Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue temporary ban by network id instead of user id #82

Merged
merged 1 commit into from
Jul 23, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion mp/src/game/shared/sdk/sdk_gamerules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3129,6 +3129,9 @@ ConVar da_vote_kick_plurality("da_vote_kick_plurality", "0.7", FCVAR_GAMEDLL, "W

class CKickPlayerVoteIssue : public CDAIssue
{
private:
CUtlString networkIDString;

public:
CKickPlayerVoteIssue()
: CDAIssue("kick")
Expand Down Expand Up @@ -3164,7 +3167,7 @@ class CKickPlayerVoteIssue : public CDAIssue
return;
}

engine->ServerCommand(UTIL_VarArgs( "banid 30 %s kick\n", GetDetailsString() ));
engine->ServerCommand(UTIL_VarArgs( "banid 30 %s kick\n", networkIDString ));
engine->ServerCommand("writeip\n");
engine->ServerCommand("writeid\n");
}
Expand All @@ -3174,6 +3177,15 @@ class CKickPlayerVoteIssue : public CDAIssue
AssertMsg(false, "Unimplemented");
ClientPrint( pForWhom, HUD_PRINTCONSOLE, "Nothing here.\n" );
}

virtual void SetIssueDetails(const char *pszDetails)
{
CDAIssue::SetIssueDetails(pszDetails);

int iUserID = atoi(pszDetails);
CBasePlayer* pPlayer = UTIL_PlayerByUserId(iUserID);
networkIDString = pPlayer->GetNetworkIDString();
}
};

class CAddBotVoteIssue : public CDAIssue
Expand Down