mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
fix: Use NetworkClient.Send
- there is a null check in Send before attempting to use the connection
This commit is contained in:
parent
321b68238d
commit
205ced88aa
@ -162,7 +162,7 @@ public override void OnClientAuthenticate()
|
||||
authPassword = password
|
||||
};
|
||||
|
||||
NetworkClient.connection.Send(authRequestMessage);
|
||||
NetworkClient.Send(authRequestMessage);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -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>
|
||||
|
@ -175,7 +175,7 @@ public override void OnClientAuthenticate()
|
||||
authUsername = playerName,
|
||||
};
|
||||
|
||||
NetworkClient.connection.Send(authRequestMessage);
|
||||
NetworkClient.Send(authRequestMessage);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user