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 theSetupHostConnectionAsync
function of theConnectionMethodIP
class was commented out, since the server is not a player. - In
Assets/Scripts/ConnectionManagement/ConnectionState/StartingHostState.cs
, we changedNetworkManager.StartHost()
withNetworkManager.StartServer()
in theStartHost
function. - In
Assets/Scripts/Gameplay/GameplayObjects/Character/ClientCharacter.cs
, we commented out theOnMovementStatusChanged()
call in theOnNetworkSpawn
function. - In
Assets/Scripts/ConnectionManagement/ConnectionState/HostingState.cs
, we commented out the following lines from theGetConnectStatus
function in order to test the client from the editor.
if (connectionPayload.isDebug != Debug.isDebugBuild)
{
return ConnectStatus.IncompatibleBuildType;
}
- We added
Assets/Scripts/EdgegapServerStarter.cs
with an empty gameObject to theMainMenu
scene to to automatically callconnectionManager.StartHostIp()
on server launch, using0.0.0.0
as the address, and the value of theARBITRIUM_PORT_GAMEPORT_INTERNAL
environment variable as the port. The value used for the player name does not matter in this case.