X-Git-Url: https://jfr.im/git/irc/gameservirc.git/blobdiff_plain/36b31e1c4586267c36d76d7442e5c682f6ee243e..11f32a66ef4b0b3ee957af30a8d5b235a18aac9f:/gameserv/gameserv.cpp diff --git a/gameserv/gameserv.cpp b/gameserv/gameserv.cpp index 218eefe..33237ac 100644 --- a/gameserv/gameserv.cpp +++ b/gameserv/gameserv.cpp @@ -2128,6 +2128,19 @@ int load_gs_dbase() return 0; } + for (int x = 0; x < U_TABLE_SIZE; x++) + { + ListNode *tempNode; + tempNode = players[x].First(); + while (tempNode) + { + if (tempNode->getData()->stats->client) + logout(tempNode->getData()->stats->client); + tempNode = tempNode->Next(); + } + players[x].deleteNodes(); + } + while (infile.getline(buf, 1024, '\n')) { temp = new aClient; @@ -2521,7 +2534,6 @@ void do_tavern(char *u) else if (stricmp(cmd, "BUY") == 0) { char *chnum = strtok(NULL, " "); - int num = stringtoint(chnum); if (!chnum) { @@ -2529,6 +2541,8 @@ void do_tavern(char *u) notice(s_GameServ, u, "Example: /msg %S TAVERN BUY 1"); return; } + int num = stringtoint(chnum); + if (num < 1 || num > 4) { notice(s_GameServ, u, "Invalid Choice!"); @@ -2658,7 +2672,12 @@ void do_bank(char *u) notice(s_GameServ, u, "I don't know how to convert alphabet letters into currency, sire!"); return; } - + if (stringtoint(amount) < 0) + { + notice(s_GameServ, u, "Sorry. This bank is not licensed "\ + "to handle such sums of cash, noble Lord."); + return; + } p = user->stats; if (stricmp(cmd, "DEPOSIT") == 0)