Fix arena bugs

This commit is contained in:
SilicaAndPina 2021-02-18 13:18:06 +13:00
parent 7feec48b0c
commit ebb5b0edf8
2 changed files with 14 additions and 5 deletions

View file

@ -185,13 +185,19 @@ namespace HISP.Game
entry.EnteredUser.LoggedinClient.SendPacket(startingUpEventPacket);
}
arenaTimeout = new Timer(new TimerCallback(ArenaTimedOut), null, Timeout * 60 * 1000, Timeout * 60 * 1000);
arenaTimeout = new Timer(new TimerCallback(arenaTimedOut), null, Timeout * 60 * 1000, Timeout * 60 * 1000);
foreach(World.SpecialTile tile in World.SpecialTiles)
updateWaitingPlayers();
}
private void updateWaitingPlayers()
{
foreach (World.SpecialTile tile in World.SpecialTiles)
{
if (tile.Code == null)
continue;
if(tile.Code.StartsWith("ARENA-"))
if (tile.Code.StartsWith("ARENA-"))
{
string arenaId = tile.Code.Split('-')[1];
int id = int.Parse(arenaId);
@ -201,7 +207,7 @@ namespace HISP.Game
}
}
private void ArenaTimedOut(object state)
private void arenaTimedOut(object state)
{
End();
}
@ -286,6 +292,7 @@ namespace HISP.Game
}
reset();
updateWaitingPlayers();
}
public void DeleteEntry(User user)
{

View file

@ -5965,6 +5965,9 @@ namespace HISP.Server
return;
}
forClient.LoggedinUser.MetaPriority = false;
string LocationStr = "";
if (!World.InSpecialTile(forClient.LoggedinUser.X, forClient.LoggedinUser.Y))
{
@ -5986,7 +5989,6 @@ namespace HISP.Server
byte[] AreaMessage = PacketBuilder.CreateMetaPacket(LocationStr);
forClient.SendPacket(AreaMessage);
forClient.LoggedinUser.MetaPriority = false;
}
public static void UpdateStats(GameClient client)