Game Development Community

Extra" player when joining dedicated server

by Lee Latham · in Torque Game Engine · 04/21/2007 (7:24 pm) · 6 replies

Hello,

I was wondering if anyone could explain why when I join the dedicated server with any client, I get, it seems, two players! One of them has "Super" by his name...is this significant?:
cm4msaa7.com/screenie.jpg

"boogerhead" is the name I have set in my starter.fps/client/prefs.cs, which seems to have been copied over by the engine to common/client/prefs.cs.

"Poser" is the default in the aforementioned common/server/clientConnection.cs. I don't understand the relationships, here, or how this works. Is there a document somewhere about this?

You know what's really weird, is I've just done a Find in Files on the the script and engine source, and "Poser" is nowhere to be found.

#1
04/21/2007 (9:22 pm)
Perhaps you need some practice using "Find in Files".

common/server/clientConnection.cs
function GameConnection::setPlayerName(%client,%name)
{
   %client.sendGuid = 0;

   // Minimum length requirements
   %name = stripTrailingSpaces( strToPlayerName( %name ) );
   if ( strlen( %name ) < 3 )
      %name = [b]"Poser";[/b]

How are you instigating the dedicated server? If you're doing it properly (via a tag on the exe) there's no way a ghost player could be present.

If you're just hosting a game on one PC (server) and joining with another (client), this is not a dedicated server. The "Poser" player is the client who joined the game and "boogerhead" is the person who is hosting (thus the super tag).
#2
04/22/2007 (8:26 am)
Hehe, actually I did find that instance of "Poser", changed it to "", saved, and did another Find in Files, found nothing--and the player still shows up named "Poser".

I concede that I've probably done something foolish...but I've deleted dso's, and can't think what it might be.

I'm running the dedicated server with the -dedicated commandline parameter. In fact, that's the only time I have this problem (whether or not it's the pc or linux dedicated server). If I run the game as combined client/server, I just get the regular user "boogerhead", as I would expect. What's interesting is that "boogerhead" is the "super" player, and all other clients get assigned "poser", which is the name the game puts in when the player's name is less than 3 characters, correct?

I'm beginning to think that there must be two client connections being made by my client. One that is fully functional, and one just lying around somehow...because the game seems to play just fine.

Edit: yeah something really bizarre is going on...suddenly deleting dso's isn't enough to change script values. I had copied my directory tree to a linux partition to do this linux dedicated server build, and copied it back to get the Windows build on the same page...and clearly thrown something for a loop. Perhaps permissions? Gah!

But I just tried to make my player jump value extremely high and it didn't "take"...doesn't explain my two player problem, but does show why Poser keeps showing up...
#3
04/22/2007 (8:47 am)
Ok, secondary problem solved. Windows didn't like the files copied to the fat32 partition by Linux. I copied the directory within Windows and it's fine now. "Poser" doesn't show up, but I get "boogerhead" as admin and ".1" as my playername when connecting to a dedicated server.
#4
04/22/2007 (11:27 am)
With Torsion I appear to have established that the problem is happening on the dedicated server side of life. The "poser" line of code never gets tripped by the client (I stuck a breakpoint there).

Unfortunately, I seem to be having trouble getting the dedicated server to work correctly with Torsion....
#5
04/22/2007 (1:27 pm)
Well, I started this thread so I'll fess up. I had left the server/init.cs from my TSE installation, which was spawning a server, apparently. Pulled in the stock init.cs and had "invalid packet" issues, fixed that. Now I've got only one guy entering the game as one would expect (yay) but his name is always Poser (boo!).

I appreciate anyone that read this or tried to help (especially you again, Tim), but obviously it a) isn't a common problem and b)I have clearly no choice but to dig dig dig. It's just as well really, since this is a part of the engine that is very new to me and I've already learned a lot the hard way.

Good thing I kinda enjoy it! :-)
#6
04/22/2007 (2:15 pm)
In case anybody else ever runs into it. I discovered that the name works fine when entered via the server connect gui.