|
@@ -43,7 +43,7 @@ int debug = 0; // Are we in debug mode?
|
|
|
|
|
|
// Please change it for your system!
|
|
|
int allowDev = 1; // Allow "Beanzilla" to not need the password.
|
|
|
-char * sysop_pass = "spaceISbig"; // Not case insensitive!
|
|
|
+char * sysop_pass = "spaceISbig"; // Case sensitive!
|
|
|
|
|
|
// User Structure (This includes guns, fuel, armor, shields, HP)
|
|
|
typedef struct user_info {
|
|
@@ -60,6 +60,7 @@ typedef struct user_info {
|
|
|
int shieldpoints; // Points we get from shields (Self-Regenerates, and does not get destroyed)
|
|
|
int shieldsup; // 0 means yes, anything else means shields are offline, deduct if not 0 for each attack.
|
|
|
int laston; // 20200630 is 6-30-2020
|
|
|
+ int dirty; // Need to save?
|
|
|
char nick[256]; // What they go by on score board, this allows duping since we really go by real
|
|
|
char real[256]; // Their real name to match with drop file info, prevents someone from loging in as another
|
|
|
} user_inf;
|
|
@@ -130,35 +131,17 @@ int compareDate(int dt) {
|
|
|
return (now - dt); // 10000 = 1 Year, 100 = 1 Month, 1 = 1 Day
|
|
|
}
|
|
|
|
|
|
-dT formDate(int diff) {
|
|
|
+dT fromDate(int diff) {
|
|
|
// Reverse process so we can compare exact days or get the structure back out too.
|
|
|
dT result;
|
|
|
- result.year = 0;
|
|
|
- result.month = 0;
|
|
|
- result.day = 0;
|
|
|
+ result.year = diff / 10000;
|
|
|
+ result.month = (diff / 100) % 100;
|
|
|
+ result.day = diff % 100;
|
|
|
result.age = 0;
|
|
|
- int notDone = 1;
|
|
|
- while(notDone) {
|
|
|
- if(diff >= 10000) {
|
|
|
- diff -= 10000;
|
|
|
- result.year += 1;
|
|
|
- } else if(diff >= 100) {
|
|
|
- diff -= 100;
|
|
|
- result.month += 1;
|
|
|
- } else if(diff >= 1) {
|
|
|
- diff -= 1;
|
|
|
- result.day += 1;
|
|
|
- } else {
|
|
|
- notDone = 0;
|
|
|
- }
|
|
|
- } // Process Aprox day count
|
|
|
- if(result.year != 0) {
|
|
|
- result.age += (365 * result.year);
|
|
|
- } else if(result.month != 0) {
|
|
|
- result.age += (30 * result.month);
|
|
|
- } else if(result.day != 0) {
|
|
|
- result.age += result.day;
|
|
|
- }
|
|
|
+ // Process Aprox day count
|
|
|
+ result.age += (365 * result.year);
|
|
|
+ result.age += (30 * result.month);
|
|
|
+ result.age += result.day;
|
|
|
return result;
|
|
|
}
|
|
|
|
|
@@ -1660,21 +1643,15 @@ void main_menu() {
|
|
|
}
|
|
|
}
|
|
|
inuse = check_lock();
|
|
|
- // Lock game
|
|
|
if (inuse == 0) {
|
|
|
+ //md_printf("`bright white`Play\r\n");
|
|
|
grab_lock();
|
|
|
- }
|
|
|
- if (inuse == 1) {
|
|
|
+ play_game();
|
|
|
+ rel_lock();
|
|
|
+ } else {
|
|
|
md_clr_scr();
|
|
|
md_sendfile("ansis/sc_inuse.ans", FALSE);
|
|
|
paws();
|
|
|
- } else {
|
|
|
- //md_printf("`bright white`Play\r\n");
|
|
|
- play_game();
|
|
|
- }
|
|
|
- // Unlock game
|
|
|
- if (inuse == 0) {
|
|
|
- rel_lock();
|
|
|
}
|
|
|
break;
|
|
|
case 'a':
|
|
@@ -1724,6 +1701,11 @@ void main_menu() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+void cleanMe() {
|
|
|
+ rel_lock();
|
|
|
+ md_exit(0);
|
|
|
+}
|
|
|
+
|
|
|
int main(int argc, char **argv) {
|
|
|
int socket;
|
|
|
if (argc < 2) { // Not enough arguments
|
|
@@ -1742,6 +1724,7 @@ int main(int argc, char **argv) {
|
|
|
}
|
|
|
// Initiate MagiDoor
|
|
|
md_init(argv[1], socket);
|
|
|
+ atexit(cleanMe);
|
|
|
md_clr_scr();
|
|
|
|
|
|
// Debug System
|
|
@@ -1767,7 +1750,4 @@ int main(int argc, char **argv) {
|
|
|
|
|
|
// Main Menu
|
|
|
main_menu();
|
|
|
-
|
|
|
- // Goodbye
|
|
|
- md_exit(0);
|
|
|
}
|