Game Development Community

GameConnection sent to each player?

by Johnathan Moore · in Torque 3D Professional · 11/29/2012 (8:35 pm) · 4 replies

Hello. I'm a little confused about the GameConnection class. I'm wondering if you can use it to store information about players.
I've used my child class to decide whether the player can select the unit or not(nothing to do with mControllingClient). What I wonder though is, if the player has that information; whether each player is given a ghost of every GameConnection connected to the server.

If this is not the case where should I put thing like team and which player controls what? Preferably in code.

#1
11/30/2012 (8:53 am)
on script side u can save anything into any object as dynamic field.
that is also possible from source.

that is how server store each client's control object and score.

in ScriptsservergameCore.cs search for:
%client.player = %player;
and
%client.player = 0;

+ take a look on score related code

#2
11/30/2012 (9:21 am)
When a client is given the ghost of anouther clients controlled player, will that player.mControllingConnection point to a valid client side ghost of the GameConnection class?

Does it's server side GameConnection instance exist according to that client?
#3
11/30/2012 (10:01 am)
Oh, I'm going to make it so the server decides whether it's one of yours. Which is probably what I should have been doing, otherwise you can use server commands to add the other teams units to your selection xD.
#4
11/30/2012 (3:01 pm)
Hmmm... not quite sure how to answer that question. There is some information available about the other players in the world (I believe on the client but it's been a while since I've looked at it) since it is possible to display names above them and so on. That information would be ghosted as you said so it could come from a variety of classes. I would recommend digging into the code to see what information is transferred by default. The benefit of this approach is that you can transfer anything you wish once you understand the system.