diff --git a/Assets/Plugins/GameDevWare.Serialization/GenerateTypeSerializerAttribute.cs b/Assets/Plugins/GameDevWare.Serialization/GenerateTypeSerializerAttribute.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/IJsonReader.cs b/Assets/Plugins/GameDevWare.Serialization/IJsonReader.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/IJsonWriter.cs b/Assets/Plugins/GameDevWare.Serialization/IJsonWriter.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/IValueInfo.cs b/Assets/Plugins/GameDevWare.Serialization/IValueInfo.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/IndexedDictionary.cs b/Assets/Plugins/GameDevWare.Serialization/IndexedDictionary.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/Json.cs b/Assets/Plugins/GameDevWare.Serialization/Json.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/JsonMember.cs b/Assets/Plugins/GameDevWare.Serialization/JsonMember.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/JsonReader.cs b/Assets/Plugins/GameDevWare.Serialization/JsonReader.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/JsonReaderExtentions.cs b/Assets/Plugins/GameDevWare.Serialization/JsonReaderExtentions.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/JsonSerializationException.cs b/Assets/Plugins/GameDevWare.Serialization/JsonSerializationException.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/JsonStreamReader.cs b/Assets/Plugins/GameDevWare.Serialization/JsonStreamReader.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/JsonStreamWriter.cs b/Assets/Plugins/GameDevWare.Serialization/JsonStreamWriter.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/JsonStringBuilderReader.cs b/Assets/Plugins/GameDevWare.Serialization/JsonStringBuilderReader.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/JsonStringBuilderWriter.cs b/Assets/Plugins/GameDevWare.Serialization/JsonStringBuilderWriter.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/JsonStringReader.cs b/Assets/Plugins/GameDevWare.Serialization/JsonStringReader.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/JsonTextReader.cs b/Assets/Plugins/GameDevWare.Serialization/JsonTextReader.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/JsonTextWriter.cs b/Assets/Plugins/GameDevWare.Serialization/JsonTextWriter.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/JsonToken.cs b/Assets/Plugins/GameDevWare.Serialization/JsonToken.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/JsonUtils.cs b/Assets/Plugins/GameDevWare.Serialization/JsonUtils.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/JsonWriter.cs b/Assets/Plugins/GameDevWare.Serialization/JsonWriter.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/JsonWriterExtentions.cs b/Assets/Plugins/GameDevWare.Serialization/JsonWriterExtentions.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/MessagePack/BigEndianBitConverter.cs b/Assets/Plugins/GameDevWare.Serialization/MessagePack/BigEndianBitConverter.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/MessagePack/DefaultMsgPackExtensionTypeHandler.cs b/Assets/Plugins/GameDevWare.Serialization/MessagePack/DefaultMsgPackExtensionTypeHandler.cs old mode 100644 new mode 100755 index 00e4c689..8e198632 --- a/Assets/Plugins/GameDevWare.Serialization/MessagePack/DefaultMsgPackExtensionTypeHandler.cs +++ b/Assets/Plugins/GameDevWare.Serialization/MessagePack/DefaultMsgPackExtensionTypeHandler.cs @@ -92,11 +92,13 @@ public override bool TryRead(sbyte type, ArraySegment data, out object val return false; var buffer = data.Array; - var guidValue = new Guid - ( - this.bitConverter.ToUInt32(buffer, data.Offset), - this.bitConverter.ToUInt16(buffer, data.Offset + 4), - this.bitConverter.ToUInt16(buffer, data.Offset + 6), + unchecked + { + var guidValue = new Guid + ( + (uint)(buffer[data.Offset + 3] << 24 | buffer[data.Offset + 2] << 16 | buffer[data.Offset + 1] << 8 | buffer[data.Offset + 0]), + (ushort)(buffer[data.Offset + 5] << 8 | buffer[data.Offset + 4]), + (ushort)(buffer[data.Offset + 7] << 8 | buffer[data.Offset + 6]), buffer[data.Offset + 8], buffer[data.Offset + 9], buffer[data.Offset + 10], @@ -105,9 +107,11 @@ public override bool TryRead(sbyte type, ArraySegment data, out object val buffer[data.Offset + 13], buffer[data.Offset + 14], buffer[data.Offset + 15] - ); - value = guidValue; - return true; + ); + + value = guidValue; + return true; + } default: return false; } diff --git a/Assets/Plugins/GameDevWare.Serialization/MessagePack/EndianBitConverter.cs b/Assets/Plugins/GameDevWare.Serialization/MessagePack/EndianBitConverter.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/MessagePack/Endianness.cs b/Assets/Plugins/GameDevWare.Serialization/MessagePack/Endianness.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/MessagePack/LittleEndianBitConverter.cs b/Assets/Plugins/GameDevWare.Serialization/MessagePack/LittleEndianBitConverter.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/MessagePack/MsgPackExtensionType.cs b/Assets/Plugins/GameDevWare.Serialization/MessagePack/MsgPackExtensionType.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/MessagePack/MsgPackExtensionTypeHandler.cs b/Assets/Plugins/GameDevWare.Serialization/MessagePack/MsgPackExtensionTypeHandler.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/MessagePack/MsgPackReader.cs b/Assets/Plugins/GameDevWare.Serialization/MessagePack/MsgPackReader.cs old mode 100644 new mode 100755 index ad3d44f6..f25b1753 --- a/Assets/Plugins/GameDevWare.Serialization/MessagePack/MsgPackReader.cs +++ b/Assets/Plugins/GameDevWare.Serialization/MessagePack/MsgPackReader.cs @@ -260,15 +260,15 @@ public bool NextToken() this.closingTokens.Push(new ClosingToken { Token = JsonToken.EndOfObject, Counter = mapCount * 2 + 1 }); this.Value.SetValue(null, JsonToken.BeginObject, pos); } - else if (formatValue >= (byte)MsgPackType.NegativeFixIntStart && formatValue <= (byte)MsgPackType.NegativeFixIntEnd) + else if (formatValue >= (byte)MsgPackType.NegativeFixIntStart) { - var value = -(formatValue - (byte)MsgPackType.NegativeFixIntStart); - this.Value.SetValue((sbyte)value, JsonToken.Number, pos); + var value = unchecked((sbyte)formatValue); + this.Value.SetValue(value, JsonToken.Number, pos); } - else if (formatValue >= (byte)MsgPackType.PositiveFixIntStart && formatValue <= (byte)MsgPackType.PositiveFixIntEnd) + else if (formatValue <= (byte)MsgPackType.PositiveFixIntEnd) { - var value = formatValue - (byte)MsgPackType.PositiveFixIntStart; - this.Value.SetValue((byte)value, JsonToken.Number, pos); + var value = unchecked((byte)formatValue); + this.Value.SetValue(value, JsonToken.Number, pos); } else { @@ -421,7 +421,7 @@ public bool NextToken() break; case MsgPackType.Int8: this.ReadToBuffer(1, throwOnEos: true); - this.Value.SetValue((sbyte)this.buffer[this.bufferOffset], JsonToken.Number, pos); + this.Value.SetValue(unchecked((sbyte)this.buffer[this.bufferOffset]), JsonToken.Number, pos); break; case MsgPackType.Int16: this.ReadToBuffer(2, throwOnEos: true); diff --git a/Assets/Plugins/GameDevWare.Serialization/MessagePack/MsgPackTimestamp.cs b/Assets/Plugins/GameDevWare.Serialization/MessagePack/MsgPackTimestamp.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/MessagePack/MsgPackType.cs b/Assets/Plugins/GameDevWare.Serialization/MessagePack/MsgPackType.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/MessagePack/MsgPackWriter.cs b/Assets/Plugins/GameDevWare.Serialization/MessagePack/MsgPackWriter.cs old mode 100644 new mode 100755 index 8d097b88..e255ecb3 --- a/Assets/Plugins/GameDevWare.Serialization/MessagePack/MsgPackWriter.cs +++ b/Assets/Plugins/GameDevWare.Serialization/MessagePack/MsgPackWriter.cs @@ -109,16 +109,16 @@ public void Write(JsonMember value) public void Write(int number) { - if (number > -32 && number < 0) + if (number >= -32 && number < 0) { - var formatByte = (byte)((byte)Math.Abs(number) | (byte)MsgPackType.NegativeFixIntStart); + var formatByte = unchecked((byte)number); this.buffer[0] = formatByte; this.outputStream.Write(this.buffer, 0, 1); this.bytesWritten += 1; } else if (number >= 0 && number < 128) { - var formatByte = (byte)((byte)number | (byte)MsgPackType.PositiveFixIntStart); + var formatByte = unchecked((byte)number); this.buffer[0] = formatByte; this.outputStream.Write(this.buffer, 0, 1); this.bytesWritten += 1; @@ -126,14 +126,14 @@ public void Write(int number) else if (number <= sbyte.MaxValue && number >= sbyte.MinValue) { this.WriteType(MsgPackType.Int8); - this.buffer[0] = (byte)(sbyte)number; + this.buffer[0] = unchecked((byte)(sbyte)number); this.outputStream.Write(this.buffer, 0, 1); this.bytesWritten += 1; } else if (number <= short.MaxValue && number >= short.MinValue) { this.WriteType(MsgPackType.Int16); - this.bitConverter.CopyBytes((short)number, this.buffer, 0); + this.bitConverter.CopyBytes(checked((short)number), this.buffer, 0); this.outputStream.Write(this.buffer, 0, 2); this.bytesWritten += 2; } @@ -150,7 +150,7 @@ public void Write(uint number) { if (number < 128) { - var formatByte = (byte)((byte)number | (byte)MsgPackType.PositiveFixIntStart); + var formatByte = checked((byte)number); this.buffer[0] = formatByte; this.outputStream.Write(this.buffer, 0, 1); this.bytesWritten += 1; @@ -158,14 +158,14 @@ public void Write(uint number) else if (number <= byte.MaxValue) { this.WriteType(MsgPackType.UInt8); - this.buffer[0] = (byte)number; + this.buffer[0] = checked((byte)number); this.outputStream.Write(this.buffer, 0, 1); this.bytesWritten += 1; } else if (number <= ushort.MaxValue) { this.WriteType(MsgPackType.UInt16); - this.bitConverter.CopyBytes((ushort)number, this.buffer, 0); + this.bitConverter.CopyBytes(checked((ushort)number), this.buffer, 0); this.outputStream.Write(this.buffer, 0, 2); this.bytesWritten += 2; } @@ -182,7 +182,7 @@ public void Write(long number) { if (number <= int.MaxValue && number >= int.MinValue) { - this.Write((int)number); + this.Write(checked((int)number)); return; } @@ -196,7 +196,7 @@ public void Write(ulong number) { if (number <= uint.MaxValue) { - this.Write((uint)number); + this.Write(checked((uint)number)); return; } diff --git a/Assets/Plugins/GameDevWare.Serialization/MessagePack/UnknownMsgPackExtentionTypeException.cs b/Assets/Plugins/GameDevWare.Serialization/MessagePack/UnknownMsgPackExtentionTypeException.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/MessagePack/UnknownMsgPackFormatException.cs b/Assets/Plugins/GameDevWare.Serialization/MessagePack/UnknownMsgPackFormatException.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/Metadata/DataMemberDescription.cs b/Assets/Plugins/GameDevWare.Serialization/Metadata/DataMemberDescription.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/Metadata/FieldDescription.cs b/Assets/Plugins/GameDevWare.Serialization/Metadata/FieldDescription.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/Metadata/MemberDescription.cs b/Assets/Plugins/GameDevWare.Serialization/Metadata/MemberDescription.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/Metadata/PropertyDescription.cs b/Assets/Plugins/GameDevWare.Serialization/Metadata/PropertyDescription.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/Metadata/ReflectionUtils.cs b/Assets/Plugins/GameDevWare.Serialization/Metadata/ReflectionUtils.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/Metadata/TypeDescription.cs b/Assets/Plugins/GameDevWare.Serialization/Metadata/TypeDescription.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/MsgPack.cs b/Assets/Plugins/GameDevWare.Serialization/MsgPack.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/ReflectionExtentions.cs b/Assets/Plugins/GameDevWare.Serialization/ReflectionExtentions.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/SerializationContext.cs b/Assets/Plugins/GameDevWare.Serialization/SerializationContext.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/SerializationOptions.cs b/Assets/Plugins/GameDevWare.Serialization/SerializationOptions.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/Serializers/ArraySerializer.cs b/Assets/Plugins/GameDevWare.Serialization/Serializers/ArraySerializer.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/Serializers/BinarySerializer.cs b/Assets/Plugins/GameDevWare.Serialization/Serializers/BinarySerializer.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/Serializers/BoundsSerializer.cs b/Assets/Plugins/GameDevWare.Serialization/Serializers/BoundsSerializer.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/Serializers/DateTimeOffsetSerializer.cs b/Assets/Plugins/GameDevWare.Serialization/Serializers/DateTimeOffsetSerializer.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/Serializers/DateTimeSerializer.cs b/Assets/Plugins/GameDevWare.Serialization/Serializers/DateTimeSerializer.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/Serializers/DictionaryEntrySerializer.cs b/Assets/Plugins/GameDevWare.Serialization/Serializers/DictionaryEntrySerializer.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/Serializers/DictionarySerializer.cs b/Assets/Plugins/GameDevWare.Serialization/Serializers/DictionarySerializer.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/Serializers/EnumNumberSerializer.cs b/Assets/Plugins/GameDevWare.Serialization/Serializers/EnumNumberSerializer.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/Serializers/EnumSerializer.cs b/Assets/Plugins/GameDevWare.Serialization/Serializers/EnumSerializer.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/Serializers/GuidSerializer.cs b/Assets/Plugins/GameDevWare.Serialization/Serializers/GuidSerializer.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/Serializers/Matrix4x4Serializer.cs b/Assets/Plugins/GameDevWare.Serialization/Serializers/Matrix4x4Serializer.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/Serializers/MsgPackExtensionTypeSerializer.cs b/Assets/Plugins/GameDevWare.Serialization/Serializers/MsgPackExtensionTypeSerializer.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/Serializers/MsgPackTimestampSerializer.cs b/Assets/Plugins/GameDevWare.Serialization/Serializers/MsgPackTimestampSerializer.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/Serializers/ObjectSerializer.cs b/Assets/Plugins/GameDevWare.Serialization/Serializers/ObjectSerializer.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/Serializers/PrimitiveTypeSerializer.cs b/Assets/Plugins/GameDevWare.Serialization/Serializers/PrimitiveTypeSerializer.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/Serializers/QuaternionSerializer.cs b/Assets/Plugins/GameDevWare.Serialization/Serializers/QuaternionSerializer.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/Serializers/RectSerializer.cs b/Assets/Plugins/GameDevWare.Serialization/Serializers/RectSerializer.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/Serializers/StreamSerializer.cs b/Assets/Plugins/GameDevWare.Serialization/Serializers/StreamSerializer.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/Serializers/TimeSpanSerializer.cs b/Assets/Plugins/GameDevWare.Serialization/Serializers/TimeSpanSerializer.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/Serializers/UriSerializer.cs b/Assets/Plugins/GameDevWare.Serialization/Serializers/UriSerializer.cs old mode 100644 new mode 100755 index 8caa5aba..4c48ec46 --- a/Assets/Plugins/GameDevWare.Serialization/Serializers/UriSerializer.cs +++ b/Assets/Plugins/GameDevWare.Serialization/Serializers/UriSerializer.cs @@ -1,4 +1,4 @@ -/* +/* Copyright (c) 2016 Denis Zykov, GameDevWare.com This a part of "Json & MessagePack Serialization" Unity Asset - https://www.assetstore.unity3d.com/#!/content/59918 @@ -37,7 +37,7 @@ public override void Serialize(IJsonWriter writer, object value) if (value == null) throw new ArgumentNullException("value"); var uri = (Uri)value; - writer.WriteString(uri.ToString()); + writer.WriteString(uri.OriginalString); } } } diff --git a/Assets/Plugins/GameDevWare.Serialization/Serializers/Vector2Serializer.cs b/Assets/Plugins/GameDevWare.Serialization/Serializers/Vector2Serializer.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/Serializers/Vector3Serializer.cs b/Assets/Plugins/GameDevWare.Serialization/Serializers/Vector3Serializer.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/Serializers/Vector4Serializer.cs b/Assets/Plugins/GameDevWare.Serialization/Serializers/Vector4Serializer.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/Serializers/VersionSerializer.cs b/Assets/Plugins/GameDevWare.Serialization/Serializers/VersionSerializer.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/TypeSerializer.cs b/Assets/Plugins/GameDevWare.Serialization/TypeSerializer.cs old mode 100644 new mode 100755 diff --git a/Assets/Plugins/GameDevWare.Serialization/TypeSerializerAttribute.cs b/Assets/Plugins/GameDevWare.Serialization/TypeSerializerAttribute.cs old mode 100644 new mode 100755