]> jfr.im git - irc/gameservirc.git/blame - gameserv/contrib/gameserv-hybrid.diff
New functionality. Loading monsters from a file is finished. Monsters still need...
[irc/gameservirc.git] / gameserv / contrib / gameserv-hybrid.diff
CommitLineData
5b72cf50 1Hybrid ircd support, this "works for me" on a private testnet.
2This probably should not be committed, merely kept in a "contrib"
3directory.
4
5Index: gameserv.cpp
6===================================================================
7RCS file: /cvsroot/gameservirc/gameserv/gameserv.cpp,v
8retrieving revision 1.14
9diff -u -r1.14 gameserv.cpp
10--- gameserv.cpp 24 Oct 2003 16:04:51 -0000 1.14
11+++ gameserv.cpp 26 Oct 2003 22:41:46 -0000
12@@ -116,7 +119,7 @@
13 timestamp = strtok(NULL, "\1");
14 notice(s_GameServ, source, "\1PING %s\1", timestamp);
15 } else if (stricmp(cmd, ":\1VERSION\1") == 0) {
16- notice(s_GameServ, source, "\1VERSION GameServ v1.0b\1");
17+ notice(s_GameServ, source, "\1VERSION GameServ v1.0b+hybrid_0.1\1");
18 } else if (stricmp(cmd, "SEARCH") == 0) {
19 cmd = strtok(NULL, " ");
20
21Index: tcpclient.cpp
22===================================================================
23RCS file: /cvsroot/gameservirc/gameserv/tcpclient.cpp,v
24retrieving revision 1.6
25diff -u -r1.6 tcpclient.cpp
26--- tcpclient.cpp 23 Oct 2003 21:27:19 -0000 1.6
27+++ tcpclient.cpp 26 Oct 2003 22:41:46 -0000
28@@ -56,14 +56,11 @@
29 return -1;
30 }
31
32- raw("PROTOCTL NICKv2 VHP");
33- raw("PASS :%s", remotepass);
34+ raw("PASS %s :TS", remotepass);
35 raw("SERVER %s 1 :Testing Server", servername);
36- raw("NICK %S 1 %d %S %s %s %d +owghraAxNt %s :GameServ", time(NULL), gshost,
37- servername, time(NULL), gshost);
38- raw(":%S JOIN %s", c_Forest);
39- raw(":%S MODE %s +o %S", c_Forest);
40- raw(":%S MODE %s +ntm", c_Forest);
41+ raw("NICK %S %ld 1 +o %S %s %s :GameServ", time(NULL), gshost,
42+ servername);
43+ raw(":%s SJOIN 1 %s +ntm :@%S", servername, c_Forest);
44
45 sock_gets(sock,buffer,sizeof(buffer)-1); /* -1 added thanks to
46 David Duchene <dave@ltd.com> for pointing out the possible
47@@ -128,11 +125,28 @@
48 gameserv(source, rest);
49 else if (stricmp(dest, c_Forest) == 0)
50 forest(source, rest);
51- } else if (stricmp(cmd, "JOIN") == 0) {
52+ } else if (stricmp(cmd, "SJOIN") == 0) {
53 char *channel;
54- channel = strtok(NULL, " ");
55- if (stricmp(channel, c_Forest) == 0 && is_playing(source + 1))
56- raw(":%S MODE %s +v %s", c_Forest, (source + 1));
57+ char *userptr;
58+ char *tmp;
59+ channel = strtok(NULL, " "); // channel timestamp
60+ channel = strtok(NULL, " "); // channel name
61+ tmp = strrchr(buffer, ':');
62+ tmp++;
63+ userptr = strtok(tmp, " ");
64+ while (userptr != NULL)
65+ {
66+ if (*userptr == '@')
67+ userptr++;
68+ if (*userptr == '+')
69+ userptr++; // Assume that for users opped and voiced
70+ // that they are never passed as +@user
71+
72+ if (stricmp(channel, c_Forest) == 0 && is_playing(userptr))
73+ raw(":%S MODE %s +v %s", c_Forest, userptr);
74+
75+ userptr = strtok(NULL, " ");
76+ }
77 } else {
78 // cout << "Unrecognized Message: cmd = " << cmd << setw(30) << "source = " <<
79 // source << endl;