mirror of
https://github.com/alliedmodders/sourcemod.git
synced 2025-12-06 18:08:36 +00:00
Compare commits
8 Commits
5f47159ace
...
a0748c7f65
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a0748c7f65 | ||
|
|
1819f491b5 | ||
|
|
2f8f7e80f4 | ||
|
|
97770fa508 | ||
|
|
fa8971eb5b | ||
|
|
2b5ad17fbc | ||
|
|
c18214ce79 | ||
|
|
1eac58a5b7 |
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@ -36,7 +36,7 @@ jobs:
|
|||||||
MYSQL_VERSION: '5.7'
|
MYSQL_VERSION: '5.7'
|
||||||
MMSOURCE_VERSION: '1.12'
|
MMSOURCE_VERSION: '1.12'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
path: sourcemod
|
path: sourcemod
|
||||||
|
|||||||
6
.github/workflows/mocktest.yml
vendored
6
.github/workflows/mocktest.yml
vendored
@ -12,20 +12,20 @@ jobs:
|
|||||||
mock:
|
mock:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
name: Clone sourcemod
|
name: Clone sourcemod
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
path: sourcemod
|
path: sourcemod
|
||||||
|
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
name: Clone metamod-source
|
name: Clone metamod-source
|
||||||
with:
|
with:
|
||||||
repository: alliedmodders/metamod-source
|
repository: alliedmodders/metamod-source
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
path: metamod-source
|
path: metamod-source
|
||||||
|
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
name: Clone hl2sdk-mock
|
name: Clone hl2sdk-mock
|
||||||
with:
|
with:
|
||||||
repository: alliedmodders/hl2sdk-mock
|
repository: alliedmodders/hl2sdk-mock
|
||||||
|
|||||||
2
.github/workflows/scripting.yml
vendored
2
.github/workflows/scripting.yml
vendored
@ -25,7 +25,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
ARCH: x86,x86_64
|
ARCH: x86,x86_64
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/translations.yml
vendored
2
.github/workflows/translations.yml
vendored
@ -10,7 +10,7 @@ jobs:
|
|||||||
update_translations:
|
update_translations:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@ jobs:
|
|||||||
check_translations:
|
check_translations:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
- uses: actions/setup-python@v6
|
- uses: actions/setup-python@v6
|
||||||
name: Setup Python 3.10
|
name: Setup Python 3.10
|
||||||
|
|||||||
@ -39,6 +39,8 @@
|
|||||||
#include <bridge/include/CoreProvider.h>
|
#include <bridge/include/CoreProvider.h>
|
||||||
#include <bridge/include/IVEngineServerBridge.h>
|
#include <bridge/include/IVEngineServerBridge.h>
|
||||||
|
|
||||||
|
static constexpr unsigned MAX_CONSOLE_LENGTH = 1024; // paired to MAX_CONSOLE_LENGTH in console.inc
|
||||||
|
|
||||||
static cell_t CheckCommandAccess(IPluginContext *pContext, const cell_t *params)
|
static cell_t CheckCommandAccess(IPluginContext *pContext, const cell_t *params)
|
||||||
{
|
{
|
||||||
if (params[1] == 0)
|
if (params[1] == 0)
|
||||||
@ -88,7 +90,7 @@ static cell_t CheckAccess(IPluginContext *pContext, const cell_t *params)
|
|||||||
|
|
||||||
static cell_t sm_PrintToServer(IPluginContext *pCtx, const cell_t *params)
|
static cell_t sm_PrintToServer(IPluginContext *pCtx, const cell_t *params)
|
||||||
{
|
{
|
||||||
char buffer[1024];
|
char buffer[MAX_CONSOLE_LENGTH];
|
||||||
char *fmt;
|
char *fmt;
|
||||||
int arg = 2;
|
int arg = 2;
|
||||||
|
|
||||||
@ -129,7 +131,7 @@ static cell_t sm_PrintToConsole(IPluginContext *pCtx, const cell_t *params)
|
|||||||
|
|
||||||
g_pSM->SetGlobalTarget(index);
|
g_pSM->SetGlobalTarget(index);
|
||||||
|
|
||||||
char buffer[1024];
|
char buffer[MAX_CONSOLE_LENGTH];
|
||||||
char *fmt;
|
char *fmt;
|
||||||
int arg = 3;
|
int arg = 3;
|
||||||
|
|
||||||
@ -154,7 +156,7 @@ static cell_t sm_ServerCommand(IPluginContext *pContext, const cell_t *params)
|
|||||||
{
|
{
|
||||||
g_pSM->SetGlobalTarget(SOURCEMOD_SERVER_LANGUAGE);
|
g_pSM->SetGlobalTarget(SOURCEMOD_SERVER_LANGUAGE);
|
||||||
|
|
||||||
char buffer[1024];
|
char buffer[MAX_CONSOLE_LENGTH];
|
||||||
size_t len;
|
size_t len;
|
||||||
{
|
{
|
||||||
DetectExceptions eh(pContext);
|
DetectExceptions eh(pContext);
|
||||||
@ -176,7 +178,7 @@ static cell_t sm_InsertServerCommand(IPluginContext *pContext, const cell_t *par
|
|||||||
{
|
{
|
||||||
g_pSM->SetGlobalTarget(SOURCEMOD_SERVER_LANGUAGE);
|
g_pSM->SetGlobalTarget(SOURCEMOD_SERVER_LANGUAGE);
|
||||||
|
|
||||||
char buffer[1024];
|
char buffer[MAX_CONSOLE_LENGTH];
|
||||||
size_t len;
|
size_t len;
|
||||||
{
|
{
|
||||||
DetectExceptions eh(pContext);
|
DetectExceptions eh(pContext);
|
||||||
@ -265,7 +267,7 @@ static cell_t ReplyToCommand(IPluginContext *pContext, const cell_t *params)
|
|||||||
g_pSM->SetGlobalTarget(params[1]);
|
g_pSM->SetGlobalTarget(params[1]);
|
||||||
|
|
||||||
/* Build the format string */
|
/* Build the format string */
|
||||||
char buffer[1024];
|
char buffer[MAX_CONSOLE_LENGTH];
|
||||||
size_t len;
|
size_t len;
|
||||||
{
|
{
|
||||||
DetectExceptions eh(pContext);
|
DetectExceptions eh(pContext);
|
||||||
@ -338,19 +340,19 @@ static cell_t RemoveServerTag(IPluginContext *pContext, const cell_t *params)
|
|||||||
|
|
||||||
REGISTER_NATIVES(consoleNatives)
|
REGISTER_NATIVES(consoleNatives)
|
||||||
{
|
{
|
||||||
{"CheckCommandAccess", CheckCommandAccess},
|
{"CheckCommandAccess", CheckCommandAccess},
|
||||||
{"CheckAccess", CheckAccess},
|
{"CheckAccess", CheckAccess},
|
||||||
{"PrintToServer", sm_PrintToServer},
|
{"PrintToServer", sm_PrintToServer},
|
||||||
{"PrintToConsole", sm_PrintToConsole},
|
{"PrintToConsole", sm_PrintToConsole},
|
||||||
{"ServerCommand", sm_ServerCommand},
|
{"ServerCommand", sm_ServerCommand},
|
||||||
{"InsertServerCommand", sm_InsertServerCommand},
|
{"InsertServerCommand", sm_InsertServerCommand},
|
||||||
{"ServerExecute", sm_ServerExecute},
|
{"ServerExecute", sm_ServerExecute},
|
||||||
{"ClientCommand", sm_ClientCommand},
|
{"ClientCommand", sm_ClientCommand},
|
||||||
{"FakeClientCommand", FakeClientCommand},
|
{"FakeClientCommand", FakeClientCommand},
|
||||||
{"ReplyToCommand", ReplyToCommand},
|
{"ReplyToCommand", ReplyToCommand},
|
||||||
{"GetCmdReplySource", GetCmdReplyTarget},
|
{"GetCmdReplySource", GetCmdReplyTarget},
|
||||||
{"SetCmdReplySource", SetCmdReplyTarget},
|
{"SetCmdReplySource", SetCmdReplyTarget},
|
||||||
{"AddServerTag", AddServerTag},
|
{"AddServerTag", AddServerTag},
|
||||||
{"RemoveServerTag", RemoveServerTag},
|
{"RemoveServerTag", RemoveServerTag},
|
||||||
{NULL, NULL}
|
{NULL, NULL}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -37,6 +37,11 @@
|
|||||||
|
|
||||||
#define INVALID_FCVAR_FLAGS (-1)
|
#define INVALID_FCVAR_FLAGS (-1)
|
||||||
|
|
||||||
|
#define MAX_CONSOLE_LENGTH 1024 /**< Maximum buffer size for console messages */
|
||||||
|
|
||||||
|
#define COMMAND_MAX_ARGC 64 /**< Maxmimum allowed command argument count */
|
||||||
|
#define COMMAND_MAX_LENGTH 512 /**< Maxmimum allowed length of a command argument */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Console variable query helper values.
|
* Console variable query helper values.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user