protected sealed override void Load(LogicJSONObject jsonObject) { LogicJSONArray ownerIdArray = jsonObject.GetJSONArray(StreamDocument.JSON_ATTRIBUTE_OWNER_ID); this.OwnerId = new LogicLong(ownerIdArray.GetJSONNumber(0).GetIntValue(), ownerIdArray.GetJSONNumber(1).GetIntValue()); this.CreateTime = DateTime.Parse(jsonObject.GetJSONString(StreamDocument.JSON_ATTRIBUTE_CREATE_TIME).GetStringValue()); this.Type = (StreamType)jsonObject.GetJSONNumber(StreamDocument.JSON_ATTRIBUTE_TYPE).GetIntValue(); switch (this.Type) { case StreamType.ALLIANCE: { StreamEntry entry = StreamEntryFactory.CreateStreamEntryByType((StreamEntryType)jsonObject.GetJSONNumber(StreamDocument.JSON_ATTRIBUTE_ENTRY_TYPE).GetIntValue()); entry.Load(jsonObject.GetJSONObject(StreamDocument.JSON_ATTRIBUTE_ENTRY)); entry.SetId(this.Id); this.Entry = entry; break; } case StreamType.AVATAR: { AvatarStreamEntry entry = AvatarStreamEntryFactory.CreateStreamEntryByType((AvatarStreamEntryType)jsonObject.GetJSONNumber(StreamDocument.JSON_ATTRIBUTE_ENTRY_TYPE).GetIntValue()); entry.Load(jsonObject.GetJSONObject(StreamDocument.JSON_ATTRIBUTE_ENTRY)); entry.SetId(this.Id); this.Entry = entry; break; } case StreamType.REPLAY: { ReplayStreamEntry entry = new ReplayStreamEntry(); entry.Load(jsonObject.GetJSONObject(StreamDocument.JSON_ATTRIBUTE_ENTRY)); this.Entry = entry; break; } } }
public void SetAvatarStreamEntry(AvatarStreamEntry entry) { this.m_vAvatarStreamEntry = entry; }
/// <summary> /// Initializes a new instance of the <see cref="Avatar_Stream_Removed_Message"/> class. /// </summary> /// <param name="Device">The device.</param> public Avatar_Stream_Removed_Message(Device Device, AvatarStreamEntry StreamEntry) : base(Device) { this.StreamEntry = StreamEntry; }
public static void Save(AvatarStreamEntry entry) { StreamDocument document = StreamManager.m_avatarStreams[entry.GetId()]; ServerStream.StreamDatabase.InsertOrUpdate(document.Id, CouchbaseDocument.Save(document)); }
public override void Decode(ByteStream stream) { this.Entry = AvatarStreamEntryFactory.CreateStreamEntryByType((AvatarStreamEntryType)stream.ReadVInt()); this.Entry.Decode(stream); }
/// <summary> /// Sets the <see cref="AvatarStreamEntry"/> instance. /// </summary> public void SetAvatarChangeEntry(AvatarStreamEntry entry) { this._entry = entry; }
/// <summary> /// Decodes this instance. /// </summary> public override void Decode() { base.Decode(); this._entry = AvatarStreamEntryFactory.CreateStreamEntryByType(this.Stream.ReadVInt()); this._entry.Decode(this.Stream); }
/// <summary> /// Destructs this instance. /// </summary> public override void Destruct() { base.Destruct(); this._entry = null; }