Esempio n. 1
0
        private void ReceiveSendCustomHouse(IRecvPacket packet)
        {
            CustomHousePacket p = (CustomHousePacket)packet;

            IO.CustomHousingData.UpdateCustomHouseData(p.HouseSerial, p.RevisionHash, p.PlaneCount, p.Planes);

            Multi multi = EntityManager.GetObject <Multi>(p.HouseSerial, false);

            if (multi.CustomHouseRevision != p.RevisionHash)
            {
                IO.CustomHouse house = IO.CustomHousingData.GetCustomHouseData(p.HouseSerial);
                multi.AddCustomHousingTiles(house);
            }
        }
Esempio n. 2
0
        private void ReceiveGeneralInfo(IRecvPacket packet)
        {
            // Documented here: http://docs.polserver.com/packets/index.php?Packet=0xBF
            GeneralInfoPacket p = (GeneralInfoPacket)packet;

            switch (p.Subcommand)
            {
            case 0x04:     // Close generic gump
                announce_UnhandledPacket(packet, "subcommand " + p.Subcommand);
                break;

            case 0x06:     // party system
                announce_UnhandledPacket(packet, "subcommand " + p.Subcommand);
                break;

            case 0x08:     // set map
                World.MapIndex = p.MapID;
                break;

            case 0x14:     // return context menu
                parseContextMenu(p.ContextMenu);
                break;

            case 0x18:     // Enable map-diff (files) / number of maps
                // as of 6.0.0.0, this only tells us the number of maps.
                World.MapCount = p.MapCount;
                break;

            case 0x19:     // Extended stats
                if (p.Serial != EngineVars.PlayerSerial)
                {
                    Tracer.Warn("Extended Stats packet (0xBF subcommand 0x19) received for a mobile not our own.");
                }
                else
                {
                    PlayerState.StatLocks.StrengthLock     = p.StatisticLocks.Strength;
                    PlayerState.StatLocks.DexterityLock    = p.StatisticLocks.Dexterity;
                    PlayerState.StatLocks.IntelligenceLock = p.StatisticLocks.Intelligence;
                }
                break;

            case 0x1D:     // House revision state
                if (IO.CustomHousingData.IsHashCurrent(p.HouseRevisionState.Serial, p.HouseRevisionState.Hash))
                {
                    Multi multi = EntityManager.GetObject <Multi>(p.HouseRevisionState.Serial, false);
                    if (multi == null)
                    {
                        // received a house revision for a multi that does not exist.
                    }
                    else
                    {
                        if (multi.CustomHouseRevision != p.HouseRevisionState.Hash)
                        {
                            IO.CustomHouse house = IO.CustomHousingData.GetCustomHouseData(p.HouseRevisionState.Serial);
                            multi.AddCustomHousingTiles(house);
                        }
                    }
                }
                else
                {
                    m_Network.Send(new RequestCustomHousePacket(p.HouseRevisionState.Serial));
                }
                break;

            case 0x21:     // (AOS) Ability icon confirm.
                // no data, just (bf 00 05 21)
                // ???
                break;

            default:
                announce_UnhandledPacket(packet, "subcommand " + p.Subcommand);
                break;
            }
        }