public override void Deserialize(IoBuffer input, ISerializationContext context) { //ignoring the dbwrapper junk //byte 17 and 18 change without changing settings, perhaps a message id? input.Skip(37); this.Name = input.GetPascalVLCString(); this.Description = input.GetPascalVLCString(); this.Gender = input.Get() == 0x1 ? Gender.FEMALE : Gender.MALE; var skin = input.Get(); switch (skin) { default: case 0x00: SkinTone = SkinTone.LIGHT; break; case 0x01: SkinTone = SkinTone.MEDIUM; break; case 0x02: SkinTone = SkinTone.DARK; break; } this.HeadOutfitId = input.GetUInt32(); input.Skip(4); //Unknown this.BodyOutfitId = input.GetUInt32(); }
public override void Deserialize(IoBuffer input, ISerializationContext context) { AvatarId = input.GetUInt32(); ReplaceId = input.GetUInt32(); LotId = input.GetInt32(); Change = input.GetEnum <ChangeType>(); }
public override void Deserialize(IoBuffer input, ISerializationContext context) { NominationMode = input.GetBool(); int candCount = input.GetInt32(); Candidates = new List <NhoodCandidate>(); for (int i = 0; i < candCount; i++) { var candidate = new NhoodCandidate() { ID = input.GetUInt32(), Name = input.GetPascalVLCString(), Rating = input.GetUInt32() }; if (!NominationMode) { candidate.LastNhoodName = input.GetPascalVLCString(); candidate.LastNhoodID = input.GetUInt32(); candidate.TermNumber = input.GetUInt32(); candidate.Message = input.GetPascalVLCString(); } Candidates.Add(candidate); } }
public override void Deserialize(IoBuffer input, ISerializationContext context) { Type = input.GetEnum <ClaimType>(); Action = input.GetEnum <ClaimAction>(); EntityId = input.GetInt32(); ClaimId = input.GetUInt32(); SpecialId = input.GetUInt32(); FromOwner = input.GetPascalString(); }
public uint Value; //rate (stars), nomination_run (accept if >0) public override void Deserialize(IoBuffer input, ISerializationContext context) { Type = input.GetEnum <NhoodRequestType>(); TargetAvatar = input.GetUInt32(); TargetNHood = input.GetUInt32(); Message = input.GetPascalString(); Value = input.GetUInt32(); }
public void Deserialize(IoBuffer input, ISerializationContext context) { AvatarId = input.GetUInt32(); Unknown1 = input.GetUInt32(); //Reserved - 32 bytes of uninitialized memory (just like Heartbleed); equal to "BA AD F0 0D BA AD F0 0D ..." if you are running the game in a debugger input.Skip(32); Unknown2 = input.GetUInt32(); }
public override void Deserialize(IoBuffer input, ISerializationContext context) { FromType = input.GetEnum <UserReferenceType>(); From = input.GetUInt32(); To = input.GetUInt32(); Type = input.GetEnum <InstantMessageType>(); Message = input.GetPascalVLCString(); AckID = input.GetPascalVLCString(); Reason = input.GetEnum <InstantMessageFailureReason>(); }
public object Deserialize(uint clsid, IoBuffer input, ISerializationContext serializer) { var result = new List <uint>(); var count = input.GetUInt32(); for (int i = 0; i < count; i++) { result.Add(input.GetUInt32()); } return(ImmutableList.ToImmutableList(result)); }
public void Deserialize(IoBuffer input, ISerializationContext context) { outfit_id = input.GetUInt32(); asset_id = input.GetUInt64(); sale_price = input.GetInt32(); purchase_price = input.GetInt32(); owner_type = input.GetEnum <VMGLOutfitOwner>(); owner_id = input.GetUInt32(); outfit_type = input.Get(); outfit_source = input.GetEnum <VMGLOutfitSource>(); }
public object Deserialize(uint clsid, IoBuffer input, ISerializationContext serializer) { var result = new List <byte>(); var iclsid = input.GetUInt32(); var count = input.GetUInt32(); for (int i = 0; i < count; i++) { result.Add(input.Get()); } return(new cTSOGenericData(result.ToArray())); }
public object Deserialize(uint clsid, IoBuffer buffer, ISerializationContext serializer) { var result = new Dictionary <uint, bool>(); var count = buffer.GetUInt32(); for (int i = 0; i < count; i++) { var key = buffer.GetUInt32(); result.Add(key, buffer.Get() > 0); } return(result); }
public bool NeedsValidation => false; //the CAN POST items are one off requests, rather than a state machine. public override void Deserialize(IoBuffer input, ISerializationContext context) { Type = input.GetEnum <BulletinRequestType>(); TargetNHood = input.GetUInt32(); if (Type == BulletinRequestType.POST_MESSAGE || Type == BulletinRequestType.POST_SYSTEM_MESSAGE) { Title = input.GetPascalString(); Message = input.GetPascalString(); LotID = input.GetUInt32(); } Value = input.GetUInt32(); }
public override void Deserialize(IoBuffer input, ISerializationContext context) { this.SendingAvatarID = input.GetUInt32(); this.RequestTypeID = input.GetUInt32(); var bodySize = input.GetUInt32(); var bodyBytes = new byte[bodySize]; input.Get(bodyBytes, 0, (int)bodySize); this.Body = bodyBytes; var bodyBuffer = IoBuffer.Wrap(bodyBytes); var bodyType = bodyBuffer.GetUInt32(); this.Body = context.ModelSerializer.Deserialize(bodyType, bodyBuffer, context); }
public override void Deserialize(IoBuffer input, ISerializationContext context) { Status = input.GetEnum <PurchaseLotStatus>(); Reason = input.GetEnum <PurchaseLotFailureReason>(); NewLotId = input.GetUInt32(); NewFunds = input.GetInt32(); }
public override void Deserialize(IoBuffer input, ISerializationContext context) { StatusCode = input.GetUInt32(); ReasonText = input.GetPascalString(); //Room Info }
public override void Deserialize(IoBuffer input, ISerializationContext context) { SendingAvatarID = input.GetUInt32(); Sender = GetSender(input); Badge = input.Get(); IsAlertable = input.Get(); var bodySize = input.GetUInt32(); var bodyType = input.GetUInt32(); var bodyBytes = new byte[bodySize - 4]; input.Get(bodyBytes, 0, (int)bodySize - 4); var bodyBuffer = IoBuffer.Wrap(bodyBytes); this.Body = context.ModelSerializer.Deserialize(bodyType, bodyBuffer, context); }
public override void Deserialize(IoBuffer input, ISerializationContext context) { Status = input.GetEnum <FindLotResponseStatus>(); LotId = input.GetUInt32(); LotServerTicket = input.GetPascalVLCString(); Address = input.GetPascalVLCString(); User = input.GetPascalVLCString(); }
public override void Deserialize(IoBuffer input, ISerializationContext context) { Status = input.GetEnum <TransferClaimResponseStatus>(); Type = input.GetEnum <ClaimType>(); EntityId = input.GetInt32(); ClaimId = input.GetUInt32(); NewOwner = input.GetPascalString(); }
public void Deserialize(IoBuffer input, ISerializationContext context) { Unknown_1 = input.GetUInt32(); SendingAvatarID = input.GetUInt32(); var flagsByte = input.Get(); Flags = (cTSOParameterizedEntityFlags)flagsByte; MessageID = input.GetUInt32(); if ((Flags & cTSOParameterizedEntityFlags.HAS_DS_TYPE) == cTSOParameterizedEntityFlags.HAS_DS_TYPE) { DataServiceType = input.GetUInt32(); } else if ((Flags & cTSOParameterizedEntityFlags.HAS_DB_TYPE) == cTSOParameterizedEntityFlags.HAS_DB_TYPE) { DatabaseType = input.GetUInt32(); } if ((Flags & cTSOParameterizedEntityFlags.HAS_BASIC_PARAMETER) == cTSOParameterizedEntityFlags.HAS_BASIC_PARAMETER) { Parameter = input.GetUInt32(); } if ((Flags & cTSOParameterizedEntityFlags.UNKNOWN) == cTSOParameterizedEntityFlags.UNKNOWN) { Unknown_2 = input.GetUInt32(); } if ((Flags & cTSOParameterizedEntityFlags.HAS_COMPLEX_PARAMETER) == cTSOParameterizedEntityFlags.HAS_COMPLEX_PARAMETER) { uint typeId = DatabaseType.HasValue ? DatabaseType.Value : DataServiceType.Value; ComplexParameter = context.ModelSerializer.Deserialize(typeId, input, context); } }
public void Deserialize(IoBuffer input, ISerializationContext context) { Query = input.GetPascalVLCString(); Type = (SearchType)((byte)input.GetUInt32()); Unknown = input.GetUInt32(); Items = new List <SearchResponseItem>(); var count = input.GetUInt32(); for (int i = 0; i < count; i++) { var entityId = input.GetUInt32(); var entityLabel = input.GetPascalVLCString(); Items.Add(new SearchResponseItem { EntityId = entityId, Name = entityLabel }); } input.Skip(36); }
public object Deserialize(uint clsid, IoBuffer buffer, ISerializationContext serializer) { var result = new List <bool>(); var count = buffer.GetUInt32(); for (int i = 0; i < count; i++) { result.Add(buffer.Get() > 0); } return(ImmutableList.ToImmutableList(result)); }
public override void Deserialize(IoBuffer input, ISerializationContext context) { var length = input.GetUInt16(); PlayerIds = new List <uint>(); for (var i = 0; i < length; i++) { PlayerIds.Add(input.GetUInt32()); } }
public void Deserialize(IoBuffer input, ISerializationContext context) { var count = input.GetUInt32(); Items = new List <Top100Entry>((int)count); for (var i = 0; i < count; i++) { var item = new Top100Entry(); item.Rank = input.Get(); var hasValue = input.GetBool(); if (hasValue) { item.TargetId = input.GetUInt32(); item.TargetName = input.GetPascalVLCString(); } Items.Add(item); } }
private void ParseFormat1(IoBuffer buffer) { var unknown = buffer.GetUInt32(); var sendingAvatarId = buffer.GetUInt32(); var flags = (byte)buffer.Get(); var messageId = buffer.GetUInt32(); if ((((flags) >> 1) & 0x01) == 0x01) { var unknown2 = buffer.GetUInt32(); } if ((((flags) >> 2) & 0x01) == 0x01) { var parameter = new byte[4]; buffer.Get(parameter, 0, 4); } if ((((flags) >> 3) & 0x01) == 0x01) { var unknown3 = buffer.GetUInt32(); } if ((((flags) >> 5) & 0x01) == 0x01) { var requestResponseID = buffer.GetUInt32(); /** Variable bytes **/ } }
public override object Deserialize(uint clsid, IoBuffer input, ISerializationContext serializer) { //note: currently an array full with null values will just return null. object result = null; var count = input.GetUInt32(); int leadingNulls = 0; for (int i = 0; i < count; i++) { var property = new cTSOProperty(); property.Deserialize(input, serializer); //Convert to instance var item = ConvertFromProperty(property, serializer); if (item == null) { leadingNulls++; } else if (result == null) { //still need to make the list! var listType = typeof(ImmutableList); var consMethod = listType.GetMethods().Where(method => method.IsGenericMethod).FirstOrDefault(); if (consMethod == null) { Console.WriteLine("No Generic Methods!"); return(null); } else { var generic = consMethod.MakeGenericMethod(item.GetType()); if (generic == null) { Console.WriteLine("No Generic: " + item.GetType().ToString()); return(null); } result = generic.Invoke(null, new object[] { }); //listType.MakeGenericType(item.GetType()); } //result = Activator.CreateInstance(constructedListType); for (int j = 0; j < leadingNulls; j++) { result = result.GetType().GetMethod("Add").Invoke(result, new object[] { null }); } } if (result != null) { result = result.GetType().GetMethod("Add").Invoke(result, new object[] { item }); } } return(result); }
public void Deserialize(IoBuffer input, ISerializationContext context) { //Unknown input.GetUInt32(); StructType = input.GetUInt32(); StructFields = new List <cTSOPropertyField>(); var numFields = input.GetUInt32(); for (int i = 0; i < numFields; i++) { var fieldId = input.GetUInt32(); var typeId = input.GetUInt32(); var value = context.ModelSerializer.Deserialize(typeId, input, context); StructFields.Add(new cTSOPropertyField { StructFieldID = fieldId, Value = value }); } }
public RPCRequest(IoBuffer buffer) { var bodyType = buffer.GetUInt32(); switch (bodyType) { case 0x125194E5: ParseFormat1(buffer); break; default: throw new Exception("Unknown RPC request type"); } }
protected override bool DoDecode(IoSession session, IoBuffer buffer, IProtocolDecoderOutput output) { if (buffer.Remaining < 8) { return(false); } /** * We expect aries, voltron or electron packets */ var startPosition = buffer.Position; buffer.Order = ByteOrder.LittleEndian; uint packetType = buffer.GetUInt32(); //currently unused uint payloadSize = buffer.GetUInt32(); if (buffer.Remaining < payloadSize) { /** Not all here yet **/ buffer.Position = startPosition; return(false); } var type = (VMNetMessageType)buffer.Get(); var data = new List <byte>(); for (int i = 0; i < payloadSize - 1; i++) { data.Add(buffer.Get()); } var packet = new VMNetMessage(type, data.ToArray()); output.Write(packet); return(true); }
public override void Deserialize(IoBuffer input, ISerializationContext context) { Type = input.GetEnum <BulletinResponseType>(); var numMessages = input.GetInt32(); Messages = new BulletinItem[numMessages]; for (int j = 0; j < numMessages; j++) { var length = input.GetInt32(); var dat = new byte[length]; for (int i = 0; i < length; i++) { dat[i] = input.Get(); } using (var str = new MemoryStream(dat)) { Messages[j] = new BulletinItem(str); } } Message = input.GetPascalVLCString(); BanEndDate = input.GetUInt32(); }
private void DecodeVoltronStylePackets(IoBuffer buffer, ref uint payloadSize, IProtocolDecoderOutput output, Func <ushort, Type> typeResolver) { while (payloadSize > 0) { /** Voltron packet **/ buffer.Order = ByteOrder.BigEndian; ushort type = buffer.GetUInt16(); uint innerPayloadSize = buffer.GetUInt32() - 6; byte[] data = new byte[(int)innerPayloadSize]; buffer.Get(data, 0, (int)innerPayloadSize); var packetClass = typeResolver(type); if (packetClass != null) { IoBufferDeserializable packet = (IoBufferDeserializable)Activator.CreateInstance(packetClass); packet.Deserialize(IoBuffer.Wrap(data), Context); output.Write(packet); } payloadSize -= innerPayloadSize + 6; } }