View Single Post
alliedfront
Junior Member
Join Date: Jan 2024
Location: Germany
Old 01-29-2024 , 12:40   Re: [L4D1 & L4D2] Votekick (no black screen)
Reply With Quote #49

Hi,

1.

My changes for Versus support in version 2.6 are based on the following requirements:

a) Compatibility with existing installations: Co-Op: no changes in terms of configuration variables, functionality and behavior.

b) Minimization of sources of errors: Changes in the code only if necessary for Versus support (exception: minor corrections of existing bugs)

c) Minimization of bugs resulting from the changed code: through extensive testing in L4D 1 and L4D 2, especially for:

- vk, sm_vk, sm_votekick
- sm_veto
- sm_votepass
- kick spectator
- blocklist
- kick-Reason

2.

Changed files, see also the two diffs (version 2.5 to 2.6) for details:

a) sm_votekick.cfg (in cfg directory)
b) l4d_votekick.phrases.txt (in translation directory)
c) l4d_votekick.sp (in scripting directory)


to a) added comfiguration variables:

- As Versus is a highly competitive difficulty, as an experienced Versus player, i believe it is necessary to have the possibility to set a different minimum of players in this gamemode. For the most time i use 3 or lower.

Code:
// Minimum players present in versus games to allow starting vote for kick
// -
// Default: "4"
sm_votekick_minplayers_versus "4"

- After the vote has ended, the detailed results can be displayed, e.g.

"Vote ended. (Yes - No - Unanswered): 2 - 1 - 1"

Code:
// Allow to show mumber of yesVotes - noVotes? (1 - Yes / 0 - No)
// -
// Default: "0"
sm_votekick_show_vote_details "0"
to b)

- Added translation for voting results with colored Yes, No and corresponding numbers.
- Grammatical correction.
- I suggest changing the default "kick_reason" value to a neutral tone: "You have been kicked out of the session" since people are often not kicked for violating rules in both modes co-op and versus.

to c)

- added functions:

Code:
// Versus: count members of issuer team 
int GetRealTeamClientCount(int iTeam)


// The advanced vote handling callback receives detailed results of voting, 
// which will be displayed to the Team the issuer belongs to (versus) or to all (co-op), 
// if "sm_votekick_show_vote_details" is set to "1" ("0": vote results are not shown)
// This handler is et via Menu.VoteResultCallback property (see below). Since this callback is set, 
// MenuAction_VoteEnd will not be called for both menu.DisplayVoteToAll and menu.DisplayVote. 
// The use of Menu.VoteResultCallback was necessary, because on a tie, a random item is returned by menu.VoteDisplay()
// from a list of the tied items (confirmed in my tests: sometimes in case of a tie it returns 0 and player is kicked out, 
// which is of course not acceptable. Behavior may be due to intended use in the case of map voting).

public void Handle_VoteResults(	Menu menu,	// The menu being voted on.
				int num_votes,				// Number of votes tallied in total.
				int num_clients,			// Number of clients who could vote.
				const int[][] client_info,	// Array of clients.  Use VOTEINFO_CLIENT_ defines.
				int num_items,				// Number of unique items that were selected.
				const int[][] item_info )	// Array of items, sorted by count.  Use VOTEINFO_ITEM defines.



// Versus: msg only to members of issuer team

stock void CPrintToChatTeam(const char[] format, any ...)

stock void CPrintHintTextToTeam(const char[] format, any ...)
- added variables (other than through cfg file)

Code:
// Versus: don't allow competing team to unkick a player that was kicked by issuer team ( target could be friends with compüeting team to destroy issuer team or simply an anonymous tk )
// kicked target: stores team id of issuer team 
hMapPlayerTeam
- fixed a bug that was inherited

Code:
// leftover expired entries (negative time) of kicked players are deleted, for reasons of clarity
// (had 3 pages of expired entries after 2 days, which were displayed on each !vk to the client)
- for details regarding logic and other Versus-related changes see also diffs.

3.

As an Versus player since 2009 (there are actually many who have stuck with it to this day) and who has started playing again after a few years of abstinence, it was painful to see exploits being used especially in L4D 1 to destroy matches. This is where "[L4D1 & L4D2] Votekick (no black screen)" comes into play, which effectively prevents this.
Thanks again to “Dragokas” for creating and continually expanding this plugin, as well as addressing key exploits in the game over time. However, since the plugin was written for Co-op, I was happy to do my part in extending the functionality to include full Versus support. Since Versus is also an important game mode in L4D 1/2 and the changes at hand are major in nature, I suggest making this a major release (3.0 instead of 2.6).
Attached Files
File Type: zip votekick_v2.zip (29.9 KB, 10 views)
File Type: sp Get Plugin or Get Source (l4d_votekick.sp - 18 views - 38.3 KB)
File Type: txt diff_l4d_votekick.phrases_2.5_2.6.txt (787 Bytes, 10 views)
File Type: txt diff_l4d_votekick_2.5_2.6.txt (11.1 KB, 9 views)

Last edited by alliedfront; 01-29-2024 at 12:52.
alliedfront is offline