- fixed local chat echo in clientinterface so that messages intended to be shown locally are properly displayed in the console

- added a success / failure message for downloaded map attempts
This commit is contained in:
Mark Vejvoda 2010-12-30 20:48:39 +00:00
parent 973b546b04
commit c59807c4cf
2 changed files with 20 additions and 17 deletions

View File

@ -86,7 +86,7 @@ MenuStateConnectedGame::MenuStateConnectedGame(Program *program, MainMenu *mainM
mainMessageBoxState=0;
ftpMessageBox.registerGraphicComponent(containerName,"ftpMessageBox");
ftpMessageBox.init(lang.get("Yes"),lang.get("no"));
ftpMessageBox.init(lang.get("Yes"),lang.get("No"));
ftpMessageBox.setEnabled(false);
NetworkManager &networkManager= NetworkManager::getInstance();
@ -1184,13 +1184,6 @@ void MenuStateConnectedGame::update() {
if(chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] took msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,chrono.getMillis());
if(chrono.getMillis() > 0) chrono.start();
//call the chat manager
chatManager.updateNetwork();
//console732
console.update();
//intro
if(clientInterface->getIntroDone()) {
labelInfo.setText(lang.get("WaitingHost"));
@ -1215,6 +1208,13 @@ void MenuStateConnectedGame::update() {
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
}
}
//call the chat manager
chatManager.updateNetwork();
//console732
console.update();
}
catch(const runtime_error &ex) {
char szBuf[1024]="";
@ -1407,7 +1407,7 @@ void MenuStateConnectedGame::keyUp(char key) {
Config &configKeys = Config::getInstance(std::pair<ConfigType,ConfigType>(cfgMainKeys,cfgUserKeys));
if(chatManager.getEditEnabled()){
if(chatManager.getEditEnabled()) {
//send key to the chat manager
chatManager.keyUp(key);
}
@ -1418,8 +1418,6 @@ void MenuStateConnectedGame::keyUp(char key) {
}
void MenuStateConnectedGame::setActiveInputLabel(GraphicLabel *newLable) {
if(newLable != NULL) {
string text= newLable->getText();
size_t found = text.find_last_of("_");
@ -1638,15 +1636,20 @@ void MenuStateConnectedGame::FTPClient_CallbackEvent(string mapFilename, FTP_Cli
getMissingMapFromFTPServerInProgress = false;
printf("Got FTP Callback for [%s] result = %d\n",mapFilename.c_str(),result);
if(result == ftp_crt_SUCCESS) {
NetworkManager &networkManager= NetworkManager::getInstance();
ClientInterface* clientInterface= networkManager.getClientInterface();
const GameSettings *gameSettings = clientInterface->getGameSettings();
NetworkManager &networkManager= NetworkManager::getInstance();
ClientInterface* clientInterface= networkManager.getClientInterface();
const GameSettings *gameSettings = clientInterface->getGameSettings();
if(result == ftp_crt_SUCCESS) {
char szMsg[1024]="";
sprintf(szMsg,"Player: %s SUCCESSFULLY downloaded the map: %s",getHumanPlayerName().c_str(),gameSettings->getMap().c_str());
clientInterface->sendTextMessage(szMsg,-1, true);
}
else {
char szMsg[1024]="";
sprintf(szMsg,"Player: %s FAILED to download the map: %s",getHumanPlayerName().c_str(),gameSettings->getMap().c_str());
clientInterface->sendTextMessage(szMsg,-1, true);
}
}
}}//end namespace

View File

@ -144,7 +144,7 @@ void ClientInterface::update() {
}
//clear chat variables
clearChatInfo();
//!!!clearChatInfo();
}
std::string ClientInterface::getServerIpAddress() {
@ -154,7 +154,7 @@ std::string ClientInterface::getServerIpAddress() {
void ClientInterface::updateLobby() {
//SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
//clear chat variables
clearChatInfo();
//!!!clearChatInfo();
//SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
NetworkMessageType networkMessageType = getNextMessageType(true);