Raised This Month: $51 Target: $400
 12% 

[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 - 1160 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
    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 #8

    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 #9

    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
    Michalplyoutube
    Veteran Member
    Join Date: Jan 2013
    Location: Tank Carrier in Mannhatt
    Old 01-18-2015 , 08:42   Re: [TF2] Plugin keeper for tf2itemsinfo
    Reply With Quote #10

    Quote:
    Originally Posted by Chdata View Post
    But who uses it > Nobody besides friagram
    I haven't seen any plugin using it and its outdated last update was since 2013

    tf2itemsinfo is better and deal with it
    __________________
    The plugin developer of TF2BWR Reborn
    And a TF2 Player
    Michalplyoutube 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 14:23.


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