Ejemplo n.º 1
0
    /** 处理申请 */
    public void handleApply(long targetID, int result)
    {
        if (isFull())
        {
            me.warnLog("处理申请时,人数已满");
            return;
        }

        if ((getMember(targetID)) != null)
        {
            me.warnLog("处理申请时,成员已存在");
            return;
        }

        //不可处理申请
        if (!RoleGroupTitleType.canOperateApply(_selfData.title))
        {
            me.warnLog("处理申请时,不可处理申请");
            return;
        }

        if (!_d.applyDic.contains(targetID))
        {
            me.warnLog("处理申请时,不在申请组");
            return;
        }

        me.send(FuncHandleApplyRoleGroupRequest.create(_funcID, groupID, targetID, result));
    }
Ejemplo n.º 2
0
    /** 邀请入群 */
    public void inviteRoleGroup(long groupID, long targetID)
    {
        if (!me.role.checkRoleConditions(_config.joinConditions, true))
        {
            me.warnLog("邀请入群时,condition不满足");
            return;
        }

        if (groupID > 0)
        {
            PlayerRoleGroup roleGroup = getRoleGroup(groupID);

            if (roleGroup == null)
            {
                me.warnLog("邀请入群时,找不到群", groupID);
                return;
            }

            if (roleGroup.isFull())
            {
                me.warnLog("邀请入群时,人数已满", groupID);
                return;
            }

            if (!RoleGroupTitleType.canOperateApply(roleGroup.getSelfData().title))
            {
                Ctrl.warnLog("邀请入群时,邀请者没有权限", groupID, roleGroup.getSelfData().title);
                return;
            }

            if (roleGroup.getMember(targetID) != null)
            {
                me.warnLog("邀请入群时,已在群中", groupID);
                return;
            }
        }
        else
        {
            if (!_config.canInviteCreate)
            {
                me.warnLog("邀请入群直接创建时,不支持直接邀请创建");
                return;
            }

            if (_config.eachPlayerGroupNum != 1)
            {
                me.warnLog("邀请入群直接创建时,必须为单一群");
                return;
            }

            if (isRoleGroupFull())
            {
                me.warnLog("邀请入群直接创建时,已达到数目限制");
                return;
            }
        }

        me.send(FuncInviteRoleGroupRequest.create(_funcID, groupID, targetID));
    }