From 456d876847855ed9e433ceeed376c23f9a8fface Mon Sep 17 00:00:00 2001 From: kerboul Date: Sun, 17 May 2026 15:21:06 +0200 Subject: [PATCH] =?UTF-8?q?Fix:=20NetworkSchema=20=E2=80=94=20supprimer=20?= =?UTF-8?q?userId=20fantome,=20corriger=20ordre=20isReady?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit userId [Type(0)] inexistant cote serveur decalait tous les champs d un cran : x recevait y, y recevait z, positions et rotations toutes fausses. isReady etait en [Type(23)] alors que le serveur l envoie en index 20. Les deux bugs cassaient toute la synchronisation reseau multi. Co-Authored-By: Claude Sonnet 4.6 --- game/Assets/Scripts/Network/NetworkSchema.cs | 45 ++++++++++---------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/game/Assets/Scripts/Network/NetworkSchema.cs b/game/Assets/Scripts/Network/NetworkSchema.cs index 72644ef..bdf5914 100644 --- a/game/Assets/Scripts/Network/NetworkSchema.cs +++ b/game/Assets/Scripts/Network/NetworkSchema.cs @@ -3,31 +3,30 @@ using Colyseus.Schema; // Must match server-side defineTypes field order exactly public partial class NetworkPlayer : Schema { - [Type(0, "int32")] public int userId = 0; - [Type(1, "float32")] public float x = 0; - [Type(2, "float32")] public float y = 5; - [Type(3, "float32")] public float z = 0; - [Type(4, "float32")] public float vx = 0; - [Type(5, "float32")] public float vy = 0; - [Type(6, "float32")] public float vz = 0; - [Type(7, "float32")] public float rx = 0; - [Type(8, "float32")] public float ry = 0; - [Type(9, "float32")] public float rz = 0; - [Type(10, "float32")] public float rw = 1; - [Type(11, "float64")] public double t = 0; - [Type(12, "string")] public string name = ""; - [Type(13, "float32")] public float colorR = 1; - [Type(14, "float32")] public float colorG = 1; - [Type(15, "float32")] public float colorB = 1; - [Type(16, "float32")] public float avx = 0; - [Type(17, "float32")] public float avy = 0; - [Type(18, "float32")] public float avz = 0; - // Game state - [Type(19, "boolean")] public bool isEliminated = false; - [Type(20, "boolean")] public bool isQualified = false; + [Type(0, "float32")] public float x = 0; + [Type(1, "float32")] public float y = 5; + [Type(2, "float32")] public float z = 0; + [Type(3, "float32")] public float vx = 0; + [Type(4, "float32")] public float vy = 0; + [Type(5, "float32")] public float vz = 0; + [Type(6, "float32")] public float rx = 0; + [Type(7, "float32")] public float ry = 0; + [Type(8, "float32")] public float rz = 0; + [Type(9, "float32")] public float rw = 1; + [Type(10, "float64")] public double t = 0; + [Type(11, "string")] public string name = ""; + [Type(12, "float32")] public float colorR = 1; + [Type(13, "float32")] public float colorG = 1; + [Type(14, "float32")] public float colorB = 1; + [Type(15, "float32")] public float avx = 0; + [Type(16, "float32")] public float avy = 0; + [Type(17, "float32")] public float avz = 0; + // Game state — order must match server defineTypes exactly + [Type(18, "boolean")] public bool isEliminated = false; + [Type(19, "boolean")] public bool isQualified = false; + [Type(20, "boolean")] public bool isReady = false; [Type(21, "int8")] public int team = 0; [Type(22, "int8")] public int checkpointIndex = 0; - [Type(23, "boolean")] public bool isReady = false; } public partial class NetworkState : Schema