1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This source file has been modified by the following contributors:
5 // Copyright (C) 2019 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
7 // This program is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU Affero General Public License as
9 // published by the Free Software Foundation, either version 3 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU Affero General Public License for more details.
17 // You should have received a copy of the GNU Affero General Public License
18 // along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #include "game_share/utils.h"
22 #include "log_item_gen.h"
25 #include "logger_service_itf.h"
26 #include "logger_service_client.h"
28 // A function fo force linking of this code module
29 void forceLink_Item(){}
36 friend class CLoggerClient
;
38 /// The list of log definition for this log class
39 std::vector
<LGS::TLogDefinition
> _LogDefs
;
41 /// Stack of context variable
43 std::vector
<NLMISC::CEntityId
> _charId
;
45 std::vector
<NLMISC::CEntityId
> _validatorCharId
;
47 std::vector
<NLMISC::CEntityId
> _otherEntityId
;
50 /// Counter of 'no context' object stacked.
51 uint32 _NoContextCount
;
61 LGS::TLogDefinition
&logDef
= _LogDefs
[0];
63 logDef
.setLogName("Item_BuyItem");
65 logDef
.setContext(true);
71 LGS::TLogDefinition
&logDef
= _LogDefs
[1];
73 logDef
.setLogName("Item_CreateGuild");
75 logDef
.setContext(true);
81 LGS::TLogDefinition
&logDef
= _LogDefs
[2];
83 logDef
.setLogName("Item_BuyGuildOption");
85 logDef
.setContext(true);
91 LGS::TLogDefinition
&logDef
= _LogDefs
[3];
93 logDef
.setLogName("Item_Forage");
95 logDef
.setContext(true);
101 LGS::TLogDefinition
&logDef
= _LogDefs
[4];
103 logDef
.setLogName("Item_QuarterOrLoot");
105 logDef
.setContext(true);
111 LGS::TLogDefinition
&logDef
= _LogDefs
[5];
113 logDef
.setLogName("Item_OtherTempPickup");
115 logDef
.setContext(true);
121 LGS::TLogDefinition
&logDef
= _LogDefs
[6];
123 logDef
.setLogName("Item_AutoMissionLoot");
125 logDef
.setContext(true);
131 LGS::TLogDefinition
&logDef
= _LogDefs
[7];
133 logDef
.setLogName("Item_Craft");
135 logDef
.setContext(true);
141 LGS::TLogDefinition
&logDef
= _LogDefs
[8];
143 logDef
.setLogName("Item_Mission");
145 logDef
.setContext(true);
151 LGS::TLogDefinition
&logDef
= _LogDefs
[9];
153 logDef
.setLogName("Item_Sell");
155 logDef
.setContext(true);
161 LGS::TLogDefinition
&logDef
= _LogDefs
[10];
163 logDef
.setLogName("Item_Destroy");
165 logDef
.setContext(true);
171 LGS::TLogDefinition
&logDef
= _LogDefs
[11];
173 logDef
.setLogName("Item_DropTempInventory");
175 logDef
.setContext(true);
181 LGS::TLogDefinition
&logDef
= _LogDefs
[12];
183 logDef
.setLogName("Item_DestroySaleStore");
185 logDef
.setContext(true);
191 LGS::TLogDefinition
&logDef
= _LogDefs
[13];
193 logDef
.setLogName("Item_SaleStoreTimeout");
195 logDef
.setContext(true);
201 LGS::TLogDefinition
&logDef
= _LogDefs
[14];
203 logDef
.setLogName("Item_ConsumeAmmo");
205 logDef
.setContext(true);
211 LGS::TLogDefinition
&logDef
= _LogDefs
[15];
213 logDef
.setLogName("Item_ConsumeFaberMp");
215 logDef
.setContext(true);
221 LGS::TLogDefinition
&logDef
= _LogDefs
[16];
223 logDef
.setLogName("Item_Consume");
225 logDef
.setContext(true);
231 LGS::TLogDefinition
&logDef
= _LogDefs
[17];
233 logDef
.setLogName("Item_Exchange");
235 logDef
.setContext(true);
241 LGS::TLogDefinition
&logDef
= _LogDefs
[18];
243 logDef
.setLogName("Item_BadSheet");
245 logDef
.setContext(true);
251 LGS::TLogDefinition
&logDef
= _LogDefs
[19];
253 logDef
.setLogName("Item_Swap");
255 logDef
.setContext(true);
261 LGS::TLogDefinition
&logDef
= _LogDefs
[20];
263 logDef
.setLogName("Item_Command");
265 logDef
.setContext(true);
271 LGS::TLogDefinition
&logDef
= _LogDefs
[21];
273 logDef
.setLogName("Item_PetDespawn");
275 logDef
.setContext(true);
281 LGS::TLogDefinition
&logDef
= _LogDefs
[22];
283 logDef
.setLogName("Item_NoRent");
285 logDef
.setContext(true);
291 LGS::TLogDefinition
&logDef
= _LogDefs
[23];
293 logDef
.setLogName("Item_OutpostDriller");
295 logDef
.setContext(true);
301 LGS::TLogDefinition
&logDef
= _LogDefs
[24];
305 logDef
.setLogName("Item_Create");
306 logDef
.setLogText("Character has a new item in an inventory");
308 logDef
.getParams().resize(5);
309 logDef
.getListParams().resize(0);
312 logDef
.getParams()[0].setName("charId");
313 logDef
.getParams()[0].setType(LGS::TSupportedParamType::spt_entityId
);
315 logDef
.getParams()[1].setName("itemId");
316 logDef
.getParams()[1].setType(LGS::TSupportedParamType::spt_itemId
);
317 logDef
.getParams()[1].setList(false);
319 logDef
.getParams()[2].setName("sheetId");
320 logDef
.getParams()[2].setType(LGS::TSupportedParamType::spt_sheetId
);
321 logDef
.getParams()[2].setList(false);
323 logDef
.getParams()[3].setName("quantity");
324 logDef
.getParams()[3].setType(LGS::TSupportedParamType::spt_uint32
);
325 logDef
.getParams()[3].setList(false);
327 logDef
.getParams()[4].setName("quality");
328 logDef
.getParams()[4].setType(LGS::TSupportedParamType::spt_uint32
);
329 logDef
.getParams()[4].setList(false);
334 LGS::TLogDefinition
&logDef
= _LogDefs
[25];
338 logDef
.setLogName("Item_UpdateQuantity");
339 logDef
.setLogText("The stack size has changed (ie the quantity)");
341 logDef
.getParams().resize(4);
342 logDef
.getListParams().resize(0);
345 logDef
.getParams()[0].setName("charId");
346 logDef
.getParams()[0].setType(LGS::TSupportedParamType::spt_entityId
);
348 logDef
.getParams()[1].setName("itemId");
349 logDef
.getParams()[1].setType(LGS::TSupportedParamType::spt_itemId
);
350 logDef
.getParams()[1].setList(false);
352 logDef
.getParams()[2].setName("quantity");
353 logDef
.getParams()[2].setType(LGS::TSupportedParamType::spt_uint32
);
354 logDef
.getParams()[2].setList(false);
356 logDef
.getParams()[3].setName("oldQuantity");
357 logDef
.getParams()[3].setType(LGS::TSupportedParamType::spt_uint32
);
358 logDef
.getParams()[3].setList(false);
363 LGS::TLogDefinition
&logDef
= _LogDefs
[26];
367 logDef
.setLogName("Item_Move");
368 logDef
.setLogText("The item is moved from one inventory to another");
370 logDef
.getParams().resize(4);
371 logDef
.getListParams().resize(0);
374 logDef
.getParams()[0].setName("charId");
375 logDef
.getParams()[0].setType(LGS::TSupportedParamType::spt_entityId
);
377 logDef
.getParams()[1].setName("itemId");
378 logDef
.getParams()[1].setType(LGS::TSupportedParamType::spt_itemId
);
379 logDef
.getParams()[1].setList(false);
381 logDef
.getParams()[2].setName("srcInventoryId");
382 logDef
.getParams()[2].setType(LGS::TSupportedParamType::spt_string
);
383 logDef
.getParams()[2].setList(false);
385 logDef
.getParams()[3].setName("dstInventoryId");
386 logDef
.getParams()[3].setType(LGS::TSupportedParamType::spt_string
);
387 logDef
.getParams()[3].setList(false);
392 LGS::TLogDefinition
&logDef
= _LogDefs
[27];
396 logDef
.setLogName("Item_PutInSaleStore");
397 logDef
.setLogText("The item have been put in sale store");
399 logDef
.getParams().resize(2);
400 logDef
.getListParams().resize(0);
403 logDef
.getParams()[0].setName("charId");
404 logDef
.getParams()[0].setType(LGS::TSupportedParamType::spt_entityId
);
406 logDef
.getParams()[1].setName("itemId");
407 logDef
.getParams()[1].setType(LGS::TSupportedParamType::spt_itemId
);
408 logDef
.getParams()[1].setList(false);
413 LGS::TLogDefinition
&logDef
= _LogDefs
[28];
417 logDef
.setLogName("Item_RemoveFromSaleStore");
418 logDef
.setLogText("The item have retired from the sale store");
420 logDef
.getParams().resize(2);
421 logDef
.getListParams().resize(0);
424 logDef
.getParams()[0].setName("charId");
425 logDef
.getParams()[0].setType(LGS::TSupportedParamType::spt_entityId
);
427 logDef
.getParams()[1].setName("itemId");
428 logDef
.getParams()[1].setType(LGS::TSupportedParamType::spt_itemId
);
429 logDef
.getParams()[1].setList(false);
434 LGS::TLogDefinition
&logDef
= _LogDefs
[29];
438 logDef
.setLogName("Item_Delete");
439 logDef
.setLogText("The item is destroyed or consumed");
441 logDef
.getParams().resize(5);
442 logDef
.getListParams().resize(0);
445 logDef
.getParams()[0].setName("charId");
446 logDef
.getParams()[0].setType(LGS::TSupportedParamType::spt_entityId
);
448 logDef
.getParams()[1].setName("itemId");
449 logDef
.getParams()[1].setType(LGS::TSupportedParamType::spt_itemId
);
450 logDef
.getParams()[1].setList(false);
452 logDef
.getParams()[2].setName("sheetId");
453 logDef
.getParams()[2].setType(LGS::TSupportedParamType::spt_sheetId
);
454 logDef
.getParams()[2].setList(false);
456 logDef
.getParams()[3].setName("quantity");
457 logDef
.getParams()[3].setType(LGS::TSupportedParamType::spt_uint32
);
458 logDef
.getParams()[3].setList(false);
460 logDef
.getParams()[4].setName("quality");
461 logDef
.getParams()[4].setType(LGS::TSupportedParamType::spt_uint32
);
462 logDef
.getParams()[4].setList(false);
467 LGS::TLogDefinition
&logDef
= _LogDefs
[30];
471 logDef
.setLogName("Item_FailedAddBoughtItem");
472 logDef
.setLogText("Cannot put the bought item in the character inventory");
474 logDef
.getParams().resize(3);
475 logDef
.getListParams().resize(0);
478 logDef
.getParams()[0].setName("charId");
479 logDef
.getParams()[0].setType(LGS::TSupportedParamType::spt_entityId
);
481 logDef
.getParams()[1].setName("itemId");
482 logDef
.getParams()[1].setType(LGS::TSupportedParamType::spt_itemId
);
483 logDef
.getParams()[1].setList(false);
485 logDef
.getParams()[2].setName("dstInventoryId");
486 logDef
.getParams()[2].setType(LGS::TSupportedParamType::spt_string
);
487 logDef
.getParams()[2].setList(false);
492 LGS::TLogDefinition
&logDef
= _LogDefs
[31];
496 logDef
.setLogName("Item_Money");
497 logDef
.setLogText("The money amount change");
499 logDef
.getParams().resize(3);
500 logDef
.getListParams().resize(0);
503 logDef
.getParams()[0].setName("charId");
504 logDef
.getParams()[0].setType(LGS::TSupportedParamType::spt_entityId
);
506 logDef
.getParams()[1].setName("moneyBefore");
507 logDef
.getParams()[1].setType(LGS::TSupportedParamType::spt_uint64
);
508 logDef
.getParams()[1].setList(false);
510 logDef
.getParams()[2].setName("moneyAfter");
511 logDef
.getParams()[2].setType(LGS::TSupportedParamType::spt_uint64
);
512 logDef
.getParams()[2].setList(false);
517 LGS::TLogDefinition
&logDef
= _LogDefs
[32];
521 logDef
.setLogName("Item_ExchangeWithChar");
522 logDef
.setLogText("A character exchange with another character");
524 logDef
.getParams().resize(2);
525 logDef
.getListParams().resize(0);
528 logDef
.getParams()[0].setName("validatorCharId");
529 logDef
.getParams()[0].setType(LGS::TSupportedParamType::spt_entityId
);
531 logDef
.getParams()[1].setName("otherEntityId");
532 logDef
.getParams()[1].setType(LGS::TSupportedParamType::spt_entityId
);
537 LGS::TLogDefinition
&logDef
= _LogDefs
[33];
541 logDef
.setLogName("Item_ExchangeWithNPC");
542 logDef
.setLogText("A character exchange with a NPC");
544 logDef
.getParams().resize(2);
545 logDef
.getListParams().resize(0);
548 logDef
.getParams()[0].setName("validatorCharId");
549 logDef
.getParams()[0].setType(LGS::TSupportedParamType::spt_entityId
);
551 logDef
.getParams()[1].setName("otherEntityId");
552 logDef
.getParams()[1].setType(LGS::TSupportedParamType::spt_entityId
);
557 LGS::TLogDefinition
&logDef
= _LogDefs
[34];
559 logDef
.setLogName("Item_EnchantPhrase");
560 logDef
.setLogText("Player character crystallizes a spell phrase");
562 logDef
.setContext(true);
566 LGS::TLogDefinition
&logDef
= _LogDefs
[35];
568 logDef
.setLogName("Item_CheckSaleStore");
569 logDef
.setLogText("Check coherency between player and sale store");
571 logDef
.setContext(true);
575 LGS::TLogDefinition
&logDef
= _LogDefs
[36];
577 logDef
.setLogName("Item_SaleStoreSold");
578 logDef
.setLogText("An item was sold through the store and money is received");
580 logDef
.setContext(true);
584 LGS::TLogDefinition
&logDef
= _LogDefs
[37];
586 logDef
.setLogName("Item_EnchantOrRecharge");
587 logDef
.setLogText("A player character enchants an item with a crystallized spell phrase or recharges the sap load");
589 logDef
.setContext(true);
593 LGS::TLogDefinition
&logDef
= _LogDefs
[38];
595 logDef
.setLogName("Item_SapRechargeSpell");
596 logDef
.setLogText("A player character creates a sap load recharge");
598 logDef
.setContext(true);
602 // Register the log definitions
603 LGS::ILoggerServiceClient::addLogDefinitions(_LogDefs
);
606 // Context var stack accessor
608 bool getContextVar_charId (NLMISC::CEntityId
&value
)
613 value
= _charId
.back();
617 void pushContextVar_charId (const NLMISC::CEntityId
&value
)
619 _charId
.push_back(value
);
621 void popContextVar_charId ()
626 bool getContextVar_validatorCharId (NLMISC::CEntityId
&value
)
628 if (_validatorCharId
.empty())
631 value
= _validatorCharId
.back();
635 void pushContextVar_validatorCharId (const NLMISC::CEntityId
&value
)
637 _validatorCharId
.push_back(value
);
639 void popContextVar_validatorCharId ()
641 _validatorCharId
.pop_back();
644 bool getContextVar_otherEntityId (NLMISC::CEntityId
&value
)
646 if (_otherEntityId
.empty())
649 value
= _otherEntityId
.back();
653 void pushContextVar_otherEntityId (const NLMISC::CEntityId
&value
)
655 _otherEntityId
.push_back(value
);
657 void popContextVar_otherEntityId ()
659 _otherEntityId
.pop_back();
669 nlassert(_NoContextCount
> 0);
673 uint32
getNoContextCount()
675 return _NoContextCount
;
679 // Instantiate the descriptor class
684 const std::string
TLogContext_Item_BuyItem::_ContextName("Item_BuyItem");
685 /// The constructor push a log context in the logger system
686 TLogContext_Item_BuyItem::TLogContext_Item_BuyItem(const NLMISC::CEntityId
&charId
)
688 if (LGS::ILoggerServiceClient::isInitialized())
689 LGS::ILoggerServiceClient::getInstance()->pushLogContext(_ContextName
);
691 // stack the context param in the context class object
692 ItemDesc
.pushContextVar_charId(charId
);
696 /// The destructor pop a context in the logger system
697 TLogContext_Item_BuyItem::~TLogContext_Item_BuyItem()
699 if (LGS::ILoggerServiceClient::isInitialized())
700 LGS::ILoggerServiceClient::getInstance()->popLogContext(_ContextName
);
702 // pop the context param in the context class object
703 ItemDesc
.popContextVar_charId();
707 const std::string
TLogContext_Item_CreateGuild::_ContextName("Item_CreateGuild");
708 /// The constructor push a log context in the logger system
709 TLogContext_Item_CreateGuild::TLogContext_Item_CreateGuild(const NLMISC::CEntityId
&charId
)
711 if (LGS::ILoggerServiceClient::isInitialized())
712 LGS::ILoggerServiceClient::getInstance()->pushLogContext(_ContextName
);
714 // stack the context param in the context class object
715 ItemDesc
.pushContextVar_charId(charId
);
719 /// The destructor pop a context in the logger system
720 TLogContext_Item_CreateGuild::~TLogContext_Item_CreateGuild()
722 if (LGS::ILoggerServiceClient::isInitialized())
723 LGS::ILoggerServiceClient::getInstance()->popLogContext(_ContextName
);
725 // pop the context param in the context class object
726 ItemDesc
.popContextVar_charId();
730 const std::string
TLogContext_Item_BuyGuildOption::_ContextName("Item_BuyGuildOption");
731 /// The constructor push a log context in the logger system
732 TLogContext_Item_BuyGuildOption::TLogContext_Item_BuyGuildOption(const NLMISC::CEntityId
&charId
)
734 if (LGS::ILoggerServiceClient::isInitialized())
735 LGS::ILoggerServiceClient::getInstance()->pushLogContext(_ContextName
);
737 // stack the context param in the context class object
738 ItemDesc
.pushContextVar_charId(charId
);
742 /// The destructor pop a context in the logger system
743 TLogContext_Item_BuyGuildOption::~TLogContext_Item_BuyGuildOption()
745 if (LGS::ILoggerServiceClient::isInitialized())
746 LGS::ILoggerServiceClient::getInstance()->popLogContext(_ContextName
);
748 // pop the context param in the context class object
749 ItemDesc
.popContextVar_charId();
753 const std::string
TLogContext_Item_Forage::_ContextName("Item_Forage");
754 /// The constructor push a log context in the logger system
755 TLogContext_Item_Forage::TLogContext_Item_Forage(const NLMISC::CEntityId
&charId
)
757 if (LGS::ILoggerServiceClient::isInitialized())
758 LGS::ILoggerServiceClient::getInstance()->pushLogContext(_ContextName
);
760 // stack the context param in the context class object
761 ItemDesc
.pushContextVar_charId(charId
);
765 /// The destructor pop a context in the logger system
766 TLogContext_Item_Forage::~TLogContext_Item_Forage()
768 if (LGS::ILoggerServiceClient::isInitialized())
769 LGS::ILoggerServiceClient::getInstance()->popLogContext(_ContextName
);
771 // pop the context param in the context class object
772 ItemDesc
.popContextVar_charId();
776 const std::string
TLogContext_Item_QuarterOrLoot::_ContextName("Item_QuarterOrLoot");
777 /// The constructor push a log context in the logger system
778 TLogContext_Item_QuarterOrLoot::TLogContext_Item_QuarterOrLoot(const NLMISC::CEntityId
&charId
)
780 if (LGS::ILoggerServiceClient::isInitialized())
781 LGS::ILoggerServiceClient::getInstance()->pushLogContext(_ContextName
);
783 // stack the context param in the context class object
784 ItemDesc
.pushContextVar_charId(charId
);
788 /// The destructor pop a context in the logger system
789 TLogContext_Item_QuarterOrLoot::~TLogContext_Item_QuarterOrLoot()
791 if (LGS::ILoggerServiceClient::isInitialized())
792 LGS::ILoggerServiceClient::getInstance()->popLogContext(_ContextName
);
794 // pop the context param in the context class object
795 ItemDesc
.popContextVar_charId();
799 const std::string
TLogContext_Item_OtherTempPickup::_ContextName("Item_OtherTempPickup");
800 /// The constructor push a log context in the logger system
801 TLogContext_Item_OtherTempPickup::TLogContext_Item_OtherTempPickup(const NLMISC::CEntityId
&charId
)
803 if (LGS::ILoggerServiceClient::isInitialized())
804 LGS::ILoggerServiceClient::getInstance()->pushLogContext(_ContextName
);
806 // stack the context param in the context class object
807 ItemDesc
.pushContextVar_charId(charId
);
811 /// The destructor pop a context in the logger system
812 TLogContext_Item_OtherTempPickup::~TLogContext_Item_OtherTempPickup()
814 if (LGS::ILoggerServiceClient::isInitialized())
815 LGS::ILoggerServiceClient::getInstance()->popLogContext(_ContextName
);
817 // pop the context param in the context class object
818 ItemDesc
.popContextVar_charId();
822 const std::string
TLogContext_Item_AutoMissionLoot::_ContextName("Item_AutoMissionLoot");
823 /// The constructor push a log context in the logger system
824 TLogContext_Item_AutoMissionLoot::TLogContext_Item_AutoMissionLoot(const NLMISC::CEntityId
&charId
)
826 if (LGS::ILoggerServiceClient::isInitialized())
827 LGS::ILoggerServiceClient::getInstance()->pushLogContext(_ContextName
);
829 // stack the context param in the context class object
830 ItemDesc
.pushContextVar_charId(charId
);
834 /// The destructor pop a context in the logger system
835 TLogContext_Item_AutoMissionLoot::~TLogContext_Item_AutoMissionLoot()
837 if (LGS::ILoggerServiceClient::isInitialized())
838 LGS::ILoggerServiceClient::getInstance()->popLogContext(_ContextName
);
840 // pop the context param in the context class object
841 ItemDesc
.popContextVar_charId();
845 const std::string
TLogContext_Item_Craft::_ContextName("Item_Craft");
846 /// The constructor push a log context in the logger system
847 TLogContext_Item_Craft::TLogContext_Item_Craft(const NLMISC::CEntityId
&charId
)
849 if (LGS::ILoggerServiceClient::isInitialized())
850 LGS::ILoggerServiceClient::getInstance()->pushLogContext(_ContextName
);
852 // stack the context param in the context class object
853 ItemDesc
.pushContextVar_charId(charId
);
857 /// The destructor pop a context in the logger system
858 TLogContext_Item_Craft::~TLogContext_Item_Craft()
860 if (LGS::ILoggerServiceClient::isInitialized())
861 LGS::ILoggerServiceClient::getInstance()->popLogContext(_ContextName
);
863 // pop the context param in the context class object
864 ItemDesc
.popContextVar_charId();
868 const std::string
TLogContext_Item_Mission::_ContextName("Item_Mission");
869 /// The constructor push a log context in the logger system
870 TLogContext_Item_Mission::TLogContext_Item_Mission(const NLMISC::CEntityId
&charId
)
872 if (LGS::ILoggerServiceClient::isInitialized())
873 LGS::ILoggerServiceClient::getInstance()->pushLogContext(_ContextName
);
875 // stack the context param in the context class object
876 ItemDesc
.pushContextVar_charId(charId
);
880 /// The destructor pop a context in the logger system
881 TLogContext_Item_Mission::~TLogContext_Item_Mission()
883 if (LGS::ILoggerServiceClient::isInitialized())
884 LGS::ILoggerServiceClient::getInstance()->popLogContext(_ContextName
);
886 // pop the context param in the context class object
887 ItemDesc
.popContextVar_charId();
891 const std::string
TLogContext_Item_Sell::_ContextName("Item_Sell");
892 /// The constructor push a log context in the logger system
893 TLogContext_Item_Sell::TLogContext_Item_Sell(const NLMISC::CEntityId
&charId
)
895 if (LGS::ILoggerServiceClient::isInitialized())
896 LGS::ILoggerServiceClient::getInstance()->pushLogContext(_ContextName
);
898 // stack the context param in the context class object
899 ItemDesc
.pushContextVar_charId(charId
);
903 /// The destructor pop a context in the logger system
904 TLogContext_Item_Sell::~TLogContext_Item_Sell()
906 if (LGS::ILoggerServiceClient::isInitialized())
907 LGS::ILoggerServiceClient::getInstance()->popLogContext(_ContextName
);
909 // pop the context param in the context class object
910 ItemDesc
.popContextVar_charId();
914 const std::string
TLogContext_Item_Destroy::_ContextName("Item_Destroy");
915 /// The constructor push a log context in the logger system
916 TLogContext_Item_Destroy::TLogContext_Item_Destroy(const NLMISC::CEntityId
&charId
)
918 if (LGS::ILoggerServiceClient::isInitialized())
919 LGS::ILoggerServiceClient::getInstance()->pushLogContext(_ContextName
);
921 // stack the context param in the context class object
922 ItemDesc
.pushContextVar_charId(charId
);
926 /// The destructor pop a context in the logger system
927 TLogContext_Item_Destroy::~TLogContext_Item_Destroy()
929 if (LGS::ILoggerServiceClient::isInitialized())
930 LGS::ILoggerServiceClient::getInstance()->popLogContext(_ContextName
);
932 // pop the context param in the context class object
933 ItemDesc
.popContextVar_charId();
937 const std::string
TLogContext_Item_DropTempInventory::_ContextName("Item_DropTempInventory");
938 /// The constructor push a log context in the logger system
939 TLogContext_Item_DropTempInventory::TLogContext_Item_DropTempInventory(const NLMISC::CEntityId
&charId
)
941 if (LGS::ILoggerServiceClient::isInitialized())
942 LGS::ILoggerServiceClient::getInstance()->pushLogContext(_ContextName
);
944 // stack the context param in the context class object
945 ItemDesc
.pushContextVar_charId(charId
);
949 /// The destructor pop a context in the logger system
950 TLogContext_Item_DropTempInventory::~TLogContext_Item_DropTempInventory()
952 if (LGS::ILoggerServiceClient::isInitialized())
953 LGS::ILoggerServiceClient::getInstance()->popLogContext(_ContextName
);
955 // pop the context param in the context class object
956 ItemDesc
.popContextVar_charId();
960 const std::string
TLogContext_Item_DestroySaleStore::_ContextName("Item_DestroySaleStore");
961 /// The constructor push a log context in the logger system
962 TLogContext_Item_DestroySaleStore::TLogContext_Item_DestroySaleStore(const NLMISC::CEntityId
&charId
)
964 if (LGS::ILoggerServiceClient::isInitialized())
965 LGS::ILoggerServiceClient::getInstance()->pushLogContext(_ContextName
);
967 // stack the context param in the context class object
968 ItemDesc
.pushContextVar_charId(charId
);
972 /// The destructor pop a context in the logger system
973 TLogContext_Item_DestroySaleStore::~TLogContext_Item_DestroySaleStore()
975 if (LGS::ILoggerServiceClient::isInitialized())
976 LGS::ILoggerServiceClient::getInstance()->popLogContext(_ContextName
);
978 // pop the context param in the context class object
979 ItemDesc
.popContextVar_charId();
983 const std::string
TLogContext_Item_SaleStoreTimeout::_ContextName("Item_SaleStoreTimeout");
984 /// The constructor push a log context in the logger system
985 TLogContext_Item_SaleStoreTimeout::TLogContext_Item_SaleStoreTimeout(const NLMISC::CEntityId
&charId
)
987 if (LGS::ILoggerServiceClient::isInitialized())
988 LGS::ILoggerServiceClient::getInstance()->pushLogContext(_ContextName
);
990 // stack the context param in the context class object
991 ItemDesc
.pushContextVar_charId(charId
);
995 /// The destructor pop a context in the logger system
996 TLogContext_Item_SaleStoreTimeout::~TLogContext_Item_SaleStoreTimeout()
998 if (LGS::ILoggerServiceClient::isInitialized())
999 LGS::ILoggerServiceClient::getInstance()->popLogContext(_ContextName
);
1001 // pop the context param in the context class object
1002 ItemDesc
.popContextVar_charId();
1006 const std::string
TLogContext_Item_CheckSaleStore::_ContextName("Item_CheckSaleStore");
1007 /// The constructor push a log context in the logger system
1008 TLogContext_Item_CheckSaleStore::TLogContext_Item_CheckSaleStore(const NLMISC::CEntityId
&charId
)
1010 if (LGS::ILoggerServiceClient::isInitialized())
1011 LGS::ILoggerServiceClient::getInstance()->pushLogContext(_ContextName
);
1013 // stack the context param in the context class object
1014 ItemDesc
.pushContextVar_charId(charId
);
1018 /// The destructor pop a context in the logger system
1019 TLogContext_Item_CheckSaleStore::~TLogContext_Item_CheckSaleStore()
1021 if (LGS::ILoggerServiceClient::isInitialized())
1022 LGS::ILoggerServiceClient::getInstance()->popLogContext(_ContextName
);
1024 // pop the context param in the context class object
1025 ItemDesc
.popContextVar_charId();
1029 const std::string
TLogContext_Item_SaleStoreSold::_ContextName("Item_SaleStoreSold");
1030 /// The constructor push a log context in the logger system
1031 TLogContext_Item_SaleStoreSold::TLogContext_Item_SaleStoreSold(const NLMISC::CEntityId
&charId
)
1033 if (LGS::ILoggerServiceClient::isInitialized())
1034 LGS::ILoggerServiceClient::getInstance()->pushLogContext(_ContextName
);
1036 // stack the context param in the context class object
1037 ItemDesc
.pushContextVar_charId(charId
);
1041 /// The destructor pop a context in the logger system
1042 TLogContext_Item_SaleStoreSold::~TLogContext_Item_SaleStoreSold()
1044 if (LGS::ILoggerServiceClient::isInitialized())
1045 LGS::ILoggerServiceClient::getInstance()->popLogContext(_ContextName
);
1047 // pop the context param in the context class object
1048 ItemDesc
.popContextVar_charId();
1052 const std::string
TLogContext_Item_ConsumeAmmo::_ContextName("Item_ConsumeAmmo");
1053 /// The constructor push a log context in the logger system
1054 TLogContext_Item_ConsumeAmmo::TLogContext_Item_ConsumeAmmo(const NLMISC::CEntityId
&charId
)
1056 if (LGS::ILoggerServiceClient::isInitialized())
1057 LGS::ILoggerServiceClient::getInstance()->pushLogContext(_ContextName
);
1059 // stack the context param in the context class object
1060 ItemDesc
.pushContextVar_charId(charId
);
1064 /// The destructor pop a context in the logger system
1065 TLogContext_Item_ConsumeAmmo::~TLogContext_Item_ConsumeAmmo()
1067 if (LGS::ILoggerServiceClient::isInitialized())
1068 LGS::ILoggerServiceClient::getInstance()->popLogContext(_ContextName
);
1070 // pop the context param in the context class object
1071 ItemDesc
.popContextVar_charId();
1075 const std::string
TLogContext_Item_ConsumeFaberMp::_ContextName("Item_ConsumeFaberMp");
1076 /// The constructor push a log context in the logger system
1077 TLogContext_Item_ConsumeFaberMp::TLogContext_Item_ConsumeFaberMp(const NLMISC::CEntityId
&charId
)
1079 if (LGS::ILoggerServiceClient::isInitialized())
1080 LGS::ILoggerServiceClient::getInstance()->pushLogContext(_ContextName
);
1082 // stack the context param in the context class object
1083 ItemDesc
.pushContextVar_charId(charId
);
1087 /// The destructor pop a context in the logger system
1088 TLogContext_Item_ConsumeFaberMp::~TLogContext_Item_ConsumeFaberMp()
1090 if (LGS::ILoggerServiceClient::isInitialized())
1091 LGS::ILoggerServiceClient::getInstance()->popLogContext(_ContextName
);
1093 // pop the context param in the context class object
1094 ItemDesc
.popContextVar_charId();
1098 const std::string
TLogContext_Item_Consume::_ContextName("Item_Consume");
1099 /// The constructor push a log context in the logger system
1100 TLogContext_Item_Consume::TLogContext_Item_Consume(const NLMISC::CEntityId
&charId
)
1102 if (LGS::ILoggerServiceClient::isInitialized())
1103 LGS::ILoggerServiceClient::getInstance()->pushLogContext(_ContextName
);
1105 // stack the context param in the context class object
1106 ItemDesc
.pushContextVar_charId(charId
);
1110 /// The destructor pop a context in the logger system
1111 TLogContext_Item_Consume::~TLogContext_Item_Consume()
1113 if (LGS::ILoggerServiceClient::isInitialized())
1114 LGS::ILoggerServiceClient::getInstance()->popLogContext(_ContextName
);
1116 // pop the context param in the context class object
1117 ItemDesc
.popContextVar_charId();
1121 const std::string
TLogContext_Item_Exchange::_ContextName("Item_Exchange");
1122 /// The constructor push a log context in the logger system
1123 TLogContext_Item_Exchange::TLogContext_Item_Exchange(const NLMISC::CEntityId
&validatorCharId
, const NLMISC::CEntityId
&otherEntityId
)
1125 if (LGS::ILoggerServiceClient::isInitialized())
1126 LGS::ILoggerServiceClient::getInstance()->pushLogContext(_ContextName
);
1128 // stack the context param in the context class object
1129 ItemDesc
.pushContextVar_validatorCharId(validatorCharId
);
1130 ItemDesc
.pushContextVar_otherEntityId(otherEntityId
);
1134 /// The destructor pop a context in the logger system
1135 TLogContext_Item_Exchange::~TLogContext_Item_Exchange()
1137 if (LGS::ILoggerServiceClient::isInitialized())
1138 LGS::ILoggerServiceClient::getInstance()->popLogContext(_ContextName
);
1140 // pop the context param in the context class object
1141 ItemDesc
.popContextVar_validatorCharId();
1142 ItemDesc
.popContextVar_otherEntityId();
1146 const std::string
TLogContext_Item_BadSheet::_ContextName("Item_BadSheet");
1147 /// The constructor push a log context in the logger system
1148 TLogContext_Item_BadSheet::TLogContext_Item_BadSheet(const NLMISC::CEntityId
&charId
)
1150 if (LGS::ILoggerServiceClient::isInitialized())
1151 LGS::ILoggerServiceClient::getInstance()->pushLogContext(_ContextName
);
1153 // stack the context param in the context class object
1154 ItemDesc
.pushContextVar_charId(charId
);
1158 /// The destructor pop a context in the logger system
1159 TLogContext_Item_BadSheet::~TLogContext_Item_BadSheet()
1161 if (LGS::ILoggerServiceClient::isInitialized())
1162 LGS::ILoggerServiceClient::getInstance()->popLogContext(_ContextName
);
1164 // pop the context param in the context class object
1165 ItemDesc
.popContextVar_charId();
1169 const std::string
TLogContext_Item_Swap::_ContextName("Item_Swap");
1170 /// The constructor push a log context in the logger system
1171 TLogContext_Item_Swap::TLogContext_Item_Swap(const NLMISC::CEntityId
&charId
)
1173 if (LGS::ILoggerServiceClient::isInitialized())
1174 LGS::ILoggerServiceClient::getInstance()->pushLogContext(_ContextName
);
1176 // stack the context param in the context class object
1177 ItemDesc
.pushContextVar_charId(charId
);
1181 /// The destructor pop a context in the logger system
1182 TLogContext_Item_Swap::~TLogContext_Item_Swap()
1184 if (LGS::ILoggerServiceClient::isInitialized())
1185 LGS::ILoggerServiceClient::getInstance()->popLogContext(_ContextName
);
1187 // pop the context param in the context class object
1188 ItemDesc
.popContextVar_charId();
1192 const std::string
TLogContext_Item_Command::_ContextName("Item_Command");
1193 /// The constructor push a log context in the logger system
1194 TLogContext_Item_Command::TLogContext_Item_Command(const NLMISC::CEntityId
&charId
)
1196 if (LGS::ILoggerServiceClient::isInitialized())
1197 LGS::ILoggerServiceClient::getInstance()->pushLogContext(_ContextName
);
1199 // stack the context param in the context class object
1200 ItemDesc
.pushContextVar_charId(charId
);
1204 /// The destructor pop a context in the logger system
1205 TLogContext_Item_Command::~TLogContext_Item_Command()
1207 if (LGS::ILoggerServiceClient::isInitialized())
1208 LGS::ILoggerServiceClient::getInstance()->popLogContext(_ContextName
);
1210 // pop the context param in the context class object
1211 ItemDesc
.popContextVar_charId();
1215 const std::string
TLogContext_Item_PetDespawn::_ContextName("Item_PetDespawn");
1216 /// The constructor push a log context in the logger system
1217 TLogContext_Item_PetDespawn::TLogContext_Item_PetDespawn(const NLMISC::CEntityId
&charId
)
1219 if (LGS::ILoggerServiceClient::isInitialized())
1220 LGS::ILoggerServiceClient::getInstance()->pushLogContext(_ContextName
);
1222 // stack the context param in the context class object
1223 ItemDesc
.pushContextVar_charId(charId
);
1227 /// The destructor pop a context in the logger system
1228 TLogContext_Item_PetDespawn::~TLogContext_Item_PetDespawn()
1230 if (LGS::ILoggerServiceClient::isInitialized())
1231 LGS::ILoggerServiceClient::getInstance()->popLogContext(_ContextName
);
1233 // pop the context param in the context class object
1234 ItemDesc
.popContextVar_charId();
1238 const std::string
TLogContext_Item_NoRent::_ContextName("Item_NoRent");
1239 /// The constructor push a log context in the logger system
1240 TLogContext_Item_NoRent::TLogContext_Item_NoRent(const NLMISC::CEntityId
&charId
)
1242 if (LGS::ILoggerServiceClient::isInitialized())
1243 LGS::ILoggerServiceClient::getInstance()->pushLogContext(_ContextName
);
1245 // stack the context param in the context class object
1246 ItemDesc
.pushContextVar_charId(charId
);
1250 /// The destructor pop a context in the logger system
1251 TLogContext_Item_NoRent::~TLogContext_Item_NoRent()
1253 if (LGS::ILoggerServiceClient::isInitialized())
1254 LGS::ILoggerServiceClient::getInstance()->popLogContext(_ContextName
);
1256 // pop the context param in the context class object
1257 ItemDesc
.popContextVar_charId();
1261 const std::string
TLogContext_Item_OutpostDriller::_ContextName("Item_OutpostDriller");
1262 /// The constructor push a log context in the logger system
1263 TLogContext_Item_OutpostDriller::TLogContext_Item_OutpostDriller(const NLMISC::CEntityId
&charId
)
1265 if (LGS::ILoggerServiceClient::isInitialized())
1266 LGS::ILoggerServiceClient::getInstance()->pushLogContext(_ContextName
);
1268 // stack the context param in the context class object
1269 ItemDesc
.pushContextVar_charId(charId
);
1273 /// The destructor pop a context in the logger system
1274 TLogContext_Item_OutpostDriller::~TLogContext_Item_OutpostDriller()
1276 if (LGS::ILoggerServiceClient::isInitialized())
1277 LGS::ILoggerServiceClient::getInstance()->popLogContext(_ContextName
);
1279 // pop the context param in the context class object
1280 ItemDesc
.popContextVar_charId();
1284 const std::string
TLogContext_Item_EnchantPhrase::_ContextName("Item_EnchantPhrase");
1285 /// The constructor push a log context in the logger system
1286 TLogContext_Item_EnchantPhrase::TLogContext_Item_EnchantPhrase(const NLMISC::CEntityId
&charId
)
1288 if (LGS::ILoggerServiceClient::isInitialized())
1289 LGS::ILoggerServiceClient::getInstance()->pushLogContext(_ContextName
);
1291 // stack the context param in the context class object
1292 ItemDesc
.pushContextVar_charId(charId
);
1296 /// The destructor pop a context in the logger system
1297 TLogContext_Item_EnchantPhrase::~TLogContext_Item_EnchantPhrase()
1299 if (LGS::ILoggerServiceClient::isInitialized())
1300 LGS::ILoggerServiceClient::getInstance()->popLogContext(_ContextName
);
1302 // pop the context param in the context class object
1303 ItemDesc
.popContextVar_charId();
1307 const std::string
TLogContext_Item_EnchantOrRecharge::_ContextName("Item_EnchantOrRecharge");
1308 /// The constructor push a log context in the logger system
1309 TLogContext_Item_EnchantOrRecharge::TLogContext_Item_EnchantOrRecharge(const NLMISC::CEntityId
&charId
)
1311 if (LGS::ILoggerServiceClient::isInitialized())
1312 LGS::ILoggerServiceClient::getInstance()->pushLogContext(_ContextName
);
1314 // stack the context param in the context class object
1315 ItemDesc
.pushContextVar_charId(charId
);
1319 /// The destructor pop a context in the logger system
1320 TLogContext_Item_EnchantOrRecharge::~TLogContext_Item_EnchantOrRecharge()
1322 if (LGS::ILoggerServiceClient::isInitialized())
1323 LGS::ILoggerServiceClient::getInstance()->popLogContext(_ContextName
);
1325 // pop the context param in the context class object
1326 ItemDesc
.popContextVar_charId();
1330 const std::string
TLogContext_Item_SapRechargeSpell::_ContextName("Item_SapRechargeSpell");
1331 /// The constructor push a log context in the logger system
1332 TLogContext_Item_SapRechargeSpell::TLogContext_Item_SapRechargeSpell(const NLMISC::CEntityId
&charId
)
1334 if (LGS::ILoggerServiceClient::isInitialized())
1335 LGS::ILoggerServiceClient::getInstance()->pushLogContext(_ContextName
);
1337 // stack the context param in the context class object
1338 ItemDesc
.pushContextVar_charId(charId
);
1342 /// The destructor pop a context in the logger system
1343 TLogContext_Item_SapRechargeSpell::~TLogContext_Item_SapRechargeSpell()
1345 if (LGS::ILoggerServiceClient::isInitialized())
1346 LGS::ILoggerServiceClient::getInstance()->popLogContext(_ContextName
);
1348 // pop the context param in the context class object
1349 ItemDesc
.popContextVar_charId();
1354 /// No context context. Use this to disable any contextual log underneath
1355 TLogNoContext_Item::TLogNoContext_Item()
1357 ItemDesc
.pushNoContext();
1360 TLogNoContext_Item::~TLogNoContext_Item()
1362 ItemDesc
.popNoContext();
1367 void _log_Item_Create(INVENTORIES::TItemId itemId
, const NLMISC::CSheetId
&sheetId
, uint32 quantity
, uint32 quality
, const char *_filename_
, uint _lineNo_
)
1369 static LGS::TLogInfo logInfo
;
1370 static bool init
= false;
1373 logInfo
.setLogName("Item_Create");
1374 logInfo
.getParams().resize(5);
1375 logInfo
.getListParams().resize(0);
1379 // Context parameter
1380 NLMISC::CEntityId charId
;
1381 if (!ItemDesc
.getContextVar_charId(charId
))
1383 // If this bomb is thrown, you need to add a log context (or otherwise a 'noContext').
1384 STOP_IF(ItemDesc
.getNoContextCount() == 0, _filename_
<<"("<<_lineNo_
<<") : Missing log context for log 'Item'");
1389 logInfo
.getParams()[0] = LGS::TParamValue(charId
);
1391 logInfo
.getParams()[1] = LGS::TParamValue(itemId
);
1393 logInfo
.getParams()[2] = LGS::TParamValue(sheetId
);
1395 logInfo
.getParams()[3] = LGS::TParamValue(quantity
);
1397 logInfo
.getParams()[4] = LGS::TParamValue(quality
);
1400 logInfo
.setTimeStamp(NLMISC::CTime::getSecondsSince1970());
1402 if (LGS::ILoggerServiceClient::isInitialized())
1403 LGS::ILoggerServiceClient::getInstance()->sendLog(logInfo
);
1406 void _log_Item_UpdateQuantity(INVENTORIES::TItemId itemId
, uint32 quantity
, uint32 oldQuantity
, const char *_filename_
, uint _lineNo_
)
1408 static LGS::TLogInfo logInfo
;
1409 static bool init
= false;
1412 logInfo
.setLogName("Item_UpdateQuantity");
1413 logInfo
.getParams().resize(4);
1414 logInfo
.getListParams().resize(0);
1418 // Context parameter
1419 NLMISC::CEntityId charId
;
1420 if (!ItemDesc
.getContextVar_charId(charId
))
1422 // If this bomb is thrown, you need to add a log context (or otherwise a 'noContext').
1423 STOP_IF(ItemDesc
.getNoContextCount() == 0, _filename_
<<"("<<_lineNo_
<<") : Missing log context for log 'Item'");
1428 logInfo
.getParams()[0] = LGS::TParamValue(charId
);
1430 logInfo
.getParams()[1] = LGS::TParamValue(itemId
);
1432 logInfo
.getParams()[2] = LGS::TParamValue(quantity
);
1434 logInfo
.getParams()[3] = LGS::TParamValue(oldQuantity
);
1437 logInfo
.setTimeStamp(NLMISC::CTime::getSecondsSince1970());
1439 if (LGS::ILoggerServiceClient::isInitialized())
1440 LGS::ILoggerServiceClient::getInstance()->sendLog(logInfo
);
1443 void _log_Item_Move(INVENTORIES::TItemId itemId
, INVENTORIES::TInventory srcInventoryId
, INVENTORIES::TInventory dstInventoryId
, const char *_filename_
, uint _lineNo_
)
1445 static LGS::TLogInfo logInfo
;
1446 static bool init
= false;
1449 logInfo
.setLogName("Item_Move");
1450 logInfo
.getParams().resize(4);
1451 logInfo
.getListParams().resize(0);
1455 // Context parameter
1456 NLMISC::CEntityId charId
;
1457 if (!ItemDesc
.getContextVar_charId(charId
))
1459 // If this bomb is thrown, you need to add a log context (or otherwise a 'noContext').
1460 STOP_IF(ItemDesc
.getNoContextCount() == 0, _filename_
<<"("<<_lineNo_
<<") : Missing log context for log 'Item'");
1465 logInfo
.getParams()[0] = LGS::TParamValue(charId
);
1467 logInfo
.getParams()[1] = LGS::TParamValue(itemId
);
1469 logInfo
.getParams()[2] = LGS::TParamValue(INVENTORIES::toString(srcInventoryId
));
1471 logInfo
.getParams()[3] = LGS::TParamValue(INVENTORIES::toString(dstInventoryId
));
1474 logInfo
.setTimeStamp(NLMISC::CTime::getSecondsSince1970());
1476 if (LGS::ILoggerServiceClient::isInitialized())
1477 LGS::ILoggerServiceClient::getInstance()->sendLog(logInfo
);
1480 void _log_Item_PutInSaleStore(INVENTORIES::TItemId itemId
, const char *_filename_
, uint _lineNo_
)
1482 static LGS::TLogInfo logInfo
;
1483 static bool init
= false;
1486 logInfo
.setLogName("Item_PutInSaleStore");
1487 logInfo
.getParams().resize(2);
1488 logInfo
.getListParams().resize(0);
1492 // Context parameter
1493 NLMISC::CEntityId charId
;
1494 if (!ItemDesc
.getContextVar_charId(charId
))
1496 // If this bomb is thrown, you need to add a log context (or otherwise a 'noContext').
1497 STOP_IF(ItemDesc
.getNoContextCount() == 0, _filename_
<<"("<<_lineNo_
<<") : Missing log context for log 'Item'");
1502 logInfo
.getParams()[0] = LGS::TParamValue(charId
);
1504 logInfo
.getParams()[1] = LGS::TParamValue(itemId
);
1507 logInfo
.setTimeStamp(NLMISC::CTime::getSecondsSince1970());
1509 if (LGS::ILoggerServiceClient::isInitialized())
1510 LGS::ILoggerServiceClient::getInstance()->sendLog(logInfo
);
1513 void _log_Item_RemoveFromSaleStore(INVENTORIES::TItemId itemId
, const char *_filename_
, uint _lineNo_
)
1515 static LGS::TLogInfo logInfo
;
1516 static bool init
= false;
1519 logInfo
.setLogName("Item_RemoveFromSaleStore");
1520 logInfo
.getParams().resize(2);
1521 logInfo
.getListParams().resize(0);
1525 // Context parameter
1526 NLMISC::CEntityId charId
;
1527 if (!ItemDesc
.getContextVar_charId(charId
))
1529 // If this bomb is thrown, you need to add a log context (or otherwise a 'noContext').
1530 STOP_IF(ItemDesc
.getNoContextCount() == 0, _filename_
<<"("<<_lineNo_
<<") : Missing log context for log 'Item'");
1535 logInfo
.getParams()[0] = LGS::TParamValue(charId
);
1537 logInfo
.getParams()[1] = LGS::TParamValue(itemId
);
1540 logInfo
.setTimeStamp(NLMISC::CTime::getSecondsSince1970());
1542 if (LGS::ILoggerServiceClient::isInitialized())
1543 LGS::ILoggerServiceClient::getInstance()->sendLog(logInfo
);
1546 void _log_Item_Delete(INVENTORIES::TItemId itemId
, const NLMISC::CSheetId
&sheetId
, uint32 quantity
, uint32 quality
, const char *_filename_
, uint _lineNo_
)
1548 static LGS::TLogInfo logInfo
;
1549 static bool init
= false;
1552 logInfo
.setLogName("Item_Delete");
1553 logInfo
.getParams().resize(5);
1554 logInfo
.getListParams().resize(0);
1558 // Context parameter
1559 NLMISC::CEntityId charId
;
1560 if (!ItemDesc
.getContextVar_charId(charId
))
1562 // If this bomb is thrown, you need to add a log context (or otherwise a 'noContext').
1563 STOP_IF(ItemDesc
.getNoContextCount() == 0, _filename_
<<"("<<_lineNo_
<<") : Missing log context for log 'Item'");
1568 logInfo
.getParams()[0] = LGS::TParamValue(charId
);
1570 logInfo
.getParams()[1] = LGS::TParamValue(itemId
);
1572 logInfo
.getParams()[2] = LGS::TParamValue(sheetId
);
1574 logInfo
.getParams()[3] = LGS::TParamValue(quantity
);
1576 logInfo
.getParams()[4] = LGS::TParamValue(quality
);
1579 logInfo
.setTimeStamp(NLMISC::CTime::getSecondsSince1970());
1581 if (LGS::ILoggerServiceClient::isInitialized())
1582 LGS::ILoggerServiceClient::getInstance()->sendLog(logInfo
);
1585 void _log_Item_FailedAddBoughtItem(INVENTORIES::TItemId itemId
, INVENTORIES::TInventory dstInventoryId
, const char *_filename_
, uint _lineNo_
)
1587 static LGS::TLogInfo logInfo
;
1588 static bool init
= false;
1591 logInfo
.setLogName("Item_FailedAddBoughtItem");
1592 logInfo
.getParams().resize(3);
1593 logInfo
.getListParams().resize(0);
1597 // Context parameter
1598 NLMISC::CEntityId charId
;
1599 if (!ItemDesc
.getContextVar_charId(charId
))
1601 // If this bomb is thrown, you need to add a log context (or otherwise a 'noContext').
1602 STOP_IF(ItemDesc
.getNoContextCount() == 0, _filename_
<<"("<<_lineNo_
<<") : Missing log context for log 'Item'");
1607 logInfo
.getParams()[0] = LGS::TParamValue(charId
);
1609 logInfo
.getParams()[1] = LGS::TParamValue(itemId
);
1611 logInfo
.getParams()[2] = LGS::TParamValue(INVENTORIES::toString(dstInventoryId
));
1614 logInfo
.setTimeStamp(NLMISC::CTime::getSecondsSince1970());
1616 if (LGS::ILoggerServiceClient::isInitialized())
1617 LGS::ILoggerServiceClient::getInstance()->sendLog(logInfo
);
1620 void _log_Item_Money(uint64 moneyBefore
, uint64 moneyAfter
, const char *_filename_
, uint _lineNo_
)
1622 static LGS::TLogInfo logInfo
;
1623 static bool init
= false;
1626 logInfo
.setLogName("Item_Money");
1627 logInfo
.getParams().resize(3);
1628 logInfo
.getListParams().resize(0);
1632 // Context parameter
1633 NLMISC::CEntityId charId
;
1634 if (!ItemDesc
.getContextVar_charId(charId
))
1636 // If this bomb is thrown, you need to add a log context (or otherwise a 'noContext').
1637 STOP_IF(ItemDesc
.getNoContextCount() == 0, _filename_
<<"("<<_lineNo_
<<") : Missing log context for log 'Item'");
1642 logInfo
.getParams()[0] = LGS::TParamValue(charId
);
1644 logInfo
.getParams()[1] = LGS::TParamValue(moneyBefore
);
1646 logInfo
.getParams()[2] = LGS::TParamValue(moneyAfter
);
1649 logInfo
.setTimeStamp(NLMISC::CTime::getSecondsSince1970());
1651 if (LGS::ILoggerServiceClient::isInitialized())
1652 LGS::ILoggerServiceClient::getInstance()->sendLog(logInfo
);
1655 void _log_Item_ExchangeWithChar(const char *_filename_
, uint _lineNo_
)
1657 static LGS::TLogInfo logInfo
;
1658 static bool init
= false;
1661 logInfo
.setLogName("Item_ExchangeWithChar");
1662 logInfo
.getParams().resize(2);
1663 logInfo
.getListParams().resize(0);
1667 // Context parameter
1668 NLMISC::CEntityId validatorCharId
;
1669 if (!ItemDesc
.getContextVar_validatorCharId(validatorCharId
))
1671 // If this bomb is thrown, you need to add a log context (or otherwise a 'noContext').
1672 STOP_IF(ItemDesc
.getNoContextCount() == 0, _filename_
<<"("<<_lineNo_
<<") : Missing log context for log 'Item'");
1677 logInfo
.getParams()[0] = LGS::TParamValue(validatorCharId
);
1679 // Context parameter
1680 NLMISC::CEntityId otherEntityId
;
1681 if (!ItemDesc
.getContextVar_otherEntityId(otherEntityId
))
1683 // If this bomb is thrown, you need to add a log context (or otherwise a 'noContext').
1684 STOP_IF(ItemDesc
.getNoContextCount() == 0, _filename_
<<"("<<_lineNo_
<<") : Missing log context for log 'Item'");
1689 logInfo
.getParams()[1] = LGS::TParamValue(otherEntityId
);
1692 logInfo
.setTimeStamp(NLMISC::CTime::getSecondsSince1970());
1694 if (LGS::ILoggerServiceClient::isInitialized())
1695 LGS::ILoggerServiceClient::getInstance()->sendLog(logInfo
);
1698 void _log_Item_ExchangeWithNPC(const char *_filename_
, uint _lineNo_
)
1700 static LGS::TLogInfo logInfo
;
1701 static bool init
= false;
1704 logInfo
.setLogName("Item_ExchangeWithNPC");
1705 logInfo
.getParams().resize(2);
1706 logInfo
.getListParams().resize(0);
1710 // Context parameter
1711 NLMISC::CEntityId validatorCharId
;
1712 if (!ItemDesc
.getContextVar_validatorCharId(validatorCharId
))
1714 // If this bomb is thrown, you need to add a log context (or otherwise a 'noContext').
1715 STOP_IF(ItemDesc
.getNoContextCount() == 0, _filename_
<<"("<<_lineNo_
<<") : Missing log context for log 'Item'");
1720 logInfo
.getParams()[0] = LGS::TParamValue(validatorCharId
);
1722 // Context parameter
1723 NLMISC::CEntityId otherEntityId
;
1724 if (!ItemDesc
.getContextVar_otherEntityId(otherEntityId
))
1726 // If this bomb is thrown, you need to add a log context (or otherwise a 'noContext').
1727 STOP_IF(ItemDesc
.getNoContextCount() == 0, _filename_
<<"("<<_lineNo_
<<") : Missing log context for log 'Item'");
1732 logInfo
.getParams()[1] = LGS::TParamValue(otherEntityId
);
1735 logInfo
.setTimeStamp(NLMISC::CTime::getSecondsSince1970());
1737 if (LGS::ILoggerServiceClient::isInitialized())
1738 LGS::ILoggerServiceClient::getInstance()->sendLog(logInfo
);