Add arena failed to join text

This commit is contained in:
Bluzume 2021-11-08 01:52:58 -05:00
parent 7815ffc630
commit b4350d1e5f
5 changed files with 21 additions and 7 deletions

@ -1 +1 @@
Subproject commit 2135825724166a05c6fabc0d7550f712aeada1fc
Subproject commit 98f385f4adaad7e58d265001f4f109869ca9c88d

View file

@ -348,7 +348,15 @@ namespace HISP.Game
public void AddEntry(User user, HorseInstance horse)
{
if (Entries.Length + 1 > Slots)
return;
{
if (Entries.Length + 1 > Slots)
{
byte[] enterFailed = PacketBuilder.CreateChat(Messages.ArenaFullErrorMessage, PacketBuilder.CHAT_BOTTOM_RIGHT);
user.LoggedinClient.SendPacket(enterFailed);
GameServer.UpdateArea(user.LoggedinClient);
return;
}
}
if(!UserHasHorseEntered(user))
{
@ -357,6 +365,14 @@ namespace HISP.Game
arenaEntry.EnteredHorse = horse;
entries.Add(arenaEntry);
}
user.TakeMoney(EntryCost);
byte[] enteredIntoCompetition = PacketBuilder.CreateChat(Messages.ArenaEnteredInto, PacketBuilder.CHAT_BOTTOM_RIGHT);
user.LoggedinClient.SendPacket(enteredIntoCompetition);
GameServer.UpdateAreaForAll(user.X, user.Y, true);
return;
}
public static Arena GetArenaUserEnteredIn(User user)

View file

@ -333,6 +333,7 @@ namespace HISP.Game
public static string ArenaNeedsVet;
public static string ArenaEventNameFormat;
public static string ArenaFullErrorMessage;
public static string ArenaCurrentlyTakingEntriesFormat;
public static string ArenaCompetitionInProgress;

View file

@ -1255,6 +1255,8 @@ namespace HISP.Server
Messages.ArenaYouHaveHorseEntered = gameData.messages.meta.arena.horse_entered;
Messages.ArenaCompetitionFull = gameData.messages.meta.arena.competiton_full;
Messages.ArenaFullErrorMessage = gameData.messages.meta.arena.arena_join_fail_full;
Messages.ArenaEnterHorseFormat = gameData.messages.meta.arena.enter_horse;
Messages.ArenaCurrentCompetitors = gameData.messages.meta.arena.current_competitors;
Messages.ArenaCompetingHorseFormat = gameData.messages.meta.arena.competing_horses;

View file

@ -1678,11 +1678,6 @@ namespace HISP.Server
if (sender.LoggedinUser.Money >= arena.EntryCost)
{
arena.AddEntry(sender.LoggedinUser, horseInstance);
sender.LoggedinUser.TakeMoney(arena.EntryCost);
byte[] enteredIntoCompetition = PacketBuilder.CreateChat(Messages.ArenaEnteredInto, PacketBuilder.CHAT_BOTTOM_RIGHT);
sender.SendPacket(enteredIntoCompetition);
UpdateAreaForAll(sender.LoggedinUser.X, sender.LoggedinUser.Y, true);
break;
}
else