Exemple #1
0
        public static void Parse(GameProtocolListener listener, Byte[] packet)
        {
            BinaryReader rdr = new BinaryReader(new MemoryStream(packet));
            OPCODE opcode = (OPCODE)rdr.ReadByte();
            switch (opcode)
            {
                case OPCODE.REQUEST_INTRO:
                    int uuidLength = rdr.ReadInt32();
                    byte[] uuidBytes = rdr.ReadBytes(uuidLength);
                    Guid uuid = new Guid(uuidBytes);
                    String ipStr = rdr.ReadString();
                    IPAddress ip = IPAddress.Parse(ipStr);
                    int socketNum = rdr.ReadInt32();
                    listener.ManagerIntroRequest(uuid, ip, socketNum);
                    break;
                case OPCODE.INTRO:

                    break;
            }
        }