[All Sro] Generic Server Stats

12/23/2009 00:49 pushedx#1
[Only registered and activated users can see links. Click Here To Register...]

This program is a generic server stats program for all Silkroad versions. It uses a lot of the code I have already released as part of my edxSilkroadLoader project to be fully data driven. In addition, I have added in code that shows how to convert the server names from foreign languages into English by hand via code.

For SRO versions that block most IPs, like JSRO and TSRO, the names will need to be translated and the program recompiled if you want English names for those versions. I only used Google translator for the translations of the names, so for the servers that are wrong, you will need to recompile the program.

This is a programmers project and tool! It does not have a GUI but rather just displays information on a console. The program is setup to write out a text file to make processing the server stats information easy. The format of the file is as follows:
Quote:
# of servers
Server Id
Server Name
Current Players
Max Players
State (1 = open, 0 = check)
...
Server Id
Server Name
Current Players
Max Players
State (1 = open, 0 = check)
For example, RSRO would look like this:
Quote:
2
220
Zeus
354
2500
1
221
Venus
539
2500
1
So if you have a website, you can upload the file via FTP to your own directory and write a simple PHP script or ASP script to parse the file and display the results. Or, you can post the data via PHP via a web URL. Doing that is outside the scope of this thread, but that is just one idea of many I've had requested that lead to the creation of this tool.

All source code is provided and as a bonus I have included an updated Silkroad Security API. This API allows full emulation of the Silkroad security protocol so you can implement a true man in the middle attack without modifying the client at all if you setup your own proxy or want to add Silkroad security to your emulator project. It's not the simplest concepts to understand, but everything you need is there so you just have to take the time to figure it all out.

[Only registered and activated users can see links. Click Here To Register...] -- Result: 1/41 (2.44%)

If the program fails to run with an Application Configuration Error, you will need to install:
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]

Please read the "readme.txt" file as well for additional information on how to run the program multiple times and for other details. I hope there are not any serious bugs, but I have done simple testing on all the SRO versions I have and had no problems.

The project and code is provided in the public domain with no license and comes with no warranty or support. You can use it and modify it however you need.

Enjoy! :)
12/23/2009 04:57 _FoulSoul_#2
nice work as awalys. keep on.
12/23/2009 07:57 GibCo2ntra#3
You're awesome! How do you get all these ideas?
12/23/2009 20:10 pushedx#4
Thanks for the comments guys. :)

I've made a bit of an update to make this project a lot easier to work with and more usable. All translation logic has been moved to Unicode data files now, so you can easily change the existing translations without having to recompile. In addition, server names that are not translated are logged to a file so you can easily copy and paste their names. I also fixed a few bugs that would result in a crash due to exception handling code being slightly off.

I hope this new version is much better now! Here is the new readme.txt
Code:
SroServerStats (1.1)
pushedx

==] Setup [==

Locale to Language
	2 --> KSRO
	4 --> CSRO
	12 --> TSRO
	18 --> ISRO
	23 --> VSRO
	15 --> JSRO
	38 --> THSRO
	40 --> RSRO

translations.txt -- Contains the translations of the server names. The format is:

	Silkroad Locale
	Text to translate
	Desired translation

config.txt -- Contains the code page value for the specific Silkroad locale. The format is:

	Silkroad Locale<TAB>Code Page

You will not need to modify this file!

==] Usage [==
	SroServerStats <Interval (ms)> <Silkroad Path> <Division>

Examples:
	SroServerStats.exe 5000 "J:\sro\[isro][225]Silkroad" 1
	SroServerStats.exe 5000 "J:\sro\[csro]Silkroad" 2
	SroServerStats.exe 5000 "J:\sro\[thaisro]Silkroad" 1

==] Instructions [==

1. Edit "run.bat"
 - Modify the Interval if you need to (minimal is 500ms)
 - Modify the path to your Silkroad directory
 - Modify the Division if you need to

2. Save "run.bat" and then execute it.

3. Press any key in the console to exit the SroServerStats program.

4. Any server names not translated, will be added to the "Unknown.txt" file. 
*** Please do not delete this file ***
Simply open it up in note pad and delete the contents and save it again.

SroServerStats saves an INI file of the SRO version you are running in the format of:

# of servers
Server Id
Server Name 
Current Players
Max Players
State (1 = open, 0 = check)
...
Server Id
Server Name
Current Players
Max Players
State (1 = open, 0 = check)

For example, from RSRO_1.ini:

2
220
Zeus
354
2500
1
221
Venus
539
2500
1

You can easily process the data in this file to have access to the server stats information on demand.

If you wish to run the program multiple times for different versions, simply create a new .BAT file for
each version and modify the command line data.
[Only registered and activated users can see links. Click Here To Register...] 2/40 (5%)

If anyone uses this a lot, please let me know how it goes. Or if you need some help using it, feel free to ask.
12/23/2009 23:45 s2k#5
this is awesome bro, i love you for that you allow us to be leecher of your knowledge.

good luck for your future projects!
12/24/2009 03:27 hadyz3#6
awesome project for isro and rusro in the next few weeks coz i expect a crowded servers there
for other versions of sro we will need it for fun ( NO crowded servers)

offtopic: autoselect got fucked up in ksro coz as u know they hate botters ( especially goldbots:rolleyes:) do u have any idea how to fix it?
i know u dont have time for it just try to give us ideas
ty again:handsdown:
12/24/2009 20:03 djfisring#7
Really nice project :)

Is it able to change the format of how it shows the server status?
And also is it able to just have one or some servers to be shown only?
12/25/2009 20:17 XchangliiX#8
Nice dude more then the one from PH!
01/10/2010 00:20 Yo123#9
once again drew, i want you to marry me
01/10/2010 14:46 iW84u#10
looks pritty :) and usefull
01/13/2010 15:55 Sakurii#11
I don't get it to work, could someone make something like a guide, I'm in rSRO btw.
01/13/2010 16:10 pushedx#12
Quote:
Originally Posted by Sakurii View Post
I don't get it to work, could someone make something like a guide, I'm in rSRO btw.
All you have to do is modify "run.bat" to have the path of your Silkroad directory and then run the batch file.

So if your rSRO path is: "C:\program files\[rsro]Silkroad" then your run.bat file would be:

SroServerStats.exe 1000 "C:\program files\[rsro]Silkroad" 1

And that's it! All you have to do is change the path to your Silkroad directory, the other options are for people who want to use the stats and upload them to the web.
01/13/2010 16:17 Sakurii#13
I did that but then it does nothing... I'm gona try again but what should I do with the serverstats.exe (or something) and where should I see the stats? :)

I do have W7 64-bit, maybe that's it, and i'm runnin rSRO. I just says SroServerStats.exe blablabla press a button to continue and then it shuts down :)

Now it says can't load Media.pk2... I'm confused :p
01/21/2010 03:37 Murgen#14
Kinda a neat little tool.
01/28/2010 10:30 PhreaK™#15
Every time i try and use it i get a pk2 reader tool error...anybody know the solution to this?