Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Couple of Fixes #1222

Merged
merged 90 commits into from
Apr 28, 2024
Merged
Show file tree
Hide file tree
Changes from 45 commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
e1e4d55
Missing comma.
cbnolok Nov 19, 2023
855dd7d
Fix crafting (#1190)
raydienull Nov 24, 2023
9017458
Add editorconfig (#1188)
raydienull Dec 1, 2023
5e35e44
Fix Issue #1191 CANMASK no save on server reboot (#1192)
Jhobean Dec 7, 2023
c9cfc6c
Fix cancel target death (#1186)
raydienull Dec 7, 2023
8753fc3
Feature/meditation fail movement (#1184)
raydienull Dec 8, 2023
b584596
Fix herding dupe char (#1185)
raydienull Dec 11, 2023
56f6e6c
Editable DispID for chars (#1178)
DavideRei Dec 11, 2023
ea20f76
Fix issue #1097 (CAN_O_NOSLEEP not work on server reboot) (#1198)
Jhobean Dec 13, 2023
a5d5714
Fixed: Rare crash occurring when a NPC is selecting an attackable tar…
cbnolok Dec 13, 2023
646b9d1
CSFile Windows creation file mode fix (#1205)
DavideRei Jan 31, 2024
4bd64cf
Updated SphereCrypt.ini. (#1211)
drk84 Feb 12, 2024
4934125
Add some item props functionnality (#1131)
Jhobean Mar 14, 2024
3be9ce6
Couple of Fixes
xwerswoodx Mar 23, 2024
c4ba839
Update CItem.cpp
xwerswoodx Mar 23, 2024
980eb5b
Couple of Fixes
xwerswoodx Mar 24, 2024
1037519
Couple of Fixes
xwerswoodx Mar 24, 2024
229f4fa
Couple of Fixes
xwerswoodx Mar 24, 2024
c5bf09b
Couple of Fixes
xwerswoodx Mar 24, 2024
cc67d8c
Couple of Fixes
xwerswoodx Mar 24, 2024
422c945
Couple of Fixes
xwerswoodx Mar 24, 2024
841a230
Update CLog.h
xwerswoodx Mar 24, 2024
0980cd8
Couple of Fixes
xwerswoodx Mar 24, 2024
422bacb
Update Changelog.txt
xwerswoodx Mar 24, 2024
6df3fc4
Couple of Fixes
xwerswoodx Mar 25, 2024
0948503
Couple of Fixes
xwerswoodx Mar 26, 2024
ea8ac59
Update Changelog.txt
xwerswoodx Mar 26, 2024
62b51d6
Couple of Fixes
xwerswoodx Mar 26, 2024
2dbe9ba
Couple of Fixes
xwerswoodx Mar 27, 2024
4240b0f
Update CItemMulti.cpp
xwerswoodx Mar 27, 2024
6bc4646
Couple of Fixes
xwerswoodx Mar 27, 2024
4a684b0
REGION_FLAG_HOUSE
xwerswoodx Mar 28, 2024
1786757
@MurderMark Update
xwerswoodx Mar 30, 2024
c52eea5
@RegionResource Fix
xwerswoodx Mar 30, 2024
ceaf0a3
Multi Invalid Region Fix
xwerswoodx Mar 31, 2024
d7f7614
CAN Flags DWORD to UINT64
xwerswoodx Apr 2, 2024
f7c948a
Build Fix
xwerswoodx Apr 2, 2024
33db930
Chat Debug Possible Fix
xwerswoodx Apr 2, 2024
7b806e6
Added Missing Data to sphere.ini
xwerswoodx Apr 2, 2024
a36e879
t_crop update
xwerswoodx Apr 3, 2024
592f0a6
Crop update
xwerswoodx Apr 3, 2024
e080570
Invalid Resource ID
xwerswoodx Apr 3, 2024
0248026
Multi Region
xwerswoodx Apr 8, 2024
3c8cfb8
Elemental Engine Flags
xwerswoodx Apr 8, 2024
ec132ce
Increased CElementDef structure from uint to uint64 as some flags in …
xwerswoodx Apr 8, 2024
642c031
Custom Multi Count
xwerswoodx Apr 9, 2024
e1859c1
Bonded Pet Cannot See Master
xwerswoodx Apr 9, 2024
000c555
Standart Guild Align Fix
xwerswoodx Apr 9, 2024
787fbfd
Console Warnings
xwerswoodx Apr 9, 2024
262f4e4
GMs Dress Players
xwerswoodx Apr 10, 2024
dcaf0af
GM unequip fix
xwerswoodx Apr 10, 2024
9a091a7
Some Review Changes
xwerswoodx Apr 12, 2024
bebbf59
Custom Hosing Fix
xwerswoodx Apr 14, 2024
af32ecc
Merged Jhobean's Pr
xwerswoodx Apr 16, 2024
33dba6c
@Hit and @GetHit as Item Triggers
xwerswoodx Apr 16, 2024
7d887da
Visual Range Update
xwerswoodx Apr 16, 2024
3d86b36
H keyword for Hexadecimal returns
xwerswoodx Apr 17, 2024
4ad60ab
raydienull's LAYER_STABLE PR merge
xwerswoodx Apr 17, 2024
753ff28
Update Changelog.txt
xwerswoodx Apr 17, 2024
b1ba663
c_man_gm
xwerswoodx Apr 18, 2024
82e59ee
NPC Hear Distance
xwerswoodx Apr 18, 2024
75e5be9
CCChampion Rework
xwerswoodx Apr 20, 2024
5d92edc
Fixed forgotten callstack names.
xwerswoodx Apr 20, 2024
6cf816b
T_MULTI_ADDON Fix
xwerswoodx Apr 21, 2024
665ded8
ADDCOMPONENT
xwerswoodx Apr 22, 2024
9951612
Some Review Changes
xwerswoodx Apr 22, 2024
098b10e
Reactivated Hardcoded Fishing Skill
xwerswoodx Apr 22, 2024
2d0446f
Update CCharSkill.cpp
xwerswoodx Apr 22, 2024
3733da5
EF_DAMAGETOOLS Update
xwerswoodx Apr 23, 2024
cc8ac5f
Review Changes
xwerswoodx Apr 23, 2024
8c4d9e6
Review Changes
xwerswoodx Apr 23, 2024
f00c638
Review Changes
xwerswoodx Apr 23, 2024
b4b055f
Update Changelog.txt
xwerswoodx Apr 23, 2024
07a466d
Build Fix and Forgotten Ini Settings Removal
xwerswoodx Apr 23, 2024
0d28677
Forgotten Sphere.ini entry that crashes sphere
xwerswoodx Apr 24, 2024
9ccb383
Fixed my stupid mistake.
xwerswoodx Apr 24, 2024
2e0a8f5
Cancelled default more input for ResourceGetName
xwerswoodx Apr 24, 2024
9ff1647
m_ridFruitOverride CAN_I_SCRIPTEDMORE update
xwerswoodx Apr 24, 2024
688fd68
Update CItemPlant.cpp
xwerswoodx Apr 24, 2024
2f1d08f
Update sphereCrypt.ini
xwerswoodx Apr 24, 2024
0720adf
ConsoleTextColor Location
xwerswoodx Apr 26, 2024
4e1a9c0
Update CItemMulti.cpp
xwerswoodx Apr 26, 2024
999f3af
ResourceGetName
xwerswoodx Apr 26, 2024
0f7fc66
std::max/min
xwerswoodx Apr 26, 2024
de007c2
Revert spellflag_targ_onlyself update
xwerswoodx Apr 26, 2024
a7a494a
H Keyword/Sphere Switch
xwerswoodx Apr 27, 2024
cdc2e62
Update CServerConfig.cpp
xwerswoodx Apr 27, 2024
3b24fea
Build Fix
xwerswoodx Apr 27, 2024
762b6c8
Some Prefix Changes
xwerswoodx Apr 27, 2024
3e87445
SPELLFLAG_NOUNPARALYZE
xwerswoodx Apr 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
trim_trailing_whitespace = true
end_of_line = lf
insert_final_newline = true

# Tab indentation (no size specified)
[Makefile]
indent_style = tab

[*.{c,h,cpp,hpp}]
indent_size = 4
indent_style = space
cpp_indent_case_contents_when_block = true
cpp_new_line_before_open_brace_namespace = same_line
cpp_indent_namespace_contents = true
136 changes: 135 additions & 1 deletion Changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3429,9 +3429,143 @@ Additionally, the problem of zig-zag issue following in the South direction has

02-11-2023, Jhobean
- Modified: @Mount added argument ARGN1
ARGN1 (rw) = The itemID of the item containing the animation use when moounting. (Anim # is in tiledata of this item)
ARGN1 (rw) = The itemID of the item containing the animation use when moounting. (Anim # is in tiledata of this item)
NOTE: When mounting a pet you'll read a non sense random value but you can replace it by an ITEMID to force anim
Example: 03ea6 for Llama anim or 03e9f for gray horse anim. Yes 03ea6 is a ship part but in tiledata it link to anim 828

18-11-2023, Nolok
- Fixed: House customization sending wrong component data, breaking it.

09-12-2023, DavideRei
- Added: DispID can now also be used on chars, to change their appearance.

13-12-2023, Nolok
- Fixed: Rare crash occurring when a NPC is selecting an attackable target, but there's only one target (not attackable) in sight.

12-02-2024, Drk84
- Updated SphereCrypt.ini.

13-03-2024, Jhobean
- Added: Item properties functionnality:HITAREAPHYSICAL,HITAREAFIRE,HITAREACOLD,HITAREAPOISON,HITAREAENERGY,HITFIREBALL,HITHARM,HITLIGHTNING,HITMAGICARROW,REFLECTPHYSICALDAM

24-03-2024, xwerswoodx
Fixed: The issue that causes more1/2 not saved correctly for spellbook. (Issue: #1221)
Fixed: Players automatically become criminal to everyone when attack someone. (Issue: #1213)
Fixed: CallGuard not working correctly on the players that only criminal for target. (Issue: #1213, #1040)
Fixed: The wrong input of Kill trigger, to make it compatible with older sphere versions. (Issue: #1210)
Added: New Layer LAYER_STORAGE (80) to let scripters create their own storage system. (Issue: #1209)
Only t_container and t_container_locked can be equipped to this layer.
Changed: Decay time removed from spawned items, as Sphere gives tons of invalid link errors when items decayed. (Issue: #1218)
Added: New spellflag SPELLFLAG_ASYNC (0100000000) to randomize field timers like old sphere versions. (Issue: #1169)
xwerswoodx marked this conversation as resolved.
Show resolved Hide resolved
SPELLFLAG_ASYNC should be added to defs.
Added: New spellflag SPELLFLAG_TARG_ONLYSELF (0200000000) to make spell only be used on character himself. (Issue: #1171)
SPELLFLAG_TARG_ONLYSELF should be added to defs.
//magery_9 "You can only use this spell on yourself." could be added to defmessages.
Changed: SERV.LOG command changed to support console colors. (Issue: [Feature Request] Colored Serv & Src Log System #1158)
SERV.LOG works same as before.
Usage of custom color system is: SERV.LOG @color,type,mask message
Example: SERV.LOG @CTCOL_RED,LOGL_EVENT,LOGM_NOCONTEXT|LOGM_KILLS message
cbnolok marked this conversation as resolved.
Show resolved Hide resolved
LOGM, LOGL and CTCOL values should be added to defs.

25-03-2024, xwerswoodx
Added: Sphere.ini setting CanPetsDrinkPotion (true in default) to make pets drink potion when their owner drop it on it. (Issue: #1147)
CanPetsDrinkPotion = 0 can be added to sphere.ini to disable that.
Fixed: Missing fCheckOnly checks block the taming skill. (Issue: #1219)

26-03-2024, xwerswoodx
Added: New trigger @Drink added for characters. (Issue: #1162)
I: The character drinking the item.
SRC: The character drinking the item.
ARGO = the item that drank
ARGN1 = cooldown (in seconds)
ARGN2 = consumption amount (1 in default)
LOCAL.BottleID = empty bottle id that will be given when after item drank. (Will be given ARGN2 amount of empty bottle in default)
- Returns:
1: Stops character from drinking the item.
5: Let character to drink but will only give 1 empty bottle.
6: Let character to drink but will not give any empty bottle.
- Messages:
DRINK_NOT_ENOUGH, "You don't have enough %s to drink this."
Added: New trigger @AfkMode added for characters. (Issue: #1161)
I: The character changing AFK status.
SRC: The character changing AFK status.
ARGN1 = Current Afk Status
ARGN2 = Next Afk Status
- Returns:
1: Stops character from switching afk status.
Added: New trigger @Reveal added for characters. (Issue: #1157)
I: The character who is revealing.
SRC: The character who is revealing.
- Returns:
1: Prevents character from being revealed.
Added: New triggers @ArrowQuest_Add and @ArrowQuest_Close added for characters. (Issue: #1116)
I: The character who activating/deactivating arrow quest.
SRC: The character who activating/deactivating arrow quest.
Added: New function triggers f_onaccount_block and f_onaccount_unblock. (Issue: #1156)
ARGS = Account name.
- Returns:
1: Prevents account from blocking/unblocking.
Added: New function trigger f_onserver_broadcast. (Issue: #1145)
ARGS = message
- Returns:
1: Prevents server to send broadcast message.
Added: Two new LOCAL variables ItemPoisonReductionChance and ItemPoisonReductionAmount to @Hit trigger. (Issue: #1159)
LOCAL.ItemPoisonReductionChance = Is the chance that weapon reduce poison morez. (Default 100%)
LOCAL.ItemPoisonReductionAmount = Is the amount that weapon reduce. (Default: CurrentPoisonAmount/ 2)
Added: You can now use TDATA2 for setting default cooldown (delay) for drinks. (Default: 15secs for potions, 1500 secs for ales)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be useful then to be able to set a default cooldown in the ini? I admit i don't remember if that's already possible

Copy link
Contributor Author

@xwerswoodx xwerswoodx Apr 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can add default cooldown to ini for drinks, but it's different for ales and potions, but I can put some extra integers in sphere.ini for default cooldowns. But I add TDATA2 because people may want to keep default potion cooldowns but change some of them, like he may want to keep default cooldown for heal potion but change it for cure.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel it would be wise to have a default cooldown for each type (maybe in the typedef? or ini?), then give the possibility to overwrite for the specific item. In the latter case, imho it would be better to store the info in a tag, so that it can be statically added to the typedef but also changed at runtime for maximum flexibility.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, could you please explain differently in the changelog what do the new locals do? I'm not sure i've grasped it fully

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel it would be wise to have a default cooldown for each type (maybe in the typedef? or ini?), then give the possibility to overwrite for the specific item. In the latter case, imho it would be better to store the info in a tag, so that it can be statically added to the typedef but also changed at runtime for maximum flexibility.

Honestly I added TDATA2 exactly for this, it works well with @drink trigger, I mean, TDATA2 is something that you can set under [ITEMDEF] for any drink to define it's cooldown timer, but it can be override under @drink trigger dynamically, but if you still wish to add another tag that can be defined under [itemdef] and overridable dynamically, we can add TAG.OVERRIDE, https://wiki.spherecommunity.net/index.php?title=Override_TAGs like in here.

For LOCALS, they were for the POISONED WEAPONS, poison on weapon saved on morez, and it drops some value from it on every hit of player, normally this is 100%. but I added CHANCE and AMOUNT override to let gms decide how this poison effect removes, seems like I haven't put much info in changelog, I can improve it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay then for TDATA2 and @drink!
I'd only update the changelog entry for poisoned weapons

Added: MAGICF_REACTIVEARMORTH (010000) MAGICF flag to Sphere.ini to let people decide if reactive armor should reflect two handed weapons.
xwerswoodx marked this conversation as resolved.
Show resolved Hide resolved

27-03-2024, xwerswoodx
Fixed: Possible fix for accesses and bans not loading for multis. (Issue: #1223)
Fixed: Possible fix for wrong damage calculation of slayer bonus damage. (Issue: #1179)

28-03-2024, xwerswoodx
Added: REGION_FLAG_HOUSE (0x0100) for houses. (Issue: #1154)
REGION_FLAG_HOUSE 0100 should be added defs.

30-03-2024, xwerswoodx
Added: ARGO object for @MurderMark trigger to get killed character.
Fixed: ARGN1 (reap amount) doesn't updated depends on the amount left on bit. (Issue: #1224)
Added: ARGO to get bit uid under @ResourceGather and @RegionResourceGather triggers.

31-03-2024, xwerswoodx
Fixed: Possible fix for the OnRegionTrigger getting called on invalid region while multi creating/removing.

02-04-2024, xwerswoodx
Changed: dword CAN flags changed with uint64 to increase limits.
cbnolok marked this conversation as resolved.
Show resolved Hide resolved
Fixed: Possible fix for chat debugs. (Issue: #1212) (Issue: https://discord.com/channels/354358315373035542/483721253773901824/1224030729906815077)

03-04-2024, xwerswoodx
Added: "MOREX" key to set amount of fruit given when the crop ripped.
Changed: Now @Create trigger called when crop grow to let people to change MORE values in stages if needed.
Added: @ResourceTest trigger added for crops. (This trigger works separately for every stage)
I: Crop UID
SRC: Player who uses plant.
ARGN1: Next state item ID [Writeable]
ARGN2: Fruit ID (if exists) [Writeable]
ARGN3: Fruit ID Override (if exists) [Writeable]
- Returns:
1: Stop the fruit checks.
Added: @ResourceGather trigger added for crops. (This trigger works separately for every stage)
I: Crop UID
SRC: Player who is gathering plant.
ARGN1: Amount of fruit. [Writeable]
ARGO: Fruit UID
- Returns:
1: Prevent player to gather fruit.
6: Let player to gather fruit but it will drop to the ground instead of backpack.
Fixed: Possible fix for invalid ResourceID warnings. (Issue: #1071)

08-04-2024, xwerswoodx
Fixed: Missing REGION reference for multis. (Issue: #1228)
Added: ElementalEngineFlags variable added to sphere.ini to let servers to filter elemental engine. (Issue: #1230)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't this be added as a spellflag directly on the interested spell?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly it was the thing I thought at first, but there are other things affected from Elemental Engine, like defense calculation, RES DAM HITAREA etc, so I thought maybe we need to put some check for these props when they fully implemented, but if you think it's better to add spellflag for it I can revert this update back and add SPELLFLAG for it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes the elemental engine itself has different implications, but i'm not really convinced to add another variable (ElementalEngineFlags) in the ini just to configure single spells.
I'd see best a ini setting as something with a broad effect, or to config unscriptable stuff like network, muls etc. I fear to pollute the ini (which is already a big fat boy of a config file) with small tweaks affecting a single small thing

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personnally more option on the ini more cool it is. Important is to have good default configuration. This particular feature about elemental engine was asked by someone on discord. This fix make sense to me and give more possibility to personalise server.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert Back the Elemental Engine update, and added SPELLFLAG_NO_ELEMENTALENGINE flag for spells.

EE_CURSE = 0x1, // Adds Elemental buff/defuff to curse spell.
EE_MASS_CURSE = 0x2, // Adds Elemental buff/defuff to mass curse spell.
EE_REACTIVE_ARMOR = 0x4, // Adds Elemental buff/defuff to reactive armor spell.
EE_MAGIC_REFLECT = 0x8, // Adds Elemental buff/defuff to magic reflect spell.
EE_PROTECTION = 0x10, // Adds Elemental buff/defuff to protection spell.
EE_ARCH_PROTECTION = 0x20, // Adds Elemental buff/defuff to arch protection spell.
EE_STONESKIN = 0x40, // Adds Elemental buff/defuff to stone skin spell.
EE_STEELSKIN = 0x80, // Adds Elemental buff/defuff to steel skin spell.
EE_RESPHYSICAL = 0x100 // Use RESPHYSICAL value instead of ARMOR for defense calculation.

17 changes: 13 additions & 4 deletions src/common/CLog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "CLog.h"


int CEventLog::VEvent(dword dwMask, lpctstr pszFormat, va_list args) noexcept
int CEventLog::VEvent(dword dwMask, lpctstr pszFormat, va_list args, ConsoleTextColor iColor) noexcept
xwerswoodx marked this conversation as resolved.
Show resolved Hide resolved
{
if (pszFormat == nullptr || pszFormat[0] == '\0')
return 0;
Expand All @@ -21,7 +21,7 @@ int CEventLog::VEvent(dword dwMask, lpctstr pszFormat, va_list args) noexcept
// if ( ( pFix = strchr( pszText, 0x0C ) ) )
// *pFix = ' ';

return EventStr(dwMask, pszTemp);
return EventStr(dwMask, pszTemp, iColor);
}

int CEventLog::Event(dword dwMask, lpctstr pszFormat, ...) noexcept
Expand Down Expand Up @@ -60,6 +60,15 @@ int CEventLog::EventWarn(lpctstr pszFormat, ...) noexcept
return iret;
}

int CEventLog::EventCustom(ConsoleTextColor iColor, dword dwMask, lpctstr pszFormat, ...) noexcept
{
va_list vargs;
va_start(vargs, pszFormat);
int iret = VEvent(dwMask, pszFormat, vargs, iColor);
va_end(vargs);
return iret;
}

#ifdef _DEBUG
int CEventLog::EventEvent(lpctstr pszFormat, ...) noexcept
{
Expand Down Expand Up @@ -204,7 +213,7 @@ bool CLog::OpenLog(lpctstr pszBaseDirName) // name set previously.
THREAD_UNIQUE_LOCK_RETURN(CLog::_OpenLog(pszBaseDirName));
}

int CLog::EventStr( dword dwMask, lpctstr pszMsg ) noexcept
int CLog::EventStr( dword dwMask, lpctstr pszMsg, ConsoleTextColor iLogColor) noexcept
{
ADDTOCALLSTACK("CLog::EventStr");
// NOTE: This could be called in odd interrupt context so don't use dynamic stuff
Expand All @@ -217,7 +226,7 @@ int CLog::EventStr( dword dwMask, lpctstr pszMsg ) noexcept

try
{
ConsoleTextColor iLogTextColor = CTCOL_DEFAULT;
ConsoleTextColor iLogTextColor = iLogColor;
ConsoleTextColor iLogTypeColor = CTCOL_DEFAULT;

// Put up the date/time.
Expand Down
10 changes: 6 additions & 4 deletions src/common/CLog.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ enum LOG_TYPE
LOGM_KILLS = 0x010000, // Log player combat results.
LOGM_HTTP = 0x020000,
LOGM_NOCONTEXT = 0x040000, // do not include context information
LOGM_DEBUG = 0x080000 // debug kind of message with "DEBUG:" prefix
LOGM_DEBUG = 0x080000, // debug kind of message with "DEBUG:" prefix
LOGM_QTY = 0x0FFF00 // All masks.
};

class CSError;
Expand All @@ -58,15 +59,16 @@ class CEventLog
// May include __LINE__ or __FILE__ macro as well ?

protected:
virtual int EventStr(dword dwMask, lpctstr pszMsg) noexcept = 0;
virtual int EventStr(dword dwMask, lpctstr pszMsg, ConsoleTextColor iColor = CTCOL_DEFAULT) noexcept = 0;

int VEvent(dword dwMask, lpctstr pszFormat, va_list args) noexcept;
int VEvent(dword dwMask, lpctstr pszFormat, va_list args, ConsoleTextColor iColor = CTCOL_DEFAULT) noexcept;

public:
int _cdecl Event( dword dwMask, lpctstr pszFormat, ... ) noexcept __printfargs(3,4);
int _cdecl EventDebug(lpctstr pszFormat, ...) noexcept __printfargs(2,3);
int _cdecl EventError(lpctstr pszFormat, ...) noexcept __printfargs(2,3);
int _cdecl EventWarn(lpctstr pszFormat, ...) noexcept __printfargs(2,3);
int _cdecl EventCustom(ConsoleTextColor iColor, dword dwMask, lpctstr pszFormat, ...) noexcept __printfargs(4,5);
#ifdef _DEBUG
int _cdecl EventEvent( lpctstr pszFormat, ... ) noexcept __printfargs(2,3);
#endif //_DEBUG
Expand Down Expand Up @@ -117,7 +119,7 @@ public: bool OpenLog(lpctstr pszName = nullptr);
bool IsLoggedLevel( LOG_TYPE level ) const;
bool IsLogged( dword dwMask ) const;

virtual int EventStr( dword dwMask, lpctstr pszMsg ) noexcept final; // final: for now, it doesn't have any other virtual methods
virtual int EventStr( dword dwMask, lpctstr pszMsg, ConsoleTextColor iLogColor = CTCOL_DEFAULT ) noexcept final; // final: for now, it doesn't have any other virtual methods
void _cdecl CatchEvent( const CSError * pErr, lpctstr pszCatchContext, ... ) __printfargs(3,4);
void _cdecl CatchStdException( const std::exception * pExc, lpctstr pszCatchContext, ... ) __printfargs(3,4);

Expand Down
Loading
Loading