From 1a2800896033ef54d6d605025bd1babe016d4096 Mon Sep 17 00:00:00 2001 From: Karrar Date: Tue, 27 Aug 2024 10:07:35 +0300 Subject: [PATCH] Fixed an issue with the previous commit when sending custom user data using `LiteNetLib`. --- Netick/Editor/Netick.Unity.Editor.dll | Bin 61952 -> 61952 bytes Netick/Editor/Netick.Unity.Pro.Editor.dll | Bin 8192 -> 8192 bytes Netick/Editor/Unity.Netick.CodeGen.dll | Bin 22528 -> 22528 bytes Netick/Runtime/Netick.Unity.Pro.dll | Bin 16896 -> 16896 bytes Netick/Runtime/Netick.Unity.dll | Bin 132608 -> 132608 bytes .../LiteNetLibTransportProvider.cs | 7 ++++++- package.json | 2 +- 7 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Netick/Editor/Netick.Unity.Editor.dll b/Netick/Editor/Netick.Unity.Editor.dll index c3f4e47afe88c1c3c6b1401ca25bafaa623faa3b..ef6b868513bf0887ce7fd290aebedb8ffbbf39ff 100644 GIT binary patch delta 121 zcmZp8!rbtLc|r%v`;44b8+*d{Fq&+BvS%w3keaoB9h1PJCn~GAxzu}1wcR%>I_&d~ z%@K!G6j>Z(lnzX8cpME`8F?3jmWFILiP4 delta 121 zcmZp8!rbtLc|r$^_}K+#Hui+?VKm1Xfv3UEJ_u zbHpJPMHW|a+vAfP9tQ{4DKI!HK0MJ)E0{{R3 diff --git a/Netick/Editor/Netick.Unity.Pro.Editor.dll b/Netick/Editor/Netick.Unity.Pro.Editor.dll index 3f57b69983973921c588545bd0e8648d073ebf5a..9c52418751a7709d05f66b45fd86637505ff0539 100644 GIT binary patch delta 105 zcmZp0XmFU&!O~tWw_sz>1R;U;Rfok+cuaF{xXt+NTGH;Fn{|YDFtHSe|2{DJg=m0) zvcj@GtYIZ?3v_#y_0;ABP4*D0RDcS$J%9=VRXe=oYF=Zr%U0m>)GI!lABxFy0sxHk BE+7B^ delta 105 zcmZp0XmFU&!7{ZXef7qk2|@za%X9r(z8-N{Yw~{fkHe4eY}OIp!Nf8vci*GQFGK?b z&O8fa@KMrq==J7bux-!R+mk)SDixrD48Bl7kZP_)^UIXeA8b^qJ{`3Ap_n`;089fh AT>t<8 diff --git a/Netick/Editor/Unity.Netick.CodeGen.dll b/Netick/Editor/Unity.Netick.CodeGen.dll index e63e03f4b6d4f87570eb7f8f0afcb45f84e01f92..f57ec563d2423905644285dda6ecec0cf2ff50c4 100644 GIT binary patch delta 107 zcmZqJz}T>XaY6^n$5qo7ZtRJ174V$3ZQozfMSjb4QoLW^5y;>C!*vEbOZkJ!qm!rj z1_XaY6^n_G2=WH}=H13M}q6JoaAK%X>~xNavg>r=D&8;W~qz<>E_;{>f8( z0|XwGXjX1}Yw17##2mKN-mhOLfAK9-fC)c~0J#{MaH; zz;owwi-@zUJa=CIylKgS9}bgUEQ=JNf-hl$K*j6p&N+N_{aIvw^qcy_&DSioH~=~Q BI6VLW delta 106 zcmZo@VQgq&oY29-o3(z*#-1Za0zdRjc|&4u`0rz4z8JJK<@@FY;|5k{10UVVk1YZP z4)9)U`~K70bBps{b@v0eawof37AZglPnJLhfr|ByAN;nrXm4+hvXy!4=4+N(8~~ej BFOdKM diff --git a/Netick/Runtime/Netick.Unity.dll b/Netick/Runtime/Netick.Unity.dll index 086899b3bb38ed1135621eba599c8dfb41ebeee6..be7d20d3770848e31fa7ad59858364132e526947 100644 GIT binary patch delta 122 zcmZqZ;b`dLn9#wJ(&M(c{XF$M@!?ov|}4O-*9WR_cLPx7qh=^I`#<|#l$rBk4yAoW&C;e1mg Rx-9$rqb#=Dy=FWl1px59HDv$* delta 122 zcmZqZ;b`dLn9#w(d2jNQ#-6P`j6T~06hcq^pWDpizt`l`>po$#Roh=|W9$%NG~Ql# zn(?+AOL2HW>-2zEi~#~{7EjJ?%j|NTI=?=TrCL*G`i57Gc?wX`i=t3bpn6u>9dcrI SGj>f?w_lLF-R?ExAt?aS+B6ja diff --git a/Transport/LiteNetLib Transport/LiteNetLibTransportProvider.cs b/Transport/LiteNetLib Transport/LiteNetLibTransportProvider.cs index 66dcc45..94bf961 100644 --- a/Transport/LiteNetLib Transport/LiteNetLibTransportProvider.cs +++ b/Transport/LiteNetLib Transport/LiteNetLibTransportProvider.cs @@ -7,6 +7,7 @@ using System.Net; using System.Net.Sockets; using System; using Netick.Unity; +using UnityEngine.UIElements; namespace Netick.Transport { @@ -16,7 +17,7 @@ namespace Netick.Transport [Tooltip("Time duration (in seconds) until a connection is dropped when no packets were received.")] public float DisconnectTimeout = 5; [Tooltip("Time interval (in seconds) between connection attempts.")] - public float ReconnectInterval = 0.5f; + public float ReconnectInterval = 0.5f; [Tooltip("Max number of connect attempts.")] public int MaxConnectAttempts = 10; [Tooltip("LiteNetLib internal logic update interval (in seconds).")] @@ -222,6 +223,10 @@ namespace Netick.Transport if (_clients.TryGetValue(peer, out var c)) { var len = reader.AvailableBytes; + + if (_bytes.Length < reader.AvailableBytes) + _bytes = new byte[reader.AvailableBytes]; + reader. GetBytes(_bytes, 0, reader.AvailableBytes); fixed(byte* ptr = _bytes) diff --git a/package.json b/package.json index 7a2e773..0c2db01 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.karrar.netick", - "version": "0.12.23", + "version": "0.12.24", "displayName": "Netick", "description": "A networking solution for Unity", "unity": "2021.3",