AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Unapproved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=109)
-   -   [L4D/L4D2] Return To Lobby Fix For Campaign Switching Plugins (https://forums.alliedmods.net/showthread.php?t=316913)

MasterMind420 06-17-2019 10:48

[L4D/L4D2] Return To Lobby Fix For Campaign Switching Plugins
 
This plugin will keep players on the server never disconnecting them at the end of a campaign, u can use map change cmd to change maps or use a campaign changing plugin. This prevents all Return To Lobby requests other than from votes. All campaign changing plugins that change maps at the end of a campaign should use this to correct issues with going back to lobby instead of changing maps correctly.

V1.1 - New Better Method Supporting L4D1 Thanks to Crasher_3637

Mr. Man 06-17-2019 16:42

Re: [L4D/L4D2] Return To Lobby Fix
 
Thanks for this, taking it for a spin right now. I see this issue in custom campaigns where the ACS system will fail to trigger and return everyone to the lobby.

Psyk0tik 06-17-2019 19:02

Re: [L4D/L4D2] Return To Lobby Fix
 
An ideal automatic campaign switcher should let players vote to skip the stats crawl first before switching to a new campaign or returning players to the lobby. To counter that one guy who's idle during the stats crawl, there can be a check after each vote cast to determine if the majority votes to skip the stats crawl.

MasterMind420 06-22-2019 15:55

Re: [L4D/L4D2] Return To Lobby Fix
 
Quote:

Originally Posted by Crasher_3637 (Post 2655831)
An ideal automatic campaign switcher should let players vote to skip the stats crawl first before switching to a new campaign or returning players to the lobby. To counter that one guy who's idle during the stats crawl, there can be a check after each vote cast to determine if the majority votes to skip the stats crawl.

campaign shift by ngbuckwangs does this...in my opinion his is coded best to handle end game stuff accordingly...however it lacks any type of menu or voting system other than replay vote. A mashup of campaignshift and ACS with my fix would be ideal...imo.

Lux 06-22-2019 18:56

Re: [L4D/L4D2] Return To Lobby Fix
 
if you make many proper changes in this fork of ACS
https://github.com/LuxLuma/l4d2_mission_manager

Should be one of the best map changers for people looking to view stats

MasterMind420 06-30-2019 10:27

Re: [L4D/L4D2] Return To Lobby Fix
 
Quote:

Originally Posted by Lux (Post 2656383)
if you make many proper changes in this fork of ACS
https://github.com/LuxLuma/l4d2_mission_manager

Should be one of the best map changers for people looking to view stats

Thanks for this...i'll have a look. I'm gonna do some more testing at campaign end to see what can and cannot be done. Having an indefinite window at the end gives some possibilities.

MasterMind420 07-03-2019 20:01

Re: [L4D/L4D2] Return To Lobby Fix
 
If anyone using this would be so kind as to test pressing space to skip stats at end brings players back to lobby or not...haven't tested that and if it does i'd like to add a few options for that...like crasher said would be nice to actually tally that vote either based on majority skipping and moving on or otherwise...but i think some viable options for that can be added to this...maybe morph this into something that handles end game things while letting any campaign changer handle the map changing stuff...

phoenix0001 07-09-2019 11:31

Re: [L4D/L4D2] Return To Lobby Fix
 
PHP Code:

/home/groups/sourcemod/upload_tmp/phpJndwmv.sp(25) : warning 217loose indentation
/home/groups/sourcemod/upload_tmp/phpJndwmv.sp(28) : warning 217loose indentation 


Mr. Man 07-09-2019 14:17

Re: [L4D/L4D2] Return To Lobby Fix
 
Quote:

Originally Posted by phoenix0001 (Post 2658470)
PHP Code:

/home/groups/sourcemod/upload_tmp/phpJndwmv.sp(25) : warning 217loose indentation
/home/groups/sourcemod/upload_tmp/phpJndwmv.sp(28) : warning 217loose indentation 


Just a formatting problem most commonly caused by copy/paste. The plugin will work just fine.

MasterMind420 07-12-2019 21:14

Re: [L4D/L4D2] Return To Lobby Fix
 
Quote:

Originally Posted by Mr. Man (Post 2658491)
Just a formatting problem most commonly caused by copy/paste. The plugin will work just fine.

yah in most cases...if there are tabs or spaces mixed into the sp it will loose indentate those lines. The .sp as is has no loose indentations, i make sure every plugin i post has 0 errors in sourcemod when compiling(using tabs for spacing not spaces). The original file has no loose indentations. He either copy and pasted something or modified the .sp before trying to compile it.

Psyk0tik 07-12-2019 21:51

Re: [L4D/L4D2] Return To Lobby Fix
 
Quote:

Originally Posted by MasterMind420 (Post 2658923)
yah in most cases...if there are tabs or spaces mixed into the sp it will loose indentate those lines. The .sp as is has no loose indentations, i make sure every plugin i post has 0 errors in sourcemod when compiling(using tabs for spacing not spaces). The original file has no loose indentations. He either copy and pasted something or modified the .sp before trying to compile it.

When I downloaded and opened the source file, lines 25-26 have spaces instead of tabs.

PHP Code:

    char sBuffer[64];
    
BfReadString(bfsBuffersizeof(sBuffer)); 


MasterMind420 07-12-2019 22:00

Re: [L4D/L4D2] Return To Lobby Fix
 
Quote:

Originally Posted by Crasher_3637 (Post 2658927)
When I downloaded and opened the source file, lines 25-26 have spaces instead of tabs.

PHP Code:

    char sBuffer[64];
    
BfReadString(bfsBuffersizeof(sBuffer)); 


Good catch...I didn't see that...I only compiled the version on my computer which i commented out those lines for testing. Hence never getting the loose indentation. Thanks for pointing that out :)

rikka0w0 08-04-2019 14:04

Re: [L4D/L4D2] Return To Lobby Fix
 
Hi,

I have tested the plugin on my server, at the "Vote to skip", if I press the space key, nothing happens but the server prints:
OnDisconnectToLobby (Message = )
return Plugin_Handled;
At the end, I was not sent back to the lobby. If I didn't hit the key, I still stayed in the game.

Is this considered to be the normal behavior of this plugin? I was trying to integrate this plugin with my automatic map switcher, so that at the end of a campaign, players will be sent to the next map instead of disconnected back to the lobby.

MasterMind420 08-04-2019 19:34

Re: [L4D/L4D2] Return To Lobby Fix
 
Quote:

Originally Posted by rikka0w0 (Post 2661871)
Hi,

I have tested the plugin on my server, at the "Vote to skip", if I press the space key, nothing happens but the server prints:
OnDisconnectToLobby (Message = )
return Plugin_Handled;
At the end, I was not sent back to the lobby. If I didn't hit the key, I still stayed in the game.

Is this considered to be the normal behavior of this plugin? I was trying to integrate this plugin with my automatic map switcher, so that at the end of a campaign, players will be sent to the next map instead of disconnected back to the lobby.

as far as i know...ngbuckwangs campaign shift plugin is the only public plugin that has the code that does this...are u using a public campaign changing plugin...if so maybe when i have time i can help adapt it.

rikka0w0 08-05-2019 11:15

Re: [L4D/L4D2] Return To Lobby Fix
 
Quote:

Originally Posted by MasterMind420 (Post 2661927)
as far as i know...ngbuckwangs campaign shift plugin is the only public plugin that has the code that does this...are u using a public campaign changing plugin...if so maybe when i have time i can help adapt it.

Here is my open-source campaign switcher: Improved Automatic Campaign Switcher
Source code is available here:
https://github.com/rikka0w0/l4d2_mission_manager

I need to detect "the end of a campaign", my method is to read out the description file of all installed vpks and find out the name of the last map. This works for most campaigns, but very few 3rd party campaign doesn't (e.g. tanks challenge). So I'm looking for a better way, you plugin seems to be a good start point!

MasterMind420 08-05-2019 11:29

Re: [L4D/L4D2] Return To Lobby Fix
 
Quote:

Originally Posted by rikka0w0 (Post 2662027)
Here is my open-source campaign switcher: Improved Automatic Campaign Switcher
Source code is available here:
https://github.com/rikka0w0/l4d2_mission_manager

I need to detect "the end of a campaign", my method is to read out the description file of all installed vpks and find out the name of the last map. This works for most campaigns, but very few 3rd party campaign doesn't (e.g. tanks challenge). So I'm looking for a better way, you plugin seems to be a good start point!

Code:

public void OnPluginStart()
{
        AddCommandListener(SkipOutroIntercept, "skipouttro");
        AddCommandListener(OutroDoneIntercept, "outtro_stats_done");
}

//THIS TRIGGERS WHEN ALL PLAYERS SKIP STATS AT END
public Action SkipOutroIntercept(int client, const char[] cmd, int argc)
{

}

//THIS TRIGGERS WHEN OUTRO STATS ARE DONE JUST BEFORE BUMPING PLAYERS BACK TO LOBBY
public Action OutroDoneIntercept(int client, const char[] cmd, int argc)
{
       
}


Sappykun 09-30-2020 23:09

Re: [L4D/L4D2] Return To Lobby Fix
 
Quote:

Originally Posted by MasterMind420 (Post 2662030)
Code:

public void OnPluginStart()
{
        AddCommandListener(SkipOutroIntercept, "skipouttro");
        AddCommandListener(OutroDoneIntercept, "outtro_stats_done");
}

//THIS TRIGGERS WHEN ALL PLAYERS SKIP STATS AT END
public Action SkipOutroIntercept(int client, const char[] cmd, int argc)
{

}

//THIS TRIGGERS WHEN OUTRO STATS ARE DONE JUST BEFORE BUMPING PLAYERS BACK TO LOBBY
public Action OutroDoneIntercept(int client, const char[] cmd, int argc)
{
       
}


I have been trying to modify ACS so that it displays the stats screen before switching the campaign.

The intercept for outtro_stats_done does in fact trigger after the zombie kill count is displayed, but skipouttro actually triggers when a user presses spacebar to vote skip, not when all players have voted and the credits skip is triggered.

Where did you find these commands? I am trying to find the one that is called when the stats are skipped.

MasterMind420 10-01-2020 09:09

Re: [L4D/L4D2] Return To Lobby Fix
 
Quote:

Originally Posted by Sappykun (Post 2719763)
I have been trying to modify ACS so that it displays the stats screen before switching the campaign.

The intercept for outtro_stats_done does in fact trigger after the zombie kill count is displayed, but skipouttro actually triggers when a user presses spacebar to vote skip, not when all players have voted and the credits skip is triggered.

Where did you find these commands? I am trying to find the one that is called when the stats are skipped.

its possible i was wrong about the skip outro cmd...look at ngbuckwangs campaignshift plugin...he has the code in there. it will ahow you how to use it.

CryWolf 01-09-2021 08:15

Re: [L4D/L4D2] Return To Lobby Fix
 
Does anyone have a working version of this ? because this throwns a full log of errors and does nothing, pressing space to skip, it takes me out of server to main menu screen of L4D1
Code:

L 01/08/2021 - 15:15:47: Info (map "l4d_farm01_hilltop") (file "/home/crywolf/steamcmd/l4d/left4dead/addons/sourcemod/logs/errors_20210108.log")
L 01/08/2021 - 15:15:47: [SM] Exception reported: Invalid message id supplied (-1)
L 01/08/2021 - 15:15:47: [SM] Blaming: l4d_return_to_lobby_fix.smx
L 01/08/2021 - 15:15:47: [SM] Call stack trace:
L 01/08/2021 - 15:15:47: [SM]  [0] HookUserMessage
L 01/08/2021 - 15:15:47: [SM]  [1] Line 17, E:\Source Mod\scripting\l4d_return_to_lobby_fix.sp::OnPluginStart
L 01/08/2021 - 15:15:47: [SM] Unable to load plugin "l4d_return_to_lobby_fix.smx": Error detected in plugin startup (see error logs)
L 01/08/2021 - 15:15:49: [SM] Exception reported: Invalid convar handle 0 (error 4)


darkbret 01-10-2021 00:32

Re: [L4D/L4D2] Return To Lobby Fix
 
Quote:

Originally Posted by CryWolf (Post 2731917)
Does anyone have a working version of this ? because this throwns a full log of errors and does nothing, pressing space to skip, it takes me out of server to main menu screen of L4D1

I have same problem with you.
Code:

L 01/10/2021 - 12:26:29: SourceMod error session started
L 01/10/2021 - 12:26:29: Info (map "l4d_garage01_alleys") (file "D:\New folder (2)\l4d\left4dead\addons\sourcemod\logs\errors_20210110.log")
L 01/10/2021 - 12:26:29: [SM] Exception reported: Invalid message id supplied (-1)
L 01/10/2021 - 12:26:29: [SM] Blaming: l4d_return_to_lobby_fix.smx
L 01/10/2021 - 12:26:29: [SM] Call stack trace:
L 01/10/2021 - 12:26:29: [SM]  [0] HookUserMessage
L 01/10/2021 - 12:26:29: [SM]  [1] Line 17, /home/forums/content/files/9/7/2/5/7/175987.attach::OnPluginStart
L 01/10/2021 - 12:26:29: [SM] Unable to load plugin "l4d_return_to_lobby_fix.smx": Error detected in plugin startup (see error logs)


MasterMind420 03-20-2021 14:00

Re: [L4D/L4D2] Return To Lobby Fix
 
Quote:

Originally Posted by darkbret (Post 2732017)
I have same problem with you.
Code:

L 01/10/2021 - 12:26:29: SourceMod error session started
L 01/10/2021 - 12:26:29: Info (map "l4d_garage01_alleys") (file "D:\New folder (2)\l4d\left4dead\addons\sourcemod\logs\errors_20210110.log")
L 01/10/2021 - 12:26:29: [SM] Exception reported: Invalid message id supplied (-1)
L 01/10/2021 - 12:26:29: [SM] Blaming: l4d_return_to_lobby_fix.smx
L 01/10/2021 - 12:26:29: [SM] Call stack trace:
L 01/10/2021 - 12:26:29: [SM]  [0] HookUserMessage
L 01/10/2021 - 12:26:29: [SM]  [1] Line 17, /home/forums/content/files/9/7/2/5/7/175987.attach::OnPluginStart
L 01/10/2021 - 12:26:29: [SM] Unable to load plugin "l4d_return_to_lobby_fix.smx": Error detected in plugin startup (see error logs)


sorry for the late reply, looks to me the message id for return to lobby is different in l4d1, i'll have a look and see if it can be fixed.

Psyk0tik 03-20-2021 23:58

Re: [L4D2] Return To Lobby Fix
 
You only really need "DisconnectToLobby" for both games.
PHP Code:

#define ISSUE_CHANGEDIFFICULTY        0
#define ISSUE_RESTARTGAME        1
#define ISSUE_KICK            2
#define ISSUE_CHANGEMISSION        3
#define ISSUE_RETURNTOLOBBY        4
#define ISSUE_CHANGECHAPTER        5
#define ISSUE_CHANGEALLTALK        6

public void OnPluginStart()
{
    
// DisconnectToLobby is sent when stats crawl finishes or is skipped or when Return To Lobby vote succeeds
    
HookUserMessage(GetUserMessageId("DisconnectToLobby"), OnDisconnectToLobbytrue);
}

public 
Action OnDisconnectToLobby(UserMsg msg_idHandle bf, const int[] playersint playersNumbool reliablebool init)
{
    
// Don't intercept Return To Lobby votes
    
int iVoteController FindEntityByClassname(-1"vote_controller");
    if (!
IsValidEntity(iVoteController) || GetEntProp(iVoteControllerProp_Send"m_activeIssueIndex") == ISSUE_RETURNTOLOBBY)
    {
        return 
Plugin_Continue;
    }

    return 
Plugin_Handled;



CryWolf 03-21-2021 04:22

Re: [L4D2] Return To Lobby Fix
 
Quote:

Originally Posted by Crasher_3637 (Post 2741126)
You only really need "DisconnectToLobby" for both games.

Thanks, i shall test it, btw
Code:

#include <sdktools>
As your code to work compiling.

MasterMind420 03-21-2021 10:31

Re: [L4D/L4D2] Return To Lobby Fix
 
V1.1 - New Better Method Supporting L4D1 Thanks to Crasher_3637

CryWolf 03-24-2021 05:20

Re: [L4D/L4D2] Return To Lobby Fix
 
I can tell, that the plugin did nothing, as a client i was stucked at the end of campaign, when types press SPACE bar to skip, it showns main credits and i got black screen, reconnecting to the server it was default start map.

Psyk0tik 03-24-2021 10:01

Re: [L4D/L4D2] Return To Lobby Fix
 
That sounds like the plugin works. All it does is prevent clients from being sent back to the lobby (unless they vote for it). You’re supposed to use another plugin that switches to another campaign when that black screen shows up.

CryWolf 03-24-2021 11:24

Re: [L4D/L4D2] Return To Lobby Fix
 
Quote:

Originally Posted by Crasher_3637 (Post 2741589)
That sounds like the plugin works. All it does is prevent clients from being sent back to the lobby (unless they vote for it). You’re supposed to use another plugin that switches to another campaign when that black screen shows up.

Yes but also pressing space to vote skip doesn't work, no errors in log.

Psyk0tik 03-24-2021 11:56

Re: [L4D/L4D2] Return To Lobby Fix
 
Can you elaborate further on what you mean by "vote skip doesn't work"? What happens when everyone skips the credits? Do you just get a black screen after skipping?

CryWolf 03-24-2021 17:25

Re: [L4D/L4D2] Return To Lobby Fix
 
Quote:

Originally Posted by Crasher_3637 (Post 2741618)
Can you elaborate further on what you mean by "vote skip doesn't work"? What happens when everyone skips the credits? Do you just get a black screen after skipping?

Exacly, but it blocks also the SPACE BAR, if you press it it just does nothing to vote, and after ending of credits, you just get a blank screen and you need to exit to main menu

Psyk0tik 03-24-2021 19:06

Re: [L4D/L4D2] Return To Lobby Fix
 
Which plugin are you using to automatically switch to the next campaign?

CryWolf 03-25-2021 02:19

Re: [L4D/L4D2] Return To Lobby Fix
 
Quote:

Originally Posted by Crasher_3637 (Post 2741678)
Which plugin are you using to automatically switch to the next campaign?

I have none of that.

cravenge 03-25-2021 03:08

Re: [L4D/L4D2] Return To Lobby Fix
 
The title is misleading to be honest. It makes people think there's something wrong or glitchy with the "Return To Lobby" feature. Perhaps rename it to something more fitting like "Block Return To Lobby"?

MasterMind420 03-25-2021 10:27

Re: [L4D/L4D2] Return To Lobby Fix
 
Quote:

Originally Posted by cravenge (Post 2741714)
The title is misleading to be honest. It makes people think there's something wrong or glitchy with the "Return To Lobby" feature. Perhaps rename it to something more fitting like "Block Return To Lobby"?

If all u are reading is the title...the whole purpose this was made was to fix an issue where return to lobby fires before an automatic campaign switcher can change maps, which is described in the post. I do understand some people who do not speak english can misinterpret what this does, google translate can help with that. Not trying to be rude, but most coders know that people who do not fully understand dont read things properly. Changing the title will hardly fix that issue, however for readabilities sake I will add in the title, (for campaign switch plugins only). Block Return To Lobby might make people think this blocks lobby votes as well.

Psyk0tik 03-25-2021 11:06

Re: [L4D/L4D2] Return To Lobby Fix
 
Quote:

Originally Posted by CryWolf (Post 2741713)
I have none of that.

There lies your problem. This plugin (as the new thread title says) is only useful if you’re using a campaign switcher plugin. When you press spacebar to skip the credits, that’s not the same as “voting to return to lobby”. That means you are just skipping the waiting process. Think of the black screen as the server’s way of saying “Well we’re not allowed to return to the lobby, so now what do we do?” And that’s where your campaign switcher is supposed to come in. If you’re not using one, then this plugin is practically useless to you.

CryWolf 04-13-2021 02:09

Re: [L4D/L4D2] Return To Lobby Fix For Campaign Switching Plugins
 
Yes, just releazed :|

Problem is that none of the plugins around here are for L4D1 :(


All times are GMT -4. The time now is 22:28.

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