Skip to content

Commit 65cebcd

Browse files
committed
Removed Encryption from Channels
1 parent 43859d1 commit 65cebcd

File tree

3 files changed

+3
-21
lines changed

3 files changed

+3
-21
lines changed

MLAPI-Editor/NetworkingManagerEditor.cs

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -78,26 +78,16 @@ private void OnEnable()
7878
int firstLabelWidth = 50;
7979
int secondLabelWidth = 40;
8080
int secondFieldWidth = 150;
81-
int thirdLabelWidth = networkingManager.NetworkConfig.EnableEncryption ? 70 : 0;
82-
int thirdFieldWidth = networkingManager.NetworkConfig.EnableEncryption ? 10 : 0;
8381
int reduceFirstWidth = 45;
84-
int reduceSecondWidth = networkingManager.NetworkConfig.EnableEncryption ? 10 : 0;
8582

8683
EditorGUI.LabelField(new Rect(rect.x, rect.y, firstLabelWidth, EditorGUIUtility.singleLineHeight), "Name");
87-
EditorGUI.PropertyField(new Rect(rect.x + firstLabelWidth, rect.y, rect.width - firstLabelWidth - secondLabelWidth - secondFieldWidth - thirdFieldWidth - thirdLabelWidth - reduceFirstWidth,
84+
EditorGUI.PropertyField(new Rect(rect.x + firstLabelWidth, rect.y, rect.width - firstLabelWidth - secondLabelWidth - secondFieldWidth - reduceFirstWidth,
8885
EditorGUIUtility.singleLineHeight), element.FindPropertyRelative("Name"), GUIContent.none);
8986

9087

91-
EditorGUI.LabelField(new Rect(rect.width - secondLabelWidth - secondFieldWidth - thirdFieldWidth - thirdLabelWidth, rect.y, secondLabelWidth, EditorGUIUtility.singleLineHeight), "Type");
92-
EditorGUI.PropertyField(new Rect(rect.width - secondFieldWidth - thirdLabelWidth - thirdFieldWidth, rect.y, secondFieldWidth - reduceSecondWidth,
88+
EditorGUI.LabelField(new Rect(rect.width - secondLabelWidth - secondFieldWidth, rect.y, secondLabelWidth, EditorGUIUtility.singleLineHeight), "Type");
89+
EditorGUI.PropertyField(new Rect(rect.width - secondFieldWidth, rect.y, secondFieldWidth,
9390
EditorGUIUtility.singleLineHeight), element.FindPropertyRelative("Type"), GUIContent.none);
94-
95-
if (networkingManager.NetworkConfig.EnableEncryption)
96-
{
97-
EditorGUI.LabelField(new Rect(rect.width - thirdFieldWidth - thirdLabelWidth, rect.y, thirdLabelWidth, EditorGUIUtility.singleLineHeight), "Encrypted");
98-
EditorGUI.PropertyField(new Rect(rect.width - thirdFieldWidth, rect.y, secondFieldWidth,
99-
EditorGUIUtility.singleLineHeight), element.FindPropertyRelative("Encrypted"), GUIContent.none);
100-
}
10191
};
10292

10393
channelsList.drawHeaderCallback = (Rect rect) => {

MLAPI/Data/Channel.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,5 @@ public class Channel
1717
/// The Transport QOS type
1818
/// </summary>
1919
public ChannelType Type;
20-
/// <summary>
21-
/// Wheter or not the channel should be encrypted
22-
/// </summary>
23-
public bool Encrypted;
2420
}
2521
}

MLAPI/Data/NetworkConfig.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ public string ToBase64()
170170
for (int i = 0; i < config.Channels.Count; i++)
171171
{
172172
writer.WriteString(config.Channels[i].Name);
173-
writer.WriteBool(config.Channels[i].Encrypted);
174173
writer.WriteBits((byte)config.Channels[i].Type, 5);
175174
}
176175

@@ -232,7 +231,6 @@ public void FromBase64(string base64, bool createDummyObject = false)
232231
Channel channel = new Channel()
233232
{
234233
Name = reader.ReadString().ToString(),
235-
Encrypted = reader.ReadBool(),
236234
Type = (ChannelType)reader.ReadBits(5)
237235
};
238236
config.Channels.Add(channel);
@@ -310,8 +308,6 @@ public ulong GetConfig(bool cache = true)
310308
{
311309
writer.WriteString(Channels[i].Name);
312310
writer.WriteByte((byte)Channels[i].Type);
313-
if (EnableEncryption)
314-
writer.WriteBool(Channels[i].Encrypted);
315311
}
316312
if (EnableSceneSwitching)
317313
{

0 commit comments

Comments
 (0)