echo "#undef BAHAMUT" >> options.h
echo "#undef P10" >> options.h
echo "#undef HYBRID" >> options.h
- echo "#undef ULTIMATE2" >> options.h;;
+ echo "#undef ULTIMATE2" >> options.h
+ echo "#undef PTLINK" >> options.h;;
2)
echo "#undef UNREAL" > options.h
echo "#define BAHAMUT" >> options.h
echo "#undef P10" >> options.h
echo "#undef HYBRID" >> options.h
- echo "#undef ULTIMATE2" >> options.h;;
+ echo "#undef ULTIMATE2" >> options.h
+ echo "#undef PTLINK" >> options.h;;
3)
echo "#undef UNREAL" > options.h
echo "#undef BAHAMUT" >> options.h
echo "#define P10" >> options.h
echo "#undef HYBRID" >> options.h
- echo "#undef ULTIMATE2" >> options.h;;
+ echo "#undef ULTIMATE2" >> options.h
+ echo "#undef PTLINK" >> options.h;;
4)
echo "#undef UNREAL" > options.h
echo "#undef BAHAMUT" >> options.h
echo "#undef P10" >> options.h
echo "#define HYBRID" >> options.h
- echo "#undef ULTIMATE2" >> options.h;;
+ echo "#undef ULTIMATE2" >> options.h
+ echo "#undef PTLINK" >> options.h;;
5)
echo "#undef UNREAL" > options.h
echo "#undef BAHAMUT" >> options.h
echo "#undef P10" >> options.h
echo "#undef HYBRID" >> options.h
- echo "#define ULTIMATE2" >> options.h;;
+ echo "#define ULTIMATE2" >> options.h
+ echo "#undef PTLINK" >> options.h;;
+ 6)
+ echo "#undef UNREAL" > options.h
+ echo "#undef BAHAMUT" >> options.h
+ echo "#undef P10" >> options.h
+ echo "#undef HYBRID" >> options.h
+ echo "#undef ULTIMATE2" >> options.h
+ echo "#define PTLINK" >> options.h;;
*)
echo
echo "Improper selection"
if (isBOper())
raw(":%S mode %S +o");
raw(":%S JOIN %s", c_Forest);
+#elif defined(PTLINK)
+ raw("PASS %s :TS", remotepass);
+ raw("SERVER %s 1 :%s", servername, servername);
+ raw("NICK %S 1 %d %s%s %s %s %s :GameServ", time(NULL), (isBOper() ? "+iow " : ""), gsident, gshost, gshost, servername);
+ raw(":%s SJOIN %d %s +nt :@%S", servername, time(NULL), c_Forest);
#elif defined(P10)
// Server numeric is: [] <-- must be unique
raw("PASS :%s", remotepass);
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] == ':')
+ if (buffer[0] == ':')
{
- aClient *tempPtr;
- if ((tempPtr = find((source + 1))))
- {
- char *nick;
- unsigned long oldhv, newhv;
- nick = strtok(NULL, " ");
- oldhv = iHASH((unsigned char *) tempPtr->getNick());
- newhv = iHASH((unsigned char *) nick);
- tempPtr->setNick(nick);
- clients[oldhv].remove(tempPtr);
- clients[newhv].insertAtBack(tempPtr);
- }
+ aClient *tempPtr;
+ if ((tempPtr = find((source + 1))))
+ {
+ char *nick;
+ unsigned long oldhv, newhv;
+ nick = strtok(NULL, " ");
+ oldhv = iHASH((unsigned char *) tempPtr->getNick());
+ newhv = iHASH((unsigned char *) nick);
+ tempPtr->setNick(nick);
+ clients[oldhv].remove(tempPtr);
+ clients[newhv].insertAtBack(tempPtr);
+ }
}
- else
+ else
{
- char *nick;
+ char *nick;
#else
} else if (stricmp(cmd, "N") == 0 && strlen(source) == 2) {
{
temp = clients[hv].insertAtBack(newuser);
- #if defined(HYBRID) || defined(BAHAMUT) || defined(ULTIMATE2)
+ #if defined(HYBRID) || defined(BAHAMUT) || defined(ULTIMATE2) || defined(PTLINK)
char *nickserver;
strtok(NULL, " ");
strtok(NULL, " ");
} else if (stricmp(cmd, "Q") == 0) {
// unsigned long hv = sHASH((unsigned char *) source);
#else
- } else if (stricmp(cmd, "QUIT") == 0) {
+ } else if (stricmp(cmd, "QUIT") == 0)
+ {
// unsigned long hv = iHASH((unsigned char *) source);
- #endif
- aClient *quitter;
- char z = source[0];
+#endif
+ aClient *quitter;
+ char z = source[0];
if (z == ':')
- source++;
-
+ source++;
+
if (!(quitter = find(source)))
- {
- log("Fatal Error: could not find %s in the "\
- "clients list", source);
- goto end;
- }
+ {
+ log("Fatal Error: could not find %s in the "\
+ "clients list", source);
+ goto end;
+ }
logout(quitter);
delete quitter;
if (z == ':')
- source--;
+ source--;
/* Attempting to use the logout() function
if ((quitter = find(source)))
aClient *findbynick(char *nick)
{
- ListNode <aClient> *newPtr;
- #ifdef P10
- unsigned long hv = sHASH((unsigned char *) nick);
- #else
- unsigned long hv = iHASH((unsigned char *) nick);
- #endif
-
- newPtr = clients[hv].First();
-
- aClient *client = NULL;
-
- while (newPtr)
+ ListNode <aClient> *newPtr;
+#ifdef P10
+ unsigned long hv = sHASH((unsigned char *) nick);
+#else
+ unsigned long hv = iHASH((unsigned char *) nick);
+#endif
+
+ newPtr = clients[hv].First();
+
+ aClient *client = NULL;
+
+ while (newPtr)
{
- client = newPtr->getData();
- #ifdef P10
- if (strcmp(client->getNick(), nick) == 0)
- #else
- if (stricmp(client->getNick(), nick) == 0)
- #endif
- return client;
- client = NULL;
- newPtr = newPtr->Next();
+ client = newPtr->getData();
+#ifdef P10
+ if (strcmp(client->getNick(), nick) == 0)
+ {
+#else
+ if (stricmp(client->getNick(), nick) == 0)
+ {
+#endif
+ return client;
+ }
+ client = NULL;
+ newPtr = newPtr->Next();
}
- return client;
+ return client;
}
aClient *findIRCplayer(const char *nick)
{
- ListNode <aClient> *newPtr;
- aClient *p = NULL;
-
- p = find(nick);
-
- if (!is_playing(p))
+ ListNode <aClient> *newPtr;
+ aClient *p = NULL;
+
+ p = find(nick);
+
+ if (!is_playing(p))
return NULL;
-
- unsigned long hv = iHASH((unsigned char *) p->stats->getName().c_str());
-
- for (newPtr = players[hv].First(); newPtr; newPtr = newPtr->Next())
+
+ unsigned long hv = iHASH((unsigned char *) p->stats->getName().c_str());
+
+ for (newPtr = players[hv].First(); newPtr; newPtr = newPtr->Next())
{
- p = newPtr->getData();
- #ifdef P10
- if (strcmp(p->getNick(), nick) == 0)
- #else
- if (stricmp(p->getNick(), nick) == 0)
- #endif
- return p;
- p = NULL;
- }
- return NULL;
+ p = newPtr->getData();
+#ifdef P10
+ if (strcmp(p->getNick(), nick) == 0)
+ {
+#else
+ if (stricmp(p->getNick(), nick) == 0)
+ {
+#endif
+ return p;
+ }
+ p = NULL;
+ }
+ return NULL;
}
aClient *findplayer(const char *name)