fix: catch more edge cases
This commit is contained in:
parent
5eedbf2f1e
commit
b9a7a1c479
4 changed files with 28 additions and 25 deletions
|
|
@ -35,15 +35,18 @@ public class GBSUServer : MonoBehaviour
|
|||
|
||||
public static void StartServer()
|
||||
{
|
||||
Helper.hosting = true;
|
||||
AudioListener.volume = 0; // mute game audio
|
||||
if (!Helper.hosting)
|
||||
{
|
||||
Helper.hosting = true;
|
||||
AudioListener.volume = 0; // mute game audio
|
||||
|
||||
Plugin.AddServerComp(); // add custom GBSU server component
|
||||
|
||||
RotationConfig gameConfig = GBConfigLoader.LoadRotationConfig(null); // the argument doesn't matter as we do stuff in the method
|
||||
ServerConfig serverConfig = NetConfigLoader.LoadServerConfig(); // load default server config, because it can be overridden by args like -ip and -port
|
||||
MonoSingleton<Global>.Instance.UNetManager.LaunchServer(serverConfig); // launch the server with the server config
|
||||
MonoSingleton<Global>.Instance.UNetManager.GetComponent<GameManagerNew>().ChangeRotationConfig(gameConfig, 0); // set server's rotationconfig
|
||||
Plugin.AddServerComp(); // add custom GBSU server component
|
||||
|
||||
RotationConfig gameConfig = GBConfigLoader.LoadRotationConfig(null); // the argument doesn't matter as we do stuff in the method
|
||||
ServerConfig serverConfig = NetConfigLoader.LoadServerConfig(); // load default server config, because it can be overridden by args like -ip and -port
|
||||
MonoSingleton<Global>.Instance.UNetManager.LaunchServer(serverConfig); // launch the server with the server config
|
||||
MonoSingleton<Global>.Instance.UNetManager.GetComponent<GameManagerNew>().ChangeRotationConfig(gameConfig, 0); // set server's rotationconfig
|
||||
}
|
||||
}
|
||||
|
||||
public static void StopServer()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue