|
|
@ -68,7 +68,7 @@ All rights reserved. |
|
|
|
#include "MenuItemItemButton.h" |
|
|
|
#include "MenuItemItemButton.h" |
|
|
|
#include "Merchant.h" |
|
|
|
#include "Merchant.h" |
|
|
|
#ifndef __EMSCRIPTEN__ |
|
|
|
#ifndef __EMSCRIPTEN__ |
|
|
|
#include "discord-files/discord.h" |
|
|
|
#include "discord.h" |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
INCLUDE_EMITTER_LIST |
|
|
|
INCLUDE_EMITTER_LIST |
|
|
@ -209,8 +209,9 @@ bool Crawler::OnUserCreate(){ |
|
|
|
utils::datafile::INITIAL_SETUP_COMPLETE=true; |
|
|
|
utils::datafile::INITIAL_SETUP_COMPLETE=true; |
|
|
|
|
|
|
|
|
|
|
|
ValidateGameStatus(); //Checks to make sure everything has been initialized properly.
|
|
|
|
ValidateGameStatus(); //Checks to make sure everything has been initialized properly.
|
|
|
|
|
|
|
|
#ifndef __EMSCRIPTEN__ |
|
|
|
SetupDiscord(); |
|
|
|
SetupDiscord(); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
@ -2301,22 +2302,22 @@ void Crawler::EndGame(){ |
|
|
|
gameEnd=true; |
|
|
|
gameEnd=true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
::discord::Result Crawler::SetupDiscord(){ |
|
|
|
#ifndef __EMSCRIPTEN__ |
|
|
|
#ifndef __EMSCRIPTEN__ |
|
|
|
::discord::Result Crawler::SetupDiscord(){ |
|
|
|
auto result=::discord::Core::Create(1186719371750555780,DiscordCreateFlags_NoRequireDiscord,&Discord); |
|
|
|
auto result=::discord::Core::Create(1186719371750555780,DiscordCreateFlags_NoRequireDiscord,&Discord); |
|
|
|
if(result==::discord::Result::Ok){ |
|
|
|
if(result==::discord::Result::Ok){ |
|
|
|
Discord->SetLogHook( |
|
|
|
Discord->SetLogHook( |
|
|
|
discord::LogLevel::Debug, [](discord::LogLevel level, const char* message) { |
|
|
|
discord::LogLevel::Debug, [](discord::LogLevel level, const char* message) { |
|
|
|
std::cerr << "Log(" << static_cast<uint32_t>(level) << "): " << message << "\n"; |
|
|
|
std::cerr << "Log(" << static_cast<uint32_t>(level) << "): " << message << "\n"; |
|
|
|
}); |
|
|
|
}); |
|
|
|
std::cout<<"Connected to Discord!"<<std::endl; |
|
|
|
std::cout<<"Connected to Discord!"<<std::endl; |
|
|
|
UpdateDiscordStatus("Main Menu",player.get()->GetClassName()); |
|
|
|
UpdateDiscordStatus("Main Menu",player.get()->GetClassName()); |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
std::cout<<"Could not connect to Discord. Error Code "<<int(result)<<std::endl; |
|
|
|
std::cout<<"Could not connect to Discord. Error Code "<<int(result)<<std::endl; |
|
|
|
} |
|
|
|
} |
|
|
|
return result; |
|
|
|
return result; |
|
|
|
#endif |
|
|
|
} |
|
|
|
} |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
void Crawler::UpdateDiscordStatus(std::string levelName,std::string className){ |
|
|
|
void Crawler::UpdateDiscordStatus(std::string levelName,std::string className){ |
|
|
|
#ifndef __EMSCRIPTEN__ |
|
|
|
#ifndef __EMSCRIPTEN__ |
|
|
|