Esempio n. 1
0
 public static Base Parse(Client client, Coob coob)
 {
     return new UpdateSector(
         client.Reader.ReadInt32(),
         client.Reader.ReadInt32(),
         client);
 }
Esempio n. 2
0
            public static Base Parse(Client client, Coob coob)
            {
                var hit = new Hit(client);

                hit.EntityId = client.Reader.ReadUInt64();
                hit.TargetId = client.Reader.ReadUInt64();
                hit.Damage   = client.Reader.ReadSingle();
                hit.Critical = client.Reader.ReadByte();
                client.Reader.ReadBytes(3);
                hit.StunDuration = client.Reader.ReadUInt32();
                hit.Something8   = client.Reader.ReadUInt32();
                hit.Position     = client.Reader.ReadQVector3();
                hit.HitDirection = client.Reader.ReadVector3();
                hit.Skill        = client.Reader.ReadByte();
                hit.HitType      = client.Reader.ReadByte();
                hit.ShowLight    = client.Reader.ReadByte();
                client.Reader.ReadBytes(1);

                coob.World.HitPackets.Add(hit);

                hit.Attacker = coob.World.Entities[hit.EntityId];
                hit.Target   = coob.World.Entities[hit.TargetId];

                return(hit);
            }
Esempio n. 3
0
 public static Base Parse(Client client, Coob coob)
 {
     return(new UpdateSector(
                client.Reader.ReadInt32(),
                client.Reader.ReadInt32(),
                client));
 }
Esempio n. 4
0
            public static Base Parse(Client client, Coob coob)
            {
                NetReader reader = client.Reader;
                var shoot = new Shoot(client);

                shoot.EntityID = reader.ReadUInt64();
                shoot.ChunkX = reader.ReadInt32();
                shoot.ChunkY = reader.ReadInt32();
                shoot.something5 = reader.ReadUInt32();
                reader.ReadBytes(4);
                shoot.Position = reader.ReadQVector3();
                shoot.something13 = reader.ReadUInt32();
                shoot.something14 = reader.ReadUInt32();
                shoot.something15 = reader.ReadUInt32();
                shoot.Velocity = reader.ReadVector3();
                shoot.something19 = reader.ReadSingle();
                shoot.something20 = reader.ReadSingle();
                shoot.something21 = reader.ReadSingle();
                shoot.something22 = reader.ReadSingle();
                shoot.something23 = reader.ReadUInt32();
                shoot.something24 = reader.ReadByte();
                reader.ReadBytes(3);
                shoot.something25 = reader.ReadUInt32();
                shoot.something26 = reader.ReadByte();
                reader.ReadBytes(3);
                shoot.something27 = reader.ReadUInt32();
                shoot.something28 = reader.ReadUInt32();

                return shoot;
            }
Esempio n. 5
0
            public static Base Parse(Client client, Coob coob)
            {
                NetReader reader = client.Reader;
                var       shoot  = new Shoot(client);

                shoot.EntityId   = reader.ReadUInt64();
                shoot.ChunkX     = reader.ReadInt32();
                shoot.ChunkY     = reader.ReadInt32();
                shoot.something5 = reader.ReadUInt32();
                reader.ReadBytes(4);
                shoot.Position    = reader.ReadQVector3();
                shoot.something13 = reader.ReadUInt32();
                shoot.something14 = reader.ReadUInt32();
                shoot.something15 = reader.ReadUInt32();
                shoot.Velocity    = reader.ReadVector3();
                shoot.something19 = reader.ReadSingle();
                shoot.something20 = reader.ReadSingle();
                shoot.something21 = reader.ReadSingle();
                shoot.something22 = reader.ReadSingle();
                shoot.something23 = reader.ReadUInt32();
                shoot.something24 = reader.ReadByte();
                reader.ReadBytes(3);
                shoot.something25 = reader.ReadUInt32();
                shoot.something26 = reader.ReadByte();
                reader.ReadBytes(3);
                shoot.something27 = reader.ReadUInt32();
                shoot.something28 = reader.ReadUInt32();
                coob.World.ShootPackets.Add(shoot);
                return(shoot);
            }
Esempio n. 6
0
            public static Base Parse(Client client, Coob coob)
            {
                int length = client.Reader.ReadInt32();
                string message = Encoding.Unicode.GetString(client.Reader.ReadBytes(length * 2));

                if (message.Length > Globals.MaxChatMessageLength)
                    message = message.Substring(0, Globals.MaxChatMessageLength);

                return new ChatMessage(message, client);
            }
Esempio n. 7
0
            public static Base Parse(Client client, Coob coob)
            {
                int    length  = client.Reader.ReadInt32();
                string message = Encoding.Unicode.GetString(client.Reader.ReadBytes(length * 2));

                if (message.Length > Globals.MaxChatMessageLength)
                {
                    message = message.Substring(0, Globals.MaxChatMessageLength);
                }

                return(new ChatMessage(message, client));
            }
Esempio n. 8
0
 public static Base Parse(Client client, Coob coob)
 {
     Item Item = new Item();
     Item.Read(client.Reader);
     return new Interact(client)
     {
         Item = Item,
         ChunkX = client.Reader.ReadInt32(),
         ChunkY = client.Reader.ReadInt32(),
         ItemIndex = client.Reader.ReadInt32(),
         Something4 = client.Reader.ReadUInt32(),
         InteractType = (InteractType)client.Reader.ReadByte(),
         Something6 = client.Reader.ReadByte(),
         Something7 = client.Reader.ReadUInt16()
     };
 }
Esempio n. 9
0
            public static Base Parse(Client client, Coob coob)
            {
                Item item = new Item();

                item.Read(client.Reader);

                return(new Interact(client)
                {
                    Item = item,
                    ChunkX = client.Reader.ReadInt32(),
                    ChunkY = client.Reader.ReadInt32(),
                    ItemIndex = client.Reader.ReadInt32(),
                    Something4 = client.Reader.ReadUInt32(),
                    InteractType = (InteractType)client.Reader.ReadByte(),
                    Something6 = client.Reader.ReadByte(),
                    Something7 = client.Reader.ReadUInt16()
                });
            }
Esempio n. 10
0
            public static Base Parse(Client client, Coob coob)
            {
                var hit = new Hit(client);

                hit.EntityID = client.Reader.ReadUInt64();
                hit.TargetID = client.Reader.ReadUInt64();
                hit.Damage = client.Reader.ReadSingle();
                hit.Critical = client.Reader.ReadByte();
                client.Reader.ReadBytes(3);
                hit.StunDuration = client.Reader.ReadUInt32();
                hit.Something8 = client.Reader.ReadUInt32();
                hit.Position = client.Reader.ReadQVector3();
                hit.HitDirection = client.Reader.ReadVector3();
                hit.Skill = client.Reader.ReadByte();
                hit.HitType = client.Reader.ReadByte();
                hit.ShowLight = client.Reader.ReadByte();
                client.Reader.ReadBytes(1);
                return hit;
            }
Esempio n. 11
0
        // TODO Fix ctor
        public Entity(Coob coob, Client owner)
        {
            Client        = owner;
            Position      = new QVector3();
            Rotation      = new Vector3();
            Velocity      = new Vector3();
            Acceleration  = new Vector3();
            ExtraVelocity = new Vector3();
            Appearance    = new Appearance();
            RayHit        = new Vector3();
            ItemData      = new Item();

            Equipment = new Item[EquipmentCount];
            for (int i = 0; i < EquipmentCount; i++)
            {
                Equipment[i] = new Item();
            }

            Skills = new uint[SkillCount];
        }
Esempio n. 12
0
            public static Base Parse(Client client, Coob coob)
            {
                int length = client.Reader.ReadInt32();

                byte[] compressedData = client.Reader.ReadBytes(length);
                byte[] maskedData = ZlibHelper.UncompressBuffer(compressedData);

                Entity entity;

                using (var ms = new MemoryStream(maskedData))
                using (var br = new BinaryReader(ms))
                {
                    ulong id = br.ReadUInt64();

                    if (id != client.ID)
                        throw new NotImplementedException();

                    if (client.Entity == null)
                    {
                        entity = new Entity();

                        client.Entity = entity;
                        entity.ID = client.ID;
                        coob.World.Entities[client.ID] = client.Entity;

                        entity.ReadByMask(br);

                        return new EntityUpdate(client.Entity, client.Entity, true, client);
                    }
                    else
                    {
                        entity = coob.World.Entities[id];

                        Entity changes = new Entity();
                        changes.ReadByMask(br);

                        return new EntityUpdate(client.Entity, changes, false, client);
                    }
                }
            }
Esempio n. 13
0
            public static Base Parse(Client client, Coob coob)
            {
                var mission = new Mission(client);

                mission.SectorX    = client.Reader.ReadUInt32();
                mission.SectorY    = client.Reader.ReadUInt32();
                mission.Something1 = client.Reader.ReadUInt32();
                mission.Something2 = client.Reader.ReadUInt32();
                mission.Something3 = client.Reader.ReadUInt32();
                mission.Something4 = client.Reader.ReadUInt32();
                mission.Something5 = client.Reader.ReadUInt32();
                mission.MonsterId  = client.Reader.ReadUInt32();
                mission.QuestLevel = client.Reader.ReadUInt32();
                mission.Something8 = client.Reader.ReadByte();
                mission.Something9 = client.Reader.ReadByte();
                client.Reader.ReadBytes(2);
                mission.Something10 = client.Reader.ReadSingle();
                mission.Something11 = client.Reader.ReadSingle();
                mission.ChunkX      = client.Reader.ReadUInt32();
                mission.ChunkY      = client.Reader.ReadUInt32();

                return(mission);
            }
Esempio n. 14
0
            public static Base Parse(Client client, Coob coob)
            {
                int length = client.Reader.ReadInt32();

                byte[] compressedData = client.Reader.ReadBytes(length);
                byte[] maskedData     = ZlibHelper.UncompressBuffer(compressedData);

                using (var ms = new MemoryStream(maskedData))
                    using (var br = new BinaryReader(ms))
                    {
                        ulong id = br.ReadUInt64();

                        if (id != client.Id)
                        {
                            throw new NotImplementedException();
                        }

                        if (client.Entity == null)
                        {
                            Entity entity = new Entity(coob, null);

                            client.Entity = entity;
                            entity.Client = client;
                            entity.ID     = client.Id;
                            coob.World.Entities[client.Id] = client.Entity;

                            entity.ReadByMask(br);

                            return(new EntityUpdate(client.Entity, client.Entity, true, client));
                        }

                        Entity changes = new Entity(coob, client);
                        changes.ReadByMask(br);

                        return(new EntityUpdate(client.Entity, changes, false, client));
                    }
            }
Esempio n. 15
0
 public static Base Parse(Client client, Coob coob)
 {
     int version = client.Reader.ReadInt32();
     return new ClientVersion(version, client);
 }
Esempio n. 16
0
 public static Base Parse(Client client, Coob coob)
 {
     return(new ClientVersion(client.Reader.ReadInt32(), client));
 }
Esempio n. 17
0
 public World(int seed, Coob coob)
 {
     Seed     = seed;
     Entities = new ConcurrentDictionary <ulong, Entity>();
     Coob     = coob;
 }
Esempio n. 18
0
 public World(int seed, Coob coob)
 {
     Seed = seed;
     Entities = new ConcurrentDictionary<ulong, Entity>();
     Coob = coob;
 }