Author Topic: Calling GameConnection from the client?  (Read 837 times)

So I used trace(1); to check out how something is done when your avatar changes and I noticed 7902 as the very first number in the parentheses. Using .getClassName(); I figured out that it was the GameConnection number. So, when I go to use that serverCmd I found, what should be in the parentheses? It contains a bunch of values that I have figured out what they are for but I need to know what to put as the first number in the parentheses.

A client, if you're doing this from the console, try something like serverCmdFirePants(findClientByName("blockhead"),45);

A client, if you're doing this from the console, try something like serverCmdFirePants(findClientByName("blockhead"),45);
From the clients end, how would you do this? Or is it automatically done?

From the clients end, how would you do this? Or is it automatically done?
Client's end?

You don't even need that part. In fact, if you could put in a value for a Gameconnection on the client end then you could potentially abuse any server.

commandToServer('function name without ServerCmd',args, and, stuff);

For example, commandToServer('useTool',0); will pull out your hammer, and that number (7902 in your case) is automatically defined by the server, being the client that called the command.

Simplified:
Client does commandToServer('UseTool',0);
Server gets ServerCmdUseTool(7902,0);

Client's end?

You don't even need that part. In fact, if you could put in a value for a Gameconnection on the client end then you could potentially abuse any server.

commandToServer('function name without ServerCmd',args, and, stuff);

For example, commandToServer('useTool',0); will pull out your hammer, and that number (7902 in your case) is automatically defined by the server, being the client that called the command.

Simplified:
Client does commandToServer('UseTool',0);
Server gets ServerCmdUseTool(7902,0);
Ah, I see.