Пример #1
0
        bool HandleMapLoading(ReceptionPacket rcvData)
        {
            AddMap(rcvData.ReadString());

            int maxCount = rcvData.ReadCount();
            for (int count = 0; count < maxCount; ++count)
            {
                DynamicWorldObject dObj = rcvData.ReadDynamicObjectMapAdd();

                if (dObj.Guid == GameSession.Instance.GetGuid())
                {
                    PlayerHdl.Instance.Init((Player)dObj);
                    PlayerHdl.Warp(CurrentMap);
                    continue;
                }

                CurrentMap.AddDynamicObject(dObj, dObj.Position.X, dObj.Position.Y);
            }

            return true;
        }
Пример #2
0
        bool HandleMapObjectAdd(ReceptionPacket rcvData)
        {
            DynamicWorldObject dObj = rcvData.ReadDynamicObjectMapAdd();
            dObj.SetMap(CurrentMap, dObj.Position.X, dObj.Position.Y);
            CurrentMap.AddDynamicObject(dObj, dObj.Position.X, dObj.Position.Y);

            Log.Cldebug(dObj.Guid, "Added oject", System.ConsoleColor.Cyan);

            return true;
        }