AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [CSGO][PugSetup] RoundRestore (https://forums.alliedmods.net/showthread.php?t=325630)

Cruze 06-30-2020 09:13

[CSGO][PugSetup] RoundRestore
 
2 Attachment(s)
Description: Sometimes (player dropped/crashed) which would be disadvantage for a team. It would be very handy to restore the match to the previous round.

Thanks to: L.O.T for suggestion and for testing.

Dependencies:
1) PugSetup (optional)
2) "mp_backup_round_file_pattern" to default value ("%prefix%_round%round%.txt") [Thinking a way to add support to change in this too. :/ Suggestions and Pull requests are welcome! <3]

More about this:
1) https://github.com/splewis/csgo-pug-setup/issues/145
2) https://forums.alliedmods.net/showthread.php?t=269467
3) https://forums.alliedmods.net/showthread.php?t=306284

Post bug reports and suggestions IN THIS THREAD/GITHUB ISSUES ONLY.

Changelogs:
Code:

1.1 -
* Two New commands:
1) sm_restoreround (to restore certain round)(admin only)
2) sm_deleteallbackuprounds (to delete all backup rounds)(root admin only)
* Three self-explanatory cvars.
* Translation file (PR for other languages are welcome in my github)
1.1fix -
Fixed translation file name. Thanks to paulo_crash
1.2 -
* Fixes in multiple occasions!
* Translation file name change for no freaking reason.
* Added support to filename change in mp_backup_round_file

Sourcecode in GitHub too (PR for translations are welcome)

paulo_crash 06-30-2020 13:28

Re: [CSGO][PugSetup] RoundRestore
 
Thanks for the release. :bacon!:

I only have a few questions that I would like to confirm even before testing, testing back with feedback, for now...

Works with both WarMod [BFG] and PUGSetup, right?

And any suggestions already, from what I could notice any player can use the .stop command and restore the round, right? In the future I could make the command be valid only for the team that lost its player in the case, that is, it will only use the team that is or has been without a player.

It would also be good to implement a voting system, that is, the majority of the team that would like to use this feature needs to type in the .stop chat.

Cruze 06-30-2020 17:07

Re: [CSGO][PugSetup] RoundRestore
 
Quote:

Thanks for the release. :bacon!:

I only have a few questions that I would like to confirm even before testing, testing back with feedback, for now...

Works with both WarMod [BG] and PUGSetup, right?
I've tried PugSetup only, give it a go!
Quote:

And any suggestions already, from what I could notice any player can use the .stop command and restore the round, right? In the future I could make the command be valid only for the team that lost its player in the case, that is, it will only use the team that is or has been without a player.
Good suggestion, will add it in next version with cvar to enable or disable.
Quote:

It would also be good to implement a voting system, that is, the majority of the team that would like to use this feature needs to type in the .stop chat.
Like: "Playername just typed .stop (2/5 votes)" in which 3 votes are required to pause?

paulo_crash 06-30-2020 18:59

Re: [CSGO][PugSetup] RoundRestore
 
Quote:

Originally Posted by Cruze (Post 2708033)
Like: "Playername just typed .stop (2/5 votes)" in which 3 votes are required to pause?

That, it looks good this way.

[EDIT]
Translation errors:
Code:

LoadTranslations("PugRestoreRound.phrases");
Translation file name PugRoundRestore.phrases.txt

[EDIT2]
Same thing in the config he creates, in this case the name was changed. But the config I believe is the least:
Code:

AutoExecConfig_SetFile("PugRestoreRound");

Cruze 07-01-2020 00:03

Re: [CSGO][PugSetup] RoundRestore
 
Quote:

Originally Posted by paulo_crash (Post 2708045)
That, it looks good this way.

[EDIT]
Translation errors:
Code:

LoadTranslations("PugRestoreRound.phrases");
Translation file name PugRoundRestore.phrases.txt

[EDIT2]
Same thing in the config he creates, in this case the name was changed. But the config I believe is the least:
Code:

AutoExecConfig_SetFile("PugRestoreRound");

Can you show me the errors?
Edit: Fixed

borzaka 07-02-2020 17:30

Re: [CSGO][PugSetup] RoundRestore
 
Couple of suggestions:
  • prefix is not always backup_round, it can be set to any custom by mp_backup_round_file cvar
    I have multi instance servers, where I have to set this to different values to not overwrite each other.
  • You can use completely different backup file name patterns by mp_backup_round_file_pattern cvar
    e.g. %prefix%_%date%_%time%_%team1%_%team2%_%map%_ round%round%_score_%score1%_%score2%.txt
  • mp_backup_restore_load_file pauses automatically after executing mp_backup_restore_load_file, if the mp_backup_restore_load_autopause cvar left default, no need to pause again

So, I would pay attention to custom backup file prefixes and names and use the values from cvars.

Cruze 07-03-2020 06:56

Re: [CSGO][PugSetup] RoundRestore
 
Quote:

Originally Posted by borzaka (Post 2708298)
Couple of suggestions:
  • prefix is not always backup_round, it can be set to any custom by mp_backup_round_file cvar
    I have multi instance servers, where I have to set this to different values to not overwrite each other.
  • You can use completely different backup file name patterns by mp_backup_round_file_pattern cvar
    e.g. %prefix%_%date%_%time%_%team1%_%team2%_%map%_ round%round%_score_%score1%_%score2%.txt
  • mp_backup_restore_load_file pauses automatically after executing mp_backup_restore_load_file, if the mp_backup_restore_load_autopause cvar left default, no need to pause again

So, I would pay attention to custom backup file prefixes and names and use the values from cvars.

Hmm, that's a good catch. Would if I do this? I don't know much about this cvars.

PHP Code:

        char filepath[PLATFORM_MAX_PATH];
    
char num[5];
    
Format(filepathsizeof(filepath), "%s"g_BackupPrefixPattern);
    
ReplaceString(filepathsizeof(filepath), "%prefix%"g_BackupPrefix);
    if(
round 10)
    {
        
Format(numsizeof(num), "0%d"round);
        
ReplaceString(filepathsizeof(filepath), "%round%"num);
    }
    else
    {
        
Format(numsizeof(num), "%d"round);
        
ReplaceString(filepathsizeof(filepath), "%round%"num);
    }
    
ServerCommand("mp_backup_restore_load_file %s"filepath); 

Code:

public void OnMapStart()
{
        FindConVar("mp_backup_round_file").GetString(g_BackupPrefix, sizeof(g_BackupPrefix));
        FindConVar("mp_backup_round_file_pattern").GetString(g_BackupPrefixPattern, sizeof(g_BackupPrefixPattern));
       
        ServerCommand("mp_backup_restore_load_autopause 0");
        ServerCommand("mp_backup_round_auto 1");
}

EDIT: After F-ing up my mind, I couldn't think of any way to replace this with old round's prefix :/ "%date%_%time%_%team1%_%team2%_%map%_ round%round%_score_%score1%_%score2%"
"%map%" can be possible but rest, I don't know. Any help would be appreciated!

Cruze 07-03-2020 06:58

Re: [CSGO][PugSetup] RoundRestore
 
Quote:

Originally Posted by paulo_crash (Post 2708008)
Thanks for the release. :bacon!:

I only have a few questions that I would like to confirm even before testing, testing back with feedback, for now...

Works with both WarMod [BFG] and PUGSetup, right?

And any suggestions already, from what I could notice any player can use the .stop command and restore the round, right? In the future I could make the command be valid only for the team that lost its player in the case, that is, it will only use the team that is or has been without a player.

It would also be good to implement a voting system, that is, the majority of the team that would like to use this feature needs to type in the .stop chat.

I can't guarantee WarMod [BFG] but get5 and pugsetup should be supported after next release!

thinkii 07-03-2020 13:01

Re: [CSGO][PugSetup] RoundRestore
 
Loving this plugin, would you mind adding a .pause and !pause feature? Just for in between rounds tactical pauses

Cruze 07-04-2020 01:05

Re: [CSGO][PugSetup] RoundRestore
 
Quote:

Originally Posted by thinkii (Post 2708430)
Loving this plugin, would you mind adding a .pause and !pause feature? Just for in between rounds tactical pauses

Why do you need pause feature inside tactical pauses? O.o There is !unpause


All times are GMT -4. The time now is 05:43.

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