show megaglest version in irc WhoIS

This commit is contained in:
titiger 2017-03-11 23:57:44 +01:00
parent 438d37c59f
commit 2133b8fd07
3 changed files with 5 additions and 1 deletions

View File

@ -329,6 +329,7 @@ MenuStateMasterserver::MenuStateMasterserver(Program *program, MainMenu *mainMen
ircClient = ircThread;
ircClient->setUniqueID(mutexOwnerId);
ircClient->setPlayerName(netPlayerName);
ircClient->setGlestVersionString(glestVersionString);
ircClient->start();
}
else {

View File

@ -69,6 +69,7 @@ protected:
string nick;
string playerName;
string glestVersionString;
bool hasJoinedChannel;
@ -97,6 +98,7 @@ public:
static void setGlobalCacheContainerName(const char *name) { globalCacheContainerName = name; }
void setPlayerName(string value) { playerName = value; }
void setGlestVersionString(string value) { glestVersionString = value; }
string getPlayerName() const { return playerName; }
bool getWantToLeaveChannel() const { return wantToLeaveChannel; }

View File

@ -540,6 +540,7 @@ IRCThread::IRCThread(const std::vector<string> &argv, IRCCallbackInterface *call
lastNickListUpdate = time(NULL);
wantToLeaveChannel = false;
playerName = "";
glestVersionString = "";
}
void IRCThread::disconnect() {
@ -824,7 +825,7 @@ void IRCThread::execute() {
if(SystemFlags::VERBOSE_MODE_ENABLED || IRCThread::debugEnabled) printf ("===> IRC: Line: %d\n", __LINE__);
safeMutex.Lock();
if(irc_connect(ircSession, argv[0].c_str(), IRC_SERVER_PORT, 0, this->nick.c_str(), this->username.c_str(), "megaglest")) {
if(irc_connect(ircSession, argv[0].c_str(), IRC_SERVER_PORT, 0, this->nick.c_str(), this->username.c_str(), ("MegagGlest "+glestVersionString).c_str())) {
safeMutex.ReleaseLock();
if(SystemFlags::VERBOSE_MODE_ENABLED || IRCThread::debugEnabled) printf ("===> IRC Could not connect: %s\n", irc_strerror (irc_errno(ircSession)));
return;