-cout << endl;
-cout << " GGGG AAA MM MM EEEEEEE SSSSS EEEEEEE RRRRRR VV VV " << endl;
-cout << " GG GG AAAAA MMM MMM EE SS EE RR RR VV VV " << endl;
-cout << "GG AA AA MM MM MM EEEEE SSSSS EEEEE RRRRRR VV VV " << endl;
-cout << "GG GGG AAAAAAA MM MM EE SS EE RR RR VV VV " << endl;
-cout << "G G AA AA MM MM EEEEEEE SSSSS EEEEEEE RR RR VVV" << endl;
-cout << " GGGGG V\n\n" << endl;
-cout << "Version: " << VERSION << endl;
+ cout << endl;
+ cout << " GGGG AAA MM MM EEEEEEE SSSSS EEEEEEE RRRRRR VV VV " << endl;
+ cout << " GG GG AAAAA MMM MMM EE SS EE RR RR VV VV " << endl;
+ cout << "GG AA AA MM MM MM EEEEE SSSSS EEEEE RRRRRR VV VV " << endl;
+ cout << "GG GGG AAAAAAA MM MM EE SS EE RR RR VV VV " << endl;
+ cout << "G G AA AA MM MM EEEEEEE SSSSS EEEEEEE RR RR VVV" << endl;
+ cout << " GGGGG V\n\n" << endl;
+ cout << "Version: " << VERSION << endl;
+ cout << "http://www.gameserv.us - http://www.sourceforge.net/projects/gameservirc" << endl;
+}
+
+void load_lastrefresh()
+{
+ ifstream infile;
+ infile.open(".gsrefresh");
+ if (infile.fail())
+ {
+#ifdef DEBUGMODE
+ log("Error opening .gsrefresh");
+#endif
+
+ generate:
+ long mytime = time(NULL);
+#ifdef DEBUGMODE
+ log("Generating new refresh time");
+#endif
+
+ // Just a safety measure... tho no one should
+ // get anywhere near the actual time as their refreshperiod
+ if (refreshperiod >= mytime)
+ {
+ log("Refresh period is greater than or equal to the actual time... setting it to 86400");
+ refreshperiod = 86400;
+ }
+
+ lastrefresh = mytime - (mytime % refreshperiod);
+
+ refreshall();
+ save_lastrefresh();
+ return;
+ }
+ infile >> lastrefresh;
+
+ infile.close();
+ if (lastrefresh < 0)
+ goto generate;
+}
+
+void load_lastrollover()
+{
+ ifstream infile;
+ infile.open(".gsrollover");
+ if (infile.fail())
+ {
+#ifdef DEBUGMODE
+ log("Error opening .gsrollover");
+#endif
+
+ generate:
+ long mytime = time(NULL);
+#ifdef DEBUGMODE
+ log("Generating new rollover time");
+#endif
+ lastrollover = mytime;
+ return;
+ }
+ infile >> lastrollover;
+
+ infile.close();
+ if (lastrollover < 0)
+ goto generate;
+}
+
+void save_lastrefresh()
+{
+ ofstream outfile;
+
+ outfile.open(".gsrefresh");
+
+ if (outfile.fail())
+ {
+ log("Error creating new file .gsrefresh");
+ return;
+ }
+ outfile << lastrefresh << endl << lastrollover;
+
+ outfile.close();
+}
+
+void save_lastrollover()
+{
+ ofstream outfile;
+
+ outfile.open(".gsrollover");
+
+ if (outfile.fail())
+ {
+ log("Error creating new file .gsrollover");
+ return;
+ }
+ outfile << lastrollover << endl;
+ outfile.close();
+}
+void clearItems()
+{
+ list<item*>::iterator iter;
+ for (iter = Items.begin(); iter != Items.end(); iter++)
+ {
+ delete (*iter);
+ Items.erase(iter);
+ }
+}
+void clearClients()
+{
+ list<aClient*>::iterator iter;
+ for (unsigned long x = 0; x < U_TABLE_SIZE; x++)
+ {
+ for (iter = clients[x].begin(); iter != clients[x].end(); iter++)
+ {
+ delete (*iter);
+ clients[x].erase(iter);
+ }
+ }
+}
+
+void clearPlayers()
+{
+ list<Player*>::iterator iter;
+ for (unsigned long x = 0; x < U_TABLE_SIZE; x++)
+ {
+ for (iter = players[x].begin(); iter != players[x].end(); iter++)
+ {
+ delete (*iter);
+ players[x].erase(iter);
+ }
+ }