From 1c94b706f76412d4ba17a17d19e35b91c17be8be Mon Sep 17 00:00:00 2001 From: CNWMakesCode <110615551+CNWMakesCode@users.noreply.github.com> Date: Wed, 10 Jul 2024 18:57:36 -0400 Subject: [PATCH 1/2] Update RunVoteSubHandler.cs Change wording to: 1. Be more human sounding 2. Be clearer 3. Consistency between DispatchMessageToAllClients and JPCCLog.Normal text fields --- JPCC/Commands/SubHandler/RunVoteSubHandler.cs | 62 +++++++++---------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/JPCC/Commands/SubHandler/RunVoteSubHandler.cs b/JPCC/Commands/SubHandler/RunVoteSubHandler.cs index 4d31f0e0..ce8d9eef 100644 --- a/JPCC/Commands/SubHandler/RunVoteSubHandler.cs +++ b/JPCC/Commands/SubHandler/RunVoteSubHandler.cs @@ -39,29 +39,29 @@ public void StartVoteHandler(string[] command, ClientStructure client) // What type of vote do we have? if (_votingTracker.VoteType == "resetworld") { - _messageDispatcherHandler.DispatchMessageToAllClients($"Player {client.PlayerName} has initiated a vote on resetting the world!{Environment.NewLine}Please use the commands /yes or /no to cast your vote!"); - JPCCLog.Normal($"{client.PlayerName} has started a vote on resetting the world!"); + _messageDispatcherHandler.DispatchMessageToAllClients($"{client.PlayerName} started a vote on resetting the world!{Environment.NewLine}Use the commands /yes or /no to cast your vote."); + JPCCLog.Normal($"{client.PlayerName} started a vote on resetting the world"); VoteTimerAsync(command, client); } if (_votingTracker.VoteType == "kickplayer") { - _messageDispatcherHandler.DispatchMessageToAllClients($"Player {client.PlayerName} has initiated a vote on kicking {command[1]} from the server!{Environment.NewLine}Please use the commands /yes or /no to cast your vote!"); - JPCCLog.Normal($"{client.PlayerName} has started a vote on kicking {command[1]} from the server!"); + _messageDispatcherHandler.DispatchMessageToAllClients($"{client.PlayerName} started a vote on kicking {command[1]} from the server!{Environment.NewLine}Use the commands /yes or /no to cast your vote."); + JPCCLog.Normal($"{client.PlayerName} started a vote on kicking {command[1]} from the server"); VoteTimerAsync(command, client); } if (_votingTracker.VoteType == "banplayer") { - _messageDispatcherHandler.DispatchMessageToAllClients($"Player {client.PlayerName} has initiated a vote on banning {command[1]} from the server!{Environment.NewLine}Please use the commands /yes or /no to cast your vote!"); - JPCCLog.Normal($"{client.PlayerName} has started a vote on banning {command[1]} from the server!"); + _messageDispatcherHandler.DispatchMessageToAllClients($"{client.PlayerName} started a vote on banning {command[1]} from the server!{Environment.NewLine}Use the commands /yes or /no to cast your vote."); + JPCCLog.Normal($"{client.PlayerName} started a vote on banning {command[1]} from the server"); VoteTimerAsync(command, client); } } else { - _messageDispatcherHandler.DispatchMessageToSingleClient("Vote is currently running, can not start a new one!", client); + _messageDispatcherHandler.DispatchMessageToSingleClient("Vote is currently running, cannot start a new one.", client); } } @@ -70,17 +70,17 @@ private async Task VoteTimerAsync(string[] command, ClientStructure client) { await Task.Delay(5000); - _messageDispatcherHandler.DispatchMessageToAllClients("30 seconds left to vote!"); + _messageDispatcherHandler.DispatchMessageToAllClients("30 seconds left to vote."); JPCCLog.Debug($"Vote has 30 seconds left!"); await Task.Delay(10000); - _messageDispatcherHandler.DispatchMessageToAllClients("20 seconds left to vote!"); + _messageDispatcherHandler.DispatchMessageToAllClients("20 seconds left to vote."); JPCCLog.Debug($"Vote has 20 seconds left!"); await Task.Delay(10000); - _messageDispatcherHandler.DispatchMessageToAllClients("10 seconds left to vote!"); + _messageDispatcherHandler.DispatchMessageToAllClients("10 seconds left to vote."); JPCCLog.Debug($"Vote has 10 seconds left!"); await Task.Delay(10000); @@ -131,12 +131,12 @@ private async Task HandleResetVoteResults(string[] command, ClientStructure clie // Do we have enough votes? if (_votingTracker.VotedYesCount > _votingTracker.VotedNoCount) { - _messageDispatcherHandler.DispatchMessageToAllClients($"Vote has succeeded! Enough players voted yes. World will be reset."); - JPCCLog.Normal($"Vote has succeeded! Enough players voted yes. World will be reset."); + _messageDispatcherHandler.DispatchMessageToAllClients($"Enough players voted yes, so the world willll be reset."); + JPCCLog.Normal($"Enough players voted yes, the world will be reset."); await Task.Delay(4000); - _messageDispatcherHandler.DispatchMessageToAllClients($"Server will reboot in 5 seconds..."); - JPCCLog.Normal($"Server will reboot in 5 seconds..."); + _messageDispatcherHandler.DispatchMessageToAllClients($"Server will restart in 5 seconds..."); + JPCCLog.Normal($"Server will restart in 5 seconds..."); await Task.Delay(5000); @@ -149,8 +149,8 @@ private async Task HandleResetVoteResults(string[] command, ClientStructure clie } else { - _messageDispatcherHandler.DispatchMessageToAllClients($"Vote has failed! Not enough players voted yes. World will not be reset."); - JPCCLog.Normal($"Vote has failed! Not enough players voted yes. World will not be reset."); + _messageDispatcherHandler.DispatchMessageToAllClients($"Not enough players voted yes, so the world won't be reset."); + JPCCLog.Normal($"Not enough players voted yes, so the world won't be reset."); } } @@ -162,8 +162,8 @@ private async Task HandleKickVoteResults(string[] command, ClientStructure clien // Do we have enough votes, and do we have more yes than no votes? if ((_votingTracker.VotedYesCount > _votingTracker.VotedNoCount) && _votingTracker.PlayersWhoVoted.Count() >= 1) { - _messageDispatcherHandler.DispatchMessageToAllClients($"Vote has succeeded! Enough players voted yes. Player {command[1]} will be kicked."); - JPCCLog.Normal($"Vote has succeeded! Enough players voted yes. Player {command[1]} will be kicked."); + _messageDispatcherHandler.DispatchMessageToAllClients($"Enough players voted yes, so {command[1]} will be kicked."); + JPCCLog.Normal($"Enough players voted yes, so {command[1]} will be kicked."); await Task.Delay(2000); @@ -176,19 +176,19 @@ private async Task HandleKickVoteResults(string[] command, ClientStructure clien var kickMessage = "The server voted to kick you out!"; CommandHandler.Commands["kick"].Func($"{player.PlayerName} {kickMessage}"); - _messageDispatcherHandler.DispatchMessageToAllClients($"{command[1]} has been kicked!"); - JPCCLog.Normal($"{command[1]} has been kicked!"); + _messageDispatcherHandler.DispatchMessageToAllClients($"{command[1]} has been kicked."); + JPCCLog.Normal($"{command[1]} has been kicked."); } else { - _messageDispatcherHandler.DispatchMessageToAllClients($"Error, {command[1]} could not be kicked as they are no longer on the server!"); - JPCCLog.Normal($"Error, {command[1]} could not be kicked as they are no longer on the server!"); + _messageDispatcherHandler.DispatchMessageToAllClients($"Can't kick {command[1]}, since they left the server."); + JPCCLog.Normal($"Can't kick {command[1]}, since they left the server."); } } else { - _messageDispatcherHandler.DispatchMessageToAllClients($"Vote has failed! Not enough players voted yes. Player {command[1]} will not be kicked."); - JPCCLog.Normal($"Vote has failed! Not enough players voted yes. Player {command[1]} will not be kicked."); + _messageDispatcherHandler.DispatchMessageToAllClients($"Not enough players voted yes, so {command[1]} will not be kicked."); + JPCCLog.Normal($"Not enough players voted yes, so {command[1]} will not be kicked."); } } @@ -200,8 +200,8 @@ private async Task HandleBanVoteResults(string[] command, ClientStructure client // Do we have enough votes and more yes than no votes? if ((_votingTracker.VotedYesCount > _votingTracker.VotedNoCount) && _votingTracker.PlayersWhoVoted.Count() >= 2) { - _messageDispatcherHandler.DispatchMessageToAllClients($"Vote has succeeded! Enough players voted yes. Player {command[1]} will be banned."); - JPCCLog.Normal($"Vote has succeeded! Enough players voted yes. Player {command[1]} will be banned."); + _messageDispatcherHandler.DispatchMessageToAllClients($"Enough players voted yes, so {command[1]} will be banned."); + JPCCLog.Normal($"Enough players voted yes, so {command[1]} will be banned."); await Task.Delay(2000); @@ -215,19 +215,19 @@ private async Task HandleBanVoteResults(string[] command, ClientStructure client var banMessage = "The server voted to ban you!"; CommandHandler.Commands["ban"].Func($"{player.PlayerName} {banMessage}"); - _messageDispatcherHandler.DispatchMessageToAllClients($"{command[1]} has been banned!"); + _messageDispatcherHandler.DispatchMessageToAllClients($"{command[1]} has been struck by the Ban Hammer!"); JPCCLog.Normal($"{command[1]} has been banned!"); } else { - _messageDispatcherHandler.DispatchMessageToAllClients($"Error, {command[1]} could not be banned as they are no longer on the server!"); - JPCCLog.Normal($"Error, {command[1]} could not be banned as they are no longer on the server!"); + _messageDispatcherHandler.DispatchMessageToAllClients($"Can't ban {command[1]}, since they left the server."); + JPCCLog.Normal($"Can't ban {command[1]}, since they left the server."); } } else { - _messageDispatcherHandler.DispatchMessageToAllClients($"Vote has failed! Not enough players voted yes. Player {command[1]} will not be banned."); - JPCCLog.Normal($"Vote has failed! Not enough players voted yes. Player {command[1]} will not be banned."); + _messageDispatcherHandler.DispatchMessageToAllClients($"Not enough players voted yes, so command[1]} won't be banned."); + JPCCLog.Normal($"Not enough players voted yes, so command[1]} won't be banned."); } } } From f5f18d9fe6f5983ab8241eb9c05497515db474e9 Mon Sep 17 00:00:00 2001 From: CNWMakesCode <110615551+CNWMakesCode@users.noreply.github.com> Date: Wed, 10 Jul 2024 19:02:26 -0400 Subject: [PATCH 2/2] Update RunVoteSubHandler.cs Fixed a typo, added some more consistency --- JPCC/Commands/SubHandler/RunVoteSubHandler.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/JPCC/Commands/SubHandler/RunVoteSubHandler.cs b/JPCC/Commands/SubHandler/RunVoteSubHandler.cs index ce8d9eef..ce51d7f1 100644 --- a/JPCC/Commands/SubHandler/RunVoteSubHandler.cs +++ b/JPCC/Commands/SubHandler/RunVoteSubHandler.cs @@ -40,21 +40,21 @@ public void StartVoteHandler(string[] command, ClientStructure client) if (_votingTracker.VoteType == "resetworld") { _messageDispatcherHandler.DispatchMessageToAllClients($"{client.PlayerName} started a vote on resetting the world!{Environment.NewLine}Use the commands /yes or /no to cast your vote."); - JPCCLog.Normal($"{client.PlayerName} started a vote on resetting the world"); + JPCCLog.Normal($"{client.PlayerName} started a vote on resetting the world."); VoteTimerAsync(command, client); } if (_votingTracker.VoteType == "kickplayer") { _messageDispatcherHandler.DispatchMessageToAllClients($"{client.PlayerName} started a vote on kicking {command[1]} from the server!{Environment.NewLine}Use the commands /yes or /no to cast your vote."); - JPCCLog.Normal($"{client.PlayerName} started a vote on kicking {command[1]} from the server"); + JPCCLog.Normal($"{client.PlayerName} started a vote on kicking {command[1]} from the server."); VoteTimerAsync(command, client); } if (_votingTracker.VoteType == "banplayer") { _messageDispatcherHandler.DispatchMessageToAllClients($"{client.PlayerName} started a vote on banning {command[1]} from the server!{Environment.NewLine}Use the commands /yes or /no to cast your vote."); - JPCCLog.Normal($"{client.PlayerName} started a vote on banning {command[1]} from the server"); + JPCCLog.Normal($"{client.PlayerName} started a vote on banning {command[1]} from the server."); VoteTimerAsync(command, client); } @@ -131,7 +131,7 @@ private async Task HandleResetVoteResults(string[] command, ClientStructure clie // Do we have enough votes? if (_votingTracker.VotedYesCount > _votingTracker.VotedNoCount) { - _messageDispatcherHandler.DispatchMessageToAllClients($"Enough players voted yes, so the world willll be reset."); + _messageDispatcherHandler.DispatchMessageToAllClients($"Enough players voted yes, so the world will be reset."); JPCCLog.Normal($"Enough players voted yes, the world will be reset."); await Task.Delay(4000);