Fix MultiRoom updating every time anyone walks ANYWHERE in the game

This commit is contained in:
Bluzume 2021-11-06 02:40:11 -04:00
parent 4ad3bd1432
commit f7930fd4d3
4 changed files with 35 additions and 16 deletions

View file

@ -84,6 +84,27 @@ namespace HISP.Game.Chat
return false;
}
}
else if(args[0].ToUpper() == "AWARD")
{
int awardId = 0;
try
{
awardId = int.Parse(args[1]);
if (args.Length >= 3)
{
findNamePartial(args[2]).Awards.AddAward(Award.GetAwardById(awardId));
}
else
{
user.Awards.AddAward(Award.GetAwardById(awardId));
}
}
catch (Exception)
{
return false;
}
}
else if (args[0].ToUpper() == "MONEY")
{
int money = 0;

View file

@ -106,8 +106,7 @@ namespace HISP.Game.Items
{
Database.DecrementDroppedItemDespawnTimer();
Database.RemoveDespawningItems(); // GO-GO-GO-GOGOGOGO GOTTA GO FAST!!!
int itmCount = droppedItemsList.Count;
for (int i = 0; i < itmCount; i++)
for (int i = 0; i < droppedItemsList.Count; i++)
{
if (droppedItemsList[i] == null) // Item removed in another thread.
continue;
@ -121,9 +120,7 @@ namespace HISP.Game.Items
Logger.DebugPrint("Despawned Item at " + droppedItemsList[i].X + ", " + droppedItemsList[i].Y);
droppedItemsList.Remove(droppedItemsList[i]);
itmCount = droppedItemsList.Count;
}
}
}

View file

@ -95,12 +95,13 @@ namespace HISP.Game
{
Logger.DebugPrint(user.Username + " Left multiroom @ " + x.ToString() + "," + y.ToString());
joinedUsers.Remove(user);
}
foreach (User joinedUser in JoinedUsers)
if (!TwoPlayer.IsPlayerInGame(joinedUser))
if (!joinedUser.ListingAuction)
GameServer.UpdateArea(joinedUser.LoggedinClient);
foreach (User joinedUser in JoinedUsers)
if (!TwoPlayer.IsPlayerInGame(joinedUser))
if (!joinedUser.ListingAuction)
GameServer.UpdateArea(joinedUser.LoggedinClient);
}
}
}

View file

@ -6446,7 +6446,7 @@ namespace HISP.Server
}
catch (FormatException)
{
Logger.ErrorPrint(sender.LoggedinUser.Username + " Sent an invalid object interaction packet.");
Logger.ErrorPrint(sender.LoggedinUser.Username + " Sent an invalid object interaction packet. " + BitConverter.ToString(packet));
return;
}
if (sender.LoggedinUser.Inventory.HasItem(randomId))
@ -6587,7 +6587,7 @@ namespace HISP.Server
}
catch (FormatException)
{
Logger.ErrorPrint(sender.LoggedinUser.Username + " Sent an invalid object interaction packet.");
Logger.ErrorPrint(sender.LoggedinUser.Username + " Sent an invalid object interaction packet. " + BitConverter.ToString(packet));
return;
}
@ -6625,7 +6625,7 @@ namespace HISP.Server
}
catch (FormatException)
{
Logger.ErrorPrint(sender.LoggedinUser.Username + " Sent an invalid object interaction packet. (drop)");
Logger.ErrorPrint(sender.LoggedinUser.Username + " Sent an invalid object interaction packet. (drop)"+BitConverter.ToString(packet));
return;
}
@ -7087,7 +7087,7 @@ namespace HISP.Server
}
catch (FormatException)
{
Logger.ErrorPrint(sender.LoggedinUser.Username + " Sent an invalid object interaction packet.");
Logger.ErrorPrint(sender.LoggedinUser.Username + " Sent an invalid object interaction packet. " + BitConverter.ToString(packet));
return;
}
@ -7122,7 +7122,7 @@ namespace HISP.Server
}
catch (FormatException)
{
Logger.ErrorPrint(sender.LoggedinUser.Username + " Sent an invalid object interaction packet.");
Logger.ErrorPrint(sender.LoggedinUser.Username + " Sent an invalid object interaction packet. " + BitConverter.ToString(packet));
return;
}
@ -7151,7 +7151,7 @@ namespace HISP.Server
}
catch (FormatException)
{
Logger.ErrorPrint(sender.LoggedinUser.Username + " Sent an invalid object interaction packet.");
Logger.ErrorPrint(sender.LoggedinUser.Username + " Sent an invalid object interaction packet. " + BitConverter.ToString(packet));
return;
}