summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/CPacketBreaker.cs
blob: 4b266b476933797c75a5dfb8c67db296db23c65f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using System;

namespace XMainClient
{
	public class CPacketBreaker : IPacketBreaker
	{
		public int BreakPacket(byte[] data, int index, int len)
		{
			bool flag = len < 4;
			int result;
			if (flag)
			{
				result = 0;
			}
			else
			{
				int num = BitConverter.ToInt32(data, index);
				bool flag2 = len < 4 + num;
				if (flag2)
				{
					result = 0;
				}
				else
				{
					result = num + 4;
				}
			}
			return result;
		}
	}
}