private void SetupLogger()
 {
     //Telepathy.Logger.Log = Logger.Log;
     Telepathy.Logger.Log        = msg => Logger.Log("[Telepathy] " + msg);
     Telepathy.Logger.LogWarning = msg => Logger.Warn("[Telepathy] " + msg);
     Telepathy.Logger.LogError   = msg => Logger.Error("[Telepathy] " + msg);
 }
 private void Awake()
 {
     if (ClientNetManagerUnity.Instance == null)
     {
         Logger.Error("Cannot awaken a ClientBehaviour before the ClientNetManager! Try changing your script execution order.");
     }
     ClientNetManagerUnity.Instance.ListenForPackets(OnReceivePacket);
 }
 /// <summary>
 /// Stop the server & disconnect all clients
 /// </summary>
 public bool StopServer()
 {
     if (_server == null)
     {
         Logger.Error("Cannot stop the server as it was never started!");
         return(false);
     }
     return(_server.Stop());
 }
示例#4
0
        public bool DisconnectClient()
        {
            if (_client == null)
            {
                Logger.Error("Cannot disconnect the client before initialization!");
                return(false);
            }

            return(_client.Disconnect());
        }