AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Connecting to a different server & get info (https://forums.alliedmods.net/showthread.php?t=180157)

anakin_cstrike 03-11-2012 12:46

Connecting to a different server & get info
 
Let's say i have two servers. On the 1st one i want to install a plugin wich retrieves the num of active players on the 2nd server, in order to do something else later on.
How can i do that? maybe you guys have a small code or smth that does that
I tried looking at xredirect's source but it's too damn complicated for me at this time.

Thanks

drekes 03-11-2012 12:48

Re: Connecting to a different server & get info
 
http://forums.alliedmods.net/showthread.php?t=142858

anakin_cstrike 03-12-2012 12:21

Re: Connecting to a different server & get info
 
won't work..

Exolent[jNr] 03-12-2012 12:25

Re: Connecting to a different server & get info
 
Quote:

Originally Posted by anakin_cstrike (Post 1667509)
won't work..

Show your code, because it does work.

anakin_cstrike 03-12-2012 16:44

Re: Connecting to a different server & get info
 
i justed copied both _example and _api plugins and used sq_server, sq_players command...it's says "acquiring..." but won't show anything...after 5 minutes if i use the command again it shows something like "already .."

DjOptimuS 03-13-2012 02:08

Re: Connecting to a different server & get info
 
i used that NATIVE few months ago and all worked smoothly. You do something wrong.

anakin_cstrike 03-13-2012 09:36

Re: Connecting to a different server & get info
 
Quote:

Originally Posted by DjOptimuS (Post 1667893)
i used that NATIVE few months ago and all worked smoothly. You do something wrong.

I also have 200+ ping..

Exolent[jNr] 03-13-2012 09:45

Re: Connecting to a different server & get info
 
What are the conditions are you using the plugin?
- Are you testing from your local to another server?
- Are the 2 servers far apart (such as a high ping)?
- Are you trying to get data from the same IP, or even the same server?

DjOptimuS 03-13-2012 10:12

Re: Connecting to a different server & get info
 
I tested the native on 5 servers, but all of them were in the same datacenter.

If the servers are far from each other you should change this task

PHP Code:

set_task0.1"TaskReceiveServerInfo"iIndex__"a"SERVER_INFO_WAIT 10 ); 

to a bigger delay, let's say at least 2 seconds instead of 0.1. That should give enough time to the other server to respond.

anakin_cstrike 03-13-2012 13:19

Re: Connecting to a different server & get info
 
Quote:

Originally Posted by Exolent[jNr] (Post 1668022)
What are the conditions are you using the plugin?
- Are you testing from your local to another server?
- Are the 2 servers far apart (such as a high ping)?
- Are you trying to get data from the same IP, or even the same server?

the 2 servers are "close" to each other, they're both hosted at the same company, the same datacenter (@DjOptimuS)
and no, i'm not tryign the get any data from the same server

EDIT: Ok i've changed the task interval to 2.0 seconds and sq_server seems to works fine but sq_players causes ~200 ping and won't show anything

EDIT2: Any example of using that function for redirecting a player to a server if it isn't full? thx


All times are GMT -4. The time now is 01:01.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.