Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixup discord rich presence application ID/Name, 64-bit discord integration #195

Merged
merged 3 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion codemp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,11 @@ if(BuildMPEngine)
elseif(MSVC AND CMAKE_SIZEOF_VOID_P EQUAL 4)
set(MPEngineIncludeDirectories ${MPEngineIncludeDirectories} ${OpenJKLibDir}/discord-rpc/include)
set(MPEngineDefines ${MPEngineDefines} "DISCORD")
set(MPEngineLibraries ${MPEngineLibraries} ${OpenJKLibDir}/discord-rpc/lib/discord-rpc.lib)
set(MPEngineLibraries ${MPEngineLibraries} ${OpenJKLibDir}/discord-rpc/lib/x86/discord-rpc.lib)
elseif(MSVC AND CMAKE_SIZEOF_VOID_P EQUAL 8)
set(MPEngineIncludeDirectories ${MPEngineIncludeDirectories} ${OpenJKLibDir}/discord-rpc/include)
set(MPEngineDefines ${MPEngineDefines} "DISCORD")
set(MPEngineLibraries ${MPEngineLibraries} ${OpenJKLibDir}/discord-rpc/lib/x64/discord-rpc.lib)
endif()
endif(BuildDiscordRichPresence)

Expand Down
2 changes: 1 addition & 1 deletion codemp/cgame/cg_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ typedef struct playerEntity_s {
#define DEFAULT_MALE_SOUNDPATH "chars/mp_generic_male/misc"//"chars/kyle/misc"

//Let's use 14 bytes because OpenJK and JA++ game modules both use 16 bytes buffer for color1, so if we support up to 16 only, we can pretty much use this on any server.
//The remaining 2 bytes are to support the actual saber colors, since EternalJK supports up to 12 colors, we need to reserve 2 bytes for the color.
//The remaining 2 bytes are to support the actual saber colors, since TaystJK supports up to 12 colors, we need to reserve 2 bytes for the color.
#define MAX_COSMETIC_LENGTH 14

#define COSMETIC_HATS_PATH "models/cosmetics/hats/"
Expand Down
6 changes: 3 additions & 3 deletions codemp/cgame/hud_strafehelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ along with this program; if not, see <https://www.gnu.org/licenses/>.
===========================================================================
*/

#ifndef ETERNALJK_HUD_STRAFEHELPER_H
#define ETERNALJK_HUD_STRAFEHELPER_H
#ifndef TAYSTJK_HUD_STRAFEHELPER_H
#define TAYSTJK_HUD_STRAFEHELPER_H

#include "cg_local.h"
#include "../ui/ui_shared.h"
Expand Down Expand Up @@ -333,4 +333,4 @@ int maxSpeedSample;
dfstate state;
speedgraph_t speedgraph;

#endif //ETERNALJK_HUD_STRAFEHELPER_H
#endif //TAYSTJK_HUD_STRAFEHELPER_H
4 changes: 2 additions & 2 deletions codemp/cgame/hud_tribes.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef ETERNALJK_HUD_TRIBES_H
#define ETERNALJK_HUD_TRIBES_H
#ifndef TAYSTJK_HUD_TRIBES_H
#define TAYSTJK_HUD_TRIBES_H

//includes
#include "cg_local.h"
Expand Down
2 changes: 1 addition & 1 deletion codemp/client/cl_discordrpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ You need to link the static library also 'discord_rpc.lib'.

//Author: Blackwolf
//This is my Application ID of the Discord Developer section, feel free to use it.
static const char* APPLICATION_ID = "459923453139746816";
static const char* APPLICATION_ID = "1235827127321100338";

typedef struct statusIcon_s {
char *string;
Expand Down
2 changes: 1 addition & 1 deletion codemp/ui/ui_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ typedef struct playerInfo_s {
#define MAX_SCROLLTEXT_LINES 64

//Let's use 14 bytes because OpenJK and JA++ game modules both use 16 bytes buffer for color1, so if we support up to 16 only, we can pretty much use this on any server.
//The remaining 2 bytes are to support the actual saber colors, since EternalJK supports up to 12 colors, we need to reserve 2 bytes for the color.
//The remaining 2 bytes are to support the actual saber colors, since TaystJK supports up to 12 colors, we need to reserve 2 bytes for the color.
#define MAX_COSMETIC_LENGTH 14

typedef struct aliasInfo_s {
Expand Down
2 changes: 1 addition & 1 deletion codemp/ui/ui_xcvar.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#endif

XCVAR_DEF( capturelimit, "0", NULL, CVAR_ARCHIVE|CVAR_NORESTART|CVAR_SERVERINFO ) // fixme init'd to 8 in game module
XCVAR_DEF( cl_ratioFix, "1", UI_Set2DRatio, CVAR_ARCHIVE ) //cvar name is shared in jaPRO cgame & EternalJK engine
XCVAR_DEF( cl_ratioFix, "1", UI_Set2DRatio, CVAR_ARCHIVE ) //cvar name is shared in jaPRO cgame & TaystJK engine
XCVAR_DEF( cg_drawCrosshair, "1", NULL, CVAR_ARCHIVE )
XCVAR_DEF( cg_drawCrosshairNames, "1", NULL, CVAR_ARCHIVE )
XCVAR_DEF( cg_marks, "1", NULL, CVAR_ARCHIVE )
Expand Down
4 changes: 2 additions & 2 deletions codemp/ui/ui_xdocs.complete.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
/* --------------------------------------------------- */
/* CVARS */

// EternalJK HUD cvars:
// TaystJK HUD cvars:

//XDOCS_CVAR_DEF("cg_", "Description",
//"More somethings if needed." NL
Expand Down Expand Up @@ -345,7 +345,7 @@ XDOCS_CVAR_DEF("cg_teamChatsOnly", "Hide non-team chat messages",
/* --------------------------------------------------- */
/* COMMANDS */

// EternalJK commands:
// TaystJK commands:

XDOCS_CMD_DEF("clientlist", "Displays a list of all connected clients and their real client numbers")

Expand Down
4 changes: 2 additions & 2 deletions codemp/ui/ui_xdocs.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
/* --------------------------------------------------- */
/* CVARS */

// EternalJK HUD cvars:
// TaystJK HUD cvars:
//XDOCS_CVAR_DEF("cg_", "Description",
//"More somethings if needed." NL
//SETTING("0", "something something probably (Base behavior)") NL
Expand Down Expand Up @@ -554,7 +554,7 @@ XDOCS_CVAR_DEF("cg_pitchHudRgba", "Color of the pitch HUD",""
/* --------------------------------------------------- */
/* COMMANDS */

// EternalJK console commands:
// TaystJK console commands:

XDOCS_CMD_DEF("clientlist", "Displays a list of all connected clients and their real client numbers")

Expand Down
Binary file added lib/discord-rpc/lib/x64/discord-rpc.lib
Binary file not shown.
8 changes: 4 additions & 4 deletions shared/sys/sys_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ enum SearchPathFlag
{
SEARCH_PATH_MOD = 1 << 0,
SEARCH_PATH_BASE = 1 << 1,
SEARCH_PATH_ETERNALJK = 1 << 2,
SEARCH_PATH_TAYSTJK = 1 << 2,
SEARCH_PATH_ROOT = 1 << 3
};

Expand All @@ -412,7 +412,7 @@ static void *Sys_LoadDllFromPaths( const char *filename, const char *gamedir, co
}
}

if (searchFlags & SEARCH_PATH_ETERNALJK)
if (searchFlags & SEARCH_PATH_TAYSTJK)
{
for (size_t i = 0; i < numPaths; i++)
{
Expand Down Expand Up @@ -530,7 +530,7 @@ void *Sys_LoadLegacyGameDll( const char *name, VMMainProc **vmMain, SystemCallPr
};
size_t numPaths = ARRAY_LEN( searchPaths );

libHandle = Sys_LoadDllFromPaths( filename, gamedir, searchPaths, numPaths, SEARCH_PATH_BASE | SEARCH_PATH_ETERNALJK | SEARCH_PATH_MOD, __FUNCTION__ );
libHandle = Sys_LoadDllFromPaths( filename, gamedir, searchPaths, numPaths, SEARCH_PATH_BASE | SEARCH_PATH_TAYSTJK | SEARCH_PATH_MOD, __FUNCTION__ );
if ( !libHandle )
return NULL;
}
Expand Down Expand Up @@ -612,7 +612,7 @@ void *Sys_LoadGameDll( const char *name, GetModuleAPIProc **moduleAPI )
};
size_t numPaths = ARRAY_LEN( searchPaths );

libHandle = Sys_LoadDllFromPaths( filename, gamedir, searchPaths, numPaths, SEARCH_PATH_BASE | SEARCH_PATH_ETERNALJK | SEARCH_PATH_MOD, __FUNCTION__ );
libHandle = Sys_LoadDllFromPaths( filename, gamedir, searchPaths, numPaths, SEARCH_PATH_BASE | SEARCH_PATH_TAYSTJK | SEARCH_PATH_MOD, __FUNCTION__ );
if ( !libHandle )
return NULL;
}
Expand Down