From 36acbb57c5fd4f4166c2bc25b7ba8cc794951422 Mon Sep 17 00:00:00 2001 From: devbeni Date: Sun, 14 Dec 2025 23:13:43 +0100 Subject: [PATCH] Enhance reliability of chunk data transmission and update world seed handling on game start --- Packets/Network/ClientConnected.cs | 2 +- ServerLobby/ServerLobbyScript.cs | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Packets/Network/ClientConnected.cs b/Packets/Network/ClientConnected.cs index 6c55639..d4f39a7 100644 --- a/Packets/Network/ClientConnected.cs +++ b/Packets/Network/ClientConnected.cs @@ -99,7 +99,7 @@ namespace KCM.Packets.Network chunkSize = chunk.Length, saveDataIndex = sent, totalChunks = chunks.Count - }.Send(clientId); + }.Send(clientId, Riptide.MessageSendMode.Reliable); Main.helper.Log(" "); diff --git a/ServerLobby/ServerLobbyScript.cs b/ServerLobby/ServerLobbyScript.cs index 9524e1f..fa0bb84 100644 --- a/ServerLobby/ServerLobbyScript.cs +++ b/ServerLobby/ServerLobbyScript.cs @@ -144,7 +144,6 @@ namespace KCM { Main.helper.Log("Disable all"); - //StartGameButton.gameObject.SetActive(false); StartGameButton.onClick.RemoveAllListeners(); StartGameButton.GetComponentInChildren().text = "Ready"; StartGameButton.onClick.AddListener(() => @@ -189,6 +188,16 @@ namespace KCM StartGameButton.GetComponentInChildren().text = "Start"; StartGameButton.onClick.AddListener(() => { + if (World.inst.GetTextSeed() != WorldSeed.text) + { + World.inst.seed = World.inst.SeedFromText(WorldSeed.text); + } + + new WorldSeed() + { + Seed = World.inst.seed + }.SendToAll(KCClient.client.Id); + new StartGame().SendToAll(); if (PlacementType.value == 0 && !LobbyManager.loadingSave)