experimental fix for amb1586 - team native crash
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402044
This commit is contained in:
parent
c42a26bb66
commit
a483ec5dc5
@ -46,6 +46,7 @@
|
|||||||
#include <inetchannel.h>
|
#include <inetchannel.h>
|
||||||
#include <iclient.h>
|
#include <iclient.h>
|
||||||
#include "GameConfigs.h"
|
#include "GameConfigs.h"
|
||||||
|
#include "systems/ExtensionSys.h"
|
||||||
|
|
||||||
PlayerManager g_Players;
|
PlayerManager g_Players;
|
||||||
bool g_OnMapStarted = false;
|
bool g_OnMapStarted = false;
|
||||||
@ -206,6 +207,7 @@ void PlayerManager::OnServerActivate(edict_t *pEdictList, int edictCount, int cl
|
|||||||
|
|
||||||
g_NumPlayersToAuth = &m_AuthQueue[0];
|
g_NumPlayersToAuth = &m_AuthQueue[0];
|
||||||
}
|
}
|
||||||
|
g_Extensions.CallOnCoreMapStart(pEdictList, edictCount, clientMax);
|
||||||
m_onActivate->Execute(NULL);
|
m_onActivate->Execute(NULL);
|
||||||
m_onActivate2->Execute(NULL);
|
m_onActivate2->Execute(NULL);
|
||||||
|
|
||||||
|
@ -1369,3 +1369,15 @@ IExtension *CExtensionManager::LoadExternal(IExtensionInterface *pInterface,
|
|||||||
return pExt;
|
return pExt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CExtensionManager::CallOnCoreMapStart(edict_t *pEdictList, int edictCount, int clientMax)
|
||||||
|
{
|
||||||
|
List<CExtension *>::iterator iter;
|
||||||
|
|
||||||
|
for (iter=m_Libs.begin(); iter!=m_Libs.end(); iter++)
|
||||||
|
{
|
||||||
|
if (SMINTERFACE_EXTENSIONAPI_VERSION > 3)
|
||||||
|
{
|
||||||
|
(*iter)->GetAPI()->OnCoreMapStart(pEdictList, edictCount, clientMax);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -178,6 +178,7 @@ public:
|
|||||||
void AddLibrary(IExtension *pSource, const char *library);
|
void AddLibrary(IExtension *pSource, const char *library);
|
||||||
bool LibraryExists(const char *library);
|
bool LibraryExists(const char *library);
|
||||||
void OverrideNatives(IExtension *myself, const sp_nativeinfo_t *natives);
|
void OverrideNatives(IExtension *myself, const sp_nativeinfo_t *natives);
|
||||||
|
void CallOnCoreMapStart(edict_t *pEdictList, int edictCount, int clientMax);
|
||||||
public:
|
public:
|
||||||
CExtension *GetExtensionFromIdent(IdentityToken_t *ptr);
|
CExtension *GetExtensionFromIdent(IdentityToken_t *ptr);
|
||||||
void Shutdown();
|
void Shutdown();
|
||||||
|
@ -71,6 +71,7 @@ public: //public SDKExtension
|
|||||||
virtual bool QueryRunning(char *error, size_t maxlength);
|
virtual bool QueryRunning(char *error, size_t maxlength);
|
||||||
virtual bool QueryInterfaceDrop(SMInterface *pInterface);
|
virtual bool QueryInterfaceDrop(SMInterface *pInterface);
|
||||||
virtual void NotifyInterfaceDrop(SMInterface *pInterface);
|
virtual void NotifyInterfaceDrop(SMInterface *pInterface);
|
||||||
|
virtual void OnCoreMapStart(edict_t *pEdictList, int edictCount, int clientMax);
|
||||||
public:
|
public:
|
||||||
#if defined SMEXT_CONF_METAMOD
|
#if defined SMEXT_CONF_METAMOD
|
||||||
virtual bool SDK_OnMetamodLoad(ISmmAPI *ismm, char *error, size_t maxlen, bool late);
|
virtual bool SDK_OnMetamodLoad(ISmmAPI *ismm, char *error, size_t maxlen, bool late);
|
||||||
|
@ -64,7 +64,7 @@ bool FindTeamEntities(SendTable *pTable, const char *name)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SDKTools::OnServerActivate(edict_t *pEdictList, int edictCount, int clientMax)
|
void SDKTools::OnCoreMapStart(edict_t *pEdictList, int edictCount, int clientMax)
|
||||||
{
|
{
|
||||||
g_Teams.clear();
|
g_Teams.clear();
|
||||||
g_Teams.resize(1);
|
g_Teams.resize(1);
|
||||||
|
@ -210,6 +210,7 @@ native GetClientAimTarget(client, bool:only_clients=true);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the total number of teams in a game.
|
* Returns the total number of teams in a game.
|
||||||
|
* Note: This native should not be called before OnMapStart.
|
||||||
*
|
*
|
||||||
* @return Total number of teams.
|
* @return Total number of teams.
|
||||||
*/
|
*/
|
||||||
@ -217,6 +218,7 @@ native GetTeamCount();
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the team name based on a team index.
|
* Retrieves the team name based on a team index.
|
||||||
|
* Note: This native should not be called before OnMapStart.
|
||||||
*
|
*
|
||||||
* @param index Team index.
|
* @param index Team index.
|
||||||
* @param name Buffer to store string in.
|
* @param name Buffer to store string in.
|
||||||
@ -228,6 +230,7 @@ native GetTeamName(index, String:name[], maxlength);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the score of a team based on a team index.
|
* Returns the score of a team based on a team index.
|
||||||
|
* Note: This native should not be called before OnMapStart.
|
||||||
*
|
*
|
||||||
* @param index Team index.
|
* @param index Team index.
|
||||||
* @return Score.
|
* @return Score.
|
||||||
@ -237,6 +240,7 @@ native GetTeamScore(index);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the score of a team based on a team index.
|
* Sets the score of a team based on a team index.
|
||||||
|
* Note: This native should not be called before OnMapStart.
|
||||||
*
|
*
|
||||||
* @param index Team index.
|
* @param index Team index.
|
||||||
* @param value New score value.
|
* @param value New score value.
|
||||||
@ -247,6 +251,7 @@ native SetTeamScore(index, value);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the number of players in a certain team.
|
* Retrieves the number of players in a certain team.
|
||||||
|
* Note: This native should not be called before OnMapStart.
|
||||||
*
|
*
|
||||||
* @param index Team index.
|
* @param index Team index.
|
||||||
* @return Number of players in the team.
|
* @return Number of players in the team.
|
||||||
|
@ -40,6 +40,8 @@
|
|||||||
* @brief Defines the interface for loading/unloading/managing extensions.
|
* @brief Defines the interface for loading/unloading/managing extensions.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
struct edict_t;
|
||||||
|
|
||||||
namespace SourceMod
|
namespace SourceMod
|
||||||
{
|
{
|
||||||
class IExtensionInterface;
|
class IExtensionInterface;
|
||||||
@ -131,7 +133,7 @@ namespace SourceMod
|
|||||||
* Note: This is bumped when IShareSys is changed, because IShareSys
|
* Note: This is bumped when IShareSys is changed, because IShareSys
|
||||||
* itself is not versioned.
|
* itself is not versioned.
|
||||||
*/
|
*/
|
||||||
#define SMINTERFACE_EXTENSIONAPI_VERSION 3
|
#define SMINTERFACE_EXTENSIONAPI_VERSION 4
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The interface an extension must expose.
|
* @brief The interface an extension must expose.
|
||||||
@ -289,6 +291,17 @@ namespace SourceMod
|
|||||||
* @return String containing the compilation date.
|
* @return String containing the compilation date.
|
||||||
*/
|
*/
|
||||||
virtual const char *GetExtensionDateString() =0;
|
virtual const char *GetExtensionDateString() =0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Called on server activation before plugins receive the OnServerLoad forward.
|
||||||
|
*
|
||||||
|
* @param pEdictList Edicts list.
|
||||||
|
* @param edictCount Number of edicts in the list.
|
||||||
|
* @param clientMax Maximum number of clients allowed in the server.
|
||||||
|
*/
|
||||||
|
virtual void OnCoreMapStart(edict_t *pEdictList, int edictCount, int clientMax)
|
||||||
|
{
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user