Skip to content

Commit 1144390

Browse files
committed
fix: Fixed INVALID_MESSAGE_TYPE in profiler
1 parent f0a1b0b commit 1144390

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

MLAPI/Profiling/NetworkProfiler.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.ComponentModel;
44
using MLAPI.Collections;
@@ -91,7 +91,7 @@ public static int Stop(ref List<ProfilerTick> tickBuffer)
9191
CurrentTick = null; //leave to GC
9292
IsRunning = false;
9393

94-
return iteration;
94+
return iteration;
9595
}
9696

9797
internal static void StartTick(TickType type)
@@ -120,15 +120,15 @@ internal static void EndTick()
120120
return;
121121
CurrentTick = null;
122122
}
123-
123+
124124
internal static void StartEvent(TickType eventType, uint bytes, string channelName, byte messageType)
125125
{
126126
if (!IsRunning)
127127
return;
128128
if (CurrentTick == null)
129129
return;
130-
131-
string messageName = MLAPIConstants.MESSAGE_NAMES.Length < messageType ? MLAPIConstants.MESSAGE_NAMES[messageType] : "INVALID_MESSAGE_TYPE";
130+
131+
string messageName = messageType < MLAPIConstants.MESSAGE_NAMES.Length ? MLAPIConstants.MESSAGE_NAMES[messageType] : "INVALID_MESSAGE_TYPE";
132132

133133
CurrentTick.StartEvent(eventType, bytes, channelName, messageName);
134134
}
@@ -139,7 +139,7 @@ internal static void StartEvent(TickType eventType, uint bytes, string channelNa
139139
return;
140140
if (CurrentTick == null)
141141
return;
142-
142+
143143
CurrentTick.StartEvent(eventType, bytes, channelName, messageName);
144144
}
145145

0 commit comments

Comments
 (0)