cmd = strtok(NULL, " ");
if (!cmd)
- notice(s_GameServ, source, "SYNTAX: /msg %S SEARCH FOREST");
+ notice(s_GameServ, source, "SYNTAX: /msg <S SEARCH FOREST");
else
do_forest(source);
if (!(user = find(source)))
{
- notice(s_GameServ, source, "Error: aClient not found. Contact a %S admin");
+ notice(s_GameServ, source, "Error: aClient not found. Contact a <S admin");
log("Error: aClient not found: %s", source);
}
else if (!isAdmin(user))
{
- notice(s_GameServ, source, "You must be a %S admin to use this command!");
+ notice(s_GameServ, source, "You must be a <S admin to use this command!");
}
else
{
if (!(user = find(source)))
{
- notice(s_GameServ, source, "Error: aClient not found. Contact a %S admin");
+ notice(s_GameServ, source, "Error: aClient not found. Contact a <S admin");
log("Error: aClient not found: %s", source);
}
else if (!isAdmin(user))
{
- notice(s_GameServ, source, "You must be a %S admin to use this command!");
+ notice(s_GameServ, source, "You must be a <S admin to use this command!");
}
else
{
if (!(user = find(source)))
{
- notice(s_GameServ, source, "Error: aClient not found. Contact a %S admin");
+ notice(s_GameServ, source, "Error: aClient not found. Contact a <S admin");
log("Error: aClient not found: %s", source);
}
else if (!isAdmin(user))
{
- notice(s_GameServ, source, "You must be a %S admin to use this command!");
+ notice(s_GameServ, source, "You must be a <S admin to use this command!");
}
else
{
if (!(user = find(source)))
{
- notice(s_GameServ, source, "Error: aClient not found. Contact a %S admin");
+ notice(s_GameServ, source, "Error: aClient not found. Contact a <S admin");
log("Error: aClient not found: %s", source);
}
else if (!isAdmin(user))
{
- notice(s_GameServ, source, "You must be a %S admin to use this command!");
+ notice(s_GameServ, source, "You must be a <S admin to use this command!");
}
else
{
}
else
{
- notice(s_GameServ, source, "Unknown command \002%s\002. Type /msg %S \002HELP\002 to get a list of commands.", cmd);
+ notice(s_GameServ, source, "Unknown command \002%s\002. Type /msg <S \002HELP\002 to get a list of commands.", cmd);
}
}
}
void raw(const char *fmt, ...)
{
va_list args;
- char *input;
+ char *input, *buffer;
const char *t = fmt;
- input = new char[1024];
+ input = new char[2048];
+ buffer = new char[1024];
va_start(args, fmt);
+ vsnprintf(buffer, 1024, fmt, args);
+ va_end(args);
+
memset(input, 0, sizeof(input)); // Initialize to NULL
- for (; *t; t++)
+ for (t = buffer; *t; t++)
{
- if (*t == '%')
+ if (*t == '<')
{
switch(*++t) {
- case 'd': sprintf(input, "%s%d", input, va_arg(args, int)); break;
- case 's': sprintf(input, "%s%s", input, va_arg(args, char *)); break;
- case 'S': sprintf(input, "%s%s", input, s_GameServ); break;
- case 'l':
- if (*++t == 'd')
- sprintf(input, "%s%ld", input, va_arg(args, long int)); break;
+ case 'S': sprintf(input, "%s%s", input, s_GameServ); break;
}
}
else
sprintf(input, "%s%s", input, "\r\n");
sock_puts(sock, input);
delete [] input;
- va_end(args);
+ delete [] buffer;
}
/* Send a NOTICE from the given source to the given nick. */
void notice(const char *source, const char *dest, const char *fmt, ...)
{
if (fmt[0] == '\0')
- return;
+ return;
char *commanduse;
commanduse = new char[16];
#ifdef P10
- if (isUsePrivmsg())
- strcpy(commanduse, "P");
- else
- strcpy(commanduse, "O");
+ if (isUsePrivmsg())
+ strcpy(commanduse, "P");
+ else
+ strcpy(commanduse, "O");
#else
- if (isUsePrivmsg())
- strcpy(commanduse, "PRIVMSG");
- else
- strcpy(commanduse, "NOTICE");
+ if (isUsePrivmsg())
+ strcpy(commanduse, "PRIVMSG");
+ else
+ strcpy(commanduse, "NOTICE");
#endif
va_list args;
- char *input;
+ char *input, *buffer;
const char *t = fmt;
- input = new char[1024];
+ input = new char[2048];
+ buffer = new char[1024];
va_start(args, fmt);
+ vsnprintf(buffer, 1024, fmt, args);
+ va_end(args);
+
if (dest[0] == ':')
{
- dest++;
+ dest++;
#if !defined(P10)
- sprintf(input, ":%s %s %s :", source, commanduse, dest);
+ sprintf(input, ":%s %s %s :", source, commanduse, dest);
#else
- sprintf(input, "%s %s %s :", gsnum, commanduse, dest);
+ sprintf(input, "%s %s %s :", gsnum, commanduse, dest);
#endif
- dest--;
+ dest--;
}
else
{
#if !defined(P10)
- sprintf(input, ":%s %s %s :", source, commanduse, dest);
+ sprintf(input, ":%s %s %s :", source, commanduse, dest);
#else
- sprintf(input, "%s %s %s :", gsnum, commanduse, dest);
+ sprintf(input, "%s %s %s :", gsnum, commanduse, dest);
#endif
}
-
- for (; *t; t++)
+ log("buffer: %s", buffer);
+ for (t = buffer; *t; t++)
{
- if (*t == '%')
- {
- switch(*++t) {
- case 'd': sprintf(input, "%s%d", input, va_arg(args, int)); break;
- case 's': sprintf(input, "%s%s", input, va_arg(args, char *)); break;
- case 'S': sprintf(input, "%s%s", input, s_GameServ); break;
- case 'c': sprintf(input, "%s%c", input, va_arg(args, int)); break;
- case 'l':
- if (*++t == 'd')
- sprintf(input, "%s%ld", input, va_arg(args, long int)); break;
- }
- }
- else
- {
- sprintf(input, "%s%c", input, *t);
- }
+ if (*t == '<')
+ {
+ if(*(++t) == 'S')
+ {
+ sprintf(input, "%s%s", input, s_GameServ);
+ }
+ }
+ else
+ {
+ sprintf(input, "%s%c", input, *t);
+ }
}
#ifdef DEBUGMODE
- log("Input: %s", input);
+ log("Input: %s", input);
#endif
sprintf(input, "%s%s", input, "\r\n");
sock_puts(sock, input);
delete [] commanduse;
delete [] input;
-va_end(args);
+ delete [] buffer;
}
return;
}
- list<Player*>::iterator iter;
- bool header = false;
+ if (stricmp(cmd, "TOP") == 0)
+ {
+ list<Player>::iterator iter;
+ bool header = false;
+
+ iter = myToplist.begin();
+
+ while (iter != myToplist.end())
+ {
+
+ p = &(*iter);
+ if (!header)
+ {
+ notice(s_GameServ, u, "Top Players");
+ header = true;
- for (unsigned long x = 0; x < U_TABLE_SIZE; x++)
- {
- iter = players[x].begin();
- if (!players[x].empty())
- {
- while(iter != players[x].end())
- {
- p = (*iter);
- if (cmd || is_playing(p->getClient()))
- {
- if (!header)
- {
- notice(s_GameServ, u, "Players:");
- header = true;
- }
-#ifdef P10
- notice(s_GameServ, u, "IRC: %s Game: %s", (p->getClient() ? p->getClient()->getRealNick() : "Not Playing"),
- p->getName().c_str());
-#else
- notice(s_GameServ, u, "IRC: %s Game: %s", (p->getClient() ? p->getClient()->getNick() : "Not Playing"),
- p->getName().c_str());
-#endif
- }
- iter++;
- }
- }
- }
- if (!header)
- notice(s_GameServ, u, "No one is playing");
+ }
+ notice(s_GameServ, u, "Name: %s Level: %d",
+ p->getName().c_str(), p->getLevel());
+ iter++;
+ }
+ }
else
- notice(s_GameServ, u, "End of List");
+ {
+
+ list<Player*>::iterator iter;
+ bool header = false;
+
+ for (unsigned long x = 0; x < U_TABLE_SIZE; x++)
+ {
+ iter = players[x].begin();
+ if (!players[x].empty())
+ {
+ while(iter != players[x].end())
+ {
+ p = (*iter);
+ if (cmd || is_playing(p->getClient()))
+ {
+ if (!header)
+ {
+ notice(s_GameServ, u, "Players:");
+ header = true;
+ }
+ #ifdef P10
+ notice(s_GameServ, u, "IRC: %s Game: %s", (p->getClient() ? p->getClient()->getRealNick() : "Not Playing"),
+ p->getName().c_str());
+ #else
+ notice(s_GameServ, u, "IRC: %s Game: %s", (p->getClient() ? p->getClient()->getNick() : "Not Playing"),
+ p->getName().c_str());
+ #endif
+ }
+ iter++;
+ }
+ }
+ }
+ if (!header)
+ notice(s_GameServ, u, "No one is playing");
+ else
+ notice(s_GameServ, u, "End of List");
+ }
}
void do_set(char *u)
}
else if (!name || !cmd)
{
- notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] {PASSWORD|BANK BALANCE|PLAYER FIGHTS|FOREST FIGHTS|GOLD|STRENGTH|DEFENSE|HP|MAXHP|EXP|LEVEL|ALIVE|SEEN MASTER} {STRING|NUMBER|TRUE|FALSE}");
+ notice(s_GameServ, u, "SYNTAX: /msg <S SET [NAME] {PASSWORD|BANK BALANCE|PLAYER FIGHTS|FOREST FIGHTS|GOLD|STRENGTH|DEFENSE|HP|MAXHP|EXP|LEVEL|ALIVE|SEEN MASTER} {STRING|NUMBER|TRUE|FALSE}");
return;
}
else if (!(p = findplayer(name)))
}
if (!cmd2)
{
- notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] {PASSWORD|BANK BALANCE|PLAYER FIGHTS|FOREST FIGHTS|GOLD|STRENGTH|DEFENSE|HP|MAXHP|EXP|LEVEL|ALIVE|SEEN MASTER} {STRING|NUMBER|TRUE|FALSE}");
+ notice(s_GameServ, u, "SYNTAX: /msg <S SET [NAME] {PASSWORD|BANK BALANCE|PLAYER FIGHTS|FOREST FIGHTS|GOLD|STRENGTH|DEFENSE|HP|MAXHP|EXP|LEVEL|ALIVE|SEEN MASTER} {STRING|NUMBER|TRUE|FALSE}");
return;
}
}
else if (user != p->getClient() && !isAdmin(user))
{
- notice(s_GameServ, u, "You must be a %S admin to set other peoples' passwords.");
+ notice(s_GameServ, u, "You must be a <S admin to set other peoples' passwords.");
return;
}
}
}
if (!cmd2)
{
- notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] [BANK] BALANCE <NUMBER>");
+ notice(s_GameServ, u, "SYNTAX: /msg <S SET [NAME] [BANK] BALANCE <NUMBER>");
return;
}
}
else if (stricmp(cmd2, "FIGHTS") != 0)
{
- notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] PLAYER FIGHTS <NUMBER>");
+ notice(s_GameServ, u, "SYNTAX: /msg <S SET [NAME] PLAYER FIGHTS <NUMBER>");
return;
}
else
cmd2 = strtok(NULL, " ");
if (!cmd2)
{
- notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] PLAYER FIGHTS <NUMBER>");
+ notice(s_GameServ, u, "SYNTAX: /msg <S SET [NAME] PLAYER FIGHTS <NUMBER>");
return;
}
p->setPlayerFights(stringtoint(cmd2));
}
else if (stricmp(cmd2, "FIGHTS") != 0)
{
- notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] FOREST FIGHTS <number>");
+ notice(s_GameServ, u, "SYNTAX: /msg <S SET [NAME] FOREST FIGHTS <number>");
return;
}
else
cmd2 = strtok(NULL, " ");
if (!cmd2)
{
- notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] FOREST FIGHTS <NUMBER>");
+ notice(s_GameServ, u, "SYNTAX: /msg <S SET [NAME] FOREST FIGHTS <NUMBER>");
return;
}
{
if (!cmd2)
{
- notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] GOLD <NUMBER>");
+ notice(s_GameServ, u, "SYNTAX: /msg <S SET [NAME] GOLD <NUMBER>");
return;
}
p->setGold(stringtoint(cmd2));
{
if (!cmd2)
{
- notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] STRENGTH <NUMBER>");
+ notice(s_GameServ, u, "SYNTAX: /msg <S SET [NAME] STRENGTH <NUMBER>");
return;
}
{
if (!cmd2)
{
- notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] DEFENSE <NUMBER>");
+ notice(s_GameServ, u, "SYNTAX: /msg <S SET [NAME] DEFENSE <NUMBER>");
return;
}
{
if (!cmd2)
{
- notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] HP <NUMBER>");
+ notice(s_GameServ, u, "SYNTAX: /msg <S SET [NAME] HP <NUMBER>");
return;
}
{
if (!cmd2)
{
- notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] MAXHP <NUMBER>");
+ notice(s_GameServ, u, "SYNTAX: /msg <S SET [NAME] MAXHP <NUMBER>");
return;
}
p->setMaxHP(stringtoint(cmd2));
{
if (!cmd2)
{
- notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] {EXPERIENCE|EXP} <NUMBER>");
+ notice(s_GameServ, u, "SYNTAX: /msg <S SET [NAME] {EXPERIENCE|EXP} <NUMBER>");
return;
}
{
if (!cmd2)
{
- notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] LEVEL <NUMBER>");
+ notice(s_GameServ, u, "SYNTAX: /msg <S SET [NAME] LEVEL <NUMBER>");
return;
}
p->setLevel(stringtoint(cmd2));
{
if (!cmd2)
{
- notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] ALIVE TRUE|FALSE");
+ notice(s_GameServ, u, "SYNTAX: /msg <S SET [NAME] ALIVE TRUE|FALSE");
return;
}
else if (stricmp(cmd2, "TRUE") == 0)
}
else if (stricmp(cmd2, "MASTER") != 0)
{
- notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] SEEN MASTER {TRUE|FALSE}");
+ notice(s_GameServ, u, "SYNTAX: /msg <S SET [NAME] SEEN MASTER {TRUE|FALSE}");
return;
}
else
cmd2 = strtok(NULL, " ");
if (!cmd2)
{
- notice(s_GameServ, u, "SYNTAX: /msg %S SET [NICK] SEEN MASTER {TRUE|FALSE}");
+ notice(s_GameServ, u, "SYNTAX: /msg <S SET [NICK] SEEN MASTER {TRUE|FALSE}");
return;
}
else if (stricmp(cmd2, "TRUE") == 0)
else
{
notice(s_GameServ, u, "Unknown command: SET %s", cmd);
- notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] {PASSWORD|BANK BALANCE|PLAYER FIGHTS|FOREST FIGHTS|GOLD|STRENGTH|DEFENSE|HP|MAXHP|EXP|LEVEL|ALIVE|SEEN MASTER} {STRING|NUMBER|TRUE|FALSE}");
+ notice(s_GameServ, u, "SYNTAX: /msg <S SET [NAME] {PASSWORD|BANK BALANCE|PLAYER FIGHTS|FOREST FIGHTS|GOLD|STRENGTH|DEFENSE|HP|MAXHP|EXP|LEVEL|ALIVE|SEEN MASTER} {STRING|NUMBER|TRUE|FALSE}");
return;
}
}
{
if (!isAdmin(user))
{
- notice(s_GameServ, u, "You must be a %S admin to use this command!");
+ notice(s_GameServ, u, "You must be a <S admin to use this command!");
}
else if (!(p = findplayer(name)))
{
if (iter == players[hv].end())
{
notice(s_GameServ, user->getNick(), "Fatal error. Contact "\
- "%S Admin. Cannot find you in the players list. This should NEVER happen");
+ "<S Admin. Cannot find you in the players list. This should NEVER happen");
log("Error on logout(). Can't find %s in the players list",
#ifdef P10
user->getRealNick()
if (!name)
{
- notice(s_GameServ, u, "SYNTAX: /msg %S REGISTER NAME PASSWORD");
+ notice(s_GameServ, u, "SYNTAX: /msg <S REGISTER NAME PASSWORD");
}
else if (stricmp(name, s_GameServ) == 0)
{
- notice(s_GameServ, u, "You can't use %S as a name!");
+ notice(s_GameServ, u, "You can't use <S as a name!");
}
else if (!password)
{
- notice(s_GameServ, u, "SYNTAX: /msg %S REGISTER NAME PASSWORD");
+ notice(s_GameServ, u, "SYNTAX: /msg <S REGISTER NAME PASSWORD");
}
else if (strlen(name) > maxnicklen)
{
}
else
{
- notice(s_GameServ, u, "Already registered. Contact a %S admin for help.");
+ notice(s_GameServ, u, "Already registered. Contact a <S admin for help.");
}
}
}
password = strtok(NULL, " ");
if (!password || !name)
{
- notice(s_GameServ, u, "SYNTAX: /msg %S IDENTIFY NAME PASSWORD");
+ notice(s_GameServ, u, "SYNTAX: /msg <S IDENTIFY NAME PASSWORD");
}
else if (!(user = find(u)))
{
if (iter == players[hv].end())
{
- notice(s_GameServ, u, "Fatal error. Contact %S Admin. Buf: %s",
+ notice(s_GameServ, u, "Fatal error. Contact <S Admin. Buf: %s",
strtok(NULL, ""));
return;
}
notice(s_GameServ, u, "Your Hitpoints: \ 2%d\ 2", ni->getHP());
notice(s_GameServ, u, "%s's Hitpoints: \ 2%d\ 2", ni->getMonster()->name.c_str(), ni->getMonster()->hp);
notice(s_GameServ, u, "Here are your commands:");
- notice(s_GameServ, u, "/msg %S attack");
- notice(s_GameServ, u, "/msg %S run");
+ notice(s_GameServ, u, "/msg <S attack");
+ notice(s_GameServ, u, "/msg <S run");
notice(s_GameServ, u, "What will you do?");
}
}
notice(s_GameServ, u, "Your Hitpoints: \ 2%d\ 2", user->stats->getHP());
notice(s_GameServ, u, "%s's Hitpoints: \ 2%d\ 2", battle->stats->getName().c_str(), battle->stats->getHP());
notice(s_GameServ, u, "Here are your commands:");
- notice(s_GameServ, u, "/msg %S attack");
- notice(s_GameServ, u, "/msg %S run");
+ notice(s_GameServ, u, "/msg <S attack");
+ notice(s_GameServ, u, "/msg <S run");
notice(s_GameServ, u, "What will you do?");
}
}
if (!nick)
{
- notice(s_GameServ, u, "SYNTAX: /msg %S FIGHT PLAYER");
+ notice(s_GameServ, u, "SYNTAX: /msg <S FIGHT PLAYER");
return;
}
else if (!(ni = find(u)))
{
- notice(s_GameServ, u, "Fatal error. Contact a(n) %S admin. buf: %s", strtok(NULL, ""));
+ notice(s_GameServ, u, "Fatal error. Contact a(n) <S admin. buf: %s", strtok(NULL, ""));
return;
}
else if (isIgnore(ni))
if (!item || int(item[0]) < 48 || int(item[0] > 57))
{
notice(s_GameServ, u, "SYNTAX: EQUIP ####");
- notice(s_GameServ, u, "Type /msg %S HELP EQUIP for more information.");
+ notice(s_GameServ, u, "Type /msg <S HELP EQUIP for more information.");
return;
}
else if (!(user = find(u)))
{
- notice(s_GameServ, u, "Fatal error in do_equip. Contact a(n) %S Admin");
+ notice(s_GameServ, u, "Fatal error in do_equip. Contact a(n) <S Admin");
return;
}
else if (isIgnore(user))
}
else if (equip->getItem()->getType() != ARMOR && equip->getItem()->getType() != WEAPON)
{
- notice(s_GameServ, u, "You can't use %s like that. Try /msg %S use", equip->getItem()->getName().c_str());
+ notice(s_GameServ, u, "You can't use %s like that. Try /msg <S use", equip->getItem()->getName().c_str());
}
else
{
if (!item || int(item[0]) < 48 || int(item[0]) > 57 || (numuse && (int(numuse[0]) < 48 || int(numuse[0]) > 57)))
{
notice(s_GameServ, u, "SYNTAX: USE ####");
- notice(s_GameServ, u, "Type /msg %S HELP USE for more information.");
+ notice(s_GameServ, u, "Type /msg <S HELP USE for more information.");
return;
}
else if (!(user = find(u)))
{
- notice(s_GameServ, u, "Fatal Error in do_use. Contact a(n) %S Admin");
+ notice(s_GameServ, u, "Fatal Error in do_use. Contact a(n) <S Admin");
return;
}
else if (isIgnore(user))
}
else if (used->getItem()->getType() != POTION)
{
- notice(s_GameServ, u, "You can't use %s like that. Try /msg %S equip", used->getItem()->getName().c_str());
+ notice(s_GameServ, u, "You can't use %s like that. Try /msg <S equip", used->getItem()->getName().c_str());
}
else
{
if (!(user = find(u)))
{
- notice(s_GameServ, u, "Couldn't find you. Error. Contact a %S admin");
+ notice(s_GameServ, u, "Couldn't find you. Error. Contact a <S admin");
return;
}
else if (isIgnore(user))
if (!amount)
{
- notice(s_GameServ, u, "SYNTAX: /msg %S HEAL {ALL | #}");
+ notice(s_GameServ, u, "SYNTAX: /msg <S HEAL {ALL | #}");
return;
}
else if (!(ni = find(u)))
{
- notice(s_GameServ, u, "Fatal error. Contact a(n) %S admin. buf: %s", strtok(NULL, ""));
+ notice(s_GameServ, u, "Fatal error. Contact a(n) <S admin. buf: %s", strtok(NULL, ""));
return;
}
else if (isIgnore(ni))
else if (amount[0] == '-')
notice(s_GameServ, u, "You trying to cheat?");
else
- notice(s_GameServ, u, "SYNTAX: /msg %S HEAL {ALL | #}");
+ notice(s_GameServ, u, "SYNTAX: /msg <S HEAL {ALL | #}");
}
int isstringnum(char *num)
}
}
p->inventory->sort();
+ myToplist.insertPlayer(p);
players[hv].push_back(p);
}
if ((*item_iterator)->getType() == WEAPON)
{
space = spaces(strlen((*item_iterator)->getName().c_str()), ".");
- notice(s_GameServ, u, "%s%ld. %s%s%ld", ((*item_iterator)->getID() < 10 ? " " : ""), (*item_iterator)->getID(), (*item_iterator)->getName().c_str(), space, (*item_iterator)->price());
- free(space);
+ notice(s_GameServ, u, "%s%ld. %20s..........%ld",
+ ((*item_iterator)->getID() < 10 ? " " : ""),
+ (*item_iterator)->getID(), (*item_iterator)->getName().c_str(), (*item_iterator)->price());
}
}
- notice(s_GameServ, u, "To purchase a weapon, type /msg %S STORE BUY \ 2#\ 2.");
+ notice(s_GameServ, u, "To purchase a weapon, type /msg <S STORE BUY \ 2#\ 2.");
notice(s_GameServ, u, "Where # is the weapon number from the menu above.");
}
{
if ((*item_iterator)->getType() == ARMOR)
{
- space = spaces(strlen((*item_iterator)->getName().c_str()), ".");
- notice(s_GameServ, u, "%s%ld. %s%s%d",((*item_iterator)->getID() < 10 ? " " : ""), (*item_iterator)->getID(), (*item_iterator)->getName().c_str(), space, (*item_iterator)->price());
- free(space);
+ notice(s_GameServ, u, "%s%ld. %20s..........%d",
+ ((*item_iterator)->getID() < 10 ? " " : ""),
+ (*item_iterator)->getID(), (*item_iterator)->getName().c_str(),
+ (*item_iterator)->price());
}
}
- notice(s_GameServ, u, "To purchase armor, type /msg %S store buy #");
+ notice(s_GameServ, u, "To purchase armor, type /msg <S store buy #");
notice(s_GameServ, u, "Where # is the armor number from the menu above.");
}
{
notice(s_GameServ, u, "You have purchased %s! Thanks for the gold!", tempItem->getName().c_str());
p->subtractGold(tempItem->price());
- notice(s_GameServ, u, "Don't forget to type /msg %S equip %ld", tempItem->getID());
+ notice(s_GameServ, u, "Don't forget to type /msg <S equip %ld", tempItem->getID());
}
else
{
id = stringtoint(num);
if (!isstringnum(num))
{
- notice(s_GameServ, u, "SYNTAX: /msg %S store sell #");
+ notice(s_GameServ, u, "SYNTAX: /msg <S store sell #");
return;
}
else if (!(tempContainer = p->inventory->Find(id)))
if (!(user = find(u)))
{
- notice(s_GameServ, u, "Fatal Error. Contact a %S admin!");
+ notice(s_GameServ, u, "Fatal Error. Contact a <S admin!");
return;
}
else if (isIgnore(user))
if (!(user = find(u)))
{
- notice(s_GameServ, u, "Fatal Error. See a %S admin for help");
+ notice(s_GameServ, u, "Fatal Error. See a <S admin for help");
return;
}
else if (isIgnore(user))
{
notice(s_GameServ, u, "Welcome to Boot Liquors Mystic Apothecary and General Store");
notice(s_GameServ, u, "Your commands:");
- notice(s_GameServ, u, "/msg %S TAVERN {LIST | BUY} [NUMBER]");
+ notice(s_GameServ, u, "/msg <S TAVERN {LIST | BUY} [NUMBER]");
notice(s_GameServ, u, "What'll it be?");
}
else if (stricmp(cmd, "LIST") == 0)
{
notice(s_GameServ, u, "Here is a list of what we have to offer:");
showTavern(user);
- notice(s_GameServ, u, "To buy an item, type /msg %S TAVERN BUY #");
+ notice(s_GameServ, u, "To buy an item, type /msg <S TAVERN BUY #");
}
else if (stricmp(cmd, "BUY") == 0)
{
if (!chid)
{
notice(s_GameServ, u, "SYNTAX: TAVERN BUY # [#]");
- notice(s_GameServ, u, "Example: /msg %S TAVERN BUY 6001");
- notice(s_GameServ, u, "Example: /msg %S TAVERN BUY 6001 10");
+ notice(s_GameServ, u, "Example: /msg <S TAVERN BUY 6001");
+ notice(s_GameServ, u, "Example: /msg <S TAVERN BUY 6001 10");
return;
}
long id = stringtoint(chid);
notice(s_GameServ, u, "Invalid Choice!");
notice(s_GameServ, u, "Here is a list of what we have to offer:");
showTavern(user);
- notice(s_GameServ, u, "To buy an item, type /msg %S TAVERN BUY #");
+ notice(s_GameServ, u, "To buy an item, type /msg <S TAVERN BUY #");
return;
}
else if (!amount && user->stats->getGold() < tempItem->getItem()->price())
notice(s_GameServ, u, "You don't have enough gold!");
notice(s_GameServ, u, "Here is a list of what we have to offer:");
showTavern(user);
- notice(s_GameServ, u, "To buy an item, type /msg %S TAVERN BUY #");
+ notice(s_GameServ, u, "To buy an item, type /msg <S TAVERN BUY #");
}
else if (user->stats->getGold() < amt * tempItem->getItem()->price())
{
notice(s_GameServ, u, "You don't have enough gold!");
notice(s_GameServ, u, "Here is a list of what we have to offer:");
showTavern(user);
- notice(s_GameServ, u, "To buy an item, type /msg %S TAVERN BUY # [#]");
+ notice(s_GameServ, u, "To buy an item, type /msg <S TAVERN BUY # [#]");
}
else
{
else
{
notice(s_GameServ, u, "Improper Syntax.");
- notice(s_GameServ, u, "Type /msg %S HELP TAVERN for help");
+ notice(s_GameServ, u, "Type /msg <S HELP TAVERN for help");
}
return;
}
}
else if (!(user = find(u)))
{
- notice(s_GameServ, u, "Fatal Error. Couldn't find your aClient. Contact a(n) %S "\
+ notice(s_GameServ, u, "Fatal Error. Couldn't find your aClient. Contact a(n) <S "\
" admin for help");
log("Fatal Error. Couldn't find %s while executing do_bank()", u);
return;
if (!(user = find(u)))
{
- notice(s_GameServ, u, "Fatal error. Contact a(n) %S admin. buf: %s", strtok(NULL, ""));
+ notice(s_GameServ, u, "Fatal error. Contact a(n) <S admin. buf: %s", strtok(NULL, ""));
return;
}
else if (isIgnore(user))
if (!(user = find(u)))
{
- notice(s_GameServ, u, "Fatal error. Contact a(n) %S admin. buf: %s", strtok(NULL, ""));
+ notice(s_GameServ, u, "Fatal error. Contact a(n) <S admin. buf: %s", strtok(NULL, ""));
return;
}
else if (isIgnore(user))
if (!(user = find(u)))
{
- notice(s_GameServ, u, "Fatal error. Contact a(n) %S admin. buf: %s", strtok(NULL, ""));
+ notice(s_GameServ, u, "Fatal error. Contact a(n) <S admin. buf: %s", strtok(NULL, ""));
return;
}
if (!(user = find(u)))
{
- notice(s_GameServ, u, "Error: aClient not found. Contact a %S admin");
+ notice(s_GameServ, u, "Error: aClient not found. Contact a <S admin");
log("Error: aClient not found: %s", u);
return;
}
}
else if (!isAdmin(user))
{
- notice(s_GameServ, u, "You must be a %S admin to use this command!");
+ notice(s_GameServ, u, "You must be a <S admin to use this command!");
return;
}
if (!name)
if (!(user = find(u)))
{
- notice(s_GameServ, u, "Error: aClient not found. Contact a %S admin");
+ notice(s_GameServ, u, "Error: aClient not found. Contact a <S admin");
log("Error: aClient not found: %s", u);
return;
}
else if (!isAdmin(user))
{
- notice(s_GameServ, u, "You must be a %S admin to use this command!");
+ notice(s_GameServ, u, "You must be a <S admin to use this command!");
return;
}
buf = new char[1024];
while(infile.getline(buf, 1024))
{
- // Written this way, it will process %S in the helpfiles
+ // Written this way, it will process <S in the helpfiles
// Instead of notice(s_GameServ, u, "%s", buf);
notice(s_GameServ, u, buf);
}
buf = new char[1024];
while(infile.getline(buf, 1024))
{
- // Written this way, it will process %S in the helpfiles
+ // Written this way, it will process <S in the helpfiles
// Instead of notice(s_GameServ, u, "%s", buf);
notice(s_GameServ, u, buf);
}
if (!(user = find(u)))
{
log("Error: aClient not found: %s", u);
- notice(s_GameServ, u, "Error: aClient not found. Contact %S admin.");
+ notice(s_GameServ, u, "Error: aClient not found. Contact <S admin.");
return;
}
unload_config_file();
return -1;
}
- log("%S socket connected.");
+ log("<S socket connected.");
#ifdef UNREAL
raw("PASS :%s", remotepass);
raw("SERVER %s 1 :%s", servername, servername);
- raw("NICK %S 1 %d %s %s %s %d :%s v%s", time(NULL), gsident, gshost,
+ raw("NICK <S 1 %d %s %s %s %d :%s v%s", time(NULL), gsident, gshost,
servername, time(NULL), PACKAGE, VERSION);
- raw(":%S JOIN %s", c_Forest);
- raw(":%S MODE %s +tn", c_Forest);
+ raw(":<S JOIN %s", c_Forest);
+ raw(":<S MODE %s +tn", c_Forest);
#elif defined(BAHAMUT)
raw("PASS %s :TS", remotepass);
raw("SERVER %s 1 :%s", servername, servername);
- raw("NICK %S 1 %d +w%s %s %s %s 0 :GameServ", time(NULL), (isBOper() ? "o" : ""),
+ raw("NICK <S 1 %d +w%s %s %s %s 0 :GameServ", time(NULL), (isBOper() ? "o" : ""),
gsident, gshost, servername);
- raw(":%s SJOIN %d %d %s +nt :@%S", servername, time(NULL), time(NULL), c_Forest);
+ raw(":%s SJOIN %d %d %s +nt :@<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 +w%s %s %s %s :GameServ", time(NULL), (isBOper() ? "o" : ""),
+ raw("NICK <S 1 %d +w%s %s %s %s :GameServ", time(NULL), (isBOper() ? "o" : ""),
gsident, gshost, servername);
- raw(":%s SJOIN %ld %s +nt :@%S", servername, time(NULL), c_Forest);
+ raw(":%s SJOIN %ld %s +nt :@<S", servername, time(NULL), c_Forest);
#elif defined(ULTIMATE2)
raw("PASS %s :TS", remotepass);
raw("SERVER %s 1 :%s", servername, servername);
- raw("NICK %S 1 %d %s %s %s 0 :GameServ",
+ raw("NICK <S 1 %d %s %s %s 0 :GameServ",
time(NULL), gsident, gshost, servername);
if (isBOper())
- raw(":%S mode %S +o");
- raw(":%S JOIN %s", c_Forest);
+ 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);
+ 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(VLIFE)
raw("PASS %s :TS", remotepass);
raw("SERVER %s 1 %d :%s", servername, time(NULL), servername);
- raw("NNICK %S 1 %d +w%s %s %s %s %s :GameServ", time(NULL),(isBOper() ? "o" : ""), gsident, gshost, gshost, servername);
- raw(":%s SJOIN %d %s +nt :@%S", servername, time(NULL), c_Forest);
+ raw("NNICK <S 1 %d +w%s %s %s %s %s :GameServ", time(NULL),(isBOper() ? "o" : ""), gsident, gshost, gshost, servername);
+ raw(":%s SJOIN %d %s +nt :@<S", servername, time(NULL), c_Forest);
#elif defined(BAHAMUT8)
raw("PASS %s :TS", remotepass);
raw("SERVER %s %d :%s", servername, time(NULL), servername);
- raw("NICK %S 1 %d +w%s %s %s %s 0 %d :GameServ", time(NULL), (isBOper() ? "o" : ""), gsident, gshost, servername, time(NULL));
- raw(":%s SJOIN %d %d %s +nt :@%S", servername, time(NULL), time(NULL), c_Forest);
+ raw("NICK <S 1 %d +w%s %s %s %s 0 %d :GameServ", time(NULL), (isBOper() ? "o" : ""), gsident, gshost, servername, time(NULL));
+ raw(":%s SJOIN %d %d %s +nt :@<S", servername, time(NULL), time(NULL), c_Forest);
#elif defined(P10)
// Server numeric is: [] <-- must be unique
raw("PASS :%s", remotepass);
raw("SERVER %s 1 %d %d P10 []AAF :%s", servername, time(NULL), time(NULL), servername);
- raw("[] N %S 1 %d %s %s %s DAqAoB %s :%S", time(NULL), gsident, gshost,
+ raw("[] N <S 1 %d %s %s %s DAqAoB %s :<S", time(NULL), gsident, gshost,
(isBOper() ? "+o" : ""), gsnum);
raw("[] B %s %d +tn %s:o", c_Forest, time(NULL) - 864000, gsnum);
#endif
#else
#ifndef HYBRID
#if defined(ULTIMATE2)
- raw(":%s MODE %s +o %S %ld", servername, c_Forest,
+ raw(":%s MODE %s +o <S %ld", servername, c_Forest,
time(NULL));
#else
- raw(":%S MODE %s +o %S", c_Forest);
+ raw(":<S MODE %s +o <S", c_Forest);
#endif
#endif
- raw(":%S TOPIC %s :%s", c_Forest, c_ForestTopic);
+ raw(":<S TOPIC %s :%s", c_Forest, c_ForestTopic);
#endif
#ifndef P10
if (isUseNickServ())
{
- raw(":%S PRIVMSG %s :IDENTIFY %s", nsname, nspass);
+ raw(":<S PRIVMSG %s :IDENTIFY %s", nsname, nspass);
}
#endif
sock_gets(sock,buffer,sizeof(buffer)-1); /* -1 added thanks to
if (isSavedNotice())
{
// Send notice to the channel of the update
- notice(s_GameServ, c_Forest, "%S player data saved");
+ notice(s_GameServ, c_Forest, "<S player data saved");
}
}
char *longname;
longname = new char[strlen(s_GameServ) + strlen(servername) + 2];
- sprintf(longname, "%S@%s", servername);
+ sprintf(longname, "<S@%s", servername);
dest = strtok(NULL, " ");
rest = strtok(NULL, "");
#endif
c_Forest);
#endif
- raw(":%S MODE %s +v %s", c_Forest, (source));
+ raw(":<S MODE %s +v %s", c_Forest, (source));
}
if (z == ':')
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);
+ raw(":<S MODE %s +v %s", channel, nick);
nick = strtok(NULL, " ");
}