Skip to content
This repository was archived by the owner on Nov 5, 2020. It is now read-only.

Commit 81127d7

Browse files
committed
Implement RTT error messages
1 parent a1a31c8 commit 81127d7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Scripts/LiteNetLibUnetTransport.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,16 @@ public void GetConnectionInfo(int hostId, int connectionId, out string address,
253253
public int GetCurrentRTT(int hostId, int connectionId, out byte error)
254254
{
255255
// Return the round trip time for the given connectionId.
256+
if (!connections.ContainsKey(hostId))
257+
{
258+
error = (byte)NetworkError.WrongHost;
259+
return 0;
260+
}
261+
if (!connections[hostId].ContainsKey(connectionId))
262+
{
263+
error = (byte)NetworkError.WrongConnection;
264+
return 0;
265+
}
256266
// TODO: implement this
257267
error = (byte)NetworkError.Ok;
258268
return 0;

0 commit comments

Comments
 (0)