public override bool CheckIfAuthorized(WebSocketGroupQuery request)
        {
            //Check if the type matches
            if (((IRPCGroupQuery)request).type != type)
            {
                return(false);
            }

            //Make sure the type of group matches
            if (request.GetType() != typeof(RPCGroupQueryServerTribe))
            {
                return(false);
            }

            //Check if server ID matches
            RPCGroupQueryServerTribe query = (RPCGroupQueryServerTribe)request;

            if (query.server_id != server_id)
            {
                return(false);
            }

            //Check if the the tribe ID matches (or if any is allowed)
            if (!any_tribe_id && query.tribe_id != tribe_id)
            {
                return(false);
            }

            return(true);
        }
        public override bool CheckIfAuthorized(WebSocketGroupQuery request)
        {
            //Check if the type matches
            if (((IRPCGroupQuery)request).type != type)
            {
                return(false);
            }

            //Make sure the type of group matches
            if (request.GetType() != typeof(RPCGroupQueryServerAdmin))
            {
                return(false);
            }

            //Check if server ID matches
            RPCGroupQueryServerAdmin query = (RPCGroupQueryServerAdmin)request;

            if (query.server_id != server_id)
            {
                return(false);
            }

            //Return if admin
            return(true);
        }
示例#3
0
        public override bool CheckIfAuthorized(WebSocketGroupQuery request)
        {
            //Make sure the type of group matches
            if (request.GetType() != typeof(IRPCGroupQuery))
            {
                return(false);
            }

            return(true);
        }
示例#4
0
        public override bool CheckIfAuthorized(WebSocketGroupQuery request)
        {
            //Make sure the type of group matches
            if (request.GetType() != typeof(RPCGroupQueryUser))
            {
                return(false);
            }

            //Check if user ID matches
            RPCGroupQueryUser query = (RPCGroupQueryUser)request;

            if (query.user_id != user_id)
            {
                return(false);
            }

            return(true);
        }