When client types a command in console, e.g. /share. I wonder where is this command compared to the supported game commands in the source code.
Edit: Found it already
Next question: Where is this ClientCommand( int clientNum ) function called? I can't find it.
Quote from: ScamWhen client types a command in console, e.g. /share. I wonder where is this command compared to the supported game commands in the source code.
Edit: Found it already
Next question: Where is this ClientCommand( int clientNum ) function called? I can't find it.
To find this answer, you must go to the Degobah System, young Padowan
Tip: learn to use grep. It is a wonderful tool.
casino:~/Documents/tremulous964 ben$ grep -RHn "ClientCommand" src | grep -v svn
This command finds all teh instances of ClientCommand in src and its subfolders, prints them with filename and line number, then removes any entries that contain svn (because I'm not interested in the .svn folders).
It came up with quite a lot, but only one actual call to ClientCommand:
src/game/g_main.c:310: ClientCommand( arg0 );
A closer inspection shows this as a part of the vmMain function, which suggests it gets called from outside the game.qvm (I think, although this is not my area of expertise)
It might be worth now tracking GAME_CLIENT_COMMAND or possibly looking at the SV_ClientCommand function in src/server/sv_client.c
I'm not sure how relevant those two are, but I'm not going to spend all day finding out for you, either.
Thanks! Grep really is quite handy tool.
ShadowNinjaDudeMan: It's Dagobah, not Degobah: http://en.wikipedia.org/wiki/Dagobah
Quote from: Scam
ShadowNinjaDudeMan: It's Dagobah, not Degobah: http://en.wikipedia.org/wiki/Dagobah
No its not.
Whoever said I was talking about Star Wars eh?