I have the following C# code in Unity using Mirror networking: [code] How do I prevent…
- User
I have the following C# code in Unity using Mirror networking:
[Command(channel = Channels.Unreliable)] private void UpdateClientPaths(Vector3 startingPosition, List<Vector3> vectorPath, double time) { //Debug.Log(gameObject.name); RPCUpdateCatchupPath(startingPosition, vectorPath, time); UpdateCathupPath(startingPosition,vectorPath,time); } [ClientRpc(channel = Channels.Unreliable)] private void RPCUpdateCatchupPath(Vector3 startingPosition, List<Vector3> vectorPath, double time) { UpdateCathupPath(startingPosition, vectorPath, time); } private void UpdateCathupPath(Vector3 startingPosition, List<Vector3> vectorPath, double time) { //Debug.Log(isServer + ", " + syncDirection); if (!(isLocalPlayer && syncDirection == SyncDirection.ClientToServer) || (isServer && syncDirection == SyncDirection.ServerToClient)) { //Debug.Log("Setting incoming catchup path"); if (time > lastPathSyncTime) { //Debug.Log("Accepted incoming catchup path"); lastPathSyncTime = time; lastSyncedPath = new List<Vector3>(vectorPath); lastSyncedPath.Insert(0, startingPosition); CatchUpPathUpdated(); } } }
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.