diff --git a/src/server/dispense.c b/src/server/dispense.c index 15962a3e36f3544a97d7be6d0c120a08c5fd19be..b0a59364e5c8ae63479e151adfbf66d3b8148157 100644 --- a/src/server/dispense.c +++ b/src/server/dispense.c @@ -319,9 +319,12 @@ int _GetMinBalance(int Account) /** * \brief Check if a transfer is possible + * \return Boolean success */ int _CanTransfer(int Source, int Destination, int Ammount) { + if( Bank_GetFlags(Source) & USER_FLAG_DISABLED ) + return 0; if( Ammount > 0 ) { if( Bank_GetBalance(Source) - Ammount < _GetMinBalance(Source) ) diff --git a/src/server/handler_coke.c b/src/server/handler_coke.c index 15cb8d3ab1c279db1ec12e9c634f83ba7774bad3..fb58f799b337307d0964ba6a85b73f158b4d2931 100644 --- a/src/server/handler_coke.c +++ b/src/server/handler_coke.c @@ -73,20 +73,21 @@ int Coke_InitHandler() // Reset the slot names. // - Dunno why this is needed, but the machine plays silly // sometimes. - Writef("n0 Slot0\n"); + Writef("n0 Slot0\r\n"); if( !WaitForColon() ) { - Writef("n1 Slot1\n"); + Writef("n1 Slot1\r\n"); WaitForColon(); - Writef("n2 Slot2\n"); + Writef("n2 Slot2\r\n"); WaitForColon(); - Writef("n3 Slot3\n"); + Writef("n3 Slot3\r\n"); WaitForColon(); - Writef("n4 Slot4\n"); + Writef("n4 Slot4\r\n"); WaitForColon(); - Writef("n5 Slot5\n"); + Writef("n5 Slot5\r\n"); + WaitForColon(); + Writef("n6 Coke\r\n"); WaitForColon(); - Writef("n6 Coke\n"); Coke_int_UpdateSlotStatuses(); } diff --git a/src/server/itemdb.c b/src/server/itemdb.c index 49fb743dd609302cba0104ab4b3ca377b9aa4c2c..8f2cfeccd0a1cad82cb33f153b85413ea30c048f 100644 --- a/src/server/itemdb.c +++ b/src/server/itemdb.c @@ -16,6 +16,8 @@ #include <sys/stat.h> #include <time.h> +#define DUMP_ITEMS 0 + // === IMPORTS === extern tHandler gCoke_Handler; extern tHandler gSnack_Handler; @@ -169,7 +171,9 @@ void Items_ReadFromFile(void) price = atoi( line + matches[3].rm_so ); desc = line + matches[4].rm_so; + #if DUMP_ITEMS printf("Item '%s' - %i cents, %s:%i\n", desc, price, type, num); + #endif handler = NULL; for( i = 0; i < giNumHandlers; i ++ ) @@ -190,7 +194,9 @@ void Items_ReadFromFile(void) if( items[i].Handler != handler ) continue; if( items[i].ID != num ) continue; + #if DUMP_ITEMS printf("Redefinition of %s:%i, updated\n", handler->Name, num); + #endif items[i].Price = price; free(items[i].Name); items[i].Name = strdup(desc); diff --git a/src/server/server.c b/src/server/server.c index 32e4c10514ad09f1b00212074898d5ae94d4d638..1faa6fe914e2ddb26653479209c27411d61d6e57 100644 --- a/src/server/server.c +++ b/src/server/server.c @@ -18,8 +18,9 @@ #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 @@ -166,6 +167,7 @@ void Server_Start(void) } if( pid != 0 ) { // Parent, quit + printf("Forked child %i\n", pid); exit(0); } // In child @@ -178,6 +180,8 @@ void Server_Start(void) 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 }