Skip to content

Commit 192a55b

Browse files
authored
rest of strings
1 parent 0354eb3 commit 192a55b

16 files changed

+217
-46
lines changed

BackupManagement.cs

+5-3
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ public void OnRestoreCommand(CCSPlayerController? player, CommandInfo command) {
9191
HandleRestoreCommand(player, commandArg);
9292
}
9393
else {
94-
ReplyToUserCommand(player, $"Usage: !restore <round>");
94+
// ReplyToUserCommand(player, $"Usage: !restore <round>");
95+
ReplyToUserCommand(player, Localizer["matchzy.cc.usage", "!restore <round>"]);
9596
}
9697
} else {
9798
SendPlayerNotAdminMessage(player);
@@ -117,7 +118,8 @@ private void HandleRestoreCommand(CCSPlayerController? player, string commandArg
117118
}
118119
}
119120
else {
120-
ReplyToUserCommand(player, $"Usage: !restore <round>");
121+
// ReplyToUserCommand(player, $"Usage: !restore <round>");
122+
ReplyToUserCommand(player, Localizer["matchzy.cc.usage", "!restore <round>"]);
121123
}
122124
}
123125

@@ -272,4 +274,4 @@ public void CreateMatchZyRoundDataBackup()
272274
}
273275
}
274276
}
275-
}
277+
}

ConfigConvars.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,8 @@ public void MatchZyChatMessagesTimerDelay(CCSPlayerController? player, CommandIn
211211
}
212212
else
213213
{
214-
ReplyToUserCommand(player, $"Invalid value for matchzy_chat_messages_timer_delay. Please specify a valid non-negative number.");
214+
// ReplyToUserCommand(player, $"Invalid value for matchzy_chat_messages_timer_delay. Please specify a valid non-negative number.");
215+
ReplyToUserCommand(player, Localizer["matchzy.cvars.invalidvalue"]);
215216
}
216217
}
217218
} else if (command.ArgCount == 1) {
@@ -254,7 +255,8 @@ public void MatchZyMaxSavedLastGrenadesConvar(CCSPlayerController? player, Comma
254255
}
255256
else
256257
{
257-
command.ReplyToCommand("Usage: matchzy_max_saved_last_grenades <number>");
258+
// command.ReplyToCommand("Usage: matchzy_max_saved_last_grenades <number>");
259+
ReplyToUserCommand(player, Localizer["matchzy.cc.usage", $"matchzy_max_saved_last_grenades <number>"]);
258260
}
259261
}
260262
}

ConsoleCommands.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,8 @@ private void OnMapReloadCommand(CCSPlayerController? player, CommandInfo? comman
376376
Server.ExecuteCommand($"bot_kick");
377377
Server.ExecuteCommand($"changelevel \"{currentMapName}\"");
378378
} else {
379-
ReplyToUserCommand(player, "Invalid map name!");
379+
// ReplyToUserCommand(player, "Invalid map name!");
380+
ReplyToUserCommand(player, Localizer["matchzy.cc.invalidmap"]);
380381
}
381382
}
382383

@@ -529,4 +530,4 @@ public void OnVersionCommand(CCSPlayerController? player, CommandInfo? command)
529530
command.ReplyToCommand((serverVersion != null) ? $"Protocol version {serverVersion} [{serverVersion}/{serverVersion}]" : "Unable to get server version");
530531
}
531532
}
532-
}
533+
}

DamageInfo.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ private void ShowDamageInfo()
9999
int targetHP = targetController.PlayerPawn.Value.Health < 0 ? 0 : targetController.PlayerPawn.Value.Health;
100100
string targetName = targetController.PlayerName;
101101

102-
attackerController.PrintToChat($"{chatPrefix} {ChatColors.Green}To: [{damageGiven} / {hitsGiven} hits] From: [{damageTaken} / {hitsTaken} hits] - {targetName} - ({targetHP} hp){ChatColors.Default}");
103-
targetController.PrintToChat($"{chatPrefix} {ChatColors.Green}To: [{damageTaken} / {hitsTaken} hits] From: [{damageGiven} / {hitsGiven} hits] - {attackerName} - ({attackerHP} hp){ChatColors.Default}");
102+
PrintToPlayerChat(attackerController, $"{chatPrefix} {ChatColors.Green}To: [{damageGiven} / {hitsGiven} hits] From: [{damageTaken} / {hitsTaken} hits] - {targetName} - ({targetHP} hp){ChatColors.Default}");
103+
PrintToPlayerChat(targetController, $"{chatPrefix} {ChatColors.Green}To: [{damageTaken} / {hitsTaken} hits] From: [{damageGiven} / {hitsGiven} hits] - {attackerName} - ({attackerHP} hp){ChatColors.Default}");
104104
}
105105

106106
// Mark this pair as processed to avoid duplicates.

MatchManagement.cs

+18-9
Original file line numberDiff line numberDiff line change
@@ -51,23 +51,26 @@ public void LoadMatch(CCSPlayerController? player, CommandInfo command)
5151
if (player != null) return;
5252
if (isMatchSetup)
5353
{
54-
command.ReplyToCommand($"[LoadMatch] A match is already setup with id: {liveMatchId}, cannot load a new match!");
54+
// command.ReplyToCommand($"[LoadMatch] A match is already setup with id: {liveMatchId}, cannot load a new match!");
55+
ReplyToUserCommand(player, Localizer["matchzy.mm.matchisalreadysetup", liveMatchId]);
5556
Log($"[LoadMatch] A match is already setup with id: {liveMatchId}, cannot load a new match!");
5657
return;
5758
}
5859
string fileName = command.ArgString;
5960
string filePath = Path.Join(Server.GameDirectory + "/csgo", fileName);
6061
if (!File.Exists(filePath))
6162
{
62-
command.ReplyToCommand($"[LoadMatch] Provided file does not exist! Usage: matchzy_loadmatch <filename>");
63+
// command.ReplyToCommand($"[LoadMatch] Provided file does not exist! Usage: matchzy_loadmatch <filename>");
64+
ReplyToUserCommand(player, Localizer["matchzy.mm.filedoesntexist"]);
6365
Log($"[LoadMatch] Provided file does not exist! Usage: matchzy_loadmatch <filename>");
6466
return;
6567
}
6668
string jsonData = File.ReadAllText(filePath);
6769
bool success = LoadMatchFromJSON(jsonData);
6870
if (!success)
6971
{
70-
command.ReplyToCommand("Match load failed! Resetting current match");
72+
// command.ReplyToCommand("Match load failed! Resetting current match");
73+
ReplyToUserCommand(player, Localizer["matchzy.mm.matchloadfailed"]);
7174
ResetMatch();
7275
}
7376
loadedConfigFile = fileName;
@@ -86,7 +89,8 @@ public void LoadMatchFromURL(CCSPlayerController? player, CommandInfo command)
8689
if (player != null) return;
8790
if (isMatchSetup)
8891
{
89-
command.ReplyToCommand($"[LoadMatchDataCommand] A match is already setup with id: {liveMatchId}, cannot load a new match!");
92+
// command.ReplyToCommand($"[LoadMatchDataCommand] A match is already setup with id: {liveMatchId}, cannot load a new match!");
93+
ReplyToUserCommand(player, Localizer["matchzy.mm.get5matchisalreadysetup", liveMatchId]);
9094
Log($"[LoadMatchDataCommand] A match is already setup with id: {liveMatchId}, cannot load a new match!");
9195
return;
9296
}
@@ -99,7 +103,8 @@ public void LoadMatchFromURL(CCSPlayerController? player, CommandInfo command)
99103

100104
if (!IsValidUrl(url))
101105
{
102-
command.ReplyToCommand($"[LoadMatchDataCommand] Invalid URL: {url}. Please provide a valid URL to load the match!");
106+
// command.ReplyToCommand($"[LoadMatchDataCommand] Invalid URL: {url}. Please provide a valid URL to load the match!");
107+
ReplyToUserCommand(player, Localizer["matchzy.mm.invalidurl", url]);
103108
Log($"[LoadMatchDataCommand] Invalid URL: {url}. Please provide a valid URL to load the match!");
104109
return;
105110
}
@@ -120,14 +125,16 @@ public void LoadMatchFromURL(CCSPlayerController? player, CommandInfo command)
120125
bool success = LoadMatchFromJSON(jsonData);
121126
if (!success)
122127
{
123-
command.ReplyToCommand("Match load failed! Resetting current match");
128+
// command.ReplyToCommand("Match load failed! Resetting current match");
129+
ReplyToUserCommand(player, Localizer["matchzy.mm.matchloadfailed"]);
124130
ResetMatch();
125131
}
126132
loadedConfigFile = url;
127133
}
128134
else
129135
{
130-
command.ReplyToCommand($"[LoadMatchFromURL] HTTP request failed with status code: {response.StatusCode}");
136+
// command.ReplyToCommand($"[LoadMatchFromURL] HTTP request failed with status code: {response.StatusCode}");
137+
ReplyToUserCommand(player, Localizer["matchzy.mm.httprequestfailed", response.StatusCode]);
131138
Log($"[LoadMatchFromURL] HTTP request failed with status code: {response.StatusCode}");
132139
}
133140
}
@@ -487,12 +494,14 @@ public void HandleTeamNameChangeCommand(CCSPlayerController? player, string team
487494
return;
488495
}
489496
if (matchStarted) {
490-
ReplyToUserCommand(player, "Team names cannot be changed once the match is started!");
497+
// ReplyToUserCommand(player, "Team names cannot be changed once the match is started!");
498+
ReplyToUserCommand(player, Localizer["matchzy.mm.teamcannotbechanged"]);
491499
return;
492500
}
493501
teamName = RemoveSpecialCharacters(teamName.Trim());
494502
if (teamName == "") {
495-
ReplyToUserCommand(player, $"Usage: !team{teamNum} <name>");
503+
// ReplyToUserCommand(player, $"Usage: !team{teamNum} <name>");
504+
ReplyToUserCommand(player, Localizer["matchzy.cc.usage", $"!team{teamNum} <name>"]);
496505
}
497506

498507
if (teamNum == 1) {

MatchZy.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,8 @@ public override void Load(bool hotReload) {
396396
if (commandArg != "") {
397397
Server.PrintToChatAll($"{adminChatPrefix} {commandArg}");
398398
} else {
399-
ReplyToUserCommand(player, "Usage: .asay <message>");
399+
// ReplyToUserCommand(player, "Usage: .asay <message>");
400+
ReplyToUserCommand(player, Localizer["matchzy.cc.usage, $".asay <message>"]);
400401
}
401402
} else {
402403
SendPlayerNotAdminMessage(player);

PracticeMode.cs

+28-14
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ private void HandleSpawnCommand(CCSPlayerController? player, string commandArg,
173173
}
174174
else
175175
{
176-
ReplyToUserCommand(player, $"Usage: !{command} <number>");
176+
// ReplyToUserCommand(player, $"Usage: !{command} <number>");
177+
ReplyToUserCommand(player, Localizer["matchzy.cc.usage", $"!{command} <number>"]);
177178
}
178179
}
179180

@@ -289,7 +290,8 @@ private void HandleSaveNadeCommand(CCSPlayerController? player, string saveNadeN
289290
}
290291
else
291292
{
292-
ReplyToUserCommand(player, $"Usage: .savenade <name>");
293+
// ReplyToUserCommand(player, $"Usage: .savenade <name>");
294+
ReplyToUserCommand(player, Localizer["matchzy.cc.usage", $".savenade <name>"]);
293295
}
294296
}
295297

@@ -353,7 +355,8 @@ private void HandleDeleteNadeCommand(CCSPlayerController? player, string saveNad
353355
}
354356
else
355357
{
356-
ReplyToUserCommand(player, $"Usage: .delnade <name>");
358+
// ReplyToUserCommand(player, $"Usage: .delnade <name>");
359+
ReplyToUserCommand(player, Localizer["matchzy.cc.usage", $".delnade <name>"]);
357360
}
358361
}
359362

@@ -437,7 +440,8 @@ private void HandleImportNadeCommand(CCSPlayerController? player, string saveNad
437440
}
438441
else
439442
{
440-
ReplyToUserCommand(player, $"Usage: .importnade <code>");
443+
// ReplyToUserCommand(player, $"Usage: .importnade <code>");
444+
ReplyToUserCommand(player, Localizer["matchzy.cc.usage", $".importnade <code>"]);
441445
}
442446
}
443447

@@ -610,7 +614,8 @@ private void HandleLoadNadeCommand(CCSPlayerController? player, string loadNadeN
610614
}
611615
else
612616
{
613-
ReplyToUserCommand(player, $"Nade not found! Usage: .loadnade <name>");
617+
// ReplyToUserCommand(player, $"Nade not found! Usage: .loadnade <name>");
618+
ReplyToUserCommand(player, Localizer["matchzy.pm.loadnadenotfound"]);
614619
}
615620
}
616621

@@ -705,7 +710,8 @@ public void OnSpawnCommand(CCSPlayerController? player, CommandInfo command)
705710
}
706711
else
707712
{
708-
ReplyToUserCommand(player, $"Usage: !spawn <round>");
713+
// ReplyToUserCommand(player, $"Usage: !spawn <round>");
714+
ReplyToUserCommand(player, Localizer["matchzy.cc.usage", $"!spawn <round>"]);
709715
}
710716
}
711717

@@ -724,7 +730,8 @@ public void OnCtSpawnCommand(CCSPlayerController? player, CommandInfo command)
724730
}
725731
else
726732
{
727-
ReplyToUserCommand(player, $"Usage: !ctspawn <round>");
733+
// ReplyToUserCommand(player, $"Usage: !ctspawn <round>");
734+
ReplyToUserCommand(player, Localizer["matchzy.cc.usage", $"!ctspawn <round>"]);
728735
}
729736
}
730737

@@ -743,7 +750,8 @@ public void OnTSpawnCommand(CCSPlayerController? player, CommandInfo command)
743750
}
744751
else
745752
{
746-
ReplyToUserCommand(player, $"Usage: !ctspawn <round>");
753+
// ReplyToUserCommand(player, $"Usage: !ctspawn <round>");
754+
ReplyToUserCommand(player, Localizer["matchzy.cc.usage", $"!ctspawn <round>"]);
747755
}
748756
}
749757

@@ -1226,7 +1234,8 @@ public void HandleBackCommand(CCSPlayerController player, string number)
12261234
else
12271235
{
12281236
int thrownCount = lastGrenadesData.ContainsKey(userId) ? lastGrenadesData[userId].Count : 0;
1229-
ReplyToUserCommand(player, $"Usage: !back <number> (You've thrown {thrownCount} grenades till now)");
1237+
// ReplyToUserCommand(player, $"Usage: !back <number> (You've thrown {thrownCount} grenades till now)");
1238+
ReplyToUserCommand(player, Localizer["matchzy.pm.backtonumber", thrownCount]);
12301239
}
12311240
}
12321241

@@ -1238,7 +1247,8 @@ public void HandleThrowIndexCommand(CCSPlayerController player, string argString
12381247
if (string.IsNullOrEmpty(argString))
12391248
{
12401249
int thrownCount = lastGrenadesData.ContainsKey(userId) ? lastGrenadesData[userId].Count : 0;
1241-
ReplyToUserCommand(player, $"Usage: !throwindex <number> (You've thrown {thrownCount} grenades till now)");
1250+
// ReplyToUserCommand(player, $"Usage: !throwindex <number> (You've thrown {thrownCount} grenades till now)");
1251+
ReplyToUserCommand(player, Localizer["matchzy.pm.throwindextonumber", thrownCount]);
12421252
return;
12431253
}
12441254

@@ -1273,7 +1283,8 @@ public void HandleDelayCommand(CCSPlayerController player, string delay)
12731283
int userId = player.UserId.Value;
12741284
if (string.IsNullOrWhiteSpace(delay))
12751285
{
1276-
ReplyToUserCommand(player, $"Usage: !delay <delay_in_seconds>");
1286+
// ReplyToUserCommand(player, $"Usage: !delay <delay_in_seconds>");
1287+
ReplyToUserCommand(player, Localizer["matchzy.cc.usage", $"!delay <delay_in_seconds>"]);
12771288
return;
12781289
}
12791290

@@ -1387,7 +1398,8 @@ public void OnBackCommand(CCSPlayerController? player, CommandInfo command)
13871398
{
13881399
int userId = player!.UserId!.Value;
13891400
int thrownCount = lastGrenadesData.ContainsKey(userId) ? lastGrenadesData[userId].Count : 0;
1390-
ReplyToUserCommand(player, $"Usage: !back <number> (You've thrown {thrownCount} grenades till now)");
1401+
// ReplyToUserCommand(player, $"Usage: !back <number> (You've thrown {thrownCount} grenades till now)");
1402+
ReplyToUserCommand(player, Localizer["matchzy.pm.backtonumber", thrownCount]);
13911403
}
13921404
}
13931405

@@ -1404,7 +1416,8 @@ public void OnThrowIndexCommand(CCSPlayerController? player, CommandInfo command
14041416
{
14051417
int userId = player!.UserId!.Value;
14061418
int thrownCount = lastGrenadesData.ContainsKey(userId) ? lastGrenadesData[userId].Count : 0;
1407-
ReplyToUserCommand(player, $"Usage: !throwindex <number> (You've thrown {thrownCount} grenades till now)");
1419+
// ReplyToUserCommand(player, $"Usage: !throwindex <number> (You've thrown {thrownCount} grenades till now)");
1420+
ReplyToUserCommand(player, Localizer["matchzy.pm.throwindextonumber", thrownCount]);
14081421
}
14091422
}
14101423

@@ -1429,7 +1442,8 @@ public void OnDelayCommand(CCSPlayerController? player, CommandInfo command)
14291442
}
14301443
else
14311444
{
1432-
ReplyToUserCommand(player, $"Usage: !delay <delay_in_seconds>");
1445+
// ReplyToUserCommand(player, $"Usage: !delay <delay_in_seconds>");
1446+
ReplyToUserCommand(player, Localizer["matchzy.cc.usage", $"!delay <delay_in_seconds>"]);
14331447
}
14341448
}
14351449

ReadySystem.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ public void OnForceReadyCommandCommand(CCSPlayerController? player, CommandInfo?
103103

104104
if (playerCount < minReady)
105105
{
106-
ReplyToUserCommand(player, $"You must have at least {minReady} player(s) on the server to ready up.");
106+
// ReplyToUserCommand(player, $"You must have at least {minReady} player(s) on the server to ready up.");
107+
ReplyToUserCommand(player, Localizer["matchzy.rs.minreadyplayers", minReady]);
107108
return;
108109
}
109110

@@ -112,7 +113,8 @@ public void OnForceReadyCommandCommand(CCSPlayerController? player, CommandInfo?
112113
if (!playerData[key].IsValid) continue;
113114
if (playerData[key].TeamNum == player.TeamNum) {
114115
playerReadyStatus[key] = true;
115-
ReplyToUserCommand(playerData[key], $"Your team was force-readied by {player.PlayerName}");
116+
// ReplyToUserCommand(playerData[key], $"Your team was force-readied by {player.PlayerName}");
117+
ReplyToUserCommand(playerData[key], Localizer["matchzy.rs.forcereadiedby", player.PlayerName]);
116118
}
117119
}
118120

SleepMode.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ public void OnSleepCommand(CCSPlayerController? player, CommandInfo? command)
5050

5151
if (matchStarted)
5252
{
53-
ReplyToUserCommand(player, "Sleep Mode cannot be started when a match has been started!");
53+
// ReplyToUserCommand(player, "Sleep Mode cannot be started when a match has been started!");
54+
ReplyToUserCommand(player, Localizer["matchzy.sleep.sleepwhenmatchstared"]);
5455
return;
5556
}
5657
StartSleepMode();

0 commit comments

Comments
 (0)