|
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:
. X/ s" |* c- uCode:# z* x) h1 m& M0 G4 `& I7 M2 c+ M
$mssql = mssql_query("SELECT * FROM [ACCOUNT_DBF].dbo.[ACCOUNT_TBL] WHERE isuse='J'");2 n2 ]6 O! m g/ b6 v; h
echo 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:4 z; i& O. H5 d$ Y( y) ~% _
Code:
9 n: J6 _) P' X$mssql = mssql_query("SELECT * FROM [CHARACTER_01_DBF].dbo.[CHARACTER_TBL] WHERE MultiServer='1'");. }! o' d _$ g3 Z' t' S
echo mssql_num_rows($mssql);2 p$ \1 d; _1 {! {$ _3 s1 i8 ]3 f
* `$ h+ U4 G* s+ v4 M* e, r
|
|