From 9a346b2b4198e691b6324e36ce6bd3a2aa086784 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Tue, 17 May 2022 08:55:40 -0500 Subject: [PATCH] Move disconnect reasons to natives --- scripts/client/native/connected.js | 17 +++++++++++++++++ scripts/server/native/connected.js | 17 +++++++++++++++++ scripts/server/utilities.js | 15 +-------------- 3 files changed, 35 insertions(+), 14 deletions(-) diff --git a/scripts/client/native/connected.js b/scripts/client/native/connected.js index 4f18cc48..3f03b76b 100644 --- a/scripts/client/native/connected.js +++ b/scripts/client/native/connected.js @@ -7,6 +7,23 @@ // TYPE: Server (JavaScript) // =========================================================================== +let disconnectReasons = [ + "Lost Connection", + "Disconnected", + "Unsupported Client", + "Wrong Game", + "Incorrect Password", + "Unsupported Executable", + "Disconnected", + "Banned", + "Failed", + "Invalid Name", + "Crashed", + "Modified Game" +]; + +// =========================================================================== + function sendNetworkEventToPlayer(networkEvent, client, ...args) { triggerNetworkEvent.apply(null, networkEvent, client, args); } diff --git a/scripts/server/native/connected.js b/scripts/server/native/connected.js index 2f270a28..758d0e39 100644 --- a/scripts/server/native/connected.js +++ b/scripts/server/native/connected.js @@ -22,6 +22,23 @@ let builtInCommands = [ // =========================================================================== +let disconnectReasons = [ + "Lost Connection", + "Disconnected", + "Unsupported Client", + "Wrong Game", + "Incorrect Password", + "Unsupported Executable", + "Disconnected", + "Banned", + "Failed", + "Invalid Name", + "Crashed", + "Modified Game" +]; + +// =========================================================================== + function getPlayerPosition(client) { if(!areServerElementsSupported()) { return getPlayerData(client).syncPosition; diff --git a/scripts/server/utilities.js b/scripts/server/utilities.js index 3ed39bb4..a89a7821 100644 --- a/scripts/server/utilities.js +++ b/scripts/server/utilities.js @@ -7,20 +7,7 @@ // TYPE: Server (JavaScript) // =========================================================================== -let disconnectReasons = [ - "Lost Connection", - "Disconnected", - "Unsupported Client", - "Wrong Game", - "Incorrect Password", - "Unsupported Executable", - "Disconnected", - "Banned", - "Failed", - "Invalid Name", - "Crashed", - "Modified Game" -]; + // ===========================================================================