From bf9d063af5655f93db17578cfe52d8abbb60c596 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期三, 03 十二月 2025 17:42:40 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts

---
 Main/Core/NetworkPackage/GameNetPackBasic.cs |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/Main/Core/NetworkPackage/GameNetPackBasic.cs b/Main/Core/NetworkPackage/GameNetPackBasic.cs
index 56f9dbe..77914ab 100644
--- a/Main/Core/NetworkPackage/GameNetPackBasic.cs
+++ b/Main/Core/NetworkPackage/GameNetPackBasic.cs
@@ -962,6 +962,10 @@
     {
         try
         {
+            if (vInts.IsNullOrEmpty())
+            {
+                return;
+            }
             if (vInts.Length != vLockLeng)
                 Array.Resize(ref vInts, vLockLeng);
             this.WriteBytes(vInts, vType);
@@ -978,6 +982,10 @@
     {
         try
         {
+            if (vInts.IsNullOrEmpty())
+            {
+                return;
+            }
             if (vInts.Length != vLockLeng)
                 Array.Resize(ref vInts, vLockLeng);
             this.WriteBytes(vInts, vType);
@@ -993,6 +1001,10 @@
     {
         try
         {
+            if (vInts.IsNullOrEmpty())
+            {
+                return;
+            }
             if (vWriteLen == StrWriteLen.BYTE)
                 this.WriteBytes(new Byte[] { (byte)vInts.Length });
             else if (vWriteLen == StrWriteLen.WORD)
@@ -1012,6 +1024,10 @@
     {
         try
         {
+            if (vInts.IsNullOrEmpty())
+            {
+                return;
+            }
             int l = vInts.Length;
             byte[] vRst;
             int i;
@@ -1051,6 +1067,10 @@
     {
         try
         {
+            if (vInts.IsNullOrEmpty())
+            {
+                return;
+            }
             int l = vInts.Length;
             byte[] vRst;
             int i;
@@ -1147,6 +1167,11 @@
     {
         try
         {
+            if (vBytes.IsNullOrEmpty())
+            {
+                return;
+            }
+
             Array.Resize(ref _writedBytes, _writeIndex + vBytes.Length);
             vBytes.CopyTo(_writedBytes, _writeIndex);
             _writeIndex = _writedBytes.Length;

--
Gitblit v1.8.0