fix: Use NetworkClient.Send

- there is a null check in Send before attempting to use the connection
This commit is contained in:
MrGadget1024 2022-12-30 07:20:24 -05:00
parent 321b68238d
commit 205ced88aa
4 changed files with 9 additions and 9 deletions

View File

@ -162,7 +162,7 @@ public override void OnClientAuthenticate()
authPassword = password
};
NetworkClient.connection.Send(authRequestMessage);
NetworkClient.Send(authRequestMessage);
}
/// <summary>

View File

@ -111,7 +111,7 @@ public override void OnClientAuthenticate()
}
// send the deviceUniqueIdentifier to the server
NetworkClient.connection.Send(new AuthRequestMessage { clientDeviceID = deviceUniqueIdentifier } );
NetworkClient.Send(new AuthRequestMessage { clientDeviceID = deviceUniqueIdentifier } );
}
/// <summary>

View File

@ -175,7 +175,7 @@ public override void OnClientAuthenticate()
authUsername = playerName,
};
NetworkClient.connection.Send(authRequestMessage);
NetworkClient.Send(authRequestMessage);
}
/// <summary>

View File

@ -143,7 +143,7 @@ public void RequestCreateMatch()
{
if (!NetworkClient.active) return;
NetworkClient.connection.Send(new ServerMatchMessage { serverMatchOperation = ServerMatchOperation.Create });
NetworkClient.Send(new ServerMatchMessage { serverMatchOperation = ServerMatchOperation.Create });
}
/// <summary>
@ -153,7 +153,7 @@ public void RequestJoinMatch()
{
if (!NetworkClient.active || selectedMatch == Guid.Empty) return;
NetworkClient.connection.Send(new ServerMatchMessage { serverMatchOperation = ServerMatchOperation.Join, matchId = selectedMatch });
NetworkClient.Send(new ServerMatchMessage { serverMatchOperation = ServerMatchOperation.Join, matchId = selectedMatch });
}
/// <summary>
@ -163,7 +163,7 @@ public void RequestLeaveMatch()
{
if (!NetworkClient.active || localJoinedMatch == Guid.Empty) return;
NetworkClient.connection.Send(new ServerMatchMessage { serverMatchOperation = ServerMatchOperation.Leave, matchId = localJoinedMatch });
NetworkClient.Send(new ServerMatchMessage { serverMatchOperation = ServerMatchOperation.Leave, matchId = localJoinedMatch });
}
/// <summary>
@ -173,7 +173,7 @@ public void RequestCancelMatch()
{
if (!NetworkClient.active || localPlayerMatch == Guid.Empty) return;
NetworkClient.connection.Send(new ServerMatchMessage { serverMatchOperation = ServerMatchOperation.Cancel });
NetworkClient.Send(new ServerMatchMessage { serverMatchOperation = ServerMatchOperation.Cancel });
}
/// <summary>
@ -185,7 +185,7 @@ public void RequestReadyChange()
Guid matchId = localPlayerMatch == Guid.Empty ? localJoinedMatch : localPlayerMatch;
NetworkClient.connection.Send(new ServerMatchMessage { serverMatchOperation = ServerMatchOperation.Ready, matchId = matchId });
NetworkClient.Send(new ServerMatchMessage { serverMatchOperation = ServerMatchOperation.Ready, matchId = matchId });
}
/// <summary>
@ -195,7 +195,7 @@ public void RequestStartMatch()
{
if (!NetworkClient.active || localPlayerMatch == Guid.Empty) return;
NetworkClient.connection.Send(new ServerMatchMessage { serverMatchOperation = ServerMatchOperation.Start });
NetworkClient.Send(new ServerMatchMessage { serverMatchOperation = ServerMatchOperation.Start });
}
/// <summary>