using std::endl;
char *PACKAGE = "GameServ";
-char *VERSION = "1.2.3 +devel";
+char *VERSION = "1.2.4 +devel";
int sock;
long lastrefresh;
exit(3);
}
- init_masters();
load_gs_dbase();
loadNews(newsdata, todaysnews);
+ if (load_masters() == false)
+ {
+ log("Error loading masters");
+ goto end;
+ }
+
if (load_monsters() == false)
{
log("Error loading monsters");
currentserver = strtok(NULL, " ");
}
- strcpy(boss.name, "Red Dragon");
- strcpy(boss.weapon, "Breath of Unholy Fire");
+ boss.name = "Red Dragon";
+ boss.weapon = "Breath of Unholy Fire";
boss.strength = 2500;
boss.gold = 2000000000;
boss.exp = 2000000000;
boss.maxhp = 6667;
boss.hp = 6667;
- strcpy(boss.death, "You finally snuff out the deadly murderous "\
+ boss.death = "You finally snuff out the deadly murderous "\
"dragon's dark flames. You have freed the land of its terror "\
- "filled reign from above!");
+ "filled reign from above!";
// This loop will retry the connection 3 times
save_gs_dbase();
saveNews(newsdata, todaysnews);
- // Send notice to the channel of the update
- notice(s_GameServ, c_Forest, "%S player data saved");
+ if (isSavedNotice())
+ {
+ // Send notice to the channel of the update
+ notice(s_GameServ, c_Forest, "%S player data saved");
+ }
}
{
#ifdef DEBUGMODE
log("Player %s (IRC: %s) joined %s",
- joiner->stats->name,
+ joiner->stats->name.c_str(),
#ifdef P10
joiner->getRealNick(),
#else
saveNews(newsdata, todaysnews);
delete_monsters();
- delete_masters();
#ifdef DEBUGMODE
log("<CLOSED>");
if (!is_playing(p))
return NULL;
- unsigned long hv = iHASH((unsigned char *) p->stats->name);
+ unsigned long hv = iHASH((unsigned char *) p->stats->name.c_str());
for (newPtr = players[hv].First(); newPtr; newPtr = newPtr->Next())
{
for (newPtr = players[hv].First(); newPtr; newPtr = newPtr->Next())
{
p = newPtr->getData()->stats;
- if (stricmp(p->name, name) == 0)
+ if (stricmp(p->name.c_str(), name) == 0)
return newPtr->getData();
p = NULL;
}