#define DEBUG_TRACE_CLIENT 0
#define HACK_NO_REFUNDS 1
+#define PIDFILE "/var/run/dispsrv.pid"
+
// Statistics
#define MAX_CONNECTION_QUEUE 5
#define INPUT_BUFFER_SIZE 256
// write pidfile
{
- FILE *fp = fopen("/var/run/dispsrv.pid", "w");
+ FILE *fp = fopen(PIDFILE, "w");
if( fp ) {
fprintf(fp, "%i", getpid());
fclose(fp);
{
printf("\nClose(%i)\n", giServer_Socket);
close(giServer_Socket);
- unlink("/var/run/dispsrv.pid");
+ unlink(PIDFILE);
}
/**
}
}
- 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 )
/**
* \brief Fetch information on a specific item
+ *
+ * Usage: ITEMINFO <item ID>
*/
void Server_Cmd_ITEMINFO(tClient *Client, char *Args)
{
Server_int_SendItem( Client, item );
}
+/**
+ * \brief Dispense an item
+ *
+ * Usage: DISPENSE <Item ID>
+ */
void Server_Cmd_DISPENSE(tClient *Client, char *Args)
{
tItem *item;
}
}
+/**
+ * \brief Refund an item to a user
+ *
+ * Usage: REFUND <user> <item id> [<price>]
+ */
void Server_Cmd_REFUND(tClient *Client, char *Args)
{
tItem *item;
}
}
+/**
+ * \brief Transfer money to another account
+ *
+ * Usage: GIVE <dest> <ammount> <reason...>
+ */
void Server_Cmd_GIVE(tClient *Client, char *Args)
{
char *recipient, *ammount, *reason;