Deprecated: The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence in /home/iano/public_html/tpforums-vb5/forum/includes/class_core.php on line 5842

PHP Warning: Use of undefined constant MYSQL_NUM - assumed 'MYSQL_NUM' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: Use of undefined constant MYSQL_ASSOC - assumed 'MYSQL_ASSOC' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: Use of undefined constant MYSQL_BOTH - assumed 'MYSQL_BOTH' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ..../includes/functions_navigation.php on line 588

PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ..../includes/functions_navigation.php on line 612

PHP Warning: Use of undefined constant misc - assumed 'misc' (this will throw an Error in a future version of PHP) in ..../global.php(29) : eval()'d code(6) : eval()'d code on line 1

PHP Warning: Use of undefined constant index - assumed 'index' (this will throw an Error in a future version of PHP) in ..../global.php(29) : eval()'d code(6) : eval()'d code on line 1

PHP Warning: Use of undefined constant misc - assumed 'misc' (this will throw an Error in a future version of PHP) in ..../includes/class_bootstrap.php(1422) : eval()'d code(4) : eval()'d code on line 1

PHP Warning: Use of undefined constant index - assumed 'index' (this will throw an Error in a future version of PHP) in ..../includes/class_bootstrap.php(1422) : eval()'d code(4) : eval()'d code on line 1

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6
Good way to check player's ONLINE
Results 1 to 9 of 9

Thread: Good way to check player's ONLINE

  1. #1
    Junior Member
    Join Date
    Oct 2008
    Posts
    23

    Good way to check player's ONLINE

    I've got this solution:

    Code:
    const
      ClientStatus = $3C8FF8;
    
    ...
    ...
    ...
    
    Window := FindWindow('TibiaClient', nil);
    
    if (Window <> 0) then
    begin
    
      Process_ID := GetProcessID('Tibia.exe');
      Base_Address := Integer(GetModuleBase(Process_ID, 'Tibia.exe'));
    
      Status := MemReadInteger(ClientStatus + Base_Address);
      
      if(Status = 10) then
        ShowMessage('Player ONLINE');
        ...
        ...
        ...
    Is it 100% correct way?
    Last edited by Kirgeron; 05-14-2013 at 11:52 AM.

  2. #2
    Senior Member
    Join Date
    Oct 2010
    Posts
    146
    have you checked it by yourself?....
    yea, if the char is connected it will show "10" else "8"

  3. #3
    Junior Member
    Join Date
    Oct 2008
    Posts
    23
    Yes It works, but when I'm connected I got status = "10", when disconnected = "0".

    When I will get "8" ?

  4. #4
    Senior Member
    Join Date
    Dec 2011
    Posts
    249
    AFAIK it will never return 8.

    0 = Not connected.
    9 = Connecting.
    10 = Connected.

  5. #5
    In older protocols (8.6-) client status was 8 when connected...
    Last edited by Blood; 05-15-2013 at 05:47 PM.

  6. #6
    Super Moderator
    Join Date
    May 2007
    Posts
    1,191
    Quote Originally Posted by ottizy View Post
    AFAIK it will never return 8.

    0 = Not connected.
    9 = Connecting.
    10 = Connected.
    There are many more than those three.
    There are states for resolving domain names and connecting to login/game servers, although most of the time all you need is the connected state.

  7. #7
    Senior Member
    Join Date
    Jan 2012
    Posts
    417
    Quote Originally Posted by Blaster_89 View Post
    There are many more than those three.
    There are states for resolving domain names and connecting to login/game servers, although most of the time all you need is the connected state.
    http://tpforums.org/forum/threads/54...ll=1#post49358

    I don't know if it still applies, but in any case I'm just linking this reference.

  8. #8
    Senior Member
    Join Date
    Oct 2010
    Posts
    146
    Quote Originally Posted by Kirgeron View Post
    Yes It works, but when I'm connected I got status = "10", when disconnected = "0".

    When I will get "8" ?
    Quote Originally Posted by ottizy View Post
    AFAIK it will never return 8.

    0 = Not connected.
    9 = Connecting.
    10 = Connected.
    oops, my bad, I got my notes wrong Ottizy is right

    btw thx Blaster lol, didn't know that :O

  9. #9
    Senior Member
    Join Date
    Dec 2011
    Posts
    249
    Quote Originally Posted by Blaster_89 View Post
    There are many more than those three.
    There are states for resolving domain names and connecting to login/game servers, although most of the time all you need is the connected state.
    Never said that the ones I mentioned are the only ones. However it's the ones I need.
    Last edited by ottizy; 05-14-2013 at 09:54 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •