#include <string.h>
#include <limits.h>
#include <stdarg.h>
-#include <signal.h>
-#include <ident.h>
+#include <signal.h> // Signal handling
+#include <ident.h> // AUTHIDENT
+#include <time.h> // time(2)
#define DEBUG_TRACE_CLIENT 0
#define HACK_NO_REFUNDS 1
}
if( pid != 0 ) {
// Parent, quit
+ printf("Forked child %i\n", pid);
exit(0);
}
// In child
freopen("/dev/null", "r", stdin);
freopen(gsServer_LogFile, "a", stdout);
freopen(gsServer_ErrorLog, "a", stderr);
+ fprintf(stdout, "OpenDispense 2 Server Started at %lld\n", (long long)time(NULL));
+ fprintf(stderr, "OpenDispense 2 Server Started at %lld\n", (long long)time(NULL));
#endif
}
return ;
}
}
+
+ // Disabled accounts
+ if( userFlags & USER_FLAG_DISABLED ) {
+ Client->UID = -1;
+ sendf(Client->Socket, "403 Account disabled\n");
+ return ;
+ }
sendf(Client->Socket, "200 User set\n");
}
}
}
+ if( Item->Price == 0 )
+ status = "error";
// KNOWN HACK: Naming a slot 'dead' disables it
if( strcmp(Item->Name, "dead") == 0 )
status = "sold"; // Another status?