/// <summary> /// 回池 /// </summary> protected override void toRelease(DataPool pool) { this.playerID = 0L; this.socialData = null; this.title = 0; this.joinTime = 0L; }
/// <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; } }
/// <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; }
/// <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; }
/// <summary> /// 回池 /// </summary> protected override void toRelease(DataPool pool) { this.playerID = 0L; this.data = null; this.applyTime = 0L; this.type = 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(); }
/// <summary> /// 创建角色社交数据 /// </summary> public RoleSocialData createRoleSocialData() { RoleSocialData re = GameC.factory.createRoleSocialData(); makeRoleSocialData(re); return(re); }
/// <summary> /// 读取字节流(简版) /// </summary> protected override void toReadBytesSimple(BytesReadStream stream) { this.playerID = stream.readLong(); this.socialData = (RoleSocialData)stream.readDataSimpleNotNull(); this.title = stream.readInt(); }
/// <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); }
/// <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; }
/// <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; }
/// <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(); }
/// <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; }
/// <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(); }
/// <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; }
/// <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(); }
/// <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); } }
/// <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; }
/// <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"); } }
/// <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; }
/// <summary> /// 读取字节流(简版) /// </summary> protected override void toReadBytesSimple(BytesReadStream stream) { this.data = (RoleSocialData)stream.readDataSimpleNotNull(); this.inTime = stream.readLong(); }
/// <summary> /// 回池 /// </summary> protected override void toRelease(DataPool pool) { this.data = null; this.inTime = 0L; }
/// <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(); }
/// <summary> /// 回池 /// </summary> protected override void toRelease(DataPool pool) { this.playerID = 0L; this.data = null; }
/// <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; }