EU
PC
Sponsors:
Start your own gaming site:
Login:
? Sign Up!
OP
BR
Joined: 17/6/14
Posts: 1
using Chrome 56.0
Rep:
24%
Member
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:)
Quote
Downvote
Like
6 wks ago
CZ
Joined: 1/2/15
Posts: 295
using Chrome 58.0
Rep:
85%
Member
Post Likes: 1
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.
Quote
Downvote
Like
6 wks ago
CZ
Joined: 7/1/13
Posts: 1,312
using Chrome 58.0
Rep:
81%
Member
Post Likes: 2
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..
Quote
Downvote
Like
6 wks ago

Follow CG On:
Ongoing PC PUGs:
View PCTodays Tournaments:
View All Featured Upcoming PC Tournament:
Advertisement:
Current events
CyberGamer Premium Monthly Raffle 6 Days WIN an iPod Nano every Month! Congratulations Rorgh, our April Winner!
Advertisement:
How good at your best game are you?
One of the top 20 players
Top 1% of players
Top 2% of players
Top 5% of players
Top 10% of players
Top 20% of players
Top 50% of players
Bottom 50% of players
1149 Votes