Beispiel #1
0
        public ClientForm()
        {
            InitializeComponent();
            UserInput.SetCueBanner("Username");
            PassInput.SetCueBanner("Password");
            PicInput.SetCueBanner("PIC");
            CharInput.SetCueBanner("Character");
            PacketInput.SetCueBanner("Enter packet to send...");
            DelayInput.SetCueBanner("Delay");
            InitializeProgress();

            client = new Client(this);
            PacketView.SetInput(PacketInput);
            RushView.SetClient(client);

            FmFunctions = new FreeMarketForm(this);

#if DEBUG
            /*Use this for testing account
            *  username.Text           = "";
            *  password.Text           = "";
            *  pic.Text                = "";
            *  character.Text          = "";
            *  world.SelectedIndex     = 0;
            *  channel.SelectedIndex   = 0;*/
#endif
            InitializeAccount();
        }
Beispiel #2
0
 public void Read(PacketInput input)
 {
     Item      = input.ReadInt32();
     SlotType  = input.ReadInt32();
     Tradeable = input.ReadBoolean();
     Included  = input.ReadBoolean();
 }
Beispiel #3
0
 public override void Read(PacketInput input)
 {
     Offer = new bool[input.ReadInt16()];
     for (int i = 0; i < Offer.Length; i++)
     {
         Offer[i] = input.ReadBoolean();
     }
 }
 public override void Read(PacketInput input)
 {
     EffectType     = input.ReadByte();
     TargetObjectId = input.ReadInt32();
     Pos1.Read(input);
     Pos2.Read(input);
     Color    = input.ReadInt32();
     Duration = input.ReadSingle();
 }
Beispiel #5
0
 public override void Read(PacketInput input)
 {
     AccountId  = input.ReadUTF();
     CharId     = input.ReadInt32();
     KilledBy   = input.ReadUTF();
     ZombieType = input.ReadInt32();
     ZombieId   = input.ReadInt32();
     IsZombie   = ZombieId != -1;
 }
Beispiel #6
0
 public override void Read(PacketInput input)
 {
     BulletId      = input.ReadByte();
     OwnerId       = input.ReadInt32();
     ContainerType = input.ReadInt32();
     (StartingPos = new WorldPosData()).Read(input);
     Angle  = input.ReadSingle();
     Damage = input.ReadInt16();
 }
Beispiel #7
0
 public override void Read(PacketInput input)
 {
     Pos.Read(input);
     Radius   = input.ReadSingle();
     Damage   = input.ReadUInt16();
     Effect   = input.ReadByte();
     Duration = input.ReadSingle();
     OrigType = input.ReadUInt16();
     Color    = input.ReadInt32();
 }
Beispiel #8
0
 public override void Read(PacketInput input)
 {
     AccountListId = input.ReadInt32();
     AccountIds    = new string[input.ReadInt16()];
     for (int i = 0; i < AccountIds.Length; i++)
     {
         AccountIds[i] = input.ReadUTF();
     }
     LockAction = input.ReadInt32();
 }
Beispiel #9
0
 public void Read(PacketInput input)
 {
     StatType = input.ReadByte();
     if (!IsStringStat())
     {
         StatValue = input.ReadInt32();
     }
     else
     {
         StringValue = input.ReadUTF();
     }
 }
 public override void Read(PacketInput input)
 {
     ClientOffer = new bool[input.ReadInt16()];
     for (short i = 0; i < ClientOffer.Length; i++)
     {
         ClientOffer[i] = input.ReadBoolean();
     }
     PartnerOffer = new bool[input.ReadInt16()];
     for (short i = 0; i < PartnerOffer.Length; i++)
     {
         PartnerOffer[i] = input.ReadBoolean();
     }
 }
Beispiel #11
0
 public override void Read(PacketInput input)
 {
     TargetId = input.ReadInt32();
     Effects  = new byte[input.ReadByte()];
     for (byte i = 0; i < Effects.Length; i++)
     {
         Effects[i] = input.ReadByte();
     }
     DamageAmount = input.ReadUInt16();
     Kill         = input.ReadBoolean();
     ArmorPierce  = input.ReadBoolean();
     BulletId     = input.ReadByte();
     ObjectId     = input.ReadInt32();
 }
Beispiel #12
0
 public override void Read(PacketInput input)
 {
     ClientItems = new TradeItem[input.ReadInt16()];
     for (int i = 0; i < ClientItems.Length; i++)
     {
         (ClientItems[i] = new TradeItem()).Read(input);
     }
     PartnerName  = input.ReadUTF();
     PartnerItems = new TradeItem[input.ReadInt16()];
     for (int i = 0; i < PartnerItems.Length; i++)
     {
         (PartnerItems[i] = new TradeItem()).Read(input);
     }
 }
Beispiel #13
0
 public override void Read(PacketInput input)
 {
     Tiles = new GroundTileData[input.ReadInt16()];
     for (int i = 0; i < Tiles.Length; i++)
     {
         (Tiles[i] = new GroundTileData()).Read(input);
     }
     NewObjects = new ObjectData[input.ReadInt16()];
     for (int i = 0; i < NewObjects.Length; i++)
     {
         (NewObjects[i] = new ObjectData()).Read(input);
     }
     Drops = new int[input.ReadInt16()];
     for (int i = 0; i < Drops.Length; i++)
     {
         Drops[i] = input.ReadInt32();
     }
 }
 public override void Read(PacketInput input)
 {
     BulletId   = input.ReadByte();
     OwnerId    = input.ReadInt32();
     BulletType = input.ReadByte();
     (StartingPos = new WorldPosData()).Read(input);
     Angle  = input.ReadSingle();
     Damage = input.ReadInt16();
     if (input.Remaining() > 0)
     {
         NumShots = input.ReadByte();
         AngleInc = input.ReadSingle();
     }
     else
     {
         NumShots = 1;
         AngleInc = 0;
     }
 }
Beispiel #15
0
        private void ProcessPacket(byte type, int size)
        {
            byte[] buffer   = new byte[size];
            int    received = 0;

            while (received < size)
            {
                int read = _socket.Receive(buffer, received, size - received, SocketFlags.None);
                if (read == 0)
                {
                    // eof
                    Disconnect();
                    return;
                }
                received += read;
            }
            _incomingEncryption.Cipher(buffer, 0);
            PacketType     packetType = (PacketType)type;
            IncomingPacket packet     = IncomingPacket.Create(packetType);

            if (packet != null && _hooks.ContainsKey(packetType))
            {
                MemoryStream ms = new MemoryStream(buffer);
                using (PacketInput pi = new PacketInput(ms))
                {
                    packet.Read(pi);
                }
                foreach (var hook in _hooks[packetType].ToArray())
                {
                    try
                    {
                        hook(packet);
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine(e);
                    }
                }
            }
        }
Beispiel #16
0
 public override void Read(PacketInput input)
 {
     Width               = input.ReadInt32();
     Height              = input.ReadInt32();
     Name                = input.ReadUTF();
     DisplayName         = input.ReadUTF();
     Seed                = input.ReadUInt32();
     Background          = input.ReadInt32();
     Difficulty          = input.ReadInt32();
     AllowPlayerTeleport = input.ReadBoolean();
     ShowDisplays        = input.ReadBoolean();
     ClientXML           = new string[input.ReadInt16()];
     for (int i = 0; i < ClientXML.Length; i++)
     {
         ClientXML[i] = input.ReadUTF32();
     }
     ExtraXML = new string[input.ReadInt16()];
     for (int i = 0; i < ExtraXML.Length; i++)
     {
         ExtraXML[i] = input.ReadUTF32();
     }
 }
 public override void Read(PacketInput input)
 {
     ObjectId = input.ReadInt32();
     CharId   = input.ReadInt32();
 }
Beispiel #18
0
 public override void Read(PacketInput input)
 {
     Result      = (TradeResult)input.ReadInt32();
     Description = input.ReadUTF();
 }
Beispiel #19
0
 public override void Read(PacketInput input)
 {
     SkinID    = input.ReadInt32();
     IsPetSkin = input.ReadInt32();
 }
Beispiel #20
0
 public override void Read(PacketInput input)
 {
     ObjectId = input.ReadInt32();
     (Pos = new WorldPosData()).Read(input);
 }