Register for your free account! | Forgot your password?

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

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

Advertisement



[Release] Very simple PHP module for server stats

Discussion on [Release] Very simple PHP module for server stats within the SRO Coding Corner forum part of the Silkroad Online category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jun 2011
Posts: 691
Received Thanks: 521
[Release] Very simple PHP module for server stats

Hello, this is my first 'release' in a very long time at EPVP. As you know I gave up long ago trying to participate actively and showing my stuff because of the community actitude. I am not that faithful anymore.

However, here I bring a very little script that I think will be useful. Having a look at all server's websites which has been released and those who I got access by other ways I have realized all of them are using the socket connections, along with handshake drama.

The main reason of this little release is that to make it that way, everytime you are running any request to the website you are managing sockets, opcodes, using external libraries, plus are running few hundreds (or thousands) of code lines. Also with this you don't need any external libraries or any further installation than changing the SQL data in the config.php

This will run a very little script which will take no resources at all and give back the number of users connected at your server in the exact time. I will look forward the response of the community and see if I should keep releasing some of my stuff or not.

I hope some of the website coders find this useful for their project althought is a very little help It may be a beginning of more releases.

This script is coded in PHP since I see is the language chosen by the majority of sro web coders, if you want me to port it to any other language I don't mind to do it.

Download link:



And attached to the thread

Notes: If you need anything just tell me.

The usage is very easy, just go to /config/ and get into config.php and change the SQL data. Then you can run capacity.php and It will prompt the users online. You don't need any installation or any external library, just having PHP engine, no sro api's, odbc connection or stuff like that is needed.

Apart of this, if you have any request or petition in case you are learning or something I don't mind making more stuff if people requests something. Maybe what is hard for you or a crackhead, is easy for me

EDIT1: Checking and cleaning my old PHP stuff I found this database master class. Can be achieved with more optimization but won't make much diff. Pretty useful to code things fast without using a framework:
PHP Code:
<?php
/*
Script made by Getzabelz
for Class Online ([url=http://www.classgame.net]Class Online[/url]).
You can use this file as long as you don't take any personal benefit.
*/
class useDB {
    
    
/*Lists any table, complete or with filters. It will show all the content you filter
     *@param Fields of the table you want to show and the table you want to show off
     */
    
function listar($campos$tabla)
    {
        
$row=0;
        
$datos mysql_query("select ".$campos." from ".$tabla);
        while(
$data=mysql_fetch_row($datos))
        {
            print 
"<tr>";
            while(
$data[$row]!="")
            {
                print 
"<td>".$data[$row]."</td>";
                
$row++;
            }
            print 
"</tr>";
            
$row=0;
        }
        return 
mysql_affected_rows();
    }

    
/*Looks for the fields and values you want in the desired table
     *@param Table, Field, value, you can use SQL filters and OPs
     *@return Prints the data and returns the number of entries found with desired filter
     */
    
function buscar($tabla$campo$valor)
    {
        
$datos mysql_query("select * from ".$tabla." where ".$campo."='".$valor."'");
        while(
$data=mysql_fetch_row($datos))
        {
            print 
"FirstData ".$data['0']." SecondData: ".$data['1']."<br>";
        }
        return 
mysql_affected_rows();
    }
    
    
/*Counts entries from a desired table
     *@param Table you want to use
     *@return Number of rows in the table
     */
    
function contar($tabla)
    {
        
$num mysql_query("select * from ".$tabla);
        return 
mysql_num_rows($num);
    }
    
/*Deletes the desired data from a table
     *@param Table, field, value (filters allowed)
     *@return Returns the number of deleted rows
     */
    
function borrar($tabla$campo$valor)
    {
        
$num mysql_query("DELETE FROM ".$tabla." where ".$campo."='".$valor."'");
        return 
mysql_affected_rows();
    }

    
/*Modifies the data of a table
     *@param Table, Field, Old value, New value (Allows filter)
     *@return Returns the number of rows updated
     */
    
function modificar($tabla$campo$oldvalue$newvalue)
    {
        
$num mysql_query("UPDATE ".$tabla." SET ".$campo."='".$newvalue."' WHERE ".$campo."='".$oldvalue."'");
        return 
mysql_affected_rows();
    }
    
}
?>
Attached Files
File Type: rar easyServerStatus.rar (6.4 KB, 49 views)
Getzabelz is offline  
Thanks
7 Users
Old 05/07/2012, 20:22   #2
 
Biboja's Avatar
 
elite*gold: 0
Join Date: Jul 2009
Posts: 1,121
Received Thanks: 420
How about a demo!? I think it would be more attractive But Thanks
Biboja is offline  
Old 05/07/2012, 20:25   #3
 
elite*gold: 0
Join Date: Jun 2011
Posts: 691
Received Thanks: 521
Quote:
Originally Posted by Biboja View Post
How about a demo!? I think it would be more attractive But Thanks
I don't have any server online except Class, anyway it will just show the players online so you can embed it wherever you want just like:

675

That's all It shows so you can embed it.

I am adding more resources to #1. If anybody wants to test it out and writes here a 'demo' as you said I'd appreciate it
Getzabelz is offline  
Old 05/07/2012, 23:25   #4
 
elite*gold: 0
Join Date: Jan 2012
Posts: 1,867
Received Thanks: 1,091
Quote:
Originally Posted by Getzabelz View Post
I don't have any server online except Class, anyway it will just show the players online so you can embed it wherever you want just like:

675

That's all It shows so you can embed it.

I am adding more resources to #1. If anybody wants to test it out and writes here a 'demo' as you said I'd appreciate it
why wouldn't you put the script into your website? maybe it will help who will come into your site to know the population of server.
anyway deserve a kebab!
•ᵔBeGodOfWarᵔ• is offline  
Thanks
1 User
Old 05/07/2012, 23:49   #5
 
Biboja's Avatar
 
elite*gold: 0
Join Date: Jul 2009
Posts: 1,121
Received Thanks: 420
Quote:
Originally Posted by Getzabelz View Post
I don't have any server online except Class, anyway it will just show the players online so you can embed it wherever you want just like:

675

That's all It shows so you can embed it.

I am adding more resources to #1. If anybody wants to test it out and writes here a 'demo' as you said I'd appreciate it
Thanks ) Well the most important is the function ... It is very easy to design it with images or what ever
Biboja is offline  
Old 05/08/2012, 00:57   #6
 
elite*gold: 0
Join Date: Jun 2011
Posts: 691
Received Thanks: 521
Quote:
Originally Posted by Biboja View Post
Thanks ) Well the most important is the function ... It is very easy to design it with images or what ever
Yea, that's the idea, just include it somewhere with style and that's all.

And I am not going to use it at Class Online because I hadn't got time to make an entire new website... When I get time I will use that and more stuff.

If anybody thinks something is too difficult I don't mind making an explained snippet to help and release it, maybe what is hard for you is easy for me .
Getzabelz is offline  
Old 05/08/2012, 10:06   #7
 
elite*gold: 0
Join Date: Sep 2010
Posts: 783
Received Thanks: 921
eh,wait
this uses sockets and opcodes? so why do you need sql data?
Edit: or maybe it uses _ShardCurrentUser ?
ÑõÑ_Ŝŧóp is offline  
Old 05/08/2012, 10:29   #8
 
elite*gold: 0
Join Date: Jun 2011
Posts: 691
Received Thanks: 521
Quote:
Originally Posted by ÑõÑ_Ŝŧóp View Post
eh,wait
this uses sockets and opcodes? so why do you need sql data?
Edit: or maybe it uses _ShardCurrentUser ?
Check it by yourself. It is not using sockets. thats the idea.
Getzabelz is offline  
Old 05/08/2012, 10:36   #9
 
elite*gold: 0
Join Date: Sep 2010
Posts: 783
Received Thanks: 921
actually,2lazy to deobfuscate
ÑõÑ_Ŝŧóp is offline  
Thanks
1 User
Old 05/08/2012, 11:28   #10
 
ﷲFightZﷲ's Avatar
 
elite*gold: 585
Join Date: Dec 2010
Posts: 644
Received Thanks: 296
wow how many times u encoded that **** ._.

definetly not gonna use anything thats encoded and needs my db informatiomns mhm
ﷲFightZﷲ is offline  
Old 05/08/2012, 17:50   #11
 
LastThief*'s Avatar
 
elite*gold: 60
Join Date: Feb 2012
Posts: 3,942
Received Thanks: 6,474
You're damn pro !

class.php
PHP Code:
<?php

function listSlots($hostname,$username,$password,$dbName)
{
    
connBD($hostname$username$password$dbName);
     
     
     
$query mssql_query("SELECT top 1 nUserCount FROM _ShardCurrentUser WHERE nShardID = 64 ORDER BY nId desc");

     while(
$row=mssql_fetch_array($query))
     { 
        echo 
$row[0]; 
     }
}
 function 
connBD ($hostname$username$password$dbName
 {
    
$dbConn=mssql_connect($hostname,$username,$password) or die ("Database connection failed. Script made by Getzabelz/melkorz123 (www.classgame.net)");
    
mssql_select_db($dbName) or die ("Failed selecting the desired database. Please check that you chose the right account database name. pwned by chernobyl*  ");
 }

 
?>
showCapacity.php

PHP Code:
<?php
//_ -> global vars
require_once('class.php');
listSlots("PWND""sa""1234""SRO_VT_ACCOUNT"); 
?>
and seriously you called me noob in php and writing query with sub query and people calling me awesome ? look at yourself please first

now that's final message

LastThief* is offline  
Thanks
2 Users
Old 05/08/2012, 17:54   #12
 
elite*gold: 0
Join Date: Jun 2011
Posts: 691
Received Thanks: 521
Quote:
Originally Posted by LastThief* View Post
You're damn pro !

class.php
PHP Code:
<?php

function listSlots($hostname,$username,$password,$dbName)
{
    
connBD($hostname$username$password$dbName);
     
     
     
$query mssql_query("SELECT top 1 nUserCount FROM _ShardCurrentUser WHERE nShardID = 64 ORDER BY nId desc");

     while(
$row=mssql_fetch_array($query))
     { 
        echo 
$row[0]; 
     }
}
 function 
connBD ($hostname$username$password$dbName
 {
    
$dbConn=mssql_connect($hostname,$username,$password) or die ("Database connection failed. Script made by Getzabelz/melkorz123 (www.classgame.net)");
    
mssql_select_db($dbName) or die ("Failed selecting the desired database. Please check that you chose the right account database name. pwned by chernobyl*  ");
 }

 
?>
showCapacity.php

PHP Code:
<?php
//_ -> global vars
require_once('class.php');
listSlots("PWND""sa""1234""SRO_VT_ACCOUNT"); 
?>
and seriously you called me noob in php and writing query with sub query and people calling me awesome ? look at yourself please first

now that's final message

I made it fast, just copy&pasted from another class. Anyway you showed that I was wrong trying to help. Won't try again dont worry.
Getzabelz is offline  
Old 05/08/2012, 17:57   #13
 
elite*gold: 0
Join Date: Nov 2009
Posts: 1,163
Received Thanks: 1,161
Actually, you were wrong... this is the silkroad section, not php module or css/html sections..
try the coders section
ღ ∂ Ropp is offline  
Old 05/08/2012, 18:02   #14
 
elite*gold: 0
Join Date: Jun 2011
Posts: 691
Received Thanks: 521
Quote:
Originally Posted by LastThief* View Post
You're damn pro !

class.php
PHP Code:
<?php

function listSlots($hostname,$username,$password,$dbName)
{
    
connBD($hostname$username$password$dbName);
     
     
     
$query mssql_query("SELECT top 1 nUserCount FROM _ShardCurrentUser WHERE nShardID = 64 ORDER BY nId desc");

     while(
$row=mssql_fetch_array($query))
     { 
        echo 
$row[0]; 
     }
}
 function 
connBD ($hostname$username$password$dbName
 {
    
$dbConn=mssql_connect($hostname,$username,$password) or die ("Database connection failed. Script made by Getzabelz/melkorz123 (www.classgame.net)");
    
mssql_select_db($dbName) or die ("Failed selecting the desired database. Please check that you chose the right account database name. pwned by chernobyl*  ");
 }

 
?>
showCapacity.php

PHP Code:
<?php
//_ -> global vars
require_once('class.php');
listSlots("PWND""sa""1234""SRO_VT_ACCOUNT"); 
?>
and seriously you called me noob in php and writing query with sub query and people calling me awesome ? look at yourself please first

now that's final message

Oh btw, professionals coders would deobfuscate my code, instead of asking Chernobyl to make your work, weren't you so pro? That was really sad haha
Getzabelz is offline  
Old 05/08/2012, 18:04   #15
 
LastThief*'s Avatar
 
elite*gold: 60
Join Date: Feb 2012
Posts: 3,942
Received Thanks: 6,474
Quote:
Originally Posted by Getzabelz View Post
I made it fast, just copy&pasted from another class. Anyway you showed that I was wrong trying to help. Won't try again dont worry.
ya sure please tell me why would you encrypt single query ? And also tell me why you was refusing when some one said I'm awesome you were acting like an *** "show me his work because query and sub query aint professioal" and it wasn't evn query with sub query it was rev6 system now tell me who is the noob now ? I can't just stop laughing my *** off in you looping in 1 row and encrypting one query LOL
LastThief* is offline  
Reply


Similar Threads Similar Threads
[RELEASE] Python-Module + Funktionen
09/25/2017 - Metin2 PServer Guides & Strategies - 15 Replies
Moin, ich dachte mir mal, ich trete in die Fußstapfen von hier mehr oder weniger bekannten Mitgliedern (hier ihre Namen verschlüsselt: CxxP & LaSor) und release was, das ich innerhalb von 5 Minuten bekommen kann. Und zwar: Eine vollständige Liste ALLER Module und zugehörigen Funktionen in der Metin2-Binary Die Binary ist von 2010, da ich aber nicht länger als 5 Minuten brauchen darf, konnte ich die neueren Sachen alle noch nicht extracten. Werde ich nachliefern, sobald die gewünschte...
[Mini Release]Skill Module Adition
01/18/2012 - Metin2 PServer Guides & Strategies - 5 Replies
Vorgeschichte: Joa da ich neulich mal meine Scripts wieder angeschaut hatte hab ich mitbekommen, dass ich die Skill Icons einfach nur nooblike dargestellt habe. Daraufhin hab ich mir ein kleines Script gemacht, welches mir die Icons ausgibt. Verwenden tut ihr das Script folgendermaßen: Ihr haut die .pyc Datei einfach in den Lib Ordner und addet dort wo ihr es nutzen wollt das hier: import skilladition SkillAditionByMeLol = skilladition.SkillAditionDialog() Nun könnt ihr diese...
[Release] Fastject Module Injector
10/14/2011 - Coding Releases - 4 Replies
Hey, hier mal ein etwas älterer Injector von mir. Features: 2 different injection methods (CreateRemoteThread and SetThreadContext) module hiding via PEB manipulation auto save / load settings manual injection by process id
[Release]GM codes/ simple server creation help tool
09/20/2011 - Metin2 Guides & Templates - 7 Replies
Hi epvp i've been codeing this program over last 2 days i decided to release it here dunno if it come in handy but check it out guys. :) basically u can get fast access to GM codes and a couple tutorials and stuff its in full english. Have a look at the screens. Main interface- http://i51.tinypic.com/2qt985x.png Sub Windows- http://i53.tinypic.com/xautr5.png here's a virus total scan- VirusTotal - Free Online Virus, Malware and URL Scanner and here's download link - MEGAUPLOAD...
[Release]Zszc server stats for both servers
12/31/2010 - SRO PServer Guides & Releases - 20 Replies
Hello all Since the server stats in sticky thread have all servers But the zszc servers IP changed Then it dont work any more So i maded server stats for both servers



All times are GMT +1. The time now is 07:54.


Powered by vBulletin®
Copyright ©2000 - 2026, 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 ©2026 elitepvpers All Rights Reserved.