예제 #1
0
class PacketManager():
    def __init__(self, _core):
        self.core = _core

        self.packet = Packet(self)

        self.opcodeMethods = {}

    def start(self):
        self.opcodeMethods = {MSG_NONE: self.BlankMSG}

    def handlePacket(self, _opcode, _data, _client):
        self.opcodeMethods[_opcode](_data, _client)

    ## Commands ##

    # Recv
    def BlankMSG(self, _data, _client):
        print(_data, _client)

    # Send
    def registerClient(self, _data, _client):
        pkt = self.packet.writeRegisterPacket(_data)
        self.core.tcp.sendPacket(pkt, _client)
예제 #2
0
class PacketManager:
    def __init__(self, _core):
        self.core = _core

        self.packet = Packet(self)

        self.opcodeMethods = {}

    def start(self):
        self.opcodeMethods = {MSG_NONE: self.BlankMSG}

    def handlePacket(self, _opcode, _data, _client):
        self.opcodeMethods[_opcode](_data, _client)

    ## Commands ##

    # Recv
    def BlankMSG(self, _data, _client):
        print(_data, _client)

    # Send
    def registerClient(self, _data, _client):
        pkt = self.packet.writeRegisterPacket(_data)
        self.core.tcp.sendPacket(pkt, _client)
예제 #3
0
    def __init__(self, _core):
        self.core = _core

        self.packet = Packet(self)

        self.opcodeMethods = {}
예제 #4
0
    def __init__(self, _core):
        self.core = _core

        self.packet = Packet(self)

        self.opcodeMethods = {}