public string Write()
 {
     var wtr = new NWriter(new MemoryStream());
     wtr.WriteUTF(accId);
     wtr.WriteUTF(giftCode);
     return Convert.ToBase64String(((MemoryStream)wtr.BaseStream).ToArray());
 }
 protected override void Write(Client client, NWriter wtr)
 {
     wtr.Write(Tier);
     wtr.WriteUTF(Goal);
     wtr.WriteUTF(Description);
     wtr.WriteUTF(Image);
 }
Ejemplo n.º 3
0
 protected override void Write(NWriter wtr)
 {
     wtr.WriteUTF(Title);
     wtr.WriteUTF(Message);
     wtr.WriteUTF(Button1);
     wtr.WriteUTF(Button2);
     wtr.WriteUTF(Type);
 }
Ejemplo n.º 4
0
 protected override void Write(ClientProcessor psr, NWriter wtr)
 {
     wtr.WriteUTF(Title);
     wtr.WriteUTF(Message);
     wtr.WriteUTF(Button1);
     wtr.WriteUTF(Button2);
     wtr.WriteUTF(Type);
 }
 protected override void Write(Client psr, NWriter wtr)
 {
     wtr.WriteUTF(AccountId);
     wtr.Write(CharId);
     wtr.WriteUTF(Killer);
     wtr.Write(obf0);
     wtr.Write(obf1);
 }
Ejemplo n.º 6
0
 protected override void Write(Client client, NWriter wtr)
 {
     wtr.WriteUTF(Name);
     wtr.Write(ObjectId);
     wtr.Write(Stars);
     wtr.Write(BubbleTime);
     wtr.WriteUTF(Recipient);
     wtr.WriteUTF(Text);
     wtr.WriteUTF(CleanText);
 }
Ejemplo n.º 7
0
 protected override void Write(ClientProcessor psr, NWriter wtr)
 {
     wtr.WriteUTF(Name);
     wtr.WriteUTF(Host);
     wtr.Write(Port);
     wtr.Write(GameId);
     wtr.Write(KeyTime);
     wtr.Write((short) Key.Length);
     wtr.Write(Key);
 }
 protected override void Write(Client psr, NWriter wtr)
 {
     wtr.WriteUTF(Name);
     wtr.WriteUTF(Host);
     wtr.Write(Port);
     wtr.Write(GameId);
     wtr.Write(KeyTime);
     wtr.Write(IsFromArena);
     wtr.Write((ushort)Key.Length);
     wtr.Write(Key);
 }
 protected override void Write(Client psr, NWriter wtr)
 {
     wtr.Write(AccountListId);
     wtr.Write((ushort) AccountIds.Length);
     foreach (string i in AccountIds)
         wtr.WriteUTF(i);
     wtr.Write(LockAction);
 }
        protected override void Write(Client psr, NWriter wtr)
        {
            wtr.Write((ushort) MyItems.Length);
            foreach (TradeItem i in MyItems)
                i.Write(psr, wtr);

            wtr.WriteUTF(YourName);
            wtr.Write((ushort) YourItems.Length);
            foreach (TradeItem i in YourItems)
                i.Write(psr, wtr);
        }
Ejemplo n.º 11
0
        protected override void Write(ClientProcessor psr, NWriter wtr)
        {
            wtr.Write((short)MyItems.Length);
            foreach (var i in MyItems)
                i.Write(wtr);

            wtr.WriteUTF(YourName);
            wtr.Write((short)YourItems.Length);
            foreach (var i in YourItems)
                i.Write(wtr);
        }
Ejemplo n.º 12
0
 protected override void Write(ClientProcessor psr, NWriter wtr)
 {
     wtr.WriteUTF(Copyright);
     wtr.WriteUTF(BuildVersion);
     wtr.Write(GameId);
     wtr.WriteUTF(RSA.Instance.Encrypt(GUID));
     wtr.Write(AnotherThing);
     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);
 }
Ejemplo n.º 13
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.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);
 }
 protected override void Write(Client psr, NWriter wtr)
 {
     wtr.WriteUTF(BuildVersion);
     wtr.Write(GameId);
     wtr.Write(0);
     wtr.WriteUTF(RSA.Instance.Encrypt(GUID));
     wtr.Write(randomint1);
     wtr.WriteUTF(RSA.Instance.Encrypt(Password));
     wtr.WriteUTF(Secret);
     wtr.Write(KeyTime);
     wtr.Write((ushort)Key.Length);
     wtr.Write(Key);
     wtr.Write(MapInfo.Length);
     wtr.Write(MapInfo);
     wtr.WriteUTF(obf1);
     wtr.WriteUTF(obf2);
     wtr.WriteUTF(obf3);
     wtr.WriteUTF(obf4);
     wtr.WriteUTF(obf5);
 }
Ejemplo n.º 15
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.");
            }
        }
Ejemplo n.º 16
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);
        }
Ejemplo n.º 17
0
 protected override void Write(ClientProcessor psr, NWriter wtr)
 {
     wtr.Write(Success);
     wtr.WriteUTF(Message);
 }
Ejemplo n.º 18
0
 protected override void Write(Client client, NWriter wtr)
 {
     wtr.WriteUTF(Name);
 }
Ejemplo n.º 19
0
 protected override void Write(NWriter wtr)
 {
     wtr.Write(ErrorId);
     wtr.WriteUTF(Message);
 }
 protected override void Write(NWriter wtr)
 {
     wtr.WriteUTF(Music);
 }
Ejemplo n.º 21
0
 protected override void Write(Client psr, NWriter wtr)
 {
     wtr.WriteUTF(Name);
     wtr.Write(Value);
 }
 protected override void Write(Client psr, NWriter wtr)
 {
     wtr.WriteUTF(Text);
 }
Ejemplo n.º 23
0
 protected override void Write(ClientProcessor psr, NWriter wtr)
 {
     wtr.Write(Result);
     wtr.WriteUTF(Message);
 }
Ejemplo n.º 24
0
 protected override void Write(Client psr, NWriter wtr)
 {
     wtr.Write((int)Result);
     wtr.WriteUTF(Message);
 }
Ejemplo n.º 25
0
 protected override void Write(Client psr, NWriter wtr)
 {
     wtr.WriteUTF(ClaimKey);
     wtr.WriteUTF(Type);
 }
 protected override void Write(ClientProcessor psr, NWriter wtr)
 {
     wtr.WriteUTF(Name);
 }
Ejemplo n.º 27
0
 protected override void Write(Client psr, NWriter wtr)
 {
     wtr.Write(ErrorId);
     wtr.WriteUTF(ErrorDescription);
 }
 protected override void Write(NWriter wtr)
 {
     wtr.Write(Success);
     wtr.WriteUTF(Action);
     wtr.WriteUTF(Input);
 }
Ejemplo n.º 29
0
 protected override void Write(NWriter wtr)
 {
     wtr.WriteUTF(Name);
     wtr.Write(Bytes.Length);
     wtr.Write(Bytes);
 }
Ejemplo n.º 30
0
 protected override void Write(NWriter wtr)
 {
     wtr.WriteUTF(Text);
 }
Ejemplo n.º 31
0
 protected override void Write(NWriter wtr)
 {
     wtr.WriteUTF(Name);
     wtr.Write(GuildRank);
 }
Ejemplo n.º 32
0
 protected override void Write(Client client, NWriter wtr)
 {
     wtr.Write(Result);
     wtr.WriteUTF(Message);
 }
Ejemplo n.º 33
0
 protected override void Write(NWriter wtr)
 {
     wtr.WriteUTF(Name);
 }
Ejemplo n.º 34
0
 protected override void Write(NWriter wtr)
 {
     wtr.WriteUTF(Music);
 }
Ejemplo n.º 35
0
 protected override void Write(Client psr, NWriter wtr)
 {
     wtr.WriteUTF(Title);
     wtr.WriteUTF(Description);
 }
Ejemplo n.º 36
0
 protected override void Write(ClientProcessor psr, NWriter wtr)
 {
     wtr.Write(Type);
     wtr.WriteUTF(Text);
 }
Ejemplo n.º 37
0
 protected override void Write(NWriter wtr)
 {
     wtr.WriteUTF(Message);
 }
 protected override void Write(Client psr, NWriter wtr)
 {
     wtr.WriteUTF(Name);
     wtr.Write(GuildRank);
 }
Ejemplo n.º 39
0
 protected override void Write(Client psr, NWriter wtr)
 {
     wtr.Write(Success);
     wtr.WriteUTF(ErrorText);
 }
 protected override void Write(Client psr, NWriter wtr)
 {
     wtr.Write(ErrorId);
     wtr.WriteUTF(ErrorDescription);
 }
Ejemplo n.º 41
0
 protected override void Write(NWriter wtr)
 {
     wtr.WriteUTF(Name);
 }
 protected override void Write(Client client, NWriter wtr)
 {
     wtr.WriteUTF(PetName);
     wtr.Write(PetSkinId);
 }
Ejemplo n.º 43
0
 protected override void Write(ClientProcessor psr, NWriter wtr)
 {
     wtr.Write(Type);
     wtr.WriteUTF(Text);
 }
Ejemplo n.º 44
0
 protected override void Write(NWriter wtr)
 {
     wtr.Write(AccountId);
     wtr.Write(CharId);
     wtr.WriteUTF(Killer);
 }
 protected override void Write(ClientProcessor psr, NWriter wtr)
 {
     wtr.Write(ObjectId);
     wtr.WriteUTF(Text);
     Color.Write(wtr);
 }
 protected override void Write(Client psr, NWriter wtr)
 {
     wtr.WriteUTF(Name);
     wtr.Write(Value);
 }
Ejemplo n.º 47
0
 protected override void Write(Client psr, NWriter wtr)
 {
     wtr.Write(ObjectId);
     wtr.WriteUTF(Text);
     Color.Write(psr, wtr);
 }
Ejemplo n.º 48
0
 protected override void Write(NWriter wtr)
 {
     wtr.Write(Success);
     wtr.WriteUTF(ResultMessage);
 }
Ejemplo n.º 49
0
 protected override void Write(NWriter wtr)
 {
     wtr.Write(ItemType);
     wtr.WriteUTF(ItemData.GetJson());
 }
 protected override void Write(ClientProcessor psr, NWriter wtr)
 {
     wtr.WriteUTF(Name);
 }
Ejemplo n.º 51
0
 protected override void Write(Client client, NWriter wtr)
 {
     wtr.WriteUTF(PetName);
     wtr.Write(PetSkinId);
 }
Ejemplo n.º 52
0
 protected override void Write(NWriter wtr)
 {
     wtr.Write(AccountId);
     wtr.Write(CharId);
     wtr.WriteUTF(Killer);
 }
Ejemplo n.º 53
0
 protected override void Write(NWriter wtr)
 {
     wtr.Write(Code);
     wtr.WriteUTF(Description);
 }