Enhance reliability of chunk data transmission and update world seed handling on game start
This commit is contained in:
@@ -99,7 +99,7 @@ namespace KCM.Packets.Network
|
|||||||
chunkSize = chunk.Length,
|
chunkSize = chunk.Length,
|
||||||
saveDataIndex = sent,
|
saveDataIndex = sent,
|
||||||
totalChunks = chunks.Count
|
totalChunks = chunks.Count
|
||||||
}.Send(clientId);
|
}.Send(clientId, Riptide.MessageSendMode.Reliable);
|
||||||
|
|
||||||
Main.helper.Log(" ");
|
Main.helper.Log(" ");
|
||||||
|
|
||||||
|
|||||||
@@ -144,7 +144,6 @@ namespace KCM
|
|||||||
{
|
{
|
||||||
|
|
||||||
Main.helper.Log("Disable all");
|
Main.helper.Log("Disable all");
|
||||||
//StartGameButton.gameObject.SetActive(false);
|
|
||||||
StartGameButton.onClick.RemoveAllListeners();
|
StartGameButton.onClick.RemoveAllListeners();
|
||||||
StartGameButton.GetComponentInChildren<TextMeshProUGUI>().text = "Ready";
|
StartGameButton.GetComponentInChildren<TextMeshProUGUI>().text = "Ready";
|
||||||
StartGameButton.onClick.AddListener(() =>
|
StartGameButton.onClick.AddListener(() =>
|
||||||
@@ -189,6 +188,16 @@ namespace KCM
|
|||||||
StartGameButton.GetComponentInChildren<TextMeshProUGUI>().text = "Start";
|
StartGameButton.GetComponentInChildren<TextMeshProUGUI>().text = "Start";
|
||||||
StartGameButton.onClick.AddListener(() =>
|
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();
|
new StartGame().SendToAll();
|
||||||
|
|
||||||
if (PlacementType.value == 0 && !LobbyManager.loadingSave)
|
if (PlacementType.value == 0 && !LobbyManager.loadingSave)
|
||||||
|
|||||||
Reference in New Issue
Block a user