Skip to content

Commit 7c691f8

Browse files
committed
Removed obsolete code and applied necessary fixes
1 parent 9ee9daa commit 7c691f8

File tree

5 files changed

+11
-152
lines changed

5 files changed

+11
-152
lines changed

Assets/Scripts/EOSPeer2PeerManager.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ private enum PeerConnectionAppState
9999

100100
private Dictionary<ProductUserId, PeerConnectionAppState> connectionStates = new();
101101

102+
private string Request = "hreq";
103+
private string Acknowledgement = "hack";
104+
private string Ping = "ping";
105+
102106
#if UNITY_EDITOR
103107
void OnPlayModeChanged(UnityEditor.PlayModeStateChange modeChange)
104108
{
@@ -360,14 +364,14 @@ public ProductUserId HandleReceivedMessages()
360364

361365
string message = System.Text.Encoding.UTF8.GetString(data);
362366
// --- Handshake protocol ---
363-
if (message == "hreq")
367+
if (message == Request)
364368
{
365369
SendHandshakeAck(peerId);
366370
connectionStates[peerId] = PeerConnectionAppState.FullyConnected;
367371
Debug.Log($"Received handshake request from {peerId}. Sending ack and setting FullyConnected.");
368372
return null;
369373
}
370-
else if (message == "hack")
374+
else if (message == Acknowledgement)
371375
{
372376
connectionStates[peerId] = PeerConnectionAppState.FullyConnected;
373377
Debug.Log($"Received handshake ack from {peerId}. Connection is now FullyConnected.");
@@ -415,7 +419,7 @@ public ProductUserId HandleReceivedMessages()
415419

416420
return peerId;
417421
}
418-
else if (message == "ping")
422+
else if (message == Ping)
419423
{
420424
Debug.Log($"EOS P2PNAT HandleReceivedMessages: received ping from {peerId}, ignoring.");
421425
return null;

com.playeveryware.eos/Runtime/EOS_SDK/Core/CallbackHelper.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,12 @@ internal static bool TryGetAndRemoveCallback<TCallbackInfoInternal, TCallback, T
122122
if (callback != null)
123123
{
124124
// If this delegate was added with an AddNotify, we should only ever remove it on RemoveNotify.
125-
if (notificationId.HasValue)
126-
{
127-
}
125+
// if (notificationId.HasValue)
126+
// {
127+
// }
128128

129129
// If the operation is complete, it's safe to remove.
130-
else if (callbackInfo.GetResultCode().HasValue && Common.IsOperationComplete(callbackInfo.GetResultCode().Value))
130+
if (callbackInfo.GetResultCode().HasValue && Common.IsOperationComplete(callbackInfo.GetResultCode().Value))
131131
{
132132
RemoveCallback(clientDataPointer);
133133
}

com.playeveryware.eos/Runtime/EOS_SDK/Core/ConvertHelper.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,6 @@ private static void Convert<TArray>(ArraySegment<TArray> from, out int to)
127127
to = from.Count;
128128
}
129129

130-
//internal static void Set<T1, T2>(ref T1? value, ref IntPtr m_OverrideThreadAffinity)
131-
//{
132-
// throw new NotImplementedException();
133-
//}
134130

135131
/// <summary>
136132
/// Converts from an <see cref="ArraySegment{T}" /> to an <see cref="uint" />.

com.playeveryware.eos/Runtime/EOS_SDK/Core/NotForLicensees/Common.cs

Lines changed: 0 additions & 130 deletions
This file was deleted.

com.playeveryware.eos/Runtime/EOS_SDK/Core/NotForLicensees/Common.cs.meta

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)