Author Topic: Game commands  (Read 4359 times)

Scam

  • Posts: 27
  • Turrets: +1/-2
Game commands
« on: August 10, 2007, 12:50:28 pm »
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.

ShadowNinjaDudeMan

  • Posts: 1385
  • Turrets: +86/-58
    • Tremopolis
Re: Game commands
« Reply #1 on: August 10, 2007, 01:24:51 pm »
Quote from: "Scam"
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.


To find this answer, you must go to the Degobah System, young Padowan
My favorite player is Jesus, because everything is forgiven when he respawns.

NOM!NOM!NOM!

benmachine

  • Posts: 915
  • Turrets: +99/-76
    • ben's machinery
Game commands
« Reply #2 on: August 10, 2007, 01:45:19 pm »
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:
Code: [Select]
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.
benmachine

Scam

  • Posts: 27
  • Turrets: +1/-2
Game commands
« Reply #3 on: August 10, 2007, 02:55:59 pm »
Thanks! Grep really is quite handy tool.

ShadowNinjaDudeMan: It's Dagobah, not Degobah: http://en.wikipedia.org/wiki/Dagobah

ShadowNinjaDudeMan

  • Posts: 1385
  • Turrets: +86/-58
    • Tremopolis
Game commands
« Reply #4 on: August 10, 2007, 03:50:19 pm »
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?
My favorite player is Jesus, because everything is forgiven when he respawns.

NOM!NOM!NOM!