alvyxaz / barebones-masterserver

Master Server framework for Unity
475 stars 106 forks source link

"From Scratch" documentation missing details? #42

Closed pjbaron closed 7 years ago

pjbaron commented 7 years ago

Hi! New user of your wonderful Framework and fairly new to Unity (so please excuse if this is something stupid!)

I've just followed your "From Scratch" instructions to the letter, and they work great right up to "registering a game server" https://github.com/alvyxaz/barebones-masterserver/wiki/From-Scratch.-Registering-a-Game-Server After attempting these steps several times I am always getting the error:

Failed to connect to master server
UnityEngine.Debug:LogError(Object)
FakeGameServer:<OnStartClick>m__0(IClientSocket) (at Assets/FromScratch/FakeGameServer.cs:48)
Barebones.Networking.<WaitConnection>c__AnonStorey0:<>m__1() (at Assets/Barebones/Networking/Scripts/ClientSocketWs.cs:70)
Barebones.Networking.<StartWaitingSeconds>c__Iterator1:MoveNext() (at Assets/Barebones/Networking/Scripts/BTimer.cs:138)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

I have just started to attempt to debug it, but wondered if you already know what I'm doing wrong? (the master server is running and I've tried the start-and-register button both before and after the login-as-guest button with always the same result)

I believe it might be that the Master Server doesn't have all the components it needs, so maybe there is a step missing in the 'from scratch' instructions?

My Client+FakeGameServer has:

Connection
- MasterServerConnector.cs
Canvas
- Hud
- LoginControls
-- GuestBtn
-- UsernameText
- FakeGameServer
-- StartAndRegister
-- StopAndDisconnect

My Master Server has:

Networking
- MasterServer
-- Master.cs
-- AuthModule
-- Database
Canvas
- Hud

I wonder if it's just a port issue? I see that the fakegameserver is using 5001 but in masterserver I see only code to use port 5000.

alvyxaz commented 7 years ago

Hey! At the moment, I can't check it in detail, but you might have missed this section of the tutorial:

https://github.com/alvyxaz/barebones-masterserver/wiki/From-Scratch.-Adding-Games-Module

Let me know if this helps ;)

pjbaron commented 7 years ago

Ah yes, those instructions don't look familiar so I almost certainly skipped it somehow, I'll go through it tomorrow and see how it turns out :)

pjbaron commented 7 years ago

yes, that was it, thank you!