Skip to content

edgegap/netcode-sample-unity-ngo-bossroom

Repository files navigation

Boss Room sample on Edgegap

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.

Preparation

This tutorial assumes you are already familiar with using the Edgegap plugin.

Sample Modifications

For this sample to run as dedicated server, we made the following changes:

  • In Assets/Scripts/ConnectionManagement/ConnectionMethod.cs, the SetConnectionPayload() call in the SetupHostConnectionAsync function of the ConnectionMethodIP class was commented out, since the server is not a player.
  • In Assets/Scripts/ConnectionManagement/ConnectionState/StartingHostState.cs, we changed NetworkManager.StartHost() with NetworkManager.StartServer() in the StartHost function.
  • In Assets/Scripts/Gameplay/GameplayObjects/Character/ClientCharacter.cs, we commented out the OnMovementStatusChanged() call in the OnNetworkSpawn function.
  • In Assets/Scripts/ConnectionManagement/ConnectionState/HostingState.cs, we commented out the following lines from the GetConnectStatus 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 the MainMenu scene to to automatically call connectionManager.StartHostIp() on server launch, using 0.0.0.0 as the address, and the value of the ARBITRIUM_PORT_GAMEPORT_INTERNAL environment variable as the port. The value used for the player name does not matter in this case.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •