Index: source/glest_game/menu/menu_state_masterserver.cpp
===================================================================
--- source/glest_game/menu/menu_state_masterserver.cpp (revision 4548)
+++ source/glest_game/menu/menu_state_masterserver.cpp (working copy)
@@ -305,6 +305,13 @@
else {
ircArgs.push_back("");
}
+#define REALNAMEMAXLEN 50
+ string IRCrealname =
+ "MegaGlest" +
+ glestVersionString + "|r"
+ + getSVNRevisionString().substr(5) /* skip "Rev: " */
+ + "|" + getPlatformNameString() + "|" + getCompilerNameString();
+ ircArgs.push_back(IRCrealname.substr(0,REALNAMEMAXLEN));
MutexSafeWrapper safeMutexIRCPtr(&mutexIRCClient,string(extractFileFromDirectoryPath(__FILE__).c_str()) + "_" + intToStr(__LINE__));
Index: source/shared_lib/include/platform/posix/ircclient.h
===================================================================
--- source/shared_lib/include/platform/posix/ircclient.h (revision 4548)
+++ source/shared_lib/include/platform/posix/ircclient.h (working copy)
@@ -67,8 +67,8 @@
string username;
string channel;
string nick;
-
string playerName;
+ string realname;
bool hasJoinedChannel;
@@ -118,6 +118,7 @@
string getChannel() const { return channel;}
string getNick() const { return nick;}
+ string getRealname() const { return realname;}
string getExecute_cmd_onconnect() const { return execute_cmd_onconnect; }
void setExecute_cmd_onconnect(string value) { execute_cmd_onconnect = value; }
Index: source/shared_lib/sources/platform/posix/ircclient.cpp
===================================================================
--- source/shared_lib/sources/platform/posix/ircclient.cpp (revision 4548)
+++ source/shared_lib/sources/platform/posix/ircclient.cpp (working copy)
@@ -526,6 +526,7 @@
lastNickListUpdate = time(NULL);
wantToLeaveChannel = false;
playerName = "";
+ realname = "megaglest";
}
void IRCThread::disconnect() {
@@ -720,7 +721,7 @@
ircSession=NULL;
safeMutex.ReleaseLock(true);
- if(argv.size() != 5) {
+ if(argv.size() != 6) {
if(SystemFlags::VERBOSE_MODE_ENABLED || IRCThread::debugEnabled) printf ("===> IRC Usage: <server> <nick> <channel> : got params [%ld]\n",(long int)argv.size());
return;
}
@@ -772,6 +773,9 @@
// this->password = argv[4];
// }
this->username = argv[1];
+ if (argv.size() >= 6) {
+ this->realname = argv[5];
+ }
if(argv.size() >= 4) {
this->username = argv[3];
}
@@ -787,7 +791,7 @@
}
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(), this->realname.c_str())) {
safeMutex.ReleaseLock();
if(SystemFlags::VERBOSE_MODE_ENABLED || IRCThread::debugEnabled) printf ("===> IRC Could not connect: %s\n", irc_strerror (irc_errno(ircSession)));
return;
@@ -998,7 +1002,7 @@
if(connectRequired == false) {
#if !defined(DISABLE_IRCCLIENT)
MutexSafeWrapper safeMutex1(&mutexIRCSession,string(__FILE__) + "_" + intToStr(__LINE__));
- 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(), this->realname.c_str())) {
if(SystemFlags::VERBOSE_MODE_ENABLED || IRCThread::debugEnabled) printf ("===> IRC Could not connect: %s\n", irc_strerror (irc_errno(ircSession)));
return;
}