|
@@ -43,7 +43,7 @@ int debug = 0;
|
|
|
|
|
|
|
|
|
int allowDev = 1;
|
|
|
-char * sysop_pass = "spaceISbig";
|
|
|
+char * sysop_pass = "spaceISbig";
|
|
|
|
|
|
|
|
|
typedef struct user_info {
|
|
@@ -60,6 +60,7 @@ typedef struct user_info {
|
|
|
int shieldpoints;
|
|
|
int shieldsup;
|
|
|
int laston;
|
|
|
+ int dirty;
|
|
|
char nick[256];
|
|
|
char real[256];
|
|
|
} user_inf;
|
|
@@ -130,35 +131,17 @@ int compareDate(int dt) {
|
|
|
return (now - dt);
|
|
|
}
|
|
|
|
|
|
-dT formDate(int diff) {
|
|
|
+dT fromDate(int diff) {
|
|
|
|
|
|
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;
|
|
|
- }
|
|
|
- }
|
|
|
- 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;
|
|
|
- }
|
|
|
+
|
|
|
+ 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();
|
|
|
-
|
|
|
if (inuse == 0) {
|
|
|
+
|
|
|
grab_lock();
|
|
|
- }
|
|
|
- if (inuse == 1) {
|
|
|
+ play_game();
|
|
|
+ rel_lock();
|
|
|
+ } else {
|
|
|
md_clr_scr();
|
|
|
md_sendfile("ansis/sc_inuse.ans", FALSE);
|
|
|
paws();
|
|
|
- } else {
|
|
|
-
|
|
|
- play_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) {
|
|
@@ -1742,6 +1724,7 @@ int main(int argc, char **argv) {
|
|
|
}
|
|
|
|
|
|
md_init(argv[1], socket);
|
|
|
+ atexit(cleanMe);
|
|
|
md_clr_scr();
|
|
|
|
|
|
|
|
@@ -1767,7 +1750,4 @@ int main(int argc, char **argv) {
|
|
|
|
|
|
|
|
|
main_menu();
|
|
|
-
|
|
|
-
|
|
|
- md_exit(0);
|
|
|
}
|