Raised This Month: $ Target: $400
 0% 

[TF2] Plugin keeper for tf2itemsinfo


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Michalplyoutube
Veteran Member
Join Date: Jan 2013
Location: Tank Carrier in Mannhatt
Plugin ID:
4489
Plugin Version:
0.5
Plugin Category:
Server Management
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Keeps plugin that uses tf2itemsinfo alive
    Old 01-17-2015 , 17:19   [TF2] Plugin keeper for tf2itemsinfo
    Reply With Quote #1

    The plugin reloads tf2itemsinfo on crash + the plugin that uses it

    To make it work for other plugins you need to change PLUGINNAME to file name that uses tf2itemsinfo without .smx example "tf2ibwr"

    This plugin was written because of the fact that tf2itemsinfo crashes a lot

    Download sourcecode to modify pluginname define (#define PLUGINNAME "tf2bwr")
    Attached Files
    File Type: sp Get Plugin or Get Source (pluginkeeper.sp - 1177 views - 1,008 Bytes)
    __________________
    The plugin developer of TF2BWR Reborn
    And a TF2 Player
    Michalplyoutube is offline
    Chdata
    Veteran Member
    Join Date: Aug 2012
    Location: Computer Chair, Illinois
    Old 01-17-2015 , 18:03   Re: [TF2] Plugin keeper for tf2itemsinfo
    Reply With Quote #2

    ... Wouldn't it be better to catch and fix the scenarios in which TF2ItemsInfo crashes?
    __________________

    Last edited by Chdata; 01-17-2015 at 18:03.
    Chdata is offline
    Leonardo
    Veteran Member
    Join Date: Feb 2010
    Location: 90's
    Old 01-17-2015 , 18:26   Re: [TF2] Plugin keeper for tf2itemsinfo
    Reply With Quote #3

    Quote:
    Originally Posted by Chdata View Post
    ... Wouldn't it be better to catch and fix the scenarios in which TF2ItemsInfo crashes?
    The main issue is how the data is being stored in memory.
    __________________

    Last edited by Leonardo; 01-17-2015 at 18:28.
    Leonardo is offline
    Potato Uno
    Veteran Member
    Join Date: Jan 2014
    Location: Atlanta, Georgia
    Old 01-17-2015 , 21:25   Re: [TF2] Plugin keeper for tf2itemsinfo
    Reply With Quote #4

    Reloading TF2ItemsInfo during a game is a huge performance hazard.

    items_game.txt is 2.5 MB and only is growing bigger. Because TF2ItemsInfo traverses down the entire file (it's a VDF file after all), it uses the entire server processing thread, and as such the server stops responding to player inputs/outputs. (You will get the "connection error: disconnecting in X seconds" message.)

    Nothing would be more annoying than the server freezing randomly in the middle of a game because it is reloading TF2ItemsInfo. What Chdata said in fact is correct.

    (It would be a different story if you can run the tf2itemsinfo parsing in a separate thread from the main thread, but pawn is only single-threaded, so nope.)

    My experience: Reloaded TF2ItemsInfo on my own server, the server froze for a good 5-6 seconds on a decent CPU (CPU usage 100% on a single core). That would turn to 10-12 seconds on those using VPSes or less powerful CPUs.
    Potato Uno is offline
    Chdata
    Veteran Member
    Join Date: Aug 2012
    Location: Computer Chair, Illinois
    Old 01-17-2015 , 21:45   Re: [TF2] Plugin keeper for tf2itemsinfo
    Reply With Quote #5

    Well... considering the information in items_game.txt never changes, wouldn't it be best for one to use it in such a way that it only needs to find all the information once?

    Like, OnPluginStart just cache a bunch of variables or something.

    (>>Is ignorant of what scenarios cause TF2ItemsInfo to crash).

    (>>Assuming people are using it in such a way... /any/ function is being called more than once)
    __________________

    Last edited by Chdata; 01-17-2015 at 21:45.
    Chdata is offline
    Mitchell
    ~lick~
    Join Date: Mar 2010
    Old 01-17-2015 , 23:22   Re: [TF2] Plugin keeper for tf2itemsinfo
    Reply With Quote #6

    i'm sorry but do you not know what 'else' means in coding?
    it means you don't need to do this:
    Code:
    	if (FindPluginByFile("tf2itemsinfo.smx") != INVALID_HANDLE) //check if plugin haven't crashed
    		return;
    	if (FindPluginByFile("tf2itemsinfo.smx") == INVALID_HANDLE) //check if plugin has crashed
    	{
    you dont even need to do the return at the top..
    Having this run every second is a hazard too..
    Mitchell is offline
    Powerlord
    AlliedModders Donor
    Join Date: Jun 2008
    Location: Seduce Me!
    Old 01-18-2015 , 00:48   Re: [TF2] Plugin keeper for tf2itemsinfo
    Reply With Quote #7

    I already suggested rewriting TF2ItemsInfo to have it write to a SQLite database when the server starts.
    __________________
    Not currently working on SourceMod plugin development.
    Powerlord is offline
    Erreur 500
    Senior Member
    Join Date: Aug 2012
    Location: Paris, France
    Old 01-18-2015 , 10:05   Re: [TF2] Plugin keeper for tf2itemsinfo
    Reply With Quote #8

    Quote:
    Originally Posted by Powerlord View Post
    I already suggested rewriting TF2ItemsInfo to have it write to a SQLite database when the server starts.
    I think it's a good idea!
    When the server starts TF2II, it detect if the DB is up to date (by checking TF2 version). If it isn't the case, TF2II scan tf2_items.txt and update DB. It may take some seconds to create/update the DB, but this will be done when server start (no player connected). When it is done, each plugin will be able to use TF2II included commands, and TF2II will ask the DB to answer.
    Nothing change for plugins which use TF2II.

    PROS : More performance + less RAM needed, excepted when the server starts AND DB need to be updated (There is more RAM available when there is no player) + DB only update when TF2 version change.

    CONS : When Valve update TF2, servers will take more time to start.

    I think I can modify TF2II to due that.
    __________________
    My public creation : PortalMod - Free Duels - Unusual Effects - Particle fireworks - !stuck

    Need private plugin ? We can found an agreement !
    Steam : Erreur 500

    Last edited by Erreur 500; 01-18-2015 at 10:06.
    Erreur 500 is offline
    Potato Uno
    Veteran Member
    Join Date: Jan 2014
    Location: Atlanta, Georgia
    Old 01-18-2015 , 00:49   Re: [TF2] Plugin keeper for tf2itemsinfo
    Reply With Quote #9

    I thought Friagram wrote a better TF2 schema extension that actually works. Or maybe I'm thinking of someone else.

    Either way, I remember reading someone else had an extension to do the same thing as TF2ItemsInfo does, with the only difference being that it doesn't crash randomly.
    Potato Uno is offline
    Chdata
    Veteran Member
    Join Date: Aug 2012
    Location: Computer Chair, Illinois
    Old 01-18-2015 , 01:03   Re: [TF2] Plugin keeper for tf2itemsinfo
    Reply With Quote #10

    Quote:
    Originally Posted by Potato Uno View Post
    I thought Friagram wrote a better TF2 schema extension that actually works. Or maybe I'm thinking of someone else.

    Either way, I remember reading someone else had an extension to do the same thing as TF2ItemsInfo does, with the only difference being that it doesn't crash randomly.
    https://forums.alliedmods.net/showthread.php?p=1956559

    apple banana mango oranges potato
    __________________

    Last edited by Chdata; 01-18-2015 at 01:03.
    Chdata is offline
    Reply



    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 12:51.


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