Raised This Month: $41 Target: $400
 10% 

[DEV] Entity Limits Logger


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine
Plugin ID:
7417
Plugin Version:
2.1
Plugin Category:
Technical/Development
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    11 
    Plugin Description:
    Logs entity types when the total number of entities on the map exceeds a pre-prefined maximum
    Old 12-13-2020 , 15:51   [DEV] Entity Limits Logger
    Reply With Quote #1

    Description:
    When the total number of networked entities become > 2048* (depends on your game),
    server receive crash
    Quote:
    ED_Alloc: no free edicts
    This plugin can help you with manual searching for a reason of entities leaking by logging all entities once per map whenever the total number of networked entities become > MAX, defined by you.
    List of info that is to be logged:
    - Time
    - Map name
    - Delta report since the latest snapshot (it is a difference between entities, spawned when map started and entities at the moment of a leak detection )
    - Weapon names per each slot per each player
    - Player names and their teams
    - total entities
    - total networked entities
    - per each entity:
    > class name
    > target name
    > model name
    > origin (position)
    > is within Saferoom (L4D only)
    > HammerId
    Log location: /addons/sourcemod/logs/entity_limit_<date-time>.log

    ConVars (Settings):
    Located at cfg/sourcemod/sm_entity_limit.cfg

    - sm_entity_limit_unsafe_left - def.: 150 - Plugin creates report when the number of free entities is less than this ConVar
    - sm_entity_limit_delay - def.: 10.0 - Delay to be used after map start to create entities snapshot for calculating the entities delta when a leak happens
    Commands:
    - sm_entlog - instantly creates the entities report
    - sm_entsnap - creates entities snapshot which is to be used for calculating the entities delta (when leak happens or sm_entlog used)

    - sm_entcrash - (available if only you enable DEBUG 1) - creates new 300 dummy entities to imitate the crash
    Installation:
    - copy .smx to addons/sourcemod/plugins
    Example of a log:
    Spoiler


    Related plugins:
    - [ANY] Security entity limit
    Attached Files
    File Type: sp Get Plugin or Get Source (entity_limit_logger.sp - 27 views - 12.6 KB)
    __________________
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch) (my New server L4D2)
    [My plugins] [My tools] [GitHub] [Articles] [Donate]

    Last edited by Dragokas; 03-08-2021 at 08:52.
    Dragokas is offline
    Dragokas
    Veteran Member
    Join Date: Nov 2017
    Location: Ukraine
    Old 03-07-2021 , 19:32   Re: [DEV] Entity Limits Logger
    Reply With Quote #2

    Updated to v2.0.

    Original version report contained too many entities of each class making the manual analysis of a leak to be quite a non-trivial task.

    In v2.0, I decided to provide a delta.
    So, when the map is started, logger creates snapshot of all entities.
    Next time, when the leak heppens, Entity Logger creates a report for you with a delta:

    1) Difference in total number of entities per each class between current moment and a snapshot.
    2) Detailed list of all entities MINUS those entities from a snapshot.

    Thus, you can quite easily detect which identical entities are leaking. See the sample log in 1st post.

    ChangeLog:

    Quote:
    - Added Delta report
    - Beautified
    - New ConVar "sm_entity_limit_unsafe_left"
    - New ConVar "sm_entity_limit_delay"
    - New command "sm_entsnap"
    - Logs are separated by file per date/time.
    __________________
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch) (my New server L4D2)
    [My plugins] [My tools] [GitHub] [Articles] [Donate]

    Last edited by Dragokas; 03-07-2021 at 19:37.
    Dragokas is offline
    PC Gamer
    Veteran Member
    Join Date: Mar 2014
    Old 03-08-2021 , 01:10   Re: [DEV] Entity Limits Logger
    Reply With Quote #3

    Thanks for this. I'll give it a try.

    I'm assuming there is no problem with running this concurrently with the wonderful '[ANY] Security entity limit' written by the talented Benoist3012'?
    PC Gamer is offline
    Dragokas
    Veteran Member
    Join Date: Nov 2017
    Location: Ukraine
    Old 03-08-2021 , 07:55   Re: [DEV] Entity Limits Logger
    Reply With Quote #4

    They do not conflict, if priorities met. My plugin should be first in detection order. By default - everything OK.

    "Security entity limit" has a detection point == 1950 entities.
    "Entity Limits Logger" has sm_entity_limit_unsafe_left ConVar == 150, means MAX (e.g. 2048 ) - 150 = 1898 entities,
    which will be detected earlier.
    __________________
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch) (my New server L4D2)
    [My plugins] [My tools] [GitHub] [Articles] [Donate]

    Last edited by Dragokas; 03-08-2021 at 07:56.
    Dragokas is offline
    Dragokas
    Veteran Member
    Join Date: Nov 2017
    Location: Ukraine
    Old 03-08-2021 , 08:51   Re: [DEV] Entity Limits Logger
    Reply With Quote #5

    Updated.

    Quote:
    v2.1
    - Added HammerId
    __________________
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch) (my New server L4D2)
    [My plugins] [My tools] [GitHub] [Articles] [Donate]
    Dragokas is offline
    Reply


    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 03:39.


    Powered by vBulletin®
    Copyright ©2000 - 2021, vBulletin Solutions, Inc.
    Theme made by Freecode