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

Add mappool #415

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Add mappool #415

wants to merge 6 commits into from

Conversation

TheGunter24
Copy link

#373
was made from Franc1sco Franug for me and worked fine for over a year now

i have updated it to latest version and included the fixes for sm11
steamworks needs a new version: https://forums.alliedmods.net/showpost.php?p=2785634&postcount=829

it has not been fully testet since my "update" but it looked good so far

@splewis
Copy link
Owner

splewis commented Sep 4, 2022

There's a lot of unrelated changes to the idea of adding different mappool files here. If you can split this up into multipe PRs it will be faster/more likely to get merged.

@@ -12,7 +12,7 @@
#include <SteamWorks>

#undef REQUIRE_PLUGIN
#include "include/updater.inc"
#include <updater>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change will break the automated compilation test since this file won't be available: https://github.com/splewis/csgo-pug-setup/blob/master/.travis.yml

I would revert this, unless there's a reliable location to get the include from (i.e., undo ca76885)

@@ -1,9 +1,53 @@
#define RANDOM_MAP_VOTE "-1" // must be in invalid index for array indexing

char mapGroups[][] = {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned previously, I disagree with placing these in a different directory.

I also disagree with breaking backwards compatibility for existing users populating a different map config file.

/**
* Map voting functions
*/
public void CreateMapVote() {
StartMapVote2();
}
static void StartMapVote2() {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a poor name for this function. Can you use a more descriptive name?

Format(text, 64, mapGroups[winner]);
ReplaceString(text, 64, ".txt", "", false);

PrintCenterTextAll("Winner is %s", text);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This text should use a translation string.

menu.SetTitle("%T", "VoteMenuTitle", LANG_SERVER);
menu.ExitButton = false;
for (int i = 0; i < sizeof(mapGroups); i++) {
char text[64], id[4];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this use the AddMenuInt helper function used elsewhere in the plugin?


ServerCommand("sm_pugsetup_maplist %s", mapGroups[winner]);

char text[64];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using PLATFORM_MAX_PATH instead of 64 seems more appropriate here.

@@ -397,7 +404,7 @@ public int Native_HasPermissions(Handle plugin, int numParams) {
return isAdmin;
else if (p == Permission_Leader)
return isLeader || isAdmin;
else if (p == Permission_Captains)
else if (p == Permission_Captains && UsingCaptains())
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change seems potentially problematic. If a permission has Permission_Captains using this native will throw an error now.

@@ -501,7 +513,19 @@ public int Native_SetTeamBalancer(Handle plugin, int numParams) {
bool override = GetNativeCell(2);
if (!PugSetup_IsTeamBalancerAvaliable() || override) {
g_BalancerFunctionPlugin = plugin;
//ArrayList players = new ArrayList();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be removed.

}
Call_StartFunction(g_BalancerFunctionPlugin, g_BalancerFunction);
Call_PushCell(players);
Call_Finish();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this changing? It seems incorrect to invoke this function since the native could be called far before the match is ready.

if (action == MenuAction_VoteEnd) {
int winner = GetMenuInt(menu, param1);

ServerCommand("sm_pugsetup_maplist %s", mapGroups[winner]);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't make sense to override the value here. It doesn't make sense to even have the cvar if the plugin will just override it before it gets used.

@daviten74
Copy link

Hello, I am having problems with the blocking of teams, certain people can enter from ct or t in the middle of the live game, what could be failing me?

@TheGunter24
Copy link
Author

i dont think that this is for support,
but take a look at this: https://github.com/splewis/csgo-pug-setup#pugsetup_teamlocker
works fine for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants