mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-25 13:35:12 +00:00
Fixed compiling with DISCORD_SDK=0
This commit is contained in:
parent
6f7d783602
commit
2f4008f9c9
4 changed files with 7 additions and 2 deletions
|
@ -22,7 +22,6 @@ struct DiscordApplication app = { 0 };
|
||||||
bool gDiscordInitialized = false;
|
bool gDiscordInitialized = false;
|
||||||
bool gDiscordFailed = false;
|
bool gDiscordFailed = false;
|
||||||
bool alreadyRun = false;
|
bool alreadyRun = false;
|
||||||
bool gDiscordReconnecting = false;
|
|
||||||
|
|
||||||
static void discord_sdk_log_callback(UNUSED void* hook_data, enum EDiscordLogLevel level, const char* message) {
|
static void discord_sdk_log_callback(UNUSED void* hook_data, enum EDiscordLogLevel level, const char* message) {
|
||||||
LOGFILE_INFO(LFT_DISCORD, "callback (%d): %s", level, message);
|
LOGFILE_INFO(LFT_DISCORD, "callback (%d): %s", level, message);
|
||||||
|
|
|
@ -29,7 +29,6 @@ void discord_fatal(int rc);
|
||||||
extern struct NetworkSystem gNetworkSystemDiscord;
|
extern struct NetworkSystem gNetworkSystemDiscord;
|
||||||
extern bool gDiscordInitialized;
|
extern bool gDiscordInitialized;
|
||||||
extern bool gDiscordFailed;
|
extern bool gDiscordFailed;
|
||||||
extern bool gDiscordReconnecting;
|
|
||||||
|
|
||||||
struct DiscordApplication {
|
struct DiscordApplication {
|
||||||
struct IDiscordCore* core;
|
struct IDiscordCore* core;
|
||||||
|
|
|
@ -57,6 +57,7 @@ u32 gNetworkAreaTimer = 0;
|
||||||
void* gNetworkServerAddr = NULL;
|
void* gNetworkServerAddr = NULL;
|
||||||
bool gNetworkSentJoin = false;
|
bool gNetworkSentJoin = false;
|
||||||
u16 gNetworkRequestLocationTimer = 0;
|
u16 gNetworkRequestLocationTimer = 0;
|
||||||
|
bool gDiscordReconnecting = false;
|
||||||
|
|
||||||
u8 gDebugPacketIdBuffer[256] = { 0xFF };
|
u8 gDebugPacketIdBuffer[256] = { 0xFF };
|
||||||
u8 gDebugPacketSentBuffer[256] = { 0 };
|
u8 gDebugPacketSentBuffer[256] = { 0 };
|
||||||
|
@ -409,9 +410,14 @@ void network_reconnect_begin(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
sNetworkReconnectTimer = 2 * 30;
|
sNetworkReconnectTimer = 2 * 30;
|
||||||
|
|
||||||
|
#ifdef DISCORD_SDK
|
||||||
sNetworkReconnectType = (gNetworkSystem == &gNetworkSystemDiscord)
|
sNetworkReconnectType = (gNetworkSystem == &gNetworkSystemDiscord)
|
||||||
? NS_DISCORD
|
? NS_DISCORD
|
||||||
: NS_SOCKET;
|
: NS_SOCKET;
|
||||||
|
#else
|
||||||
|
sNetworkReconnectType = NS_SOCKET;
|
||||||
|
#endif
|
||||||
|
|
||||||
gDiscordReconnecting = true;
|
gDiscordReconnecting = true;
|
||||||
network_shutdown(false, false, false);
|
network_shutdown(false, false, false);
|
||||||
|
|
|
@ -89,6 +89,7 @@ extern u8 gDebugPacketIdBuffer[];
|
||||||
extern u8 gDebugPacketSentBuffer[];
|
extern u8 gDebugPacketSentBuffer[];
|
||||||
extern u8 gDebugPacketOnBuffer;
|
extern u8 gDebugPacketOnBuffer;
|
||||||
extern u32 gNetworkStartupTimer;
|
extern u32 gNetworkStartupTimer;
|
||||||
|
extern bool gDiscordReconnecting;
|
||||||
|
|
||||||
// network.c
|
// network.c
|
||||||
void network_set_system(enum NetworkSystemType nsType);
|
void network_set_system(enum NetworkSystemType nsType);
|
||||||
|
|
Loading…
Reference in a new issue