renamed ServerPort->PortServer MasterServerExternalPort->PortExternal

This commit is contained in:
Titus Tscharntke
2012-10-06 12:56:53 +00:00
parent b05adbc6d5
commit 685b15c91e
9 changed files with 46 additions and 44 deletions

View File

@@ -64,11 +64,13 @@ MasterServerExternalPortList=61357,61367,61377,61387,61397,80,1080,8000,8080,443
NetPlayerName=newbie
NetworkConsistencyChecks=true
PhotoMode=false
PortExternal=0
PortList=61357,61367,61377,61387,61397
PortServer=61357
RefreshFrequency=75
ScreenHeight=600
ScreenWidth=800
ServerIp=192.168.0.107
ServerPort=61357
ShadowAlpha=0.2
ShadowFrameSkip=2
ShadowTextureSize=512

View File

@@ -3274,8 +3274,8 @@ int glestMain(int argc, char** argv) {
printf("Forcing internal port# %d, external port# %d\n",internalPort,externalPort);
config.setInt("ServerPort",internalPort,true);
config.setInt("MasterServerExternalPort",externalPort,true);
config.setInt("PortServer",internalPort,true);
config.setInt("PortExternal",externalPort,true);
config.setInt("FTPServerPort",internalPort+1,true);
if(paramPartPortsTokens.size() >= 3 && paramPartPortsTokens[2].length() > 0) {
@@ -4360,7 +4360,7 @@ int glestMain(int argc, char** argv) {
if(paramPartTokens.size() >= 2 && paramPartTokens[1].length() > 0) {
string autoConnectServer = paramPartTokens[1];
int port = config.getInt("ServerPort",intToStr(GameConstants::serverPort).c_str());
int port = config.getInt("PortServer",intToStr(GameConstants::serverPort).c_str());
vector<string> paramPartTokens2;
Tokenize(autoConnectServer,paramPartTokens2,":");
autoConnectServer = paramPartTokens2[0];

View File

@@ -201,8 +201,8 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu,
ipText += ip;
}
}
string externalPort=config.getString("MasterServerExternalPort", intToStr(GameConstants::serverPort).c_str());
string serverPort=config.getString("ServerPort", intToStr(GameConstants::serverPort).c_str());
string externalPort=config.getString("PortExternal", intToStr(GameConstants::serverPort).c_str());
string serverPort=config.getString("PortServer", intToStr(GameConstants::serverPort).c_str());
labelLocalIP.setText(lang.get("LanIP") + ipText + " ( "+serverPort+" / "+externalPort+" )");
ServerSocket::setExternalPort(strToInt(externalPort));
@@ -738,8 +738,8 @@ void MenuStateCustomGame::reloadUI() {
ipText += ip;
}
}
string externalPort=config.getString("MasterServerExternalPort", intToStr(GameConstants::serverPort).c_str());
string serverPort=config.getString("ServerPort", intToStr(GameConstants::serverPort).c_str());
string externalPort=config.getString("PortExternal", intToStr(GameConstants::serverPort).c_str());
string serverPort=config.getString("PortServer", intToStr(GameConstants::serverPort).c_str());
labelLocalIP.setText(lang.get("LanIP") + ipText + " ( "+serverPort+" / "+externalPort+" )");
labelMap.setText(lang.get("Map")+":");
@@ -2477,7 +2477,7 @@ void MenuStateCustomGame::update() {
labelNetStatus[i].setText(szBuf);
}
else {
string port = intToStr(config.getInt("ServerPort"));
string port = intToStr(config.getInt("PortServer"));
if(port != intToStr(GameConstants::serverPort)){
port = port + " " + lang.get("NonStandardPort") + "!)";
}
@@ -2859,7 +2859,7 @@ void MenuStateCustomGame::publishToMasterserver() {
publishToServerInfo["networkSlots"] = intToStr(slotCountHumans);
publishToServerInfo["connectedClients"] = intToStr(slotCountConnectedPlayers);
string externalport = config.getString("MasterServerExternalPort", intToStr(GameConstants::serverPort).c_str());
string externalport = config.getString("PortExternal", intToStr(GameConstants::serverPort).c_str());
publishToServerInfo["externalconnectport"] = externalport;
publishToServerInfo["privacyPlease"] = intToStr(config.getBool("PrivacyPlease","false"));

View File

@@ -146,7 +146,7 @@ void MenuStateJoinGame::CommonInit(bool connect, Ip serverIp,int portNumberOverr
labelServerPort.init(465,430);
string host = labelServerIp.getText();
int portNumber = config.getInt("ServerPort",intToStr(GameConstants::serverPort).c_str());
int portNumber = config.getInt("PortServer",intToStr(GameConstants::serverPort).c_str());
std::vector<std::string> hostPartsList;
Tokenize(host,hostPartsList,":");
if(hostPartsList.size() > 1) {
@@ -156,7 +156,7 @@ void MenuStateJoinGame::CommonInit(bool connect, Ip serverIp,int portNumberOverr
}
string port = intToStr(portNumber);
if(port != intToStr(config.getInt("ServerPort",intToStr(GameConstants::serverPort).c_str()))) {
if(port != intToStr(config.getInt("PortServer",intToStr(GameConstants::serverPort).c_str()))) {
port = port + " (" + lang.get("NonStandardPort") + ")";
}
else {
@@ -196,7 +196,7 @@ void MenuStateJoinGame::CommonInit(bool connect, Ip serverIp,int portNumberOverr
}
host = labelServerIp.getText();
portNumber = config.getInt("ServerPort",intToStr(GameConstants::serverPort).c_str());
portNumber = config.getInt("PortServer",intToStr(GameConstants::serverPort).c_str());
hostPartsList.clear();
Tokenize(host,hostPartsList,":");
if(hostPartsList.size() > 1) {
@@ -206,7 +206,7 @@ void MenuStateJoinGame::CommonInit(bool connect, Ip serverIp,int portNumberOverr
}
port = intToStr(portNumber);
if(port != intToStr(config.getInt("ServerPort",intToStr(GameConstants::serverPort).c_str()))) {
if(port != intToStr(config.getInt("PortServer",intToStr(GameConstants::serverPort).c_str()))) {
port = port + " (" + lang.get("NonStandardPort") + ")";
}
else {
@@ -242,7 +242,7 @@ void MenuStateJoinGame::reloadUI() {
labelServerPortLabel.setText(lang.get("ServerPort"));
string host = labelServerIp.getText();
int portNumber = config.getInt("ServerPort",intToStr(GameConstants::serverPort).c_str());
int portNumber = config.getInt("PortServer",intToStr(GameConstants::serverPort).c_str());
std::vector<std::string> hostPartsList;
Tokenize(host,hostPartsList,":");
if(hostPartsList.size() > 1) {
@@ -252,7 +252,7 @@ void MenuStateJoinGame::reloadUI() {
}
string port = intToStr(portNumber);
if(port != intToStr(config.getInt("ServerPort",intToStr(GameConstants::serverPort).c_str()))) {
if(port != intToStr(config.getInt("PortServer",intToStr(GameConstants::serverPort).c_str()))) {
port = port + " (" + lang.get("NonStandardPort") + ")";
}
else {
@@ -286,7 +286,7 @@ void MenuStateJoinGame::DiscoveredServers(std::vector<string> serverList) {
if(serverList.empty() == false) {
Config &config= Config::getInstance();
string bestIPMatch = "";
int serverGamePort = config.getInt("ServerPort",intToStr(GameConstants::serverPort).c_str());
int serverGamePort = config.getInt("PortServer",intToStr(GameConstants::serverPort).c_str());
std::vector<std::string> localIPList = Socket::getLocalIPAddressList();
for(int idx = 0; idx < serverList.size(); idx++) {
@@ -351,7 +351,7 @@ void MenuStateJoinGame::mouseClick(int x, int y, MouseButton mouseButton) {
string host = labelServerIp.getText();
Config &config= Config::getInstance();
int portNumber = config.getInt("ServerPort",intToStr(GameConstants::serverPort).c_str());
int portNumber = config.getInt("PortServer",intToStr(GameConstants::serverPort).c_str());
std::vector<std::string> hostPartsList;
Tokenize(host,hostPartsList,":");
if(hostPartsList.size() > 1) {
@@ -362,7 +362,7 @@ void MenuStateJoinGame::mouseClick(int x, int y, MouseButton mouseButton) {
Lang &lang= Lang::getInstance();
string port = intToStr(portNumber);
if(port != intToStr(config.getInt("ServerPort",intToStr(GameConstants::serverPort).c_str()))) {
if(port != intToStr(config.getInt("PortServer",intToStr(GameConstants::serverPort).c_str()))) {
port = port + " (" + lang.get("NonStandardPort") + ")";
}
else {
@@ -738,7 +738,7 @@ void MenuStateJoinGame::connectToServer() {
Config& config= Config::getInstance();
string host = labelServerIp.getText();
int port = config.getInt("ServerPort",intToStr(GameConstants::serverPort).c_str());
int port = config.getInt("PortServer",intToStr(GameConstants::serverPort).c_str());
std::vector<std::string> hostPartsList;
Tokenize(host,hostPartsList,":");
if(hostPartsList.size() > 1) {

View File

@@ -1048,7 +1048,7 @@ bool MenuStateMasterserver::connectToServer(string ipString, int port) {
//Config& config= Config::getInstance();
Ip serverIp(ipString);
//int serverPort = Config::getInstance().getInt("ServerPort",intToStr(GameConstants::serverPort).c_str());
//int serverPort = Config::getInstance().getInt("PortServer",intToStr(GameConstants::serverPort).c_str());
int serverPort = port;
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s] try to connect to [%s] serverPort = %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,serverIp.getString().c_str(),serverPort);
clientInterface->connect(serverIp, serverPort);

View File

@@ -447,7 +447,7 @@ MenuStateOptions::MenuStateOptions(Program *program, MainMenu *mainMenu):
labelServerPortLabel.init(currentLabelStart,currentLine);
labelServerPortLabel.setText(lang.get("ServerPort"));
labelServerPort.init(currentColumnStart,currentLine);
string port=intToStr(config.getInt("ServerPort"));
string port=intToStr(config.getInt("PortServer"));
if(port != intToStr(GameConstants::serverPort)){
port=port +" ("+lang.get("NonStandardPort")+"!!)";
}
@@ -464,25 +464,25 @@ MenuStateOptions::MenuStateOptions(Program *program, MainMenu *mainMenu):
labelPublishServerExternalPort.init(currentLabelStart, currentLine, 150);
labelPublishServerExternalPort.setText(lang.get("PublishServerExternalPort"));
listBoxPublishServerExternalPort.registerGraphicComponent(containerName,"listBoxPublishServerExternalPort");
listBoxPublishServerExternalPort.init(currentColumnStart, currentLine, 170);
listBoxServerPort.registerGraphicComponent(containerName,"listBoxPublishServerExternalPort");
listBoxServerPort.init(currentColumnStart, currentLine, 170);
string supportExternalPortList = config.getString("MasterServerExternalPortList",intToStr(GameConstants::serverPort).c_str());
std::vector<std::string> externalPortList;
Tokenize(supportExternalPortList,externalPortList,",");
string portListString = config.getString("PortList",intToStr(GameConstants::serverPort).c_str());
std::vector<std::string> portList;
Tokenize(portListString,portList,",");
string currentPort=config.getString("MasterServerExternalPort", intToStr(GameConstants::serverPort).c_str());
string currentPort=config.getString("PortExternal", intToStr(GameConstants::serverPort).c_str());
int masterServerExternalPortSelectionIndex=0;
for(int idx = 0; idx < externalPortList.size(); idx++) {
if(externalPortList[idx] != "" && IsNumeric(externalPortList[idx].c_str(),false)) {
listBoxPublishServerExternalPort.pushBackItem(externalPortList[idx]);
if(currentPort==externalPortList[idx])
for(int idx = 0; idx < portList.size(); idx++) {
if(portList[idx] != "" && IsNumeric(portList[idx].c_str(),false)) {
listBoxServerPort.pushBackItem(portList[idx]);
if(currentPort==portList[idx])
{
masterServerExternalPortSelectionIndex=idx;
}
}
}
listBoxPublishServerExternalPort.setSelectedItemIndex(masterServerExternalPortSelectionIndex);
listBoxServerPort.setSelectedItemIndex(masterServerExternalPortSelectionIndex);
currentLine-=lineOffset;
// FTP Config - start
@@ -686,7 +686,7 @@ void MenuStateOptions::reloadUI() {
labelServerPortLabel.setText(lang.get("ServerPort"));
Config &config= Config::getInstance();
string port = intToStr(config.getInt("ServerPort"));
string port = intToStr(config.getInt("PortServer"));
if(port != intToStr(GameConstants::serverPort).c_str()) {
port = port +" ("+lang.get("NonStandardPort")+"!!)";
}
@@ -862,8 +862,8 @@ void MenuStateOptions::mouseClick(int x, int y, MouseButton mouseButton){
listBoxScreenModes.mouseClick(x, y);
listFontSizeAdjustment.mouseClick(x, y);
checkBoxFullscreenWindowed.mouseClick(x, y);
if(listBoxPublishServerExternalPort.mouseClick(x, y)){
int selectedPort=strToInt(listBoxPublishServerExternalPort.getSelectedItem());
if(listBoxServerPort.mouseClick(x, y)){
int selectedPort=strToInt(listBoxServerPort.getSelectedItem());
if(selectedPort<10000){
selectedPort=GameConstants::serverPort;
}
@@ -922,7 +922,7 @@ void MenuStateOptions::mouseMove(int x, int y, const MouseState *ms){
listBoxScreenModes.mouseMove(x, y);
checkBoxFullscreenWindowed.mouseMove(x, y);
listFontSizeAdjustment.mouseMove(x, y);
listBoxPublishServerExternalPort.mouseMove(x, y);
listBoxServerPort.mouseMove(x, y);
checkBoxEnableFTP.mouseMove(x, y);
checkBoxEnableFTPServer.mouseMove(x, y);
checkBoxEnableFTPServerInternetTilesetXfer.mouseMove(x, y);
@@ -1060,7 +1060,7 @@ void MenuStateOptions::render(){
renderer.renderLabel(&labelFullscreenWindowed);
renderer.renderCheckBox(&checkBoxFullscreenWindowed);
renderer.renderLabel(&labelPublishServerExternalPort);
renderer.renderListBox(&listBoxPublishServerExternalPort);
renderer.renderListBox(&listBoxServerPort);
renderer.renderLabel(&labelNetworkSettings);
@@ -1150,8 +1150,8 @@ void MenuStateOptions::saveConfig(){
config.setString("FontSizeAdjustment", listFontSizeAdjustment.getSelectedItem());
CoreData::getInstance().getMenuMusic()->setVolume(strToInt(listBoxVolumeMusic.getSelectedItem())/100.f);
config.setString("SoundVolumeMusic", listBoxVolumeMusic.getSelectedItem());
config.setString("MasterServerExternalPort", listBoxPublishServerExternalPort.getSelectedItem());
config.setInt("FTPServerPort",config.getInt("MasterServerExternalPort")+1);
config.setString("PortExternal", listBoxServerPort.getSelectedItem());
config.setInt("FTPServerPort",config.getInt("PortExternal")+1);
config.setBool("EnableFTPXfer", checkBoxEnableFTP.getValue());
config.setBool("EnableFTPServer", checkBoxEnableFTPServer.getValue());

View File

@@ -81,7 +81,7 @@ private:
int mainMessageBoxState;
GraphicLabel labelPublishServerExternalPort;
GraphicListBox listBoxPublishServerExternalPort;
GraphicListBox listBoxServerPort;
GraphicLabel labelEnableFTP;

View File

@@ -1056,7 +1056,7 @@ void ConnectionSlot::update(bool checkForNewClients,int lockedSlotIndex) {
FileTransferInfo fileInfo;
fileInfo.hostType = eServer;
//fileInfo.serverIP = this->ip.getString();
fileInfo.serverPort = Config::getInstance().getInt("ServerPort",intToStr(GameConstants::serverPort).c_str());
fileInfo.serverPort = Config::getInstance().getInt("PortServer",intToStr(GameConstants::serverPort).c_str());
fileInfo.fileName = networkMessageSynchNetworkGameDataFileGet.getFileName();
FileTransferSocketThread *fileXferThread = new FileTransferSocketThread(fileInfo);

View File

@@ -99,7 +99,7 @@ ServerInterface::ServerInterface(bool publishEnabled) :GameNetworkInterface() {
if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
serverSocket.setBlock(false);
if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
serverSocket.setBindPort(Config::getInstance().getInt("ServerPort", intToStr(GameConstants::serverPort).c_str()));
serverSocket.setBindPort(Config::getInstance().getInt("PortServer", intToStr(GameConstants::serverPort).c_str()));
if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
/*
@@ -2424,7 +2424,7 @@ std::map<string,string> ServerInterface::publishToMasterserver() {
publishToServerInfo["activeSlots"] = intToStr(slotCountUsed);
publishToServerInfo["networkSlots"] = intToStr(slotCountHumans);
publishToServerInfo["connectedClients"] = intToStr(slotCountConnectedPlayers);
string externalport = config.getString("MasterServerExternalPort", intToStr(GameConstants::serverPort).c_str());
string externalport = config.getString("PortExternal", intToStr(GameConstants::serverPort).c_str());
publishToServerInfo["externalconnectport"] = externalport;
publishToServerInfo["privacyPlease"] = intToStr(config.getBool("PrivacyPlease","false"));
publishToServerInfo["gameStatus"] = intToStr(game_status_in_progress);