X-Git-Url: https://jfr.im/git/irc/gameservirc.git/blobdiff_plain/03e0a9d83003fd07ae25f946053ec10989bfd132..f2072f1a322a388903ce463f9cb736d6576cce4f:/gameserv/tcpclient.cpp diff --git a/gameserv/tcpclient.cpp b/gameserv/tcpclient.cpp index 0e96bb1..69d5dd7 100644 --- a/gameserv/tcpclient.cpp +++ b/gameserv/tcpclient.cpp @@ -361,11 +361,39 @@ int main(int argc, char *argv[]) else if (stricmp(dest, c_Forest) == 0) forest(source, rest); #endif + #if defined(P10) + } else if (stricmp(cmd, "J") == 0) { + #else } else if (stricmp(cmd, "JOIN") == 0) { + #endif char *channel; + aClient *joiner; channel = strtok(NULL, " "); - if (stricmp(channel, c_Forest) == 0 && is_playing(source + 1)) - raw(":%S MODE %s +v %s", c_Forest, (source + 1)); + + char z = source[0]; + + if (z == ':') + source++; + + joiner = find(source); + + if (stricmp(channel, c_Forest) == 0 && is_playing(joiner)) + { + #ifdef DEBUGMODE + log("Player %s (IRC: %s) joined %s", + joiner->stats->name, + #ifdef P10 + joiner->getRealNick(), + #else + joiner->getNick(), + #endif + c_Forest); + #endif + raw(":%S MODE %s +v %s", c_Forest, (source)); + } + + if (z == ':') + source--; #if defined(BAHAMUT) } else if (stricmp(cmd, "SJOIN") == 0) {