Example #1
0
 public static void Packet_SaveHouses(int index, ref byte[] data)
 {
     checked
     {
         if (!(S_Players.GetPlayerAccess(index) < 2))
         {
             ByteStream buffer = new ByteStream(data);
             int        Count  = buffer.ReadInt32();
             if (Count > 0)
             {
                 int num = Count;
                 for (int z = 1; z <= num; z++)
                 {
                     int i = buffer.ReadInt32();
                     S_Housing.HouseConfig[i].ConfigName   = (buffer.ReadString().Trim());
                     S_Housing.HouseConfig[i].BaseMap      = buffer.ReadInt32();
                     S_Housing.HouseConfig[i].X            = buffer.ReadInt32();
                     S_Housing.HouseConfig[i].Y            = buffer.ReadInt32();
                     S_Housing.HouseConfig[i].Price        = buffer.ReadInt32();
                     S_Housing.HouseConfig[i].MaxFurniture = buffer.ReadInt32();
                     S_Housing.SaveHouse(i);
                     int playersOnline = S_GameLogic.GetPlayersOnline();
                     for (int x = 1; x <= playersOnline; x++)
                     {
                         if (S_NetworkConfig.IsPlaying(x) && modTypes.Player[x].Character[(int)modTypes.TempPlayer[x].CurChar].InHouse == i)
                         {
                             S_Housing.SendFurnitureToHouse(i);
                         }
                     }
                 }
             }
             buffer.Dispose();
         }
     }
 }
Example #2
0
        public static void SaveHouses()
        {
            int max_HOUSES = S_Housing.MAX_HOUSES;

            checked
            {
                for (int i = 1; i <= max_HOUSES; i++)
                {
                    S_Housing.SaveHouse(i);
                }
            }
        }