Raised This Month: $51 Target: $400
 12% 

Connecting to a different server & get info


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 03-11-2012 , 12:46   Connecting to a different server & get info
Reply With Quote #1

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
__________________

anakin_cstrike is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 03-11-2012 , 12:48   Re: Connecting to a different server & get info
Reply With Quote #2

http://forums.alliedmods.net/showthread.php?t=142858
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 03-12-2012 , 12:21   Re: Connecting to a different server & get info
Reply With Quote #3

won't work..
__________________

anakin_cstrike is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-12-2012 , 12:25   Re: Connecting to a different server & get info
Reply With Quote #4

Quote:
Originally Posted by anakin_cstrike View Post
won't work..
Show your code, because it does work.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 03-12-2012 , 16:44   Re: Connecting to a different server & get info
Reply With Quote #5

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 .."
__________________

anakin_cstrike is offline
DjOptimuS
Senior Member
Join Date: Jan 2009
Old 03-13-2012 , 02:08   Re: Connecting to a different server & get info
Reply With Quote #6

i used that NATIVE few months ago and all worked smoothly. You do something wrong.
DjOptimuS is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 03-13-2012 , 09:36   Re: Connecting to a different server & get info
Reply With Quote #7

Quote:
Originally Posted by DjOptimuS View Post
i used that NATIVE few months ago and all worked smoothly. You do something wrong.
I also have 200+ ping..
__________________

anakin_cstrike is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-13-2012 , 09:45   Re: Connecting to a different server & get info
Reply With Quote #8

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?
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
DjOptimuS
Senior Member
Join Date: Jan 2009
Old 03-13-2012 , 10:12   Re: Connecting to a different server & get info
Reply With Quote #9

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.
DjOptimuS is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 03-13-2012 , 13:19   Re: Connecting to a different server & get info
Reply With Quote #10

Quote:
Originally Posted by Exolent[jNr] View Post
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
__________________


Last edited by anakin_cstrike; 03-13-2012 at 19:53.
anakin_cstrike is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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