Merge branch 'master' of https://github.com/alliedmodders/sourcemod into mapchooser-updates
This commit is contained in:
commit
a0dd8cbc97
@ -249,7 +249,7 @@ class SMConfig(object):
|
||||
if cxx.like('gcc'):
|
||||
cxx.cflags += ['-O3']
|
||||
elif cxx.like('msvc'):
|
||||
cxx.cflags += ['/Ox']
|
||||
cxx.cflags += ['/Ox', '/Zo']
|
||||
cxx.linkflags += ['/OPT:ICF', '/OPT:REF']
|
||||
|
||||
# Debugging
|
||||
@ -257,8 +257,6 @@ class SMConfig(object):
|
||||
cxx.defines += ['DEBUG', '_DEBUG']
|
||||
if cxx.like('msvc'):
|
||||
cxx.cflags += ['/Od', '/RTC1']
|
||||
if cxx.version >= 1600:
|
||||
cxx.cflags += ['/d2Zi+']
|
||||
|
||||
# This needs to be after our optimization flags which could otherwise disable it.
|
||||
if cxx.vendor == 'msvc':
|
||||
|
@ -405,7 +405,7 @@ void PlayerManager::RunAuthChecks()
|
||||
pPlayer = &m_Players[m_AuthQueue[i]];
|
||||
pPlayer->UpdateAuthIds();
|
||||
|
||||
authstr = pPlayer->m_AuthID.c_str();
|
||||
authstr = pPlayer->m_AuthID.chars();
|
||||
|
||||
if (!pPlayer->IsAuthStringValidated())
|
||||
{
|
||||
@ -717,14 +717,14 @@ void PlayerManager::OnClientPutInServer(edict_t *pEntity, const char *playername
|
||||
for (iter=m_hooks.begin(); iter!=m_hooks.end(); iter++)
|
||||
{
|
||||
pListener = (*iter);
|
||||
pListener->OnClientAuthorized(client, steamId ? steamId : pPlayer->m_AuthID.c_str());
|
||||
pListener->OnClientAuthorized(client, steamId ? steamId : pPlayer->m_AuthID.chars());
|
||||
}
|
||||
/* Finally, tell plugins */
|
||||
if (m_clauth->GetFunctionCount())
|
||||
{
|
||||
m_clauth->PushCell(client);
|
||||
/* For legacy reasons, people are expecting the Steam2 id here if using Steam auth */
|
||||
m_clauth->PushString(steamId ? steamId : pPlayer->m_AuthID.c_str());
|
||||
m_clauth->PushString(steamId ? steamId : pPlayer->m_AuthID.chars());
|
||||
m_clauth->Execute(NULL);
|
||||
}
|
||||
pPlayer->Authorize_Post();
|
||||
@ -1963,6 +1963,8 @@ void CPlayer::Initialize(const char *name, const char *ip, edict_t *pEntity)
|
||||
*ptr = '\0';
|
||||
}
|
||||
m_IpNoPort.assign(ip2);
|
||||
|
||||
UpdateAuthIds();
|
||||
}
|
||||
|
||||
void CPlayer::Connect()
|
||||
@ -2001,7 +2003,12 @@ void CPlayer::UpdateAuthIds()
|
||||
#else
|
||||
authstr = engine->GetPlayerNetworkIDString(m_pEdict);
|
||||
#endif
|
||||
m_AuthID.assign(authstr);
|
||||
if (m_AuthID.compare(authstr) == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
m_AuthID = authstr;
|
||||
|
||||
// Then, cache SteamId
|
||||
if (IsFakeClient())
|
||||
@ -2097,7 +2104,7 @@ void CPlayer::Disconnect()
|
||||
m_IsAuthorized = false;
|
||||
m_Name.clear();
|
||||
m_Ip.clear();
|
||||
m_AuthID.clear();
|
||||
m_AuthID = "";
|
||||
m_SteamId = k_steamIDNil;
|
||||
m_Steam2Id = "";
|
||||
m_Steam3Id = "";
|
||||
@ -2142,7 +2149,7 @@ const char *CPlayer::GetAuthString(bool validated)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return m_AuthID.c_str();
|
||||
return m_AuthID.chars();
|
||||
}
|
||||
|
||||
const CSteamID &CPlayer::GetSteamId(bool validated)
|
||||
@ -2451,7 +2458,7 @@ void CPlayer::DoBasicAdminChecks()
|
||||
}
|
||||
|
||||
/* Check steam id */
|
||||
if ((id = adminsys->FindAdminByIdentity("steam", m_AuthID.c_str())) != INVALID_ADMIN_ID)
|
||||
if ((id = adminsys->FindAdminByIdentity("steam", m_AuthID.chars())) != INVALID_ADMIN_ID)
|
||||
{
|
||||
if (g_Players.CheckSetAdmin(client, this, id))
|
||||
{
|
||||
|
@ -123,7 +123,7 @@ private:
|
||||
String m_Name;
|
||||
String m_Ip;
|
||||
String m_IpNoPort;
|
||||
String m_AuthID;
|
||||
ke::AString m_AuthID;
|
||||
ke::AString m_Steam2Id;
|
||||
ke::AString m_Steam3Id;
|
||||
AdminId m_Admin;
|
||||
|
@ -810,14 +810,28 @@ stock bool VoteMenuToAll(Handle menu, int time, int flags=0)
|
||||
* @param item_info Array of items, sorted by count. Use VOTEINFO_ITEM
|
||||
* defines.
|
||||
*/
|
||||
typedef VoteHandler = function void (
|
||||
typeset VoteHandler
|
||||
{
|
||||
// old style
|
||||
function void(
|
||||
Menu menu,
|
||||
int num_votes,
|
||||
int num_clients,
|
||||
const int client_info[][2],
|
||||
int num_items,
|
||||
const int item_info[][2]
|
||||
);
|
||||
);
|
||||
|
||||
// new style
|
||||
function void(
|
||||
Menu menu,
|
||||
int num_votes,
|
||||
int num_clients,
|
||||
const int[][] client_info,
|
||||
int num_items,
|
||||
const int[][] item_info
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* Sets an advanced vote handling callback. If this callback is set,
|
||||
|
@ -42,8 +42,8 @@
|
||||
#define SOURCEMOD_V_REV 0
|
||||
#define SOURCEMOD_V_CSET "0"
|
||||
#define SOURCEMOD_V_MAJOR 1 /**< SourceMod Major version */
|
||||
#define SOURCEMOD_V_MINOR 7 /**< SourceMod Minor version */
|
||||
#define SOURCEMOD_V_MINOR 8 /**< SourceMod Minor version */
|
||||
#define SOURCEMOD_V_RELEASE 0 /**< SourceMod Release version */
|
||||
|
||||
#define SOURCEMOD_VERSION "1.7.0-manual" /**< SourceMod version string (major.minor.release-tag) */
|
||||
#define SOURCEMOD_VERSION "1.8.0-manual" /**< SourceMod version string (major.minor.release-tag) */
|
||||
#endif
|
||||
|
@ -1 +1 @@
|
||||
1.7.0-dev
|
||||
1.8.0-dev
|
||||
|
@ -52,13 +52,13 @@
|
||||
#define SM_BUILD_LOCAL_REV "0"
|
||||
#define SM_BUILD_CSET "0"
|
||||
#define SM_BUILD_MAJOR "1"
|
||||
#define SM_BUILD_MINOR "7"
|
||||
#define SM_BUILD_MINOR "8"
|
||||
#define SM_BUILD_RELEASE "0"
|
||||
|
||||
#define SM_BUILD_UNIQUEID SM_BUILD_LOCAL_REV ":" SM_BUILD_CSET
|
||||
|
||||
#define SM_VERSION_STRING SM_BUILD_MAJOR "." SM_BUILD_MINOR "." SM_BUILD_RELEASE "-" SM_BUILD_TAG
|
||||
#define SM_VERSION_FILE 1,7,0,0
|
||||
#define SM_VERSION_FILE 1,8,0,0
|
||||
#endif
|
||||
#define SM_BUILD_TIMESTAMP __DATE__ " " __TIME__
|
||||
|
||||
|
@ -3,7 +3,7 @@ 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
|
||||
i am the very model of a modern major general
|
||||
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
|
||||
|
@ -334,7 +334,7 @@ const char *type_to_name(int tag)
|
||||
|
||||
const char *name = pc_tagname(tag);
|
||||
if (name)
|
||||
return "unknown";
|
||||
return name;
|
||||
|
||||
if (tag & FUNCTAG)
|
||||
return "function";
|
||||
@ -1698,6 +1698,10 @@ static int hier2(value *lval)
|
||||
}
|
||||
case tLABEL: /* tagname override */
|
||||
tag=pc_addtag(st);
|
||||
if (sc_require_newdecls) {
|
||||
// Warn: old style cast used when newdecls pragma is enabled
|
||||
error(240, st, type_to_name(tag));
|
||||
}
|
||||
lval->cmptag=tag;
|
||||
lvalue=hier2(lval);
|
||||
if ((lval->tag & OBJECTTAG) || (tag & OBJECTTAG)) {
|
||||
|
@ -462,6 +462,7 @@ static const char *warnmsg[] = {
|
||||
/*237*/ "coercing functions to and from primitives is unsupported and will be removed in the future\n",
|
||||
/*238*/ "'%s:' is an illegal cast; use view_as<%s>(expression)\n",
|
||||
/*239*/ "'%s' is an illegal tag; use %s as a type\n",
|
||||
/*240*/ "'%s:' is an old-style tag operation; use view_as<%s>(expression) instead\n",
|
||||
#else
|
||||
"\327 \275tr\242\231\227\266 %\204\305\206a\306\210\260",
|
||||
"\214\343i\215 \330\371\213t/\321cro \365",
|
||||
|
18
sourcepawn/compiler/tests/warn-oldstyle-cast.sp
Normal file
18
sourcepawn/compiler/tests/warn-oldstyle-cast.sp
Normal file
@ -0,0 +1,18 @@
|
||||
|
||||
#pragma newdecls required
|
||||
|
||||
enum MyType:{};
|
||||
|
||||
native void Print(MyType value);
|
||||
native void PrintF(float value);
|
||||
|
||||
public void main()
|
||||
{
|
||||
int val = 2;
|
||||
MyType otherVal = MyType:val;
|
||||
|
||||
float value2 = Float:val;
|
||||
|
||||
Print(otherVal);
|
||||
PrintF(value2);
|
||||
}
|
2
sourcepawn/compiler/tests/warn-oldstyle-cast.txt
Normal file
2
sourcepawn/compiler/tests/warn-oldstyle-cast.txt
Normal file
@ -0,0 +1,2 @@
|
||||
(12) : warning 240: 'MyType:' is an old-style tag operation; use view_as<MyType>(expression) instead
|
||||
(14) : warning 240: 'Float:' is an old-style tag operation; use view_as<float>(expression) instead
|
Loading…
Reference in New Issue
Block a user