protected override void Write(ClientProcessor psr, NWriter wtr)
        {
            wtr.Write(Width);
            wtr.Write(Height);
            wtr.WriteUTF(Name);
            wtr.Write(Seed);
            wtr.Write(Background);
            wtr.Write(AllowTeleport);
            wtr.Write(ShowDisplays);
            if (SendMusic)
            {
                wtr.WriteUTF(Music);
            }

            wtr.Write((short)ClientXML.Length);
            foreach (string i in ClientXML)
            {
                wtr.Write32UTF(i);
            }

            wtr.Write((short)ExtraXML.Length);
            foreach (string i in ExtraXML)
            {
                wtr.Write32UTF(i);
            }
        }
示例#2
0
        protected override void Write(NWriter wtr)
        {
            wtr.Write(Width);
            wtr.Write(Height);
            wtr.WriteUTF(Name);
            wtr.WriteUTF(ClientWorldName);
            wtr.Write(Seed);
            wtr.Write(Background);
            wtr.Write(Difficulty);
            wtr.Write(AllowTeleport);
            wtr.Write(ShowDisplays);

            wtr.Write((ushort)ClientXML.Length);
            foreach (string i in ClientXML)
            {
                wtr.Write32UTF(i);
            }

            wtr.Write((ushort)ExtraXML.Length);
            foreach (string i in ExtraXML)
            {
                wtr.Write32UTF(i);
            }

            wtr.WriteUTF(Music);
        }
示例#3
0
        public void BroadcastMessage(string msg, string username, string password)
        {
            var s = new MemoryStream();
            using (var w = new NWriter(s))
            {
                w.Write32UTF(username);
                w.Write32UTF(password);
                w.Write32UTF(msg);
            }

            SendPacket(new Packet(PacketID.Broadcast, s.ToArray()));
        }
示例#4
0
文件: Client.cs 项目: Bog624s/LR-v1
        public void BroadcastMessage(string msg, string username, string password)
        {
            MemoryStream s = new MemoryStream();

            using (var w = new NWriter(s))
            {
                w.Write32UTF(username);
                w.Write32UTF(password);
                w.Write32UTF(msg);
            }

            SendPacket(new Packet(PacketID.Broadcast, s.ToArray()));
        }
示例#5
0
        protected override void Write(NWriter wtr)
        {
            wtr.Write(Width);
            wtr.Write(Height);
            wtr.WriteUTF(Name);
            wtr.Write(Seed);
            wtr.Write(Background);
            wtr.Write(AllowTeleport);
            wtr.Write(ShowDisplays);

            wtr.Write((short)ClientXML.Length);
            foreach (var i in ClientXML)
                wtr.Write32UTF(i);

            wtr.Write((short)ExtraXML.Length);
            foreach (var i in ExtraXML)
                wtr.Write32UTF(i);
        }
示例#6
0
 protected override void Write(NWriter wtr)
 {
     wtr.WriteUTF(BuildVersion);
     wtr.Write(GameId);
     wtr.WriteUTF(RSA.Instance.Encrypt(GUID));
     wtr.WriteUTF(RSA.Instance.Encrypt(Password));
     wtr.Write(KeyTime);
     wtr.Write((short)Key.Length);
     wtr.Write(Key);
     wtr.Write32UTF(MapJSON);
 }
示例#7
0
        protected override void Write(NWriter wtr)
        {
            wtr.Write(Width);
            wtr.Write(Height);
            wtr.WriteUTF(Name);
            wtr.Write(Seed);
            wtr.Write(Background);
            wtr.Write(AllowTeleport);
            wtr.Write(ShowDisplays);

            wtr.Write((short)ClientXML.Length);
            foreach (var i in ClientXML)
            {
                wtr.Write32UTF(i);
            }

            wtr.Write((short)ExtraXML.Length);
            foreach (var i in ExtraXML)
            {
                wtr.Write32UTF(i);
            }
        }
示例#8
0
文件: Client.cs 项目: Bog624s/LR-v1
        public void TestHello(string username, string password)
        {
            MemoryStream s = new MemoryStream();

            using (var wtr = new NWriter(s))
            {
                wtr.WriteUTF("0.5.2");
                wtr.Write(-2);
                wtr.WriteUTF(RSA.Instance.Encrypt(username));
                wtr.WriteUTF(RSA.Instance.Encrypt(password));
                wtr.WriteUTF(RSA.Instance.Encrypt(""));
                wtr.Write(0);
                wtr.Write(1);
                wtr.Write(new byte[] { 1 });
                wtr.Write32UTF("");
                wtr.WriteUTF("");
                wtr.WriteUTF("");
                wtr.WriteUTF("");
                wtr.WriteUTF("");
            }

            SendPacket(new Packet(PacketID.Hello, s.ToArray()));
            Console.WriteLine("Receiving MapInfo packet...");
            var pkt = ReceivePacket(PacketID.MapInfo);

            using (var rdr = new NReader(new MemoryStream(pkt.body)))
            {
                var Width         = rdr.ReadInt32();
                var Height        = rdr.ReadInt32();
                var Name          = rdr.ReadUTF();
                var Seed          = rdr.ReadUInt32();
                var Background    = rdr.ReadInt32();
                var AllowTeleport = rdr.ReadBoolean();
                var ShowDisplays  = rdr.ReadBoolean();

                var ClientXML = new string[rdr.ReadInt16()];
                for (int i = 0; i < ClientXML.Length; i++)
                {
                    ClientXML[i] = rdr.Read32UTF();
                }

                var ExtraXML = new string[rdr.ReadInt16()];
                for (int i = 0; i < ExtraXML.Length; i++)
                {
                    ExtraXML[i] = rdr.Read32UTF();
                }

                Console.WriteLine("Grabbed info from " + Name + ".");
                Console.WriteLine("There are " + ExtraXML.Length.ToString() + " XML files.");
            }
        }
示例#9
0
        private byte[] ZipGameXmls()
        {
            using (var ms = new MemoryStream())
            {
                var wtr = new NWriter(ms);
                wtr.Write(GameXmls.Count);
                foreach (var xml in GameXmls)
                {
                    wtr.Write32UTF(xml);
                }

                return(Utils.Deflate(ms.ToArray()));
            }
        }
示例#10
0
 protected override void Write(ClientProcessor psr, NWriter wtr)
 {
     wtr.WriteUTF(BuildVersion);
     wtr.Write(GameId);
     wtr.WriteUTF(RSA.Instance.Encrypt(GUID));
     wtr.WriteUTF(RSA.Instance.Encrypt(Password));
     wtr.WriteUTF(RSA.Instance.Encrypt(Secret));
     wtr.Write(KeyTime);
     wtr.Write((short)Key.Length);
     wtr.Write(Key);
     wtr.Write32UTF(MapInfo);
     wtr.WriteUTF(__Rw);
     wtr.WriteUTF(__06U);
     wtr.WriteUTF(__LK);
     wtr.WriteUTF(PlayPlatform);
 }
示例#11
0
 protected override void Write(ClientProcessor psr, NWriter wtr)
 {
     wtr.WriteUTF(BuildVersion);
     wtr.Write(GameId);
     wtr.WriteUTF(RSA.Instance.Encrypt(GUID));
     wtr.WriteUTF(RSA.Instance.Encrypt(Password));
     wtr.WriteUTF(RSA.Instance.Encrypt(Secret));
     wtr.Write(KeyTime);
     wtr.Write((short)Key.Length);
     wtr.Write(Key);
     wtr.Write32UTF(MapInfo);
     wtr.WriteUTF(__Rw);
     wtr.WriteUTF(__06U);
     wtr.WriteUTF(__LK);
     wtr.WriteUTF(PlayPlatform);
 }
示例#12
0
        public void TestHello(string username, string password)
        {
            var s = new MemoryStream();
            using (var wtr = new NWriter(s))
            {
                wtr.WriteUTF("0.5.2");
                wtr.Write(-2);
                wtr.WriteUTF(RSA.Instance.Encrypt(username));
                wtr.WriteUTF(RSA.Instance.Encrypt(password));
                wtr.WriteUTF(RSA.Instance.Encrypt(""));
                wtr.Write(0);
                wtr.Write(1);
                wtr.Write(new byte[] { 1 });
                wtr.Write32UTF("");
                wtr.WriteUTF("");
                wtr.WriteUTF("");
                wtr.WriteUTF("");
                wtr.WriteUTF("");
            }

            SendPacket(new Packet(PacketID.Hello, s.ToArray()));
            Console.WriteLine("Receiving MapInfo packet...");
            var pkt = ReceivePacket(PacketID.MapInfo);

            using (var rdr = new NReader(new MemoryStream(pkt.body)))
            {
                var Width = rdr.ReadInt32();
                var Height = rdr.ReadInt32();
                var Name = rdr.ReadUTF();
                var Seed = rdr.ReadUInt32();
                var Background = rdr.ReadInt32();
                var AllowTeleport = rdr.ReadBoolean();
                var ShowDisplays = rdr.ReadBoolean();

                var ClientXML = new string[rdr.ReadInt16()];
                for (var i = 0; i < ClientXML.Length; i++)
                    ClientXML[i] = rdr.Read32UTF();

                var ExtraXML = new string[rdr.ReadInt16()];
                for (var i = 0; i < ExtraXML.Length; i++)
                    ExtraXML[i] = rdr.Read32UTF();

                Console.WriteLine("Grabbed info from " + Name + ".");
                Console.WriteLine("There are " + ExtraXML.Length + " XML files.");
            }
        }
示例#13
0
 protected override void Write(ClientProcessor psr, NWriter wtr)
 {
     wtr.Write32UTF(Text);
 }
 protected override void Write(Client client, NWriter wtr)
 {
     wtr.Write32UTF(Text);
 }
示例#15
0
 protected override void Write(ClientProcessor psr, NWriter wtr)
 {
     wtr.Write32UTF(Text);
 }
 protected override void Write(ClientProcessor psr, NWriter wtr)
 {
     wtr.Write32UTF(Username);
     wtr.Write32UTF(Password);
     wtr.Write32UTF(Message);
 }
 protected override void Write(ClientProcessor psr, NWriter wtr)
 {
     wtr.Write32UTF(Username);
     wtr.Write32UTF(Password);
     wtr.Write32UTF(Message);
 }
示例#18
0
 protected override void Write(Client client, NWriter wtr)
 {
     wtr.Write32UTF(Text);
 }
        protected override void Write(Client psr, NWriter wtr)
        {
            wtr.Write(Width);
            wtr.Write(Height);
            wtr.WriteUTF(Name);
            wtr.WriteUTF(ClientWorldName);
            wtr.Write(Seed);
            wtr.Write(Background);
            wtr.Write(Difficulty);
            wtr.Write(AllowTeleport);
            wtr.Write(ShowDisplays);

            wtr.Write((ushort) ClientXML.Length);
            foreach (string i in ClientXML)
                wtr.Write32UTF(i);

            wtr.Write((ushort) ExtraXML.Length);
            foreach (string i in ExtraXML)
                wtr.Write32UTF(i);
        }