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

Linux [KAG Classic] Juxta++ - Advanced Server Modding for Classic

Discussion in 'Community Dev Corner' started by master4523, Sep 9, 2014.

Mods: Downburst, Mazey
  1. master4523

    master4523 Masterful KAG Guard Global Moderator Tester
    1. PumpkinStars - [Pk#] - Inactive

    Messages:
    378
    What is Juxta++
    Juxta++ is a library made by rzaleu and myself, which enhances the functionality of KAG Classic, on server side.
    It works by hooking the functions of the server, and makes it possible to do almost anything.
    If you've already heard of KScript, think of this as a way more advanced version of it.

    What can I do with it
    A lot of things! Juxta++ comes along with a Lua scripting interface, providing an access to the functions and events.
    For example, you can place blocks, get/set players position, get/set their health, resources, bombs arrows, spawn any item (bomb, arrow), spawn entities, and much more, check out the source code!
    If you're a modder, you're going to love it.

    Edit: list of functions compiled by TropicalMurloc
    List (ID) ActorTypes
    PLAYER = 1
    UNKNOWN_2 = 2
    UNKNOWN_3 = 3
    UNKNOWN_4 = 4
    UNKNOWN_5 = 5
    UNKNOWN_6 = 6
    UNKNOWN_7 = 7
    UNKNOWN_8 = 8
    UNKNOWN_9 = 9
    UNKNOWN_10 = 10
    UNKNOWN_11 = 11
    UNKNOWN_12 = 12
    RUNNER = 13
    EGG = 14
    UNKNOWN_15 = 15
    ZOMBIE = 16
    UNKNOWN_17 = 17
    LANTERN = 18
    BOULDER = 19
    ======
    List ID Block
    AIR = 0
    BEDROCK = 106
    DIRT = 16
    DIRT_BACK = 32
    GOLD = 80
    ROCK = 96
    THICK_ROCK = 208
    TREE = 119
    RUBBLE = 155
    LADDER = 144
    CASTLE_WALL = 48
    CASTLE_BACK = 64
    GOLD_BULLION = 160
    BLUE_DOOR = 128
    RED_DOOR = 130
    BLUE_BRIDGE = 176
    RED_BRIDGE = 178
    SPIKES = 167
    WORKSHOP = 146
    WOODEN_WALL = 196
    WOODEN_BACK = 205
    ======
    List ID Team
    SPECTATOR", 200
    ======
    List ID Keys
    UP = 0
    DOWN = 1
    LEFT = 2
    RIGHT = 3
    ACTION = 4
    ACTION2 = 5
    ZOOMIN = 6//not working
    ZOOMOUT = 7//not working
    USE = 8
    CHANGE = 9
    DROP = 10
    TAUNTS = 11//not working
    BUBBLES = 12//not working
    MENU = 13//not working
    PARTY = 14//not working
    ======
    List "Plugin" [ex: plugin.GetName()]
    GetName
    GetPath
    Call
    ======
    List "Juxta" [ex: Juxta.GetVersion()]
    GetVersion
    ======
    List "Actor" [ex: Actor.GetID()]
    GetID
    GetType
    GetPlayer
    ======
    List "Blob" [ex: Blob.GetFactoryName()]
    GetFactoryName
    GetConfigFileName
    GetID
    GetType
    GetTeam
    GetX
    GetY
    SetPosition
    GetHealth
    SetHealth
    GetPlayer
    IsFacingLeft
    Kill
    ======
    List "Egg" [ex: Egg.Kill()]
    Kill
    ======
    List "Player" [ex: Player.GetID()]
    GetID
    GetBlob
    GetName
    GetClantag
    GetCharacterName
    GetSeclevID
    IsBot
    GetClass
    GetSex
    GetNetworkID //Not Work
    GetHost
    GetIP
    GetPosition //Not Work
    GetX
    GetY
    GetVelX
    GetVelY
    GetMouseX
    GetMouseY
    GetIdleTime
    GetHealth
    GetDefaultHealth
    GetBombs
    GetArrows
    GetWood
    GetStone
    GetGold
    GetCoins
    GetScore
    ======
    SetClantag
    SetName
    SetPosition
    SetVelocity
    SetTeam
    SetHealth
    SetDefaultHealth
    SetBombs
    SetArrows
    SetWood
    SetStone
    SetGold
    SetCoins
    SetScore
    ======
    Kill
    Kick
    Freeze
    Unfreeze
    Mute
    Unmute
    Ban
    SendMessage
    ======
    IsPlaying
    IsDead
    IsCrouching
    IsJumping
    IsShielding
    IsShieldingUp
    IsShieldingDown
    IsShieldingSide
    IsFrozen
    ======
    HasFeature
    HasCommand
    ======
    SetBoolean
    SetNumber
    SetString
    SetTable
    ======
    GetBoolean
    GetNumber
    GetString
    GetTable
    ======
    ChangeTeam
    SetClass
    GetSex
    SetSex
    GetSpecialColor
    SetSpecialColor
    GetHead
    SetHead
    ======
    IsKeyDown
    WasKeyPressed
    WasKeyReleased
    ShootArrow
    ======
    MountPlayer
    MountBlob
    UnMountPlayer
    UnMountBlob
    ======
    List "KAG" [ex: KAG.ChangeMAp()]
    ChangeMap
    ChangeMapPNG
    GetTile
    GetMapWidth
    GetMapHeight
    SetTile
    CreateChatCommand
    CreateRoomCommand
    GetPlayers //Not Work
    GetPlayersBySeclev //Not Work
    GetPlayerByID
    GetPlayerByName
    GetPlayerByPartialName
    GetPlayerByIndex"
    GetPlayersCount
    GetBlobByID
    GetBlobByIndex
    GetBlobsCount
    GetEggByID
    GetEggByIndex
    GetEggsCount
    SendRcon
    NextMap
    RestartMap
    SaveMap
    TriggerAutoBalance
    SetDayTime
    GetDayTime
    GetUnitsLeft
    IsWarmup
    SpawnEgg
    SpawnBomb
    SpawnBot
    SpawnBlob
    SendMessage
    GetBuildVersion
    GetVersion
    Break
    ======

    What else does it do
    In addition to the modding possibilities, it also fixes a bunch of server sided bugs.
    We've already patched the following hacks: editor hack, speedhack, fast attack hack, builder range hack, moving when being frozen.

    Where do I get it
    Link to the github repository: https://github.com/master4523/juxtapp
    The library only works on Linux based systems (tested on Ubuntu and Debian).
    There's no plan to make it compatible with Windows/OSX for now.

    Who made this?
    This software is a collaboration between rzaleu and master4523.
    Kudos to Konfitur and Chidori for helping us with testing!

    I can't run it / I found a bug!
    Feel free to reply here or send me a PM with the issue
     
    Last edited: Dec 20, 2016
    Konfitur, PussyDestroyer, -Q and 20 others like this.
  2. Galen

    Galen Haxor Staff Alumni Donator

    Messages:
    1,262
    lel master fixing classic
     
  3. Fernegulus

    Fernegulus Bison Rider

    Messages:
    400
    *stunned, slowly stands up and starts clapping*
     
  4. jrgp

    jrgp THD Team THD Team Administrator Global Moderator

    Messages:
    75
    It's nice that you're adding features, but the fact is that this counts as a "hack" as you're injecting third party code (via a Linux shared object) into the KAG binary itself. You probably also had to reverse engineer the KAG server to make this.

    It doesn't help that you're not providing the source code (which you kind of can't since it'd publicly expose how KAG works internally) but because you're not we have no way of knowing what other stuff you code might do and whether or not it may be malicious, either deliberate (trying to escalate privileges or report home sensitive data) or not (excessive resource consumption).

    I'm not sure how well this would sit with the kag devs. Did you consult @Geti when you made this?
     
    Last edited: Sep 10, 2014
  5. Geti

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

    Messages:
    3,730
    He did. My feelings on these kind of "contributions" to the game are quite reserved, on one hand I honestly do not care at all about classic, and all the serverside "hacks" I've seen so far have been with positive intent; on the other I really wish the amount of energy put into these kind of projects was put into modding the release version of KAG instead of classic.

    The latter is significantly more motivating to me "cracking down" on this kind of thing than the former; hacks for classic are nothing new and not something we can really stop either way, there's not a good way to detect these from a connecting client.

    Incidentally, the reverse engineering side of how I believe all of these hacks work is hardly hard to do or "secret", and the way KAG works with relation to these hacks isn't very different to a lot of other games (update function gets called every so often; hook your code in there). A lot of the early scripting stuff worked through the TCPR channels, I wouldn't be surprised if this one in particular hooked the engine side functions directly though - that said I haven't looked into it :)

    Either way, I'm not planning on cracking down on this kind of serverside "for the community" hacking. I need to talk with MM to see if he has any reservations but I don't think he cares much about classic either.

    Seriously though guys, its a bit of a punch in the gut that you build a whole separate modding system on top of the old game, rather than using the modding system we built for you in the new one.
     
    joshua12131415, Noburu and 101i like this.
  6. MM

    MM THD Team THD Team Administrator Global Moderator

    Messages:
    327
    I agree with what Geti said:
    Other than that I don't care and I admire the time and patience put into a project like this. Although you could have migrated classic as a mod in KAG in the same amount of time probably.
     
  7. Klokinator

    Klokinator Such Beta
    1. Aphelion's Roleplay

    Messages:
    1,443
    I played classic today for 2 hours. Lots of fun still. I really don't see why you guys hate the fact that people still love it and wanna mod it (Since it's finished basically and you're never going back to it, meaning updates won't ruin major edits made to a mod) especially as the actual gameplay is wildly different from steam kag. They're literally two completely different games with only surface levels of similarity.
     
  8. Chumind

    Chumind Drill Rusher

    Messages:
    184
    OMGERD! This is epic!.
     
  9. Mazey

    Mazey Haxor Global Moderator Forum Moderator Staff Alumni Donator Official Server Admin

    Messages:
    1,916
    Geti, MM, the reason Masty made this for classic an put effort into it is so they can play with Domis spamming 5 (because he gets more content to play with). Masty could mod Release all they want but Domis would stay on Classic, so it would be wasted time spent on coding.


    edit: also 7/10 looks good but Ardivaba did this a year ago and created some good fun mods + was making an exp leveling up gamemode with autochanging clantags depending on your skill.
     
    RampageX likes this.
  10. master4523

    master4523 Masterful KAG Guard Global Moderator Tester
    1. PumpkinStars - [Pk#] - Inactive

    Messages:
    378
    Re: legality
    Technically the way it works can be considered as hacking, and I wouldn't have released it on the forums without the permission of Geti/MM. Turns out they're kind enough to tolerate this (actually they probably don't care :^) )

    Re: malicious
    I personally have nothing against releasing the source code for this, but it's not my decision. I'd have to ask KAG devs to review the code and I'm not sure they would allow it, since they're using the same base for the Steam release.
    For the time being, I guess you can only take my word for it.
    @jrgp if you want a copy of the source code I'll gladly send one to you

    Re: y u do dis
    For the same reason people make unofficial patches for abandonned games. It's just a hobby, I like challenges and I've learned a lot of things by making this.
    The main strength of KAG has always been the fact that you can mod the hell out of it, that's what the devs did on the Steam release, and I'm just trying to show how far we can get with Classic, even with a dropped support.
    In the end, I probably do it because... I can?

    Again, if you have any questions, do not hesitate
     
  11. Haste

    Haste Bison Rider

    Messages:
    69
    Thank you everyone who made this great mod, i only wish it were for windows as well. We should be seeing some epic gamemodes with time, thanks to you guys.
    Looking forward to whats next, classic is far from dead. Random question, can you call to see what head a player is using? or change the players head via script? (possible classic blowjob?)
     
  12. samrrr

    samrrr Catapult Fodder

    Messages:
    3
    master you know chriodi like ddosing me.
    his ddos me i ddos his server
    and you know i have 99% of all kag cheats and 95% i make

    say what be if only 4 players at no oldfag server? zero new users and kag classic have zero users at 2-3 mounths

    i think now upgrade Mysterious tool to antieditor and anti tp/fly
     
  13. master4523

    master4523 Masterful KAG Guard Global Moderator Tester
    1. PumpkinStars - [Pk#] - Inactive

    Messages:
    378
    Cool story, bro. Guess what? I don't care. Not my fault if your life sucks.
     
    PUNK123, Mazey, thebonesauce and 9 others like this.
  14. Klokinator

    Klokinator Such Beta
    1. Aphelion's Roleplay

    Messages:
    1,443
    Sorry man, us human beings have trouble understanding your horribly broken Glorxian language.
     
    Asu and PUNK123 like this.
  15. samrrr

    samrrr Catapult Fodder

    Messages:
    3
    i not einglish call to google translate.
     
  16. master4523

    master4523 Masterful KAG Guard Global Moderator Tester
    1. PumpkinStars - [Pk#] - Inactive

    Messages:
    378
    New update!

    Changelog 1.0.1:
    [lib][added] config file (juxtapp_config.cfg)
    [kag][added] movement speedhack detection (please report any false positive)
    [lua][modified]OnPlayerRespawn now takes two additional parameters: x and y pos of the respawn point
    [lib][fixed] now prints in the console the name of the player who tried using editor hack, before kicking him
    [lua][fixed] the output of print() is now correctly redirected to the server console (and saved in the server logs)
    [lua][fixed] KAG.SendRcon crashes the server with script commands like addBot
    [lib][fixed] using the command /plugins reloads every plugins before printing them

    The default ban length for speedhacking is set to 15 minutes, you can change it in juxtapp_config.cfg (you can also disable it, if ... you like speedhackers)
    Juxta++ is set to restart the server at the end of the round if an update has been downloaded. You can also disable that behavior in the config file.
     
  17. Chumind

    Chumind Drill Rusher

    Messages:
    184
    OMERD, i love you!
     
  18. SnIcKeRs

    SnIcKeRs Bison Rider

    Messages:
    148
    Last edited: Sep 14, 2014
    Fernegulus likes this.
  19. master4523

    master4523 Masterful KAG Guard Global Moderator Tester
    1. PumpkinStars - [Pk#] - Inactive

    Messages:
    378
    New update!
    Changelog 1.0.2:
    [lib][added] fast attack hack detection (please report any false positive)
    [lib][added] detection for builder range hack (place/destroy blocks with no distance limit)
    [lib][added] attempt to fix tcpr spam attack
    [lib][added] new chat command: /commands (prints all the chat commands registered by the plugins)
    [lua][added] two new functions: KAG.GetMapWidth and KAG.GetMapHeight, to get the map size
    [lua][modified] OnMapReceiveTile now takes three additional parameters: x, y, and block id
    [lib][modified] optimized Lua plugins calls, better performances
    [lua][fixed] server crash when using KAG.SpawnBlob, KAG.SpawnBot or KAG.SpawnEgg
    [lib][fixed] speedhack detection now won't be triggered if the player has the seclev feature "speedkick_immunity"
    [lib][removed] old debug message related speedhack detection
     
  20. Klokinator

    Klokinator Such Beta
    1. Aphelion's Roleplay

    Messages:
    1,443
    Hey man wow we could use some of these in current kag too plz port
     
Mods: Downburst, Mazey