| | |
| | | |
| | | static ulong AutoIncreaseUID = 0; |
| | | |
| | | public ulong mPackUID; |
| | | |
| | | public ulong packUID |
| | | { |
| | | get; |
| | | private set; |
| | | get |
| | | { |
| | | return mPackUID; |
| | | } |
| | | private set |
| | | { |
| | | mPackUID = value; |
| | | } |
| | | } |
| | | |
| | | public bool commonMark |
| | | { |
| | | get; |
| | | set; |
| | | } = false; |
| | | |
| | | public GameNetPackBasic() |
| | | { |
| | | packUID = AutoIncreaseUID++; |
| | | } |
| | | |
| | | |
| | | |
| | | public ServerType socketType = ServerType.Main; //默认且唯一 |
| | | |
| | |
| | | { |
| | | try |
| | | { |
| | | if (vInts.IsNullOrEmpty()) |
| | | { |
| | | return; |
| | | } |
| | | if (vInts.Length != vLockLeng) |
| | | Array.Resize(ref vInts, vLockLeng); |
| | | this.WriteBytes(vInts, vType); |
| | |
| | | { |
| | | try |
| | | { |
| | | if (vInts.IsNullOrEmpty()) |
| | | { |
| | | return; |
| | | } |
| | | if (vInts.Length != vLockLeng) |
| | | Array.Resize(ref vInts, vLockLeng); |
| | | this.WriteBytes(vInts, vType); |
| | |
| | | { |
| | | try |
| | | { |
| | | if (vInts.IsNullOrEmpty()) |
| | | { |
| | | return; |
| | | } |
| | | if (vWriteLen == StrWriteLen.BYTE) |
| | | this.WriteBytes(new Byte[] { (byte)vInts.Length }); |
| | | else if (vWriteLen == StrWriteLen.WORD) |
| | |
| | | { |
| | | try |
| | | { |
| | | if (vInts.IsNullOrEmpty()) |
| | | { |
| | | return; |
| | | } |
| | | int l = vInts.Length; |
| | | byte[] vRst; |
| | | int i; |
| | |
| | | { |
| | | try |
| | | { |
| | | if (vInts.IsNullOrEmpty()) |
| | | { |
| | | return; |
| | | } |
| | | int l = vInts.Length; |
| | | byte[] vRst; |
| | | int i; |
| | |
| | | { |
| | | try |
| | | { |
| | | if (vBytes.IsNullOrEmpty()) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | Array.Resize(ref _writedBytes, _writeIndex + vBytes.Length); |
| | | vBytes.CopyTo(_writedBytes, _writeIndex); |
| | | _writeIndex = _writedBytes.Length; |