/**
* \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) )
// 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();
}
#include <sys/stat.h>
#include <time.h>
+#define DUMP_ITEMS 0
+
// === IMPORTS ===
extern tHandler gCoke_Handler;
extern tHandler gSnack_Handler;
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 ++ )
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);
#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
}