示例#1
0
        private static void OnC2SAskPrepareWorld(ByteBuffer buffer, Connection connection)
        {
            var    packet    = new ConnectionPackets.C2SAskWorldPrepare();
            string ip        = "127.0.0.1";
            int    port      = 8002;
            var    outPacket = new ConnectionPackets.S2CAnsWorldPrepare(ip, port);

            outPacket.Send(connection);
        }
示例#2
0
        internal static void OnC2SAskPrepareWorld(ByteBuffer buffer, Connection connection)
        {
            var packet = new ConnectionPackets.C2SAskWorldPrepare();
            var client = ClientManager.GetClient(connection);

            string ip = "127.0.0.1";

            int port      = client.GetChannel().worldPort;
            var outPacket = new ConnectionPackets.S2CAnsWorldPrepare(ip, port);

            outPacket.Send(connection);
        }
示例#3
0
        internal static void OnC2SAskEnterCharSelect(ByteBuffer buffer, Connection connection)
        {
            var incPacket = new ConnectionPackets.C2SAskEnterCharSelect(buffer, connection);

            if (DatabaseFunctions.getAllCharacters(incPacket.userID, out var characterInfos))
            {
                int userId = ClientManager.GetClient(connection).UserId;
                var bytes  = new List <byte>();
                bytes.AddRange(ByteUtils.ToByteArray(userId, 4));
                bytes.Add((byte)characterInfos.Count);
                bytes.Add((byte)characterInfos.Count);
                foreach (var info in characterInfos)
                {
                    bytes.AddRange(info.ToBytes());
                }
                var outPacket = new ConnectionPackets.S2CAnsEnterCharSelect(bytes.ToArray());
                outPacket.Send(connection);

                var outPacket2 = new ConnectionPackets.S2CAnsWorldPrepare("127.0.0.1", 8010);
                outPacket2.Send(connection);
            }
        }