Ejemplo n.º 1
0
    /// <summary>
    /// 回池
    /// </summary>
    protected override void toRelease(DataPool pool)
    {
        base.toRelease(pool);

        this.createData.release(pool);
        this.createData = null;
    }
Ejemplo n.º 2
0
    /// <summary>
    /// 创建实例
    /// </summary>
    public static FuncCreateRoleGroupRequest create(int funcID, CreateRoleGroupData createData)
    {
        FuncCreateRoleGroupRequest re = (FuncCreateRoleGroupRequest)BytesControl.createRequest(dataID);

        re.funcID     = funcID;
        re.createData = createData;
        return(re);
    }
Ejemplo n.º 3
0
    //--行为--//

    /** 创建玩家群 */
    public void createRoleGroup(CreateRoleGroupData data)
    {
        if (isRoleGroupFull())
        {
            me.warnLog("创建玩家群时,已达到数目限制");
            return;
        }

        if (_config.createCostID > 0 && !me.bag.hasCost(_config.createCostID))
        {
            me.warnLog("创建玩家群时,cost不满足");
            return;
        }

        if (!me.role.checkRoleConditions(_config.createConditions, true))
        {
            me.warnLog("创建玩家群时,condition不满足");
            return;
        }

        if (_config.nameCharLimit > 0 && StringUtils.getCharMachineNum(data.name) > _config.nameCharLimit)
        {
            me.warnLog("创建玩家群时,名字过长");
            return;
        }

        if (_config.noticeCharLimit > 0 && StringUtils.getCharMachineNum(data.notice) > _config.noticeCharLimit)
        {
            me.warnLog("创建玩家群时,公告过长");
            return;
        }

        //敏感字
        if (BaseGameUtils.hasSensitiveWord(data.name))
        {
            Ctrl.warnLog("创建玩家群时,名字敏感");
            GameC.info.showInfoCode(InfoCodeType.CreateRoleGroupFailed_nameIsSensitive);
            return;
        }

        //敏感字
        if (BaseGameUtils.hasSensitiveWord(data.notice))
        {
            Ctrl.warnLog("创建玩家群时,公告敏感");
            GameC.info.showInfoCode(InfoCodeType.CreateRoleGroupFailed_noticeIsSensitive);
            return;
        }

        if (!canCreateRoleGroupEx())
        {
            me.warnLog("创建玩家群时,ex不满足");
            return;
        }

        //发送
        me.send(FuncCreateRoleGroupRequest.create(_funcID, data));
    }
Ejemplo n.º 4
0
    /// <summary>
    /// 复制(潜拷贝)
    /// </summary>
    protected override void toShadowCopy(BaseData data)
    {
        if (!(data is CreateRoleGroupData))
        {
            return;
        }

        CreateRoleGroupData mData = (CreateRoleGroupData)data;

        this.name   = mData.name;
        this.notice = mData.notice;
    }
Ejemplo n.º 5
0
    protected override void copyData()
    {
        base.copyData();
        CreateRoleGroupData createDataTemp = createData;

        if (createDataTemp != null)
        {
            this.createData = (CreateRoleGroupData)createDataTemp.clone();
        }
        else
        {
            this.createData = null;
            nullObjError("createData");
        }
    }
Ejemplo n.º 6
0
    /// <summary>
    /// 是否数据一致
    /// </summary>
    protected override bool toDataEquals(BaseData data)
    {
        CreateRoleGroupData mData = (CreateRoleGroupData)data;

        if (this.name != mData.name)
        {
            return(false);
        }

        if (this.notice != mData.notice)
        {
            return(false);
        }

        return(true);
    }