frankvHoof93 / TikTokLiveSharp

Port of TikTok live library for C#
https://vanhoof.dev
Other
140 stars 28 forks source link

Getting Invalid wire-type on the sample in unity #10

Closed yogev2255 closed 1 year ago

yogev2255 commented 1 year ago

Hey, I have the newest version in unity and it will stop working when there is a lot of users it will stop the updates and then I am receiving this error

ProtoException: Invalid wire-type; this usually means you have over-written a file without truncating or setting the length; see https://stackoverflow.com/q/2152978/23354 ProtoBuf.ProtoReader.ReadUInt32 () (at C:/Code/pb-net_24/src/protobuf-net/ProtoReader.cs:232) (wrapper dynamic-method) TikTokLiveSharp.Models.Protobuf.Messages.RankContainer.proto_116(object,ProtoBuf.ProtoReader) ProtoBuf.Serializers.CompiledSerializer.ProtoBuf.Serializers.IProtoSerializer.Read (System.Object value, ProtoBuf.ProtoReader source) (at C:/Code/pb-net_24/src/protobuf-net/Serializers/CompiledSerializer.cs:64) ProtoBuf.Meta.RuntimeTypeModel.Deserialize (System.Int32 key, System.Object value, ProtoBuf.ProtoReader source) (at C:/Code/pb-net_24/src/protobuf-net/Meta/RuntimeTypeModel.cs:826) ProtoBuf.ProtoReader.ReadTypedObject (System.Object value, System.Int32 key, ProtoBuf.ProtoReader reader, System.Type type) (at C:/Code/pb-net_24/src/protobuf-net/ProtoReader.cs:582) ProtoBuf.ProtoReader.ReadObject (System.Object value, System.Int32 key, ProtoBuf.ProtoReader reader) (at C:/Code/pb-net_24/src/protobuf-net/ProtoReader.cs:570) (wrapper dynamic-method) TikTokLiveSharp.Models.Protobuf.Messages.WebcastHourlyRankMessage.proto_114(object,ProtoBuf.ProtoReader) ProtoBuf.Serializers.CompiledSerializer.ProtoBuf.Serializers.IProtoSerializer.Read (System.Object value, ProtoBuf.ProtoReader source) (at C:/Code/pb-net_24/src/protobuf-net/Serializers/CompiledSerializer.cs:64) ProtoBuf.Meta.RuntimeTypeModel.Deserialize (System.Int32 key, System.Object value, ProtoBuf.ProtoReader source) (at C:/Code/pb-net_24/src/protobuf-net/Meta/RuntimeTypeModel.cs:826) ProtoBuf.Meta.TypeModel.DeserializeCore (ProtoBuf.ProtoReader reader, System.Type type, System.Object value, System.Boolean noAutoCreate) (at C:/Code/pb-net_24/src/protobuf-net/Meta/TypeModel.cs:718) ProtoBuf.Meta.TypeModel.Deserialize (System.IO.Stream source, System.Object value, System.Type type, ProtoBuf.SerializationContext context) (at C:/Code/pb-net_24/src/protobuf-net/Meta/TypeModel.cs:591) ProtoBuf.Meta.TypeModel.Deserialize (System.IO.Stream source, System.Object value, System.Type type) (at C:/Code/pb-net_24/src/protobuf-net/Meta/TypeModel.cs:570) ProtoBuf.Serializer.Deserialize[T] (System.IO.Stream source) (at C:/Code/pb-net_24/src/protobuf-net/Serializer.cs:68) TikTokLiveSharp.Client.TikTokLiveClient.HandleMessage (TikTokLiveSharp.Models.Protobuf.Messages.Generic.Message message) (at Library/PackageCache/dev.vanhoof.tiktokliveunity@8bea4848ae/TikTokLiveSharp/Client/TikTokLiveClient.cs:605) TikTokLiveSharp.Client.TikTokLiveClient.HandleWebcastMessages (TikTokLiveSharp.Models.Protobuf.Messages.Generic.WebcastResponse webcastResponse) (at Library/PackageCache/dev.vanhoof.tiktokliveunity@8bea4848ae/TikTokLiveSharp/Client/TikTokLiveClient.cs:301) Rethrow as WebcastMessageException: Error whilst Handling Message. Stopping Client. Final Message: CjUKGFdlYmNhc3RIb3VybHlSYW5rTWVzc2FnZRCrlq6G/N+qpWQYhpa7p6y4p6VkIOf/sZ38MBKNAiJDGg4KCSNmZmZmZmZmZiCQAyIGCAFaAjI4ChFwbV9tdF9MaXZlX0hSTWFyaxIWSG91cmx5IE5vLiAgezA6c3RyaW5nfSp0EB4aXQoQcG1fbXRfbGl2ZV9yZWFjaBIoezA6c3RyaW5nfSBEaWFtb25kcyB0byByZWFjaCAgezE6c3RyaW5nfRoOCgkjZmZmZmZmZmYgkAMiBwgBWgMxMzUiBggBWgIyNyIJIzgwRkYzNjdGKIcBMBwItAE4AQgBEkkIBRI6ChBwbV9tdF9ob3VybHluYW1lEg5Oby4gezA6c3RyaW5nfRoOIJADCgkjZmZmZmZmZmYiBggBWgIyOBoJIzMzMDAwMDAwGP0Z UnityEngine.Debug:LogException(Exception, Object) TikTokLiveSharp.Client.TikTokLiveClient:HandleWebcastMessages(WebcastResponse) (at Library/PackageCache/dev.vanhoof.tiktokliveunity@8bea4848ae/TikTokLiveSharp/Client/TikTokLiveClient.cs:307) TikTokLiveSharp.Client.<CreateWebSocket>d__42:MoveNext() (at Library/PackageCache/dev.vanhoof.tiktokliveunity@8bea4848ae/TikTokLiveSharp/Client/TikTokBaseClient.cs:402) System.Runtime.CompilerServices.AsyncTaskMethodBuilder:SetResult() TikTokLiveSharp.Client.Socket.<Connect>d__5:MoveNext() (at Library/PackageCache/dev.vanhoof.tiktokliveunity@8bea4848ae/TikTokLiveSharp/Client/Socket/TikTokWebSocket.cs:63) UnityEngine.UnitySynchronizationContext:ExecuteTasks()

what should I do?

yogev2255 commented 1 year ago

after some testing it's happening when they are doing the VS thing on tiktok in live when it ends I will get this error ^

frankvHoof93 commented 1 year ago

This is related to TikTok (ByteDance) changing the format of some of their messages (specifically WebcastRankUpdateMessage & WebcastHourlyRankUpdateMessage, looking at the MessageData in the exception.) Resolved in 0.9.3 with new formats.