|
In the past I've seen various ways of checking the current number of online players, but all that I've seen have a fatal flaw. Depending on how the server was turned off (or more specifically, if it crashes) the player count gets messed up. Here's the one I'm talking about:, ^( I& G$ p5 ^+ A! z( m
Code:- }# Y0 n7 t! ]2 x+ v# M e' n
$mssql = mssql_query("SELECT * FROM [ACCOUNT_DBF].dbo.[ACCOUNT_TBL] WHERE isuse='J'");
7 O; l+ f8 R& B8 W& R3 eecho mssql_num_rows($mssql);Here's a more proper code, which will automatically reset the current online count whenever the world server program is opened:' q2 L3 k# n. S7 T4 |" A j
Code:
' p7 E. b+ j* J0 k! X1 |( \$mssql = mssql_query("SELECT * FROM [CHARACTER_01_DBF].dbo.[CHARACTER_TBL] WHERE MultiServer='1'");6 T" Q$ \% Y9 K8 y$ \* B
echo mssql_num_rows($mssql);
: r/ T7 {* _' o' }' s1 K2 E
! l8 f8 z( h$ @" L% i- g. H |
|