Skip to content

Commit

Permalink
fix: adding ability to start the Client & Server from interfaces (#1079)
Browse files Browse the repository at this point in the history
  • Loading branch information
Soren025 committed May 24, 2022
1 parent 325747e commit 61e8d6b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Assets/Mirage/Runtime/INetworkClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public interface INetworkClient : IMessageSender

MessageHandler MessageHandler { get; }

void Connect(string address = null, ushort? port = null);

void Disconnect();
}
}
2 changes: 2 additions & 0 deletions Assets/Mirage/Runtime/INetworkServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ public interface INetworkServer

IReadOnlyCollection<INetworkPlayer> Players { get; }

void StartServer();

void Stop();

void AddConnection(INetworkPlayer player);
Expand Down
5 changes: 5 additions & 0 deletions Assets/Mirage/Runtime/NetworkServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,11 @@ public void StartServer(NetworkClient localClient = null)
}
}

void INetworkServer.StartServer()
{
StartServer();
}

void ThrowIfActive()
{
if (Active) throw new InvalidOperationException("Server is already active");
Expand Down

0 comments on commit 61e8d6b

Please sign in to comment.