X-Git-Url: https://jfr.im/git/irc/gameservirc.git/blobdiff_plain/44ea29f75e5600eaa0f1996e8d0e4aac4e760cc8..9cc5ab579f517bb3601928b22552b4ac41ffb054:/gameserv/tcpclient.cpp diff --git a/gameserv/tcpclient.cpp b/gameserv/tcpclient.cpp index bcc98fa..7f43644 100644 --- a/gameserv/tcpclient.cpp +++ b/gameserv/tcpclient.cpp @@ -13,6 +13,7 @@ */ #include "sockhelp.h" +#include "options.h" #include "list.h" #include "aClient.h" #include "extern.h" @@ -61,14 +62,23 @@ int main(int argc, char *argv[]) return -1; } +#ifdef UNREAL raw("PROTOCTL NICKv2 VHP"); raw("PASS :%s", remotepass); - raw("SERVER %s 1 :Testing Server", servername); + raw("SERVER %s 1 :%s", servername, servername); raw("NICK %S 1 %d %S %s %s %d +owghraAxNt %s :GameServ", time(NULL), gshost, servername, time(NULL), gshost); raw(":%S JOIN %s", c_Forest); + raw(":%S MODE %s +mtn", c_Forest); +#elif defined(BAHAMUT) + raw("PASS %s :TS", remotepass); + raw("SERVER %s 1 :%s", servername, servername); + raw("NICK %S 1 %d +o %s %s %s 0 :GameServ", time(NULL), gsident, gshost, + servername); + raw(":%s SJOIN %d %d %s +mnt :@%S", servername, time(NULL), time(NULL), c_Forest); +#endif raw(":%S MODE %s +o %S", c_Forest); - raw(":%S MODE %s +ntm", c_Forest); + raw(":%S TOPIC %s :%s", c_Forest, c_ForestTopic); sock_gets(sock,buffer,sizeof(buffer)-1); /* -1 added thanks to David Duchene for pointing out the possible @@ -125,7 +135,7 @@ int main(int argc, char *argv[]) if ((quitter = find(source + 1))) clients.remove(quitter); if ((quitter = findplayer(source + 1))) - players.remove(quitter); + quitter->setNick("NULL"); } else if (stricmp(cmd, "PRIVMSG") == 0) { char *rest, *dest; @@ -140,6 +150,20 @@ int main(int argc, char *argv[]) channel = strtok(NULL, " "); if (stricmp(channel, c_Forest) == 0 && is_playing(source + 1)) raw(":%S MODE %s +v %s", c_Forest, (source + 1)); + + #if defined(BAHAMUT) + } else if (stricmp(cmd, "SJOIN") == 0) { + char *channel, *nick; + strtok(NULL, " "); // Ignore the TS + strtok(NULL, " "); // Ignore the TS + channel = strtok(NULL, " "); + strtok(NULL, " "); + nick = strtok(NULL, " "); + nick++; // Get rid of the : + if (stricmp(channel, c_Forest) == 0 && is_playing(nick)) + raw(":%S MODE %s +v %s", channel, nick); + #endif + } else { // cout << "Unrecognized Message: cmd = " << cmd << setw(30) << "source = " << // source << endl; @@ -226,8 +250,8 @@ void load_timestamp() if (infile.fail()) { - cerr << "Error opening .gstimestamp" << endl; - cerr << "Generating new timestamp" << endl; + cout << "Error opening .gstimestamp" << endl; + cout << "Generating new timestamp" << endl; generate: timestamp = midnight(); save_timestamp(); @@ -248,7 +272,7 @@ void save_timestamp() if (outfile.fail()) { - cerr << "Error creating new file." << endl; + cout << "Error creating new file." << endl; return; }