Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Silkroad Online > SRO Coding Corner
You last visited: Today at 01:46

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[PHP] Clientless Silkroad Security + ServerStats

Discussion on [PHP] Clientless Silkroad Security + ServerStats within the SRO Coding Corner forum part of the Silkroad Online category.

Reply
 
Old 06/14/2011, 22:08   #16

 
elite*gold: 260
Join Date: Aug 2008
Posts: 560
Received Thanks: 3,778
Quote:
Originally Posted by LastThief View Post
may i know what is this ?
You did not set the "host" parameter. See 'examples.txt' for more information about the parameters.

Quote:
Originally Posted by prot3ctor View Post
Array ( [0] => Error [1] => A connection could not be established. )
That means the Gateway Server you are connecting to is physically down or not accessible from your server (like jSRO on a non-jp IP). If you are sure it is up, then sockets may not be enabled for outgoing connections on your host (unlikely, but possible). Try with different hosts in 'examples.txt'.

Quote:
Originally Posted by inv123 View Post
My only prob that suddenly after some changes stats changed to ratios, hehe
Just multiple the ratio by 3500 before you display and round to a whole number. I provided the ratio in the code just because that's what is in the packet. It's the most 'accurate' to work with, so you can customize the final output if you want cur/max.

-

If you are having other troubles with the scripts, try getting a free host from and testing there. That's the test host I used and had no issues with it. Usually, it'll be a problem with how PHP is configured, but since a lot of places do it differently, there's no easy way to debug it with how PHP works. For reference, this is the from the test host.
pushedx is offline  
Old 06/15/2011, 11:25   #17
 
inv123's Avatar
 
elite*gold: 0
Join Date: Apr 2007
Posts: 968
Received Thanks: 228


Done after some hours
inv123 is offline  
Old 06/16/2011, 00:13   #18
 
elite*gold: 27
Join Date: Dec 2010
Posts: 1,579
Received Thanks: 2,706
Ur the best drew, for real.
Keep up ur good work.

Edit: here got it working:
lorveth is offline  
Old 06/17/2011, 03:05   #19
 
Kape7's Avatar
 
elite*gold: 0
Join Date: Dec 2007
Posts: 3,210
Received Thanks: 6,298
Quote:
Originally Posted by KingLi :P View Post
Ur the best drew, for real.
Keep up ur good work.

Edit: here got it working:
You will break the host if you show the stats to a large amount of users at the same time directly from the script, each user will run it and overload the host. The intention of this script is make a cronjob for update the stats into a DB or similar and show the result to the users, not make the users directly run the script.
Kape7 is offline  
Old 06/17/2011, 11:34   #20
 
lesderid's Avatar
 
elite*gold: 0
Join Date: Dec 2007
Posts: 2,400
Received Thanks: 1,517
Quote:
Originally Posted by Synx7 View Post
You will break the host if you show the stats to a large amount of users at the same time directly from the script, each user will run it and overload the host. The intention of this script is make a cronjob for update the stats into a DB or similar and show the result to the users, not make the users directly run the script.
Or if you don't have cronjobs on your host, you can check the last time it was checked and if it's too long, you do the script and put it in the DB, otherwise you just load it from the DB.
lesderid is offline  
Old 06/21/2011, 20:10   #21
 
inv123's Avatar
 
elite*gold: 0
Join Date: Apr 2007
Posts: 968
Received Thanks: 228
Hmm so strange.
I tryed using the same hosting as edx, 000webhost. But it gave me an error, even if i just trying with the non-modifyed version :/



Everything works smooth @ localhost, but i cant even make it work on remote hosts. So i cant understand how edx's stats working, and mine not
inv123 is offline  
Old 06/24/2011, 18:53   #22

 
elite*gold: 260
Join Date: Aug 2008
Posts: 560
Received Thanks: 3,778
Quote:
Originally Posted by inv123 View Post
Hmm so strange.
I tryed using the same hosting as edx, 000webhost. But it gave me an error, even if i just trying with the non-modifyed version :/
000webhost uses a bunch of different servers with different domain names. It's possible your site is being hosted on a different server that isn't setup the same as the others. I've already had one person mention similar issues with theirs, but there's not much you can do besides trying to find a different host, or trying to figure out what exactly why the configuration isn't working.
pushedx is offline  
Old 06/30/2011, 16:55   #23
 
S3cret's Avatar
 
elite*gold: 0
Join Date: Jun 2009
Posts: 111
Received Thanks: 65
Hi Drew,
is it possible to gather information (iSro) about the maximum number of people who can join a server? Or is the only way to store it in an array and renew it each time a server changes or comes new?

Greets and really well done!
S3cret
S3cret is offline  
Old 06/30/2011, 17:34   #24
 
kevin_owner's Avatar
 
elite*gold: 0
Join Date: Jan 2010
Posts: 1,484
Received Thanks: 809
The server stats of isro is just a decimal number in the packet so you don't really know how much people there are but since you know how full the server is you can calculate how much people can join.

for example server Xian is full for 0.83% you can do the following.
1.00 - 0.83 = 0.17 * 3500 which will result in the number of people who can join.

I don't know it is currently implemented in drew's tool so I'll take a look at it but you can do a lot of things with the data
kevin_owner is offline  
Old 06/30/2011, 17:39   #25
 
lesderid's Avatar
 
elite*gold: 0
Join Date: Dec 2007
Posts: 2,400
Received Thanks: 1,517
Quote:
Originally Posted by kevin_owner View Post
The server stats of isro is just a decimal number in the packet so you don't really know how much people there are but since you know how full the server is you can calculate how much people can join.

for example server Xian is full for 0.83% you can do the following.
1.00 - 0.83 = 0.17 * 3500 which will result in the number of people who can join.

I don't know it is currently implemented in drew's tool so I'll take a look at it but you can do a lot of things with the data
1.00 - 0.83 isn't equal to 0.17 * 3500?
lesderid is offline  
Old 06/30/2011, 18:07   #26
 
kevin_owner's Avatar
 
elite*gold: 0
Join Date: Jan 2010
Posts: 1,484
Received Thanks: 809
no i'm sorry that was not what i ment.
1.00 - 0.83 = 0.17
0.17 * 3500 = Users left to join.
That should be correct I guess thanks

Btw your number of thanks is evil
kevin_owner is offline  
Thanks
1 User
Old 06/30/2011, 20:07   #27
 
inv123's Avatar
 
elite*gold: 0
Join Date: Apr 2007
Posts: 968
Received Thanks: 228
This method will doesnt realy works if a new server opens with for example 2500 max. cap.^^
inv123 is offline  
Old 06/30/2011, 20:49   #28
 
kevin_owner's Avatar
 
elite*gold: 0
Join Date: Jan 2010
Posts: 1,484
Received Thanks: 809
Indeed but you can't know the maximum users for a server in silkroad.
Before they changed the server list packet the packet contained 2 words. the first one was the current users in the server and the second one the maximum. but they changed it to a float so now the client only knows how full the server in a decimal.

So you just assume that the server cap is 3500 but they might have changed it to 1000 you can't know it.
kevin_owner is offline  
Old 06/30/2011, 22:33   #29
 
elite*gold: 0
Join Date: Dec 2007
Posts: 242
Received Thanks: 49
Theoretically speaking you could calculate it. 2999/3000 (0.99966666666666) and 3499/3500 (0,99971428571428) are both really close by, but you can calculate the delta value. You take the result that has the lowest delta value, because it will be more precise than any other.

I wrote this really quick so it's not an optimal solution, nor does it always work correctly.
PHP Code:
    function test($percent) {
        
$ret = array(00); // current, maximum
        
$step 50;
        
$start $step 20;
        
$tolerance 50// 350[3]/3500, 350[1]/3500; nuff said
        
$max 4500 $tolerance// known maximum is 3500
        
$mindelta 1000000// just set it high at the beginning
        
for($i $start$i <= $max$i += $step) {
            for(
$j = (int)($percent $i 5); $j <= $i $tolerance$j++) {
                
$prev = ($j 1) / $i;
                
$curr $j $i;

                if(
abs($percent $prev) <= $mindelta) {
                    
$mindelta abs($percent $prev);
                    
$ret = array($j 1$i);
                }

                if(
abs($percent $curr) <= $mindelta) {
                    
$mindelta abs($percent $curr);
                    
$ret = array($j$i);
                }

                if(
$curr $percent) {
                    break;
                }
            }
        }
        return 
sprintf("%.2f/%.2f"$ret[0], $ret[1]);
    } 
TheSpy is offline  
Old 06/30/2011, 23:04   #30
 
S3cret's Avatar
 
elite*gold: 0
Join Date: Jun 2009
Posts: 111
Received Thanks: 65
So how does Rev6 know the exact max value of a server which just opened?
S3cret is offline  
Reply


Similar Threads Similar Threads
Silkroad Security API
06/09/2011 - SRO Coding Corner - 5 Replies
i was trying to run the server_stats example but it just immediately closeed and i cant figure out why.. also i think i need ti configure the ip or port? where can i do this? edit: I've found the error.. Index was Outside the bounds of the array line 33 the code:
[HELP]silkroad security
05/09/2011 - SRO Coding Corner - 6 Replies
what it silkroad security??? what is the packet analyzing???
Silkroad New security?
01/24/2010 - Silkroad Online - 68 Replies
This must be a joke or something another wanna be Game Guard? cus silkroad added a new folder called hackshield to the game directory... lol anyone have any inputs on this? maybe for once they trying to do something lol kinda funny... :rtfm:
[Tips] Silkroad Account Security
08/24/2009 - SRO Guides & Templates - 12 Replies
Hey, I know there are some threads about this out there but I think this will be useful though. Your password should contain at least 7 letters and/or numbers. Hint: Come up with some really senseless sentence with letters and numbers. Here an example : I look forward to the Simpsos Halloween Special on October 31th., Now take the first letter of every word and your password is: “ilfttshsoo31” For a password like this a bruter needs about 107 years and you can remember it easily. ...
Silkroad Security Video
11/06/2008 - SRO Hacks, Bots, Cheats & Exploits - 10 Replies
Hi guys, i just played a bit with Silkroad and c++. The result was a Undetected Silkroad Keylogger. I was Scanning it for fun on Virustotal.com the result was 1/36 The 1 Antivir who said anythink was Panda - Suspicous File Maybe you have the Question now why did you post this here?



All times are GMT +1. The time now is 01:47.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.