cod2 serverbot script

Thread started by deivis33 on Thursday, 8:20pm April 6th with 2 replies. Views: 903

deivis33
Posts: 1
Level: BRONZE
Reputation:
Hi,

Someone have the cod2 serverbot script to a website?
(zpam)

Like this:



> ServerBOT is a feature which connects the server with a website. Basically, it gets information from the server and puts them on the website.


thx:)
Posted 8:20pm Apr 6th 17
hitzoR
Posts: 386
Level: BRONZE
Reputation:
I was playing with it like year ago, but nothing really "ready for publishing". But it's not hard to handle serverbots data, if you know basics with PHP and JavaScript.
Posted 11:25pm Apr 6th 17
myss
Posts: 1,426
Level: PLATINUM
Reputation:
If I recall correctly, when serverbot is active, it just outputs additional cvars for public query. In this case I'd go like this:

1. Make an API script that will query the gameserver, retrieve and parse infos (think zPAM packs the array in a simple way so explode() should do the trick) and output the content in some notation. Also can take a look at this library to understand how to send queries to your gameserver: https://github.com/Austinb/GameQ
2. Query your API script with AJAX.
3. Play around with JS and frontend.
4. Put it in a loop.

In case you want to do this for website which will have bigger traffic, it might be a good idea to make a daemon script on your server which will automatically query gameserver once let's say every 30 seconds and store the results in a database (might need some playing around with locks though). Then make a public API script which will read these results from database and output them back to the client.

Otherwise you're risking having 100 people on the website and all of them constantly requesting your script to send 100 queries to the gameserver which will no doubt result in gameserver lags / your server being banned from gameserver's ISP / similar inconveniences..
Posted 11:39pm Apr 7th 17