PDA

View Full Version : Online Map


silkker
03-05-2013, 11:14
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
https://forums.alliedmods.net/attachment.php?attachmentid=117117&stc=1&d=1363363296
https://forums.alliedmods.net/attachment.php?attachmentid=117116&stc=1&d=1363363285

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

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

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.

bibu
03-05-2013, 11:55
Wow, really nice job!

Jhob94
03-05-2013, 13:02
Sounds cool
But if mod is mod like furien that players have speed or if server have noclip, does it shows player fast or player going inside walls? :)
And if have semiclip does it shows players getting inside of others players?
If yes to both, man thats awesome :)

silkker
03-05-2013, 13:05
it basically just gets the coordinates of the players so it will show the real speed and the real position - even if they are like standing in walls or something.

FanatikSVK
03-05-2013, 14:10
WOW .. this is great work! .. I think of this Take advantage of 10000 people.

Arkshine
03-05-2013, 15:58
It reminds me of Psycholive (http://forums.alliedmods.net/showthread.php?t=81379), plugin I've converted long time ago.

About your plugin, there are room for improvements.
Considering you use a task to 0.1s, it would be a good idea to keep that in mind, and using as less as natives you can, for the purpose to have an efficient plugin.

Some random remarks :

- You use 4 times socket_send, can't you concatenate to one string and using one socket_send ? Others place too, try to use one string when you can.
- It would be more appropriate to use static instead of new.
- Precompile the regex pattern
- Use formatex, faster.
- Instead of using get_playersnum, and is_user_connected, use get_players. You save a lot of natives call.
- Don't declare variable inside a loop

Start with that.

n0br41ner
03-05-2013, 16:12
This is an awesome work. I will definitely be trying this plugin on.

quilhos
03-05-2013, 18:10
Son rly GOOD JOB!

silkker
03-06-2013, 06:18
Update 1.1

socket_send is now more concentrated and used less often.
Now instead of "new", "static" is used to declare variables.
The regex pattern is now precompiled and it doesn't have to do it every 100ms. :)
Instead of format, formatex is now used.
The variables are now declared outside of the loop.

Daddy-K
03-06-2013, 07:01
1. Where upload files from onlinemap.zip?
2. How to add maps overviews folder?

silkker
03-06-2013, 07:57
you have to upload the unzipped folder to your webspace. if you want to add overviews you just have to convert them into JPEG and put it with the associated overview txt-file in the overviews folder.

e.g.

the maps name is de_example.bsp

then it has to look like this

<webspace root>/onlinemap/overviews/de_example.jpg
<webspace root>/onlinemap/overviews/de_example.txt

I will write an how to for it as soon as I find the time to do so :)

Daddy-K
03-06-2013, 08:28
There are other settings that need to be made​​, that does not work.
I look only:

An error occured please try again in a few seconds.
If you keep on having this problem the server could be offline.

silkker
03-06-2013, 08:32
I've made a little how-to in the first post :) be sure to follow the instructions. If you need more help you can send me a pm.

hLiaS
03-06-2013, 09:42
Can anyone create this _i386.so for windows .dll ??????
http://forums.alliedmods.net/showthread.php?t=60026

I find it sorry http://forums.alliedmods.net/showpost.php?p=525368&postcount=15

Daddy-K
03-06-2013, 14:46
Since I put this plugin always gives me the console:


User 82.146.57.125:59748 Will Be Banned for rcon hacking
Bad Rcon from 82.146.57.125:59748:
rcon 1525305438 "Jack" stats
L 03/06/2013 - 21:40:10: Bad Rcon: "rcon 1525305438" Jack "stats" from "82.146.57.125:59748"
Bad rcon_password.
If you stop not show anything. How do you start and gives me these messages in the console.
Why?

silkker
03-06-2013, 15:02
This plugin has nothing to do with rcon. It looks like user Jack tries to "brutforce" your password. I just want to make clear two things. Is it your server? What does the server console say on server start up? Perhaps I can help you if you give me this informations.

Arkshine
03-06-2013, 15:18
When I was saying static ; you could have kept the var inside the function. static is like a global variable but in the scope of the function. Using static out of function would mean in the scope of the plugin, but I would guess it doesn't matter really new/static here.

There are things you can do : for example, map name is not going to change, that's something you should retrieve one time. You could also put the string in a static const variable too. And instead of hardcoding the size - 1, there is a define charsmax() which does that, so if you change buffer, you don't have to changes where it's used.
Btw, why don't you concatenate all strings, and sending one socket_send(), at the end ?

Edit: Can you explain the part with the regex, not sure to understand why on the received data, you retrieve something and you send it again, can you give an example also ?

silkker
03-07-2013, 06:12
Edit: Can you explain the part with the regex, not sure to understand why on the received data, you retrieve something and you send it again, can you give an example also ?

Yup. It's because of the jQuery. jQuery sends some GET informations and they have to be sent back. For example if the request looks like:
http://localhost:1107/?jsonp=jQuery191021287121100443662_1362654468 020&_=1362654468081The response has to look like:

jQuery191021287121100443662_1362654468020({
"bombpos": [ "-1372", "2736", "27", "0" ],
...
If you wouldn't do that jquery would act like you try to get data that's not from your source.
It's all because of the same domain policie.

Arkshine
03-07-2013, 07:30
Ok. If it can help you, here more how I would do things, about I said above. I'm not telling you to use that (I don't even know if it works :P), just you give some ideas without the redundant code and bit more efficient.



#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <regex>
#include <sockets_hz>

#define PLUGIN "Online Map"
#define VERSION "1.1"
#define AUTHOR "Sebastian Groß"

new Regex:RegexHandle;
new Socket;
new MapName[ 32 ];
new BombPos[4];

public plugin_init()
{
register_plugin( PLUGIN, VERSION, AUTHOR );

new result, errorstr[ 2 ], errorno;
RegexHandle = regex_compile( "jsonp=(.+)&_=", result, errorstr, charsmax( errorstr ), "i" );

socket_unblock( Socket = socket_listen( "127.0.0.1", 1107, SOCKET_TCP, errorno ) );
server_print( "[Online Map] Waiting for requests on port %d", 1107 );

register_event( "BombDrop", "bombDrop", "a" );
register_logevent( "roundEnd", 2, "1=Round_End" );

get_mapname( MapName, charsmax( MapName ) );

set_task( 0.1, "OnSocketReply", .flags = "b" );
}

public plugin_end()
{
socket_close( Socket );
}

public bombDrop( const player )
{
BombPos[ 0 ] = read_data( 1 );
BombPos[ 1 ] = read_data( 2 );
BombPos[ 2 ] = read_data( 3 );
BombPos[ 3 ] = read_data( 4 );
}
public roundEnd(id)
{
BombPos[ 3 ] = 0;
}

public OnSocketReply()
{
static const requestHeader [] = "HTTP/1.1 200 OK^r^nServer: Online Map^r^nConnection: close^r^nContent-Type: text/plain^r^n^r^n";
static const requestMapHeader [] = "({^r^n^t^"bombpos^": [ ^"%d^", ^"%d^", ^"%d^", ^"%d^" ], ^r^n^t^"map^": ^"%s^",^r^n^t^"users^": [";
static const requestPlayerHeader[] = "^r^n^t{^r^n^t^t^"name^": ^"%s^",^r^n^t^t^"status^": [ ^"%d^", ^"%d^", ^"%d^", ^"%d^" ],^r^n^t^t^"position^": [ ^"%d^", ^"%d^", ^"%d^" ],^r^n^t^t^"angle^": [ ^"%d^", ^"%d^", ^"%d^" ],^r^n^t^t^"stats^": [ ^"%d^", ^"%d^" ]^r^n^t},^r^n";
static const requestEndHeader [] = "]^r^n})";

static request;

if( ( request = socket_accept( Socket ) ) > 0 )
{
static requestData[ 2047 ];
static requestRecv[ 256 ];
static length;
static result;

socket_recv( request, requestRecv, charsmax( requestRecv ) );

length = copy( requestData, charsmax( requestData ), requestHeader );

if( regex_match_c( requestRecv, RegexHandle, result ) )
{
static match[ 64 ];

regex_substr( RegexHandle, 1, match, charsmax( match ) );
length += copy( requestData[ length ] , charsmax( requestData ) - length, match );
}

length += formatex( requestData[ length ], charsmax( requestData ) - length, requestMapHeader, BombPos[0], BombPos[1], BombPos[2], BombPos[3], MapName) ;

static playersList[ 32 ], playersCount, player;
static playerName[ 32 ];
static angles[ 3 ];
static origin[ 3 ];
static i;

get_players( playersList, playersCount );

for( i = 0; i < playersCount; i++ )
{
player = playersList[i];

get_user_name( player, playerName, charsmax( playerName ) );
get_user_origin( player, origin, 0 );
get_user_origin( player, angles, 3 );

length += formatex( requestData[ length ], charsmax( requestData ) - length, requestPlayerHeader,
playerName,
is_user_alive( player ),
cs_get_user_team( player ),
get_user_weapon( player ),
get_user_health( player ),
origin[0], origin[1], origin[2],
angles[0], angles[1], angles[2],
get_user_frags( player ),
get_user_deaths( player ) );
}

length += copy( requestData[ length ] , charsmax( requestData ) - length, requestEndHeader );

socket_send( request, requestData, length );
socket_close( request )
}
}

silkker
03-07-2013, 08:29
WOW - just thank you. It seems like there are some errors but I think I can get that done :) Does the donate button in your signature lead to your pocket? ;)

[EDIT] sorry not some errors, one error :) i can open the stream via telnet but the browser can't handle it. But as I said I think I will get that done :)

silkker
03-07-2013, 14:38
Arkshine your plugin worked to fast i had to implement a little break :D (let it count to 999) and yeah that's true the response comes so fast that the browsers thinks its an error. It just took under 1ms :D

Arkshine
03-07-2013, 14:58
for(i = 0; i < 768; i++) {
i*i;
}

What is this ugly thing ?

VERSION is not changed also.

And I think you should create a cvar so people can change port easily.

silkker
03-07-2013, 15:01
Yeah that's just like a break. The socket closes too fast. And set_task is to slow :/. But I'm working on a nice solution. But for now it does the job...

silkker
03-11-2013, 09:13
Hi guys,

is there anybody out there who can give me a helping hand? It seems that the plugin has some problems on unix servers. I rented a unix server and the plugin won't seem to work properly. But it does on mapchange or restart. When the server is restarted or the map is changed a second time. It won't work again... So I would need somebody who can test it on his unix server. Perhaps it's just my server. It works fine in a windows environment.

I deleted the download because I don't want to give away a broken plugin. If there's anybody out there willing to help me please send me a pm.

Arkshine
03-11-2013, 11:13
Not loading or not working ?

silkker
03-11-2013, 11:19
Yeah you're right it's just not working. Not loading is the wrong term for it. But as i wrote above in a windows environment it always works without any problems.

eforie
03-11-2013, 18:41
Hi guys,

is there anybody out there who can give me a helping hand? It seems that the plugin has some problems on unix servers. I rented a unix server and the plugin won't seem to work properly. But it does on mapchange or restart. When the server is restarted or the map is changed a second time. It won't work again... So I would need somebody who can test it on his unix server. Perhaps it's just my server. It works fine in a windows environment.

I deleted the download because I don't want to give away a broken plugin. If there's anybody out there willing to help me please send me a pm.

Hi, i can test your plugin on my unix server.
Please give me the onlinemap.zip

silkker
03-11-2013, 18:59
Very experimental... Good luck with it :)

jingojang
03-11-2013, 21:02
awesome plugin dude

silkker
03-13-2013, 06:35
Okay thank you for the informations about how the plugin is working for you that never came. ;) Okay I installed Ubuntu running in parallels and now i know that it initializes the plugin but on restart/mapchange it seems that it does not open the port again. Perhaps there's something wrong with the plugin_end() so that it doesn't close the socket the right way. Just wanted you to know.

silkker
03-13-2013, 08:37
FIXED IT: there was a problem with the sockets_hz module. Updating first post now and reuploading the plugin.

silkker
03-13-2013, 15:40
OT: Plugin working on unix and got a new pope. Today was a godd day :)

Arkshine
03-13-2013, 17:27
Why do you glue all together in plugin_init ?
Use pcvar.
You don't use always charsmax() or sizeof
Using one socket_send() doesn't work, which would be weird ?
Why do you have "requestPlayerHeaderLast" just to change few characters ? It doesn't make sense.

silkker
03-13-2013, 17:34
Why do you glue all together in plugin_init ?
Use pcvar.
You don't use always charsmax() or sizeof
Using one socket_send() doesn't work, which would be weird ?
Why do you have "requestPlayerHeaderLast" just to change few characters ? It doesn't make sense.

I'm gonna update it the next few hours.

[EDIT] Using one socket_send() doesn't work, which would be weird ? I thought it would not work because of a few problems I had with the unix servers but I could handle it. Using most of the code you wrote for me now - again :D

jingojang
03-14-2013, 12:24
Legal wallhack, awesome. Is there any delay on this or is it possible to use as an advantage in-game?

AmineKyo
03-14-2013, 13:24
Legal wallhack, awesome. Is there any delay on this or is it possible to use as an advantage in-game?

Not legal wallhack, It's like UAV Radar

silkker
03-14-2013, 13:52
Yup it's just lake a radar :D but it would be possible to code something like a buffer. You're welcome to do so. But I would recommend doing this in the JS part in the onlinescript. Because you have to buffer a lot of data (e.g. for 10 seconds 100 incoming json files).

hornet
03-15-2013, 07:39
This is insane! :D New admin radarhack ;)
Great job!

silkker
03-15-2013, 12:21
I've updated the html part of the plugin.

Arkshine
03-15-2013, 12:59
static requestData[ 8192 ];

There is no point to use such size, since socket_send() use the AMXX buffer and the max size of the buffer is 3072.

silkker
03-15-2013, 13:36
static requestData[ 8192 ];

There is no point to use such size, since socket_send() use the AMXX buffer and the max size of the buffer is 3072.

Maybe I'm wrong but I think I bypassed it by using #pragma dynamic.

Arkshine
03-15-2013, 13:49
It's unrelated.

From socket_sent : char* data = MF_GetAmxString( amx , params[ 2 ] , 0 , &len );

When you use MF_GetAmxString, it copies data in a buffer. The size of this buffer is 3072. It's harcoded, it's unrelated to allocating more memory.

silkker
03-15-2013, 14:07
strange...

if I use static requestData[3072] the response looks like:
(look at the last line)



({
"bombpos": [ "0", "0", "0", "0" ],
"server": [ "localhost", "27015", "Counter-Strike 1.6 Server", "32" ],
"map": "de_dust2",
"users": [
{
"name": "Campers Death",
"status": [ "1", "1", "1", "100" ],
"position": [ "187", "135", "18" ],
"angle": [ "-9", "511", "27" ],
"stats": [ "0", "0" ]
},

{
"name": "Alloc",
"status": [ "1", "2", "11", "100" ],
"position": [ "824", "2683", "132" ],
"angle": [ "256", "2732", "143" ],
"stats": [ "0", "0" ]
},

{
"name": "Headshot Deluxe",
"status": [ "1", "1", "1", "100" ],
"position": [ "716", "-61", "36" ],
"angle": [ "128", "82", "53" ],
"stats": [ "0", "0" ]
},

{
"name": "Robert_Downey_Jr",
"status": [ "1", "2", "11", "100" ],
"position": [ "329", "2068", "-91" ],
"angle": [ "723", "2113", "-74" ],
"stats": [ "0", "0" ]
},

{
"name": "George_Hamilton",
"status": [ "1", "2", "26", "100" ],
"position": [ "1227", "2656", "150" ],
"angle": [ "1791", "2064", "220" ],
"stats": [ "0", "0" ]
},

{
"name": "Bridget_Fonda",
"status": [ "1", "1", "1", "100" ],
"position": [ "-1861", "-217", "61" ],
"angle": [ "-1849", "149", "0" ],
"stats": [ "0", "0" ]
},

{
"name": "Jean_Claude_Van_Damme",
"status": [ "1", "1", "26", "100" ],
"position": [ "-1663", "671", "68" ],
"angle": [ "-1556", "1279", "103" ],
"stats": [ "0", "0" ]
},

{
"name": "Hemp Invader",
"status": [ "1", "2", "11", "100" ],
"position": [ "-359", "1626", "-91" ],
"angle": [ "-479", "1646", "-75" ],
"stats": [ "0", "0" ]
},

{
"name": "Sylvester_Stallone",
"status": [ "1", "1", "1", "100" ],
"position": [ "-2038", "-858", "164" ],
"angle": [ "-2239", "-617", "178" ],
"stats": [ "0", "0" ]
},

{
"name": "Mel_Gibson",
"status": [ "1", "2", "1", "100" ],
"position": [ "1505", "2622", "115" ],
"angle": [ "1329", "3087", "195" ],
"stats": [ "0", "0" ]
},

{
"name": "Leonardo_DiCaprio",
"status": [ "1", "2", "16", "100" ],
"position": [ "1362", "2105", "36" ],
"angle": [ "1599", "1145", "57" ],
"stats": [ "0", "0" ]
},

{
"name": "Die Humans",
"status": [ "1", "1", "1", "100" ],
"position": [ "-1646", "-906", "166" ],
"angle": [ "-1825", "-991", "188" ],
"stats": [ "0", "0" ]
},

{
"name": "Kugelfang",
"status": [ "1", "2", "16", "100" ],
"position": [ "-415", "1751", "-91" ],
"angle": [ "-511", "1670", "-74" ],
"stats": [ "0", "0" ]
},

{
"name": "Dr. No",
"status": [ "1", "1", "26", "100" ],
"position": [ "-332", "-641", "163" ],
"angle": [ "-172", "-512", "64" ],
"stats": [ "0", "0" ]
},

{
"name": "Android",
"status": [ "1", "2", "1", "100" ],
"position": [ "643", "2064", "-59" ],
"angle": [ "1791", "2146", "240" ],
"stats": [ "0", "0" ]
},

{
"name": "Larry_Fishbourne",
"status": [ "1", "1", "1", "100" ],
"position": [ "-1477",



if I use requestData[8192] it's the complete JSON

Arkshine
03-15-2013, 14:27
You get this output how ?

silkker
03-15-2013, 14:29
via telnet or browser. http://85.131.227.229:8898 <-- try this.

doondook
03-16-2013, 15:34
Nice plugin. Watching your demo I've found a bug. If a player puts the C4 at the end of the round it's still shown at new round.

silkker
03-16-2013, 17:31
Nice plugin. Watching your demo I've found a bug. If a player puts the C4 at the end of the round it's still shown at new round.

Thank you fixed it.

silkker
03-17-2013, 10:07
would it be allowed to do a loop for the OnSocketReply function so that more users can connect without lagging the online view? for example:


public doMoreOften() {
for(new i = 0; i < 16; i++ ) {
OnSocketReply();
}
}

internel
03-17-2013, 10:23
oh wow, this is an excellent job :)

I'll totally recommend this to my friends and of course, I'll use it for my server, thank you :D

silkker
03-17-2013, 10:26
thank you. but best keep an eye on this thread because the plugin is still in development. there are still a few changes to be made. :)

internel
03-17-2013, 11:26
thank you. but best keep an eye on this thread because the plugin is still in development. there are still a few changes to be made. :)

sure, then I'll wait until it's approved :P, good luck with the project :D

eforie
03-18-2013, 13:17
I`m getting problems with installing this plugin.


1. I have a website www.mywebsite.com (http://www.mywebsite.com)
2. I put the www folder to www.mywebsite.com/onlinemap (http://www.mywebsite.com/onlinemap)
3. I have one cs server with IP 50.**.***.*
4. www.mywebsite.com (http://www.mywebsite.com) has IP 40.**.***.*

What should I put here?
a) window.server = '40.**.***.*';
b) window.port = 80;
c) window.serverAddr = '50.**.***.*';

a) should be the website ip ?
b) I can use 80 port to run script without IP & PORT ? like http://onlinemap.waweasy.com/ (http://onlinemap.waweasy.com/)
c) should be the ip of counter-strike server?


And for the plugin sv_onlinemap 80 ?

I need help, please reply.
Thank you.

silkker
03-18-2013, 14:18
I understand that reading foreign languages can be hard and that you therefore might not have followed the instructions. I'm really willing to help you but i need to have a little more information. At least i need to have the full server IP to check if the plugin is sending the information we need.

[EDIT] Okay I found the "website". Have you downloaded Sockets2 and compiled the plugin without errors? Leave the "window.serverAddr" empty. If you want to use port 80 you can do that. But make sure that there's not running an HTTP-Server on the same IP.

silkker
03-19-2013, 07:24
so after a bit of testing I found out that on a server with 32 players the requestData always is about 6000 chars long. I have no idea why it's working with such long strings if it usually just can hold 3072 chars. I better leave this to the pros but for me it's working. So can anyone tell me what I have to do next to get the plugin approved? I'm going to rewrite the plugin so that the "Loose indentation" error will be fixed.

TRUE RED
03-24-2013, 13:11
Error while compiling

eforie
03-24-2013, 13:55
Error while compiling

I uploaded for you. Take it !

Arkshine
03-24-2013, 13:59
You are not allowed to attach AMXX files.

sulinek
03-27-2013, 11:51
it works for linux servers also ?

TRUE RED
03-29-2013, 01:51
doesn't work for me. i have debian

silkker
03-29-2013, 15:39
sorry for being absent so long. It definitely works on linux machines because the online preview runs on a linux machine :) you just have to compile it the right way open the right port and you're good to go :) and before I forget if your servers are not running on a root server it could be that your provider blocks the port.

TRUE RED
03-30-2013, 13:45
i have root and why i have errors? i'm trying to compile it the right way as usual - locally

silkker
03-30-2013, 16:04
what errors do you get?

doondook
03-30-2013, 19:32
It would be nice, if you add attack drawing.

kiki33hun
03-31-2013, 07:49
Good job. This is nice. Jabatv go trash :D

TRUE RED
03-31-2013, 09:33
http://forums.alliedmods.net/showpost.php?p=1919008&postcount=55

kiki33hun
03-31-2013, 09:42
http://forums.alliedmods.net/showpost.php?p=1919008&postcount=55


Ou are blind? :) This is not error. Only warning.

TRUE RED
03-31-2013, 11:18
Ok. Does it work for you?

Artifact
03-31-2013, 13:27
This not work for me... I get warn too when compile, and when upload this to game panel plugin dont work

In amxmodmenu (cvar section) plugin show like "unknown - 5"

and when I type amx_cvar sv_onlinemap
http://oi50.tinypic.com/55ja7o.jpg

but everything I do...



Insert plugin in plugins folder
Write onlinemap.amxx in plugins.ini
Upload files to web server
Edit index.html
Restart server
Upload dll file (for socket)

and nothing

Unkolix
04-01-2013, 04:58
And what if I have 2 servers on the same IP, just the server port is different? How can I make it work on both?

P.S. Everything is working perfectly. I wish you could make hostages show too :)

If someone is interested into making overviews, I can make a tutorial :)

roymor
04-02-2013, 07:16
OP I wonder if it can be used to some sort of anti cheat system like if someone move in short amount of time alot of distance (ofcourse if no mods / maps that involve speed changing of the player)

Unkolix
04-02-2013, 08:12
OP I wonder if it can be used to some sort of anti cheat system like if someone move in short amount of time alot of distance (ofcourse if no mods / maps that involve speed changing of the player)

You should ask this in requests... This plugin has nothing to do with your idea.

My suggestions:
1. Add spectator list on the side of the web.
2. Change the lookat_rad when the player is shooting. (I changed the color of original lookat_rad.png to red and attached it.)
3. Add hostage images. (You can use .png I attached, or just make grey circles, like CT or T)

oxygen935
04-02-2013, 13:56
what i must do to make compatitible other maps(i mean like jailbreak maps or others i don't know...)

Unkolix
04-02-2013, 14:42
what i must do to make compatitible other maps(i mean like jailbreak maps or others i don't know...)

Hmmm, it is quite an easy job. Type in google "How to create overview for CS 1.6 map" and you should see CSBANANA tutorial. Do everything by it.

P.S. If you want to make it better, run the game on windowed mode and hide HUD by typing in console "hud_draw 0"

When you get the map info (dev_overview 2), you should disconnect, copy the info (it should show massively a lot of lines, you need only one).
To make the map_name.txt file, follow this example:
So you copied the code that shows after typing dev_overview 1, I used cs_max map and I got this line:
Overview: Zoom 3.60, Map Origin (240.00, 448.00, 80.00), Z Min 321.00, Z Max -161.00, Rotated 0
On the other hand, I will make it into symbols:
Overview: Zoom ZOOM_NUM, Map Origin (X, Y, Z), Z Min MIN_NUM, Z Max MAX_NUM, Rotated ROT_NUM
// overview description file for map_name.bsp

global
{
ZOOM ZOOM_NUM
ORIGIN X Y Z(I don't know exactly, I saw that this num sometimes is the MAX_NUM)
ROTATED ROT_NUM
}

layer
{
IMAGE "overviews/map_name.bmp"
HEIGHT MAX_NUM
}
And you should end with something like this:
// overview description file for cs_max.bsp

global
{
ZOOM 3.60
ORIGIN 240 448 80(or -161 I am not sure exactly)
ROTATED 0
}

layer
{
IMAGE "overviews/cs_max.bmp"
HEIGHT -161
}

oxygen935
04-02-2013, 15:27
and what about the picture?
i didn't understand...

Unkolix
04-02-2013, 15:32
and what about the picture?
i didn't understand...

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.

roymor
04-02-2013, 16:23
You should ask this in requests... This plugin has nothing to do with your idea.

My suggestions:
1. Add spectator list on the side of the web.
2. Change the lookat_rad when the player is shooting. (I changed the color of original lookat_rad.png to red and attached it.)
3. Add hostage images. (You can use .png I attached, or just make grey circles, like CT or T)
"I wonder if" what I simply ask is yes / no answer since the author know his mod the best then other people I didn't asked anyone to make me this please read.

silkker
04-03-2013, 09:59
- Spectator list is possible but i don't know if it's really needed. But i will implement it in the next release.

- Changing the lookat_rad when a player is shooting is probably possible but you have to know that there's no permanent connection between the server and the map you see online. It just gets the data every ~100 ms so you probably wouldn't see the change of it because it's to fast. I just could do something like a cooldown if somebody stops shooting it changes back to the green lookat_rad after 500ms or 1000ms.

- I'm working on adding hostages already. So just wait for the next release :)

Artifact
04-05-2013, 18:17
And what if I have 2 servers on the same IP, just the server port is different? How can I make it work on both?
I have same question...
My pub server is on 27044 port and my cw is on 27045 port... How can I solve this problem?

silkker
04-06-2013, 05:01
You just have to set "sv_onlinemap" to two different ports. And make two different pages for the HTML part. Take a look at the index.html, you'll see what you need to change.

Unkolix
04-06-2013, 05:52
You just have to set "sv_onlinemap" to two different ports. And make two different pages for the HTML part. Take a look at the index.html, you'll see what you need to change.

Is it window.serverAddr = '';

silkker
04-06-2013, 06:25
nope it's "window.port" set it to the port you configured in your server.cfg

Unkolix
04-06-2013, 06:38
nope it's "window.port" set it to the port you configured in your server.cfg

Hmm... What's the command to configure the port in server.cfg? I've never seen it...

And then what's window.serverAddr = ''; for?

silkker
04-06-2013, 06:41
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.


"window.servAddr" would be used for redirecting to another html file. But leave it empty.

Artifact
04-06-2013, 10:17
Can u compile this plugin for me, because i have one error...
http://oi50.tinypic.com/55ja7o.jpg

Unkolix
04-06-2013, 10:48
Oh, I can't figure out how to call this window:
https://forums.alliedmods.net/attachment.php?attachmentid=117116&d=1363363285

Artifact
04-06-2013, 13:06
Just hold space...

Unkolix
04-06-2013, 13:18
Just hold space...

It's kinda stupid, because in my web browser it just goes to the very bottom of the page and all I can see is half of the window...

Artifact
04-06-2013, 13:54
In my too... but did you know how to solve my problem because you probably solve this

Unkolix
04-06-2013, 14:57
I don't.

One more suggestion:

Make that window come out when you press TAB, and make it go down as the web browser scrolls down.

Artifact
04-06-2013, 15:45
Its not possible

Unkolix
04-06-2013, 15:58
Its not possible

How do you know?

silkker
04-06-2013, 16:04
Tab is bound to jumping to the next "input" object in every browser I know. But you can change it in script.js on line 74. Just change "32" to whatever you want.

a list of keycodes can be found here (http://www.webonweboff.com/tips/js/event_key_codes.aspx).

Unkolix
04-06-2013, 16:38
Tab is bound to jumping to the next "input" object in every browser I know. But you can change it in script.js on line 74. Just change "32" to whatever you want.

a list of keycodes can be found here (http://www.webonweboff.com/tips/js/event_key_codes.aspx).

Thanks. Can you make that the table would scroll down with the web page?

Artifact
04-06-2013, 17:41
silkker can you enter into my computer and setup this plugin on my server... I do everything but like plugin dont work... On web server everything is all right but on game server something is wrong

silkker
04-08-2013, 03:53
silkker can you enter into my computer and setup this plugin on my server... I do everything but like plugin dont work... On web server everything is all right but on game server something is wrong

I'm sorry, Dave. I'm afraid I can't do that.

Kz1.0
04-12-2013, 16:37
How to install it,
I Have a HLDS with port is 12345.
So I have to edit the port in index.html to 12345, the cvar sv_onlinemap to 12345 ??

silkker
04-13-2013, 05:49
No you don't have to change anything. There's an extra port that opens for the queries and thats the "sv_onlinemap" port.

pewex
06-08-2013, 13:32
sockets2 (by Bugsy https://amxmodx.org/showthread.php?p=1573388)

this site is dangerous, not work, my browser blocked this, wirus ?

please update socks

Smatify
06-08-2013, 15:22
this site is dangerous, not work, my browser blocked this, wirus ?

please update socks

Same here.

Try this : https://forums.alliedmods.net/showthread.php?t=169315

AmineKyo
06-08-2013, 16:37
this site is dangerous, not work, my browser blocked this, wirus ?

please update socks

Because of HTTPS and amxmodx.org domain doesn't support secure HTTP yet, the browser shows you that the website failed to support secure http, that's why.

YamiKaitou
06-08-2013, 20:13
this site is dangerous, not work, my browser blocked this, wirus ?

please update socks

That site is owned and operated by this site (both sites are on the same physical server). Simply replacing amxmodx.org with forums.alliedmods.net "fixes" the link. I will update the post to reflect the same

tonykaram1993
06-10-2013, 23:07
please update socks

I am all out of socks, all my socks are in the washing machine :P

Leonidddd
06-17-2013, 05:16
After 10-15 minutes:
( ! ) Warning: file(overviews/bmsl_m01.txt) [<a href='function.file'>function.file</a>]: failed to open stream: No such file or directory in D:\wamp\www\coop\overview\index.php on line 25
Call Stack
# Time Memory Function Location
1 0.0012 699408 {main}( ) ..\index.php:0
2 0.4530 702552 file ( ) ..\index.php:25
Site:http://gameswitch.org/coop/overview/

Jamesas007
06-17-2013, 08:35
15:34:13 L 06/17/2013 - 15:34:13: -------- Mapchange to de_dust2 --------
15:34:13 L 06/17/2013 - 15:34:13: [AMXX] Invalid Plugin (plugin "onlinemap.amxx")

Mofforg
06-25-2013, 19:19
silkker, i can not find version of sockets2 without bugs. Maybe you should use default sockets or some other socket edition? I am using Linux.