Raised This Month: $12 Target: $400
 3% 

[L4D1 & L4D2] Map changer with rating system


Post New Thread Reply   
 
Thread Tools Display Modes
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 02-13-2020 , 11:29   Re: [L4D] Map changer with rating system
Reply With Quote #11

Thanks. I see on it later.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 03-07-2020 , 15:12   Re: [L4D] Map changer with rating system
Reply With Quote #12

Fixed L4D2 support.

Updated.

Quote:
v.1.11 (11-Apr-2019)
- Fixed security issue in admin check
- Added restriction for repeated vote (interval: 1 min.)
- Added logging of all map changing vote actions to logs/vote_map.log
- Map change is now only allowed for admins with flag "k" (ADMFLAG_VOTE), or when only 1 player exists on server.

v.1.12 (10-May-2019)
- Added ability to choose vote access flag for default and for custom map.
- Added ability to rename (append campaign name) to server name, when current map is changed to custom.
// (???) - Added safer way to change map, using entity (thanks to Lux).
- Now, to inform players, center screen message is appearing for 5 sec. before actual changing the map (if number of players > 1).
- Added "callvote" redirection to sm_maps

v.1.13
- Converted to methodmaps

v.1.14 (19-Feb-2020)
- Added "l4d_mapchanger_delay" ConVar: Minimum delay (in sec.) allowed between votes
- Added "l4d_mapchanger_timeout" ConVar: How long (in sec.) does the vote last
- Added "l4d_mapchanger_announcedelay" ConVar: Delay (in sec.) between announce and vote menu appearing
- Added "l4d_mapchanger_allow_custom" ConVar: Display custom maps menu items? (1 - Yes, 0 - No)
- Added "l4d_mapchanger_servername_short" ConVar: Short name of your server (specify it, if you want custom campaign name will be prepended to it)
- Added "l4d_mapchanger_votemark_minplayers" ConVar: Minimum number of players to allow starting the vote for mark
- Added "l4d_mapchanger_default_voteaccess" ConVar: Flag allowed to access the vote for change to default maps. By default: "k" (StartVote)
- Added "l4d_mapchanger_custom_voteaccess" ConVar: Flag allowed to access the vote for change to custom maps. By default: "k" (StartVote)
- Fixed sm_veto, sm_votepass
- optimizations
- Added "Proper change level" to prevent memory leak in L4D2 (by Lux), added similar fix for L4D1 just in case
- new #define PRIVATE_STUFF 1 - to unlock some private options, e.g. specify nicknames for disallow voting.

v.1.15 (07-Mar-2020)
- Removed "Proper change level" method from l4d1 since it produce some strange behaviour.
- Config files are renamed and splitted: configs/MapChanger.txt =>
* MapChanger.l4d1.txt
* MapChanger.l4d2.txt
- L4D1 custom maps config is appended with a lot of campaigns.
- L4D2 custom maps config is filled with campaigns from "Installer Extra Campaigns" tool by dr.lex:
https://www.gamemaps.com/details/21899

// TODO:
- Sigs for changelevel Windows L4D1 and try to figure out why this method is bugged in l4d1.
- improve server host name renamer
- remove custom map configs and replace with direct reading from mission files (or use Rikka's ACS API).
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

Last edited by Dragokas; 03-07-2020 at 15:13.
Dragokas is offline
user2000
Member
Join Date: Nov 2015
Location: Peru - Lima
Old 03-07-2020 , 18:59   Re: [L4D] Map changer with rating system
Reply With Quote #13

works fine on dedicated server no problem

but on a local server this error comes out

Quote:
L 03/07/2020 - 180:10: SourceMod error session started
L 03/07/2020 - 180:10: Info (map "c2m1_highway") (file "D:\Juegos de Steam\steamapps\common\Left 4 Dead 2\left4dead2\addons\sourcemod\logs\errors_202 00307.log")
L 03/07/2020 - 180:10: [SM] Exception reported: Client index 0 is invalid
L 03/07/2020 - 180:10: [SM] Blaming: MapChanger.smx
L 03/07/2020 - 180:10: [SM] Call stack trace:
L 03/07/2020 - 180:11: [SM] [0] IsClientInGame
L 03/07/2020 - 180:11: [SM] [1] Line 1168, H:\_To_games\Left4Dead_2\My_mods\MapChanger\M apChanger\MapChanger_1.15\scripting\MapChange r.sp::GetRealClientCount
L 03/07/2020 - 180:11: [SM] [2] Line 1216, H:\_To_games\Left4Dead_2\My_mods\MapChanger\M apChanger\MapChanger_1.15\scripting\MapChange r.sp::CheckVoteMap
L 03/07/2020 - 180:11: [SM] [3] Line 965, H:\_To_games\Left4Dead_2\My_mods\MapChanger\M apChanger\MapChanger_1.15\scripting\MapChange r.sp::Menu_DefMapHandler
L 03/07/2020 - 181:16: [SM] Exception reported: Client index 0 is invalid
L 03/07/2020 - 181:16: [SM] Blaming: MapChanger.smx
L 03/07/2020 - 181:16: [SM] Call stack trace:
L 03/07/2020 - 181:16: [SM] [0] IsClientInGame
L 03/07/2020 - 181:16: [SM] [1] Line 1168, H:\_To_games\Left4Dead_2\My_mods\MapChanger\M apChanger\MapChanger_1.15\scripting\MapChange r.sp::GetRealClientCount
L 03/07/2020 - 181:16: [SM] [2] Line 1216, H:\_To_games\Left4Dead_2\My_mods\MapChanger\M apChanger\MapChanger_1.15\scripting\MapChange r.sp::CheckVoteMap
L 03/07/2020 - 181:16: [SM] [3] Line 965, H:\_To_games\Left4Dead_2\My_mods\MapChanger\M apChanger\MapChanger_1.15\scripting\MapChange r.sp::Menu_DefMapHandler
L 03/07/2020 - 185:15: Error log file session closed.
Or is it only for a dedicated server?
user2000 is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 03-07-2020 , 20:36   Re: [L4D] Map changer with rating system
Reply With Quote #14

I think that Dragokas don't support local servers, but you can change the code in this parts:

for (int i = IsDedicatedServer() ? 1 : 0

to

for (int i = 1

and try...this may stop the exception, but the plugin may not work properly.

The reason besides (from my tests) it is that when you use console commands in a local server (or binded sm_commands, being the hoster), it always runs as client index = 0, which is invalid, but if you are using commands through the chat it should work in most of the cases.
__________________

Last edited by Marttt; 03-07-2020 at 20:38.
Marttt is offline
user2000
Member
Join Date: Nov 2015
Location: Peru - Lima
Old 03-07-2020 , 21:43   Re: [L4D] Map changer with rating system
Reply With Quote #15

Quote:
Originally Posted by Marttt View Post
I think that Dragokas don't support local servers, but you can change the code in this parts:

for (int i = IsDedicatedServer() ? 1 : 0

to

for (int i = 1

and try...this may stop the exception, but the plugin may not work properly.

The reason besides (from my tests) it is that when you use console commands in a local server (or binded sm_commands, being the hoster), it always runs as client index = 0, which is invalid, but if you are using commands through the chat it should work in most of the cases.

I have made the changes as you mentioned and it works fine so far

but I will continue doing more tests. Thank you for helping
user2000 is offline
user2000
Member
Join Date: Nov 2015
Location: Peru - Lima
Old 03-07-2020 , 23:15   Re: [L4D] Map changer with rating system
Reply With Quote #16

local server tests:

I did the tests and only official maps work but custom maps don't work

dedicated servivor tests:

It works perfect
user2000 is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 03-12-2020 , 08:29   Re: [L4D] Map changer with rating system
Reply With Quote #17

This is the first time when I'm trying to see the difference in listen server in practice (just for interest).

Quote:
Originally Posted by Marttt View Post
for (int i = IsDedicatedServer() ? 1 : 0
I saw this sample lot of times.
How are you guys receiving "0" index of client? This is what I have when I join the L4D1 game:

Quote:
hostname: ☣ Drakoshka ☣
version : 1.0.3.8 6830 insecure
map : l4d_hospital01_apartment at ( 2004, 904, 494 )
udp/ip : 192.168.x.x:27015 [ public n/a ]
players : 1 humans, 0 bots (4 max) (not hibernating) (unreserved)

os : Windows Listen
# userid name uniqueid connected ping loss state rate adr
# 6 1 "☣ Drakoshka ☣" STEAM_1:1xx 00:51 33 0 active 30000 loopback
# 7 "Zoey" BOT active
# 8 "Francis" BOT active
# 9 "Bill" BOT active
#end
My index is 1 (UserId 6). I can't reproduce 0.
The only way I succeed to get 0 was entering command via console, so client == 0 and %N == Console.
Also, checking for IsClientInGame(0) raise an exception.

BTW, v.1.15 is correctly work for me on my listen server L4D1 (both, default and custom maps).
Though, command bind doesn't call menu, only chat command for obvious reason: command handler receive 0, but 0 is Console, not client.

Plugin is updated to v.1.16
Quote:
v.1.16 (12-Mar-2020)
- Fixed L4D1 Windows support.
- Attempt to add 'listen servers' support.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 03-12-2020 , 08:49   Re: [L4D] Map changer with rating system
Reply With Quote #18

Quote:
Originally Posted by Dragokas View Post
How are you guys receiving "0" index of client?
I'm used to test plugins in my local server, usually they work, from my experience, most of the failures (returning client index = 0) are related to running cmds through the console or with "sm_xxx" bound to keys (which also runs in the console).
Also, index = 0, depending on the hook event, can mean the "worldspawn" classname entity.
Maybe one "workaround" would find which player is the "hoster" and change the index = 0 to the host index. But is just something that I thought.
__________________
Marttt is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 03-12-2020 , 09:16   Re: [L4D] Map changer with rating system
Reply With Quote #19

Actually, previous version is not worked precisely because I decided to put somewhere in code:
Code:
 IsDedicatedServer() ? 1 : 0


Quote:
Originally Posted by Marttt View Post
Maybe one "workaround" would find which player is the "hoster" and change the index = 0 to the host index. But is just something that I thought.
I think hoster should always be index 1.
Does other connected players transmit correct index in command callback executed via console?
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
Cahit_asd
New Member
Join Date: Apr 2020
Old 04-05-2020 , 16:21   Re: [L4D] Map changer with rating system
Reply With Quote #20

Hi

i downloaded the plugin fine , put all files correctly and add cvar to server.cfg
when i press !maps , the menu show up , but when i choose map , nothing happened , why ?
i can't change map even for stock maps
Cahit_asd is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:29.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode