OnlinePlayers indicator ! how?

06/05/2009 13:25 Rulzan#1
i need something for my web that will show the online players,i saw on a lot of webs.. i use 5065 tq binarys
something like
Code:
Login Server: Online
Game Server: Online
Registration Server: Online
Players Online: 35
Only the Players online stuff i need
06/05/2009 15:44 magnon#2
E*Pvpers only can help u
06/05/2009 15:53 3mrz#3
Then someone help him >.>
06/05/2009 17:11 Rulzan#4
Quote:
Originally Posted by magnon View Post
E*Pvpers only can help u

your post supose to help me ?
06/05/2009 17:19 damianpesta#5
Quote:
Originally Posted by Rulzan View Post
your post supose to help me ?
Hmm I think that source suppose to be saving the character count to an ini file , and everytime someone logs/logs out it updates the ini file with the count of the characters online , and your website reads the ini file with the charr count.I think thats the way , maybe not...?
06/05/2009 17:30 yuko#6
DATABASE.CS
Code:
public static void ChangeOnlineStatus(string AccID, int online)
        {
            MySqlCommand Cmd = new MySqlCommand("UPDATE `accounts` SET `online` = \"" + online + "\" WHERE `AccountID` = \"" + AccID + "\"", DatabaseConnection.NewConnection());
            Cmd.ExecuteNonQuery();
            Cmd.Connection.Close();
            Cmd.Connection.Dispose();
            Cmd.Dispose();
        }
PACKETPROCESSOR.CS
Code:
Database.Database.ChangeOnlineStatus(CSocket.AccountName, 1);//online
CLIENTSOCKET.CS
Code:
Database.Database.ChangeOnlineStatus(AccountName, 0);//offline
database(mysql)
Code:
ALTER TABLE `accounts` ADD `online` BOOL NOT NULL ;

edit it the way you want.
06/05/2009 17:53 Kiyono#7
Quote:
Originally Posted by yuko View Post
DATABASE.CS
Code:
public static void ChangeOnlineStatus(string AccID, int online)
        {
            MySqlCommand Cmd = new MySqlCommand("UPDATE `accounts` SET `online` = \"" + online + "\" WHERE `AccountID` = \"" + AccID + "\"", DatabaseConnection.NewConnection());
            Cmd.ExecuteNonQuery();
            Cmd.Connection.Close();
            Cmd.Connection.Dispose();
            Cmd.Dispose();
        }
PACKETPROCESSOR.CS
Code:
Database.Database.ChangeOnlineStatus(CSocket.AccountName, 1);//online
CLIENTSOCKET.CS
Code:
Database.Database.ChangeOnlineStatus(AccountName, 0);//offline
database(mysql)
Code:
ALTER TABLE `accounts` ADD `online` BOOL NOT NULL ;

edit it the way you want.
He uses the TQ Binaries.
06/05/2009 18:04 Rulzan#8
damn im sad..i really wanna have that indicator :(
06/05/2009 18:33 hunterman01#9
Quote:
Originally Posted by Rulzan View Post
damn im sad..i really wanna have that indicator :(
Then Dont use binarys lol
06/05/2009 18:41 Rulzan#10
Quote:
Originally Posted by hunterman01 View Post
Then Dont use binarys lol
lol,i hate those crappy-reply's
i thing you eat lotf every day..
06/05/2009 18:44 L1nk1n*P4rK#11
Man what you need i a php indicator???
to show you how much ppls are online???

BTW Rulzan I just release Table Editor V2 go and test it :P
06/09/2009 10:44 blakesmi13#12
well...you can do /player all and it shows all players online in top left and /player map shows how many players is on that map hope it helped
06/09/2009 17:39 Zeroxelli#13
PHP Code:
$sql mysql_query("SELECT COUNT(*) AS PlayersOnline FROM characters WHERE Online='true'");
if(
$row mysql_fetch_array($sql))
    echo 
"{$row['PlayersOnline']} Players online." 
Or something ;O
06/09/2009 17:58 coles#14
Quote:
Originally Posted by Zeroxelli View Post
#Request Delete Post

Wtf, if I lag it sends twice? ;'<
Meh, quickest way to get an online count for server is run a shell netstat command.
Ofcourse using this method would require you to have the correct OS permissions.

same goes for status, query an ip and port (can increase page load times if not written properly)
06/09/2009 21:38 Zeroxelli#15
Quote:
Originally Posted by coles View Post
Meh, quickest way to get an online count for server is run a shell netstat command.
Ofcourse using this method would require you to have the correct OS permissions.

same goes for status, query an ip and port (can increase page load times if not written properly)
He's talking about getting the players online, on the game server. The only two ways of doing that are MySQL and Flatfiles. MySQL is obviously easier and in some cases faster. Plus, you don't need extra r+ perms for the folder of your host. Netstat isn't smart unless you're hosting on your own machine, or a nix shell.