|
|
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:2 T5 B5 N/ ~! J( f; p4 D+ y
Code:
! @/ @2 @$ z% R! V4 H$mssql = mssql_query("SELECT * FROM [ACCOUNT_DBF].dbo.[ACCOUNT_TBL] WHERE isuse='J'");6 N8 J! v/ t; E& G9 W# v8 H# I* r
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:. H0 Z" B1 ^1 F3 {7 j5 o# C
Code:+ b/ ^. a8 `) E7 h; G7 h$ ^- y, ~- [
$mssql = mssql_query("SELECT * FROM [CHARACTER_01_DBF].dbo.[CHARACTER_TBL] WHERE MultiServer='1'");. A/ E8 C9 V" K) j5 K
echo mssql_num_rows($mssql);# m6 O* L' y' U9 A0 j" U4 c
|- y' N4 y' ^& k1 }+ \. y5 J. F
|
|