27 lines
746 B
Python
27 lines
746 B
Python
from Messages.Messages import IMessage
|
|
|
|
## A network id message invites another participant to a site
|
|
#
|
|
## This can be sent in response to a ClientMsg
|
|
class NetworkIdMsg(IMessage):
|
|
id = 0xA1
|
|
length = 2
|
|
|
|
|
|
## Create a network id message
|
|
def __init__(self, data = None):
|
|
pass
|
|
|
|
## Serialize the message into the given buffer
|
|
#
|
|
## @param buffer_ref A reference to the buffer to use. This should be a list with the buffer as its first and only element
|
|
## @returns the length of the message
|
|
def Serialize(self, buffer_ref):
|
|
buffer: bytearray = buffer_ref[0]
|
|
buffer[0:NetworkIdMsg.length] = [
|
|
NetworkIdMsg.id,
|
|
0
|
|
]
|
|
return NetworkIdMsg.length
|
|
|