Game Development Community

SetConnectArgs not working?

by Robert Stewart · in RTS Starter Kit · 02/19/2005 (10:54 pm) · 3 replies

Ok so the problem im having is trying to get %conn.setConnectArgs($pref::Player::Name, %data);
from joinServerGui.cs, to send information to RTSConnection::onClientEnterGame(%this, %name, %data) in gameConnection.cs. %name and %data are empty, am i missing something? Im guessing that the data is sent to a different function? I tried looking for something more like tge's onConnect function, but couldent find anything. Thanks for any help.

#1
02/20/2005 (8:57 am)
Ok, the connection sequence is actually pretty involved, but your main issue is that RTSConnection::onClientEnterGame() happens well after the raw conn.connect() event is handled--in other words, you cannot pass information directly from client side script connect() to server side script onClientEnterGame().

The method you are looking for is GameConnection::onConnect(), located in common/server/clientConnection.cs. I'm working on a more detailed description of the connection process that will probably be put up as a resource, but it's taking some time--I've traced through it pretty completely before, and I'm already lost again in the executation handoffs!
#2
02/20/2005 (1:49 pm)
Ok so i found this file and i put %client.data = %data; inside of clientConnection.cs, I can echo it in the same function and get the data, but when i goto gameConnection.cs and try to echo it i just get blank. I think i almost have this figured out.

Edit: I have it working for me now.
#3
02/22/2005 (10:45 am)
I posted my connection sequence overview as a resource, you can find it here: TGE 1.3 Connection Sequence Overview

EDIT: Sorry for the cross-posting, but I realized that stock 1.3 owners wouldn't see this announcement here!