2276
2276
message2.Append( tOutput( "$network_redirect", redirect->GetConnectionName(), (int)redirect->GetPort() ) );
2279
//Display reason for disconnect locally in console.
2281
con << message2 << "\n";
2284
2279
return tConsole::Message( title, message2, timeout );
6080
6075
static tConfItemFunc sg_KillAllPlayers_conf("KILL_ALL", &sg_KillAllPlayers);
6081
6076
static tAccessLevelSetter sg_KillAllPlayers_confLevel( sg_KillAllPlayers_conf, tAccessLevel_Moderator );
6083
// File name for default configuration file. Default is settings_visual, seemed to contain more
6084
// tConfItem's than the others.
6085
// However, this can be changed to the servers settings file and used by admins.
6086
static tString sn_defaultSettingFile("settings_visual.cfg");
6087
static tConfItem<tString> sn_defaultSettingFileConf(
6088
"SET_DEFAULT_CONFIG_FILE", sn_defaultSettingFile);
6090
void sg_setDefaultValue(std::istream& s)
6092
// String user passes with commands.
6093
tString passedString;
6094
passedString.ReadLine(s);
6096
// Convert to lowercase.
6097
tToLower(passedString);
6099
if (passedString.Filter() == "")
6105
tCurrentAccessLevel level(tAccessLevel_Owner, true);
6108
tArray<tString> passedCommands = passedString.Split(" ");
6109
if (passedCommands.Len() > 0)
6111
for (int i = 0; i < passedCommands.Len(); i++)
6113
bool foundCommand = false;
6114
tTextFileRecorder defaultConfigs(tDirectories::Config(), sn_defaultSettingFile);
6115
while (!defaultConfigs.EndOfFile())
6117
std::stringstream line(defaultConfigs.GetLine());
6122
line >> command >> value;
6126
if ((command) == passedCommands[i])
6128
// Using LoadAll(line) was not working here, so I guess I will build a tString
6129
// and cast the value.
6130
params = command << " " << value;
6131
std::stringstream commandToLoad(static_cast<char const*>(params));
6132
tConfItemBase::LoadAll(commandToLoad);
6133
foundCommand = true;
6141
"$config_command_not_found", passedCommands[i], sn_defaultSettingFile);
6147
static tConfItemFunc sg_setDefaultValueConf("SET_DEFAULT", &sg_setDefaultValue);
6149
6078
static void sg_CustomMessage(std::istream &s)