1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Hey Guest, is it this your first time on the forums?

    Visit the Beginner's Box

    Introduce yourself, read some of the ins and outs of the community, access to useful links and information.

    Dismiss Notice

Stupid simple signature status script with simple scripted server savvy

Discussion in 'Community Dev Corner' started by FliesLikeABrick, Jun 16, 2012.

Mods: Downburst, Mazey
  1. WarrFork

    WarrFork フォーク Donator Tester

    Messages:
    1,412
  2. Noburu

    Noburu Dirty, DRUNK, Hillbilly Forum Moderator Donator Tester

    Messages:
    1,809
    Sorry should have used reply to quote allknowing. Wasnt directed to FLAB.
     
  3. allknowingfrog

    allknowingfrog Bison Rider

    Messages:
    549
    Lol. Something like that. The MOLE server is certainly a popular "last seen in" location.
     
  4. Lieber

    Lieber Is Probing Uranus Global Moderator Forum Moderator Donator Tester

    Messages:
    787
    Pretty cool signature thing.
     
  5. FliesLikeABrick

    FliesLikeABrick THD Team THD Team Administrator Global Moderator

    Messages:
    952
    I updated the proof of concept code for the signature generator a bit - making $c static so that the curl handle gets re-used.

    In any case - in any script you are calling the API from make sure you use curl or another method that will re-use connections for subsequent HTTP requests. This will add a huge performance boost (more and more of a performance boost the further your server/script is from the API in the Eastern US). Especially in cases where you're making an API call for each player in a server or for each server in the server list - those delays add up _fast_. The added delay is roughly equivalent to the ping time from your server to the API (1xRTT).


    So if you have a box on the west coast of the US or Europe (lets say 75ms) away, and you have a page that (for example) lists every player on a server as well as shows them as gold/whatever - you need to make a query for every player. On a server with 32 players that would be an extra 32*75ms delay, which is an extra 2.4 second delay in your page loading.

    Even if your site is only 1 or 10 ms away from the API, the extra delays from opening a new TCP connection do add up significantly. For a server on the same LAN making 2 calls to the API, I measured an extra 10-35ms delay between re-using the same connection versus not (it seems a bit high but it may be correct)

    tl;dr: on any page/in any script where you are making repeated calls to the API, make sure you are re-using your http connection with libcurl or similar.

    This is also very important for helping us maintain the API. If people don't do this, we may have to impose more strict rate limits on API calls because unnecessarily high numbers of connections will create problems for us (whereas many API calls per second is less of a problem)
     
    Noburu likes this.
  6. GloriousToast

    GloriousToast Haxor Donator

    Messages:
    1,463
    As a suggestion I recommend using this as a way to check if a user name is taken or not
    for example someone can use the name glorious
    [​IMG]
    but cant use the name toast
    [​IMG]
    also im wondering if it would be possible if i gain access to the account toast as
    a. it is not used
    b. there are no forum accounts related to it either
     
  7. WarrFork

    WarrFork フォーク Donator Tester

    Messages:
    1,412
    Why would we need that? They can just see it by trying to register with an name already used.
     
  8. FliesLikeABrick

    FliesLikeABrick THD Team THD Team Administrator Global Moderator

    Messages:
    952
    They can check by attempting to register the name or by looking at https://api.kag2d.com/player/usernameWhatever/info

    Using this signature generator is a very roundabout way of doing it

    No, we won't unregister any existing nicknames regardless of how long they appear to have been inactive (note that the API doesn't record all actions)
     
    Razi likes this.
  9. GloriousToast

    GloriousToast Haxor Donator

    Messages:
    1,463
    cause sometimes the thing will reset and you need to re-enter all your information. this is irritating.
    it seems faster.

    and still i wanted that username, evil dreaded person who took it
     
  10. WarrFork

    WarrFork フォーク Donator Tester

    Messages:
    1,412
    Actually, you register before looking in forums to get the signature and check if the name is already used.
    It's way more slower to do that.
     
  11. BlueLuigi

    BlueLuigi :^) Forum Moderator Donator Tester

    Messages:
    3,620
    Well that sucks for you, but giving people usernames with low activity is not a good idea, no matter how much they beg.

    I want to be Kouji
     
  12. GloriousToast

    GloriousToast Haxor Donator

    Messages:
    1,463
    large difference there as Kouji is on lots and toast isn't
     
  13. Panasonic

    Panasonic Builder Stabber
    1. The Ivory Tower of Grammar-Nazis

    Messages:
    133
    Wow Now i learnt how to do spoilers thx FLAB Ur the man
     
  14. SlyStalker

    SlyStalker Shopkeep Stealer

    Messages:
    423
    i think that the 'people you're following' thingy is supposed to be a 'friends' thing, although it sounds like your a paedophile or something
     
    TheBlackDog likes this.
  15. Lee_Shioon

    Lee_Shioon NinjaBrian in disguise Donator
    1. Practitioners of War Extreme Revolution - POWER

    Messages:
    33
    It seems like no one has asked this yet but, what do you add if there is a space inbetween your username? ex: Hey There. (steam username)
     
  16. 8x

    8x Elimination Et Choix Traduisant la Realité Forum Moderator Staff Alumni Tester
    1. The Young Blood Collective - [YB]

    Messages:
    1,325
    Click on your panel, on the top of the page tohether with Inbox and Alerts, then 'Signature'.
     
  17. Raigbox

    Raigbox Shipwright

    Messages:
    57
    I'm lost, how do I generate the signature?
     
  18. Kouji

    Kouji Cold, Uncaring, Sadistic, Evil and Cruel Meanie Administrator Global Moderator Forum Moderator Tester
    1. MOLEing Over Large Estates - [MOLE]
    2. REKINS OF SEAS: Super Crew of Ultimate Havoking 2: Return of King of KAG: Chapter 420blazeit - REKIN

    Messages:
    2,910
    In your signiture take this: https://poc.kag2d.com/siggen/kagstatus-simple.php?username=MyNAME,
    post that with an image tag like this: [img]https://poc.kag2d.com/siggen/kagstatus-simple.php?username=MyNAME[/img] in your signature
    and you'll get this:[​IMG]

    Just change MyNAME to your username in that link
     
    Klokinator, FoxyLady and Noburu like this.
  19. Raigbox

    Raigbox Shipwright

    Messages:
    57
    Thanks, I figured out that I have to use my Steam username to do it, I was using my other name, (Raigbox)
    But thanks anyways, @Kouji
     
  20. FliesLikeABrick

    FliesLikeABrick THD Team THD Team Administrator Global Moderator

    Messages:
    952
    Instead of a space, put %20. For example Hey There would become Hey%20There
     
    Noburu likes this.
Mods: Downburst, Mazey