mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
[Command] tests: set up NetworkIdentity connectionToServer everywhere too, not just to client. prepares for making SendCommandInternal use connectionToServer instead of NetworkClient.readyConnection.
This commit is contained in:
parent
b3c25d1094
commit
a58cd37a36
@ -316,7 +316,10 @@ public void SendCommandInternal()
|
||||
isAuthenticated = true
|
||||
};
|
||||
connection.connectionToServer.connectionToClient = connection;
|
||||
|
||||
// host needs connection to both directions
|
||||
identity.connectionToClient = connection;
|
||||
identity.connectionToServer = connection.connectionToServer;
|
||||
|
||||
// calling command before client is connected shouldn't work
|
||||
// error log is expected
|
||||
|
@ -58,7 +58,10 @@ protected T CreateHostObject<T>(bool spawnWithAuthority) where T : NetworkBehavi
|
||||
GameObject gameObject = new GameObject();
|
||||
spawned.Add(gameObject);
|
||||
|
||||
gameObject.AddComponent<NetworkIdentity>();
|
||||
NetworkIdentity netIdentity = gameObject.AddComponent<NetworkIdentity>();
|
||||
|
||||
// host mode object needs a connection to server for commands to work
|
||||
netIdentity.connectionToServer = NetworkClient.readyConnection;
|
||||
|
||||
T behaviour = gameObject.AddComponent<T>();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user