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

Devlog KAG BUILD 2067 - More API Client Fixes

Discussion in 'Announcements' started by Geti, Dec 14, 2016.

?

What Next?

  1. HTTP From Script

    10 vote(s)
    14.1%
  2. Boulder Rebalance

    7 vote(s)
    9.9%
  3. 5 New TDM Maps

    5 vote(s)
    7.0%
  4. 2 new CTF Maps

    2 vote(s)
    2.8%
  5. 2 new TTH Maps

    1 vote(s)
    1.4%
  6. Official Modded Server

    27 vote(s)
    38.0%
  7. New Heads

    19 vote(s)
    26.8%
  1. Nicuwins

    Nicuwins Bison Rider

    Messages:
    63
    [​IMG]

    Here is a good example for an ugly head (i know the discussion is over but i believe i promised to send a pic)
     
    Last edited: Dec 14, 2016
  2. PUNK123

    PUNK123 Hella wRangler Staff Alumni Tester

    Messages:
    1,275
    I made a minor nudge at furai a couple months ago to swap out factions for wastekind(because it is an infinitely better mod) hopefully it will eventually get hosted in US even if it isnt on official.

    I dont see the value in custom heads much myself. Personally i feel like something along of the lines of kill-counters and ranking would nudge some tryhards to play more(and lead to less ingame eyesores).
     
  3. Furai

    Furai THD Team THD Team Administrator

    Messages:
    3,124
    And just so you know - I'm not really eager to set up a modded official server. Just saying. â„¢
     
  4. Furai

    Furai THD Team THD Team Administrator

    Messages:
    3,124
    Just pushed a minor hotfix that addresses the issues with the maps not properly loading on some of the servers. Nothing else has really changed.
     
  5. Inferdy

    Inferdy Arsonist

    Messages:
    246
    I am glad to see that the community vote for
    Official Modded Server
    cause developers make really fun
    mods
     
    bru-jaz likes this.
  6. ShamWow-SuperRag

    ShamWow-SuperRag zamn Donator Tester

    Messages:
    173
    Just wondering, what mods would be considered to be added to the Official Modded Server?
     
  7. 8x

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

    Messages:
    1,325
    Perhaps Geti could put his hands on The Waste Kind, make some fixes, proper explosives and 2-3 weapons and add it to an Official modded server. The creators of it would be so really happy to see it have an official push, it has some possibilities I couldn't develop further and we grow tired of. (hu3 i know it sounds like wishful thinking).
     
    bru-jaz, epsilon and PUNK123 like this.
  8. franek123

    franek123 The architect of the royal castle. Donator Tester

    Messages:
    514
    Next: Pls fix bugged animations. (ppl running with no anim til you kill them) That bug has like few years
     
    EhRa, epsilon and Blue_Tiger like this.
  9. PUNK123

    PUNK123 Hella wRangler Staff Alumni Tester

    Messages:
    1,275
    It was decided on months ago that it would be shiprekt, attack and defend, and factions.
     
    SirDangalang likes this.
  10. epsilon

    epsilon Assonist THD Team Forum Moderator Donator Tester
    1. Gather Oceania
    2. KAG World Cup 2018

    Messages:
    506
    Haven't more mods been released after that vote? I hope that vote is redone! plz...
    Can you link me to it?
     
  11. Eluded

    Eluded Haxor Official Server Admin

    Messages:
    132
    If "HTTP From Script" is what I think it means (that mod code can make HTTP requests), then this opens up possibilities for some INSANELY COOL mods. Persistent world/MMO style mods would be enabled in particular. The majority of the community probably won't understand the significance of this voting point though.
     
  12. PUNK123

    PUNK123 Hella wRangler Staff Alumni Tester

    Messages:
    1,275
  13. Geti

    Geti Please avoid PMing me (poke a mod instead) THD Team Administrator Global Moderator

    Messages:
    3,730
    It can already be done with TCPR, it's just quite fiddly to do :) The backend for Trench Run, which handles persistent costumes, coins and whatnot shared between multiple servers is just a TCPR app written in node.

    HTTP From Script would basically leverage the async HTTP calls stuff added behind the APIClient to indeed make HTTP Requests and load them into strings. It'll likely happen at some point but it could be rushed along if there was interest. Looks like there's more in an official modded server though, I'll have to talk with joe about it as furai doesn't like the sound of working on it :)
     
    Osmal likes this.
  14. Eluded

    Eluded Haxor Official Server Admin

    Messages:
    132
    What do you mean by TCPR Geti? Haven't heard of that before
     
  15. Geti

    Geti Please avoid PMing me (poke a mod instead) THD Team Administrator Global Moderator

    Messages:
    3,730
    TCPR is TCP RCON - Remote console. You can use anything that can speak TCP and either send commands or script code; you can talk to it either just by printing, or by explicitly calling tcpr("your string to send"), which is the "more portable" way to do things (you can turn off sending prints to tcpr to reduce I/O or network bandwidth consumed).

    For the HTTP example you'd have things KAG-side write a request into the console with something like tcpr("GET http://mykagmodwebsite.com/some_awesome_arguments reqID"); and then have the tcpr script curl for that (or wget or use node's built in http stuff or whatever), and send back getRules().set_string("reqID", "webpage contents"); - the big things to watch out for are
    • TCPR cant handle particularly long lines. I think it's currently 16k as the limit. If you were handling requests for non-trivial pages you'd need to write them back to KAG over multiple lines - longer lines will be truncated at whatever the limit is, and read as separate lines into the console, which will of course cause errors. Splitting stuff up into multiple lines is better.
    • TCPR can handle \r\n and \n line endings, though it'll go with whatever you send first and you better stick with that. This forms part of auth, as you have to send the rcon password as the first line or your app will be disconnected.
    • You need some sort of request ID and timeout system - and to recycle them - or you'll slowly consume more and more RAM for the rules properties. We use a pool of 100 IDs for common requests in trench run, plus a per-user string (so the user data is always readily available).
    • The timeout system is also needed because there's no way to ensure that something's actually connected to tcpr - I've considered adding something to check (basically isTCPRConnected()) a few times but since it's so underutilised I haven't bothered. Your TCPR app can also drop if it's on a remote machine, and will need to attempt to reconnect if the socket is occupied or whatever as well - it can get quite fiddly making this stuff robust.
    • It is possible to have more than one connection to tcpr at the same time, as well (for example if you wanted a separate user ranking system and a HTTP fetcher for community-authored maps) and they'll all receive the same stuff, so it's important to keep that in mind and make sure they filter messages that aren't meant for them.
    @makmoud98 is the only person I'm aware of tinkering with it at this point though I wouldn't be surprised if some others were doing things on the more "secretive" modded servers.

    Hope this helps :)
     
    Osmal, makmoud98 and ParaLogia like this.
  16. Eluded

    Eluded Haxor Official Server Admin

    Messages:
    132
    Ah thanks for the info, never realised this was possible. Is it blocking to call the tcpr function KAG side though? @Cruxiat will be interested in this for his knight ELO mod.
     
  17. Cruxiat

    Cruxiat Haxor Tester
    1. Gather Oceania
    2. KAG World Cup 2018

    Messages:
    116
  18. Geti

    Geti Please avoid PMing me (poke a mod instead) THD Team Administrator Global Moderator

    Messages:
    3,730
    Is what blocking the call to tcpr? If you mean like, in terms of a blocking function call, it returns immediately and there's no guarantee that anyone is listening. It functions just like a print, and you can only send string data.

    If you mean in terms of security - running tcpr() on the client does absolutely nothing. Only calls to it serverside matter at all.

    Timestamps are appended as well, which is actually kind of annoying, so something to watch out for.

    It's actually probably one of the more powerful modding options, and it's the only closed-source one. I'm not sure why people haven't investigated it more other than it being somewhat obscure.

    Honestly, just try it and see, the worst you can do is waste an afternoon if it doesn't work out, haha.
     
  19. jimmyzoudcba

    jimmyzoudcba Haxor Tester

    Messages:
    274
    Incredible.

    MODDED SERVER PPL

    We can do it
     
  20. Furai

    Furai THD Team THD Team Administrator

    Messages:
    3,124
    Soo, progress has been made regarding modded servers (thanks @jrgp for help). Now the question to community - can you guys poke the authors of chosen previously mods that are to be hosted on the server so they make sure the mods do work in the latest version of KAG and that they are uploaded to our API? I'd rather deal with updates via API than having to upload the files manually every now and then when the fix is in place. I don't remember top of my head who is responsible for what mod and which mod have we chosen - I trust you guys that you know and that you'll just annoy the shit out of those dudes till the do what needed. Once I have everything in place we'll be able to host these mods.
     
    bru-jaz, Noburu and epsilon like this.