/// <summary>
    /// 读取字节流(完整版)
    /// </summary>
    protected override void toReadBytesFull(BytesReadStream stream)
    {
        base.toReadBytesFull(stream);

        stream.startReadObj();

        BaseData dataT = stream.readDataFullNotNull();

        if (dataT != null)
        {
            if (dataT is RoleShowChangeData)
            {
                this.data = (RoleShowChangeData)dataT;
            }
            else
            {
                this.data = new RoleShowChangeData();
                if (!(dataT.GetType().IsAssignableFrom(typeof(RoleShowChangeData))))
                {
                    stream.throwTypeReadError(typeof(RoleShowChangeData), dataT.GetType());
                }
                this.data.shadowCopy(dataT);
            }
        }
        else
        {
            this.data = null;
        }

        stream.endReadObj();
    }
Beispiel #2
0
    /// <summary>
    /// 是否数据一致
    /// </summary>
    protected override bool toDataEquals(BaseData data)
    {
        RoleShowChangeData mData = (RoleShowChangeData)data;

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

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

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

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

        return(true);
    }
Beispiel #3
0
    /// <summary>
    /// 改变
    /// </summary>
    public virtual void onChange(RoleShowChangeData data)
    {
        switch (data.type)
        {
        case RoleShowDataPartType.IsOnline:
        {
            this.isOnline = (data.arg0 == 1);
            //同时赋值两个
            this.lastOnlineTime = data.arg2;
        }
        break;

        case RoleShowDataPartType.LastOnlineTime:
        {
            this.lastOnlineTime = data.arg2;
        }
        break;

        case RoleShowDataPartType.Location:
        {
            this.location = ((SceneLocationRoleShowChangeData)data).localtion;
        }
        break;

        default:
        {
            //传递
            showData.onChange(data);
        }
        break;
        }
    }
Beispiel #4
0
    /** 刷新角色外显数据 */
    public void onRefreshRoleShowData(RoleShowChangeData data)
    {
        switch (data.type)
        {
        case RoleShowDataPartType.Name:
        {
            _unit.head?.onRefreshRoleName();
        }
        break;

        case RoleShowDataPartType.Sex:
        {
            //				_unit.head.onRefreshRoleName();
        }
        break;

        case RoleShowDataPartType.Vocation:
        {
            //				_unit.head.onRefreshRoleName();
        }
        break;

        case RoleShowDataPartType.Level:
        {
            //其他单位升级特效(目前暂时不考虑降级的情况)
        }
        break;
        }
    }
    /// <summary>
    /// 回池
    /// </summary>
    protected override void toRelease(DataPool pool)
    {
        base.toRelease(pool);

        this.memberID = 0L;
        this.data     = null;
    }
    /// <summary>
    /// 读取字节流(简版)
    /// </summary>
    protected override void toReadBytesSimple(BytesReadStream stream)
    {
        base.toReadBytesSimple(stream);

        this.memberID = stream.readLong();

        this.data = (RoleShowChangeData)stream.readDataSimpleNotNull();
    }
Beispiel #7
0
    /// <summary>
    /// 刷新部分外显数据(String)
    /// </summary>
    public void refreshPartRoleShowData(int type, string value)
    {
        RoleShowChangeData data = new RoleShowChangeData();

        data.type = type;
        data.arg1 = value;

        refreshPartRoleShowData(data);
    }
Beispiel #8
0
    /// <summary>
    /// 改变
    /// </summary>
    public virtual void onChange(RoleShowChangeData data)
    {
        switch (data.type)
        {
        case RoleShowDataPartType.Name:
        {
            this.name = data.arg1;
            return;
        }

        case RoleShowDataPartType.Sex:
        {
            this.sex = data.arg0;
            return;
        }

        case RoleShowDataPartType.Vocation:
        {
            this.vocation = data.arg0;
            return;
        }

        case RoleShowDataPartType.Level:
        {
            this.level = data.arg0;
            return;
        }

        case RoleShowDataPartType.FightForce:
        {
            this.fightForce = data.arg2;
            return;
        }

        case RoleShowDataPartType.IsOnline:
        case RoleShowDataPartType.LastOnlineTime:
        {
            return;
        }

        case RoleShowDataPartType.Union:
        {
            this.unionID   = data.arg2;
            this.unionName = data.arg1;
            return;
        }

        default:
        {
            Ctrl.throwError("未处理的ShowDataPartType类型:" + data.type);
        }
        break;
        }
    }
Beispiel #9
0
    /// <summary>
    /// 复制(潜拷贝)
    /// </summary>
    protected override void toShadowCopy(BaseData data)
    {
        if (!(data is RoleShowChangeData))
        {
            return;
        }

        RoleShowChangeData mData = (RoleShowChangeData)data;

        this.type = mData.type;
        this.arg0 = mData.arg0;
        this.arg1 = mData.arg1;
        this.arg2 = mData.arg2;
    }
Beispiel #10
0
    /** 成员外显数据变化 */
    public void onMemberRoleShowChange(long memberID, RoleShowChangeData data)
    {
        PlayerRoleGroupMemberData member = getMember(memberID);

        if (member != null)
        {
            member.socialData.onChange(data);

            evt.groupID  = groupID;
            evt.targetID = memberID;
            evt.type     = data.type;
            me.dispatch(GameEventType.ChangeRoleGroupMemberRoleShowData, evt);
        }
    }
Beispiel #11
0
        public override void onChange(RoleShowChangeData data)
        {
            if (!_g15)
            {
                _m15 = instance.Type.GetMethod("onChange", 1);
                _g15 = true;
            }

            if (_m15 != null && !_b15)
            {
                _b15   = true;
                _p1[0] = data;
                appdomain.Invoke(_m15, instance, _p1);
                _p1[0] = null;
                _b15   = false;
            }
            else
            {
                base.onChange(data);
            }
        }
Beispiel #12
0
    /// <summary>
    /// 刷新部分外显数据
    /// </summary>
    public void refreshPartRoleShowData(RoleShowChangeData data)
    {
        //先改自己的
        _selfRoleShowData.onChange(data);

        Scene scene = GameC.scene.getScene();

        //场景部分
        Unit unit;

        if (scene != null && (unit = scene.hero) != null)
        {
            //非社交部分
            if (!RoleShowDataPartTypeConfig.get(data.type).isSocialPart)
            {
                RoleShowData roleShowData = unit.getUnitData().getCharacterIdentity().roleShowData;

                roleShowData.onChange(data);
            }
        }

        //社交部分
        // me.social.refreshRoleSocialData(data);
    }