From: John Hodge Date: Fri, 27 Apr 2012 03:27:41 +0000 (+0800) Subject: Server - Changed logging to note when a test dispense is done X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=00f47de18c9b8462fc21ad16d89f257c96d2e6be;p=tpg%2Fopendispense2.git Server - Changed logging to note when a test dispense is done --- diff --git a/src/server/dispense.c b/src/server/dispense.c index b0a5936..b05c81c 100644 --- a/src/server/dispense.c +++ b/src/server/dispense.c @@ -68,10 +68,21 @@ int DispenseItem(int ActualUser, int User, tItem *Item) actualUsername = Bank_GetAcctName(ActualUser); // And log that it happened - Log_Info("dispense '%s' (%s:%i) for %s by %s [cost %i, balance %i]", - Item->Name, handler->Name, Item->ID, - username, actualUsername, Item->Price, Bank_GetBalance(User) - ); + if( gbNoCostMode ) + { + // Special format for zero cost dispenses + Log_Info("test dispense '%s' (%s:%i) for %s by %s [no change]", + Item->Name, handler->Name, Item->ID, + username, actualUsername + ); + } + else + { + Log_Info("dispense '%s' (%s:%i) for %s by %s [cost %i, balance %i]", + Item->Name, handler->Name, Item->ID, + username, actualUsername, Item->Price, Bank_GetBalance(User) + ); + } free( username ); free( actualUsername );