From: kainazzzo Date: Wed, 19 Nov 2003 06:22:42 +0000 (+0000) Subject: Switched the hybrid contrib files to an updated version for configscript. Thank you... X-Git-Url: https://jfr.im/git/irc/gameservirc.git/commitdiff_plain/f809a0d876151c3149168d121e833884a394015c?hp=4dde2ed9f323c87a1f54b002c66da835f7dc0baa Switched the hybrid contrib files to an updated version for configscript. Thank you wcampbell! git-svn-id: https://svn.code.sf.net/p/gameservirc/code/trunk@62 bc333340-6410-0410-a689-9d09f3c113fa --- diff --git a/gameserv/contrib/gameserv-1.1.3+hybrid_0.2.diff b/gameserv/contrib/gameserv-1.1.3+hybrid_0.2.diff new file mode 100644 index 0000000..7ea2de2 --- /dev/null +++ b/gameserv/contrib/gameserv-1.1.3+hybrid_0.2.diff @@ -0,0 +1,97 @@ +diff -uNrd gameserv-1.1.3.dist/configscript.cpp gameserv-1.1.3/configscript.cpp +--- gameserv-1.1.3.dist/configscript.cpp Thu Nov 6 23:10:32 2003 ++++ gameserv-1.1.3/configscript.cpp Fri Nov 7 12:46:51 2003 +@@ -27,11 +27,17 @@ + case '1': + outfile << "#define UNREAL" << endl; + outfile << "#undef BAHAMUT" << endl; ++ outfile << "#undef HYBRID" << endl; + break; + case '2': + outfile << "#undef UNREAL" << endl; + outfile << "#define BAHAMUT" << endl; ++ outfile << "#undef HYBRID" <> selection; + return selection; +diff -uNrd gameserv-1.1.3.dist/tcpclient.cpp gameserv-1.1.3/tcpclient.cpp +--- gameserv-1.1.3.dist/tcpclient.cpp Thu Nov 6 23:10:32 2003 ++++ gameserv-1.1.3/tcpclient.cpp Fri Nov 7 13:00:10 2003 +@@ -26,7 +26,7 @@ + #include + + char *PACKAGE = "GameServ"; +-char *VERSION = "1.1.2"; ++char *VERSION = "1.1.3+hybrid_0.2"; + + int sock; + long timestamp; +@@ -79,6 +79,13 @@ + 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); ++#elif defined(HYBRID) ++ raw("PASS %s :TS", remotepass); ++ raw("SERVER %s 1 :%s", servername, servername); ++ raw("NICK %S 1 %d +o %s %s %s :GameServ", time(NULL), gsident, gshost, ++ servername); ++ // Sending a timestamp of 1 to force ops. ++ raw(":%s SJOIN 1 %s +ntm :@%S", servername, c_Forest); + #endif + raw(":%S MODE %s +o %S", c_Forest); + raw(":%S TOPIC %s :%s", c_Forest, c_ForestTopic); +@@ -175,17 +182,30 @@ + if (stricmp(channel, c_Forest) == 0 && is_playing(source + 1)) + raw(":%S MODE %s +v %s", c_Forest, (source + 1)); + +- #if defined(BAHAMUT) ++#if defined(BAHAMUT) || defined(HYBRID) + } else if (stricmp(cmd, "SJOIN") == 0) { +- char *channel, *nick; ++ char *channel, *nick, *tmp, *rest; + strtok(NULL, " "); // Ignore the TS ++#ifndef HYBRID + strtok(NULL, " "); // Ignore the TS ++#endif + 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); ++ rest = strtok(NULL, ""); ++ tmp = strchr(rest, ':'); ++ tmp++; ++ nick = strtok(tmp, " "); ++ while (nick != NULL) ++ { ++ if (*nick == '@') ++ nick++; ++ if (*nick == '+') ++ nick++; // Assume for users set op and voice, they ++ // are never passed as +@nick ++ if (stricmp(channel, c_Forest) == 0 && is_playing(nick)) ++ raw(":%S MODE %s +v %s", channel, nick); ++ ++ nick = strtok(NULL, " "); ++ } + #endif + + } else { diff --git a/gameserv/contrib/gameserv-hybrid.diff b/gameserv/contrib/gameserv-hybrid.diff deleted file mode 100644 index ca23910..0000000 --- a/gameserv/contrib/gameserv-hybrid.diff +++ /dev/null @@ -1,79 +0,0 @@ -Hybrid ircd support, this "works for me" on a private testnet. -This probably should not be committed, merely kept in a "contrib" -directory. - -Index: gameserv.cpp -=================================================================== -RCS file: /cvsroot/gameservirc/gameserv/gameserv.cpp,v -retrieving revision 1.14 -diff -u -r1.14 gameserv.cpp ---- gameserv.cpp 24 Oct 2003 16:04:51 -0000 1.14 -+++ gameserv.cpp 26 Oct 2003 22:41:46 -0000 -@@ -116,7 +119,7 @@ - timestamp = strtok(NULL, "\1"); - notice(s_GameServ, source, "\1PING %s\1", timestamp); - } else if (stricmp(cmd, ":\1VERSION\1") == 0) { -- notice(s_GameServ, source, "\1VERSION GameServ v1.0b\1"); -+ notice(s_GameServ, source, "\1VERSION GameServ v1.0b+hybrid_0.1\1"); - } else if (stricmp(cmd, "SEARCH") == 0) { - cmd = strtok(NULL, " "); - -Index: tcpclient.cpp -=================================================================== -RCS file: /cvsroot/gameservirc/gameserv/tcpclient.cpp,v -retrieving revision 1.6 -diff -u -r1.6 tcpclient.cpp ---- tcpclient.cpp 23 Oct 2003 21:27:19 -0000 1.6 -+++ tcpclient.cpp 26 Oct 2003 22:41:46 -0000 -@@ -56,14 +56,11 @@ - return -1; - } - -- raw("PROTOCTL NICKv2 VHP"); -- raw("PASS :%s", remotepass); -+ raw("PASS %s :TS", remotepass); - raw("SERVER %s 1 :Testing Server", 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 +o %S", c_Forest); -- raw(":%S MODE %s +ntm", c_Forest); -+ raw("NICK %S %ld 1 +o %S %s %s :GameServ", time(NULL), gshost, -+ servername); -+ raw(":%s SJOIN 1 %s +ntm :@%S", servername, c_Forest); - - sock_gets(sock,buffer,sizeof(buffer)-1); /* -1 added thanks to - David Duchene for pointing out the possible -@@ -128,11 +125,28 @@ - gameserv(source, rest); - else if (stricmp(dest, c_Forest) == 0) - forest(source, rest); -- } else if (stricmp(cmd, "JOIN") == 0) { -+ } else if (stricmp(cmd, "SJOIN") == 0) { - char *channel; -- channel = strtok(NULL, " "); -- if (stricmp(channel, c_Forest) == 0 && is_playing(source + 1)) -- raw(":%S MODE %s +v %s", c_Forest, (source + 1)); -+ char *userptr; -+ char *tmp; -+ channel = strtok(NULL, " "); // channel timestamp -+ channel = strtok(NULL, " "); // channel name -+ tmp = strrchr(buffer, ':'); -+ tmp++; -+ userptr = strtok(tmp, " "); -+ while (userptr != NULL) -+ { -+ if (*userptr == '@') -+ userptr++; -+ if (*userptr == '+') -+ userptr++; // Assume that for users opped and voiced -+ // that they are never passed as +@user -+ -+ if (stricmp(channel, c_Forest) == 0 && is_playing(userptr)) -+ raw(":%S MODE %s +v %s", c_Forest, userptr); -+ -+ userptr = strtok(NULL, " "); -+ } - } else { - // cout << "Unrecognized Message: cmd = " << cmd << setw(30) << "source = " << - // source << endl;