|
You last visited: Today at 23:21
Advertisement
[help] how to echo online players
Discussion on [help] how to echo online players within the Rappelz Private Server forum part of the Rappelz category.
06/07/2015, 12:55
|
#1
|
elite*gold: 0
Join Date: Aug 2014
Posts: 6
Received Thanks: 0
|
[help] how to echo online players
hi !
as the title says !! i want to echo the number of online player on My Server in my site ... i need the code to do that , please !
|
|
|
06/07/2015, 14:14
|
#2
|
elite*gold: 0
Join Date: Jul 2014
Posts: 14
Received Thanks: 1
|
I NEED THIS 2
|
|
|
06/07/2015, 14:20
|
#3
|
Moderator
elite*gold: 1
Join Date: Dec 2012
Posts: 4,785
Received Thanks: 1,463
|
There is a help thread for help questions...
Please use it and stop contributing to the mess that our section is in.
Code:
SELECT COUNT(*) AS "Number of players"
FROM telecaster.dbo.character
WHERE login_time > logout_time;
That is a query, how to put it into your web site scripting is on you or somebody else.
|
|
|
06/08/2015, 01:41
|
#4
|
elite*gold: 0
Join Date: Aug 2014
Posts: 6
Received Thanks: 0
|
i couldn't make it !! please can u give me the full code ^^"
|
|
|
06/08/2015, 02:23
|
#5
|
Moderator
elite*gold: 1
Join Date: Dec 2012
Posts: 4,785
Received Thanks: 1,463
|
No I can't I am not a web developer.
|
|
|
06/08/2015, 08:00
|
#6
|
elite*gold: 0
Join Date: Apr 2011
Posts: 278
Received Thanks: 73
|
for in-game
Hints : get_env , notice , game.user_count
Search , learn and you will make it , you job is to assemble the hints.
-------------------------
for web, as @thndr said.
|
|
|
06/08/2015, 10:26
|
#7
|
elite*gold: 0
Join Date: Aug 2014
Posts: 6
Received Thanks: 0
|
i know how to do it in the game !
i just need to know how to do it in Web why wouldn't you guyz help me ?
|
|
|
06/08/2015, 11:14
|
#8
|
elite*gold: 99
Join Date: Jun 2015
Posts: 274
Received Thanks: 108
|
thndr already gave you a fully working query to achieve that..
Here's my two cents.
ASPX.NET:
Code:
Using saConn As New SqlConnection(Database connection info)
Dim Q As String = Nothing
Q = "SELECT COUNT(*) AS 'Count' FROM [Telecaster].[dbo].[Character] WHERE login_time > logout_time"
Dim cmd As New SqlCommand(Q, saConn)
saConn.Open()
Using saReader As SqlDataReader = cmd.ExecuteReader()
While saReader.Read()
Return saReader("Count")
End While
End Using
saConn.Close()
End Using
|
|
|
06/10/2015, 22:07
|
#9
|
elite*gold: 0
Join Date: Sep 2013
Posts: 41
Received Thanks: 1
|
Good evening would it be possible to explain how to make an echo in php.
I can not create a php mssql connection and to execute a query and my php script shows me the nickname.
Is it possible to show me an example?
----------------------------------------------------------------------------
Bonsoir serait il possible de m'expliquer comment faire un echo en php.
Je ne n'arrive pas a créer de connexion mssql et php pour executer un query et que mon script php me montre le pseudo.
Serait il possible de me montré un exemple ?
|
|
|
06/10/2015, 22:46
|
#10
|
elite*gold: 99
Join Date: Jun 2015
Posts: 274
Received Thanks: 108
|
PHP Code:
<?php $servername = "localhost"; $username = "username"; $password = "password"; $dbname = "myDB"; // Create connection $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } $sql = "SELECT COUNT(*) AS 'Count' FROM [Telecaster].[dbo].[Character] WHERE login_time > logout_time"; $result = $conn->query($sql); if ($result->num_rows > 0) { while($row = $result->fetch_assoc()) { echo $row["Count"]; } } else { echo "0"; } $conn->close(); ?>
I am not familiar with PHP, but a simple google and a little of my own thinking came up with that.
|
|
|
06/10/2015, 23:40
|
#11
|
elite*gold: 0
Join Date: Apr 2012
Posts: 99
Received Thanks: 35
|
hy , i use iis 7.5 with php 5.6.2 and for sql server , mssql functions not working .
you need to instal the good unofficial_sql_server_driver for php for your php version.
this the link of my driver for iis and php i use :
just unrar it , put the 2 files in your php/ext folder and add these 4 rows in your php.ini :
[PHP_PDO_SQLSRV_56_NTS]
extension=php_pdo_sqlsrv_56_nts.dll
[PHP_SQLSRV_56_NTS]
extension=php_sqlsrv_56_nts.dll
reboot iis and check if the install as ok with php manager
link for php manager if you don't have it:
and this an example of php function to sql server:
<?php
$pseudo = $_POST['pseudo'];
$pass = $_POST['pass'];
$email = $_POST['email'];
$key = "2011";
$hdpass = md5("$key$pass");
$serverName = "(local)";
$uid = "database_account_name";
$pwd = "database_account_password";
$connectionInfo = array( "UID"=>$uid,"PWD"=>$pwd,"Database"=>"Auth");
$conn = sqlsrv_connect( $serverName, $connectionInfo);
if( $conn === false )
{
echo "Impossible de se connecter au serveur .\n";
die( print_r( sqlsrv_errors(), true));
}
$tsql = "INSERT INTO [Account]
([login_name]
,[password]
,[referral_id]
,[referral_code]
,[pcbang]
,[block]
,[withdraw_remain_time]
,[age]
,[auth_ok]
,[last_login_server_idx]
,[event_code]
,[server_list_mask]
,[result]
,[ip]
,[game_code]
,[gamecode]
,[login_event]
,[email])
VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?);";
$params = array($pseudo,$hdpass,0,0,0,0,0,18,1,1,0,0,0,0,0,0 ,0,$email);
$stmt = sqlsrv_query( $conn, $tsql, $params);
if( $stmt === false )
{
die( print_r( sqlsrv_errors(), true));
}
else if( $stmt === true )
{
echo $pseudo . ", merci d'avoir créé un compte sur notre site.<br />
A très vite sur notre serveur .<br />
RappelZ FamilY<br />";
}
sqlsrv_free_stmt( $stmt);
sqlsrv_close( $conn);
?>
this the base y use to create my website AccountCreator , it's working but need more work for security .
you can use this example for the sql_server php functions after have modded it to your idea .
link to the php sql_server Library:
good night all
|
|
|
06/11/2015, 10:48
|
#12
|
elite*gold: 0
Join Date: Sep 2013
Posts: 41
Received Thanks: 1
|
Thanks you very mush brother !!!!!
|
|
|
06/11/2015, 19:35
|
#13
|
elite*gold: 0
Join Date: Apr 2012
Posts: 99
Received Thanks: 35
|
No problem , i search a lot when i make the Account Creator for this, it's not very easy to fund .
|
|
|
06/11/2015, 20:26
|
#14
|
elite*gold: 0
Join Date: Sep 2013
Posts: 41
Received Thanks: 1
|
I need classement fonctionnal
|
|
|
06/11/2015, 20:35
|
#15
|
elite*gold: 0
Join Date: Apr 2012
Posts: 99
Received Thanks: 35
|
lol , don't know ; order by lvl ?
use telecaster
select top 10 name, lv from character order by lv desc
this the start for your work.
you need to adapt it to use with php,
and to show the values in your web page.
|
|
|
All times are GMT +2. The time now is 23:21.
|
|