Skip to content

Commit 74c59a2

Browse files
committed
[COTLMP] Move the player name setting to Mod settings
The player name is a local setting bound to the mod client and not to the server. The server only fetches the player name from the client, so......
1 parent 1584bde commit 74c59a2

2 files changed

Lines changed: 14 additions & 14 deletions

File tree

COTLMP/Plugin.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -106,35 +106,35 @@ private void Awake()
106106
/* Retrieve the setting data from the setting object */
107107
ToggleMod = COTLMP.Api.Configuration.GetSettingData<bool>(SettingData);
108108

109-
/* Initialize the "Game Mode" setting */
110-
SettingData = COTLMP.Api.Configuration.CreateSetting(CONFIGURATION_SECTION.ServerSettings,
111-
"Game Mode",
112-
"The game mode for the multiplayer server. Possible values are: Standard, Boss Fight, Deathmatch, Zombies!",
113-
"Standard");
109+
/* Initialize the "Player Name" setting */
110+
SettingData = COTLMP.Api.Configuration.CreateSetting(CONFIGURATION_SECTION.ModSettings,
111+
"Player Name",
112+
"The name of the player in-game",
113+
"The Player");
114114
if (SettingData == null)
115115
{
116-
Logger.LogFatal("Failed to set default or load the \"Game Mode\" setting!");
116+
Logger.LogFatal("Failed to set default or load the \"Player Name\" setting!");
117117
HarmonyInstance.UnpatchSelf();
118118
return;
119119
}
120120

121121
/* Retrieve the setting data from the setting object */
122-
GameMode = COTLMP.Api.Configuration.GetSettingData<string>(SettingData);
122+
PlayerName = COTLMP.Api.Configuration.GetSettingData<string>(SettingData);
123123

124-
/* Initialize the "Player Name" setting */
124+
/* Initialize the "Game Mode" setting */
125125
SettingData = COTLMP.Api.Configuration.CreateSetting(CONFIGURATION_SECTION.ServerSettings,
126-
"Player Name",
127-
"The name of the player in-game",
128-
"The Player");
126+
"Game Mode",
127+
"The game mode for the multiplayer server. Possible values are: Standard, Boss Fight, Deathmatch, Zombies!",
128+
"Standard");
129129
if (SettingData == null)
130130
{
131-
Logger.LogFatal("Failed to set default or load the \"Player Name\" setting!");
131+
Logger.LogFatal("Failed to set default or load the \"Game Mode\" setting!");
132132
HarmonyInstance.UnpatchSelf();
133133
return;
134134
}
135135

136136
/* Retrieve the setting data from the setting object */
137-
PlayerName = COTLMP.Api.Configuration.GetSettingData<string>(SettingData);
137+
GameMode = COTLMP.Api.Configuration.GetSettingData<string>(SettingData);
138138

139139
/* Initialize the "Server Name" setting */
140140
SettingData = COTLMP.Api.Configuration.CreateSetting(CONFIGURATION_SECTION.ServerSettings,

COTLMP/Ui/ServersList.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ private static void PlayerNameSubmitHandler()
389389
ConfigEntry<string> SettingEntry;
390390

391391
/* Retrieve the section name for the setting */
392-
Section = COTLMP.Api.Configuration.GetSectionName(CONFIGURATION_SECTION.ServerSettings);
392+
Section = COTLMP.Api.Configuration.GetSectionName(CONFIGURATION_SECTION.ModSettings);
393393

394394
/* Get the Player Name setting */
395395
Definition = new ConfigDefinition(Section, "Player Name");

0 commit comments

Comments
 (0)