extern tHandler *gaHandlers[];
extern int giNumHandlers;
extern int giDebugLevel;
+extern int gbNoCostMode;
// === FUNCTIONS ===
extern void Items_UpdateFile(void);
if( res == 0 )
{
// Oops!, no drink
+ printf("Drink dispense failed, bit lowered too quickly\n");
return 1;
}
items = realloc( items, (numItems + 1)*sizeof(items[0]) );
items[numItems].Handler = handler;
items[numItems].ID = num;
- items[numItems].Price = price;
+ if( gbNoCostMode )
+ items[numItems].Price = 0;
+ else
+ items[numItems].Price = price;
items[numItems].Name = strdup(desc);
items[numItems].bHidden = (line[0] == '-');
numItems ++;
// === GLOBALS ===
int giDebugLevel = 0;
+ int gbNoCostMode = 0;
const char *gsCokebankPath = "cokebank.db";
// - Functions called every 20s (or so)
#define ciMaxPeriodics 10
gsCoke_ModbusAddress = Config_GetValue("coke_modbus_address", 0);
giServer_Port = Config_GetValue_Int("server_port", 0);
gsItemListFile = Config_GetValue("items_file", 0);
-
+
+ gbNoCostMode = Config_GetValue_Bool("test_mode", 0);
+
signal(SIGINT, sigint_handler);
signal(SIGTERM, sigint_handler);
}
}
- if( Item->Price == 0 )
+ if( !gbNoCostMode && Item->Price == 0 )
status = "error";
// KNOWN HACK: Naming a slot 'dead' disables it
if( strcmp(Item->Name, "dead") == 0 )