Online Map Fix: v2.5
An online map so you can watch what's happening on your server without joining the game. I made it for my own purposes and wanted to share with you guys. It's my first plugin so don't be to hard with your judgement. Most of the credit for helping me with the code goes to Arkshine
Pictures
Online preview: (Note: The server could use a testversion that is not released yet)
currently offline:
http://onlinemap.waweasy.com/
How it works:
It acts like a webserver that creates JSON data that can be fetched with a little jQuery - even if it's not on the same domain. You just have to set up the server ip in the index.php and you're good to go. It works on port 1107 (TCP) but you can change that if you want.
I tested it on a server with some bots and it always worked fine. If you have any suggestions on making it even better go ahead.
How to use Online Map:
1. Requirements
- a running hlds server with counter strike 1.6 mod ;)
- port TCP 1107 has to be opened on the server!
- sockets2 (by Bugsy
https://forums.alliedmods.net/showthread.php?p=1573388)
2. Prepare your webspace
You now have to download and unzip the onlinemap.zip. Open the index.html and edit the line
PHP Code:
window.server = '127.0.0.1';
to fit your needs. For example your server has the IP 85.114.13.88 then the line should look like
PHP Code:
window.server = '85.114.13.88';
Save it. Now you can upload the whole unzipped folder to your webspace put it whereever you want it.
You can leave the port as it is. But if you want you can use the CVar "sv_onlinemap" to change the port how you want it.
3. Adding custom overviews (not necessary)
Open the overview file you want to add with some kind of image editing program (e.g. Photoshop, Paint.net). You can swap the green background with the color (Hex #404040) if you want. Then save it as jpeg into the onlinemap/overviews folder. Next step is to add the overviews txt-file (<mapname>.txt) to the onlinemap/overviews folder and thats pretty much it. The overview file should now be recognized and working with Online Map.
Update 2.2
Fixed some bugs.
Updated the onlinescripts - now working without PHP ;)
Update 2.3
Rewrote the code. Should be more efficient now.
Update 2.4
Fixed a problem where strings > ~ 2000 could not be sent.
Press space and see the stats.
Update 2.5
Fixed a bug where the bomb didn't disappear when planted after round end.