Пример #1
0
 /// <summary>
 ///     Default access provider, which always confirms access requests
 /// </summary>
 /// <param name="peerId"></param>
 /// <param name="callback"></param>
 public void DefaultAccessProvider(UsernameAndPeerIdPacket requester, RoomAccessProviderCallback callback)
 {
     callback.Invoke(new RoomAccessPacket {
         RoomIp     = Options.RoomIp,
         RoomPort   = Options.RoomPort,
         Properties = Options.Properties,
         RoomId     = RoomId,
         Token      = Guid.NewGuid().ToString(),
         SceneName  = SceneManager.GetActiveScene().name
     }, null);
 }
Пример #2
0
 /// <summary>
 ///     Override, if you want to manually handle creation of access'es
 /// </summary>
 /// <param name="callback"></param>
 public virtual void CreateAccess(UsernameAndPeerIdPacket requester, RoomAccessProviderCallback callback)
 {
     callback.Invoke(new RoomAccessPacket {
         RoomIp     = Controller.Options.RoomIp,
         RoomPort   = Controller.Options.RoomPort,
         Properties = Controller.Options.Properties,
         RoomId     = Controller.RoomId,
         SceneName  = SceneManager.GetActiveScene().name,
         Token      = Guid.NewGuid().ToString()
     }, null);
 }
Пример #3
0
 /// <summary>
 /// Default access provider, which always confirms access requests
 /// </summary>
 /// <param name="peerId"></param>
 /// <param name="callback"></param>
 public void DefaultAccessProvider(UsernameAndPeerIdPacket requester, RoomAccessProviderCallback callback, ErrorCallback errorCallback)
 {
     callback.Invoke(new RoomAccessPacket
     {
         RoomIp     = Options.RoomIp,
         RoomPort   = Options.RoomPort,
         Properties = Options.Properties,
         RoomId     = RoomId,
         Token      = Guid.NewGuid().ToString(),
         SceneName  = "SceneName"
     });
 }
Пример #4
0
 /// <summary>
 /// Default access provider, which always confirms access requests
 /// </summary>
 /// <param name="accessCheckOptions"></param>
 /// <param name="callback"></param>
 public void DefaultAccessProvider(RoomAccessProviderCheck accessCheckOptions, RoomAccessProviderCallback callback)
 {
     callback.Invoke(new RoomAccessPacket()
     {
         RoomIp        = Options.RoomIp,
         RoomPort      = Options.RoomPort,
         CustomOptions = Options.CustomOptions,
         RoomId        = RoomId,
         Token         = Msf.Helper.CreateGuidString(),
         SceneName     = SceneManager.GetActiveScene().name
     }, null);
 }