The listen server works fine but why is my dedicated server not working right?

Hey everyone,

I’m trying to launch a dedicated server of my game from a desktop shortcut but its not quite working how I think it should. I setup the listen server fine with the target in my shortcut as:

“…/gamestuff/game.uproject” MyMap?listen -game -log

at the end of the target box in the shortcut I made, which works perfectly.

However to setup a dedicated server I tried switching to:

“…/gamestuff/game.uproject” MyMap -server -log

When I launch it, it launches the log like it should but when I connect there is no custom game mode like when I launch the listen server. I’m just a spectator camera flying around.

Am I missing something simple here? I can’t seem to figure out why it isn’t launching my custom game mode class.

Thanks!

Check your Default settings for Game modes including default server setting
If they don’t all match properly (also depending on how your menus start), that could be part of it.
This is found in project settings for maps & modes, also when the server starts it doesn’t listen on
127.0.0.1, its actually listening by default on the local lan IP address…
or least thats the current state where I am at :slight_smile:

Yes all those settings are set but I still load as a spectator.

“also when the server starts it doesn’t listen on 127.0.0.1, its actually listening by default on the local lan IP address” Can you expand on that? should I change the client target to something besides local host?

what is your server log showing? When I set mine to ?listen, then its local lan, when its set to just (game.exe) [gamemap] -server it shows in the logs: [2014.05.10-19.12.09:114][ 0]LogInit: WinSock: I am DevelopII (192.168.0.4:0)
and doesn’t (listen) on localhost… Still digging into this and so just getting the Socket part sorted out myself. So yeah, try open (your machines Lan IP)
As for the reason for spectator, try opening the console and typing (reconnect), otherwise it maybe that it isn’t finding the Start point for your player to spawn at, or there maybe something in the way where it is trying to spawn. I have additional code to test around the spawn point by +/-10 to find a valid spawn point. That may be your real problem…

I’m not launching from an exe I’m launching from .uproject as I showed above, could that have something to do with it?

This is what the server log shows:

[2014.05.10-19.46.48:346][ 0]LogWorld: Game class is ‘GameMode’

[2014.05.10-19.46.48:347][ 0]LogSockets:Warning: Failed to create socket SessionSocket [Unreal]

[2014.05.10-19.46.48:348][ 0]LogInit: WinSock: Socket queue 131072 / 131072

[2014.05.10-19.46.48:350][ 0]LogInit: WinSock: I am God (192.168.1.143:0)

[2014.05.10-19.46.48:350][ 0]LogNet: GameNetDriver IpNetDriver_0 IpNetDriver listening on port 7777

[2014.05.10-19.46.48:351][ 0]LogWorld: Bringing World /Game/Disabled_Comodo_Int.Disabled_Comodo_Int up for play (max tick rate 30) at 2014.05.10-20.46.48

[2014.05.10-19.46.48:352][ 0]LogInit:Display: Game Engine Initialized.

[2014.05.10-19.46.48:356][ 0]LogLoad: Full Startup: 2.46 seconds (BP compile: 0.12 seconds)

[2014.05.10-19.46.56:957][256]LogNet: NotifyAcceptingConnection: Server Disabled_Comodo_Int accept

[2014.05.10-19.46.56:957][256]LogNet: Open Disabled_Comodo_Int 05/10/14 20:46:56 127.0.0.1

[2014.05.10-19.46.56:957][256]LogNet: Added client connection. Remote address = 127.0.0.1:52682

[2014.05.10-19.46.56:957][256]LogNet: NotifyAcceptingChannel Control 0 server World /Game/Disabled_Comodo_Int.Disabled_Comodo_Int: Accepted

[2014.05.10-19.46.56:957][256]LogNet: Remote platform little endian=1

[2014.05.10-19.46.56:957][256]LogNet: This platform little endian=1

[2014.05.10-19.46.57:226][264]LogNet: Login request: /Game/Disabled_Comodo_Int?Name=Player userId: Invalid

[2014.05.10-19.46.57:226][264]LogNet: Client netspeed is 10000

[2014.05.10-19.46.57:497][272]LogNet: Join request: /Game/Disabled_Comodo_Int?Name=Player?SplitscreenCount=1

[2014.05.10-19.46.57:497][272]LogGameMode: RestartPlayer Player

[2014.05.10-19.46.57:498][272]LogNet: Join succeeded: Player

[2014.05.10-19.46.58:069][289]LogPlayerController: ServerAcknowledgePossession_Implementation DefaultPawn_0

nope, that shouldn’t be the problem… Not sure where your problem is coming from there. It looks like the spawn implemenation isn’t continuing after getting control of it and it is sitting at spectator mode. Can’t tell where it fails. Best bet is to debug it from the point it is suppose to spawn the player and work backwards.

■■■■, well thanks for trying anyway.

heres a thought… If you don’t have the game mode initializing properly by default you coud try forcing it on the server with: …/gamestuff/game.uproject" MyMap?game=MyGameMode -server -log It might be you don’t have your initgame() setup right for the server to start in that mode, this should force it. Altho it does look like the log says it is starting in that mode… unless GameMode is not the one you want…

I forced it with the line of code you gave but still the same problem. Spawns for a second in the floor and then goes to spectator mode. reconnect in console command doesn’t fix it.

That sounds like the spawn setup is incorrect, try moving the Spawn game object up higher in the editor. Better to drop a little bit to floor then to try spawning in the floor as that would cause it to fail usually.

Ya I have it setup pretty high in the air. It spawns in the floor first then way up in the air with just the camera.

aahh, yeah, thats normal, thinking about it, the spawn starts with zero point position then gets the correct location on spawn setup. At this point its gonna take debuging, not the easy way but necessary. As it spawns the spectator you can do a break at that point and back trace to where it decides wether to spawn a player or the spectator and see what is failing. Not much more I can do from here.

ok thanks for trying!