Ejemplo n.º 1
0
        private void OnUpdate(Client client, UpdatePacket packet)
        {
            client.PlayerData.Parse(packet);
            if (client.State.ACCID != null) return;

            State resolvedState = null;

            foreach (State cstate in _proxy.States.Values)
                if (cstate.ACCID == client.PlayerData.AccountId)
                    resolvedState = cstate;

            if (resolvedState == null)
                client.State.ACCID = client.PlayerData.AccountId;
            else
            {
                foreach (var pair in client.State.States)
                    resolvedState[pair.Key] = pair.Value;
                foreach (var pair in client.State.States)
                    resolvedState[pair.Key] = pair.Value;

                client.State = resolvedState;
            }
        }
Ejemplo n.º 2
0
 private void OnUpdatePacket(Client client, UpdatePacket packet)
 {
     if (this.m_currentGameId != -5) return;
     for (int i = 0; i < packet.NewObjs.Length; i++)
         if (packet.NewObjs[i].ObjectType == 0x0504) //Vault Chest
             UpdateStats(ref packet.NewObjs[i].Status);
 }
Ejemplo n.º 3
0
 public void Update(UpdatePacket update)
 {
     foreach (Entity e in update.NewObjs)
         if (!EnemyTypeMap.ContainsKey(e.Status.ObjectId))
             EnemyTypeMap[e.Status.ObjectId] = (ushort)e.ObjectType;
     foreach (Tile t in update.Tiles)
         TileTypes[t.X, t.Y] = t.Type;
 }
Ejemplo n.º 4
0
        public void Update(UpdatePacket packet)
        {
            foreach (var t in (packet as UpdatePacket).Tiles)
            {
                this.Tiles[t.X][t.Y] = t.Type;
                currentTiles++;
                if (TilesAdded != null)
                    TilesAdded(this.currentTiles);
            }

            foreach (var tileDef in (packet as UpdatePacket).NewObjs)
            {
                var def = (Entity)tileDef.Clone();

                if (isMapObject(def.ObjectType))
                {
                    def.Status.Position.X -= 0.5F;
                    def.Status.Position.Y -= 0.5F;

                    int _x = (int)def.Status.Position.X;
                    int _y = (int)def.Status.Position.Y;
                    Array.Resize(ref this.Entities[_x][_y], this.Entities[_x][_y].Length + 1);
                    Entity[] arr = this.Entities[_x][_y];

                    arr[arr.Length - 1] = def;
                }
            }
        }
Ejemplo n.º 5
0
 public void Parse(UpdatePacket update)
 {
     foreach (Entity newObject in update.NewObjs)
         if (newObject.Status.ObjectId == OwnerObjectId)
         {
             Class = (Classes)newObject.ObjectType;
             foreach (StatData data in newObject.Status.Data)
                 Parse(data.Id, data.IntValue, data.StringValue);
         }
 }