AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [TF2] Plugin keeper for tf2itemsinfo (https://forums.alliedmods.net/showthread.php?t=255632)

Michalplyoutube 01-17-2015 17:19

[TF2] Plugin keeper for tf2itemsinfo
 
1 Attachment(s)
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")

Chdata 01-17-2015 18:03

Re: [TF2] Plugin keeper for tf2itemsinfo
 
... Wouldn't it be better to catch and fix the scenarios in which TF2ItemsInfo crashes?

Leonardo 01-17-2015 18:26

Re: [TF2] Plugin keeper for tf2itemsinfo
 
Quote:

Originally Posted by Chdata (Post 2250494)
... 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.

Potato Uno 01-17-2015 21:25

Re: [TF2] Plugin keeper for tf2itemsinfo
 
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.

Chdata 01-17-2015 21:45

Re: [TF2] Plugin keeper for tf2itemsinfo
 
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)

Mitchell 01-17-2015 23:22

Re: [TF2] Plugin keeper for tf2itemsinfo
 
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..

Powerlord 01-18-2015 00:48

Re: [TF2] Plugin keeper for tf2itemsinfo
 
I already suggested rewriting TF2ItemsInfo to have it write to a SQLite database when the server starts.

Potato Uno 01-18-2015 00:49

Re: [TF2] Plugin keeper for tf2itemsinfo
 
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.

Chdata 01-18-2015 01:03

Re: [TF2] Plugin keeper for tf2itemsinfo
 
Quote:

Originally Posted by Potato Uno (Post 2250573)
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

Michalplyoutube 01-18-2015 08:42

Re: [TF2] Plugin keeper for tf2itemsinfo
 
Quote:

Originally Posted by Chdata (Post 2250578)

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


All times are GMT -4. The time now is 12:51.

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