Compare commits
29
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2a9deb6a64 | ||
|
|
351e406f85 | ||
|
|
d6e518838f | ||
|
|
9e39f18230 | ||
|
|
3dd1e5a318 | ||
|
|
23e1c0b71e | ||
|
|
a1436cd205 | ||
|
|
0d320b7922 | ||
|
|
b2a0d0e4da | ||
|
|
273f058da9 | ||
|
|
c6f751bb67 | ||
|
|
00b7ac5a39 | ||
|
|
c0686dc4f9 | ||
|
|
7ab3a3cfd9 | ||
|
|
c3102c7e9f | ||
|
|
77f4ddf2c2 | ||
|
|
024ae2b9ed | ||
|
|
8a4295d699 | ||
|
|
f05e39afe1 | ||
|
|
3b1fb85bb8 | ||
|
|
a405f85eee | ||
|
|
78511afa4c | ||
|
|
c37c4f830f | ||
|
|
4fe2ae780b | ||
|
|
e02e6bcb4f | ||
|
|
c7392aeded | ||
|
|
14247af323 | ||
|
|
32cb00a4c6 | ||
|
|
5293815bf6 |
@@ -0,0 +1,12 @@
|
||||
# GitHub views all .h files as C, let's assume it's C++
|
||||
*.h linguist-language=c++
|
||||
|
||||
# Internal tools overriding
|
||||
tools/* linguist-vendored
|
||||
editor/* linguist-vendored
|
||||
|
||||
# Third-party overriding
|
||||
extensions/curl/curl-src/* linguist-vendored
|
||||
extensions/geoip/GeoIP.c linguist-vendored
|
||||
extensions/geoip/GeoIP.h linguist-vendored
|
||||
extensions/sqlite/sqlite-source/* linguist-vendored
|
||||
@@ -379,6 +379,16 @@ class SMConfig(object):
|
||||
def configure_windows(self, cxx):
|
||||
cxx.defines += ['WIN32', '_WINDOWS']
|
||||
|
||||
def add_libamtl(self):
|
||||
# Add libamtl.
|
||||
self.libamtl = {}
|
||||
for arch in self.archs:
|
||||
def get_configure_fn(arch):
|
||||
return lambda builder, name: self.StaticLibrary(builder, name, arch)
|
||||
extra_vars = {'Configure': get_configure_fn(arch)}
|
||||
libamtl = builder.Build('public/amtl/amtl/AMBuilder', extra_vars)
|
||||
self.libamtl[arch] = libamtl.binary
|
||||
|
||||
def AddVersioning(self, binary, arch):
|
||||
if builder.target.platform == 'windows':
|
||||
binary.sources += ['version.rc']
|
||||
@@ -613,6 +623,7 @@ SM = SMConfig()
|
||||
SM.detectProductVersion()
|
||||
SM.detectSDKs()
|
||||
SM.configure()
|
||||
SM.add_libamtl()
|
||||
|
||||
if SM.use_auto_versioning():
|
||||
SM.generated_headers = builder.Build(
|
||||
|
||||
+4
-99
@@ -30,7 +30,6 @@
|
||||
*/
|
||||
|
||||
#include "PlayerManager.h"
|
||||
#include "sourcemod.h"
|
||||
#include "IAdminSystem.h"
|
||||
#include "ConCmdManager.h"
|
||||
#include "MenuStyle_Valve.h"
|
||||
@@ -93,12 +92,6 @@ SH_DECL_EXTERN1_void(ConCommand, Dispatch, SH_NOATTRIB, false, const CCommand &)
|
||||
#else
|
||||
SH_DECL_EXTERN0_void(ConCommand, Dispatch, SH_NOATTRIB, false);
|
||||
#endif
|
||||
SH_DECL_HOOK2_void(IVEngineServer, ClientPrintf, SH_NOATTRIB, 0, edict_t *, const char *);
|
||||
|
||||
static void PrintfBuffer_FrameAction(void *data)
|
||||
{
|
||||
g_Players.OnPrintfFrameAction(reinterpret_cast<unsigned int>(data));
|
||||
}
|
||||
|
||||
ConCommand *maxplayersCmd = NULL;
|
||||
|
||||
@@ -179,7 +172,6 @@ void PlayerManager::OnSourceModAllInitialized()
|
||||
#elif SOURCE_ENGINE > SE_EYE // 2013/orangebox, but not original orangebox.
|
||||
SH_ADD_HOOK(IServerGameDLL, SetServerHibernation, gamedll, SH_MEMBER(this, &PlayerManager::OnServerHibernationUpdate), true);
|
||||
#endif
|
||||
SH_ADD_HOOK(IVEngineServer, ClientPrintf, engine, SH_MEMBER(this, &PlayerManager::OnClientPrintf), false);
|
||||
|
||||
sharesys->AddInterface(NULL, this);
|
||||
|
||||
@@ -233,7 +225,6 @@ void PlayerManager::OnSourceModShutdown()
|
||||
#elif SOURCE_ENGINE > SE_EYE // 2013/orangebox, but not original orangebox.
|
||||
SH_REMOVE_HOOK(IServerGameDLL, SetServerHibernation, gamedll, SH_MEMBER(this, &PlayerManager::OnServerHibernationUpdate), true);
|
||||
#endif
|
||||
SH_REMOVE_HOOK(IVEngineServer, ClientPrintf, engine, SH_MEMBER(this, &PlayerManager::OnClientPrintf), false);
|
||||
|
||||
/* Release forwards */
|
||||
forwardsys->ReleaseForward(m_clconnect);
|
||||
@@ -855,88 +846,6 @@ void PlayerManager::OnClientDisconnect_Post(edict_t *pEntity)
|
||||
}
|
||||
}
|
||||
|
||||
void PlayerManager::OnClientPrintf(edict_t *pEdict, const char *szMsg)
|
||||
{
|
||||
int client = IndexOfEdict(pEdict);
|
||||
|
||||
CPlayer &player = m_Players[client];
|
||||
if (!player.IsConnected())
|
||||
RETURN_META(MRES_IGNORED);
|
||||
|
||||
INetChannel *pNetChan = static_cast<INetChannel *>(engine->GetPlayerNetInfo(client));
|
||||
if (pNetChan == NULL)
|
||||
RETURN_META(MRES_IGNORED);
|
||||
|
||||
size_t nMsgLen = strlen(szMsg);
|
||||
#if SOURCE_ENGINE == SE_EPISODEONE
|
||||
static const int nNumBitsWritten = 0;
|
||||
#else
|
||||
int nNumBitsWritten = pNetChan->GetNumBitsWritten(false); // SVC_Print uses unreliable netchan
|
||||
#endif
|
||||
|
||||
// if the msg is bigger than allowed then just let it fail
|
||||
if (nMsgLen + 1 >= SVC_Print_BufferSize) // +1 for NETMSG_TYPE_BITS
|
||||
RETURN_META(MRES_IGNORED);
|
||||
|
||||
// enqueue msgs if we'd overflow the SVC_Print buffer (+7 as ceil)
|
||||
if (!player.m_PrintfBuffer.empty() || (nNumBitsWritten + NETMSG_TYPE_BITS + 7) / 8 + nMsgLen >= SVC_Print_BufferSize)
|
||||
{
|
||||
// Don't send any more messages for this player until the buffer is empty.
|
||||
// Queue up a gameframe hook to empty the buffer (if we haven't already)
|
||||
if (player.m_PrintfBuffer.empty())
|
||||
g_SourceMod.AddFrameAction(PrintfBuffer_FrameAction, (void *)(uintptr_t)player.GetSerial());
|
||||
|
||||
player.m_PrintfBuffer.append(szMsg);
|
||||
|
||||
RETURN_META(MRES_SUPERCEDE);
|
||||
}
|
||||
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void PlayerManager::OnPrintfFrameAction(unsigned int serial)
|
||||
{
|
||||
int client = GetClientFromSerial(serial);
|
||||
CPlayer &player = m_Players[client];
|
||||
if (!player.IsConnected())
|
||||
{
|
||||
player.ClearNetchannelQueue();
|
||||
return;
|
||||
}
|
||||
|
||||
INetChannel *pNetChan = static_cast<INetChannel *>(engine->GetPlayerNetInfo(client));
|
||||
if (pNetChan == NULL)
|
||||
{
|
||||
player.ClearNetchannelQueue();
|
||||
return;
|
||||
}
|
||||
|
||||
while (!player.m_PrintfBuffer.empty())
|
||||
{
|
||||
#if SOURCE_ENGINE == SE_EPISODEONE
|
||||
static const int nNumBitsWritten = 0;
|
||||
#else
|
||||
int nNumBitsWritten = pNetChan->GetNumBitsWritten(false); // SVC_Print uses unreliable netchan
|
||||
#endif
|
||||
|
||||
ke::AString &string = player.m_PrintfBuffer.front();
|
||||
|
||||
// stop if we'd overflow the SVC_Print buffer (+7 as ceil)
|
||||
if ((nNumBitsWritten + NETMSG_TYPE_BITS + 7) / 8 + string.length() >= SVC_Print_BufferSize)
|
||||
break;
|
||||
|
||||
SH_CALL(engine, &IVEngineServer::ClientPrintf)(player.m_pEdict, string.chars());
|
||||
|
||||
player.m_PrintfBuffer.popFront();
|
||||
}
|
||||
|
||||
if (!player.m_PrintfBuffer.empty())
|
||||
{
|
||||
// continue processing it on the next gameframe as buffer is not empty
|
||||
g_SourceMod.AddFrameAction(PrintfBuffer_FrameAction, (void *)(uintptr_t)player.GetSerial());
|
||||
}
|
||||
}
|
||||
|
||||
void ClientConsolePrint(edict_t *e, const char *fmt, ...)
|
||||
{
|
||||
char buffer[512];
|
||||
@@ -1565,7 +1474,10 @@ void PlayerManager::InvalidatePlayer(CPlayer *pPlayer)
|
||||
}
|
||||
}
|
||||
|
||||
m_UserIdLookUp[engine->GetPlayerUserId(pPlayer->m_pEdict)] = 0;
|
||||
auto userid = engine->GetPlayerUserId(pPlayer->m_pEdict);
|
||||
if (userid != -1)
|
||||
m_UserIdLookUp[userid] = 0;
|
||||
|
||||
pPlayer->Disconnect();
|
||||
}
|
||||
|
||||
@@ -2236,13 +2148,6 @@ void CPlayer::Disconnect()
|
||||
#if SOURCE_ENGINE == SE_CSGO
|
||||
m_LanguageCookie = InvalidQueryCvarCookie;
|
||||
#endif
|
||||
ClearNetchannelQueue();
|
||||
}
|
||||
|
||||
void CPlayer::ClearNetchannelQueue(void)
|
||||
{
|
||||
while (!m_PrintfBuffer.empty())
|
||||
m_PrintfBuffer.popFront();
|
||||
}
|
||||
|
||||
void CPlayer::SetName(const char *name)
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
#include <sh_list.h>
|
||||
#include <sh_vector.h>
|
||||
#include <am-string.h>
|
||||
#include <am-deque.h>
|
||||
#include "ConVarManager.h"
|
||||
|
||||
#include <steam/steamclientpublic.h>
|
||||
@@ -124,7 +123,6 @@ private:
|
||||
bool IsAuthStringValidated();
|
||||
bool SetEngineString();
|
||||
bool SetCSteamID();
|
||||
void ClearNetchannelQueue(void);
|
||||
private:
|
||||
bool m_IsConnected = false;
|
||||
bool m_IsInGame = false;
|
||||
@@ -154,7 +152,6 @@ private:
|
||||
#if SOURCE_ENGINE == SE_CSGO
|
||||
QueryCvarCookie_t m_LanguageCookie = InvalidQueryCvarCookie;
|
||||
#endif
|
||||
ke::Deque<ke::AString> m_PrintfBuffer;
|
||||
};
|
||||
|
||||
class PlayerManager :
|
||||
@@ -193,8 +190,6 @@ public:
|
||||
void OnClientSettingsChanged(edict_t *pEntity);
|
||||
//void OnClientSettingsChanged_Pre(edict_t *pEntity);
|
||||
void OnServerHibernationUpdate(bool bHibernating);
|
||||
void OnClientPrintf(edict_t *pEdict, const char *szMsg);
|
||||
void OnPrintfFrameAction(unsigned int serial);
|
||||
public: //IPlayerManager
|
||||
void AddClientListener(IClientListener *listener);
|
||||
void RemoveClientListener(IClientListener *listener);
|
||||
@@ -272,9 +267,6 @@ private:
|
||||
int m_SourceTVUserId;
|
||||
int m_ReplayUserId;
|
||||
bool m_bInCCKVHook;
|
||||
private:
|
||||
static const int NETMSG_TYPE_BITS = 5; // SVC_Print overhead for netmsg type
|
||||
static const int SVC_Print_BufferSize = 2048 - 1; // -1 for terminating \0
|
||||
};
|
||||
|
||||
#if SOURCE_ENGINE >= SE_ORANGEBOX
|
||||
|
||||
@@ -1364,7 +1364,7 @@ bool CLocalExtension::IsSameFile(const char *file)
|
||||
|
||||
bool CRemoteExtension::IsSameFile(const char *file)
|
||||
{
|
||||
/* :TODO: this could be better, but no one uses this API anyway. */
|
||||
return strcmp(file, m_Path.c_str()) == 0;
|
||||
/* Check full path and name passed in from LoadExternal */
|
||||
return strcmp(file, m_Path.c_str()) == 0 || strcmp(file, m_File.c_str()) == 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -53,6 +53,10 @@ static CBaseEntity *FindEntityByNetClass(int start, const char *classname)
|
||||
if (network == NULL)
|
||||
continue;
|
||||
|
||||
IHandleEntity *pHandleEnt = network->GetEntityHandle();
|
||||
if (pHandleEnt == NULL)
|
||||
continue;
|
||||
|
||||
ServerClass *sClass = network->GetServerClass();
|
||||
const char *name = sClass->GetName();
|
||||
|
||||
|
||||
@@ -998,6 +998,22 @@ static cell_t smn_TRGetHitGroup(IPluginContext *pContext, const cell_t *params)
|
||||
return tr->hitgroup;
|
||||
}
|
||||
|
||||
static cell_t smn_TRGetHitBoxIndex(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
sm_trace_t *tr;
|
||||
HandleError err;
|
||||
HandleSecurity sec(pContext->GetIdentity(), myself->GetIdentity());
|
||||
|
||||
if (params[1] == BAD_HANDLE)
|
||||
{
|
||||
tr = &g_Trace;
|
||||
} else if ((err = handlesys->ReadHandle(params[1], g_TraceHandle, &sec, (void **)&tr)) != HandleError_None) {
|
||||
return pContext->ThrowNativeError("Invalid Handle %x (error %d)", params[1], err);
|
||||
}
|
||||
|
||||
return tr->hitbox;
|
||||
}
|
||||
|
||||
static cell_t smn_TRGetEntityIndex(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
sm_trace_t *tr;
|
||||
@@ -1102,6 +1118,7 @@ sp_nativeinfo_t g_TRNatives[] =
|
||||
{"TR_StartSolid", smn_TRStartSolid},
|
||||
{"TR_DidHit", smn_TRDidHit},
|
||||
{"TR_GetHitGroup", smn_TRGetHitGroup},
|
||||
{"TR_GetHitBoxIndex", smn_TRGetHitBoxIndex},
|
||||
{"TR_ClipRayToEntity", smn_TRClipRayToEntity},
|
||||
{"TR_ClipRayToEntityEx", smn_TRClipRayToEntityEx},
|
||||
{"TR_ClipRayHullToEntity", smn_TRClipRayHullToEntity},
|
||||
|
||||
@@ -255,10 +255,12 @@ ValveCall *CreateValveVCall(unsigned int vtableIdx,
|
||||
|
||||
/* Get return information - encode only */
|
||||
PassInfo retBuf;
|
||||
ObjectField retFieldBuf[16];
|
||||
size_t retBufSize = 0;
|
||||
bool retbuf_needs_extra;
|
||||
if (retInfo)
|
||||
{
|
||||
retBuf.fields = retFieldBuf;
|
||||
if ((size = ValveParamToBinParam(retInfo->vtype, retInfo->type, retInfo->flags, &retBuf, retbuf_needs_extra)) == 0)
|
||||
{
|
||||
delete vc;
|
||||
@@ -269,12 +271,14 @@ ValveCall *CreateValveVCall(unsigned int vtableIdx,
|
||||
|
||||
/* Get parameter info */
|
||||
PassInfo paramBuf[32];
|
||||
ObjectField fieldBuf[32][16];
|
||||
size_t sizes[32];
|
||||
size_t normSize = 0;
|
||||
size_t extraSize = 0;
|
||||
for (unsigned int i=0; i<numParams; i++)
|
||||
{
|
||||
bool needs_extra;
|
||||
paramBuf[i].fields = fieldBuf[i];
|
||||
if ((size = ValveParamToBinParam(params[i].vtype,
|
||||
params[i].type,
|
||||
params[i].flags,
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
SOURCEMOD LICENSE INFORMATION
|
||||
VERSION: JUNE-13-2008
|
||||
VERSION: 2019-9-30
|
||||
-----------------------------
|
||||
|
||||
SourceMod is licensed under the GNU General Public License, version 3.
|
||||
|
||||
As a special exception, AlliedModders LLC gives you permission to link the code
|
||||
of this program (as well as its derivative works) to "Half-Life 2," the "Source
|
||||
Engine," the "SourcePawn JIT," and any Game MODs that run on software by the
|
||||
Valve Corporation. You must obey the GNU General Public License in all
|
||||
respects for all other code used. Additionally, AlliedModders LLC grants this
|
||||
exception to all derivative works.
|
||||
Engine" and any Game MODs that run on software by the Valve Corporation.
|
||||
You must obey the GNU General Public License in all respects for all other code used.
|
||||
Additionally, AlliedModders LLC grants this exception to all derivative works.
|
||||
|
||||
As an additional special exception to the GNU General Public License 3.0,
|
||||
AlliedModders LLC permits dual-licensing of DERIVATIVE WORKS ONLY (that is,
|
||||
@@ -27,7 +26,6 @@ License version 2 (without an "or any higher version" clause) if and only if
|
||||
the work was already GNU General Public License 2.0 exclusive. This clause is
|
||||
provided for backwards compatibility only.
|
||||
|
||||
A copy of the JIT License is available in JIT.txt.
|
||||
A copy of the GNU General Public License 2.0 is available in GPLv2.txt.
|
||||
A copy of the GNU General Public License 3.0 is available in GPLv3.txt.
|
||||
|
||||
@@ -35,5 +33,4 @@ SourcePawn is Copyright (C) 2006-2008 AlliedModders LLC. All rights reserved.
|
||||
SourceMod is Copyright (C) 2006-2008 AlliedModders LLC. All rights reserved.
|
||||
Pawn and SMALL are Copyright (C) 1997-2008 ITB CompuPhase.
|
||||
Source is Copyright (C) Valve Corporation.
|
||||
All trademarks are property of their respective owners in the US and other
|
||||
|
||||
All trademarks are property of their respective owners in the US and other countries.
|
||||
|
||||
@@ -4,26 +4,26 @@
|
||||
|
||||
#define ARRAY_STRING_LENGTH 32
|
||||
|
||||
enum GroupCommands
|
||||
enum struct GroupCommands
|
||||
{
|
||||
ArrayList:groupListName,
|
||||
ArrayList:groupListCommand
|
||||
};
|
||||
ArrayList groupListName;
|
||||
ArrayList groupListCommand;
|
||||
}
|
||||
|
||||
int g_groupList[GroupCommands];
|
||||
GroupCommands g_groupList;
|
||||
int g_groupCount;
|
||||
|
||||
SMCParser g_configParser;
|
||||
|
||||
enum Places
|
||||
enum struct Places
|
||||
{
|
||||
Place_Category,
|
||||
Place_Item,
|
||||
Place_ReplaceNum
|
||||
};
|
||||
int category;
|
||||
int item;
|
||||
int replaceNum;
|
||||
}
|
||||
|
||||
char g_command[MAXPLAYERS+1][CMD_LENGTH];
|
||||
int g_currentPlace[MAXPLAYERS+1][Places];
|
||||
Places g_currentPlace[MAXPLAYERS+1];
|
||||
|
||||
/**
|
||||
* What to put in the 'info' menu field (for PlayerList and Player_Team menus only)
|
||||
@@ -331,11 +331,11 @@ void ParseConfigs()
|
||||
g_configParser.OnKeyValue = KeyValue;
|
||||
g_configParser.OnLeaveSection = EndSection;
|
||||
|
||||
delete g_groupList[groupListName];
|
||||
delete g_groupList[groupListCommand];
|
||||
delete g_groupList.groupListName;
|
||||
delete g_groupList.groupListCommand;
|
||||
|
||||
g_groupList[groupListName] = new ArrayList(ARRAY_STRING_LENGTH);
|
||||
g_groupList[groupListCommand] = new ArrayList(ARRAY_STRING_LENGTH);
|
||||
g_groupList.groupListName = new ArrayList(ARRAY_STRING_LENGTH);
|
||||
g_groupList.groupListCommand = new ArrayList(ARRAY_STRING_LENGTH);
|
||||
|
||||
char configPath[256];
|
||||
BuildPath(Path_SM, configPath, sizeof(configPath), "configs/dynamicmenu/adminmenu_grouping.txt");
|
||||
@@ -376,13 +376,13 @@ public SMCResult NewSection(SMCParser smc, const char[] name, bool opt_quotes)
|
||||
|
||||
public SMCResult KeyValue(SMCParser smc, const char[] key, const char[] value, bool key_quotes, bool value_quotes)
|
||||
{
|
||||
g_groupList[groupListName].PushString(key);
|
||||
g_groupList[groupListCommand].PushString(value);
|
||||
g_groupList.groupListName.PushString(key);
|
||||
g_groupList.groupListCommand.PushString(value);
|
||||
}
|
||||
|
||||
public SMCResult EndSection(SMCParser smc)
|
||||
{
|
||||
g_groupCount = g_groupList[groupListName].Length;
|
||||
g_groupCount = g_groupList.groupListName.Length;
|
||||
}
|
||||
|
||||
public void DynamicMenuCategoryHandler(TopMenu topmenu,
|
||||
@@ -421,8 +421,8 @@ public void DynamicMenuItemHandler(TopMenu topmenu,
|
||||
|
||||
strcopy(g_command[param], sizeof(g_command[]), output.cmd);
|
||||
|
||||
g_currentPlace[param][Place_Item] = location;
|
||||
g_currentPlace[param][Place_ReplaceNum] = 1;
|
||||
g_currentPlace[param].item = location;
|
||||
g_currentPlace[param].replaceNum = 1;
|
||||
|
||||
ParamCheck(param);
|
||||
}
|
||||
@@ -436,19 +436,19 @@ public void ParamCheck(int client)
|
||||
Item outputItem;
|
||||
Submenu outputSubmenu;
|
||||
|
||||
g_DataArray.GetArray(g_currentPlace[client][Place_Item], outputItem);
|
||||
g_DataArray.GetArray(g_currentPlace[client].item, outputItem);
|
||||
|
||||
if (g_currentPlace[client][Place_ReplaceNum] < 1)
|
||||
if (g_currentPlace[client].replaceNum < 1)
|
||||
{
|
||||
g_currentPlace[client][Place_ReplaceNum] = 1;
|
||||
g_currentPlace[client].replaceNum = 1;
|
||||
}
|
||||
|
||||
Format(buffer, 5, "#%i", g_currentPlace[client][Place_ReplaceNum]);
|
||||
Format(buffer2, 5, "@%i", g_currentPlace[client][Place_ReplaceNum]);
|
||||
Format(buffer, 5, "#%i", g_currentPlace[client].replaceNum);
|
||||
Format(buffer2, 5, "@%i", g_currentPlace[client].replaceNum);
|
||||
|
||||
if (StrContains(g_command[client], buffer) != -1 || StrContains(g_command[client], buffer2) != -1)
|
||||
{
|
||||
outputItem.submenus.GetArray(g_currentPlace[client][Place_ReplaceNum] - 1, outputSubmenu);
|
||||
outputItem.submenus.GetArray(g_currentPlace[client].replaceNum - 1, outputSubmenu);
|
||||
|
||||
Menu itemMenu = new Menu(Menu_Selection);
|
||||
itemMenu.ExitBackButton = true;
|
||||
@@ -460,8 +460,8 @@ public void ParamCheck(int client)
|
||||
|
||||
for (int i = 0; i<g_groupCount; i++)
|
||||
{
|
||||
g_groupList[groupListName].GetString(i, nameBuffer, sizeof(nameBuffer));
|
||||
g_groupList[groupListCommand].GetString(i, commandBuffer, sizeof(commandBuffer));
|
||||
g_groupList.groupListName.GetString(i, nameBuffer, sizeof(nameBuffer));
|
||||
g_groupList.groupListCommand.GetString(i, commandBuffer, sizeof(commandBuffer));
|
||||
itemMenu.AddItem(commandBuffer, nameBuffer);
|
||||
}
|
||||
}
|
||||
@@ -591,7 +591,7 @@ public void ParamCheck(int client)
|
||||
}
|
||||
|
||||
g_command[client][0] = '\0';
|
||||
g_currentPlace[client][Place_ReplaceNum] = 1;
|
||||
g_currentPlace[client].replaceNum = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -622,16 +622,16 @@ public int Menu_Selection(Menu menu, MenuAction action, int param1, int param2)
|
||||
char infobuffer[NAME_LENGTH+2];
|
||||
Format(infobuffer, sizeof(infobuffer), "\"%s\"", info);
|
||||
|
||||
Format(buffer, 5, "#%i", g_currentPlace[param1][Place_ReplaceNum]);
|
||||
Format(buffer, 5, "#%i", g_currentPlace[param1].replaceNum);
|
||||
ReplaceString(g_command[param1], sizeof(g_command[]), buffer, infobuffer);
|
||||
//replace #num with the selected option (quoted)
|
||||
|
||||
Format(buffer, 5, "@%i", g_currentPlace[param1][Place_ReplaceNum]);
|
||||
Format(buffer, 5, "@%i", g_currentPlace[param1].replaceNum);
|
||||
ReplaceString(g_command[param1], sizeof(g_command[]), buffer, info);
|
||||
//replace @num with the selected option (unquoted)
|
||||
|
||||
// Increment the parameter counter.
|
||||
g_currentPlace[param1][Place_ReplaceNum]++;
|
||||
g_currentPlace[param1].replaceNum++;
|
||||
|
||||
ParamCheck(param1);
|
||||
}
|
||||
|
||||
@@ -159,8 +159,10 @@ int LoadMapList(Menu menu)
|
||||
|
||||
for (int i = 0; i < map_count; i++)
|
||||
{
|
||||
char displayName[PLATFORM_MAX_PATH];
|
||||
GetArrayString(g_map_array, i, map_name, sizeof(map_name));
|
||||
menu.AddItem(map_name, map_name);
|
||||
GetMapDisplayName(map_name, displayName, sizeof(displayName));
|
||||
menu.AddItem(map_name, displayName);
|
||||
}
|
||||
|
||||
return map_count;
|
||||
|
||||
@@ -84,7 +84,7 @@ methodmap ArrayStack < Handle
|
||||
// @param block Optionally specify which block to read from
|
||||
// (useful if the blocksize > 0).
|
||||
// @param asChar Optionally read as a byte instead of a cell.
|
||||
// @return True on success, false if the stack is empty.
|
||||
// @return Value popped from the stack.
|
||||
// @error The stack is empty.
|
||||
public native any Pop(int block=0, bool asChar=false);
|
||||
|
||||
@@ -92,7 +92,7 @@ methodmap ArrayStack < Handle
|
||||
//
|
||||
// @param buffer Buffer to store string.
|
||||
// @param maxlength Maximum size of the buffer.
|
||||
// @oaram written Number of characters written to buffer, not including
|
||||
// @param written Number of characters written to buffer, not including
|
||||
// the null terminator.
|
||||
// @error The stack is empty.
|
||||
public native void PopString(char[] buffer, int maxlength, int &written = 0);
|
||||
|
||||
@@ -45,6 +45,8 @@
|
||||
#define CS_SLOT_KNIFE 2 /**< Knife slot. */
|
||||
#define CS_SLOT_GRENADE 3 /**< Grenade slot (will only return one grenade). */
|
||||
#define CS_SLOT_C4 4 /**< C4 slot. */
|
||||
#define CS_SLOT_BOOST 11 /**< Slot for healthshot and shield (will only return one weapon/item). */
|
||||
#define CS_SLOT_UTILITY 12 /**< Slot for tablet. */
|
||||
|
||||
#define CS_DMG_HEADSHOT (1 << 30) /**< Headshot */
|
||||
|
||||
@@ -156,6 +158,7 @@ enum CSWeaponID
|
||||
CSWeapon_BUMPMINE = 85,
|
||||
CSWeapon_MAX_WEAPONS_NO_KNIFES, // Max without the knife item defs, useful when treating all knives as a regular knife.
|
||||
CSWeapon_BAYONET = 500,
|
||||
CSWeapon_KNIFE_CLASSIC = 503,
|
||||
CSWeapon_KNIFE_FLIP = 505,
|
||||
CSWeapon_KNIFE_GUT = 506,
|
||||
CSWeapon_KNIFE_KARAMBIT = 507,
|
||||
|
||||
@@ -547,7 +547,7 @@ native bool SQL_CheckConfig(const char[] name);
|
||||
* string to return the default driver.
|
||||
* @return Driver Handle, or INVALID_HANDLE on failure.
|
||||
*/
|
||||
native Handle SQL_GetDriver(const char[] name="");
|
||||
native DBDriver SQL_GetDriver(const char[] name="");
|
||||
|
||||
/**
|
||||
* Reads the driver of an opened database.
|
||||
@@ -557,7 +557,7 @@ native Handle SQL_GetDriver(const char[] name="");
|
||||
* @param ident_length Maximum length of the buffer.
|
||||
* @return Driver Handle.
|
||||
*/
|
||||
native Handle SQL_ReadDriver(Handle database, char[] ident="", int ident_length=0);
|
||||
native DBDriver SQL_ReadDriver(Handle database, char[] ident="", int ident_length=0);
|
||||
|
||||
/**
|
||||
* Retrieves a driver's identification string.
|
||||
|
||||
@@ -314,7 +314,7 @@ native bool ReadDirEntry(Handle dir, char[] buffer, int maxlength, FileType &typ
|
||||
* Mac, this has no distinction from binary mode. On Windows, it causes the '\n'
|
||||
* character (0xA) to be written as "\r\n" (0xD, 0xA).
|
||||
*
|
||||
* Example: "rb" opens a binary file for writing; "at" opens a text file for
|
||||
* Example: "rb" opens a binary file for reading; "at" opens a text file for
|
||||
* appending.
|
||||
*
|
||||
* @param file File to open.
|
||||
|
||||
@@ -682,7 +682,7 @@ enum ClientRangeType
|
||||
* @param size Maximum size of clients array.
|
||||
* @return Number of client indexes written to clients array.
|
||||
*/
|
||||
native int GetClientsInRange(float origin[3], ClientRangeType rangeType, int[] clients, int size);
|
||||
native int GetClientsInRange(const float origin[3], ClientRangeType rangeType, int[] clients, int size);
|
||||
|
||||
/**
|
||||
* Retrieves the server's authentication string (SteamID).
|
||||
|
||||
@@ -224,7 +224,7 @@ stock void TE_SendToClient(int client, float delay=0.0)
|
||||
* @param rangeType Range type to use for filtering clients.
|
||||
* @param delay Delay in seconds to send the TE.
|
||||
*/
|
||||
stock void TE_SendToAllInRange(float origin[3], ClientRangeType rangeType, float delay=0.0)
|
||||
stock void TE_SendToAllInRange(const float origin[3], ClientRangeType rangeType, float delay=0.0)
|
||||
{
|
||||
int[] clients = new int[MaxClients];
|
||||
int total = GetClientsInRange(origin, rangeType, clients, MaxClients);
|
||||
|
||||
@@ -633,6 +633,18 @@ native bool TR_DidHit(Handle hndl=INVALID_HANDLE);
|
||||
*/
|
||||
native int TR_GetHitGroup(Handle hndl=INVALID_HANDLE);
|
||||
|
||||
/**
|
||||
* Returns in which hitbox the trace collided if any.
|
||||
*
|
||||
* Note: if the entity that collided with the trace is the world entity,
|
||||
* then this function doesn't return an hitbox index but a static prop index.
|
||||
*
|
||||
* @param hndl A trace Handle, or INVALID_HANDLE to use a global trace result.
|
||||
* @return Hitbox index (Or static prop index).
|
||||
* @error Invalid Handle.
|
||||
*/
|
||||
native int TR_GetHitBoxIndex(Handle hndl=INVALID_HANDLE);
|
||||
|
||||
/**
|
||||
* Find the normal vector to the collision plane of a trace.
|
||||
*
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
1.10.0
|
||||
1.11.0
|
||||
|
||||
+1
-1
Submodule public/amtl updated: 2be66bdbdf...eb7b6ba084
+1
-1
Submodule sourcepawn updated: a98c996b16...7e69f7eaf5
Vendored
+12
-2
@@ -18,7 +18,17 @@ param(
|
||||
'tf2',
|
||||
'insurgency',
|
||||
'sdk2013',
|
||||
'dota'
|
||||
'dota',
|
||||
'orangebox',
|
||||
'blade',
|
||||
'episode1',
|
||||
'bms',
|
||||
'darkm',
|
||||
'swarm',
|
||||
'bgt',
|
||||
'eye',
|
||||
'contagion',
|
||||
'doi'
|
||||
)
|
||||
)
|
||||
|
||||
@@ -78,4 +88,4 @@ Checkout-Repo -Name "ambuild" -Branch "master" -Repo "https://github.com/alliedm
|
||||
Set-Location ambuild
|
||||
& python setup.py install
|
||||
|
||||
Set-Location ..
|
||||
Set-Location ..
|
||||
|
||||
Reference in New Issue
Block a user