Compare commits

..
Author SHA1 Message Date
Nicholas Hastings 255e2ef6f0 Merge branch '1.7-dev' of https://github.com/alliedmodders/sourcemod into 1.7-dev. 2015-05-30 08:06:56 -04:00
Nicholas Hastings 18f8d10f10 Update versioning for 1.7.2 release. 2015-05-30 08:06:23 -04:00
Nicholas Hastings a626005cc6 Update changelog for version 1.7.2. 2015-05-30 08:05:13 -04:00
Nicholas Hastings bf9c96b48f Fix sm_trigger_show default in shipped sourcemod.cfg match default in basetriggers. 2015-05-30 07:56:06 -04:00
Ruben Gonzalez dca2596788 Update more CS:GO gamedata. 2015-05-28 13:29:35 -04:00
David Anderson b491345d78 Fix continue in a loop body leaking heap-allocated variables. (bug 6370, r=fyren) 2015-05-27 10:33:07 -04:00
Ruben Gonzalez 8cb2fcdf65 Update CS:GO gamedata for latest update. 2015-05-26 21:53:44 -04:00
Nicholas Hastings f86c5e9940 Fix regression in admin-sql-threaded when porting to transitional syntax. 2015-05-18 13:22:34 -04:00
Ruben Gonzalez fd9dbded8b Trigger build. 2015-05-15 20:53:31 -04:00
Ruben Gonzalez 404cd28423 Trigger Build. 2015-05-15 18:30:35 -04:00
Ruben Gonzalez afaddda8cf Trigger Build 2015-05-15 15:51:46 -04:00
Asher Baker 6c7a6c72aa Correct NameHashSet::add() return type. 2015-05-09 11:56:15 +01:00
Asher Baker 97605a500c Remove check_thunks reliance on Tier0. 2015-05-07 21:56:31 +01:00
Kyle Sanderson 16b7c576d4 Merge pull request #330 from yedpodtrzitko/1.7-dev
Add IsFree check to FindEntityByNetClass in SDKTools.
2015-05-04 18:08:51 -07:00
yed_ f504188854 add IsFree check 2015-05-05 01:06:40 +01:00
Nicholas Hastings 8b2d7a1e49 Trigger build for hl2sdk-dota changes. 2015-05-03 15:08:03 -04:00
Nicholas Hastings b429c37ab3 Trigger build for hl2sdk-dota changes. 2015-05-03 10:05:53 -04:00
Nicholas Hastings 13cf293f1c Merge pull request #250 from alliedmodders/sdkhooks-newdecls
Convert remainder of sdkhooks.inc to newdecls (r=dvander).
2015-04-20 10:19:23 -07:00
Nicholas Hastings a2b9c91423 Roll version number. 2015-04-18 15:48:19 -04:00
Nicholas Hastings cf9aa05a0c Update versioning for 1.7.1 release. 2015-04-18 15:13:41 -04:00
Nicholas Hastings 824b0f9a3c Update changelog for version 1.7.1. 2015-04-18 09:58:37 -04:00
David Anderson f74e357e91 Merge pull request #288 from klausenbusk/patch-1
Updated KillTimer documentation to reflect "Invalid handles" = runtime error.
2015-04-18 09:41:30 -04:00
David Anderson 15b65468ac Fix bug where the compiler could crash trying to dereference a decayed accessor expression used as |this|. 2015-04-18 08:53:13 -04:00
David Anderson d64bcc763a Fix bug where complex |this| values could be corrupted while evaluating function arguments. (bug 6329) 2015-04-18 08:51:02 -04:00
Nicholas Hastings f4ff0e574c Fix CoreConfig init to happen after SMGlobalClasses from logic bin are added.
This fixes OnSourceModConfigChanged not being called for logic classes when
config is first read, matching behavior for core classes. The function is still called
before each class's OnSourceModStartup func.
2015-04-18 08:35:10 -04:00
Nicholas Hastings 4ffe11a235 Enable the "name %s" command blocking on CS:GO as well. 2015-04-17 04:51:24 -07:00
Nicholas Hastings fc2addf11e Merge pull request #313 from alliedmodders/set-client-name
Add SetClientName native.
2015-04-07 04:39:52 -07:00
Peace-Maker 491d24a028 Add missing debug info for multidimensional strings
new String:INVISIBLE[2][8];

Multidimensional arrays like this wouldn't get their debug info added to
the debug symbols table.
Bug: https://bugs.alliedmods.net/show_bug.cgi?id=6324

See Fyren's comment in the bug report.
This patch recursively checks the parent symbol of array dimensions
until it finds the top symbol and uses that to check for the compound
level.
This still allows for early exiting the loop when going out of scope.
2015-04-04 11:05:36 -04:00
Peace-Maker 9a26ae0526 Fix declaring variable on same line after array
int a[5], b;
b would get a size of |0| on the stack instead of a sizeof(cell_t).
Bug: https://bugs.alliedmods.net/show_bug.cgi?id=6335
2015-04-04 11:03:27 -04:00
Ryan Stecker 8f0067b3b4 Improve the diagnostic given when a function prototype doesn't match an existing definition. 2015-04-04 10:51:10 -04:00
Nicholas Hastings d68829d301 Fix build. 2015-04-04 10:26:11 -04:00
Nicholas Hastings a48d5bfe1f Add missing impl for File.ReadUint16. 2015-04-04 10:22:41 -04:00
Nicholas Hastings e54850e1f9 Add explicit return types to forwards missing them. 2015-04-04 10:21:34 -04:00
InstantMuffin fd4ac6312c Update functions.inc 2015-04-04 10:17:02 -04:00
Alexander Corn 3c95f191c4 Moved note about releasing resources from OnPluginStart to OnPluginEnd 2015-04-04 10:10:51 -04:00
Nicholas Hastings a523948ebb Make OpenDirectory error for empty path match error in DirExists. 2015-04-04 10:10:13 -04:00
Nicholas Hastings fc5149a1c7 Throw an error if DirExists called with empty path. 2015-04-04 10:10:07 -04:00
Nicholas Hastings 50399f25f4 Update TF2 gamedata. 2015-03-31 17:39:50 -04:00
Ruben Gonzalez 1552464465 Fix not being able to block CS_OnCSWeaponDrop and clarify include file. (bug 6334) 2015-03-29 18:39:38 -04:00
Dr!fter dd401e760c Fix more Freak Fortress gamedata. 2015-03-27 21:59:02 -04:00
Ruben Gonzalez 0c976cd1f0 Fix Fortress Forever gamedata. 2015-03-27 21:47:32 -04:00
Nicholas Hastings e5fb8984f4 Merge pull request #286 from peace-maker/noradiomenu_regression
Fix crash regression in games that don't support radio style menus (r=psychonic).
2015-03-21 18:46:56 -04:00
Ruben Gonzalez 57c993e17e Merge pull request #303 from alliedmodders/tf2_vstk_fix
Fix some TF2 natives not having the correct vstk size.
2015-03-14 09:51:08 -04:00
Ruben Gonzalez ec32f3cf2d Update TF2's MakeBleed native for the latest update. 2015-03-12 18:07:12 -04:00
Nicholas Hastings 3764881daa Trigger build for hl2sdk-dota changes. 2015-03-06 11:26:26 -05:00
Ryan Stecker 2754be4066 Fix tag mismatch warning when using SQLite_UseDatabase. (bug 6310) 2015-03-03 23:04:23 -05:00
Peace-Maker b52054de1e Fix crash in games that don't support radio style menus
Fix regression in ad7d920ce0
GetMenuStyleHandle(MenuStyle_Radio) crashes games, which don't support
the radio menu style. The style is never added to the menu manager, if
it's not supported, so GetMenuStyleHandle tries to call IsSupported on a
nullptr.
2015-03-01 18:48:30 +01:00
Nicholas Hastings 94c982f8cf Merge pull request #267 from 50Wliu/tf2_setclientteam
Add TF2_SetClientTeam to provide symmetry to TF2_GetClientTeam (r=psychonic).
2015-02-26 17:42:32 -05:00
Asher Baker 66b00d4ae7 Updated plugin blacklist. 2015-02-25 01:17:42 +00:00
Asher Baker 784f9f4993 Merge pull request #213 from splewis/find-array-nonzero-blocks
Add block parameter to FindValueInArray native.
2015-02-25 01:16:06 +00:00
Nicholas Hastings 6fb9e1b30e Fix Insurgency s_pTempEntities offset on Windows. 2015-02-22 20:09:03 -05:00
Nicholas Hastings 51c1e17717 Use new IVEngineServer::GetIServer to get IServer* on Insurgency. 2015-02-22 15:16:39 -05:00
Nicholas Hastings c911af4109 Update Insurgency Windows SDKTools gamedata. 2015-02-22 10:18:45 -05:00
Kyle Sanderson a67c54f0c0 Root Menu Handles during Display. 2015-02-21 17:36:08 -08:00
Nicholas Hastings a989a2b791 Trigger build for hl2sdk-dota changes. 2015-02-20 09:17:01 -05:00
Nicholas Hastings 68a1e89c24 Trigger build for hl2sdk-csgo changes. 2015-02-17 15:50:38 -05:00
Nicholas Hastings 289455d538 Trigger build (bug 6308). 2015-02-14 12:03:55 -05:00
Nicholas Hastings 4919e4a002 Roll version number. 2015-02-04 18:25:02 -05:00
65 changed files with 834 additions and 304 deletions
+38 -1
View File
@@ -1,5 +1,43 @@
SourceMod Changelog
SourceMod 1.7.2 [2015-05-30]
URL: http://wiki.alliedmods.net/SourceMod_1.7.2_Release_Notes
User Changes:
- Updated game compatibility for the latest CS:GO updates.
- Fixed potential crash when using SDKTools GameRules_* natives. (PR 330) (yed).
- Fixed regression in v1.7.0 causing admin-sql-threaded plugin to not properly load admins. (bug 6365) (PR 342).
- Fixed leak in plugin heap memory that could lead to "Not enough space on the heap" error. (bug 6370).
----------------------------------------------------------
SourceMod 1.7.1 [2015-04-18]
URL: http://wiki.alliedmods.net/SourceMod_1.7.1_Release_Notes
User Changes:
- Updated game compatibility for CS:GO, TF2, Dota 2, Insurgency, and Fortress Forever.
- Fixed regression causing crash in games that do not support radio menus (PR 286) (Peace-Maker).
- Fixed sm_rename not working on some games, including CS:S and CS:GO (PR 313).
- Fixed some core.cfg values being ignored on start (PR 322).
- Fixed crash when plugins close a menu handle during menu draw (PR 268)
Developer Changes:
- Added tagged TF2_SetClientTeam to provide symmetry to TF2_GetClientTeam (PR 267) (Wliu).
- Added block parameter to FindValueInArray native (PR 213) (splewis).
- Added explicit return types to forwards missing them to avoid future compatibility issues (PR 294).
- Added new SetClientName native to reliably change a player's name on any game (PR 313).
- Fixed tag mismatch warning when using SQLite_UseDatabase (bug 6310) (PR 262) (VoiDeD).
- Fixed not actually being able to block CS_OnCSWeaponDrop (bug 6334) (PR 316).
- Fixed DirExists to throw an error when passed empty string (PR 315).
- Fixed ReadUint16 on File methodmap throwing "not bound" error (PR 265).
- Fixed various include docs (PR 288) (PR 290) (PR 295).
- Fixed issues with declaring variable on same line after array (SP PR 7) (Peace-Maker).
- Fixed debug info for multidimensional strings not being written to smx (SP PR 8) (Peace-Maker).
- Fixed issues with nesting methodmap calls (bug 6329) (SP PR 11) (SP PR 13).
- Improved diagnostic given when function prototype doesn't match an existing definition (PR 291) (VoiDeD).
----------------------------------------------------------
SourceMod 1.7.0 [2015-02-04]
URL: http://wiki.alliedmods.net/SourceMod_1.7.0_Release_Notes
@@ -44,7 +82,6 @@ Developer Changes:
- SourceMod now uses some C++11 and has newer compiler requirements.
- Added --disable-auto-versioning option to ambuild configure script.
----------------------------------------------------------
SourceMod 1.6.3 [2014-11-25]
+2 -2
View File
@@ -105,8 +105,8 @@ sm_timeleft_interval 0
// 1 (Enabled)
// --
// Requires: basetriggers.smx
// Default: 1
sm_trigger_show 1
// Default: 0
sm_trigger_show 0
// Specifies whether or not to display vote progress to clients in the
// "hint" box (near the bottom of the screen in most games).
+5 -1
View File
@@ -83,6 +83,10 @@ void CRadioStyle::OnSourceModLevelChange(const char *mapName)
}
g_bRadioInit = true;
// Always register the style. Use IsSupported() to check for validity before use.
g_Menus.AddStyle(this);
const char *msg = g_pGameConf->GetKeyValue("HudRadioMenuMsg");
if (!msg || msg[0] == '\0')
{
@@ -118,7 +122,6 @@ void CRadioStyle::OnSourceModLevelChange(const char *mapName)
}
}
g_Menus.AddStyle(this);
g_Menus.SetDefaultStyle(this);
g_UserMsgs.HookUserMessage(g_ShowMenuId, this, false);
@@ -593,6 +596,7 @@ bool CRadioMenu::DisplayAtItem(int client,
return false;
}
AutoHandleRooter ahr(this->GetHandle());
return g_RadioMenuStyle.DoClientMenu(client,
this,
start_item,
+2
View File
@@ -41,6 +41,8 @@
#include "sm_fastlink.h"
#include <sh_stack.h>
#include <compat_wrappers.h>
#include "logic/common_logic.h"
#include "AutoHandleRooter.h"
using namespace SourceMod;
+1
View File
@@ -408,6 +408,7 @@ bool CValveMenu::DisplayAtItem(int client,
return false;
}
AutoHandleRooter ahr(this->GetHandle());
return g_ValveMenuStyle.DoClientMenu(client, this, start_item, alt_handler ? alt_handler : m_pHandler, time);
}
+2
View File
@@ -39,6 +39,8 @@
#include "KeyValues.h"
#include "sm_fastlink.h"
#include <compat_wrappers.h>
#include "logic/common_logic.h"
#include "AutoHandleRooter.h"
using namespace SourceMod;
+37 -24
View File
@@ -8,7 +8,7 @@
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, version 3.0, as published by the
* Free Software Foundation.
*
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
@@ -35,7 +35,7 @@
HandleType_t htCellArray;
class CellArrayHelpers :
class CellArrayHelpers :
public SMGlobalClass,
public IHandleTypeDispatch
{
@@ -75,7 +75,7 @@ static cell_t CreateArray(IPluginContext *pContext, const cell_t *params)
{
array->resize(params[2]);
}
Handle_t hndl = handlesys->CreateHandle(htCellArray, array, pContext->GetIdentity(), g_pCoreIdent, NULL);
if (!hndl)
{
@@ -91,14 +91,14 @@ static cell_t ClearArray(IPluginContext *pContext, const cell_t *params)
HandleError err;
HandleSecurity sec(pContext->GetIdentity(), g_pCoreIdent);
if ((err = handlesys->ReadHandle(params[1], htCellArray, &sec, (void **)&array))
if ((err = handlesys->ReadHandle(params[1], htCellArray, &sec, (void **)&array))
!= HandleError_None)
{
return pContext->ThrowNativeError("Invalid Handle %x (error: %d)", params[1], err);
}
array->clear();
return 1;
}
@@ -108,7 +108,7 @@ static cell_t ResizeArray(IPluginContext *pContext, const cell_t *params)
HandleError err;
HandleSecurity sec(pContext->GetIdentity(), g_pCoreIdent);
if ((err = handlesys->ReadHandle(params[1], htCellArray, &sec, (void **)&array))
if ((err = handlesys->ReadHandle(params[1], htCellArray, &sec, (void **)&array))
!= HandleError_None)
{
return pContext->ThrowNativeError("Invalid Handle %x (error: %d)", params[1], err);
@@ -128,7 +128,7 @@ static cell_t GetArraySize(IPluginContext *pContext, const cell_t *params)
HandleError err;
HandleSecurity sec(pContext->GetIdentity(), g_pCoreIdent);
if ((err = handlesys->ReadHandle(params[1], htCellArray, &sec, (void **)&array))
if ((err = handlesys->ReadHandle(params[1], htCellArray, &sec, (void **)&array))
!= HandleError_None)
{
return pContext->ThrowNativeError("Invalid Handle %x (error: %d)", params[1], err);
@@ -143,7 +143,7 @@ static cell_t PushArrayCell(IPluginContext *pContext, const cell_t *params)
HandleError err;
HandleSecurity sec(pContext->GetIdentity(), g_pCoreIdent);
if ((err = handlesys->ReadHandle(params[1], htCellArray, &sec, (void **)&array))
if ((err = handlesys->ReadHandle(params[1], htCellArray, &sec, (void **)&array))
!= HandleError_None)
{
return pContext->ThrowNativeError("Invalid Handle %x (error: %d)", params[1], err);
@@ -166,7 +166,7 @@ static cell_t PushArrayString(IPluginContext *pContext, const cell_t *params)
HandleError err;
HandleSecurity sec(pContext->GetIdentity(), g_pCoreIdent);
if ((err = handlesys->ReadHandle(params[1], htCellArray, &sec, (void **)&array))
if ((err = handlesys->ReadHandle(params[1], htCellArray, &sec, (void **)&array))
!= HandleError_None)
{
return pContext->ThrowNativeError("Invalid Handle %x (error: %d)", params[1], err);
@@ -192,7 +192,7 @@ static cell_t PushArrayArray(IPluginContext *pContext, const cell_t *params)
HandleError err;
HandleSecurity sec(pContext->GetIdentity(), g_pCoreIdent);
if ((err = handlesys->ReadHandle(params[1], htCellArray, &sec, (void **)&array))
if ((err = handlesys->ReadHandle(params[1], htCellArray, &sec, (void **)&array))
!= HandleError_None)
{
return pContext->ThrowNativeError("Invalid Handle %x (error: %d)", params[1], err);
@@ -224,7 +224,7 @@ static cell_t GetArrayCell(IPluginContext *pContext, const cell_t *params)
HandleError err;
HandleSecurity sec(pContext->GetIdentity(), g_pCoreIdent);
if ((err = handlesys->ReadHandle(params[1], htCellArray, &sec, (void **)&array))
if ((err = handlesys->ReadHandle(params[1], htCellArray, &sec, (void **)&array))
!= HandleError_None)
{
return pContext->ThrowNativeError("Invalid Handle %x (error: %d)", params[1], err);
@@ -263,7 +263,7 @@ static cell_t GetArrayString(IPluginContext *pContext, const cell_t *params)
HandleError err;
HandleSecurity sec(pContext->GetIdentity(), g_pCoreIdent);
if ((err = handlesys->ReadHandle(params[1], htCellArray, &sec, (void **)&array))
if ((err = handlesys->ReadHandle(params[1], htCellArray, &sec, (void **)&array))
!= HandleError_None)
{
return pContext->ThrowNativeError("Invalid Handle %x (error: %d)", params[1], err);
@@ -289,7 +289,7 @@ static cell_t GetArrayArray(IPluginContext *pContext, const cell_t *params)
HandleError err;
HandleSecurity sec(pContext->GetIdentity(), g_pCoreIdent);
if ((err = handlesys->ReadHandle(params[1], htCellArray, &sec, (void **)&array))
if ((err = handlesys->ReadHandle(params[1], htCellArray, &sec, (void **)&array))
!= HandleError_None)
{
return pContext->ThrowNativeError("Invalid Handle %x (error: %d)", params[1], err);
@@ -322,7 +322,7 @@ static cell_t SetArrayCell(IPluginContext *pContext, const cell_t *params)
HandleError err;
HandleSecurity sec(pContext->GetIdentity(), g_pCoreIdent);
if ((err = handlesys->ReadHandle(params[1], htCellArray, &sec, (void **)&array))
if ((err = handlesys->ReadHandle(params[1], htCellArray, &sec, (void **)&array))
!= HandleError_None)
{
return pContext->ThrowNativeError("Invalid Handle %x (error: %d)", params[1], err);
@@ -361,7 +361,7 @@ static cell_t SetArrayString(IPluginContext *pContext, const cell_t *params)
HandleError err;
HandleSecurity sec(pContext->GetIdentity(), g_pCoreIdent);
if ((err = handlesys->ReadHandle(params[1], htCellArray, &sec, (void **)&array))
if ((err = handlesys->ReadHandle(params[1], htCellArray, &sec, (void **)&array))
!= HandleError_None)
{
return pContext->ThrowNativeError("Invalid Handle %x (error: %d)", params[1], err);
@@ -387,7 +387,7 @@ static cell_t SetArrayArray(IPluginContext *pContext, const cell_t *params)
HandleError err;
HandleSecurity sec(pContext->GetIdentity(), g_pCoreIdent);
if ((err = handlesys->ReadHandle(params[1], htCellArray, &sec, (void **)&array))
if ((err = handlesys->ReadHandle(params[1], htCellArray, &sec, (void **)&array))
!= HandleError_None)
{
return pContext->ThrowNativeError("Invalid Handle %x (error: %d)", params[1], err);
@@ -420,7 +420,7 @@ static cell_t ShiftArrayUp(IPluginContext *pContext, const cell_t *params)
HandleError err;
HandleSecurity sec(pContext->GetIdentity(), g_pCoreIdent);
if ((err = handlesys->ReadHandle(params[1], htCellArray, &sec, (void **)&array))
if ((err = handlesys->ReadHandle(params[1], htCellArray, &sec, (void **)&array))
!= HandleError_None)
{
return pContext->ThrowNativeError("Invalid Handle %x (error: %d)", params[1], err);
@@ -443,7 +443,7 @@ static cell_t RemoveFromArray(IPluginContext *pContext, const cell_t *params)
HandleError err;
HandleSecurity sec(pContext->GetIdentity(), g_pCoreIdent);
if ((err = handlesys->ReadHandle(params[1], htCellArray, &sec, (void **)&array))
if ((err = handlesys->ReadHandle(params[1], htCellArray, &sec, (void **)&array))
!= HandleError_None)
{
return pContext->ThrowNativeError("Invalid Handle %x (error: %d)", params[1], err);
@@ -466,7 +466,7 @@ static cell_t SwapArrayItems(IPluginContext *pContext, const cell_t *params)
HandleError err;
HandleSecurity sec(pContext->GetIdentity(), g_pCoreIdent);
if ((err = handlesys->ReadHandle(params[1], htCellArray, &sec, (void **)&array))
if ((err = handlesys->ReadHandle(params[1], htCellArray, &sec, (void **)&array))
!= HandleError_None)
{
return pContext->ThrowNativeError("Invalid Handle %x (error: %d)", params[1], err);
@@ -494,14 +494,14 @@ static cell_t CloneArray(IPluginContext *pContext, const cell_t *params)
HandleError err;
HandleSecurity sec(pContext->GetIdentity(), g_pCoreIdent);
if ((err = handlesys->ReadHandle(params[1], htCellArray, &sec, (void **)&oldArray))
if ((err = handlesys->ReadHandle(params[1], htCellArray, &sec, (void **)&oldArray))
!= HandleError_None)
{
return pContext->ThrowNativeError("Invalid Handle %x (error: %d)", params[1], err);
}
CellArray *array = oldArray->clone();
Handle_t hndl = handlesys->CreateHandle(htCellArray, array, pContext->GetIdentity(), g_pCoreIdent, NULL);
if (!hndl)
{
@@ -517,7 +517,7 @@ static cell_t FindStringInArray(IPluginContext *pContext, const cell_t *params)
HandleError err;
HandleSecurity sec(pContext->GetIdentity(), g_pCoreIdent);
if ((err = handlesys->ReadHandle(params[1], htCellArray, &sec, (void **)&array))
if ((err = handlesys->ReadHandle(params[1], htCellArray, &sec, (void **)&array))
!= HandleError_None)
{
return pContext->ThrowNativeError("Invalid Handle %x (error: %d)", params[1], err);
@@ -544,15 +544,28 @@ static cell_t FindValueInArray(IPluginContext *pContext, const cell_t *params)
HandleError err;
HandleSecurity sec(pContext->GetIdentity(), g_pCoreIdent);
if ((err = handlesys->ReadHandle(params[1], htCellArray, &sec, (void **)&array))
if ((err = handlesys->ReadHandle(params[1], htCellArray, &sec, (void **)&array))
!= HandleError_None)
{
return pContext->ThrowNativeError("Invalid Handle %x (error: %d)", params[1], err);
}
// the blocknumber is not guaranteed to always be passed
size_t blocknumber = 0;
if (params[0] >= 3)
{
blocknumber = (size_t) params[3];
}
if (blocknumber >= array->blocksize())
{
return pContext->ThrowNativeError("Invalid block %d (blocksize: %d)", blocknumber, array->blocksize());
}
for (unsigned int i = 0; i < array->size(); i++)
{
if (params[2] == *array->at(i))
cell_t *blk = array->at(i);
if (params[2] == blk[blocknumber])
{
return (cell_t) i;
}
+8 -2
View File
@@ -309,7 +309,7 @@ static cell_t sm_OpenDirectory(IPluginContext *pContext, const cell_t *params)
if (!path[0])
{
return pContext->ThrowNativeError("Invalid file path");
return pContext->ThrowNativeError("Invalid path. An empty path string is not valid, use \".\" to refer to the current working directory.");
}
Handle_t handle = 0;
@@ -616,7 +616,12 @@ static cell_t sm_DirExists(IPluginContext *pContext, const cell_t *params)
{
char *name;
pContext->LocalToString(params[1], &name);
if (!name[0])
{
return pContext->ThrowNativeError("Invalid path. An empty path string is not valid, use \".\" to refer to the current working directory.");
}
if (params[0] >= 2 && params[2] == 1)
{
char *pathID;
@@ -1176,6 +1181,7 @@ REGISTER_NATIVES(filesystem)
{"File.ReadInt8", File_ReadTyped<int8_t>},
{"File.ReadUint8", File_ReadTyped<uint8_t>},
{"File.ReadInt16", File_ReadTyped<int16_t>},
{"File.ReadUint16", File_ReadTyped<uint16_t>},
{"File.ReadInt32", File_ReadTyped<int32_t>},
{"File.WriteInt8", File_WriteTyped<int8_t>},
{"File.WriteInt16", File_WriteTyped<int16_t>},
+3 -3
View File
@@ -176,9 +176,6 @@ bool SourceModBase::InitializeSourceMod(char *error, size_t maxlength, bool late
return false;
}
/* Initialize CoreConfig to get the SourceMod base path properly - this parses core.cfg */
g_CoreConfig.Initialize();
/* There will always be a path by this point, since it was force-set above. */
m_GotBasePath = true;
@@ -276,6 +273,9 @@ void SourceModBase::StartSourceMod(bool late)
InitLogicBridge();
/* Initialize CoreConfig to get the SourceMod base path properly - this parses core.cfg */
g_CoreConfig.Initialize();
/* Notify! */
SMGlobalClass *pBase = SMGlobalClass::head;
while (pBase)
+1 -1
View File
@@ -177,7 +177,7 @@ DETOUR_DECL_MEMBER3(DetourCSWeaponDrop, void, CBaseEntity *, weapon, bool, bDrop
g_pCSWeaponDropForward->Execute(&result);
if (result >= Pl_Continue)
if (result == Pl_Continue)
{
#if SOURCE_ENGINE == SE_CSGO
DETOUR_MEMBER_CALL(DetourCSWeaponDrop)(weapon, vec, unknown);
+31
View File
@@ -50,6 +50,9 @@
*/
SH_DECL_HOOK6(IServerGameDLL, LevelInit, SH_NOATTRIB, false, bool, const char *, const char *, const char *, const char *, bool, bool);
#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_CSGO
SH_DECL_HOOK1_void_vafmt(IVEngineServer, ClientCommand, SH_NOATTRIB, 0, edict_t *);
#endif
SDKTools g_SdkTools; /**< Global singleton for extension's main interface */
IServerGameEnts *gameents = NULL;
@@ -261,6 +264,10 @@ bool SDKTools::SDK_OnMetamodLoad(ISmmAPI *ismm, char *error, size_t maxlen, bool
#endif
GET_V_IFACE_ANY(GetEngineFactory, soundemitterbase, ISoundEmitterSystemBase, SOUNDEMITTERSYSTEM_INTERFACE_VERSION);
#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_CSGO
SH_ADD_HOOK(IVEngineServer, ClientCommand, engine, SH_MEMBER(this, &SDKTools::OnSendClientCommand), false);
#endif
gpGlobals = ismm->GetCGlobals();
enginePatch = SH_GET_CALLCLASS(engine);
enginesoundPatch = SH_GET_CALLCLASS(engsound);
@@ -268,6 +275,14 @@ bool SDKTools::SDK_OnMetamodLoad(ISmmAPI *ismm, char *error, size_t maxlen, bool
return true;
}
bool SDKTools::SDK_OnMetamodUnload(char *error, size_t maxlen)
{
#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_CSGO
SH_REMOVE_HOOK(IVEngineServer, ClientCommand, engine, SH_MEMBER(this, &SDKTools::OnSendClientCommand), false);
#endif
return true;
}
void SDKTools::SDK_OnAllLoaded()
{
SM_GET_LATE_IFACE(BINTOOLS, g_pBinTools);
@@ -456,6 +471,22 @@ void SDKTools::OnClientPutInServer(int client)
g_Hooks.OnClientPutInServer(client);
}
#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_CSGO
void SDKTools::OnSendClientCommand(edict_t *pPlayer, const char *szFormat)
{
// Due to legacy code, CS:S and CS:GO still sends "name \"newname\"" to the
// client after aname change. The engine has a change hook on name causing
// it to reset to the player's Steam name. This quashes that to make
// SetClientName work properly.
if (!strncmp(szFormat, "name ", 5))
{
RETURN_META(MRES_SUPERCEDE);
}
RETURN_META(MRES_IGNORED);
}
#endif
class SDKTools_API : public ISDKTools
{
public:
+4 -1
View File
@@ -83,7 +83,7 @@ public: //public SDKExtension
public:
#if defined SMEXT_CONF_METAMOD
virtual bool SDK_OnMetamodLoad(ISmmAPI *ismm, char *error, size_t maxlen, bool late);
//virtual bool SDK_OnMetamodUnload(char *error, size_t maxlen);
virtual bool SDK_OnMetamodUnload(char *error, size_t maxlen);
//virtual bool SDK_OnMetamodPauseChange(bool paused, char *error, size_t maxlen);
#endif
public: //IConCommandBaseAccessor
@@ -101,6 +101,9 @@ public: // IVoiceServer
#else
void OnClientCommand(edict_t *pEntity);
#endif
#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_CSGO
void OnSendClientCommand(edict_t *pPlayer, const char *szFormat);
#endif
public: //ICommandTargetProcessor
bool ProcessCommandTarget(cmd_target_info_t *info);
+1 -1
View File
@@ -46,7 +46,7 @@ static CBaseEntity *FindEntityByNetClass(int start, const char *classname)
for (int i = start; i < maxEntities; i++)
{
edict_t *current = gamehelpers->EdictOfIndex(i);
if (current == NULL)
if (current == NULL || current->IsFree())
continue;
IServerNetworkable *network = current->GetNetworkable();
+4 -1
View File
@@ -215,9 +215,12 @@ void GetIServer()
|| SOURCE_ENGINE == SE_DODS \
|| SOURCE_ENGINE == SE_HL2DM \
|| SOURCE_ENGINE == SE_CSS \
|| SOURCE_ENGINE == SE_SDK2013
|| SOURCE_ENGINE == SE_SDK2013 \
|| SOURCE_ENGINE == SE_INSURGENCY
#if SOURCE_ENGINE != SE_INSURGENCY
if (g_SMAPI->GetEngineFactory(false)("VEngineServer022", nullptr))
#endif // !SE_INSURGENCY
{
iserver = engine->GetIServer();
return;
+57 -1
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod SDKTools Extension
* Copyright (C) 2004-2010 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2010 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -1267,6 +1267,61 @@ static cell_t ActivateEntity(IPluginContext *pContext, const cell_t *params)
return 1;
}
static cell_t SetClientName(IPluginContext *pContext, const cell_t *params)
{
if (iserver == NULL)
{
return pContext->ThrowNativeError("IServer interface not supported, file a bug report.");
}
IGamePlayer *player = playerhelpers->GetGamePlayer(params[1]);
IClient *pClient = iserver->GetClient(params[1] - 1);
if (player == NULL || pClient == NULL)
{
return pContext->ThrowNativeError("Invalid client index %d", params[1]);
}
if (!player->IsConnected())
{
return pContext->ThrowNativeError("Client %d is not connected", params[1]);
}
static ValveCall *pCall = NULL;
if (!pCall)
{
ValvePassInfo params[1];
InitPass(params[0], Valve_String, PassType_Basic, PASSFLAG_BYVAL);
if (!CreateBaseCall("SetClientName", ValveCall_Entity, NULL, params, 1, &pCall))
{
return pContext->ThrowNativeError("\"SetClientName\" not supported by this mod");
}
else if (!pCall)
{
return pContext->ThrowNativeError("\"SetClientName\" wrapper failed to initialize");
}
}
// The IClient vtable is +4 from the CBaseClient vtable due to multiple inheritance.
void *pGameClient = (void *)((intptr_t)pClient - 4);
// Change the name in the engine.
START_CALL();
void **ebuf = (void **)vptr;
*ebuf = pGameClient;
DECODE_VALVE_PARAM(2, vparams, 0);
FINISH_CALL_SIMPLE(NULL);
// Notify the server of the change.
#if SOURCE_ENGINE == SE_DOTA
serverClients->ClientSettingsChanged(player->GetIndex());
#else
serverClients->ClientSettingsChanged(player->GetEdict());
#endif
return 1;
}
static cell_t SetClientInfo(IPluginContext *pContext, const cell_t *params)
{
if (iserver == NULL)
@@ -1418,6 +1473,7 @@ sp_nativeinfo_t g_Natives[] =
{"EquipPlayerWeapon", WeaponEquip},
{"ActivateEntity", ActivateEntity},
{"SetClientInfo", SetClientInfo},
{"SetClientName", SetClientName},
{"GetPlayerResourceEntity", GetPlayerResourceEntity},
{"GivePlayerAmmo", GivePlayerAmmo},
{NULL, NULL},
+13 -8
View File
@@ -41,11 +41,11 @@ cell_t TF2_MakeBleed(IPluginContext *pContext, const cell_t *params)
{
static ICallWrapper *pWrapper = NULL;
// CTFPlayerShared::MakeBleed(CTFPlayer*, CTFWeaponBase*, float, int=4)
// CTFPlayerShared::MakeBleed(CTFPlayer*, CTFWeaponBase*, float, int=4, bool=false)
if(!pWrapper)
{
REGISTER_NATIVE_ADDR("MakeBleed",
PassInfo pass[4]; \
PassInfo pass[5]; \
pass[0].flags = PASSFLAG_BYVAL; \
pass[0].size = sizeof(CBaseEntity *); \
pass[0].type = PassType_Basic; \
@@ -58,7 +58,10 @@ cell_t TF2_MakeBleed(IPluginContext *pContext, const cell_t *params)
pass[3].flags = PASSFLAG_BYVAL; \
pass[3].size = sizeof(int); \
pass[3].type = PassType_Basic; \
pWrapper = g_pBinTools->CreateCall(addr, CallConv_ThisCall, NULL, pass, 4))
pass[4].flags = PASSFLAG_BYVAL; \
pass[4].size = sizeof(bool); \
pass[4].type = PassType_Basic; \
pWrapper = g_pBinTools->CreateCall(addr, CallConv_ThisCall, NULL, pass, 5))
}
CBaseEntity *pEntity;
@@ -75,7 +78,7 @@ cell_t TF2_MakeBleed(IPluginContext *pContext, const cell_t *params)
void *obj = (void *)((uint8_t *)pEntity + playerSharedOffset->actual_offset);
unsigned char vstk[sizeof(void *) + 2*sizeof(CBaseEntity *) + sizeof(float)];
unsigned char vstk[sizeof(void *) + 2*sizeof(CBaseEntity *) + sizeof(float) + sizeof(int) + sizeof(bool)];
unsigned char *vptr = vstk;
*(void **)vptr = obj;
@@ -87,6 +90,8 @@ cell_t TF2_MakeBleed(IPluginContext *pContext, const cell_t *params)
*(float *)vptr = sp_ctof(params[3]);
vptr += sizeof(float);
*(int *)vptr = 4;
vptr += sizeof(int);
*(bool *)vptr = false;
pWrapper->Execute(vstk, NULL);
@@ -98,7 +103,7 @@ cell_t TF2_Burn(IPluginContext *pContext, const cell_t *params)
{
static ICallWrapper *pWrapper = NULL;
// CTFPlayerShared::Burn(CTFPlayer*, CTFWeaponBase*)
// CTFPlayerShared::Burn(CTFPlayer*, CTFWeaponBase*, float=-1.0)
if (!pWrapper)
{
REGISTER_NATIVE_ADDR("Burn",
@@ -129,7 +134,7 @@ cell_t TF2_Burn(IPluginContext *pContext, const cell_t *params)
void *obj = (void *)((uint8_t *)pEntity + playerSharedOffset->actual_offset);
unsigned char vstk[sizeof(void *) + 2*sizeof(CBaseEntity *)];
unsigned char vstk[sizeof(void *) + 2*sizeof(CBaseEntity *) + sizeof(float)];
unsigned char *vptr = vstk;
*(void **)vptr = obj;
@@ -155,7 +160,7 @@ cell_t TF2_Disguise(IPluginContext *pContext, const cell_t *params)
{
static ICallWrapper *pWrapper = NULL;
//CTFPlayerShared::Disguise(int, int, CTFPlayer *)
//CTFPlayerShared::Disguise(int, int, CTFPlayer *, bool=true)
if (!pWrapper)
{
REGISTER_NATIVE_ADDR("Disguise",
@@ -190,7 +195,7 @@ cell_t TF2_Disguise(IPluginContext *pContext, const cell_t *params)
return pContext->ThrowNativeError("Target client index %d is not valid", params[4]);
}
unsigned char vstk[sizeof(void *) + 2*sizeof(int) + sizeof(bool)];
unsigned char vstk[sizeof(void *) + 2*sizeof(int) + sizeof(CBaseEntity *) + sizeof(bool)];
unsigned char *vptr = vstk;
+57 -1
View File
@@ -25,10 +25,66 @@
"plugin_7b3ce69f15e61cc896228cb8424be589" "" /* UCP Server (Endi) - Version 7.8.2 */
"plugin_24602c74f183cfcd157b3d50dee96c52" "" /* UCP Server (Endi) - Version 7.8.3 */
"plugin_43bd225c5fdcd3af35729ca9d481b20d" "" /* UCP Server (Endi) - Version 8.3 */
"plugin_aaeeeedeca7bdbdd630ddc5868daade7" "" /* UCP Server (Endi) - Version 8.4 */
"plugin_78140f1a0f26cd3297767d0598eac4b1" "" /* [Any] PReplay (DarthNinja) - Version 1.0.0 */
"plugin_55923ba6bfe41569a3e4fbd7ca4606e5" "" /* VIP Plugin (World-Source.Ru) - Version 2.0 */
"plugin_55923ba6bfe41569a3e4fbd7ca4606e5" "" /* VIP Plugin (wS) - Version 2.0 */
"plugin_4bf983e1d5b61ba0b1ab9a7e53bfda27" "" /* WarMod CS:GO (Twelve-60) */
"plugin_08574c4295afdaa5f613b8ceef96ecc3" "" /* AlliedBans (TommY) - Version 3.140902A */
"plugin_035ef79cb06a3ebcfaf277641577fdc6" "" /* Ability Levels (wS) - Version v1.1.1 */
"plugin_ce9183f87bf265408cb1c78534cc4863" "" /* Ability Levels Commands (wS) - Version 1.0.1 */
"plugin_d6386cf822f095289b011ca2f47ae6c4" "" /* AdMiN (wS) - Version v2.3.1 */
"plugin_02ef75b4af8c3f1d7998befdd8ed7586" "" /* Jail Control (wS) - Version v2.4.3 */
"plugin_a0c93519819ad79c3c2e27830c7edeff" "" /* Knife Arena (wS) - Version 1.2.7 */
"plugin_daf0ad0dd7c3aa732b9c1cb7a9cbb3cf" "" /* Round Start Effects (wS) - Version 1.2 */
"plugin_c473a87937edf5967db777f1cf04f725" "" /* Continuous Attack (wS) - Version 1.0 */
"plugin_12d7f2697110d4d67f33ca8b2a81c490" "" /* STORE (wS) - Version 2.1.5 */
"plugin_d134bd59c6f8dc2b8df27be31fd966b1" "" /* STORE (Auction) (wS) - Version 1.0 */
"plugin_159560d50105f9a58fa8a94de56c5fc4" "" /* STORE (Bhop) (wS) - Version 1.2 */
"plugin_99d45e0bfd4d4fdd0513cd84c50dca31" "" /* STORE (Credits Giver) (wS) - Version 1.2 */
"plugin_989d2075869168645c7a761ff41f69f6" "" /* STORE (Critical Grenade) (wS) - Version 1.1 */
"plugin_34eddaa68248ff140daad09a58c619de" "" /* STORE (Double Jump) (wS) - Version 1.0 */
"plugin_7bda86011e3365d90bee6dd88f213ae6" "" /* STORE (Enemy Skin) (wS) - Version 1.1 */
"plugin_4f2b15a5b260936149a3123504c1ac7c" "" /* STORE (Gifts) (wS) - Version 1.2 */
"plugin_c1b560cd688de12bebdeaa04999dc3d4" "" /* STORE (Gravity) (wS) - Version 1.1 */
"plugin_79e80527430bba85d311a79cd729b914" "" /* STORE (Health) (wS) - Version 1.2 */
"plugin_79fd13ceb7227c34571833a31d2a4957" "" /* STORE (Lasers) (wS) - Version 1.2 */
"plugin_7c83004d88445d84bf4291fec678614d" "" /* STORE (Money) (wS) - Version 1.3 */
"plugin_b98d853e0387ff44e4e58822949bb5f5" "" /* STORE (Respawn) (wS) - Version 1.2 */
"plugin_d45ef7eb8ef26a46e6ea8e7dc2640ed5" "" /* STORE (Show Credits) (wS) - Version 1.3 */
"plugin_624d31eecf19f9a4a7d87b7d2d2d14aa" "" /* STORE (Skins) (wS) - Version 1.2 */
"plugin_8b2f4f60a77d1e81e6e7026ff6316920" "" /* STORE (Speed) (wS) - Version 1.2 */
"plugin_643e1c5bf55c6ed10763dd46d4620aa4" "" /* STORE (Trails) (wS) - Version 1.2 */
"plugin_b75c6ba4f569c57bc6df906f1a4dfd4f" "" /* STORE (Transfer Credits) (wS) - Version 1.2 */
"plugin_93122ae52ae37c4a13eb9da25562e234" "" /* Teleporter (wS) - Version v1.0 */
"plugin_41f8b0b9b67fa207acf229bdf6251765" "" /* VIP Module (Ammo) (wS) - Version 1.0 */
"plugin_c9ff989b36ff12fcf3b8c93b42ada242" "" /* VIP Module (Anti Flash) (wS) - Version 1.1 */
"plugin_3c9c13133eb8d83c2b4221ca102d90ac" "" /* VIP Module (Armor) (wS) - Version 1.0 */
"plugin_b6eb66fe6fe44a907073825a02932317" "" /* VIP Module (Aura) (wS) - Version 1.1 */
"plugin_d6e99dbf976f4011399075dd4e2c95a8" "" /* VIP Module (BHOP|Double Jump|Parachute) (wS) - Version 1.4.7 */
"plugin_490fdd8bf0457878e89d383180c86e3d" "" /* VIP Module (Chat) (wS) - Version 1.2.1 */
"plugin_1655ed45b5c016bcfd703f8bc59cee69" "" /* VIP Module (DMG Changer) (wS) - Version 1.1 */
"plugin_0b194f78df428423927ba8868bcf3300" "" /* VIP Module (Drop Any Weapon) (wS) - Version 1.2 */
"plugin_0e574d5ffaac4600cd883270b55dc30a" "" /* VIP Module (Flags|Immunity) (wS) - Version 1.1 */
"plugin_a415a21bf430fa8b67b5ca73c9e46fb3" "" /* VIP Module (Gravity) (wS) - Version 1.1 */
"plugin_57d0852c9619c20c57e8a1d6b6f6b9da" "" /* VIP Module (Grenade Explode Effect) (wS) - Version 1.1 */
"plugin_ae385eb0ef6eaf12fb704051b17ac0e8" "" /* VIP Module (Grenade Model) (wS) - Version 1.0 */
"plugin_1915c17c700c2d6dd0c543f04ffcfb5c" "" /* VIP Module (Grenade Trail) (wS) - Version 1.2 */
"plugin_28c7754b3782b5b2f64243b5ac80088e" "" /* VIP Module (Hostage Rescue) (wS) - Version 1.0 */
"plugin_e3f382addaf9d83201dae58e816222e9" "" /* VIP Module (HP Regen) (wS) - Version 1.1 */
"plugin_8c6b5b2813dd289db3294346887d0160" "" /* VIP Module (Kill Cash) (wS) - Version 1.1 */
"plugin_21d22920b63ab7683b86e36aae239996" "" /* VIP Module (Kill HP) (wS) - Version 1.1 */
"plugin_7fb93bf5756a2d8542ca565d8d9aa65a" "" /* VIP Module (More Grenades) (wS) - Version 1.2.1 */
"plugin_43af503aec909771eb5e71fd65a411bb" "" /* VIP Module (Quick Defuse) (wS) - Version 1.1 */
"plugin_cf69750c2be3baf0fe6dd5dc21de257d" "" /* VIP Module (Reset Score) (wS) - Version 1.1 */
"plugin_f50c61c3d3c2f1f1393272c84dbe798d" "" /* VIP Module (Respawn) (wS) - Version 1.1 */
"plugin_43643c4b9ee9ed14fced7b06dd006e7f" "" /* VIP Module (Skins) (wS) - Version 1.2.5 */
"plugin_831bb87c8882c5e17408717cc829c7b6" "" /* VIP Module (Smoke Aura) (wS) - Version 1.1 */
"plugin_fd0550b620e4b280fbf5812478d97a0b" "" /* VIP Module (Speed) (wS) - Version 1.1 */
"plugin_249d893b2f699b51a757f9a0f76408e3" "" /* VIP Module (Team) (wS) - Version 1.1 */
"plugin_9bf46f7ecbf9a94fd4b3f922bb2f1003" "" /* VIP Module (Teleport) (wS) - Version 1.0 */
"plugin_229bb55fb7f4d9e6df47682847201031" "" /* VIP Test (wS) - Version 1.2 */
"plugin_4a9943bb6c831c605c3e4aef38d9c789" "" /* VIP Module (Trails) (wS) - Version 1.2 */
"plugin_2296f1162a2f1886fcad5601c1597835" "" /* VIP (!vips) (wS) - Version 1.2.1 */
}
}
}
+6 -6
View File
@@ -47,17 +47,17 @@
"mac" "294"
}
"PreThink"
{
"windows" "365"
"linux" "366"
"mac" "366"
}
"PostThink"
{
"windows" "366"
"linux" "367"
"mac" "367"
}
"PostThink"
{
"windows" "367"
"linux" "368"
"mac" "368"
}
"Reload"
{
"windows" "308"
+9
View File
@@ -156,6 +156,15 @@
"windows" "17"
}
/**
* CBaseClient::SetName(char const*);
* Has string "(%d)%-0.*s"
*/
"SetClientName"
{
"windows" "16"
}
/**
* Offset into CBaseClient - Used by CBaseServer::UpdateUserSettings to determine when changes have been made.
* Find CBaseClient::UpdateUserSettings (strings "net_maxroutable", "cl_updaterate" etc) and the offset is set to 0 near the end.
+11
View File
@@ -210,6 +210,17 @@
"linux" "64"
"mac" "64"
}
/**
* CBaseClient::SetName(char const*);
* Linux offset straight from VTable dump.
* Has string "(%d)%-0.*s"
*/
"SetClientName"
{
"windows" "16"
"linux" "63"
"mac" "63"
}
/**
* Offset into CBaseClient - Used by CBaseServer::UpdateUserSettings to determine when changes have been made.
* Find CBaseClient::UpdateUserSettings (strings "net_maxroutable", "cl_updaterate" etc) and the offset is set to 0 near the end.
@@ -205,6 +205,17 @@
"linux" "63"
"mac" "63"
}
/**
* CBaseClient::SetName(char const*);
* Linux offset straight from VTable dump.
* Has string "(%d)%-0.*s"
*/
"SetClientName"
{
"windows" "16"
"linux" "62"
"mac" "62"
}
/**
* Offset into CBaseClient - Used by CBaseServer::UpdateUserSettings to determine when changes have been made.
* Find CBaseClient::UpdateUserSettings (strings "net_maxroutable", "cl_updaterate" etc) and the offset is set to 0 near the end.
+20 -9
View File
@@ -220,6 +220,17 @@
"SetUserCvar"
{
/* Not 100% sure on this, why would windows change and not linux - TEST ME */
"windows" "28"
"linux" "65"
"mac" "65"
}
/**
* CBaseClient::SetName(char const*);
* Linux offset straight from VTable dump.
* Has string "(%d)%-0.*s"
*/
"SetClientName"
{
"windows" "27"
"linux" "64"
"mac" "64"
@@ -252,9 +263,9 @@
{
"GiveNamedItem"
{
"windows" "445"
"linux" "446"
"mac" "446"
"windows" "446"
"linux" "447"
"mac" "447"
}
"RemovePlayerItem"
{
@@ -288,9 +299,9 @@
}
"CommitSuicide"
{
"windows" "495"
"linux" "495"
"mac" "495"
"windows" "496"
"linux" "496"
"mac" "496"
}
"GetVelocity"
{
@@ -330,9 +341,9 @@
}
"PlayerRunCmd"
{
"windows" "465"
"linux" "466"
"mac" "466"
"windows" "466"
"linux" "467"
"mac" "467"
}
"GiveAmmo"
{
+11
View File
@@ -193,6 +193,17 @@
"linux" "58"
"mac" "58"
}
/**
* CBaseClient::SetName(char const*);
* Linux offset straight from VTable dump.
* Has string "(%d)%-0.*s"
*/
"SetClientName"
{
"windows" "17"
"linux" "57"
"mac" "57"
}
/**
* Offset into CBaseClient - Used by CBaseServer::UpdateUserSettings to determine when changes have been made.
* Find CBaseClient::UpdateUserSettings (strings "net_maxroutable", "cl_updaterate" etc) and the offset is set to 0 near the end.
+9
View File
@@ -224,6 +224,15 @@
{
"windows" "17"
}
/**
* CBaseClient::SetName(char const*);
* Has string "(%d)%-0.*s"
*/
"SetClientName"
{
"windows" "16"
}
"UpdateUserSettings"
{
+11
View File
@@ -250,6 +250,17 @@
"SetUserCvar"
{
"windows" "26"
"linux" "63"
"mac" "63"
}
/**
* CBaseClient::SetName(char const*);
* Linux offset straight from VTable dump.
* Has string "(%d)%-0.*s"
*/
"SetClientName"
{
"windows" "25"
"linux" "62"
"mac" "62"
}
+10
View File
@@ -256,6 +256,16 @@
"windows" "17"
"linux" "53"
}
/**
* CBaseClient::SetName(char const*);
* Linux offset straight from VTable dump.
* Has string "(%d)%-0.*s"
*/
"SetClientName"
{
"windows" "16"
"linux" "52"
}
/**
* Offset into CBaseClient - Used by CBaseServer::UpdateUserSettings to determine when changes have been made.
* Find CBaseClient::UpdateUserSettings (strings "net_maxroutable", "cl_updaterate" etc) and the offset is set to 0 near the end.
+10
View File
@@ -219,6 +219,16 @@
"windows" "17"
"linux" "55"
}
/**
* CBaseClient::SetName(char const*);
* Linux offset straight from VTable dump.
* Has string "(%d)%-0.*s"
*/
"SetClientName"
{
"windows" "16"
"linux" "54"
}
/**
* Offset into CBaseClient - Used by CBaseServer::UpdateUserSettings to determine when changes have been made.
* Find CBaseClient::UpdateUserSettings (strings "net_maxroutable", "cl_updaterate" etc) and the offset is set to 0 near the end.
@@ -237,6 +237,17 @@
"linux" "58"
"mac" "58"
}
/**
* CBaseClient::SetName(char const*);
* Linux offset straight from VTable dump.
* Has string "(%d)%-0.*s"
*/
"SetClientName"
{
"windows" "17"
"linux" "57"
"mac" "57"
}
/**
* Offset into CBaseClient - Used by CBaseServer::UpdateUserSettings to determine when changes have been made.
* Find CBaseClient::UpdateUserSettings (strings "net_maxroutable", "cl_updaterate" etc) and the offset is set to 0 near the end.
+8
View File
@@ -183,6 +183,14 @@
{
"windows" "17"
}
/**
* CBaseClient::SetName(char const*);
* Has string "(%d)%-0.*s"
*/
"SetClientName"
{
"windows" "16"
}
/**
* Offset into CBaseClient - Used by CBaseServer::UpdateUserSettings to determine when changes have been made.
* Find CBaseClient::UpdateUserSettings (strings "net_maxroutable", "cl_updaterate" etc) and the offset is set to 0 near the end.
+18 -44
View File
@@ -35,7 +35,7 @@
/* Offset into CBaseTempEntity constructor */
"s_pTempEntities"
{
"windows" "19"
"windows" "16"
}
"GetTEName"
{
@@ -62,7 +62,7 @@
"CBaseTempEntity"
{
"library" "server"
"windows" "\x55\x8B\xEC\x8B\xC1\x8B\x4D\x08\xC7\x00\x2A\x2A\x2A\x2A\x89\x48\x2A\x8B"
"windows" "\x55\x8B\xEC\x8B\x45\x08\x89\x41\x04\xC7\x01\x2A\x2A\x2A\x2A\xA1"
}
"s_pTempEntities"
{
@@ -82,7 +82,7 @@
"FindEntityByClassname"
{
"library" "server"
"windows" "\x55\x8B\xEC\x53\x56\x8B\xF1\x8B\x4D\x08\x57\x85\xC9\x74\x2A\x8B\x01\x8B\x50\x08\xFF\xD2\x8B\x00\x83\xF8\xFF\x75\x2A\xB8\xFF\x1F\x00\x00\x8D\x04\x40\x8B\x74\xC6\x2A\xEB"
"windows" "\x55\x8B\xEC\x53\x56\x8B\xF1\x8B\x4D\x08\x57\x85\xC9\x74\x26\x8B\x01\xFF\x50\x08\x8B\x00\x83\xF8\xFF\x75\x0E\xB8\xFF\x1F\x00\x00\x8D\x04\x40\x8B\x74\xC6\x10\xEB\x12\x0F\xB7\xC0\x8D\x04\x40\x8B\x74\xC6\x10\xEB\x06\x8B\xB6\x2A\x2A\x2A\x2A\x85\xF6\x74\x4C"
"linux" "@_ZN17CGlobalEntityList21FindEntityByClassnameEP11CBaseEntityPKc"
"mac" "@_ZN17CGlobalEntityList21FindEntityByClassnameEP11CBaseEntityPKc"
}
@@ -102,7 +102,7 @@
/* Offset into CreateGameRulesObject */
"g_pGameRules"
{
"windows" "2"
"windows" "5"
}
}
@@ -119,7 +119,7 @@
"CreateGameRulesObject"
{
"library" "server"
"windows" "\x8B\x0D\x2A\x2A\x2A\x2A\x85\xC9\x74\x2A\x8B\x01\x8B\x50\x2A\x6A\x01\xFF\xD2"
"windows" "\x55\x8B\xEC\x8B\x0D\x2A\x2A\x2A\x2A\x85\xC9\x74\x07\x8B"
}
"g_pGameRules"
{
@@ -130,43 +130,6 @@
}
}
/* IServer interface pointer */
"#default"
{
"Keys"
{
/* Signature for the beginning of IVEngineServer::CreateFakeClient.
*
* The engine binary is not actually scanned in order to look for
* this. SourceHook is used to used to determine the address of the
* function and this signature is used to verify that it contains
* the expected code. A pointer to sv (IServer interface) is used
* here.
*/
"CreateFakeClient_Windows" "\x55\x8B\xEC\x8B\x2A\x2A\x50\xB9\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\x85\xC0\x75"
}
"Offsets"
{
/* Offset into IVEngineServer::CreateFakeClient */
"sv"
{
"windows" "8"
}
}
"Signatures"
{
/* CBaseServer object for IServer interface */
"sv"
{
"library" "engine"
"linux" "@sv"
"mac" "@sv"
}
}
}
/* EntityFactoryDictionary function */
"#default"
{
@@ -175,7 +138,7 @@
"EntityFactory"
{
"library" "server"
"windows" "\xB8\x01\x00\x00\x00\x84\x2A\x2A\x2A\x2A\x2A\x75\x1D\x09\x2A\x2A\x2A\x2A\x2A\xB9\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\x68\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\x83\xC4\x04\xB8\x2A\x2A\x2A\x2A\xC3"
"windows" "\xA1\x2A\x2A\x2A\x2A\xA8\x01\x75\x1F\x83\xC8\x01\xB9\x2A\x2A\x2A\x2A\xA3\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\x68\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\x83\xC4\x04\xB8"
"linux" "@_Z23EntityFactoryDictionaryv"
"mac" "@_Z23EntityFactoryDictionaryv"
}
@@ -190,7 +153,7 @@
"FireOutput"
{
"library" "server"
"windows" "\x55\x8B\xEC\x81\x2A\x2A\x2A\x2A\x2A\x53\x56\x8B\x71\x2A\x57"
"windows" "\x55\x8B\xEC\x81\xEC\x2A\x2A\x2A\x2A\x53\x8B\xC1\xC7\x45\x2A\x2A\x2A\x2A\x00\x56\x57\x89"
"linux" "@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f"
"mac" "@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f"
}
@@ -214,6 +177,17 @@
"linux" "67"
"mac" "67"
}
/**
* CBaseClient::SetName(char const*);
* Linux offset straight from VTable dump.
* Has string "(%d)%-0.*s"
*/
"SetClientName"
{
"windows" "19"
"linux" "66"
"mac" "66"
}
/**
* Offset into CBaseClient - Used by CBaseServer::UpdateUserSettings to determine when changes have been made.
* Find CBaseClient::UpdateUserSettings (strings "net_maxroutable", "cl_updaterate" etc) and the offset is set to 0 near the end.
+11
View File
@@ -225,6 +225,17 @@
"linux" "63"
"mac" "63"
}
/**
* CBaseClient::SetName(char const*);
* Linux offset straight from VTable dump.
* Has string "(%d)%-0.*s"
*/
"SetClientName"
{
"windows" "16"
"linux" "62"
"mac" "62"
}
/**
* Offset into CBaseClient - Used by CBaseServer::UpdateUserSettings to determine when changes have been made.
* Find CBaseClient::UpdateUserSettings (strings "net_maxroutable", "cl_updaterate" etc) and the offset is set to 0 near the end.
+11
View File
@@ -102,6 +102,17 @@
"linux" "63"
"mac" "63"
}
/**
* CBaseClient::SetName(char const*);
* Linux offset straight from VTable dump.
* Has string "(%d)%-0.*s"
*/
"SetClientName"
{
"windows" "16"
"linux" "62"
"mac" "62"
}
/**
* Offset into CBaseClient - Used by CBaseServer::UpdateUserSettings to determine when changes have been made.
* Find CBaseClient::UpdateUserSettings (strings "net_maxroutable", "cl_updaterate" etc) and the offset is set to 0 near the end.
@@ -91,6 +91,17 @@
"linux" "58"
"mac" "58"
}
/**
* CBaseClient::SetName(char const*);
* Linux offset straight from VTable dump.
* Has string "(%d)%-0.*s"
*/
"SetClientName"
{
"windows" "17"
"linux" "57"
"mac" "57"
}
/**
* Offset into CBaseClient - Used by CBaseServer::UpdateUserSettings to determine when changes have been made.
* Find CBaseClient::UpdateUserSettings (strings "net_maxroutable", "cl_updaterate" etc) and the offset is set to 0 near the end.
+8
View File
@@ -180,6 +180,14 @@
/* Not 100% sure on this, why would windows change and not linux - TEST ME */
"windows" "17"
}
/**
* CBaseClient::SetName(char const*);
* Has string "(%d)%-0.*s"
*/
"SetClientName"
{
"windows" "16"
}
/**
* Offset into CBaseClient - Used by CBaseServer::UpdateUserSettings to determine when changes have been made.
* Find CBaseClient::UpdateUserSettings (strings "net_maxroutable", "cl_updaterate" etc) and the offset is set to 0 near the end.
+5 -5
View File
@@ -113,22 +113,22 @@
"CreateGameRulesObject"
{
"library" "server"
"windows" "\x8B\x0D\x2A\x2A\x2A\x2A\x85\xC9\x74\x09\x8B\x01\x8B\x50\x2C\x6A\x01"
"windows" "\x8B\x0D\x2A\x2A\x2A\x2A\x85\xC9\x74\x2A\x8B\x01\x8B\x50\x2C\x6A\x01\xFF\xD2\x53\x56\x8B"
}
"FindEntityByClassname"
{
"library" "server"
"windows" "\x53\x55\x56\x8B\xF1\x8B\x4C\x24\x10\x85\xC9\x57\x74\x19\x8B\x01\x8B\x50\x08\xFF\xD2\x8B\x00\x25\xFF\x0F\x00\x00\x83\xC0\x01\xC1\xE0\x04\x8B\x3C\x30\xEB\x06\x8B\xBE\x04\x00\x01\x00\x85\xFF\x74\x39\x8B\x5C\x24\x18\x8B\x2D\x2A\x2A\x2A\x2A\xEB\x03"
"windows" "\x53\x55\x56\x8B\xF1\x8B\x4C\x24\x10\x85\xC9\x57\x74\x2A\x8B\x01\x8B\x50\x08\xFF\xD2\x8B\x00\x25\xFF\x0F\x00\x00\x83\xC0\x01\xC1\xE0\x04\x8B\x3C\x30\xEB\x2A\x8B\xBE\x04\x00\x01\x00\x85\xFF\x74\x2A\x8B\x5C\x24\x18\x8B\x2D\x2A\x2A\x2A\x2A\xEB\x2A\x8D\x49\x00\x8B\x37\x85\xF6\x75\x2A\x68\x2A\x2A\x2A\x2A\xFF\xD5\x83\xC4\x04\xEB\x2A\x39\x5E\x34\x74\x2A\x53\x8B\xCE\xE8\x2A\x2A\x2A\x2A\x84\xC0"
}
"DispatchSpawn"
{
"library" "server"
"windows" "\x53\x55\x56\x8B\x74\x24\x10\x85\xF6\x57\x0F\x84\x2A\x2A\x2A\x2A\x8B\x1D\x2A\x2A\x2A\x2A\x8B\x03\x8B\x50\x60\x8B\xCB"
"windows" "\x53\x55\x56\x8B\x74\x24\x10\x85\xF6\x57\x0F\x84\x2A\x2A\x2A\x2A\x8B\x1D\x2A\x2A\x2A\x2A\x8B\x03"
}
"CreateEntityByName"
{
"library" "server"
"windows" "\x56\x8B\x74\x24\x0C\x83\xFE\xFF\x57\x8B\x7C\x24\x0C\x74\x27\x8B\x0D\x2A\x2A\x2A\x2A\x8B\x01\x8B\x50\x54\x56\xFF\xD2"
"windows" "\x56\x8B\x74\x24\x0C\x83\xFE\xFF\x57\x8B\x7C\x2A\x2A\x74\x2A\x8B\x0D\x2A\x2A\x2A\x2A\x8B\x01\x8B"
}
"FireOutput"
{
@@ -143,4 +143,4 @@
"GameRulesProxy" "CFFGameRulesProxy"
}
}
}
}
+12 -1
View File
@@ -125,6 +125,17 @@
"linux" "63"
"mac" "63"
}
/**
* CBaseClient::SetName(char const*);
* Linux offset straight from VTable dump.
* Has string "(%d)%-0.*s"
*/
"SetClientName"
{
"windows" "16"
"linux" "62"
"mac" "62"
}
/**
* Offset into CBaseClient - Used by CBaseServer::UpdateUserSettings to determine when changes have been made.
* Find CBaseClient::UpdateUserSettings (strings "net_maxroutable", "cl_updaterate" etc) and the offset is set to 0 near the end.
@@ -248,4 +259,4 @@
}
}
}
}
}
+3 -3
View File
@@ -56,7 +56,7 @@
//Offset into HandleCommand_Buy_Internal
"CCSPlayerInventoryOffset"
{
"windows" "285"
"windows" "55"
"linux" "32"
"mac" "109"
}
@@ -95,7 +95,7 @@
"HandleCommand_Buy_Internal"//Wildcard first 6 bytes for getting address for weapon price.
{
"library" "server"
"windows" "\x2A\x2A\x2A\x2A\x2A\x2A\x81\xEC\x2A\x2A\x2A\x2A\x83\x3D\x2A\x2A\x2A\x2A\x00\x53\x56\x57\x8B\xF9"
"windows" "\x2A\x2A\x2A\x2A\x2A\x2A\x81\xEC\x64\x01\x00\x00\x53\x56\x57\x6A\x00\x8B\xF9\xE8\x2A\x2A\x2A\x2A\x33\xC9\x84\xC0"
"linux" "@_ZN9CCSPlayer26HandleCommand_Buy_InternalEPKcib"
"mac" "@_ZN9CCSPlayer26HandleCommand_Buy_InternalEPKcib"
}
@@ -109,7 +109,7 @@
"TerminateRound"
{
"library" "server"
"windows" "\x55\x8B\xEC\x83\x2A\x2A\x83\x2A\x2A\x53\x56\x57\x8B\xF9\xF3\x0F\x2A\x2A\x2A\x2A\x33\xDB\xC7\x2A\x2A\x2A\x00\x00\x00\x00\x89"
"windows" "\x55\x8B\xEC\x83\xE4\xF8\x83\xEC\x3C\x53\x8B\xD9\xF3\x0F\x11\x4C\x24\x18\x56\x57\x89\x2A\x2A\x2A\x83"
"linux" "@_ZN12CCSGameRules14TerminateRoundEfi"
"mac" "@_ZN12CCSGameRules14TerminateRoundEfi"
}
+9 -9
View File
@@ -81,9 +81,9 @@
"MakeBleed"
{
"library" "server"
"windows" "\x55\x8B\xEC\x83\xEC\x20\x56\x8B\xF1\x89\x75\xF8\x8B\x8E"
"linux" "@_ZN15CTFPlayerShared9MakeBleedEP9CTFPlayerP13CTFWeaponBasefi"
"mac" "@_ZN15CTFPlayerShared9MakeBleedEP9CTFPlayerP13CTFWeaponBasefi"
"windows" "\x55\x8B\xEC\x83\xEC\x24\x56\x8B\xF1\x89\x75\xF8\x8B\x8E\x2A\x2A\x2A\x2A\x8B\x01"
"linux" "@_ZN15CTFPlayerShared9MakeBleedEP9CTFPlayerP13CTFWeaponBasefib"
"mac" "@_ZN15CTFPlayerShared9MakeBleedEP9CTFPlayerP13CTFWeaponBasefib"
}
"IsPlayerInDuel"
{
@@ -118,17 +118,17 @@
"mac" "326"
}
"CalcIsAttackCriticalHelper"
{
"windows" "384"
"linux" "391"
"mac" "391"
}
"CalcIsAttackCriticalHelperNoCrits"
{
"windows" "385"
"linux" "392"
"mac" "392"
}
"CalcIsAttackCriticalHelperNoCrits"
{
"windows" "386"
"linux" "393"
"mac" "393"
}
// CTFGameRules::IsHolidayActive
"IsHolidayActive"
+1 -1
View File
@@ -350,7 +350,7 @@ public void OnReceiveUser(Database db, DBResultSet rs, const char[] error, any d
/**
* Cache user info -- [0] = db id, [1] = cache id, [2] = groups
*/
char[][] user_lookup = new char[num_accounts][3];
int[][] user_lookup = new int[num_accounts][3];
int total_users = 0;
while (rs.FetchRow())
+2 -4
View File
@@ -63,17 +63,15 @@
* the Handle or add categories.
*
* @param topmenu Handle to the admin menu's TopMenu.
* @noreturn
*/
forward OnAdminMenuCreated(Handle topmenu);
forward void OnAdminMenuCreated(Handle topmenu);
/**
* Called when the admin menu is ready to have items added.
*
* @param topmenu Handle to the admin menu's TopMenu.
* @noreturn
*/
forward OnAdminMenuReady(Handle topmenu);
forward void OnAdminMenuReady(Handle topmenu);
/**
* Retrieves the Handle to the admin top menu.
+27 -24
View File
@@ -9,7 +9,7 @@
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, version 3.0, as published by the
* Free Software Foundation.
*
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
@@ -29,14 +29,14 @@
*
* Version: $Id$
*/
#if defined _adt_array_included
#endinput
#endif
#define _adt_array_included
/**
* Given a maximum string size (including the null terminator),
* Given a maximum string size (including the null terminator),
* returns the number of cells required to fit that string.
*
* @param size Number of bytes.
@@ -52,16 +52,16 @@ stock ByteCountToCells(size)
methodmap ArrayList < Handle {
// Creates a dynamic global cell array. While slower than a normal array,
// it can be used globally AND dynamically, which is otherwise impossible.
//
// The contents of the array are uniform; i.e. storing a string at index X
//
// The contents of the array are uniform; i.e. storing a string at index X
// and then retrieving it as an integer is NOT the same as StringToInt()!
// The "blocksize" determines how many cells each array slot has; it cannot
// be changed after creation.
//
// @param blocksize The number of cells each member of the array can
// @param blocksize The number of cells each member of the array can
// hold. For example, 32 cells is equivalent to:
// new Array[X][32]
// @param startsize Initial size of the array. Note that data will
// @param startsize Initial size of the array. Note that data will
// NOT be auto-intialized.
// @return New Handle to the array object.
public native ArrayList(int blocksize=1, int startsize=0);
@@ -106,7 +106,7 @@ methodmap ArrayList < Handle {
//
// @param values Block of values to copy.
// @param size If not set, the number of elements copied from the array
// will be equal to the blocksize. If set higher than the
// will be equal to the blocksize. If set higher than the
// blocksize, the operation will be truncated.
// @return Index of the new entry.
public native int PushArray(const any[] values, int size=-1);
@@ -168,15 +168,15 @@ methodmap ArrayList < Handle {
// @error Invalid index.
public native void SetArray(int index, const any[] values, int size=-1);
// Shifts an array up. All array contents after and including the given
// index are shifted up by one, and the given index is then "free."
// Shifts an array up. All array contents after and including the given
// index are shifted up by one, and the given index is then "free."
// After shifting, the contents of the given index is undefined.
//
// @param index Index in the array to shift up from.
// @error Invalid index.
public native void ShiftUp(int index);
// Removes an array index, shifting the entire array down from that position
// Removes an array index, shifting the entire array down from that position
// on. For example, if item 8 of 10 is removed, the last 3 items will then be
// (6,7,8) instead of (7,8,9), and all indexes before 8 will remain unchanged.
//
@@ -197,13 +197,15 @@ methodmap ArrayList < Handle {
// @param item String to search for
// @return Array index, or -1 on failure
public native int FindString(const char[] item);
// Returns the index for the first occurance of the provided value. If the
// value cannot be located, -1 will be returned.
//
// @param item Value to search for
// @param block Optionally which block to search in
// @return Array index, or -1 on failure
public native int FindValue(any item);
// @error Invalid block index
public native int FindValue(any item, int block=0);
// Retrieve the size of the array.
property int Length {
@@ -214,16 +216,16 @@ methodmap ArrayList < Handle {
/**
* Creates a dynamic global cell array. While slower than a normal array,
* it can be used globally AND dynamically, which is otherwise impossible.
*
* The contents of the array are uniform; i.e. storing a string at index X
*
* The contents of the array are uniform; i.e. storing a string at index X
* and then retrieving it as an integer is NOT the same as StringToInt()!
* The "blocksize" determines how many cells each array slot has; it cannot
* be changed after creation.
*
* @param blocksize The number of cells each member of the array can
* @param blocksize The number of cells each member of the array can
* hold. For example, 32 cells is equivalent to:
* new Array[X][32]
* @param startsize Initial size of the array. Note that data will
* @param startsize Initial size of the array. Note that data will
* NOT be auto-intialized.
* @return New Handle to the array object.
*/
@@ -300,7 +302,7 @@ native int PushArrayString(Handle array, const char[] value);
* @param array Array Handle.
* @param values Block of values to copy.
* @param size If not set, the number of elements copied from the array
* will be equal to the blocksize. If set higher than the
* will be equal to the blocksize. If set higher than the
* blocksize, the operation will be truncated.
* @return Index of the new entry.
* @error Invalid Handle or out of memory.
@@ -383,8 +385,8 @@ native int SetArrayString(Handle array, int index, const char[] value);
native int SetArrayArray(Handle array, int index, const any[] values, int size=-1);
/**
* Shifts an array up. All array contents after and including the given
* index are shifted up by one, and the given index is then "free."
* Shifts an array up. All array contents after and including the given
* index are shifted up by one, and the given index is then "free."
* After shifting, the contents of the given index is undefined.
*
* @param array Array Handle.
@@ -394,7 +396,7 @@ native int SetArrayArray(Handle array, int index, const any[] values, int size=-
native void ShiftArrayUp(Handle array, int index);
/**
* Removes an array index, shifting the entire array down from that position
* Removes an array index, shifting the entire array down from that position
* on. For example, if item 8 of 10 is removed, the last 3 items will then be
* (6,7,8) instead of (7,8,9), and all indexes before 8 will remain unchanged.
*
@@ -424,14 +426,15 @@ native void SwapArrayItems(Handle array, int index1, int index2);
* @error Invalid Handle
*/
native int FindStringInArray(Handle array, const char[] item);
/**
* Returns the index for the first occurance of the provided value. If the value
* cannot be located, -1 will be returned.
*
* @param array Array Handle.
* @param item Value to search for
* @param block Optionally which block to search in
* @return Array index, or -1 on failure
* @error Invalid Handle
* @error Invalid Handle or invalid block
*/
native int FindValueInArray(Handle array, any item);
native int FindValueInArray(Handle array, any item, int block=0);
+2 -2
View File
@@ -41,7 +41,7 @@
* @param client Client index
* @param muteState True if client was muted, false otherwise
*/
forward BaseComm_OnClientMute(client, bool:muteState);
forward void BaseComm_OnClientMute(client, bool:muteState);
/**
* Called when a client is gagged or ungagged
@@ -49,7 +49,7 @@
* @param client Client index
* @param gagState True if client was gaged, false otherwise
*/
forward BaseComm_OnClientGag(client, bool:gagState);
forward void BaseComm_OnClientGag(client, bool:gagState);
/**
* Returns whether or not a client is gagged
+1 -1
View File
@@ -156,7 +156,7 @@ native bool:AreClientCookiesCached(client);
*
* @param client Client index.
*/
forward OnClientCookiesCached(client);
forward void OnClientCookiesCached(client);
/**
* Cookie Menu Callback prototype
+1 -1
View File
@@ -144,7 +144,7 @@ forward Action:CS_OnBuyCommand(client, const String:weapon[]);
/**
* Called when CSWeaponDrop is called
* Return Plugin_Continue to allow the call or return a
* higher action to deny.
* higher action to block.
*
* @param client Client index
* @param weaponIndex Weapon index
+5 -7
View File
@@ -477,15 +477,13 @@ stock Database SQLite_UseDatabase(const char[] database,
char[] error,
maxlength)
{
Handle kv, db;
KeyValues kv = CreateKeyValues("");
kv.SetString("driver", "sqlite");
kv.SetString("database", database);
kv = CreateKeyValues("");
KvSetString(kv, "driver", "sqlite");
KvSetString(kv, "database", database);
Database db = SQL_ConnectCustom(kv, error, maxlength, false);
db = SQL_ConnectCustom(kv, error, maxlength, false);
CloseHandle(kv);
delete kv;
return db;
}
+2 -2
View File
@@ -318,10 +318,10 @@ native Call_PushString(const String:value[]);
* @param value String to push.
* @param length Length of string buffer.
* @param szflags Flags determining how string should be handled.
* See SP_PARAM_STRING_* constants for details.
* See SM_PARAM_STRING_* constants for details.
* The default (0) is to push ASCII.
* @param cpflags Whether or not changes should be copied back to the input array.
* See SP_PARAM_* constants for details.
* See SM_PARAM_* constants for details.
* @noreturn
* @error Called before a call has been started.
*/
+15 -18
View File
@@ -299,17 +299,15 @@ typeset SDKHookCB
*
* @param entity Entity index
* @param classname Class name
* @noreturn
*/
forward OnEntityCreated(entity, const String:classname[]);
forward void OnEntityCreated(int entity, const char[] classname);
/**
* @brief When an entity is destroyed
*
* @param entity Entity index
* @noreturn
*/
forward OnEntityDestroyed(entity);
forward void OnEntityDestroyed(int entity);
/**
* @brief When the game description is retrieved
@@ -317,18 +315,18 @@ forward OnEntityDestroyed(entity);
* @note Not supported on ep2v.
*
* @param gameDesc Game description
* @noreturn
* @return Plugin_Changed if gameDesc has been edited, else no change.
*/
forward Action:OnGetGameDescription(String:gameDesc[64]);
forward Action OnGetGameDescription(char gameDesc[64]);
/**
* @brief When the level is initialized
*
* @param mapName Name of the map
* @param mapEntities Entities of the map
* @noreturn
* @return Plugin_Changed if mapEntities has been edited, else no change.
*/
forward Action:OnLevelInit(const String:mapName[], String:mapEntities[2097152]);
forward Action OnLevelInit(const char[] mapName, char mapEntities[2097152]);
/**
* @brief Hooks an entity
@@ -336,9 +334,8 @@ forward Action:OnLevelInit(const String:mapName[], String:mapEntities[2097152]);
* @param entity Entity index
* @param type Type of function to hook
* @param callback Function to call when hook is called
* @noreturn
*/
native SDKHook(entity, SDKHookType:type, SDKHookCB:callback);
native void SDKHook(int entity, SDKHookType type, SDKHookCB callback);
/**
* @brief Hooks an entity
@@ -348,7 +345,7 @@ native SDKHook(entity, SDKHookType:type, SDKHookCB:callback);
* @param callback Function to call when hook is called
* @return bool Hook Successful
*/
native bool:SDKHookEx(entity, SDKHookType:type, SDKHookCB:callback);
native bool SDKHookEx(int entity, SDKHookType type, SDKHookCB callback);
/**
* @brief Unhooks an entity
@@ -356,9 +353,8 @@ native bool:SDKHookEx(entity, SDKHookType:type, SDKHookCB:callback);
* @param entity Entity index
* @param type Type of function to unhook
* @param callback Callback function to unhook
* @noreturn
*/
native SDKUnhook(entity, SDKHookType:type, SDKHookCB:callback);
native void SDKUnhook(int entity, SDKHookType type, SDKHookCB callback);
/**
* @brief Applies damage to an entity
@@ -373,9 +369,10 @@ native SDKUnhook(entity, SDKHookType:type, SDKHookCB:callback);
* @param weapon Weapon index (orangebox and later) or -1 for unspecified
* @param damageForce Velocity of damage force
* @param damagePosition Origin of damage
* @noreturn
*/
native SDKHooks_TakeDamage(entity, inflictor, attacker, Float:damage, damageType=DMG_GENERIC, weapon=-1, const Float:damageForce[3]=NULL_VECTOR, const Float:damagePosition[3]=NULL_VECTOR);
native void SDKHooks_TakeDamage(int entity, int inflictor, int attacker,
float damage, int damageType=DMG_GENERIC, int weapon=-1,
const float damageForce[3]=NULL_VECTOR, const float damagePosition[3]=NULL_VECTOR);
/**
* @brief Forces a client to drop the specified weapon
@@ -384,15 +381,15 @@ native SDKHooks_TakeDamage(entity, inflictor, attacker, Float:damage, damageType
* @param weapon Weapon entity index.
* @param vecTarget Location to toss weapon to, or NULL_VECTOR for default.
* @param vecVelocity Velocity at which to toss weapon, or NULL_VECTOR for default.
* @noreturn
* @error Invalid client or weapon entity, weapon not owned by client.
*/
native SDKHooks_DropWeapon(client, weapon, const Float:vecTarget[3]=NULL_VECTOR, const Float:vecVelocity[3]=NULL_VECTOR);
native void SDKHooks_DropWeapon(int client, int weapon, const float vecTarget[3]=NULL_VECTOR,
const float vecVelocity[3]=NULL_VECTOR);
/**
* Do not edit below this line!
*/
public Extension:__ext_sdkhooks =
public Extension __ext_sdkhooks =
{
name = "SDKHooks",
file = "sdkhooks.ext",
+9
View File
@@ -332,6 +332,15 @@ native ActivateEntity(entity);
*/
native SetClientInfo(client, const String:key[], const String:value[]);
/**
* Changes a client's name.
*
* @param client Player's index.
* @param name New name.
* @error Invalid client index, or client not connected.
*/
native void SetClientName(int client, const char[] name);
/**
* Gives ammo of a certain type to a player.
* This natives obeys the maximum amount of ammo a player can carry per ammo type.
+4 -4
View File
@@ -92,10 +92,6 @@ enum APLRes
* If any run-time error is thrown during this callback, the plugin will be marked
* as failed.
*
* It is not necessary to close any handles or remove hooks in this function.
* SourceMod guarantees that plugin shutdown automatically and correctly releases
* all resources.
*
* @noreturn
*/
forward void OnPluginStart();
@@ -132,6 +128,10 @@ forward APLRes:AskPluginLoad2(Handle:myself, bool:late, String:error[], err_max)
/**
* Called when the plugin is about to be unloaded.
*
* It is not necessary to close any handles or remove hooks in this function.
* SourceMod guarantees that plugin shutdown automatically and correctly releases
* all resources.
*
* @noreturn
*/
forward void OnPluginEnd();
+4 -10
View File
@@ -399,32 +399,26 @@ native TF2_RemoveWearable(client, wearable);
*
* @param client Index of the client to which the conditon is being added.
* @param condition Condition that is being added.
* @noreturn
*/
forward TF2_OnConditionAdded(client, TFCond:condition);
forward void TF2_OnConditionAdded(client, TFCond:condition);
/**
* Called after a condition is removed from a player
*
* @param client Index of the client to which the condition is being removed.
* @param condition Condition that is being removed.
* @noreturn
*/
forward TF2_OnConditionRemoved(client, TFCond:condition);
forward void TF2_OnConditionRemoved(client, TFCond:condition);
/**
* Called when the server enters the Waiting for Players round state
*
* @noreturn
*/
forward TF2_OnWaitingForPlayersStart();
forward void TF2_OnWaitingForPlayersStart();
/**
* Called when the server exits the Waiting for Players round state
*
* @noreturn
*/
forward TF2_OnWaitingForPlayersEnd();
forward void TF2_OnWaitingForPlayersEnd();
/**
* Called when a player attempts to use a teleporter to decide if the player should be allowed to teleport.
+42 -29
View File
@@ -9,7 +9,7 @@
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, version 3.0, as published by the
* Free Software Foundation.
*
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
@@ -262,7 +262,7 @@ enum
TFWeaponSlot_Building,
TFWeaponSlot_PDA,
TFWeaponSlot_Item1,
TFWeaponSlot_Item2
TFWeaponSlot_Item2
};
// Identifiers for the eventtype property on the teamplay_flag_event event
@@ -279,12 +279,12 @@ enum TFResourceType
TFResource_Ping,
TFResource_Score,
TFResource_Deaths,
TFResource_TotalScore,
TFResource_TotalScore,
TFResource_Captures,
TFResource_Defenses,
TFResource_Dominations,
TFResource_Revenge,
TFResource_BuildingsDestroyed,
TFResource_BuildingsDestroyed,
TFResource_Headshots,
TFResource_Backstabs,
TFResource_HealPoints,
@@ -320,7 +320,7 @@ static const String:TFResourceNames[TFResourceType][] =
/**
* Gets a client's current team.
*
*
* @param client Client index.
* @return Current TFTeam of client.
* @error Invalid client index.
@@ -330,6 +330,19 @@ stock TFTeam:TF2_GetClientTeam(client)
return TFTeam:GetClientTeam(client);
}
/**
* Changes a client's current team.
*
* @param client Client index.
* @param team TFTeam team symbol.
* @noreturn
* @error Invalid client index.
*/
stock TF2_ChangeClientTeam(client, TFTeam:team)
{
ChangeClientTeam(client, _:team);
}
/**
* Gets a client's current class.
*
@@ -357,7 +370,7 @@ stock TFClassType:TF2_GetPlayerClass(client)
stock TF2_SetPlayerClass(client, TFClassType:classType, bool:weapons=true, bool:persistent=true)
{
SetEntProp(client, Prop_Send, "m_iClass", _:classType);
if (persistent)
{
SetEntProp(client, Prop_Send, "m_iDesiredPlayerClass", _:classType);
@@ -377,23 +390,23 @@ stock TF2_GetPlayerResourceData(client, TFResourceType:type)
{
if (!IsClientConnected(client))
{
return -1;
return -1;
}
new offset = FindSendPropInfo("CTFPlayerResource", TFResourceNames[type]);
if (offset < 1)
{
return -1;
return -1;
}
new entity = TF2_GetResourceEntity();
if (entity == -1)
{
return -1;
}
return GetEntData(entity, offset + (client*4));
}
@@ -413,26 +426,26 @@ stock bool:TF2_SetPlayerResourceData(client, TFResourceType:type, any:value)
{
if (!IsClientConnected(client))
{
return false;
return false;
}
new offset = FindSendPropInfo("CTFPlayerResource", TFResourceNames[type]);
if (offset < 1)
{
return false;
return false;
}
new entity = TF2_GetResourceEntity();
if (entity == -1)
{
return false;
return false;
}
SetEntData(entity, offset + (client*4), value);
return true;
return true;
}
/**
@@ -510,7 +523,7 @@ stock bool:TF2_IsPlayerInCondition(client, TFCond:cond)
{
return true;
}
if ((GetEntProp(client, Prop_Send, "_condition_bits") & bit) == bit)
{
return true;
@@ -540,7 +553,7 @@ stock bool:TF2_IsPlayerInCondition(client, TFCond:cond)
return true;
}
}
return false;
}
@@ -554,12 +567,12 @@ stock bool:TF2_IsPlayerInCondition(client, TFCond:cond)
stock TFObjectType:TF2_GetObjectType(entity)
{
new offset = GetEntSendPropOffs(entity, "m_iObjectType");
if (offset <= 0)
{
ThrowError("Entity index %d is not an object", entity);
}
return TFObjectType:GetEntData(entity, offset);
}
@@ -573,11 +586,11 @@ stock TFObjectType:TF2_GetObjectType(entity)
stock TFObjectMode:TF2_GetObjectMode(entity)
{
new offset = GetEntSendPropOffs(entity, "m_iObjectMode");
if (offset <= 0)
{
ThrowError("Entity index %d is not an object", entity);
}
return TFObjectMode:GetEntData(entity, offset);
}
+1
View File
@@ -96,6 +96,7 @@ native Handle:CreateTimer(Float:interval, Timer:func, any:data=INVALID_HANDLE, f
* @param autoClose If autoClose is true, the data that was passed to CreateTimer() will
* be closed as a handle if TIMER_DATA_HNDL_CLOSE was not specified.
* @noreturn
* @error Invalid handles will cause a run time error.
*/
native KillTimer(Handle:timer, bool:autoClose=false);
-5
View File
@@ -50,9 +50,6 @@ public Plugin:myinfo =
TopMenu hTopMenu;
/* Used to get the SDK / Engine version. */
/* This is used in sm_rename and sm_changeteam */
new EngineVersion:g_ModVersion = Engine_Unknown;
#include "playercommands/slay.sp"
#include "playercommands/slap.sp"
#include "playercommands/rename.sp"
@@ -65,8 +62,6 @@ public OnPluginStart()
RegAdminCmd("sm_slap", Command_Slap, ADMFLAG_SLAY, "sm_slap <#userid|name> [damage]");
RegAdminCmd("sm_slay", Command_Slay, ADMFLAG_SLAY, "sm_slay <#userid|name>");
RegAdminCmd("sm_rename", Command_Rename, ADMFLAG_SLAY, "sm_rename <#userid|name>");
g_ModVersion = GetEngineVersion();
/* Account for late loading */
TopMenu topmenu;
+1 -15
View File
@@ -37,22 +37,8 @@ PerformRename(client, target)
{
LogAction(client, target, "\"%L\" renamed \"%L\" to \"%s\")", client, target, g_NewName[target]);
/* Used on OB / L4D engine */
if (g_ModVersion != Engine_SourceSDK2006)
{
SetClientInfo(target, "name", g_NewName[target]);
}
else /* Used on CSS and EP1 / older engine */
{
if (!IsPlayerAlive(target)) /* Lets tell them about the player renamed on the next round since they're dead. */
{
decl String:m_TargetName[MAX_NAME_LENGTH];
SetClientName(target, g_NewName[target]);
GetClientName(target, m_TargetName, sizeof(m_TargetName));
ReplyToCommand(client, "[SM] %t", "Dead Player Rename", m_TargetName);
}
ClientCommand(target, "name %s", g_NewName[target]);
}
g_NewName[target][0] = '\0';
}
+1 -1
View File
@@ -1 +1 @@
1.7.0
1.7.2
+7 -8
View File
@@ -4,6 +4,8 @@
#define _GNU_SOURCE
#include <dlfcn.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#define REG_EAX 0
#define REG_ECX 1
@@ -13,8 +15,6 @@
#define IA32_MOV_REG_IMM 0xB8 // encoding is +r <imm32>
#endif
extern void Msg( const char *, ... );
/**
* Checks if a call to a fpic thunk has just been written into dest.
* If found replaces it with a direct mov that sets the required register to the value of pc.
@@ -25,9 +25,7 @@ extern void Msg( const char *, ... );
*/
void check_thunks(unsigned char *dest, unsigned char *pc)
{
#if defined WIN32
return;
#else
#ifndef WIN32
/* Step write address back 4 to the start of the function address */
unsigned char *writeaddr = dest - 4;
unsigned char *calloffset = *(unsigned char **)writeaddr;
@@ -64,7 +62,10 @@ void check_thunks(unsigned char *dest, unsigned char *pc)
}
default:
{
Msg("Unknown thunk: %c\n", *(calladdr+1));
printf("Unknown thunk: %c\n", *(calladdr+1));
#ifndef NDEBUG
abort();
#endif
break;
}
}
@@ -81,8 +82,6 @@ void check_thunks(unsigned char *dest, unsigned char *pc)
*(void **)writeaddr = (void *)pc;
writeaddr += 4;
}
return;
#endif
}
+2 -2
View File
@@ -117,12 +117,12 @@ public:
return table_.findForAdd(aKey);
}
void add(Insert &i, const T &value)
bool add(Insert &i, const T &value)
{
return table_.add(i, value);
}
void add(Insert &i, ke::Moveable<T> value)
bool add(Insert &i, ke::Moveable<T> value)
{
return table_.add(i, value);
}
+6 -4
View File
@@ -2,14 +2,14 @@ a billion and nanas
joys of buildbot, part 2: buildbot and the very lonely square-shaped duck
joys of buildbot, part 3: an accidental event proves troublesome for a psychic fish
joys of buildbot, part 4: a transient mummy is perplexed by a broken wand
buildbot has horrible blugs
buildbot has horrible bloogs
I am the very model of a modern major general
It's no wonder the build always falls over when we call it pushing.
h
i
D
S
!
!!!
joys of buildbot, part 5: a watermelon's diatribes need not be cause for spilling the queen's tea
crab
joys of buildbot, part 6: a merry metal matchturtle mocks mostly and mainly in Madrid.
@@ -17,11 +17,11 @@ joys of buildbot, part nana: if you don't do as you are told, buildbot-san, you
DS saves us from Valve again.
Pants will save us from certain death.
Invaders' blood marches through my veins, like GIANT RADIOACTIVE RUBBER PANTS!
THE PANTS COMMAND COMMAND ME! DO NOT IGNORE MY VEINS.
¡ THE PANTS COMMAND COMMAND ME! DO NOT IGNORE MY VEINS. !
This file sure has gotten big.
sawce is rukia and loves anime, sushi, and macs
ur
oh, it's so cute. she calls it a mayonegg
oh, it's so cute. she sometimes takes a little pack of mayonnaise, and she'll squirt it in her mouth all over, and then she'll take an egg and kind of... mmmmm. she calls it a mayonegg
not me
javaliabuf64k..
"line 29" rhymes... kinda. <-- CONFIRMED
@@ -68,3 +68,5 @@ Buildbot, I hereby challenge you to an honorable prison stabbing to the death!
Bees.
Beads.
snakesssssssss; maple
pie?
Your tier1 tower is under attack..
+20 -1
View File
@@ -248,6 +248,20 @@ typedef struct value_s {
char boolresult; /* boolean result for relational operators */
cell *arrayidx; /* last used array indices, for checking self assignment */
// Returns whether the value can be rematerialized based on static
// information, or whether it is the result of an expression.
bool canRematerialize() const {
switch (ident) {
case iVARIABLE:
case iCONSTEXPR:
return true;
case iREFERENCE:
return sym->vclass == sLOCAL;
default:
return false;
}
}
/* when ident == iACCESSOR */
struct methodmap_method_s *accessor;
} value;
@@ -256,6 +270,10 @@ typedef struct value_s {
typedef struct svalue_s {
value val;
int lvalue;
bool canRematerialize() const {
return val.canRematerialize();
}
} svalue;
#define DECLFLAG_ARGUMENT 0x02 // The declaration is for an argument.
@@ -715,6 +733,7 @@ void startfunc(char *fname);
void endfunc(void);
void alignframe(int numbytes);
void rvalue(value *lval);
void rvalue(svalue *sval);
void address(symbol *ptr,regid reg);
void store(value *lval);
void loadreg(cell address,regid reg);
@@ -981,7 +1000,7 @@ typedef struct array_info_s
} array_info_t;
enum FatalError {
FIRST_FATAL_ERROR = 180,
FIRST_FATAL_ERROR = 182,
FATAL_ERROR_READ = FIRST_FATAL_ERROR,
FATAL_ERROR_WRITE,
+20 -5
View File
@@ -3478,10 +3478,9 @@ static int reparse_new_decl(declinfo_t *decl, int flags)
//
// Reset the fact that we saw an array.
decl->type.numdim = 0;
decl->type.size = 0;
decl->type.enumroot = NULL;
decl->type.ident = iVARIABLE;
decl->type.size = 0;
decl->type.size = 1;
decl->type.has_postdims = false;
if (matchtoken('['))
parse_old_array_dims(decl, flags);
@@ -5535,7 +5534,7 @@ static int newfunc(declinfo_t *decl, const int *thistag, int fpublic, int fstati
if ((sym->usage & uPROTOTYPED) && !compare_tag(sym->tag, decl->type.tag)) {
int old_fline = fline;
fline = funcline;
error(25);
error(180, type_to_name(sym->tag), type_to_name(decl->type.tag));
fline = old_fline;
}
@@ -5745,7 +5744,7 @@ static int declargs(symbol *sym, int chkshadow, const int *thistag)
} else {
/* check the argument with the earlier definition */
if (argcnt>oldargcnt || !argcompare(&sym->dim.arglist[argcnt],&arg))
error(25); /* function definition does not match prototype */
error(181, arg.name); /* function argument does not match prototype */
/* may need to free default array argument and the tag list */
if (arg.ident==iREFARRAY && arg.hasdefault)
free(arg.defvalue.array.data);
@@ -6475,7 +6474,20 @@ static int testsymbols(symbol *root,int level,int testlabs,int testconst)
int entry=FALSE;
symbol *sym=root->next;
while (sym!=NULL && sym->compound>=level) {
symbol *parent;
while (sym!=NULL) {
if (sym->compound < level) {
parent = sym->parent;
if (parent == NULL || (parent->ident != iARRAY && parent->ident != iREFARRAY))
break;
/* This is one dimension of a multidimensional array. Find the top symbol. */
while (parent->parent != NULL && (parent->parent->ident == iARRAY || parent->parent->ident == iREFARRAY)) {
parent = parent->parent;
}
/* Only the top symbol gets the compound level set. */
if (parent->compound < level)
break;
}
switch (sym->ident) {
case iLABEL:
if (testlabs) {
@@ -7241,6 +7253,7 @@ static int dofor(void)
save_nestlevel=nestlevel;
save_endlessloop=endlessloop;
pushstacklist();
pushheaplist();
addwhile(wq);
skiplab=getlabel();
@@ -7338,6 +7351,8 @@ static int dofor(void)
setlabel(wq[wqEXIT]);
delwhile();
popheaplist();
assert(nestlevel>=save_nestlevel);
if (nestlevel>save_nestlevel) {
/* Clean up the space and the symbol table for the local
+123 -17
View File
@@ -2662,7 +2662,7 @@ enum {
* Generates code to call a function. This routine handles default arguments
* and positional as well as named parameters.
*/
static void callfunction(symbol *sym, const svalue *implicitthis, value *lval_result, int matchparanthesis)
static void callfunction(symbol *sym, const svalue *aImplicitThis, value *lval_result, int matchparanthesis)
{
static long nest_stkusage=0L;
static int nesting=0;
@@ -2680,7 +2680,7 @@ static int nesting=0;
symbol *symret;
cell lexval;
char *lexstr;
int pending_this = (implicitthis ? TRUE : FALSE);
bool pending_this = !!aImplicitThis;
assert(sym!=NULL);
lval_result->ident=iEXPRESSION; /* preset, may be changed later */
@@ -2718,6 +2718,78 @@ static int nesting=0;
error(234,sym->name,ptr); /* deprecated (probably a native function) */
} /* if */
svalue implicit_this;
bool has_complex_this = false;
if (aImplicitThis) {
implicit_this = *aImplicitThis;
has_complex_this = !implicit_this.canRematerialize();
}
// If we have an implicit |this|, and it requires evaluating an expression
// to compute, then we have to save PRI across each argument. The reason is
// that Pawn will evaluate arguments like so:
//
// x[5].z(1, 2)
//
// Resolves to:
//
// begin:
// load.s.pri x
// add.pri.c 5 * sizeof(cell)
// marked:
// push.pri ; this
// const.pri 1
// push.pri
// const.pri 2
// push.pri 2
// finished:
// push.c 3 ; argc
//
// The expressions from "marked" to "finished" are reversed, so that
// arguments appear in order. Thus the final sequence is:
//
// begin:
// load.s.pri x
// add.pri.c 5 * sizeof(cell)
// marked:
// const.pri 2
// push.pri 2
// const.pri 1
// push.pri
// push.pri ; this
// finished:
// push.c 3 ; argc
//
// To account for this, if |this| requires evaluation, we evaluate it ahead
// of time and store it on the stack, so we can extract it again later.
// Because there is no opcode to do this, we have to play hot potato like so:
//
// begin:
// load.s.pri x
// add.pri.c 5 * sizeof(cell)
// marked:
// const.pri 2
// pop.alt ; pop |this|
// push.pri 2
// push.alt ; re-push |this|
// const.pri 1
// pop.alt ; pop |this|
// push.pri
// push.alt ; re-push |this|
// finished:
// push.c 3 ; argc
//
if (has_complex_this) {
// Compute an rvalue of |implicit_this|. Note that if it's an accessor,
// this reduces it to an iEXPRESSION. That's ok. We don't touch it
// otherwise though, so the type checking logic below basically acts the
// same. We are careful to not double-evaluate however.
if (implicit_this.lvalue)
rvalue(&implicit_this);
pushreg(sPRI);
nest_stkusage++;
}
/* run through the arguments */
arg=sym->dim.arglist;
assert(arg!=NULL);
@@ -2788,8 +2860,8 @@ static int nesting=0;
if (arg[argidx].ident!=0 && arg[argidx].numtags==1) /* set the expected tag, if any */
lval.cmptag=arg[argidx].tags[0];
if (pending_this) {
lval = implicitthis->val;
lvalue = implicitthis->lvalue;
lval = implicit_this.val;
lvalue = implicit_this.lvalue;
} else {
lvalue = hier14(&lval);
if (lvalue && lval.ident == iACCESSOR) {
@@ -2801,7 +2873,7 @@ static int nesting=0;
switch (arg[argidx].ident) {
case 0:
/* On the first pass, we donm't have all of the parameter info.
* Hpwever, use information must be marked anyway, otherwise vars
* However, use information must be marked anyway, otherwise vars
* declared previously will be omitted in the second psas. See
* SourceMod bug 4643.
*/
@@ -2810,6 +2882,10 @@ static int nesting=0;
markusage(lval.sym, uREAD);
break;
case iVARARGS:
// hier13() should filter non-methodmap functions, and |this| is
// always an iVARIABLE.
assert(!pending_this);
/* always pass by reference */
if (lval.ident==iVARIABLE || lval.ident==iREFERENCE) {
assert(lval.sym!=NULL);
@@ -2851,11 +2927,20 @@ static int nesting=0;
if (lval.ident==iLABEL || lval.ident==iFUNCTN || lval.ident==iREFFUNC
|| lval.ident==iARRAY || lval.ident==iREFARRAY)
error(35,argidx+1); /* argument type mismatch */
if (lvalue)
rvalue(&lval); /* get value (direct or indirect) */
if (lvalue) {
// Note: do not load anything if the implicit this was pre-evaluted
// for being too complex.
if (!(pending_this && has_complex_this))
rvalue(&lval); /* get value (direct or indirect) */
}
/* otherwise, the expression result is already in PRI */
assert(arg[argidx].numtags>0);
check_userop(NULL,lval.tag,arg[argidx].tags[0],2,NULL,&lval.tag);
// Do not allow user operators to transform |this|.
if (!pending_this)
check_userop(NULL,lval.tag,arg[argidx].tags[0],2,NULL,&lval.tag);
if (!checktags_string(arg[argidx].tags, arg[argidx].numtags, &lval))
checktag(arg[argidx].tags, arg[argidx].numtags, lval.tag);
if (lval.tag!=0)
@@ -2863,6 +2948,10 @@ static int nesting=0;
argidx++; /* argument done */
break;
case iREFERENCE:
// hier13() should filter non-methodmap functions, and |this| is
// always an iVARIABLE.
assert(!pending_this);
if (!lvalue)
error(35,argidx+1); /* argument type mismatch */
if (lval.sym!=NULL && (lval.sym->usage & uCONST)!=0 && (arg[argidx].usage & uCONST)==0)
@@ -2886,6 +2975,10 @@ static int nesting=0;
markusage(lval.sym,uWRITTEN);
break;
case iREFARRAY:
// hier13() should filter non-methodmap functions, and |this| is
// always an iVARIABLE.
assert(!pending_this);
if (lval.ident!=iARRAY && lval.ident!=iREFARRAY
&& lval.ident!=iARRAYCELL && lval.ident!=iARRAYCHAR)
{
@@ -2971,19 +3064,31 @@ static int nesting=0;
argidx++; /* argument done */
break;
} /* switch */
pushreg(sPRI); /* store the function argument on the stack */
markexpr(sPARM,NULL,0); /* mark the end of a sub-expression */
nest_stkusage++;
// If we are processing |this| and it's complex, then it was never
// actually evaluated as an argument, so don't push it.
if (!(pending_this && has_complex_this)) {
// If we have a complex |this|, pop it as ALT, push the evaluated
// argument, then push |this| again. This makes sure |this| is
// always the last argument.
if (has_complex_this) {
popreg(sALT);
pushreg(sPRI); /* store the function argument on the stack */
pushreg(sALT);
} else {
pushreg(sPRI); /* store the function argument on the stack */
}
markexpr(sPARM,NULL,0); /* mark the end of a sub-expression */
nest_stkusage++;
}
} /* if */
assert(arglist[argpos]!=ARG_UNHANDLED);
nargs++;
/**
* We can already have decided it was time to close because of pending_this.
* If that's the case, then bail out now.
*/
// We can already have decided it was time to close because of pending_this.
// If that's the case, then bail out now.
if (pending_this && close) {
pending_this = FALSE;
pending_this = false;
break;
}
@@ -3002,7 +3107,7 @@ static int nesting=0;
} /* if */
} /* if */
pending_this = FALSE;
pending_this = false;
} while (!close && freading && !matchtoken(tENDEXPR)); /* do */
} /* if */
/* check remaining function arguments (they may have default values) */
@@ -3057,6 +3162,7 @@ static int nesting=0;
arglist[argidx]=ARG_DONE;
} /* for */
stgmark(sENDREORDER); /* mark end of reversed evaluation */
pushval((cell)nargs /* *sizeof(cell)*/ );
nest_stkusage++;
ffcall(sym,NULL,nargs);
+10
View File
@@ -426,6 +426,16 @@ void rvalue(value *lval)
} /* if */
}
// Wrapper that automatically markes lvalues as decayed if they are accessors,
// since it is illegal to evaluate them twice.
void rvalue(svalue *sval)
{
int ident = sval->val.ident;
rvalue(&sval->val);
if (ident == iACCESSOR)
sval->lvalue = FALSE;
}
/* Get the address of a symbol into the primary or alternate register (used
* for arrays, and for passing arguments by reference).
*/
+15 -13
View File
@@ -222,7 +222,9 @@ static const char *errmsg[] = {
/*176*/ "non-static method or property '%s' must be called with a value of type '%s'\n",
/*177*/ "static method '%s' must be invoked via its type (try '%s.%s')\n",
/*178*/ "cannot coerce %s[] to %s[]; storage classes differ\n",
/*179*/ "cannot assign %s[] to %s[], storage classes differ\n",
/*179*/ "cannot assign %s[] to %s[], storage classes differ\n",
/*180*/ "function return type differs from prototype. expected '%s', but got '%s'\n",
/*181*/ "function argument named '%s' differs from prototype\n",
#else
"\315e\306\227\266k\217:\235\277bu\201fo\220\204\223\012",
"\202l\224\250s\205g\346\356e\233\201(\243\315\214\267\202) \253 f\255low ea\305 \042c\353e\042\012",
@@ -386,24 +388,24 @@ static const char *errmsg[] = {
static const char *fatalmsg[] = {
#ifdef SCPACK
/*180*/ "cannot read from file: \"%s\"\n",
/*181*/ "cannot write to file: \"%s\"\n",
/*182*/ "table overflow: \"%s\"\n",
/*182*/ "cannot read from file: \"%s\"\n",
/*183*/ "cannot write to file: \"%s\"\n",
/*184*/ "table overflow: \"%s\"\n",
/* table can be: loop table
* literal table
* staging buffer
* option table (response file)
* peephole optimizer table
*/
/*183*/ "insufficient memory\n",
/*184*/ "invalid assembler instruction \"%s\"\n",
/*185*/ "numeric overflow, exceeding capacity\n",
/*186*/ "compiled script exceeds the maximum memory size (%ld bytes)\n",
/*187*/ "too many error messages on one line\n",
/*188*/ "codepage mapping file not found\n",
/*189*/ "invalid path: \"%s\"\n",
/*190*/ "assertion failed: %s\n",
/*191*/ "user error: %s\n",
/*185*/ "insufficient memory\n",
/*186*/ "invalid assembler instruction \"%s\"\n",
/*187*/ "numeric overflow, exceeding capacity\n",
/*188*/ "compiled script exceeds the maximum memory size (%ld bytes)\n",
/*189*/ "too many error messages on one line\n",
/*190*/ "codepage mapping file not found\n",
/*191*/ "invalid path: \"%s\"\n",
/*192*/ "assertion failed: %s\n",
/*193*/ "user error: %s\n",
#else
"\256\214a\204from \344le:\354",
"\256writ\200\266 \344le:\354",
@@ -0,0 +1,32 @@
native void printnum(int x);
methodmap X
{
public void GetValue() {
printnum(view_as<int>(this));
}
public void SetValue(const char[] key, any value) {
printnum(view_as<int>(this));
}
};
int Sandwich(const char[] value)
{
return 999;
}
//////////////////////////////////
X gTargets[] = {
view_as<X>(10),
view_as<X>(20),
view_as<X>(30),
}
// Should print 30 three times.
public main()
{
printnum(view_as<int>(gTargets[2]));
gTargets[2].GetValue();
gTargets[2].SetValue("TargetBanTime", Sandwich("hello"));
}
-6
View File
@@ -15,12 +15,6 @@
{
"en" "Rename player"
}
"Dead Player Rename"
{
"#format" "{1:s}"
"en" "{1} will be renamed on the next round."
}
"Slap player"
{