Game Development Community

Networking question

by 255h · in Torque 3D Beginner · 12/01/2013 (9:52 am) · 7 replies

Hi. I've been playing with t3d for a few days, and it's just fantastic.
still wondering, how minimalistic networking server-client skeleton should look.

my attemp:
//server
enableWinConsole(true);
setNetPort(27020 );
allowConnections(true);
$ServerGroup = new SimGroup(ServerGroup);

//client (?) documentation said setting up client bla bla lba
// http://docs.garagegames.com/torque-3d/official/content/documentation/Scripting/Advanced/Networking.html#Setting_Up_The_Server
%conn = new GameConnection( ServerConnection );
RootGroup.add( ServerConnection ); 
%conn.setConnectArgs( $pref::Player::Name );
%conn.setJoinPassword( $Client::Password );
%conn.connect("127.0.0.1:27020");

but still no luck:
Binding server port to default IP
UDP initialized on port 27020
successfully connected to port: 27020

Adding a pending connection
Sending Connect challenge Request
Sending Connect challenge Request (never ending)

What am i doing wrong?
*tried rtfm'ing but i dont get it :D

About the author

Recent Threads


#1
12/01/2013 (8:30 pm)
You do have the proper callbacks for client connection coded as well, correct?

GameConnection::onConnect and GameConnection::onDrop I beleive.
#2
12/01/2013 (9:59 pm)
Tried implementing this functions with "dummies", but theris no sign of them being called.
btw %conn.connectLocal(); seems to be working.
#3
12/02/2013 (1:38 am)
Are u running another version of the game as dedicated?
#4
12/02/2013 (2:16 am)
I'v created 2 empty projects and cleand em so only game dll, executable and main.cs (with my code) left. And yes i'm runing both of them while testing xD
#5
12/02/2013 (2:19 am)
I'm sorry boss are u trying to make 2 different empty projects connect to each other?
#6
12/02/2013 (3:21 am)
U need to run the same empty project twice - once in dedicated mode and another just normally, u have to use command line to run in dedicated mode I think
#7
12/02/2013 (7:10 am)
2 Thomas Fluff Harris:
hm i think i represented my problem in a wrong way :D im not running standart emppty project as is. The idea is to write something from scratch. So the part with dedicated server that declired in main.cs:

from function parseArgs() im main.cs
switch$ (%arg)
      {
         //--------------------
         case "-dedicated":
            $Server::Dedicated = true;
            enableWinConsole(true);
            $argUsed[%i]++;

is not used in my project. im running EMPTY project with no (other then my main.cs) scripts included.