|
You last visited: Today at 02:01
Advertisement
[ASP][c#] Online User & Serverstatus how to code
Discussion on [ASP][c#] Online User & Serverstatus how to code within the SRO Private Server forum part of the Silkroad Online category.
12/07/2015, 13:20
|
#1
|
elite*gold: 0
Join Date: Dec 2008
Posts: 74
Received Thanks: 4
|
[ASP][c#] Online User & Serverstatus how to code
Hello;
İm trying to code web page for vsro private servers.
Anybody know how to code Online user and serverstatus ?
i guess sql code like that
"SELECT TOP 1 nUserCount as Online FROM _ShardCurrentUser WHERE nShardID = 64 ORDER BY nID DESC"
|
|
|
12/08/2015, 02:39
|
#2
|
elite*gold: 0
Join Date: May 2012
Posts: 179
Received Thanks: 56
|
here you go try this >
Quote:
<?php
function checkState($hostname,$port) {
$timeout = 0.1;
$socket = @fsockopen($hostname,$port,$errno,$errstr,$timeout );
if($socket) return true;
return false;
}
function valueBetween($value, $high, $low) {
if($value < $low) return false;
if($value > $high) return false;
return true;
}
?>
<?php ////////////////////////////////////////////////////////////////////////////// Shard DB ////////////////////////////////////////////////////////////////////////////// ?>
<?php
$mssql->dbClose();
$mssql->dbOpen($conf->shardDbName) ;
$TotalCharacter = $mssql->numRows("SELECT * FROM _Char");
$mssql->dbClose();
$mssql->dbOpen($conf->accountDbName);
?>
<?php
$mssql->dbClose();
$mssql->dbOpen($conf->accountDbName) ;
$TotalUsers = $mssql->numRows("SELECT * FROM TB_User");
$mssql->dbClose();
$mssql->dbOpen($conf->shardDbName);
?>
<?php ////////////////////////////////////////////////////////////////////////////// Account DB ////////////////////////////////////////////////////////////////////////////// ?>
<?php
if(isset($_POST['submit'])) {
$username = $sec->secure($_POST["id"]);
$password = md5($sec->secure($_POST["pw"]));
$query = $mssql->dbQuery("SELECT * FROM TB_User WHERE StrUserID ='$username'");
$row = sqlsrv_fetch_array($query);
$check = $mssql->numRows("select * from TB_User where StrUserID = '$username' and password = '$password'");
$TotalUsers = $mssql->numRows("SELECT * FROM TB_User");
if ($check != 1) {
echo '<script type="text/javascript">';
echo ' alert("Invalid username and/or password!");';
echo '</script>';
} else {
$_SESSION['JID'] = $row['JID'];
$_SESSION['email'] = $row['Email'];
$_SESSION['Sex'] = $row['sex'];
$_SESSION['username'] = $username;
$_SESSION['userrank'] = $row['sec_content'];
$_SESSION['IsLoggedIn'] = true;
}
}
?>
<?php ////////////////////////////////////////////////////////////////////////////// Server Stats ////////////////////////////////////////////////////////////////////////////// ?>
<div class="page-body newsblock">
<div class="news-title">
Server Stats:
</div>
<table style="border:1px solid #3f3f3f; border-radius: 8px 8px 8px 8px;padding: 4px;background-color:rgba(50,50,50,0.55);text-align:center;color: #fff; font-family: Arial, Helvetica, sans-serif;" width="100%" cellpadding="0" cellspacing="0"align="center">
<tr>
<td style="border:1px solid #3f3f3f;background:rgba(0,0,0,0.55);"width="80%" align="left">Unholy Server: </td>
<td style="border:1px solid #3f3f3f;background:rgba(0,0,0,0.55);"width="20%">< font style='color:#ffa800'><?php echo "<b>$conf->Unholy Server</b> "; ?></font></td>
</tr>
<tr>
<td style="border:1px solid #3f3f3f;background:rgba(0,0,0,0.55);" align="left">Total Account:</td>
<td style="border:1px solid #3f3f3f;background:rgba(0,0,0,0.55);"><font style='color:lime'><?php echo $TotalUsers; ?></font></td>
</tr>
<tr>
<td style="border:1px solid #3f3f3f;background:rgba(0,0,0,0.55);" align="left">Total Character:</td>
<td style="border:1px solid #3f3f3f;background:rgba(0,0,0,0.55);"><font style='color:lime'><?php echo $TotalCharacter; ?></font></td>
</tr>
<tr>
<td style="border:1px solid #3f3f3f;background:rgba(0,0,0,0.55);" align="left">Server Is:</td>
<td style="border:1px solid #3f3f3f;background:rgba(0,0,0,0.55);">
<?php
$status = checkState($conf->serverIP,$conf->serverPort);
if ($status) echo '<span style="color: green;font-weight:bold;">Online</span>';
else echo '<span style="color: red;font-weight:bold;">Offline</span>';
?>
</td>
</tr>
</table>
<div class="news-title">
Server Rates:
</div>
<table style="border:1px solid #3f3f3f; border-radius: 8px 8px 8px 8px;padding: 4px;background-color:rgba(50,50,50,0.55);text-align:center;color: #fff;font-family: Arial, Helvetica, sans-serif;font-size:12px;" width="100%" cellpadding="0" cellspacing="0"align="center">
<tr>
<td style="border:1px solid #3f3f3f;background:rgba(0,0,0,0.55);"width="80%" align="left">Solo Experience:</td>
<td style="border:1px solid #3f3f3f;background:rgba(0,0,0,0.55);"width="20%">< font style='color:lime'><?php echo "$conf->expRate" ?>x</font></td>
</tr>
<tr>
<td style="border:1px solid #3f3f3f;background:rgba(0,0,0,0.55);"width="80%" align="left">Party Experience:</td>
<td style="border:1px solid #3f3f3f;background:rgba(0,0,0,0.55);"width="20%">< font style='color:lime'><?php echo "$conf->expRate" ?>x</font></td>
</tr>
<tr>
<td style="border:1px solid #3f3f3f;background:rgba(0,0,0,0.55);" align="left">Item Drop Rate:</td>
<td style="border:1px solid #3f3f3f;background:rgba(0,0,0,0.55);"><font style='color:lime'><?php echo "$conf->dropRate" ?>x</font></td>
</tr>
<tr>
<td style="border:1px solid #3f3f3f;background:rgba(0,0,0,0.55);" align="left">Gold Drop Rate:</td>
<td style="border:1px solid #3f3f3f;background:rgba(0,0,0,0.55);"><font style='color:lime'><?php echo "$conf->goldRate" ?>x</font></td>
</tr>
<tr>
<td style="border:1px solid #3f3f3f;background:rgba(0,0,0,0.55);" align="left">Alchemy:</td>
<td style="border:1px solid #3f3f3f;background:rgba(0,0,0,0.55);"><font style='color:lime'><?php echo "$conf->alchemyRate" ?>%</font></td>
</tr>
<tr>
<td style="border:1px solid #3f3f3f;background:rgba(0,0,0,0.55);" align="left">Level Cap:</td>
<td style="border:1px solid #3f3f3f;background:rgba(0,0,0,0.55);"><font style='color:lime'><?php echo "$conf->LevelCap" ?></font></td>
</tr>
<tr>
<td style="border:1px solid #3f3f3f;background:rgba(0,0,0,0.55);" align="left">Item Cap:</td>
<td style="border:1px solid #3f3f3f;background:rgba(0,0,0,0.55);"><font style='color:lime'><?php echo "$conf->ItemCap" ?></font></td>
</tr>
<tr>
<td style="border:1px solid #3f3f3f;background:rgba(0,0,0,0.55);" align="left">Client Version:</td>
<td style="border:1px solid #3f3f3f;background:rgba(0,0,0,0.55);"><font style='color:lime'><?php echo "$conf->clientVersion"?></font></td>
</tr>
</table>
<table style="border:1px solid #3f3f3f; border-radius: 8px 8px 8px 8px;padding: 4px;background-color:rgba(50,50,50,0.55);text-align:center;color: #fff; font-family: Arial, Helvetica, sans-serif;" width="80%" cellpadding="0" cellspacing="0"align="center">
<tr>
<td style="border:1px solid #3f3f3f;background:rgba(0,0,0,0.55);">
<?php echo $_SESSION[username] ?> |
<a href="?pg=support">Support</a> |
<a href="?pg=SilkCharge">Donate / Silkcharge</a> |
<a href="?pg=UniqueMobsSpawn">Unique Spawn</a> |
<a href="./mod/video.html">Watch Videos</a></td>
</tr>
</table>
</div>
|
|
|
|
12/08/2015, 09:39
|
#3
|
elite*gold: 0
Join Date: Dec 2008
Posts: 74
Received Thanks: 4
|
Quote:
Originally Posted by mtnman33
here you go try this >
|
Can you check title of topic?
i say for asp that php and havent anycode about online user count -.-
|
|
|
12/09/2015, 17:27
|
#4
|
elite*gold: 260
Join Date: Nov 2015
Posts: 31
Received Thanks: 9
|
If you add a line to SRO_VT_ACCOUNT.._Shard with the right Nid, ie 64.... the global manager will update it every few seconds with status and current player ratio...
|
|
|
 |
Similar Threads
|
Splinter Cell Blacklist Code + 4 Games Gratis! // Ghost Recon Online Code//
09/29/2013 - Trading - 1 Replies
Hey leute!
Ich tausche 3x Splinter Cell Blacklist 10€ Rabattcodes + jeweils 4 games dazu! ACHTUNG: Diese Codes sind nur bis zum 30. Septembeir gültig, also schlagt zu! Gesamtwert ~ 50€
Ebenfalls tausche ich einen Ghost Recon Online Code , der Ingame - Währung freischaltet! Dabei sind 1x Schädelkopftuch + M500 Schrotgewehr + P250 Pistole!
Noch dazu tausche ich einen exklusiven Key für das Game "Storm" der 7 Tage Spielzeit erlaubt!
Meldet euch per PN!
|
War Bot Premium User Code Pls
03/27/2012 - WarRock Hacks, Bots, Cheats & Exploits - 2 Replies
Hİ
War Bot Premium User Code Pls
|
[VB 2010] Serverstatus ist immer Online
08/08/2011 - .NET Languages - 24 Replies
Hi ehm um den Serverstatus zu ermitteln habe ich das stehen :
Timer1.Enabled = True
Try
My.Computer.Network.Ping("----------")
PictureBox8.Visible = True
PictureBox3.Visible = False
Catch es As Exception
PictureBox3.Visible = True
|
Serverstatus.php? Eigene Serverstatus.php datei!
02/16/2011 - Metin2 Private Server - 2 Replies
Aloha ,
Kann jemand eine 'PHP Datei' machen in der mein Serverstatus angezeigt wird?
Sodas ich den Code auf eine Seite von meiner Hp bzw. einem Kasten reinschreiben kann?
Danke
|
[PROBLEM]ServerStatus auch auf Online, wenn der Server off ist oO
08/02/2010 - Metin2 Private Server - 5 Replies
Hallo Leute,
ich verwende den ServerStatus von Blackout Gaming - Projects, und habe ihn auf meine Homepage kopiert.
Was ich nicht ganz verstehe, ist, warum der Status auch auf "ONLINE" steht, wenn mein Server off ist. Selbst wenn der komplette PC aus ist und ich mit dem iPhone nach gucke, steht der Status auf "ONLINE"
Kann mir das jemand erklären?
MfG
|
All times are GMT +1. The time now is 02:02.
|
|