l2merge Fyren

This commit is contained in:
Matt Woodrow 2009-04-24 18:20:55 +12:00
commit 4abdc29d9e
6 changed files with 8 additions and 38 deletions

View File

@ -421,7 +421,7 @@ bool PlayerManager::OnClientConnect(edict_t *pEntity, const char *pszName, const
pPlayer->Initialize(pszName, pszAddress, pEntity);
m_clconnect->PushCell(client);
m_clconnect->PushStringEx(reject, maxrejectlen, SM_PARAM_STRING_UTF8, SM_PARAM_COPYBACK);
m_clconnect->PushStringEx(reject, maxrejectlen, SM_PARAM_STRING_UTF8 | SM_PARAM_STRING_COPY, SM_PARAM_COPYBACK);
m_clconnect->PushCell(maxrejectlen);
m_clconnect->Execute(&res);

View File

@ -35,7 +35,6 @@ IServerGameEnts *gameents = NULL;
CDetour *calcIsAttackCriticalDetour = NULL;
CDetour *calcIsAttackCriticalMeleeDetour = NULL;
CDetour *calcIsAttackCriticalKnifeDetour = NULL;
IForward *g_critForward = NULL;
@ -152,24 +151,6 @@ DETOUR_DECL_MEMBER0(CalcIsAttackCriticalHelperMelee, bool)
}
}
DETOUR_DECL_MEMBER0(CalcIsAttackCriticalHelperKnife, bool)
{
DetourResult result = DetourCallback((CBaseEntity *)this);
if (result == Result_Ignore)
{
return DETOUR_MEMBER_CALL(CalcIsAttackCriticalHelperKnife)();
}
else if (result == Result_NoCrit)
{
return 0;
}
else
{
return 1;
}
}
DETOUR_DECL_MEMBER0(CalcIsAttackCriticalHelper, bool)
{
DetourResult result = DetourCallback((CBaseEntity *)this);
@ -192,7 +173,6 @@ void InitialiseDetours()
{
calcIsAttackCriticalDetour = DETOUR_CREATE_MEMBER(CalcIsAttackCriticalHelper, "CalcCritical");
calcIsAttackCriticalMeleeDetour = DETOUR_CREATE_MEMBER(CalcIsAttackCriticalHelperMelee, "CalcCriticalMelee");
calcIsAttackCriticalKnifeDetour = DETOUR_CREATE_MEMBER(CalcIsAttackCriticalHelperKnife, "CalcCriticalKnife");
bool HookCreated = false;
@ -208,12 +188,6 @@ void InitialiseDetours()
HookCreated = true;
}
if (calcIsAttackCriticalKnifeDetour != NULL)
{
calcIsAttackCriticalKnifeDetour->EnableDetour();
HookCreated = true;
}
if (!HookCreated)
{
g_pSM->LogError(myself, "No critical hit forwards could be initialized - Disabled critical hit hooks");
@ -226,5 +200,4 @@ void RemoveDetours()
{
calcIsAttackCriticalDetour->Destroy();
calcIsAttackCriticalMeleeDetour->Destroy();
calcIsAttackCriticalKnifeDetour->Destroy();
}

View File

@ -48,8 +48,8 @@
}
"CommitSuicide"
{
"windows" "390"
"linux" "390"
"windows" "391"
"linux" "391"
}
"GetVelocity"
{

View File

@ -45,13 +45,6 @@
"linux" "@_ZN18CTFWeaponBaseMelee26CalcIsAttackCriticalHelperEv"
"windows" "\x83\xEC\x08\x53\x57\x8B\xF9\xE8\x2A\x2A\x2A\x2A\x8B\xD8"
}
"CalcCriticalKnife"
{
"library" "server"
"linux" "@_ZN8CTFKnife26CalcIsAttackCriticalHelperEv"
"windows" "\x8B\x81\xF0\x13\x00\x00\x83\xF8\xFF\x74\x29\x8B\x15"
}
}
"Offsets"
{

View File

@ -63,6 +63,10 @@ public const MaxClients; /**< Maximum number of players the server supports (dyn
* If you return false (or return nothing), the client will be rejected. If the client is
* rejected by this forward or any other, OnClientDisconnect will not be called.
*
* Note: Do not write to rejectmsg if you plan on returning true. If multiple plugins write
* to the string buffer, it is not defined which plugin's string will be shown to the client,
* but it is guaranteed one of them will.
*
* @param client Client index.
* @param rejectmsg Buffer to store the rejection message when the connection is refused.
* @param maxlen Maximum number of characters for rejection buffer.

View File

@ -84,7 +84,7 @@
{
if (strcmp(pBase->GetName(), name) == 0)
{
if (pBase->IsCommand())
if (!pBase->IsCommand())
{
return NULL;
}