diff --git a/DataCollection/gamedata.json b/DataCollection/gamedata.json index 11624b4..6a56e51 100755 --- a/DataCollection/gamedata.json +++ b/DataCollection/gamedata.json @@ -233,8 +233,10 @@ "starting_game":"Starting up two player game with %PLAYERNAME%!", "game_closed":"Game Closed.", - "game_closed_other":"Game Closed by Other Player." - + "game_closed_other":"Game Closed by Other Player.", + + "recorded_win":"Recorded a WIN at %GAMETITLE%.", + "recorded_loss":"Recorded a LOSS at %GAMETITLE%." }, "player_interaction":{ "players_here":"Players Here:", diff --git a/Horse Isle Server/HorseIsleServer/Game/Messages.cs b/Horse Isle Server/HorseIsleServer/Game/Messages.cs index a2e7edd..733486c 100755 --- a/Horse Isle Server/HorseIsleServer/Game/Messages.cs +++ b/Horse Isle Server/HorseIsleServer/Game/Messages.cs @@ -51,6 +51,9 @@ namespace HISP.Game public static string TwoPlayerGameClosed; public static string TwoPlayerGameClosedOther; + public static string TwoPlayerRecordedWinFormat; + public static string TwoPlayerRecordedLossFormat; + // Trading public static string TradeWithPlayerFormat; @@ -1054,7 +1057,14 @@ namespace HISP.Game // Click public static string NothingInterestingHere; - + public static string Format2PlayerRecordLose(string gameTitle) + { + return TwoPlayerRecordedLossFormat.Replace("%GAMETITLE%", gameTitle); + } + public static string Format2PlayerRecordWin(string gameTitle) + { + return TwoPlayerRecordedWinFormat.Replace("%GAMETITLE%", gameTitle); + } public static string Format2PlayerStartingGame(string playerName) { return TwoPlayerStartingUpGameFormat.Replace("%PLAYERNAME%", playerName); @@ -2178,7 +2188,7 @@ namespace HISP.Game } public static string FormatWinlooseListEntry(int ranking, int wins, int loose, string username, int totalplays) { - return GameWinLooseHeaderFormat.Replace("%RANKING%", ranking.ToString("N0", CultureInfo.InvariantCulture)).Replace("%WINS%", wins.ToString("N0", CultureInfo.InvariantCulture)).Replace("%LOSES%", loose.ToString("N0", CultureInfo.InvariantCulture)).Replace("%USERNAME%", username).Replace("%TOTALPLAYS%", totalplays.ToString("N0", CultureInfo.InvariantCulture)); + return GameWinLooseFormat.Replace("%RANKING%", ranking.ToString("N0", CultureInfo.InvariantCulture)).Replace("%WINS%", wins.ToString("N0", CultureInfo.InvariantCulture)).Replace("%LOSES%", loose.ToString("N0", CultureInfo.InvariantCulture)).Replace("%USERNAME%", username).Replace("%TOTALPLAYS%", totalplays.ToString("N0", CultureInfo.InvariantCulture)); } public static string FormatHighscoreHeader(string gameName) { diff --git a/Horse Isle Server/HorseIsleServer/Server/GameDataJson.cs b/Horse Isle Server/HorseIsleServer/Server/GameDataJson.cs index cdc74b8..de552bb 100755 --- a/Horse Isle Server/HorseIsleServer/Server/GameDataJson.cs +++ b/Horse Isle Server/HorseIsleServer/Server/GameDataJson.cs @@ -891,6 +891,9 @@ namespace HISP.Server Messages.TwoPlayerGameClosed = gameData.messages.meta.two_player.game_closed; Messages.TwoPlayerGameClosedOther = gameData.messages.meta.two_player.game_closed_other; + Messages.TwoPlayerRecordedWinFormat = gameData.messages.meta.two_player.recorded_win; + Messages.TwoPlayerRecordedLossFormat = gameData.messages.meta.two_player.recorded_loss; + // Trade Messages.TradeWithPlayerFormat = gameData.messages.meta.player_interaction.trade.trading_with; @@ -1794,6 +1797,9 @@ namespace HISP.Server Messages.GameHighScoreHeaderFormat = gameData.messages.meta.highscores.game_highscore_header; Messages.GameHighScoreFormat = gameData.messages.meta.highscores.game_highscore_format; + Messages.GameWinLooseHeaderFormat = gameData.messages.meta.highscores.game_winloose_header; + Messages.GameWinLooseFormat = gameData.messages.meta.highscores.game_winloose_format; + Messages.GameBestTimeHeaderFormat = gameData.messages.meta.highscores.game_besttime_header; Messages.GameBestTimeFormat = gameData.messages.meta.highscores.game_besttime_format; diff --git a/Horse Isle Server/HorseIsleServer/Server/GameServer.cs b/Horse Isle Server/HorseIsleServer/Server/GameServer.cs index e17d205..6421ef3 100755 --- a/Horse Isle Server/HorseIsleServer/Server/GameServer.cs +++ b/Horse Isle Server/HorseIsleServer/Server/GameServer.cs @@ -4047,10 +4047,14 @@ namespace HISP.Server if(pmethod == PacketBuilder.WINLOOSE_WIN) { sender.LoggedinUser.Highscores.Win(gameTitle); + byte[] winMsg = PacketBuilder.CreateChat(Messages.Format2PlayerRecordWin(gameTitle), PacketBuilder.CHAT_BOTTOM_RIGHT); + sender.SendPacket(winMsg); } else if(pmethod == PacketBuilder.WINLOOSE_LOOSE) { sender.LoggedinUser.Highscores.Loose(gameTitle); + byte[] looseMsg = PacketBuilder.CreateChat(Messages.Format2PlayerRecordLose(gameTitle), PacketBuilder.CHAT_BOTTOM_RIGHT); + sender.SendPacket(looseMsg); } if (sender.LoggedinUser.Highscores.HighscoreList.Length >= 30)