Jump to content

Insane Limits: !setnext map command, to set next map by name


ImportBot

Recommended Posts

Originally Posted by PapaCharlie9*:

 

This limit enables admins who have a Procon account that permits map list changes to use chat commands to set the next map in the current rotation by name and to end the current round and run the next map, preserving scores.

 

The chat command for setting a map by name has this format:

 

!setnext shortMap shortMode rounds

 

The shortMode and rounds parameters are optional. If shortMode is omitted, ConquestLarge0 is assumed. If rounds are omitted, 1 is assumed. Map names and modes may be abbreviated, any unique case insensitive substring will work.

 

The command assumes you are trying to change to a map in the current rotation. If the map name is not in the current rotation, an error will be issued. However, if the map file code name is used in the command, that map will be added permanently to the end of the rotation.

 

!next

 

This command ends the current round immediately, preserving scores and going through the normal end-of-round sequence. Then the next map in the rotation will be loaded. Not to be confused with !nextlevel from the Procon In-Game Admin plugin, which terminates the current round without scores and immediately loads the next round.

 

Examples:

 

Suppose the current rotation is:

 

Paracel Storm, ConquestLarge0, 1

Flood Zone, ConquestLarge0, 1

Zavod 311, ConquestLarge0, 1

Golmud Railway, ConquestLarge0, 1

Operation Locker, ConquestLarge0, 1

 

And the game is currently running Paracel Storm.

 

All of these commands are equivalent:

 

!setnext rail

!setnext rail conquestlarge

!setnext rail conquestlarge 1

 

Each of those will set the next map to Goldmud Railway, ConquestLarge0, 1 round. When the Paracel Storm round ends normally, the map rotation will be skipped to Golmud Railway.

 

!setnext XP0_Metro

 

Since this map is not in the current rotation and the map name is a valid map file code name, a new entry will be added to the end of the current map rotation for Operation Metro 2014, ConquestLarge, 1 round. This is a permanent addition to the map list rotation.

 

!setnext MP_Siege Domination0 2

 

Since this map is not in the current rotation and the map name is a valid map file code name, a new etnry will be added to the end of the current map rotation for Siege of Shanghai, Domination, 2 rounds. This is a permanent addition to the map list rotation.

 


 

Create a new limit to evaluate OnAnyChat, call it "Map Command", leave Action set to None.

 

Set first_check to this Code:

 

Code:

/* Version 0.9/R8 */
int level = 2;

try {
    level = Convert.ToInt32(plugin.getPluginVarValue("debug_level"));
} catch (Exception e) {}


Match next1Cmd = Regex.Match(player.LastChat, @"^\s*!setnext\s+([^\s]+)$", RegexOptions.IgnoreCase);
Match next2Cmd = Regex.Match(player.LastChat, @"^\s*!setnext\s+([^\s]+)\s+([^\s]+)$", RegexOptions.IgnoreCase);
Match next3Cmd = Regex.Match(player.LastChat, @"^\s*!setnext\s+([^\s]+)\s+([^\s]+)\s+([^\s]+)$", RegexOptions.IgnoreCase);
Match nextCmd = Regex.Match(player.LastChat, @"^\s*!next", RegexOptions.IgnoreCase);

if (!next1Cmd.Success && !next2Cmd.Success && !next3Cmd.Success && !nextCmd.Success) return false;

bool canKill = false;
bool canKick = false;
bool canBan = false;
bool canMove = false;
bool canChangeLevel = false;

if (!plugin.CheckAccount(player.Name, out canKill, out canKick, out canBan, out canMove, out canChangeLevel) || !canChangeLevel) {
    plugin.SendPlayerMessage(player.Name, "You are not permitted to use that command: " + player.LastChat);
    return false;
}

/* Default map list */

List<String> mapFileNames = server.MapFileNameRotation;
List<String> modeNames = server.GamemodeRotation;
List<int> rounds = server.LevelRoundsRotation;

/* Functions */

Converter<String,String> ShortMapToMapCode = delegate(String sname) {
    String ret = null;
    foreach (String name in mapFileNames) {
        try {
            String lname = plugin.FriendlyMapName(name);
            if (Regex.Match(lname, sname, RegexOptions.IgnoreCase).Success) {
                ret = name; // map code
                break;
            }
        } catch (Exception e) {
            return null;
        }
    }
    if (ret == null && sname.Contains("_")) ret = sname; // liternal map code name
    return ret;
};

Converter<String,String> ShortModeToLongMode = delegate(String smode) {
    String ret = null;
    foreach (String name in modeNames) {
        try {
            String lname = plugin.FriendlyModeName(name);
            if (Regex.Match(lname, smode, RegexOptions.IgnoreCase).Success) {
                ret = name; // map code
                break;
            }
        } catch (Exception e) {
            return null;
        }
    };
    if (ret == null && smode.Contains("0")) ret = smode; // literal mode name
    if (ret == null) ret = "ConquestLarge0";
    return ret;
};

Converter<String,int> MapCodeToIndex = delegate(String mc) {
    int i = 0;
    foreach (String mapFileName in mapFileNames) {
        if (Regex.Match(mapFileName, mc, RegexOptions.IgnoreCase).Success) {
            return i;
        }
        i = i + 1;
    }
    return i;
};

String mapCode = "MP_Prison";
int winner = (team1.RemainTicketsPercent > team2.RemainTicketsPercent) _ 1 : 2;

/* !next, ignore !nextlevel */

if (nextCmd.Success) {
    if (Regex.Match(player.LastChat, @"^\s*!nextlevel", RegexOptions.IgnoreCase).Success) return false; // let other plugin handle it
    if (level >= 2) plugin.ConsoleWrite("^b[MAP]^n " + player.FullName + " issued !next command");

    plugin.PRoConEvent("IGC !next", player.FullName);
    plugin.ServerCommand("mapList.endRound", winner.ToString());
    return false;
}

/* !setnext shortMap [shortMode] [rounds] */
/* Ignore !setnext integer */

if (next1Cmd.Success || next2Cmd.Success || next3Cmd.Success) {
    String shortMap = mapCode;
    String shortMode = "ConquestLarge";
    int r = 1;
    
    if (next1Cmd.Success) {
        shortMap = next1Cmd.Groups[1].Value;
        if (Regex.Match(shortMap, @"^[0-9]+$").Success) return false; // let other plugin handle it
    } else if (next2Cmd.Success) {
        shortMap = next2Cmd.Groups[1].Value;
        shortMode = next2Cmd.Groups[2].Value;
    } else if (next3Cmd.Success) {
        shortMap = next3Cmd.Groups[1].Value;
        shortMode = next3Cmd.Groups[2].Value;
        r = Convert.ToInt32(next3Cmd.Groups[3].Value);
    }
    
    // Get the map code
    mapCode = ShortMapToMapCode(shortMap);
    if (mapCode == null) {
        plugin.ServerCommand("admin.say", "Bad map name: " + shortMap, "player", player.Name);
        return false;
    }
    
    // Get the mode
    String longMode = ShortModeToLongMode(shortMode);
    if (longMode == null) {
        plugin.ServerCommand("admin.say", "Bad mode name: " + shortMode, "player", player.Name);
        return false;
    }
    
    if (level >= 2) plugin.ConsoleWrite("^b[MAP]^n " + player.FullName + ": !setnext " + mapCode + " " + longMode + " " + r );
    String dope = "Next map: " + plugin.FriendlyMapName(mapCode) + " " + plugin.FriendlyModeName(longMode) + " " + r;
    plugin.SendPlayerMessage(player.Name, dope);
    plugin.PRoConChat(player.FullName + "> " + dope);

    // Special case
    if (server.MapFileNameRotation.Contains(mapCode)) {
        
        int mapIndex = MapCodeToIndex(mapCode);
        if (mapIndex < modeNames.Count && modeNames[mapIndex] == longMode) {

        if (level >= 2) plugin.ConsoleWrite("^b[MAP]^n special case, setting next to existing map entry #" + mapIndex + ", " + plugin.FriendlyMapName(mapCode)  );

        // Say
        //plugin.ServerCommand("admin.say", "Next map will be " + plugin.FriendlyMapName(mapCode), "player", player.Name);

        // Set it as the next map
        plugin.ServerCommand("mapList.setNextMapIndex", mapIndex.ToString());
        
        return false;
      }
    }
    
    
    // Remember where we put this temporary map entry
    int lastMap = server.MapFileNameRotation.Count;

    if (level >= 2) plugin.ConsoleWrite("^b[MAP]^n setnext: temp map inserted at index #" + lastMap);
    
    // Say
    //plugin.ServerCommand("admin.say", "Next map will be " + plugin.FriendlyMapName(mapCode) + "/" + plugin.FriendlyModeName(longMode), "player", player.Name);

    // Add new map list entry at the end
    plugin.ServerCommand("mapList.add", mapCode, longMode, r.ToString());
    
    // Set it as the next map
    plugin.ServerCommand("mapList.setNextMapIndex", lastMap.ToString());
    
    // Refresh map list
    plugin.ServerCommand("mapList.list");

    return false;
}

return false;
* Restored post. It could be that the author is no longer active.
Link to comment
  • 1 month later...

Originally Posted by Level*:

 

Hey THX but,

 

It does not work 100% when I write !SetNext operation metro it change to operation firestorm _!

 

and why you need the right "Change current map funtions" why is not enough "Edit map zones"

 

LG Level

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by madmuthamonk*:

 

I get this error when putting in the code above:

 

[12:54:17 21] [insane Limits] Compiling Limit #1 - Map Command - OnAnyChat

[12:54:17 22] [insane Limits] ERROR: 1 error compiling Code

[12:54:17 22] [insane Limits] ERROR: (CS1513, line: 36, column: 10): ) expected

 

What does that mean?

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

I get this error when putting in the code above:

 

[12:54:17 21] [insane Limits] Compiling Limit #1 - Map Command - OnAnyChat

[12:54:17 22] [insane Limits] ERROR: 1 error compiling Code

[12:54:17 22] [insane Limits] ERROR: (CS1513, line: 36, column: 10): ) expected

 

What does that mean?

Copy & paste error? I just tried it and did not get any errors. Are you using IE? Sometimes Internet Exploder causes copy&paste problems. Try a different browser.

 

You did'nt change any code, right? If you did, probably something you changed. :smile:

* Restored post. It could be that the author is no longer active.
Link to comment
  • 1 month later...

Originally Posted by LCARSx64*:

 

This is for Conquest only? Tried to set it for rush and it set it to conquest.

Did you type the command like this:

!setmap rail RushLarge0 2

In this example, when the current round ends normally, the next map will be Golmud Railway ("rail"), gamemode will be RushLarge0 with 2 rounds.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

!setnext shortMap shortMode rounds

 

The shortMode and rounds parameters are optional. If shortMode is omitted, ConquestLarge0 is assumed. If rounds are omitted, 1 is assumed. Map names and modes may be abbreviated, any unique case insensitive substring will work.

Highlighted in red for your (madmuthamunk's) edification. :smile:

 

Because "rush" is not unique (Rush and Squad Rush), you have to at least include the L, so the minimal command would be:

 

!setnext rail rushl 2

* Restored post. It could be that the author is no longer active.
Link to comment
  • 3 months later...

Originally Posted by trans-am*:

 

I have a few question about this limits:

 

1)

For example this is my current rotation:

 

Paracel Storm, ConquestLarge0, 1

Flood Zone, ConquestLarge0, 1

Zavod 311, ConquestLarge0, 1

Golmud Railway, ConquestLarge0, 1

Operation Locker, ConquestLarge0, 1

 

I am now playing Paracel storm and want to change to Operation Locker what do i type so that it will immediately change to that map?

 

2)

All of these commands are equivalent:

 

!setnext rail conquestlarge 1

For this other than the map file's code name, can we type the human readable map name (e.g Zavod 311)?

If so how do we type it short?

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

I have a few question about this limits:

 

1)

For example this is my current rotation:

 

Paracel Storm, ConquestLarge0, 1

Flood Zone, ConquestLarge0, 1

Zavod 311, ConquestLarge0, 1

Golmud Railway, ConquestLarge0, 1

Operation Locker, ConquestLarge0, 1

 

I am now playing Paracel storm and want to change to Operation Locker what do i type so that it will immediately change to that map?

There are two separate commands, set what the map will be in the next round, and end the current round and run the next round. You can see how using those together is the same as immediately changing, right? You would type this two commands, one after the other:

 

!setnext locker

!next

 

Since you only have one mode and always have 1 round, you just need part of the readable name. Any unique part of the name would work. You could probably just type "!setnext lock" and that would work.

 

2)

 

 

For this other than the map file's code name, can we type the human readable map name (e.g Zavod 311)?

If so how do we type it short?

You can't type "Zavod 311" because the command will think that 311 is the name of a mode, because it is separated by a space. Use any single word from the readable name that doesn't match any other part of any other name. Just use "zavod", for example. You can type everything lowercase if you want, it doesn't matter.

 

For your map list, all of the names are unique, but what if you had?

 

Operation Locker, ConquestLarge0, 1

Operation Firestorm 2014, ConquestLarge0, 1

 

You can't use "!setnext Operation", because two different maps have that word in it. If you want Firestorm, you'd have to use "!setnext Firestorm".

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

What went wrong for the first 2 command?

Capture.jpg

Nothing is wrong with the first two commands. It it is telling you that you didn't have Flood Zone in your maplist. When you used the mp_flooded form, it added the map to the end of your maplist.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by trans-am*:

 

1) so for the 1st two commands, it mean that the next map after this is flood zone if flood zone is in my maplist,?

 

2) Let say i have Locker (current map) & Shanghai in maplist & i key in mp_flooded, so after Locker end, it will skip shanghai and went straight to Flood zone? (take it all map is 1 round)

 

3) In my map list, Locker 2 round (current map), Shanghai 2 Round

and i have key in this !setnext mp_flooded domination0 2

 

so after round 1 of locker it will change to Flood zone or round 2 of locker

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

1) so for the 1st two commands, it mean that the next map after this is flood zone if flood zone is in my maplist,?

Yes, so if you let the current round finish normally, no more commands, the next round would jump to Flood Zone.

 

2) Let say i have Locker (current map) & Shanghai in maplist & i key in mp_flooded, so after Locker end, it will skip shanghai and went straight to Flood zone? (take it all map is 1 round)

Yes, and mp_flooded will be the last map in the map list.

 

If you use no other command, the current round will end normally in time, and then the next round will skip to Flood Zone.

 

If, however, immediately after !setnext you use the !next command, the current round will end immediately and then the next round will skip to Flood Zone.

 

3) In my map list, Locker 2 round (current map), Shanghai 2 Round

and i have key in this !setnext mp_flooded domination0 2

 

so after round 1 of locker it will change to Flood zone or round 2 of locker

Round 2 of Locker. The !setnext command sets the next map, not the next round. That is true if you let the round end normally or use the !next command. The !next command ends the current round and runs the next round, it doesn't really have anything to do with maps. It is a little confusing, one is about maps, the other is about rounds.
* Restored post. It could be that the author is no longer active.
Link to comment

Archived

This topic is now archived and is closed to further replies.



  • Our picks

    • Game Server Hosting:

      We're happy to announce that EZRCON will branch out into the game server provider scene. This is a big step for us so please having patience if something doesn't go right in this area. Now, what makes us different compared to other providers? Well, we're going with the idea of having a scaleable server hosting and providing more control in how you set up your server. For example, in Minecraft, you have the ability to control how many CPU cores you wish your server to have access to, how much RAM you want to use, how much disk space you want to use. This type of control can't be offered in a single service package so you're able to configure a custom package the way you want it.

      You can see all the available games here. Currently, we have the following games available.

      Valheim (From $1.50 USD)


      Rust (From $3.20 USD)


      Minecraft (Basic) (From $4.00 USD)


      Call of Duty 4X (From $7.00 USD)


      OpenTTD (From $4.00 USD)


      Squad (From $9.00 USD)


      Insurgency: Sandstorm (From $6.40 USD)


      Changes to US-East:

      Starting in January 2022, we will be moving to a different provider that has better support, better infrastructure, and better connectivity. We've noticed that the connection/routes to this location are not ideal and it's been hard getting support to correct this. Our contract for our two servers ends in March/April respectively. If you currently have servers in this location you will be migrated over to the new provider. We'll have more details when the time comes closer to January. The new location for this change will be based out of Atlanta, GA. If you have any questions/concerns please open a ticket and we'll do our best to answer them.
      • 5 replies
    • Hello All,

      I wanted to give an update to how EZRCON is doing. As of today we have 56 active customers using the services offered. I'm glad its doing so well and it hasn't been 1 year yet. To those that have services with EZRCON, I hope the service is doing well and if not please let us know so that we can improve it where possible. We've done quite a few changes behind the scenes to improve the performance hopefully. 

      We'll be launching a new location for hosting procon layers in either Los Angeles, USA or Chicago, IL. Still being decided on where the placement should be but these two locations are not set in stone yet. We would like to get feedback on where we should have a new location for hosting the Procon Layers, which you can do by replying to this topic. A poll will be created where people can vote on which location they would like to see.

      We're also looking for some suggestions on what else you would like to see for hosting provider options. So please let us know your thoughts on this matter.
      • 4 replies
    • Added ability to disable the new API check for player country info


      Updated GeoIP database file


      Removed usage sending stats


      Added EZRCON ad banner



      If you are upgrading then you may need to add these two lines to your existing installation in the file procon.cfg. To enable these options just change False to True.

      procon.private.options.UseGeoIpFileOnly False
      procon.private.options.BlockRssFeedNews False



       
      • 2 replies
    • I wanted I let you know that I am starting to build out the foundation for the hosting services that I talked about here. The pricing model I was originally going for wasn't going to be suitable for how I want to build it. So instead I decided to offer each service as it's own product instead of a package deal. In the future, hopefully, I will be able to do this and offer discounts to those that choose it.

      Here is how the pricing is laid out for each service as well as information about each. This is as of 7/12/2020.

      Single MySQL database (up to 30 GB) is $10 USD per month.



      If you go over the 30 GB usage for the database then each additional gigabyte is charged at $0.10 USD each billing cycle. If you're under 30GB you don't need to worry about this.


      Databases are replicated across 3 zones (regions) for redundancy. One (1) on the east coast of the USA, One (1) in Frankfurt, and One (1) in Singapore. Depending on the demand, this would grow to more regions.


      Databases will also be backed up daily and retained for 7 days.




      Procon Layer will be $2 USD per month.


      Each layer will only allow one (1) game server connection. The reason behind this is for performance.


      Each layer will also come with all available plugins installed by default. This is to help facilitate faster deployments and get you up and running quickly.


      Each layer will automatically restart if Procon crashes. 


      Each layer will also automatically restart daily at midnight to make sure it stays in tip-top shape.


      Custom plugins can be installed by submitting a support ticket.




      Battlefield Admin Control Panel (BFACP) will be $5 USD per month


      As I am still working on building version 3 of the software, I will be installing the last version I did. Once I complete version 3 it will automatically be upgraded for you.





      All these services will be managed by me so you don't have to worry about the technical side of things to get up and going.

      If you would like to see how much it would cost for the services, I made a calculator that you can use. It can be found here https://ezrcon.com/calculator.html

       
      • 11 replies
    • I have pushed out a new minor release which updates the geodata pull (flags in the playerlisting). This should be way more accurate now. As always, please let me know if any problems show up.

       
      • 9 replies
×
×
  • Create New...

Important Information

Please review our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.