Merge branch 'develop' of github-softcoder-megaglest:MegaGlest/megaglest-source into develop
This commit is contained in:
commit
03f5455eb2
|
@ -1 +1 @@
|
||||||
Subproject commit f22554bcfa828545a8996e8f08a49c9f96848283
|
Subproject commit 0ebb6df9491841a83a872d2a95291e6ee6f17750
|
|
@ -214,7 +214,7 @@ string getAboutString1(int i) {
|
||||||
case 0: return "MegaGlest " + glestVersionString + " (" + "Shared Library " + sharedLibVersionString + ")";
|
case 0: return "MegaGlest " + glestVersionString + " (" + "Shared Library " + sharedLibVersionString + ")";
|
||||||
case 1: return GIT_Rev;
|
case 1: return GIT_Rev;
|
||||||
case 2: return "Copyright 2001-2010 The Glest Team";
|
case 2: return "Copyright 2001-2010 The Glest Team";
|
||||||
case 3: return "Copyright 2010-2015 The MegaGlest Team";
|
case 3: return "Copyright 2010-2016 The MegaGlest Team";
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
|
@ -113,6 +113,7 @@ Config::Config() {
|
||||||
fileNameParameter.first = "";
|
fileNameParameter.first = "";
|
||||||
fileNameParameter.second = "";
|
fileNameParameter.second = "";
|
||||||
custom_path_parameter = "";
|
custom_path_parameter = "";
|
||||||
|
serverTitle = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Config::tryCustomPath(std::pair<ConfigType,ConfigType> &type, std::pair<string,string> &file, string custom_path) {
|
bool Config::tryCustomPath(std::pair<ConfigType,ConfigType> &type, std::pair<string,string> &file, string custom_path) {
|
||||||
|
|
|
@ -52,6 +52,7 @@ private:
|
||||||
std::pair<string,string> fileName;
|
std::pair<string,string> fileName;
|
||||||
std::pair<bool,bool> fileLoaded;
|
std::pair<bool,bool> fileLoaded;
|
||||||
string custom_path_parameter;
|
string custom_path_parameter;
|
||||||
|
string serverTitle;
|
||||||
|
|
||||||
static map<ConfigType,Config> configList;
|
static map<ConfigType,Config> configList;
|
||||||
|
|
||||||
|
@ -118,6 +119,9 @@ public:
|
||||||
|
|
||||||
string toString();
|
string toString();
|
||||||
|
|
||||||
|
string getServerTitle() {return serverTitle;}
|
||||||
|
void setServerTitle(string name) {serverTitle=name;}
|
||||||
|
|
||||||
static string getCustomRuntimeProperty(string key) { return customRuntimeProperties[key]; }
|
static string getCustomRuntimeProperty(string key) { return customRuntimeProperties[key]; }
|
||||||
static void setCustomRuntimeProperty(string key, string value) { customRuntimeProperties[key] = value; }
|
static void setCustomRuntimeProperty(string key, string value) { customRuntimeProperties[key] = value; }
|
||||||
|
|
||||||
|
|
|
@ -4107,6 +4107,29 @@ int glestMain(int argc, char** argv) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_SERVER_TITLE]) == true) {
|
||||||
|
int foundParamIndIndex = -1;
|
||||||
|
hasCommandArgument(argc, argv,string(GAME_ARGS[GAME_ARG_SERVER_TITLE]) + string("="),&foundParamIndIndex);
|
||||||
|
if(foundParamIndIndex < 0) {
|
||||||
|
hasCommandArgument(argc, argv,string(GAME_ARGS[GAME_ARG_SERVER_TITLE]),&foundParamIndIndex);
|
||||||
|
}
|
||||||
|
string paramValue = argv[foundParamIndIndex];
|
||||||
|
vector<string> paramPartTokens;
|
||||||
|
Tokenize(paramValue,paramPartTokens,"=");
|
||||||
|
if(paramPartTokens.size() >= 2 && paramPartTokens[1].length() > 0) {
|
||||||
|
Config &config = Config::getInstance();
|
||||||
|
string serverTitle = paramPartTokens[1];
|
||||||
|
printf("Forcing serverTitle[%s]\n",serverTitle.c_str());
|
||||||
|
|
||||||
|
config.setServerTitle(serverTitle);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
printf("\nInvalid missing server title specified on commandline [%s] value [%s]\n\n",argv[foundParamIndIndex],(paramPartTokens.size() >= 2 ? paramPartTokens[1].c_str() : NULL));
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
PlatformExceptionHandler::application_binary= executable_path(argv[0],true);
|
PlatformExceptionHandler::application_binary= executable_path(argv[0],true);
|
||||||
mg_app_name = GameConstants::application_name;
|
mg_app_name = GameConstants::application_name;
|
||||||
mailStringSupport = mailString;
|
mailStringSupport = mailString;
|
||||||
|
|
|
@ -461,12 +461,7 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu,
|
||||||
labelGameName.init(20+checkBoxPublishServer.getW()+5, networkPos,200);
|
labelGameName.init(20+checkBoxPublishServer.getW()+5, networkPos,200);
|
||||||
labelGameName.setFont(CoreData::getInstance().getMenuFontBig());
|
labelGameName.setFont(CoreData::getInstance().getMenuFontBig());
|
||||||
labelGameName.setFont3D(CoreData::getInstance().getMenuFontBig3D());
|
labelGameName.setFont3D(CoreData::getInstance().getMenuFontBig3D());
|
||||||
if(this->headlessServerMode == false) {
|
labelGameName.setText(createGameName());
|
||||||
labelGameName.setText(defaultPlayerName+"'s game");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
labelGameName.setText("headless ("+defaultPlayerName+")");
|
|
||||||
}
|
|
||||||
labelGameName.setEditable(true);
|
labelGameName.setEditable(true);
|
||||||
labelGameName.setMaxEditWidth(20);
|
labelGameName.setMaxEditWidth(20);
|
||||||
labelGameName.setMaxEditRenderWidth(200);
|
labelGameName.setMaxEditRenderWidth(200);
|
||||||
|
@ -735,6 +730,22 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string MenuStateCustomGame::createGameName(string controllingPlayer){
|
||||||
|
Config &config = Config::getInstance();
|
||||||
|
if(config.getServerTitle()!="" && controllingPlayer == ""){
|
||||||
|
return config.getServerTitle();
|
||||||
|
}
|
||||||
|
else if (this->headlessServerMode == true) {
|
||||||
|
if (controllingPlayer != "") {
|
||||||
|
return controllingPlayer + " controls";
|
||||||
|
} else {
|
||||||
|
return "Headless (" + defaultPlayerName + ")";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return defaultPlayerName+"'s game";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void MenuStateCustomGame::reloadUI() {
|
void MenuStateCustomGame::reloadUI() {
|
||||||
Lang &lang= Lang::getInstance();
|
Lang &lang= Lang::getInstance();
|
||||||
Config &config = Config::getInstance();
|
Config &config = Config::getInstance();
|
||||||
|
@ -809,12 +820,8 @@ void MenuStateCustomGame::reloadUI() {
|
||||||
|
|
||||||
labelGameName.setFont(CoreData::getInstance().getMenuFontBig());
|
labelGameName.setFont(CoreData::getInstance().getMenuFontBig());
|
||||||
labelGameName.setFont3D(CoreData::getInstance().getMenuFontBig3D());
|
labelGameName.setFont3D(CoreData::getInstance().getMenuFontBig3D());
|
||||||
if(this->headlessServerMode == false) {
|
|
||||||
labelGameName.setText(defaultPlayerName+"'s game");
|
labelGameName.setText(createGameName());
|
||||||
}
|
|
||||||
else {
|
|
||||||
labelGameName.setText("headless ("+defaultPlayerName+")");
|
|
||||||
}
|
|
||||||
|
|
||||||
labelNetworkPauseGameForLaggedClients.setText(lang.getString("NetworkPauseGameForLaggedClients"));
|
labelNetworkPauseGameForLaggedClients.setText(lang.getString("NetworkPauseGameForLaggedClients"));
|
||||||
|
|
||||||
|
@ -3854,7 +3861,7 @@ void MenuStateCustomGame::loadGameSettings(GameSettings *gameSettings,bool force
|
||||||
clientConnectedTime = serverInterface->getSlot(i,true)->getConnectedTime();
|
clientConnectedTime = serverInterface->getSlot(i,true)->getConnectedTime();
|
||||||
gameSettings->setMasterserver_admin(serverInterface->getSlot(i,true)->getSessionKey());
|
gameSettings->setMasterserver_admin(serverInterface->getSlot(i,true)->getSessionKey());
|
||||||
gameSettings->setMasterserver_admin_faction_index(serverInterface->getSlot(i,true)->getPlayerIndex());
|
gameSettings->setMasterserver_admin_faction_index(serverInterface->getSlot(i,true)->getPlayerIndex());
|
||||||
labelGameName.setText(serverInterface->getSlot(i,true)->getName()+" controls");
|
labelGameName.setText(createGameName(serverInterface->getSlot(i,true)->getName()));
|
||||||
//printf("slot = %d, admin key [%d] slot connected time[" MG_SIZE_T_SPECIFIER "] clientConnectedTime [" MG_SIZE_T_SPECIFIER "]\n",i,gameSettings->getMasterserver_admin(),serverInterface->getSlot(i)->getConnectedTime(),clientConnectedTime);
|
//printf("slot = %d, admin key [%d] slot connected time[" MG_SIZE_T_SPECIFIER "] clientConnectedTime [" MG_SIZE_T_SPECIFIER "]\n",i,gameSettings->getMasterserver_admin(),serverInterface->getSlot(i)->getConnectedTime(),clientConnectedTime);
|
||||||
}
|
}
|
||||||
if(serverInterface->getSlot(i,true)->getSessionKey() == gameSettings->getMasterserver_admin()){
|
if(serverInterface->getSlot(i,true)->getSessionKey() == gameSettings->getMasterserver_admin()){
|
||||||
|
@ -3878,7 +3885,7 @@ void MenuStateCustomGame::loadGameSettings(GameSettings *gameSettings,bool force
|
||||||
clientConnectedTime = serverInterface->getSlot(i,true)->getConnectedTime();
|
clientConnectedTime = serverInterface->getSlot(i,true)->getConnectedTime();
|
||||||
gameSettings->setMasterserver_admin(serverInterface->getSlot(i,true)->getSessionKey());
|
gameSettings->setMasterserver_admin(serverInterface->getSlot(i,true)->getSessionKey());
|
||||||
gameSettings->setMasterserver_admin_faction_index(serverInterface->getSlot(i,true)->getPlayerIndex());
|
gameSettings->setMasterserver_admin_faction_index(serverInterface->getSlot(i,true)->getPlayerIndex());
|
||||||
labelGameName.setText(serverInterface->getSlot(i,true)->getName()+" controls");
|
labelGameName.setText(createGameName(serverInterface->getSlot(i,true)->getName()));
|
||||||
//printf("slot = %d, admin key [%d] slot connected time[" MG_SIZE_T_SPECIFIER "] clientConnectedTime [" MG_SIZE_T_SPECIFIER "]\n",i,gameSettings->getMasterserver_admin(),serverInterface->getSlot(i)->getConnectedTime(),clientConnectedTime);
|
//printf("slot = %d, admin key [%d] slot connected time[" MG_SIZE_T_SPECIFIER "] clientConnectedTime [" MG_SIZE_T_SPECIFIER "]\n",i,gameSettings->getMasterserver_admin(),serverInterface->getSlot(i)->getConnectedTime(),clientConnectedTime);
|
||||||
}
|
}
|
||||||
if(serverInterface->getSlot(i,true)->getSessionKey() == gameSettings->getMasterserver_admin()){
|
if(serverInterface->getSlot(i,true)->getSessionKey() == gameSettings->getMasterserver_admin()){
|
||||||
|
@ -3890,7 +3897,7 @@ void MenuStateCustomGame::loadGameSettings(GameSettings *gameSettings,bool force
|
||||||
|
|
||||||
if(masterserver_admin_found == false)
|
if(masterserver_admin_found == false)
|
||||||
{
|
{
|
||||||
labelGameName.setText("Headless: "+defaultPlayerName);
|
labelGameName.setText(createGameName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -292,6 +292,7 @@ private:
|
||||||
ServerInterface *& serverInterface, int startIndex, int endIndex,
|
ServerInterface *& serverInterface, int startIndex, int endIndex,
|
||||||
bool onlyNetworkUnassigned);
|
bool onlyNetworkUnassigned);
|
||||||
|
|
||||||
|
string createGameName(string controllingPlayer="");
|
||||||
void reloadUI();
|
void reloadUI();
|
||||||
void loadScenarioInfo(string file, ScenarioInfo *scenarioInfo);
|
void loadScenarioInfo(string file, ScenarioInfo *scenarioInfo);
|
||||||
void processScenario();
|
void processScenario();
|
||||||
|
|
|
@ -1151,7 +1151,7 @@ void MainWindow::onMenuHideWater(wxCommandEvent &event) {
|
||||||
void MainWindow::onMenuViewAbout(wxCommandEvent &event) {
|
void MainWindow::onMenuViewAbout(wxCommandEvent &event) {
|
||||||
MsgDialog(
|
MsgDialog(
|
||||||
this,
|
this,
|
||||||
wxT("Glest Map Editor - Copyright 2004 The Glest Team\n(with improvements by others, 2010)."),
|
wxT("\n Glest Map Editor\n Copyright 2004-2010 The Glest Team\n Copyright 2010-2016 The MegaGlest Team \n"),
|
||||||
wxT("About")).ShowModal();
|
wxT("About")).ShowModal();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,7 @@ const char *GAME_ARGS[] = {
|
||||||
"--starthost",
|
"--starthost",
|
||||||
"--headless-server-mode",
|
"--headless-server-mode",
|
||||||
"--headless-server-status",
|
"--headless-server-status",
|
||||||
|
"--server-title",
|
||||||
"--use-ports",
|
"--use-ports",
|
||||||
|
|
||||||
"--load-scenario",
|
"--load-scenario",
|
||||||
|
@ -113,6 +114,7 @@ enum GAME_ARG_TYPE {
|
||||||
GAME_ARG_SERVER,
|
GAME_ARG_SERVER,
|
||||||
GAME_ARG_MASTERSERVER_MODE,
|
GAME_ARG_MASTERSERVER_MODE,
|
||||||
GAME_ARG_MASTERSERVER_STATUS,
|
GAME_ARG_MASTERSERVER_STATUS,
|
||||||
|
GAME_ARG_SERVER_TITLE,
|
||||||
GAME_ARG_USE_PORTS,
|
GAME_ARG_USE_PORTS,
|
||||||
|
|
||||||
GAME_ARG_LOADSCENARIO,
|
GAME_ARG_LOADSCENARIO,
|
||||||
|
@ -235,7 +237,7 @@ void printParameterHelp(const char *argv0, bool foundInvalidArgs) {
|
||||||
|
|
||||||
printf("\n%s\tCheck the current status of a headless server.",GAME_ARGS[GAME_ARG_MASTERSERVER_STATUS]);
|
printf("\n%s\tCheck the current status of a headless server.",GAME_ARGS[GAME_ARG_MASTERSERVER_STATUS]);
|
||||||
|
|
||||||
printf("\n%s=x,y,z\t\t\tForce hosted games to listen internally on port",GAME_ARGS[GAME_ARG_USE_PORTS]);
|
printf("\n%s=x,y,z\t\tForce hosted games to listen internally on port",GAME_ARGS[GAME_ARG_USE_PORTS]);
|
||||||
printf("\n\t\t\t\tx, externally on port y and game status on port z.");
|
printf("\n\t\t\t\tx, externally on port y and game status on port z.");
|
||||||
printf("\n \t\tWhere x is the internal port # on the local");
|
printf("\n \t\tWhere x is the internal port # on the local");
|
||||||
printf("\n \t\t machine to listen for connects");
|
printf("\n \t\t machine to listen for connects");
|
||||||
|
@ -247,6 +249,8 @@ void printParameterHelp(const char *argv0, bool foundInvalidArgs) {
|
||||||
printf("\n \t\t*NOTE: If enabled the FTP Server port #'s will");
|
printf("\n \t\t*NOTE: If enabled the FTP Server port #'s will");
|
||||||
printf("\n \t\t be set to x+1 to x+9");
|
printf("\n \t\t be set to x+1 to x+9");
|
||||||
|
|
||||||
|
printf("\n%s=x\t\tSet server title.",GAME_ARGS[GAME_ARG_SERVER_TITLE]);
|
||||||
|
|
||||||
printf("\n%s=x\t\tAuto load a scenario by scenario name.",GAME_ARGS[GAME_ARG_LOADSCENARIO]);
|
printf("\n%s=x\t\tAuto load a scenario by scenario name.",GAME_ARGS[GAME_ARG_LOADSCENARIO]);
|
||||||
printf("\n%s=x\t\t\tAuto load a mod by mod pathname.",GAME_ARGS[GAME_ARG_MOD]);
|
printf("\n%s=x\t\t\tAuto load a mod by mod pathname.",GAME_ARGS[GAME_ARG_MOD]);
|
||||||
|
|
||||||
|
|
|
@ -170,8 +170,9 @@ $me =~ s/^.+\///;
|
||||||
our $footer=$cfg->val( 'style', 'footer');
|
our $footer=$cfg->val( 'style', 'footer');
|
||||||
our $map_legend = $cfg->val('style', 'map_legend');
|
our $map_legend = $cfg->val('style', 'map_legend');
|
||||||
|
|
||||||
$footer =~ s/VAR_CREATED_BY/<I><A HREF=\"http:\/\/rupp.de\/glest\/\">$me<\/A><\/I>, version: <I>$version<\/I>, using config-file: <I>$cfg_file<\/I>, on: <I>$now_string<\/I> /;
|
#$footer =~ s/VAR_CREATED_BY/<I><A HREF=\"http:\/\/rupp.de\/glest\/\">$me<\/A><\/I>, version: <I>$version<\/I>, using config-file: <I>$cfg_file<\/I>, on: <I>$now_string<\/I> /;
|
||||||
|
# ^ timestamp should be in the one common footer
|
||||||
|
$footer =~ s/VAR_CREATED_BY/<I><A HREF=\"http:\/\/rupp.de\/glest\/\">$me<\/A><\/I>, version: <I>$version<\/I>, using config-file: <I>$cfg_file<\/I>/;
|
||||||
|
|
||||||
our $level_hp = $cfg->val('all', 'level_hp');
|
our $level_hp = $cfg->val('all', 'level_hp');
|
||||||
our $level_ep = $cfg->val('all', 'level_ep');
|
our $level_ep = $cfg->val('all', 'level_ep');
|
||||||
|
|
Loading…
Reference in New Issue
Block a user