Správné vypnutí serveru v případě crashe z důvodu obsazeného portu, soubor na nastavení rozlišení, odstranění nepoužívané metody Enemy.SilentSpawn a implementace metody SoundManager.GetRandomisedPitchInstance
This commit is contained in:
parent
243f071a43
commit
8742f9eb55
10 changed files with 46 additions and 56 deletions
|
|
@ -12,8 +12,6 @@ public static class Server {
|
|||
public static readonly Dictionary<int, ServerPlayer> Players = new();
|
||||
public static ServerPlayer OtherPlayer(ServerPlayer player) => player.State.Pid == P1.State.Pid ? P2 : P1;
|
||||
|
||||
public static bool AutoStop{ get; set; } = true;
|
||||
|
||||
private static EventBasedNetListener listener;
|
||||
private static NetManager server;
|
||||
|
||||
|
|
@ -61,6 +59,10 @@ public static class Server {
|
|||
listener.PeerDisconnectedEvent += OnPeerDisconnected;
|
||||
|
||||
server.Start(port);
|
||||
if (!server.IsRunning){
|
||||
Stop();
|
||||
return;
|
||||
}
|
||||
|
||||
Run();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue