Create a dedicated server on Edgegap for Unity's Boss Room sample. This sample does not require any Unity Gaming Services (UGS), Multiplay, or Relays to run. See guide for testing and customization in Edgegap Learning Center.
This tutorial assumes you are already familiar with using the Edgegap plugin.
For this sample to run as dedicated server, we made the following changes:
- In
Assets/Scripts/ConnectionManagement/ConnectionMethod.cs, theSetConnectionPayload()call in theSetupHostConnectionAsyncfunction of theConnectionMethodIPclass was commented out, since the server is not a player. - In
Assets/Scripts/ConnectionManagement/ConnectionState/StartingHostState.cs, we changedNetworkManager.StartHost()withNetworkManager.StartServer()in theStartHostfunction. - In
Assets/Scripts/Gameplay/GameplayObjects/Character/ClientCharacter.cs, we commented out theOnMovementStatusChanged()call in theOnNetworkSpawnfunction. - In
Assets/Scripts/ConnectionManagement/ConnectionState/HostingState.cs, we commented out the following lines from theGetConnectStatusfunction in order to test the client from the editor.
if (connectionPayload.isDebug != Debug.isDebugBuild)
{
return ConnectStatus.IncompatibleBuildType;
}
- We added
Assets/Scripts/EdgegapServerStarter.cswith an empty gameObject to theMainMenuscene to to automatically callconnectionManager.StartHostIp()on server launch, using0.0.0.0as the address, and the value of theARBITRIUM_PORT_GAMEPORT_INTERNALenvironment variable as the port. The value used for the player name does not matter in this case.