Exemple #1
0
        private async Task HandleTCPRT(NetSocket netSocket)
        {
            Guid guid = Guid.NewGuid();

            tempUsersDick.Add(guid.ToString(), netSocket);
            // TODO Complete TCP Connection
            WritePacket wr = new WritePacket(NetManager.RT_PACKET_OPCODE0);

            wr.AddString(guid.ToString());
            netSocket.Send(wr);
            await Task.FromResult(true);
        }
Exemple #2
0
        private static void HandleTCPReceive(SocketReceiveEventArgs args)
        {
            switch (args.ReadPacket.OpCode)
            {
            case 0:
                string guid = args.ReadPacket.ReadString();
                Console.WriteLine("Received : {0}", guid);
                WritePacket wr = new WritePacket(0);
                wr.AddString(guid);
                wr.AddString(matchId);
                wr.AddString(Id);
                tcpSocket.Send(wr);
                break;

            case 1:
                Console.WriteLine("You Can Play Now");
                break;

            default:
                break;
            }
        }