Game Development Community

GameConnection

by Nathan · in General Discussion · 03/24/2006 (1:17 pm) · 6 replies

I have a couple of questions regarding GameConnection. Does a new game connection instance get created every time a play joins the game? If so, would that mean that I could call player functions through GameConnection? like 1654(assuming 1654 is a gameconnection object) 1654.player.getinventory(ammo);?

#1
03/24/2006 (7:07 pm)
Everything correct as far as I can see (it's 04 in the morning :/)
#2
03/25/2006 (1:55 am)
Yup - correct!

You can then use the game connection (also names %client all over the server\game.cs code) to save information on that client that survives as long as he is logged onto that server. Like above the player - or camera - or login information
#3
03/25/2006 (7:22 am)
Ok, thanks. One more question though... Is there any way to figure out what a players game connection object is?
#4
03/25/2006 (7:35 am)
%client = ClientGroup.getObject(%i);

Something like that will work.
#5
03/25/2006 (7:40 am)
Thanks!
#6
03/25/2006 (9:18 am)
Quote:
Is there any way to figure out what a players game connection object is?

on the server, this would be
%client = %player.getControllingClient();