using std::ifstream;
char *PACKAGE = "GameServ";
-char *VERSION = "1.1.8";
+char *VERSION = "1.1.7";
int sock;
long timestamp;
#if defined(P10)
raw("%s T %s :%s", gsnum, c_Forest, c_ForestTopic);
+ raw("[] EB"); // End burst
#else
raw(":%S MODE %s +o %S", c_Forest);
raw(":%S TOPIC %s :%s", c_Forest, c_ForestTopic);
timestamp = strtok(NULL, " ");
raw("[] Z [] %s 0 %s", timestamp + 1, timestamp);
#endif
-
+ #ifdef P10
+ } else if (stricmp(cmd, "EB") == 0) {
+ raw("[] EA");
+ #endif
} else if (stricmp(cmd, "VERSION") == 0) {
char *server;
server = strtok(NULL, " ");
server++;
raw(":%s 351 %s %s %s. %s", servername, source+1, PACKAGE, VERSION, servername);
+ #if !defined(P10)
} else if (strncmp(cmd, "NICK", 4) == 0) {
if (buffer[0] == ':')
{
else
{
char *nick;
+ #else
+ } else if (stricmp(cmd, "N") == 0 && strlen(source) == 2) {
+ {
+ char *nick;
+
+ for (int x = 0; x < 6; x++)
+ nick = strtok(NULL, " ");
+
+ if (nick[0] == '+')
+ {
+ #ifdef DEBUGMODE
+ log ("aClient has modes");
+ #endif
+
+ // Searching for the +r mode (extra parameter)
+ for (unsigned int count = 1; count < strlen(nick); count++)
+ {
+ if (nick[count] == 'r')
+ {
+ nick = strtok(NULL, " ");
+ break;
+ }
+ }
+ nick = strtok(NULL, " ");
+ }
+ #endif
aClient *newuser;
+
nick = strtok(NULL, " ");
+
newuser = new aClient(nick);
if (loaded)
notice(s_GameServ, nick, welcomemsg, nick);
clients.insertAtBack(newuser);
delete newuser;
}
+ #if defined(P10)
+ } else if (stricmp(cmd, "Q") == 0) {
+ #else
} else if (stricmp(cmd, "QUIT") == 0) {
+ #endif
aClient *quitter;
- if ((quitter = find(source + 1)))
+ char z = source[0];
+
+ if (z == ':')
+ source++;
+
+ if ((quitter = find(source)))
clients.remove(quitter);
- if ((quitter = findIRCplayer(source + 1)))
+ if ((quitter = findIRCplayer(source)))
{
quitter->setNick("!NULL!");
quitter->stats->user = NULL; // Unidentify them
}
+ if (z == ':')
+ source--;
+
+ #if defined(P10)
+ } else if (stricmp(cmd, "P") == 0) {
+ char *rest, *dest;
+ char *longname;
+ longname = new char[strlen(s_GameServ) + strlen(servername) + 2];
+
+ sprintf(longname, "%S@%s", servername);
+
+ dest = strtok(NULL, " ");
+ rest = strtok(NULL, "");
+ if (stricmp(dest, gsnum) == 0 || stricmp(dest, longname) == 0)
+ {
+ delete [] longname;
+ gameserv(source, rest);
+ }
+ else if (stricmp(dest, c_Forest) == 0)
+ {
+ delete [] longname;
+ forest(source, rest);
+ }
+ #else
} else if (stricmp(cmd, "PRIVMSG") == 0) {
char *rest, *dest;
dest = strtok(NULL, " ");
gameserv(source, rest);
else if (stricmp(dest, c_Forest) == 0)
forest(source, rest);
+ #endif
} else if (stricmp(cmd, "JOIN") == 0) {
char *channel;
channel = strtok(NULL, " ");
while (newPtr)
{
client = newPtr->getData();
- if (stricmp(client->getNick(), nick) == 0)
+ #ifdef P10
+ log("Comparing %s with %s", client->getNick(), nick);
+ if (strcmp(client->getNick(), nick) == 0)
+ #else
+ if (stricmp(client->getNick(), nick) == 0)
+ #endif
return client;
client = NULL;
newPtr = newPtr->Next();
for (newPtr = players.First(); newPtr; newPtr = newPtr->Next())
{
p = newPtr->getData();
- if (stricmp(p->getNick(), nick) == 0)
+ #ifdef P10
+ if (strcmp(p->getNick(), nick) == 0)
+ #else
+ if (stricmp(p->getNick(), nick) == 0)
+ #endif
return p;
p = NULL;
}
while (newPtr)
{
client = newPtr->getData();
- if (stricmp(client->getNick(), nick) == 0)
+ #ifdef P10
+ if (strcmp(client->getNick(), nick) == 0)
+ #else
+ if (stricmp(client->getNick(), nick) == 0)
+ #endif
return client;
client = NULL;
newPtr = newPtr->Next();