Checking if a player is online without logging on the game

Discussion in 'Empire Help & Support' started by lauwenmark, Aug 13, 2016.

  1. Hi,

    I'd like to know if there is any way to test if a player is online/offline without entering the game. For example, with an http request (something like that would return a textual true/false value).

    I'd like to use that to create a dynamic signature showing my online status.

    I know it is possible to list online players through the Query protocol, but it needs to be enabled explicitely server-side, and the port is likely being firewalled anyway.

    Thanks in advance for the answer!
    ShelLuser and 607 like this.
  2. Unless it has changed, this is currently broken (and has been for some time now), in that creating new ones seems to not work anymore. Besides, it doesn't really allow to get the on/offline status in a flexible, easily parsable way; it is rather a signature designer (ok, granted, if it worked, I could create a standard signature, then parse the resulting picture to determine the player status. But that's rather convoluted, don't you think?)
  3. Hm, yeah, I'd like to know, too!
    Jack must have access to it, but I think Jack might have access to some stuff we don't.
  4. It's still possible to create your own though. I don't know how easy it would be but should still be possible.
  5. You can use this API call:

    Check server_id to see if they're online or not - the IDs are a bit weird and don't match up with the server numbers, but are as follows.
    $smp1 = '"server_id":"1"';
    $smp2 = '"server_id":"2"';
    $smp3 = '"server_id":"4"';
    $smp4 = '"server_id":"5"';
    $smp5 = '"server_id":"6"';
    $smp6 = '"server_id":"7"';
    $smp7 = '"server_id":"8"';
    $smp8 = '"server_id":"9"';
    $smp9 = '"server_id":"10"';
    $utopia = '"server_id":"3"';
    $offline = '"server_id":null';
    Please cache the response, and data updates may be delayed by up to a minute.

    If you update your name, then you'll have to update your code unless you use something like NameMC's api to also handle this.

    (Also signature generator fixes/revamp are coming very soon)

    EDIT: Actually, I'm not entirely sure that non-generator dynamic signatures actually work on the EMC site - there's some special stuff to make them bypass the forums cache system (they're only subject to a 1 minute cache), so if something looks weird in testing, that's probably it.
    TomvanWijnen, lauwenmark, 607 and 4 others like this.
  6. I put my name in to test it (don't need no signature) and it took me back to the homepage after showing me Pac Man for a few seconds.
  7. That's what needs fixing. :p
    TomvanWijnen likes this.
  8. That API call is exactly what I needed. It actually has even more informations than expected. Many thanks to you !
    ShelLuser and 607 like this.
  9. It definitely works. Granted, the update is not immediate, but since the signature picture is anyway cached on my side with a TTL of a couple minutes, the delay is a non-issue.

    I currently don't rely on UUIDs to bind the signature with a player - that will be for tomorrow :D. I currently just rely on my character's name.

    Ah, and animated background is also still lacking... I'll have to leave it for Thursday ;)