Fix quest issues, and metaprority not being priority.

This commit is contained in:
SilicaAndPina 2021-02-05 18:47:45 +13:00
parent 76f3d7d731
commit c9c81d721e
5 changed files with 668 additions and 669 deletions

File diff suppressed because it is too large Load diff

View file

@ -40,7 +40,7 @@ namespace HISP.Game.Items
public static DroppedItem[] GetItemsAt(int x, int y) public static DroppedItem[] GetItemsAt(int x, int y)
{ {
DroppedItem[] droppedItems = droppedItemsList.ToArray(); DroppedItem[] droppedItems = droppedItemsList.ToArray();
List<DroppedItem> items = new List<DroppedItem>(); List<DroppedItem> items = new List<DroppedItem>();
for(int i = 0; i < droppedItems.Length; i++) for(int i = 0; i < droppedItems.Length; i++)
@ -64,7 +64,7 @@ namespace HISP.Game.Items
public static void Update() public static void Update()
{ {
DespawnItems(); DespawnItems();
GenerateItems(); GenerateItems(false);
} }
public static void RemoveDroppedItem(DroppedItem item) public static void RemoveDroppedItem(DroppedItem item)
{ {
@ -135,7 +135,7 @@ namespace HISP.Game.Items
droppedItemsList.Add(droppedItem); droppedItemsList.Add(droppedItem);
Database.AddDroppedItem(droppedItem); Database.AddDroppedItem(droppedItem);
} }
public static void GenerateItems() public static void GenerateItems(bool randomizeDespawnTime)
{ {
Logger.InfoPrint("Generating items, (this may take awhile on a fresh database!)"); Logger.InfoPrint("Generating items, (this may take awhile on a fresh database!)");
@ -148,8 +148,9 @@ namespace HISP.Game.Items
{ {
count++; count++;
int despawnTimer = 1500;
int despawnTimer = GameServer.RandomNumberGenerator.Next(900, 1500); if(randomizeDespawnTime)
despawnTimer = GameServer.RandomNumberGenerator.Next(900, 1500);
if (item.SpawnParamaters.SpawnInZone != null) if (item.SpawnParamaters.SpawnInZone != null)
{ {
@ -330,7 +331,7 @@ namespace HISP.Game.Items
public static void Init() public static void Init()
{ {
ReadFromDatabase(); ReadFromDatabase();
GenerateItems(); GenerateItems(true);
} }
} }

View file

@ -73,7 +73,7 @@ namespace HISP.Game
Database.SetWeather(Name, value); Database.SetWeather(Name, value);
foreach(User user in GameServer.GetUsersInIsle(this,true,true)) foreach(User user in GameServer.GetUsersInIsle(this,true,true))
{ {
GameServer.UpdateArea(user.LoggedinClient); GameServer.UpdateWeather(user.LoggedinClient);
} }
} }
} }

View file

@ -7,7 +7,7 @@ namespace HISP.Server
public class ConfigReader public class ConfigReader
{ {
public static int Port; public static int Port;
public static string BindIP; public static string BindIP = "0.0.0.0";
public static string DatabaseIP; public static string DatabaseIP;
public static string DatabaseUsername; public static string DatabaseUsername;
@ -20,11 +20,11 @@ namespace HISP.Server
public static string GameDataFile; public static string GameDataFile;
public static string CrossDomainPolicyFile; public static string CrossDomainPolicyFile;
public static bool Debug; public static bool Debug = false;
public static bool AllUsersSubbed; public static bool AllUsersSubbed = false;
public static bool BadWords; public static bool BadWords = true;
public static bool DoCorrections; public static bool DoCorrections = true;
public static bool DoNonViolations; public static bool DoNonViolations = true;
public const int MAX_STACK = 50; public const int MAX_STACK = 50;

View file

@ -4144,8 +4144,13 @@ namespace HISP.Server
return; return;
} }
byte[] WeatherUpdate = PacketBuilder.CreateWeatherUpdatePacket(forClient.LoggedinUser.GetWeatherSeen()); string lastWeather = forClient.LoggedinUser.LastSeenWeather;
forClient.SendPacket(WeatherUpdate); string weather = forClient.LoggedinUser.GetWeatherSeen();
if (lastWeather != weather)
{
byte[] WeatherUpdate = PacketBuilder.CreateWeatherUpdatePacket(weather);
forClient.SendPacket(WeatherUpdate);
}
} }
public static void UpdateWorld(GameClient forClient) public static void UpdateWorld(GameClient forClient)
{ {
@ -4194,6 +4199,7 @@ namespace HISP.Server
UpdateArea(client); UpdateArea(client);
} }
} }
public static void UpdateArea(GameClient forClient) public static void UpdateArea(GameClient forClient)
{ {
if (!forClient.LoggedIn) if (!forClient.LoggedIn)
@ -4221,14 +4227,6 @@ namespace HISP.Server
LocationStr = Meta.BuildSpecialTileInfo(forClient.LoggedinUser, specialTile); LocationStr = Meta.BuildSpecialTileInfo(forClient.LoggedinUser, specialTile);
} }
string lastWeather = forClient.LoggedinUser.LastSeenWeather;
string weather = forClient.LoggedinUser.GetWeatherSeen();
if(lastWeather != weather)
{
byte[] WeatherUpdate = PacketBuilder.CreateWeatherUpdatePacket(weather);
forClient.SendPacket(WeatherUpdate);
}
byte[] AreaMessage = PacketBuilder.CreateMetaPacket(LocationStr); byte[] AreaMessage = PacketBuilder.CreateMetaPacket(LocationStr);
forClient.SendPacket(AreaMessage); forClient.SendPacket(AreaMessage);
forClient.LoggedinUser.MetaPriority = false; forClient.LoggedinUser.MetaPriority = false;