All Downloads are FREE. Search and download functionalities are using the official Maven repository.

python.ProtocolManagerTemplate.py Maven / Gradle / Ivy

Go to download

zfoo protocol is binary serialization framework for Java/C++/js/ts/C#/Go/Lua/GDScript/Python

The newest version!
${protocol_imports}

protocols = {}
protocolIdMap = {}

${protocol_manager_registrations}

def getProtocol(protocolId):
	return protocols[protocolId]

def write(buffer, packet):
	protocolId = protocolIdMap[type(packet)]
	buffer.writeShort(protocolId)
	protocol = protocols[protocolId]
	protocol.write(buffer, packet)

def read(buffer):
	protocolId = buffer.readShort()
	protocol = protocols[protocolId]
	packet = protocol.read(buffer)
	return packet




© 2015 - 2024 Weber Informatics LLC | Privacy Policy