libretro.drivers.netpacket.driver¶
Protocol definition for the network packet interface used by netplay-aware cores.
See also
libretro.api.netpacketThe matching
ctypestypes and callback definitions.
Classes
Protocol for drivers that route the netplay packet callbacks of netplay-aware cores. |
- class NetpacketDriver[source]¶
Bases:
ProtocolProtocol for drivers that route the netplay packet callbacks of netplay-aware cores.
See also
libretro.api.netpacketThe matching
ctypestypes and callback definitions.
- abstract property callback¶
The netplay packet callbacks registered by the core, if any.
Set by the core via
RETRO_ENVIRONMENT_SET_NETPACKET_INTERFACE.Noneif the core has not registered netplay support.- Parameters:
value – The callbacks struct registered by the core.
- Raises:
UnsupportedEnvCall – If this driver does not support netplay packets.
See also
retro_netpacket_callbackThe C struct registered by the core that contains these callbacks.
- abstract property version¶
The netplay protocol version advertised by the core, if any.
Used by the netplay layer to reject incompatible peers.
- Parameters:
value – The protocol version string to advertise.
- Raises:
UnsupportedEnvCall – If this driver does not advertise a protocol version.
- abstractmethod start(client_id)[source]¶
Notify the core that a netplay session has begun for
client_id.
- abstractmethod receive(buf, client_id)[source]¶
Deliver a received netplay packet to the core.
- Parameters:
buf (
memoryview) – The packet payload.client_id (
ClientID(int)) – The client that sent the packet.
- Return type:
- abstractmethod stop(client_id)[source]¶
Notify the core that the netplay session for
client_idhas ended.
- abstractmethod poll()[source]¶
Drain pending netplay packets and forward them to the core.
- Return type:
- abstractmethod connected(client_id)[source]¶
Notify the core that
client_idhas connected to the netplay session.
- __init__(*args, **kwargs)¶
- classmethod __new__(*args, **kwargs)¶