mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
fix: Port log for when Server has started and is listening. (#3642)
Allows users to know if Server has actually started and which port, and not just initialised. Credits to Gadget for code and suggesting to have it in NetworkServer. (Originally was going in KCP-only)
This commit is contained in:
parent
1641bba5b1
commit
b195cc062a
@ -122,6 +122,17 @@ public static void Listen(int maxConns)
|
||||
|
||||
active = true;
|
||||
RegisterMessageHandlers();
|
||||
|
||||
if (Transport.active is PortTransport portTransport)
|
||||
{
|
||||
#if UNITY_SERVER
|
||||
Console.ForegroundColor = ConsoleColor.Green;
|
||||
Console.WriteLine($"Server listening on port {portTransport.Port}");
|
||||
Console.ResetColor();
|
||||
#else
|
||||
Debug.Log($"Server listening on port {portTransport.Port}");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
// initialization / shutdown ///////////////////////////////////////////
|
||||
|
Loading…
Reference in New Issue
Block a user