Unity-Technologies / FPSSample

A first person multiplayer shooter example project in Unity
https://unity.com/fps-sample
Other
4.87k stars 1.84k forks source link

Server never replied when trying to connect ... disconnecting #8

Open MaikelChan opened 5 years ago

MaikelChan commented 5 years ago

Hi!

After following all the build steps and launching the game, I don't seem to be able to run it. Here's the log:

0: GameDebug initialized. Logging to ./game.log

0: cmd: exec user.cfg

0: cmd: exec game.cfg

0: SoundSystem using mixer: DefaultMixer

0: Mounted soundbank: Bank with 0 sounds

0: fps.sample initialized

0: Build type: release

0: BuildID: AutoBuild

0: Cwd: E:\FPSSample\AutoBuild

0: SimpleBundleManager initialized

0: LevelManager initialized

0: InputSystem initialized

0: Loaded game config

0: cmd: client 127.0.0.1

1: Game loop ClientGameLoop requested

2: Network client initialized

2: Switching state: null -> Connecting

2: Client initialized

2: Trying to connect to 127.0.0.1 (attempt #1)...

3577: Server never replied when trying to connect ... disconnecting

3577: Trying to connect to 127.0.0.1 (attempt #2)...

7177: Server never replied when trying to connect ... disconnecting

7177: Failed to connect to server

7177: Switching state: Connecting -> Browsing

I tried disabling the firewall and the antivirus just in case, but nope, it just doesn't work.

Greetings!

ndoell1 commented 5 years ago

I have the same issue. On the terminal after hitting Start, it also has Exec Failed: Could not find file ... user.cfg, and ... game.cfg. This warning isn't on my log either.

pseudocolor commented 5 years ago

yeah, I have this issue as well also with error on couldnt find the user.cfg and game.cfg

ndoell1 commented 5 years ago

I have found that I can "Use Editor as Server" in the Project Tools.

Camarent commented 5 years ago

I have the same problem. I used Unity 2018.3.0b7. When I clicked play it couldn't start headless server. If I unchecked headless I can play the game.

adnissen commented 5 years ago

since this workflow sucks and is a huge resource drain (the server renders the scene), to fix it simply change this line to true. https://github.com/Unity-Technologies/FPSSample/blob/master/Assets/Scripts/EditorTools/Editor/BuildWindow.cs#L553

No real idea what's going on here, just found it randomly while looking into the issue. FWIW this only effects clients that are launched from the unity editors project window. Launching the standalone build in the builds folder can create headless servers just fine, but it's much more convenient to be able to use the project window.

JairusSW commented 4 years ago

Hello, you need to navigate to FPSsample > Window > Project Tools and hit 'all [force]'. It took about 30 minutes for me. Then, scroll down a bit and hit build game with IL2CPP enabled. That should fix it!