Exemplo n.º 1
0
 /// <summary>
 /// 回池
 /// </summary>
 protected override void toRelease(DataPool pool)
 {
     this.playerID   = 0L;
     this.socialData = null;
     this.title      = 0;
     this.joinTime   = 0L;
 }
Exemplo n.º 2
0
    /// <summary>
    /// 复制(深拷贝)
    /// </summary>
    protected override void toCopy(BaseData data)
    {
        if (!(data is RoleSocialData))
        {
            return;
        }

        RoleSocialData mData = (RoleSocialData)data;

        if (mData.showData != null)
        {
            this.showData = (RoleShowData)mData.showData.clone();
        }
        else
        {
            this.showData = null;
            nullObjError("showData");
        }

        this.isOnline = mData.isOnline;

        this.lastOnlineTime = mData.lastOnlineTime;

        if (mData.location != null)
        {
            this.location = (SceneLocationData)mData.location.clone();
        }
        else
        {
            this.location = null;
        }
    }
Exemplo n.º 3
0
    /// <summary>
    /// 复制(深拷贝)
    /// </summary>
    protected override void toCopy(BaseData data)
    {
        if (!(data is RoleGroupMemberData))
        {
            return;
        }

        RoleGroupMemberData mData = (RoleGroupMemberData)data;

        this.playerID = mData.playerID;

        if (mData.socialData != null)
        {
            this.socialData = (RoleSocialData)mData.socialData.clone();
        }
        else
        {
            this.socialData = null;
            nullObjError("socialData");
        }

        this.title = mData.title;

        this.joinTime = mData.joinTime;
    }
Exemplo n.º 4
0
    /// <summary>
    /// 复制(深拷贝)
    /// </summary>
    protected override void toCopy(BaseData data)
    {
        if (!(data is ApplyAddFriendData))
        {
            return;
        }

        ApplyAddFriendData mData = (ApplyAddFriendData)data;

        this.playerID = mData.playerID;

        if (mData.data != null)
        {
            this.data = (RoleSocialData)mData.data.clone();
        }
        else
        {
            this.data = null;
            nullObjError("data");
        }

        this.applyTime = mData.applyTime;

        this.type = mData.type;
    }
Exemplo n.º 5
0
 /// <summary>
 /// 回池
 /// </summary>
 protected override void toRelease(DataPool pool)
 {
     this.playerID  = 0L;
     this.data      = null;
     this.applyTime = 0L;
     this.type      = 0;
 }
Exemplo n.º 6
0
    /// <summary>
    /// 读取字节流(完整版)
    /// </summary>
    protected override void toReadBytesFull(BytesReadStream stream)
    {
        stream.startReadObj();

        BaseData dataT = stream.readDataFullNotNull();

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

        this.inTime = stream.readLong();

        stream.endReadObj();
    }
Exemplo n.º 7
0
    /// <summary>
    /// 创建角色社交数据
    /// </summary>
    public RoleSocialData createRoleSocialData()
    {
        RoleSocialData re = GameC.factory.createRoleSocialData();

        makeRoleSocialData(re);
        return(re);
    }
Exemplo n.º 8
0
    /// <summary>
    /// 读取字节流(简版)
    /// </summary>
    protected override void toReadBytesSimple(BytesReadStream stream)
    {
        this.playerID = stream.readLong();

        this.socialData = (RoleSocialData)stream.readDataSimpleNotNull();

        this.title = stream.readInt();
    }
Exemplo n.º 9
0
    /// <summary>
    /// 是否数据一致
    /// </summary>
    protected override bool toDataEquals(BaseData data)
    {
        RoleSocialData mData = (RoleSocialData)data;

        if (mData.showData != null)
        {
            if (this.showData == null)
            {
                return(false);
            }
            if (!this.showData.dataEquals(mData.showData))
            {
                return(false);
            }
        }
        else
        {
            if (this.showData != null)
            {
                return(false);
            }
        }

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

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

        if (mData.location != null)
        {
            if (this.location == null)
            {
                return(false);
            }
            if (!this.location.dataEquals(mData.location))
            {
                return(false);
            }
        }
        else
        {
            if (this.location != null)
            {
                return(false);
            }
        }

        return(true);
    }
Exemplo n.º 10
0
    /// <summary>
    /// 复制(潜拷贝)
    /// </summary>
    protected override void toShadowCopy(BaseData data)
    {
        if (!(data is RoleSocialPoolData))
        {
            return;
        }

        RoleSocialPoolData mData = (RoleSocialPoolData)data;

        this.data   = mData.data;
        this.inTime = mData.inTime;
    }
Exemplo n.º 11
0
    /// <summary>
    /// 复制(潜拷贝)
    /// </summary>
    protected override void toShadowCopy(BaseData data)
    {
        if (!(data is ContactData))
        {
            return;
        }

        ContactData mData = (ContactData)data;

        this.playerID = mData.playerID;
        this.data     = mData.data;
    }
Exemplo n.º 12
0
    /// <summary>
    /// 复制(潜拷贝)
    /// </summary>
    protected override void toShadowCopy(BaseData data)
    {
        if (!(data is PlayerApplyRoleGroupData))
        {
            return;
        }

        PlayerApplyRoleGroupData mData = (PlayerApplyRoleGroupData)data;

        this.data = mData.data;
        this.time = mData.time;
    }
    /// <summary>
    /// 转文本输出
    /// </summary>
    protected override void toWriteDataString(DataWriter writer)
    {
        base.toWriteDataString(writer);

        writer.writeTabs();
        writer.sb.Append("dic");
        writer.sb.Append(':');
        writer.sb.Append("Map<long,RoleSocialData>");
        if (this.dic != null)
        {
            writer.sb.Append('(');
            writer.sb.Append(this.dic.size());
            writer.sb.Append(')');
            writer.writeEnter();
            writer.writeLeftBrace();
            if (!this.dic.isEmpty())
            {
                long             dicKFreeValue = this.dic.getFreeValue();
                long[]           dicKKeys      = this.dic.getKeys();
                RoleSocialData[] dicVValues    = this.dic.getValues();
                for (int dicKI = dicKKeys.Length - 1; dicKI >= 0; --dicKI)
                {
                    long dicK = dicKKeys[dicKI];
                    if (dicK != dicKFreeValue)
                    {
                        RoleSocialData dicV = dicVValues[dicKI];
                        writer.writeTabs();
                        writer.sb.Append(dicK);

                        writer.sb.Append(':');
                        if (dicV != null)
                        {
                            dicV.writeDataString(writer);
                        }
                        else
                        {
                            writer.sb.Append("RoleSocialData=null");
                        }

                        writer.writeEnter();
                    }
                }
            }
            writer.writeRightBrace();
        }
        else
        {
            writer.sb.Append("=null");
        }

        writer.writeEnter();
    }
Exemplo n.º 14
0
    /// <summary>
    /// 复制(潜拷贝)
    /// </summary>
    protected override void toShadowCopy(BaseData data)
    {
        if (!(data is PlayerRoleGroupMemberData))
        {
            return;
        }

        PlayerRoleGroupMemberData mData = (PlayerRoleGroupMemberData)data;

        this.playerID   = mData.playerID;
        this.socialData = mData.socialData;
        this.title      = mData.title;
    }
Exemplo n.º 15
0
    /// <summary>
    /// 复制(潜拷贝)
    /// </summary>
    protected override void toShadowCopy(BaseData data)
    {
        if (!(data is ApplyAddFriendData))
        {
            return;
        }

        ApplyAddFriendData mData = (ApplyAddFriendData)data;

        this.playerID  = mData.playerID;
        this.data      = mData.data;
        this.applyTime = mData.applyTime;
        this.type      = mData.type;
    }
    /// <summary>
    /// 读取字节流(完整版)
    /// </summary>
    protected override void toReadBytesFull(BytesReadStream stream)
    {
        base.toReadBytesFull(stream);

        stream.startReadObj();

        int dicLen = stream.readLen();

        if (this.dic != null)
        {
            this.dic.clear();
            this.dic.ensureCapacity(dicLen);
        }
        else
        {
            this.dic = new LongObjectMap <RoleSocialData>(dicLen);
        }

        LongObjectMap <RoleSocialData> dicT = this.dic;

        for (int dicI = dicLen - 1; dicI >= 0; --dicI)
        {
            RoleSocialData dicV;
            BaseData       dicVT = stream.readDataFullNotNull();
            if (dicVT != null)
            {
                if (dicVT is RoleSocialData)
                {
                    dicV = (RoleSocialData)dicVT;
                }
                else
                {
                    dicV = new RoleSocialData();
                    if (!(dicVT.GetType().IsAssignableFrom(typeof(RoleSocialData))))
                    {
                        stream.throwTypeReadError(typeof(RoleSocialData), dicVT.GetType());
                    }
                    dicV.shadowCopy(dicVT);
                }
            }
            else
            {
                dicV = null;
            }

            dicT.put(dicV.showData.playerID, dicV);
        }

        stream.endReadObj();
    }
Exemplo n.º 17
0
    /// <summary>
    /// 复制(潜拷贝)
    /// </summary>
    protected override void toShadowCopy(BaseData data)
    {
        if (!(data is RoleSocialData))
        {
            return;
        }

        RoleSocialData mData = (RoleSocialData)data;

        this.showData       = mData.showData;
        this.isOnline       = mData.isOnline;
        this.lastOnlineTime = mData.lastOnlineTime;
        this.location       = mData.location;
    }
Exemplo n.º 18
0
    /// <summary>
    /// 构造角色自身社交数据
    /// </summary>
    public void makeRoleSocialData(RoleSocialData data)
    {
        if (data.showData != null)
        {
            me.role.makeRoleShowData(data.showData);
        }
        else
        {
            data.showData = me.role.createRoleShowData();
        }

        data.isOnline       = true;//在线
        data.lastOnlineTime = me.getTimeMillis();
    }
Exemplo n.º 19
0
    /// <summary>
    /// 添加角色社交数据
    /// </summary>
    public RoleSocialData addPlayerRoleSocial(long playerID, RoleSocialData data)
    {
        RoleSocialData oldData;

        if ((oldData = _roleSocialDic.get(playerID)) != null)
        {
            oldData.copy(data);
            return(oldData);
        }
        else
        {
            _roleSocialDic.put(playerID, data);
            return(data);
        }
    }
Exemplo n.º 20
0
    /// <summary>
    /// 复制(深拷贝)
    /// </summary>
    protected override void toCopy(BaseData data)
    {
        if (!(data is RoleSocialPoolData))
        {
            return;
        }

        RoleSocialPoolData mData = (RoleSocialPoolData)data;

        if (mData.data != null)
        {
            this.data = (RoleSocialData)mData.data.clone();
        }
        else
        {
            this.data = null;
            nullObjError("data");
        }

        this.inTime = mData.inTime;
    }
Exemplo n.º 21
0
    /// <summary>
    /// 复制(深拷贝)
    /// </summary>
    protected override void toCopy(BaseData data)
    {
        if (!(data is ContactData))
        {
            return;
        }

        ContactData mData = (ContactData)data;

        this.playerID = mData.playerID;

        if (mData.data != null)
        {
            this.data = (RoleSocialData)mData.data.clone();
        }
        else
        {
            this.data = null;
            nullObjError("data");
        }
    }
Exemplo n.º 22
0
    /// <summary>
    /// 复制(深拷贝)
    /// </summary>
    protected override void toCopy(BaseData data)
    {
        if (!(data is PlayerApplyRoleGroupData))
        {
            return;
        }

        PlayerApplyRoleGroupData mData = (PlayerApplyRoleGroupData)data;

        if (mData.data != null)
        {
            this.data = (RoleSocialData)mData.data.clone();
        }
        else
        {
            this.data = null;
            nullObjError("data");
        }

        this.time = mData.time;
    }
Exemplo n.º 23
0
    /// <summary>
    /// 读取字节流(简版)
    /// </summary>
    protected override void toReadBytesSimple(BytesReadStream stream)
    {
        this.data = (RoleSocialData)stream.readDataSimpleNotNull();

        this.inTime = stream.readLong();
    }
Exemplo n.º 24
0
 /// <summary>
 /// 回池
 /// </summary>
 protected override void toRelease(DataPool pool)
 {
     this.data   = null;
     this.inTime = 0L;
 }
Exemplo n.º 25
0
 /// <summary>
 /// 初始化初值
 /// </summary>
 public override void initDefault()
 {
     this.data = new RoleSocialData();
     this.data.initDefault();
 }
    /// <summary>
    /// 读取字节流(简版)
    /// </summary>
    protected override void toReadBytesSimple(BytesReadStream stream)
    {
        base.toReadBytesSimple(stream);

        this.data = (RoleSocialData)stream.readDataSimpleNotNull();
    }
Exemplo n.º 27
0
 /// <summary>
 /// 回池
 /// </summary>
 protected override void toRelease(DataPool pool)
 {
     this.playerID = 0L;
     this.data     = null;
 }
Exemplo n.º 28
0
    /// <summary>
    /// 更新社交数据单个返回
    /// </summary>
    public void onUpdateRoleSocialDataOne(RoleSocialData data)
    {
        addPlayerRoleSocial(data.showData.playerID, data);

        me.dispatch(GameEventType.UpdateSocialData);
    }
    /// <summary>
    /// 回池
    /// </summary>
    protected override void toRelease(DataPool pool)
    {
        base.toRelease(pool);

        this.data = null;
    }