Skip to content

Commit ae14871

Browse files
committed
Namespace & comment cleanup
1 parent 2acb20e commit ae14871

File tree

10 files changed

+14
-40
lines changed

10 files changed

+14
-40
lines changed

MLAPI/Data/Channel.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
52
using UnityEngine.Networking;
63

74
namespace MLAPI.Data

MLAPI/Data/NetworkConfig.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
1-
using MLAPI.MonoBehaviours.Core;
2-
using MLAPI.NetworkingManagerComponents.Binary;
1+
using MLAPI.NetworkingManagerComponents.Binary;
32
using System;
43
using System.Collections.Generic;
5-
using System.IO;
6-
using System.Linq;
74
using System.Security.Cryptography;
8-
using System.Text;
95
using UnityEngine;
10-
using UnityEngine.Networking;
116

127
namespace MLAPI.Data
138
{

MLAPI/Data/SyncedVarField.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Reflection;
5-
using System.Text;
1+
using System.Reflection;
62

73
namespace MLAPI.Data
84
{

MLAPI/GlobalSuppressions.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,12 @@
1818
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0018:Inline variable declaration", Justification = "Not supported in Unity Mono version", Scope = "member", Target = "~M:MLAPI.MonoBehaviours.Core.NetworkingManager.Send(System.String,System.String,System.Byte[],System.UInt32,System.Nullable{System.UInt32},System.Nullable{System.UInt16})")]
1919
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0018:Inline variable declaration", Justification = "Not supported in Unity Mono version", Scope = "member", Target = "~M:MLAPI.MonoBehaviours.Core.NetworkingManager.Send(System.String,System.String,System.Byte[],System.Nullable{System.UInt32},System.Nullable{System.UInt16})")]
2020
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0018:Inline variable declaration", Justification = "Not supported in Unity Mono version", Scope = "member", Target = "~M:MLAPI.MonoBehaviours.Core.NetworkingManager.Send(System.UInt32[],System.String,System.String,System.Byte[],System.Nullable{System.UInt32},System.Nullable{System.UInt16})")]
21+
22+
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0018:Inline variable declaration", Justification = "Not supported in Unity Mono version", Scope = "member", Target = "~M:MLAPI.MonoBehaviours.Core.NetworkingManager.HandleApproval(System.UInt32,System.Boolean,UnityEngine.Vector3,UnityEngine.Quaternion)")]
23+
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0018:Inline variable declaration", Justification = "Not supported in Unity Mono version", Scope = "member", Target = "~M:MLAPI.NetworkingManagerComponents.Core.InternalMessageHandler.HandleConnectionApproved(System.UInt32,System.Byte[],System.Int32)")]
24+
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0018:Inline variable declaration", Justification = "Not supported in Unity Mono version", Scope = "member", Target = "~M:MLAPI.NetworkingManagerComponents.Core.InternalMessageHandler.HandleTimeSync(System.UInt32,System.Byte[],System.Int32)")]
25+
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0018:Inline variable declaration", Justification = "Not supported in Unity Mono version", Scope = "member", Target = "~M:MLAPI.NetworkingManagerComponents.Core.InternalMessageHandler.PassthroughSend(System.UInt32,System.UInt32,System.UInt16,System.Int32,System.Byte[],System.Nullable{System.UInt32},System.Nullable{System.UInt16})")]
26+
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0018:Inline variable declaration", Justification = "Not supported in Unity Mono version", Scope = "member", Target = "~M:MLAPI.NetworkingManagerComponents.Core.InternalMessageHandler.Send(System.Collections.Generic.List{System.UInt32},System.String,System.String,System.Byte[],System.Nullable{System.UInt32},System.Nullable{System.UInt16})")]
27+
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0018:Inline variable declaration", Justification = "Not supported in Unity Mono version", Scope = "member", Target = "~M:MLAPI.NetworkingManagerComponents.Core.InternalMessageHandler.Send(System.String,System.String,System.Byte[],System.Nullable{System.UInt32},System.Nullable{System.UInt16})")]
28+
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0018:Inline variable declaration", Justification = "Not supported in Unity Mono version", Scope = "member", Target = "~M:MLAPI.NetworkingManagerComponents.Core.InternalMessageHandler.Send(System.String,System.String,System.Byte[],System.UInt32,System.Nullable{System.UInt32},System.Nullable{System.UInt16})")]
29+
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0018:Inline variable declaration", Justification = "Not supported in Unity Mono version", Scope = "member", Target = "~M:MLAPI.NetworkingManagerComponents.Core.InternalMessageHandler.Send(System.UInt32[],System.String,System.String,System.Byte[],System.Nullable{System.UInt32},System.Nullable{System.UInt16})")]

MLAPI/NetworkingManagerComponents/Binary/BinaryHelpers.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
6-
namespace MLAPI.NetworkingManagerComponents.Binary
1+
namespace MLAPI.NetworkingManagerComponents.Binary
72
{
83
public static class BinaryHelpers
94
{

MLAPI/NetworkingManagerComponents/Binary/BitReader.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,6 @@ private T ReadFloating<T>()
9797
lock(result_holder)
9898
lock (type_holder)
9999
{
100-
//for (int i = 0; i < size; ++i)
101-
// holder.SetValue(ReadByte(), i);
102100
if (size == 4) result_holder.SetValue(BinaryHelpers.SwapEndian(ReadUInt()), 0);
103101
else result_holder.SetValue(BinaryHelpers.SwapEndian(ReadULong()), 0);
104102
Buffer.BlockCopy(result_holder, 0, type_holder, 0, size);

MLAPI/NetworkingManagerComponents/Binary/BitWriter.cs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -218,17 +218,7 @@ private static void Serialize<T>(T t, byte[] writeTo, ref long bitOffset, ref bo
218218
}
219219
else
220220
{
221-
//bool signed = IsSigned(t.GetType());
222221
ulong value;
223-
/*if (signed)
224-
{
225-
Type t1 = t.GetType();
226-
if (t1 == typeof(sbyte)) value = (byte)ZigZagEncode(t as sbyte? ?? 0, 1);
227-
else if (t1 == typeof(short)) value = (ushort)ZigZagEncode(t as short? ?? 0, 2);
228-
else if (t1 == typeof(int)) value = (uint)ZigZagEncode(t as int? ?? 0, 4);
229-
else /*if (t1 == typeof(long)) value = (ulong)ZigZagEncode(t as long? ?? 0, 8);
230-
}
231-
else*/
232222
if (t is byte)
233223
{
234224
WriteByte(writeTo, t as byte? ?? 0, bitOffset, isAligned);
@@ -237,7 +227,7 @@ private static void Serialize<T>(T t, byte[] writeTo, ref long bitOffset, ref bo
237227
}
238228
else if (t is ushort) value = t as ushort? ?? 0;
239229
else if (t is uint) value = t as uint? ?? 0;
240-
else /*if (t is ulong)*/ value = t as ulong? ?? 0;
230+
else value = t as ulong? ?? 0;
241231

242232
if (value <= 240) WriteByte(writeTo, (byte)value, bitOffset, isAligned);
243233
else if (value <= 2287)
@@ -324,8 +314,6 @@ private static long GetBitCount<T>(T t)
324314
else if (t is bool || t is decimal) count += ba;
325315
else count += BytesToRead(t) * 8;
326316
}
327-
//else
328-
// Debug.LogWarning("MLAPI: The type \"" + b.GetType() + "\" is not supported by the Binary Serializer. It will be ignored");
329317
return count;
330318
}
331319

MLAPI/NetworkingManagerComponents/Core/InternalMessageHandler.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using System;
2-
using MLAPI.MonoBehaviours.Core;
1+
using MLAPI.MonoBehaviours.Core;
32

43
namespace MLAPI.NetworkingManagerComponents.Core
54
{

MLAPI/NetworkingManagerComponents/Core/NetworkPoolManager.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using MLAPI.MonoBehaviours.Core;
33
using MLAPI.NetworkingManagerComponents.Binary;
44
using System.Collections.Generic;
5-
using System.IO;
65
using UnityEngine;
76

87
namespace MLAPI.NetworkingManagerComponents.Core

MLAPI/NetworkingManagerComponents/Core/SpawnManager.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
using MLAPI.Data;
22
using MLAPI.MonoBehaviours.Core;
33
using MLAPI.NetworkingManagerComponents.Binary;
4-
using System;
54
using System.Collections.Generic;
6-
using System.IO;
75
using UnityEngine;
86

97
namespace MLAPI.NetworkingManagerComponents.Core

0 commit comments

Comments
 (0)