-
Notifications
You must be signed in to change notification settings - Fork 10
Fixing initialization errors and unity log errors. Also fixes a bug with int encoding of the frames in backroll connection. #5
base: master
Are you sure you want to change the base?
Conversation
…and encoding errors for backroll connection
@@ -48,6 +48,8 @@ public unsafe class P2PBackrollSession<T> : BackrollSession<T> where T : struct | |||
|
|||
public bool IsSynchronizing { | |||
get { | |||
// Always synchronized | |||
return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this correct? I don't think this is true even in the C++ implementation for GGPO.
@@ -325,13 +336,18 @@ public unsafe class P2PBackrollSession<T> : BackrollSession<T> where T : struct | |||
if (_localConnectStatus[queue].Disconnected) return; | |||
int current_remote_frame = _localConnectStatus[queue].LastFrame; | |||
int new_remote_frame = input.Frame; | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove extra space here.
BitVector.WriteNibblet(msg.bits, i, ref offset); | ||
Debug.Log($"[BackrollConnection][Nibblet][Set] Nibblet Set! Frame {j + msg.StartFrame}, Bit: {i}, On: {current[i]}"); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please adhere to the project style convention and use K&R style bracketing.
Also is this level of logging advised? This looks like it may flood the log with noisy output. If this was just to help debug the library itself. I strongly suggest removing them.
Runtime/BackrollConnection.cs
Outdated
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove extra space.
|
||
// Steam is always synchronized already! | ||
_current_state = State.Running; | ||
//SendSyncRequest(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not localized to only a Steam implementation, and thus not a safe assumption. This is safe if HouraiNetworking ensures that the underlying transport is synchronized across all transport implementations.
{ | ||
data = (data & 1) | (uint)(value << 1); | ||
}; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what this change is doing. Please explain, or leave a comment explaining this.
for (int i = 0; i < _localConnectStatus.Length; i++) { | ||
_localConnectStatus[i].LastFrame = -1; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this initialization change do? What was broken before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previous code checked PlayerCount on line 87 (_players.Length) before _players was assigned (line 94)
also, SetupConnection tries to get the index of the player in _players so it can't be used during the assignment to _players
…er changes based on PR comments
…ject list frame save
Fixing Unity debug formatting errors, various initialization errors, and encoding errors for backroll connection.
Unity doesn't like "{}" when using Debug.Format so I added indices.