Day of Defeat Plugins Community
This site is an archive — everything is readable and downloadable, nothing can be posted. Admin

DoD Shrikebot Disabler

by TooLz · 2007-03-25 · 14 replies · 7705 views · 160 downloads

Read the thread (15 posts)

From the first post

In my endless search for the Shrikebot code to fix that horrible loop that tears my CPU usage up in my server, I decided to make this plugin to just stop the loop myself.
rn
rnDescription:
rn
rnDisables the loop in Shrikebot by checking max_bots itself and sets it to 0 if the number of clients is greater than or equal to the number of your max_bots.
rn
rnCVAR:
rn
rnCurrently set to 6, you can set it to whatever your max_bots are.
rn
dod_shrikebot_maxbots

rn
rnUPDATE 3-26-07:
rn
1. Removed PLUGIN_HANDLED as it could cause problems with other pluginsrnpossbily.

rn
rnCya

Files

ShrikebotDisabler.sma Plugin Source 806 B 160 dl Download Compile

The thread

All 15 posts from 5 people on DoD Shrikebot Disabler, kept as they were written.

T TooLz
started this thread
Posts: 96
Threads: 11
Joined: Oct 2005
03-24-2007, 11:21 PM #1

In my endless search for the Shrikebot code to fix that horrible loop that tears my CPU usage up in my server, I decided to make this plugin to just stop the loop myself.rnrnDescription:rnrnDisables the loop in Shrikebot by checking max_bots itself and sets it to 0 if the number of clients is greater than or equal to the number of your max_bots.rnrnCVAR:rnrnCurrently set to 6, you can set it to whatever your max_bots are.rn

dod_shrikebot_maxbots
rnrnUPDATE 3-26-07:rn
1. Removed PLUGIN_HANDLED as it could cause problems with other pluginsrnpossbily.
rnrnCya

S Stixsmaster
posted here
Posts: 7
Threads: 0
Joined: Feb 2007
03-25-2007, 12:03 PM #2

nice job this seems very very nice as I said and well I shall give it a try and well yea thx for it...nn---Stixsmaster

diamond-optic
posted here
Posts: 2,068
Threads: 103
Joined: May 2005
03-25-2007, 07:31 PM #3

whats this loop your talking about?nni run shrikebot and dont notice any problems..nn*edit*nni would suggest changing the return's from PLUGIN_HANDLED to PLUGIN_CONTINUE as if there are other plugins that need to do stuff in the authorize or disconnect (that are underneath this plugin).. they wont get called if this plugin sends the handled return...nni noticed you do:n

PlayerCount++
but then you don
PlayerCount -= 1
why not just do PlayerCount-- ?? lol of course it doesnt really matter.. nnalso.. simple suggestion but again not important really.. a pcvar could be added to the dod_shrikebot_maxbots cvar

T TooLz
started this thread
Posts: 96
Threads: 11
Joined: Oct 2005
03-26-2007, 06:59 AM #4

Thanks, I'll fix those tonight and reupload. The problem with Shrikebot is that there is a loop, constantly checking to see if the max_bots has been met, even if there are 10 people in the server, and I have my max_bots set to 6, it still runs that loop every 10 seconds to see if it should bring in bots yet, so I made it easier, turn the loop off with a plugin until it needs to be turned back on.. Simple.. My server has higher CPU usage with 6 bots now than it did with 6 real people. lolnnEDIT: Reuploaded. I've just had problems with pcvar's with my other mod so I have just been using cvars.nnCya

diamond-optic
posted here
Posts: 2,068
Threads: 103
Joined: May 2005
03-26-2007, 10:33 AM #5

ahh ok...nnnhmm funny thing with my server.. i turned shrikebot completely off (unloaded completely) and i didnt notice any change in CPU usage over a couple days.. i was really amazed lol.. i totally expected an improvement..nnnalso changing that shr cvar doesnt cause any problems on map change? whenever ive changed any of the shrikebot cvars mid-game thru rcon.. my server always crashed on the next mapchange...

T TooLz
started this thread
Posts: 96
Threads: 11
Joined: Oct 2005
03-26-2007, 11:30 AM #6

Mines been running fine since I released it with it on it. Not sure why that would happen with yours :
nrnAlso with whatever version of Linux my main server is running, it has 20-30% CPU Used with 6 bots.. I do shr max_bots 0, and instantly goes down to 0.01%.. When my server hits 6 players and turns bots off, it goes from 20-30% to about 6% - so it is worth it for servers like mine I guess.rnrnCya

diamond-optic
posted here
Posts: 2,068
Threads: 103
Joined: May 2005
03-26-2007, 11:43 AM #7

damnit..nni just had a full server, and cpu usage was about 60% (thru rcon stats.. and thats usually what it is when its full)nnso i typed shr max_bots 0 to see if it changed any..nnmade my server crash lol.. really pisses me off.. not often i have a full server in the morning during a weekday lol

T TooLz
started this thread
Posts: 96
Threads: 11
Joined: Oct 2005
03-26-2007, 11:45 AM #8

Ouch, good reason for that though.rnrnshr "max_bots 0"rnrnMust have quotes, or it WILL crash the server.. lol - Shoulda gotta then to ya sooner, lol.rnrnCya

diamond-optic
posted here
Posts: 2,068
Threads: 103
Joined: May 2005
03-26-2007, 11:48 AM #9

ohhh sob i knew that too lol crap...nnni thought maybe it had to do with the way i run it.. nni dont have it added thru the command line.. i have this:n

localinfo mm_gamedll shrikebot/dlls/shrikebot_i386.so
nin my autoexec.cfg file.. thought maybe loading it that way was making it act wierd

T TooLz
started this thread
Posts: 96
Threads: 11
Joined: Oct 2005
03-26-2007, 11:57 AM #10

Thats how I run mine too, pretty much the only way to if you're running metamod with it.. lolrnrnCya

=|[76AD]|= TatsuSaisei
posted here
Posts: 794
Threads: 54
Joined: May 2005
04-01-2007, 06:30 AM #11

Thanx for this idea... I never thought of the loop that checks the player count and with that in mind and you idea... things are a bit smoother now !! Thanx

T TooLz
started this thread
Posts: 96
Threads: 11
Joined: Oct 2005
04-01-2007, 06:34 AM #12

No problem, I see a nice performance difference in my servers when running this plugin, guess its just good for the systems health when running bots to have, lol..rnrnCya

B blazz
posted here
Posts: 2
Threads: 0
Joined: Dec 2007
12-11-2007, 08:34 PM #13

The plugin is running, and bot shut downrnrn but bots dont kick back on after server players go lower then 6?rnrnany ideas on y?

B blazz
posted here
Posts: 2
Threads: 0
Joined: Dec 2007
12-11-2007, 09:06 PM #14

It seems to be working, but bots did not kick in untill there was only 3 playersrnbut kicks off at 6, is there a delay for this?

T TooLz
started this thread
Posts: 96
Threads: 11
Joined: Oct 2005
12-16-2007, 08:01 AM #15

There may be a slight delay, shouldn't be too much of one though.rnrnCya

DoD Plugins Archive · Repository · Old Forum Threads · Maps · Admin · built 14 Sep 2026 00:34 UTC