Game Development Community

Couple of questions to better understand.

by Nathan Huffman · in Torque Game Engine · 06/14/2006 (1:21 am) · 2 replies

Could someone with experience please shine some light on a couple grey areas for me?

When you refer to the %client in clientConnection.cs (passed parameter), is that a GameConnection, NetConnection or what object? A client is a spawn of a new /what/? When you spawn a player in a game, what are you logically binding to it, to give a certain player control?

And it seems, in Torquescript, you can say things like %client.WHATEVER = WHATEVER. Even if a variable named "whatever" isn't 'defined' in (whatever %client is, from question 1). How is that data handled by Torque? And if server script says %client.SECRETDATA = WHISPER, that doesn't get replicated/sent to all clients does it?

I hope you see where I'm coming from. Any insight to better understand would be appreciated.

edit:

If I may tack another C++ understanding question on here:

In my ::onConnect function in my clientconnection.cs in /common, I have a SQL query performed then it uses the results and so forth. Should the SQL Server "lag" for some reason, and cause the result to be returned say... 3 seconds later... will the entire server and all players 'freeze' for 3 seconds? If not, why? If so, how can I prevent it/why? Please explain this area to me. Thx :)

#1
06/14/2006 (2:52 am)
There is an excellent explanation of the difference between the client object on the server and client object in this thread.

And dynamic variables will only exist in the scope where they were defined. Adding a dynamic variable to an object on the server means it will only be visible on the server... so that data is "avaliable" to anyone, but only on the serverside where everyone exists together. That data would have to be explicitly sent to _any_ clients (even the client object on which it is defined) for them to read it on the client side scripts.

Not sure bout the SQL stuff, don't know anything about that >.>'
#2
06/14/2006 (5:57 pm)
Thanks for your input, Paul.

Anyone know how the lagging vs. SQL stuff?