Revert "Synchronize instructions in network_init (NT_SERVER) with network_receive_join (NT_CLIENT) (#597)"

This reverts commit 0ef9ae742e.
This commit is contained in:
Agent X 2024-12-31 20:12:13 -05:00
parent 66fbbc819d
commit b49de46236
3 changed files with 18 additions and 14 deletions

View file

@ -2,6 +2,7 @@
#include "djui.h" #include "djui.h"
#include "djui_panel.h" #include "djui_panel.h"
#include "djui_panel_menu.h" #include "djui_panel_menu.h"
#include "djui_panel_modlist.h"
#include "pc/network/network.h" #include "pc/network/network.h"
#include "pc/utils/misc.h" #include "pc/utils/misc.h"
#include "pc/configfile.h" #include "pc/configfile.h"
@ -28,6 +29,11 @@ void djui_panel_do_host(bool reconnecting, bool playSound) {
network_set_system(configNetworkSystem); network_set_system(configNetworkSystem);
network_init(NT_SERVER, reconnecting); network_init(NT_SERVER, reconnecting);
djui_panel_modlist_create(NULL);
fake_lvl_init_from_save_file();
extern s16 gChangeLevelTransition;
gChangeLevelTransition = gLevelValues.entryLevel;
if (gMarioState->marioObj) vec3f_copy(gMarioState->marioObj->header.gfx.cameraToObject, gGlobalSoundSource); if (gMarioState->marioObj) vec3f_copy(gMarioState->marioObj->header.gfx.cameraToObject, gGlobalSoundSource);
if (playSound) { gDelayedInitSound = CHAR_SOUND_OKEY_DOKEY; } if (playSound) { gDelayedInitSound = CHAR_SOUND_OKEY_DOKEY; }

View file

@ -11,7 +11,6 @@
#include "pc/configfile.h" #include "pc/configfile.h"
#include "pc/djui/djui.h" #include "pc/djui/djui.h"
#include "pc/djui/djui_panel.h" #include "pc/djui/djui_panel.h"
#include "pc/djui/djui_panel_modlist.h"
#include "pc/djui/djui_hud_utils.h" #include "pc/djui/djui_hud_utils.h"
#include "pc/djui/djui_panel_main.h" #include "pc/djui/djui_panel_main.h"
#include "pc/utils/misc.h" #include "pc/utils/misc.h"
@ -159,26 +158,24 @@ bool network_init(enum NetworkType inNetworkType, bool reconnecting) {
gNetworkType = inNetworkType; gNetworkType = inNetworkType;
if (gNetworkType == NT_SERVER) { if (gNetworkType == NT_SERVER) {
extern u8* gOverrideEeprom;
gOverrideEeprom = NULL;
extern s16 gCurrSaveFileNum; extern s16 gCurrSaveFileNum;
gCurrSaveFileNum = configHostSaveSlot; gCurrSaveFileNum = configHostSaveSlot;
network_player_connected(NPT_LOCAL, 0, configPlayerModel, &configPlayerPalette, configPlayerName, get_local_discord_id());
djui_chat_box_create();
djui_panel_shutdown();
fake_lvl_init_from_save_file();
mods_activate(&gLocalMods); mods_activate(&gLocalMods);
djui_panel_modlist_create(NULL);
smlua_init(); smlua_init();
dynos_behavior_hook_all_custom_behaviors(); dynos_behavior_hook_all_custom_behaviors();
extern s16 gChangeLevelTransition; network_player_connected(NPT_LOCAL, 0, configPlayerModel, &configPlayerPalette, configPlayerName, get_local_discord_id());
gChangeLevelTransition = gLevelValues.entryLevel; extern u8* gOverrideEeprom;
gOverrideEeprom = NULL;
if (gCurrLevelNum != (s16)gLevelValues.entryLevel) {
extern s16 gChangeLevelTransition;
gChangeLevelTransition = gLevelValues.entryLevel;
}
djui_chat_box_create();
} }
configfile_save(configfile_name()); configfile_save(configfile_name());

View file

@ -15,6 +15,7 @@
#include "pc/djui/djui.h" #include "pc/djui/djui.h"
#include "pc/djui/djui_panel.h" #include "pc/djui/djui_panel.h"
#include "pc/djui/djui_panel_modlist.h" #include "pc/djui/djui_panel_modlist.h"
#include "pc/djui/djui_panel_playerlist.h"
#include "pc/djui/djui_panel_menu.h" #include "pc/djui/djui_panel_menu.h"
#include "pc/djui/djui_panel_join_message.h" #include "pc/djui/djui_panel_join_message.h"
#include "pc/utils/string_builder.h" #include "pc/utils/string_builder.h"