Game Development Community

Clients not connecting in time in starter.fps

by Stephen Lujan · in Torque Game Engine · 04/01/2007 (8:32 am) · 0 replies

First of all I'm running tge 1.5 and I noticed this bug in starter.fps

I was having some problems with the function clientCmdGameStart() in client/scripts/game.cs. It simply wasn't being called at all. So I went back to function startGame() in server/scripts/game.cs and I added the line:

echo("server: startGame() with ",ClientGroup.getCount(), " clients.");

This revealed that there were in fact 0 clients in ClientGroup when the function startGame was called. In the mission I then typed "echo(ClientGroup.getCount())" into the console and there was 1 client. I then typed "commandToClient(ClientGroup.getObject(0), 'GameStart')" into the console and clientCmdGameStart() finally ran and fixed my problems. I'm not sure if this bug originates from any of my modifications but I don't believe I've done anything that could have caused this. I'm trying to debug this problem no but ClientGroup's instantiation and the adding of clients to ClientGroup doesn't seem to be explicitly in the scripts anywhere.

For the moment I've added "commandToClient(%this, 'GameStart');" to function GameConnection::onClientEnterGame(%this). This seems to be working for my purposes, but I thought I would report all of this this.