moved from orca to concord
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Daniel Wolf 2022-09-23 16:28:05 -04:00
parent f7fe5602ac
commit 497f00a064
Signed by: nephatrine
GPG Key ID: 59D70EC2E4AAB4D0
6 changed files with 573 additions and 541 deletions

View File

@ -13,7 +13,7 @@ steps:
- mkdir build-alpine
- cd build-alpine
- cmake -GNinja -DNXPACKAGE_TRIPLET="x86_64-alpine-linux-musl" -DQ2ADMIN_NAME="game" ..
- ninja orca && ninja
- ninja concord && ninja
- tar -czvf q2admin-nxmod_x86_64-alpine-linux-musl.tar.gz game.so
- cd ../data
- tar -czvf ../build-alpine/q2admin-nxmod_noarch.tar.gz *.txt *.json
@ -23,7 +23,7 @@ steps:
- mkdir build-ubuntu
- cd build-ubuntu
- cmake -GNinja -DNXPACKAGE_TRIPLET="x86_64-ubuntu-linux-gnu" -DQ2ADMIN_NAME="game" ..
- ninja orca && ninja
- ninja concord && ninja
- tar -czvf q2admin-nxmod_x86_64-ubuntu-linux-gnu.tar.gz game.so
- name: build-redhat
image: nephatrine/nxbuilder:almalinux
@ -31,7 +31,7 @@ steps:
- mkdir build-redhat
- cd build-redhat
- cmake -GNinja -DNXPACKAGE_TRIPLET="x86_64-redhat-linux-gnu" -DQ2ADMIN_NAME="game" ..
- ninja orca && ninja
- ninja concord && ninja
- tar -czvf q2admin-nxmod_x86_64-redhat-linux-gnu.tar.gz game.so
- name: publish-web
image: nephatrine/nxbuilder:alpine
@ -96,6 +96,6 @@ trigger:
---
kind: signature
hmac: ba6a8c88e2f8853167a35f8ed4bf2d90ab44874fd356fd3755cf56bdc993bc20
hmac: 44d81da907d41e63b6d0fe5c3392c74a31d7ce3111f61d94c3df9349bb853daf
...

View File

@ -19,7 +19,7 @@
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
project(
Q2Admin
VERSION 1.18.0
VERSION 1.19.0
DESCRIPTION "Quake II Game Proxy Mod"
HOMEPAGE_URL "https://code.nephatrine.net/nephatrine/q2admin-nxmod"
LANGUAGES C)
@ -119,12 +119,12 @@ if(NX_TARGET_PLATFORM_POSIX AND NX_TARGET_ARCHITECTURE_NATIVE)
endif()
cmake_dependent_option(WITH_DISCORD "Enable Discord Bot" ON "bCanDiscord" OFF)
cmake_dependent_option(WITH_DISCORD_OUTGOING "Enable Game->Discord Bridge" ON "WITH_DISCORD" OFF)
# ==== Orca Target ====
unset(ORCA_DISCORD_INCLUDE_DIR)
unset(ORCA_DISCORD_LIBRARY)
unset(DISCORD_INCLUDE_DIR)
unset(DISCORD_LIBRARY)
unset(DISCORD_DEPENDENCIES)
if(WITH_DISCORD)
list(APPEND Q2ADMIN_SOURCES "src/zb_discord.c" "src/zb_discord.h")
@ -132,24 +132,20 @@ if(WITH_DISCORD)
include(ExternalProject)
ExternalProject_Add(
orca
GIT_REPOSITORY "https://github.com/cee-studio/orca.git"
GIT_TAG "ef7cc8d1eca1468c75fde7ba9f183b41c26ef1bc"
GIT_SHALLOW ON
concord
GIT_REPOSITORY "https://github.com/Cogmasters/concord.git"
GIT_TAG "1da91a6641f668042fecd4a318923087bdb87739"
GIT_SHALLOW OFF
GIT_PROGRESS ON
CONFIGURE_COMMAND ""
BUILD_COMMAND make discord github
BUILD_COMMAND CFLAGS=\"-fPIC\" make
BUILD_IN_SOURCE ON
INSTALL_COMMAND "${CMAKE_COMMAND}" -E env PREFIX="<INSTALL_DIR>" make install)
ExternalProject_Get_Property(orca INSTALL_DIR)
set(ORCA_DISCORD_INCLUDE_DIR "${INSTALL_DIR}/include")
set(ORCA_DISCORD_LIBRARY "${INSTALL_DIR}/lib/libdiscord.a")
set(ORCA_DISCORD_DEPENDENCIES "curl" "Threads::Threads")
if(WITH_DISCORD_OUTGOING)
list(APPEND Q2ADMIN_DEFINES "USE_DISCORD_OUTGOING=1")
endif()
ExternalProject_Get_Property(concord INSTALL_DIR)
set(DISCORD_INCLUDE_DIR "${INSTALL_DIR}/include")
set(DISCORD_LIBRARY "${INSTALL_DIR}/lib/libdiscord.a")
set(DISCORD_DEPENDENCIES "curl" "Threads::Threads")
endif()
# ==== Q2Admin Target ====
@ -160,13 +156,13 @@ nx_target(
GENERATE_EXPORT "generated/g_export.h" Q2ADMIN
GENERATE_VERSION "generated/g_version.h" Q2ADMIN
DEFINES PRIVATE ${Q2ADMIN_DEFINES}
DEPENDS PRIVATE "${ORCA_DISCORD_LIBRARY}" ${ORCA_DISCORD_DEPENDENCIES} ${CMAKE_DL_LIBS}
DEPENDS PRIVATE "${DISCORD_LIBRARY}" ${DISCORD_DEPENDENCIES} ${CMAKE_DL_LIBS}
FEATURES PRIVATE "c_std_99"
INCLUDES PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/generated" "${ORCA_DISCORD_INCLUDE_DIR}"
INCLUDES PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/generated" "${DISCORD_INCLUDE_DIR}"
SOURCES PRIVATE ${Q2ADMIN_SOURCES})
if(WITH_DISCORD)
add_dependencies("${Q2ADMIN_TARGETS}" "orca")
add_dependencies("${Q2ADMIN_TARGETS}" "concord")
endif()
# ==== Project End ====

View File

@ -1,7 +1,7 @@
# Q2Admin-NXMod
This is a fork of [Q2Admin](https://github.com/tastyspleen/q2admin-tsmod) with some compatibility tweaks and
experimental Discord support using the [Orca](https://github.com/cee-studio/orca) library.
experimental Discord support using the [Concord](https://github.com/Cogmasters/concord) library.
[![Build Status](https://ci.nephatrine.net/api/badges/nephatrine/q2admin-nxmod/status.svg?ref=refs/heads/master)](https://ci.nephatrine.net/nephatrine/q2admin-nxmod)
@ -12,16 +12,23 @@ experimental Discord support using the [Orca](https://github.com/cee-studio/orca
The optional Discord integration passes many messages from Quake II to Discord automatically such as death
messages, client connections, and chat. There is currently no way to configure that more precisely.
Chat in the Discord channel is NOT automatically mirrored to Quake II outside of the `!say` command.
Chat in the Discord channel is NOT automatically mirrored to Quake II outside of the say commands.
The following commands are implemented:
The following prefix commands are implemented if the bot has MESSAGE_CONTENT intent:
- `!say <message>`: Broadcasts a message to all players over in-game chat.
- `!rcon <command>`: Allows an whitelisted user or group to run Quake II server commands over Discord.
- `!ping`: Returns a *pong* from the bot. Just there to test connectivity.
Note that in most cases, any `!rcon` commands that rely on output being shown to the user will most likely
not have that output mirrored to Discord.
If passed an application id, the bot registers these as the following slash commands:
- `/q2say`
- `/q2rcon`
- `/q2ping`
Note that in most cases, any "rcon" commands that rely on output being shown to the user will most likely
not have that output mirrored to Discord, but instead the server terminal as they work the same way as
typing the command at the terminal rather than using the in-game rcon commands.
## Building
@ -31,11 +38,11 @@ The simplest way to build is to perform the following from the source directory.
mkdir build
cd build
cmake -GNinja ..
ninja orca
ninja concord
ninja
```
If you are on a platform where the Discord support is not functional, you can skip the `ninja orca` command.
If you are on a platform where the Discord support is not functional, you can skip the `ninja concord` command.
## Installation
@ -48,22 +55,20 @@ chosen mod directory.
## Configuration
The `q2discord.json` file contains the bot token and additional configuration for the bot itself - such as
the command prefix.
the command prefix and bot token.
Additionally, the following in-game console variables control some functionality:
- `discord_json`: Name of json file to read. Defaults to "*q2discord.json*".
- `discord_channel`: A single Discord channel ID to act in and listen to.
- `discord_thread`: If set, create a thread in the channel with this name.
- `discord_rcuser`: A single Discord user ID to allow the !rcon command.
- `discord_rcgroup`: A single Discord role ID to allow the !rcon command.
- `discord_appid`: The Discord application ID to allow slash command registration.
- `d_bot_json`: Name of json file to read. Defaults to "*q2discord.json*".
- `d_application_id`: The Discord application ID to allow slash command registration.
- `d_channel_id`: A single Discord channel ID to act in and listen to.
- `d_rcon_user_id`: A single Discord user ID to allow the (q2)rcon command.
- `d_rcon_role_id`: A single Discord role ID to allow the (q2)rcon command.
These options control outgoing message mirroring from in-game to discord:
- `mirror_high`: Mirror HIGH messages such as player connections and server status.
- `mirror_misc`: Mirror MEDIUM messages such as death messages.
- `mirror_chat`: Mirror CHAT messages such as player chat.
- `mirror_unsafe`: Send messages without WITH_DISCORD_OUTGOING. May be unstable!
- `d_mirror_high`: Mirror HIGH messages such as player connections and server status.
- `d_mirror_misc`: Mirror MEDIUM messages such as death messages.
- `d_mirror_chat`: Mirror CHAT messages such as player chat.
The standard Q2Admin configuration parameters are documented within the various configuration files.

View File

@ -92,10 +92,6 @@ void ShutdownGame (void)
STARTPERFORMANCE(2);
}
#ifdef USE_DISCORD
q2d_message_to_discord2(PRINT_HIGH, "**=== Closing Time ===**");
#endif
// reset the password just in case something has gone wrong...
lrcon_reset_rcon_password(0, 0, 0);
dllglobals->Shutdown();

File diff suppressed because it is too large Load Diff

View File

@ -408,9 +408,6 @@ void InitGame (void)
if(q2adminrunmode == 0)
{
dllglobals->Init();
#ifdef USE_DISCORD
q2d_message_to_discord2(PRINT_HIGH, "**=== Open For Business ===**");
#endif
copyDllInfo();
return;
}
@ -420,10 +417,6 @@ void InitGame (void)
dllglobals->Init(); //be carefull with all functions called from this one (like dprintf_internal) to not use proxyinfo pointer because it's not initialized yet. -Harven
STOPPERFORMANCE(2, "mod->InitGame", 0, NULL);
#ifdef USE_DISCORD
q2d_message_to_discord2(PRINT_HIGH, "**=== Open For Business ===**");
#endif
copyDllInfo();
maxclients = gi.cvar ("maxclients", "4", 0);