コード例 #1
0
		/// <summary>
		/// Disconnects client from scope. Can be applied to both application scope
		/// and scopes of lower level.
		/// </summary>
		/// <param name="client">Client object.</param>
		/// <param name="scope">Scope object.</param>
		public override void Leave(IClient client, IScope scope) 
		{
			if (ScopeUtils.IsApplication(scope)) 
				AppLeave(client, scope);
			else if (ScopeUtils.IsRoom(scope)) 
				RoomLeave(client, scope);
			base.Leave(client, scope);
		}
コード例 #2
0
		/// <summary>
		/// Stops scope handling (that is, stops application if given scope is app
		/// level scope and stops room handling if given scope has lower scope level).
		/// </summary>
		/// <param name="scope">Scope to stop.</param>
		public override void Stop(IScope scope) 
		{
			if(ScopeUtils.IsApplication(scope)) 
				AppStop(scope);
			else if (ScopeUtils.IsRoom(scope)) 
				RoomStop(scope);
			base.Stop(scope);
		}
コード例 #3
0
		/// <summary>
		/// Adds client to scope. Scope can be both application or room. Can be
		/// applied to both application scope and scopes of lower level.
		/// </summary>
		/// <param name="client">Client object.</param>
		/// <param name="scope">Scope object.</param>
        /// <returns>true to allow, false to deny join.</returns>
		public override bool Join(IClient client, IScope scope) 
		{
			if(!base.Join(client, scope)) 
				return false;
			if(ScopeUtils.IsApplication(scope)) 
				return AppJoin(client, scope);
			else if (ScopeUtils.IsRoom(scope)) 
				return RoomJoin(client, scope);
			else
				return false;
		}
コード例 #4
0
		/// <summary>
		/// Starts scope. Scope can be both application or room level.
		/// </summary>
		/// <param name="scope">Scope object.</param>
		/// <returns>true if scope can be started, false otherwise.</returns>
		public override bool Start(IScope scope) 
		{
			if(!base.Start(scope)) 
				return false;
			if(ScopeUtils.IsApplication(scope)) 
				return AppStart(scope);
			else if (ScopeUtils.IsRoom(scope)) 
				return RoomStart(scope);
			else 
				return false;
		}
コード例 #5
0
 /// <summary>
 /// Returns disconnection result for given scope and parameters.
 /// Whether the scope is room or application level scope, this method distinguishes it and acts accordingly.
 /// </summary>
 /// <param name="connection">Connection object.</param>
 /// <param name="scope">true if disconnect is successful, false otherwise.</param>
 public override void Disconnect(IConnection connection, IScope scope)
 {
     if (ScopeUtils.IsApplication(scope))
     {
         AppDisconnect(connection);
     }
     else if (ScopeUtils.IsRoom(scope))
     {
         RoomDisconnect(connection);
     }
     base.Disconnect(connection, scope);
 }
コード例 #6
0
 public override void Stop(IScope scope)
 {
     if (ScopeUtils.IsApplication(scope))
     {
         this.AppStop(scope);
     }
     else if (ScopeUtils.IsRoom(scope))
     {
         this.RoomStop(scope);
     }
     base.Stop(scope);
 }
コード例 #7
0
 public override bool Start(IScope scope)
 {
     if (!base.Start(scope))
     {
         return(false);
     }
     if (ScopeUtils.IsApplication(scope))
     {
         return(this.AppStart(scope));
     }
     return(ScopeUtils.IsRoom(scope) && this.RoomStart(scope));
 }
コード例 #8
0
 public override bool Join(IClient client, IScope scope)
 {
     if (!base.Join(client, scope))
     {
         return(false);
     }
     if (ScopeUtils.IsApplication(scope))
     {
         return(this.AppJoin(client, scope));
     }
     return(ScopeUtils.IsRoom(scope) && this.RoomJoin(client, scope));
 }
コード例 #9
0
        /// <summary>
        /// Returns connection result for given scope and parameters. 
        /// Whether the scope is room or application level scope, this method distinguishes it and acts accordingly.
        /// </summary>
        /// <param name="connection">Connection object.</param>
        /// <param name="scope">Scope object.</param>
        /// <param name="parameters">List of params passed to connection handler.</param>
        /// <returns>true if connect is successful, false otherwise.</returns>
		public override bool Connect(IConnection connection, IScope scope, object[] parameters)
		{
			if( !base.Connect (connection, scope, parameters) )
				return false;
			bool success = false;
			if(ScopeUtils.IsApplication(scope))
			{
				success = AppConnect(connection, parameters);
			}
			else if (ScopeUtils.IsRoom(scope)) 
			{
				success = RoomConnect(connection, parameters);
			}
			return success;
		}
コード例 #10
0
        public override bool Connect(IConnection connection, IScope scope, object[] parameters)
        {
            if (!base.Connect(connection, scope, parameters))
            {
                return(false);
            }
            bool flag = false;

            if (ScopeUtils.IsApplication(scope))
            {
                flag = this.AppConnect(connection, parameters);
            }
            else if (ScopeUtils.IsRoom(scope))
            {
                flag = this.RoomConnect(connection, parameters);
            }
            return(flag);
        }
コード例 #11
0
 /// <summary>
 /// Adds client to scope. Scope can be both application or room. Can be
 /// applied to both application scope and scopes of lower level.
 /// </summary>
 /// <param name="client">Client object.</param>
 /// <param name="scope">Scope object.</param>
 /// <returns>true to allow, false to deny join.</returns>
 public override bool Join(IClient client, IScope scope)
 {
     if (!base.Join(client, scope))
     {
         return(false);
     }
     if (ScopeUtils.IsApplication(scope))
     {
         return(AppJoin(client, scope));
     }
     else if (ScopeUtils.IsRoom(scope))
     {
         return(RoomJoin(client, scope));
     }
     else
     {
         return(false);
     }
 }
コード例 #12
0
 /// <summary>
 /// Starts scope. Scope can be both application or room level.
 /// </summary>
 /// <param name="scope">Scope object.</param>
 /// <returns>true if scope can be started, false otherwise.</returns>
 public override bool Start(IScope scope)
 {
     if (!base.Start(scope))
     {
         return(false);
     }
     if (ScopeUtils.IsApplication(scope))
     {
         return(AppStart(scope));
     }
     else if (ScopeUtils.IsRoom(scope))
     {
         return(RoomStart(scope));
     }
     else
     {
         return(false);
     }
 }