Custom /Commands Discussion

11/06/2015 14:29 SugarD-x#1
I've read over quite a few topics in here about custom commands, but they all seem to come down to the same limitation: You can't have custom /<command>-style commands due to the existing ones in the client. Reading further into some posts, most people seem to agree that they are directly hardcoded into the client's executable. With this in mind, has anyone ever discovered how to actually remove/disable the original /commands from the client executable so custom ones could replace them? As an alternative, what about replacing or changing their functionality? With all that is known today about the game files, (and the enormous amount of control we have over them now), it would surprise me if no one has yet to figure this out.

The reason why I ask about this is because it would seem like a much better method to creating custom commands if they could be done in a more native style to the game itself. Making custom commands obviously has been done before, but not in this way, as far as I can tell.
11/06/2015 19:27 Truth1010#2
I would say it's very possible to at least re-code it so you can change how to activate/deactivate commands.
changing /char off to /invis off for example if you wanted.
Never tried it myself, but if i was to try, i would attach the game.exe in CE and search from there.
I remember i got the game to load admins fully visible from login, but it's been months since i did much developing, just getting back into it myself. So doing that much is at least possible without much knowledge or skill.

Nubness or Juuf could tell you for sure if it's possible, and maybe give a better outline on how you would go about it. Or you can just play around yourself and see what you can learn/find.
11/06/2015 19:41 SugarD-x#3
Quote:
Originally Posted by Truth1010 View Post
I would say it's very possible to at least re-code it so you can change how to activate/deactivate commands.
changing /char off to /invis off for example if you wanted.
Never tried it myself, but if i was to try, i would attach the game.exe in CE and search from there.
I remember i got the game to load admins fully visible from login, but it's been months since i did much developing, just getting back into it myself. So doing that much is at least possible without much knowledge or skill.

Nubness or Juuf could tell you for sure if it's possible, and maybe give a better outline on how you would go about it. Or you can just play around yourself and see what you can learn/find.
Good to know that you agree it is possible. I don't really have any programming experience in my background, (despite managing several projects elsewhere which require it), but from the sounds it shouldn't be too tricky. I just still can't believe no one has done it here yet. I may have to play around and see what I can figure out. :)

Edit: After just some very basic playing around in HxD, (mainly for sheer curiosity), I was able to pull up some of the commands. Theoretically by changing them to something else, I wonder if it would be possible to use one of the custom scripted commands to override them... :D
11/06/2015 20:17 Truth1010#4
I see no reason for it not to be. And yea, it wasn't too hard to find them from what i remember.

I think there was a post here a few years back with custom commands, but i believe that was linked through the database. Didn't pay much attention to it, and my memory isn't good enough to remember it exactly. Search will probably bring up some results.

[Only registered and activated users can see links. Click Here To Register...]
11/06/2015 20:27 SugarD-x#5
Quote:
Originally Posted by Truth1010 View Post
I see no reason for it not to be. And yea, it wasn't too hard to find them from what i remember.

I think there was a post here a few years back with custom commands, but i believe that was linked through the database. Didn't pay much attention to it, and my memory isn't good enough to remember it exactly. Search will probably bring up some results.

[Only registered and activated users can see links. Click Here To Register...]
Ya, thankfully the custom concepts are well documented. I'm thinking I may try to play around with this and see what happens. Hopefully the game executable only needs the command reference itself removed to disable its use. I may test it with the ban function replaced to see how it reacts.
11/07/2015 15:16 SugarD-x#6
Quote:
Originally Posted by [ADM]Cups View Post
Changing the command identifier won't affect the functionality of the command. Commands are hard coded into the client, and each command is represented by a different opcode when communicating via packets (the game process then decodes that packet and acts accordingly). I toyed with the idea on my project in hoping that commands would all have a common, static packet opcode and were identified purely by the command name and parameters, but was disappointed.

Unless you want to figure out a way to add new packets on both client and server side, the best we can do is rename commands or build custom ones with SQL triggers.
Renaming the originals to something random and using SQL triggers/other database methods was what I was thinking about doing too. I'm hoping that by doing both, I could effectively "replace" the functionality of existing /commands with custom versions. For example, with the idea I was testing, I renamed the hardcoded /ban command to something random. I've yet to do the database portion yet, but the general plan is to make a custom /ban command in the database which I can later define further in my own ways, (such as custom permission levels of who can use it and the like). I know someone has already proved that custom command prefixes like "\" will work, as will un-prefixed commands, but my curiosity and random thoughts have me wondering if replacing /ban (or any other command) with a custom one using the same command name will have any adverse, hidden effects.

To put it simply, if I do the above to make my own /ban command, I'm just hoping that simply renaming the hardcoded one in the client disables it completely from being used, (at least using its original name), as opposed to the server seeing the custom /ban command as the original, and still executing some hidden code that can't be disabled as easily. Since this idea seems to be fairly untested by the general public, it makes me wonder if those custom commands have code directly linked to the command name somewhere else besides the client's game executable.

(I know, my apologies for writing a book full of confusing literacy. It's a bad habit :D )
11/07/2015 18:42 Truth1010#7
Can't you just make it as a chat trigger to effectively change anything in the database. The same way that the AddGM trigger works in the DB releases here without them being fixed?

With that, any account can type in normal chat to gain Admin status. Not exactly a command as in /clear, but could be used just the same to a certain degree.

With testing, i'm sure you could replicate things such as /cmove, but not entirely sure exactly how it would be done database alone.
Been out of development too long to remember the assembly i did have learnt xD slowly getting back into it.
11/07/2015 20:19 Truth1010#8
Ah, i hadn't seen that post from you. Very nice btw. :)

Makes more sense how he wants to do it now, even if i don't understand the want/need to make custom commands, you can do allot with the already existing ones.

I do like your /w to self idea though, something i hadn't thought about when triggering commands through the DB :)