ImportBot Posted August 3, 2013 Author Share Posted August 3, 2013 Originally Posted by w262035635*: Could you tell me if there is a plug-in, Can directly use special language characters? Such as the Fixed time in the chat window displays notifications game, use the language of our country, such as German or Chinese or Japanese * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted August 4, 2013 Author Share Posted August 4, 2013 Originally Posted by PapaCharlie9*: ])RAG()N* said: Would it be possible to add a white list to this ?The easiest thing to do is just use the built-in whitelist for Insane Limits. Set use_white_list to True, then add tags to clan_white_list or plane names to player_white_list. Note, this whitelist applies to all limits. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted August 4, 2013 Author Share Posted August 4, 2013 Originally Posted by PapaCharlie9*: w262035635* said: Could you tell me if there is a plug-in, Can directly use special language characters? Such as the Fixed time in the chat window displays notifications game, use the language of our country, such as German or Chinese or Japanese It's not possible to send or receive special characters in chat or yells. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted August 6, 2013 Author Share Posted August 6, 2013 Originally Posted by w262035635*: PapaCharlie9* said: It's not possible to send or receive special characters in chat or yells.I saw the other server welcome message .. you can use the language in Taiwan * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted August 6, 2013 Author Share Posted August 6, 2013 Originally Posted by Singh400*: PapaCharlie9* said: It's not possible to send or receive special characters in chat or yells.Are you sure? I've seen all sorts in my chat window. I saw full blown crazy ass Russian the other day. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted August 6, 2013 Author Share Posted August 6, 2013 Originally Posted by PapaCharlie9*: Singh400* said: Are you sure? I've seen all sorts in my chat window. I saw full blown crazy ass Russian the other day.Huh. That does suggest it is possible, but the R38 RCON protocol manual says: Quote String An 8bit ASCII string. Must not contain any characters with ASCII code 0. It says ASCII, not Unicode, which is what it would have to be. Try putting some UTF-8 into an Insane Limit plugin.SendGlobalMessage or Unicode into Spambot and see what happens. I just tried an experiment with the Procon chat tab: Entered this and did a Say: ??? Console said this: [10:10:46] Client: request S: 787 [0-admin.say] [1-???] [2-all] [10:10:46] Server: request S: 25482 [0-player.onChat] [1-Server] [2-SF_] [3-all] [10:10:46] Server: response S: 25482 [0-OK] [10:10:46] Client: response S: 787 [0-OK] (RE: [0-admin.say] [1-???] [2-all]) So you can see the string comes back as "SF_" Probably the lower 8 bits of the 16-bit Unicode. Now that might just be a Procon UI issue. It might work if you wrote UTF-8 directly into the RCON connection, but I don't know how to do that through Procon, since it uses UTF-16 for everything. Maybe it's not using the right transcoding? * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted August 6, 2013 Author Share Posted August 6, 2013 Originally Posted by Singh400*: Did some testing. Sending via IL results in ____!. Typing the phrase into chat, works fine but then ProCon doesn't show the string correctly. Pasting the dodgy characters into ProCon, sends fine but the game receives them as ___!. The phrase was "????????????!". * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted August 7, 2013 Author Share Posted August 7, 2013 Originally Posted by Singh400*: Can IL detect the use of non-standard weapons? Specifically being killed by things like medic kits, ammo boxes, spawn beacons, TUGS, and etc? Looking at we can see ProCon reports this event:- Code: Playerlist 08/06/2013 23:00:06 PlayerKilled Muentzeenberger killed freako13 [{MISSING: global.Weapons.ammobag} | -HEADSHOT-]I'm thinking OnKill and if(!weaponsList.Contains(kill.Weapon)) then do something. Ideally, it could be used as another line of defence against these types of hacks. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted August 7, 2013 Author Share Posted August 7, 2013 Originally Posted by EBassie*: Can't we just add those items to the BF3.def file and create a limit? * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted August 7, 2013 Author Share Posted August 7, 2013 Originally Posted by PapaCharlie9*: Medkit is already in BF3.defs, so I don't see why not. I think IL will work without changing BF3.defs, though. It starts with the built-in list based on BF3.defs, but whenever it finds a weapon that it doesn't recognize, it posts this logging message and adds it to its internal list: [09:48:32 80] [insane Limits] detected that weapon ‰D$…Ût‹ƒ is not in dictionary, adding it So as long as you build your list before IL adds the new weapon, it should be fine. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted August 7, 2013 Author Share Posted August 7, 2013 Originally Posted by Singh400*: PapaCharlie9* said: Medkit is already in BF3.defs, so I don't see why not. I think IL will work without changing BF3.defs, though. It starts with the built-in list based on BF3.defs, but whenever it finds a weapon that it doesn't recognize, it posts this logging message and adds it to its internal list: [09:48:32 80] [insane Limits] detected that weapon ‰D$…Ût‹ƒ is not in dictionary, adding it So as long as you build your list before IL adds the new weapon, it should be fine. I threw this together... Code: if (killer.StatsError) { return false; } BattlelogWeaponStatsInterface bws = killer.GetBattlelog(kill.Weapon); List<string> weapList = new List<string>(); weapList.Add("870MCS"); weapList.Add("870MCS"); weapList.Add("AEK-971"); weapList.Add("AKS-74u"); weapList.Add("AN-94 Abakan"); weapList.Add("AS Val"); weapList.Add("DamageArea"); weapList.Add("DAO-12"); weapList.Add("Death"); weapList.Add("Defib"); weapList.Add("F2000"); weapList.Add("FAMAS"); weapList.Add("FGM-148"); weapList.Add("FIM92"); weapList.Add("Glock18"); weapList.Add("HK53"); weapList.Add("jackhammer"); weapList.Add("JNG90"); weapList.Add("Knife_RazorBlade"); weapList.Add("L96"); weapList.Add("LSAT"); weapList.Add("M416"); weapList.Add("M417"); weapList.Add("M1014"); weapList.Add("M15 AT Mine"); weapList.Add("M16A4"); weapList.Add("M1911"); weapList.Add("M240"); weapList.Add("M249"); weapList.Add("M26Mass"); weapList.Add("M27IAR"); weapList.Add("M320"); weapList.Add("M39"); weapList.Add("M40A5"); weapList.Add("M4A1"); weapList.Add("M60"); weapList.Add("M67"); weapList.Add("M9"); weapList.Add("M93R"); weapList.Add("Medkit"); weapList.Add("Melee"); weapList.Add("MG36"); weapList.Add("Mk11"); weapList.Add("Model98B"); weapList.Add("MP7"); weapList.Add("Pecheneg"); weapList.Add("PP-19"); weapList.Add("PP-2000"); weapList.Add("QBB-95"); weapList.Add("QBU-88"); weapList.Add("QBZ-95"); weapList.Add("Repair Tool"); weapList.Add("RoadKill"); weapList.Add("RPG-7"); weapList.Add("RPK-74M"); weapList.Add("SCAR-L"); weapList.Add("SG 553 LB"); weapList.Add("Siaga20k"); weapList.Add("SKS"); weapList.Add("SMAW"); weapList.Add("SoldierCollision"); weapList.Add("SPAS-12"); weapList.Add("Suicide"); weapList.Add("SV98"); weapList.Add("SVD"); weapList.Add("Steyr AUG"); weapList.Add("Taurus .44"); weapList.Add("Type88"); weapList.Add("USAS-12"); weapList.Add("Weapons/A91/A91"); weapList.Add("Weapons/AK74M/AK74"); weapList.Add("Weapons/G36C/G36C"); weapList.Add("Weapons/G3A3/G3A3"); weapList.Add("Weapons/Gadgets/C4/C4"); weapList.Add("Weapons/Gadgets/Claymore/Claymore"); weapList.Add("Weapons/KH2002/KH2002"); weapList.Add("Weapons/Knife/Knife"); weapList.Add("Weapons/MagpulPDR/MagpulPDR"); weapList.Add("Weapons/MP412Rex/MP412REX"); weapList.Add("Weapons/MP443/MP443"); weapList.Add("Weapons/MP443/MP443_GM"); weapList.Add("Weapons/P90/P90"); weapList.Add("Weapons/P90/P90_GM"); weapList.Add("Weapons/Sa18IGLA/Sa18IGLA"); weapList.Add("Weapons/SCAR-H/SCAR-H"); weapList.Add("Weapons/UMP45/UMP45"); weapList.Add("Weapons/XP1_L85A2/L85A2"); weapList.Add("Weapons/XP2_ACR/ACR"); weapList.Add("Weapons/XP2_L86/L86"); weapList.Add("Weapons/XP2_MP5K/MP5K"); weapList.Add("Weapons/XP2_MTAR/MTAR"); weapList.Add("CrossBow"); string fancy_time = DateTime.Now.ToString("HH:mm:ss"); string fancy_date = DateTime.Now.ToString("yyyy-MM-dd"); if (weapList.Contains(kill.Weapon)) { return false; } else { plugin.Log("Logs/InsaneLimits_TEST.csv", plugin.R(fancy_date + "," + fancy_time + "," + killer.Name + "," + bws.Name + "," + kill.Weapon + ",%p_pg%,")); } return false;Feel free to improve it where possible. It's 4am, not exactly the best time to be writing snippets of code. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted August 8, 2013 Author Share Posted August 8, 2013 Originally Posted by Chilace*: w262035635* said: I saw the other server welcome message .. you can use the language in TaiwanThis is done by pbsvuser.cfg:Code: ;Messages pb_sv_task 35 600 admin.say "????? ?????????? ?? ?????? Friends in Battlefield" all pb_sv_task 36 600 admin.say "?? ??????? ??????????? ??? ? ???????????" all pb_sv_task 37 600 admin.say "? ????? ???????? ? ???? ???????" all pb_sv_task 38 600 admin.say "???????? ???? !" all * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted August 9, 2013 Author Share Posted August 9, 2013 Originally Posted by )RAG()N*: PapaCharlie9* said: The easiest thing to do is just use the built-in whitelist for Insane Limits. Set use_white_list to True, then add tags to clan_white_list or plane names to player_white_list. Note, this whitelist applies to all limits. I have "Melee/Knife Death Shame" limit if I turn the white list on will that stop working for the white list players ? * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted August 10, 2013 Author Share Posted August 10, 2013 Originally Posted by Jaythegreat1*: PapaCharlie9* said: Give this a try: Create a new custom list (make sure use_custom_lists is True) called idle_whitelist. Set it to CaseSensitive. You can put player names or clan tags in the list, separated by commas. Create a new limit to evaluate OnIntervalServer, call it "Idle Kick", set interval to 60 seconds, leave Action set to None. Set first_check to this Code: Code: double MaximumIdleSeconds = 10*60; // 10 minutes double MinimumPlayers = 6; String KickMessage = "Idle too long"; if (server.PlayerCount < MinimumPlayers) return false; List<PlayerInfoInterface> all = new List<PlayerInfoInterface>(); all.AddRange(team1.players); all.AddRange(team2.players); if (team3.players.Count > 0) all.AddRange(team3.players); if (team4.players.Count > 0) all.AddRange(team4.players); // Track and update idle players foreach (PlayerInfoInterface p in all) { if (plugin.isInList(p.Name, "idle_whitelist") || (!String.IsNullOrEmpty(p.Tag) && plugin.isInList(p.Tag, "idle_whitelist"))) continue; if (plugin.CheckPlayerIdle(p.Name) > MaximumIdleSeconds) { plugin.ConsoleWrite("Kicking idle player " + p.FullName); plugin.KickPlayerWithMessage(p.Name, KickMessage); } } return false;You should change the top three lines. MaximumIdleSeconds is the maximum idle time in seconds. So if you want 15 minutes, make it 15*60, or 900. MinimumPlayers is the minimum number of players that have to be in the server before the idle kicker is enabled. I set it to 6, but you can change it to whatever you want. KickMessage is the message you want the player to see when they are kicked. NOTE: I haven't tested this myself, but I've been told that the idle time tracked by the game server is cumulative. So if a player is idle for 5 minutes, then plays for an hour, then is idle for 5 minutes again, his idle time will be reported as 10 minutes. Keep that in mind when you set the maximum. PC, I tried this on our server white-listing our server seeders... but it doesn't look like it's kicking anybody. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted August 10, 2013 Author Share Posted August 10, 2013 Originally Posted by PapaCharlie9*: ])RAG()N* said: I have "Melee/Knife Death Shame" limit if I turn the white list on will that stop working for the white list players ?Yes. Also, I meant "player names" where I typed "plane names". * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted August 10, 2013 Author Share Posted August 10, 2013 Originally Posted by PapaCharlie9*: Jaythegreat1* said: PC, I tried this on our server white-listing our server seeders... but it doesn't look like it's kicking anybody.Use this version and set debug_level to 4. All idle times of more than 10 minutes will be listed in plugin.log. Do the times look reasonable? Code: double MaximumIdleSeconds = 10*60; // 10 minutes double MinimumPlayers = 6; String KickMessage = "Idle too long"; if (server.PlayerCount < MinimumPlayers) return false; int level = 2; try { level = Convert.ToInt32(plugin.getPluginVarValue("debug_level")); } catch (Exception e) {} List<PlayerInfoInterface> all = new List<PlayerInfoInterface>(); all.AddRange(team1.players); all.AddRange(team2.players); if (team3.players.Count > 0) all.AddRange(team3.players); if (team4.players.Count > 0) all.AddRange(team4.players); // Track and update idle players foreach (PlayerInfoInterface p in all) { if (plugin.isInList(p.Name, "idle_whitelist") || (!String.IsNullOrEmpty(p.Tag) && plugin.isInList(p.Tag, "idle_whitelist"))) continue; if (p.ScoreRound > 0 || p.KillsRound > 0) continue; double idt = plugin.CheckPlayerIdle(p.Name); if (level >= 4 && idt >= 10*60) plugin.ConsoleWrite("Idle: ^b" + p.FullName + "^n idle for " + idt.ToString("F0") + " minutes"); if (idt > MaximumIdleSeconds) { plugin.ConsoleWrite("^8Kicking idle player " + p.FullName); plugin.KickPlayerWithMessage(p.Name, KickMessage); } } return false; * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted August 11, 2013 Author Share Posted August 11, 2013 Originally Posted by Jaythegreat1*: PapaCharlie9* said: Use this version and set debug_level to 4. All idle times of more than 10 minutes will be listed in plugin.log. Do the times look reasonable? Code: double MaximumIdleSeconds = 10*60; // 10 minutes double MinimumPlayers = 6; String KickMessage = "Idle too long"; if (server.PlayerCount < MinimumPlayers) return false; int level = 2; try { level = Convert.ToInt32(plugin.getPluginVarValue("debug_level")); } catch (Exception e) {} List<PlayerInfoInterface> all = new List<PlayerInfoInterface>(); all.AddRange(team1.players); all.AddRange(team2.players); if (team3.players.Count > 0) all.AddRange(team3.players); if (team4.players.Count > 0) all.AddRange(team4.players); // Track and update idle players foreach (PlayerInfoInterface p in all) { if (plugin.isInList(p.Name, "idle_whitelist") || (!String.IsNullOrEmpty(p.Tag) && plugin.isInList(p.Tag, "idle_whitelist"))) continue; if (p.ScoreRound > 0 || p.KillsRound > 0) continue; double idt = plugin.CheckPlayerIdle(p.Name); if (level >= 4 && idt >= 10*60) plugin.ConsoleWrite("Idle: ^b" + p.FullName + "^n idle for " + idt.ToString("F0") + " minutes"); if (idt > MaximumIdleSeconds) { plugin.ConsoleWrite("^8Kicking idle player " + p.FullName); plugin.KickPlayerWithMessage(p.Name, KickMessage); } } return false; Cool, i'll give it a try... is there a way to pull time of day from procon? I know Ultimate Map Manager does map rotation dependent on what time it is. EDIT: Still not getting kicked. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted August 11, 2013 Author Share Posted August 11, 2013 Originally Posted by PapaCharlie9*: Jaythegreat1* said: Cool, i'll give it a try... is there a way to pull time of day from procon? I know Ultimate Map Manager does map rotation dependent on what time it is. EDIT: Still not getting kicked. Yes, time of day is easy to get. Details? The point of adding debug_level 4 is so you can provide more information so I can figure out what might be wrong. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted August 11, 2013 Author Share Posted August 11, 2013 Originally Posted by Jaythegreat1*: I had it a 4, but I didn't see anything in the console except for insane limits fetching stats. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted August 12, 2013 Author Share Posted August 12, 2013 Originally Posted by PapaCharlie9*: Jaythegreat1* said: I had it a 4, but I didn't see anything in the console except for insane limits fetching stats.What do you have MaximumIdleSeconds set to? Are you using the idle_whitelist? Is it possible that the players you are checking are whitelisted? Do the idle players have zero score and zero kills? If not, they are skipped and not checked for idle. Try setting debug_level to 0 and use this code. It should show idle time after 2 idle minutes per player. Code: double MaximumIdleSeconds = 10*60; // 10 minutes double MinimumPlayers = 6; String KickMessage = "Idle too long"; if (server.PlayerCount < MinimumPlayers) return false; int level = 2; try { level = Convert.ToInt32(plugin.getPluginVarValue("debug_level")); } catch (Exception e) {} List<PlayerInfoInterface> all = new List<PlayerInfoInterface>(); all.AddRange(team1.players); all.AddRange(team2.players); if (team3.players.Count > 0) all.AddRange(team3.players); if (team4.players.Count > 0) all.AddRange(team4.players); // Track and update idle players foreach (PlayerInfoInterface p in all) { if (plugin.isInList(p.Name, "idle_whitelist") || (!String.IsNullOrEmpty(p.Tag) && plugin.isInList(p.Tag, "idle_whitelist"))) continue; if (p.ScoreRound > 0 || p.KillsRound > 0) continue; double idt = plugin.CheckPlayerIdle(p.Name); if (idt >= 2*60) plugin.ConsoleWrite("Idle: ^b" + p.FullName + "^n idle for " + (idt/60.0).ToString("F0") + " minutes"); if (idt > MaximumIdleSeconds) { plugin.ConsoleWrite("^8Kicking idle player " + p.FullName); plugin.KickPlayerWithMessage(p.Name, KickMessage); } } return false; * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted August 13, 2013 Author Share Posted August 13, 2013 Originally Posted by Jaythegreat1*: I had idle set to 5 minutes, with a 32 player limit for this limit... adaptive server size turns idle kick on with 50 players. Plus, I have tested using my own account being on and off the whitelist. EDIT: Still not seeing anything on plugin console, does debug need to be on 1? EDIT#2: After setting debug to 1.. [22:40:31 93] [insane Limits] Thread(enforcer): Idle: dyobs69 idle for 3 minutes [22:42:32 63] [insane Limits] Thread(enforcer): Idle: dyobs69 idle for 4 minutes [22:43:46 65] [insane Limits] Thread(enforcer): Idle: kdrp idle for 3 minutes * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted August 13, 2013 Author Share Posted August 13, 2013 Originally Posted by PapaCharlie9*: Jaythegreat1* said: EDIT#2: After setting debug to 1.. [22:40:31 93] [insane Limits] Thread(enforcer): Idle: dyobs69 idle for 3 minutes [22:42:32 63] [insane Limits] Thread(enforcer): Idle: dyobs69 idle for 4 minutes [22:43:46 65] [insane Limits] Thread(enforcer): Idle: kdrp idle for 3 minutes Okay, now we are getting somewhere. Next I want to see a player get up to 5 minutes and the kick not happen. Then I should see idle 6 minutes for the same player, right? * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted August 14, 2013 Author Share Posted August 14, 2013 Originally Posted by Jaythegreat1*: So far those are the only samples i've gotten. Idle kick was turned off so players would stay longer than 5 minutes. EDIT: Hmmm... think i've noticed something. You have to have idle kick turned on in the configuration tab. I had it off all day and got nothing . Turned it on when I got home and got this. [18:03:23 10] [insane Limits] Thread(enforcer): Idle: eminit idle for 2 minutes [18:03:23 10] [insane Limits] Thread(enforcer): Idle: whammy765 idle for 2 minutes [18:03:23 10] [insane Limits] Thread(enforcer): Idle: BuLisTiK idle for 2 minutes [18:03:23 10] [insane Limits] Thread(enforcer): Idle: macg4lif3 idle for 2 minutes [18:03:23 10] [insane Limits] Thread(enforcer): Idle: [KU]blackdog1775 idle for 2 minutes [18:03:23 10] [insane Limits] Thread(enforcer): Idle: VonZuHeltzer idle for 2 minutes [18:03:30 42] [insane Limits] Compiling Limit #6 - Idle Kick - OnIntervalServer [18:04:32 88] [insane Limits] Thread(enforcer): Idle: eminit idle for 4 minutes [18:04:32 88] [insane Limits] Thread(enforcer): Idle: whammy765 idle for 4 minutes [18:04:32 88] [insane Limits] Thread(enforcer): Idle: BuLisTiK idle for 4 minutes [18:04:32 88] [insane Limits] Thread(enforcer): Idle: macg4lif3 idle for 4 minutes [18:04:32 88] [insane Limits] Thread(enforcer): Idle: [KU]blackdog1775 idle for 4 minutes [18:04:32 88] [insane Limits] Thread(enforcer): Idle: VonZuHeltzer idle for 4 minutes [18:04:35 57] [insane Limits] Compiling Limit #6 - Idle Kick - OnIntervalServer [18:05:38 31] [insane Limits] Thread(enforcer): Idle: eminit idle for 5 minutes [18:05:38 31] [insane Limits] Thread(enforcer): Idle: whammy765 idle for 5 minutes [18:05:38 31] [insane Limits] Thread(enforcer): Idle: BuLisTiK idle for 5 minutes [18:05:38 31] [insane Limits] Thread(enforcer): Idle: macg4lif3 idle for 5 minutes [18:05:38 31] [insane Limits] Thread(enforcer): Idle: [KU]blackdog1775 idle for 5 minutes [18:05:38 31] [insane Limits] Thread(enforcer): Idle: VonZuHeltzer idle for 5 minutes Perhaps we should switch gears here... maybe take a more simplistic approach. If I could have it turn off idle kick completely from Midnight - 2 PM The next day... then after 2PM only have idle kick ON when the minimum player threshold is reached. That would be grand . * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted August 14, 2013 Author Share Posted August 14, 2013 Originally Posted by PapaCharlie9*: Jaythegreat1* said: Perhaps we should switch gears here... maybe take a more simplistic approach. If I could have it turn off idle kick completely from Midnight - 2 PM The next day... then after 2PM only have idle kick ON when the minimum player threshold is reached. That would be grand . This uses the local time of the Procon instance (layer), so if that is different from your game server, you'll have to make adjustments to startTime and endTime. You can repurpose the old limit. It still is OnIntervalServer, 60 seconds, call it "Idle Time", leave Action set to None. Set first_check to this Code: Code: /* Version V9/R1 */ TimeSpan startTime = new TimeSpan(0,0,1); // midnight is 0 hours, 0 minutes, 1 second TimeSpan endTime = new TimeSpan(14,0,0); // 2pm is 14 hours, 0 minutes, 0 seconds int maxIdleSeconds = 5*60; // 5 minutes of idle time allowed TimeSpan now = DateTime.Now.TimeOfDay; String key = "IdleTimeJustOnce"; bool first = false; if (!plugin.Data.issetBool(key)) { first = true; plugin.Data.setBool(key, false); } bool enabled = false; if ((startTime <= now) && (now < endTime)) { // Disable idle enabled = plugin.Data.getBool(key); if (first || enabled) plugin.ConsoleWrite("^1^bIDLE TIME DISABLED!"); plugin.ServerCommand("vars.idleTimeout", "0"); plugin.Data.setBool(key, false); } else { // Enable idle enabled = plugin.Data.getBool(key); if (first || !enabled) plugin.ConsoleWrite("^1^bIDLE TIME ENABLED!"); plugin.ServerCommand("vars.idleTimeout", maxIdleSeconds.ToString()); plugin.Data.setBool(key, true); } return false; * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted August 15, 2013 Author Share Posted August 15, 2013 Originally Posted by Jaythegreat1*: PapaCharlie9* said: This uses the local time of the Procon instance (layer), so if that is different from your game server, you'll have to make adjustments to startTime and endTime. You can repurpose the old limit. It still is OnIntervalServer, 60 seconds, call it "Idle Time", leave Action set to None. Set first_check to this Code: Code: /* Version V9/R1 */ TimeSpan startTime = new TimeSpan(0,0,1); // midnight is 0 hours, 0 minutes, 1 second TimeSpan endTime = new TimeSpan(14,0,0); // 2pm is 14 hours, 0 minutes, 0 seconds int maxIdleSeconds = 5*60; // 5 minutes of idle time allowed TimeSpan now = DateTime.Now.TimeOfDay; String key = "IdleTimeJustOnce"; bool first = false; if (!plugin.Data.issetBool(key)) { first = true; plugin.Data.setBool(key, false); } bool enabled = false; if ((startTime <= now) && (now < endTime)) { // Disable idle enabled = plugin.Data.getBool(key); if (first || enabled) plugin.ConsoleWrite("^1^bIDLE TIME DISABLED!"); plugin.ServerCommand("vars.idleTimeout", "0"); plugin.Data.setBool(key, false); } else { // Enable idle enabled = plugin.Data.getBool(key); if (first || !enabled) plugin.ConsoleWrite("^1^bIDLE TIME ENABLED!"); plugin.ServerCommand("vars.idleTimeout", maxIdleSeconds.ToString()); plugin.Data.setBool(key, true); } return false; Yeah I found this code last night, do I just need to add an && argument for minimum player requirement during "prime-time" EDIT: Looks like it kicked on Idle kick.. now just gotta see what happens at midnight.. or when the server dips below X players. [18:01:38 02] [insane Limits] IDLE TIME ENABLED! EDIT: #2.... I took a stab at turning it on/off for the player count, think I've got it working. Also... wouldn't it make more sense to have the limit be evaluated by OnServerInterval instead of OnRoundEnd? It could be 20-25 minutes before the server would check again to see if it needs to turn idle on or off. Code: /* Version V9/R1 */ TimeSpan startTime = new TimeSpan(0,0,1); // midnight is 0 hours, 0 minutes, 1 second TimeSpan endTime = new TimeSpan(14,0,0); // 2pm is 14 hours, 0 minutes, 0 seconds int maxIdleSeconds = 5*60; // 5 minutes of idle time allowed int minimumPlayers = 48; TimeSpan now = DateTime.Now.TimeOfDay; String key = "IdleTimeJustOnce"; bool first = false; if (!plugin.Data.issetBool(key)) { first = true; plugin.Data.setBool(key, false); } bool enabled = false; if ((startTime <= now) && (now < endTime) || server.PlayerCount <= minimumPlayers) { // Disable idle enabled = plugin.Data.getBool(key); if (first || enabled) plugin.ConsoleWrite("^1^bIDLE TIME DISABLED for Midnight / Early Hours! or low population!"); plugin.ServerCommand("vars.idleTimeout", "0"); plugin.Data.setBool(key, false); } else { // Enable idle enabled = plugin.Data.getBool(key); if (first || !enabled) plugin.ConsoleWrite("^1^bIDLE TIME ENABLED for Afternoon / Prime-Time!"); plugin.ServerCommand("vars.idleTimeout", maxIdleSeconds.ToString()); plugin.Data.setBool(key, true); } return false; * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted August 15, 2013 Author Share Posted August 15, 2013 Originally Posted by Singh400*: Updated @shownext for R38 Code: /* BF3 friendly map names */ Dictionary<string, string> Maps = new Dictionary<string, string>(); Maps.Add("MP_001", "Grand Bazaar"); Maps.Add("MP_003", "Tehran Highway"); Maps.Add("MP_007", "Caspian Border"); Maps.Add("MP_011", "Seine Crossing"); Maps.Add("MP_012", "Operation Firestorm"); Maps.Add("MP_013", "Damavand Peak"); Maps.Add("MP_017", "Noshahr Canals"); Maps.Add("MP_018", "Kharg Island"); Maps.Add("MP_Subway", "Operation Metro"); // Back to Karkand maps Maps.Add("XP1_001", "Strike at Karkand"); Maps.Add("XP1_002", "Gulf of Oman"); Maps.Add("XP1_003", "Sharqi Peninsula"); Maps.Add("XP1_004", "Wake Island"); // Close Quarters maps Maps.Add("XP2_Factory", "Scrap Metal"); Maps.Add("XP2_Office", "Operation 925"); Maps.Add("XP2_Palace", "Donya Fortress"); Maps.Add("XP2_Skybar", "Ziba Tower"); // Armoured Kill maps Maps.Add("XP3_Desert", "Bandar Desert"); Maps.Add("XP3_Alborz", "Alborz Mountain"); Maps.Add("XP3_Valley", "Death Valley"); Maps.Add("XP3_Shield", "Armoured Shield"); // Aftermath maps Maps.Add("XP4_FD", "Markaz Monolith"); Maps.Add("XP4_Parl", "Azadi Palace"); Maps.Add("XP4_Quake", "Epicenter"); Maps.Add("XP4_Rubble", "Talah Market"); // Endgame maps Maps.Add("XP5_001", "Operation Riverside"); Maps.Add("XP5_002", "Nebandan Flats"); Maps.Add("XP5_003", "Kiasar Railroad"); Maps.Add("XP5_004", "Sabalan Pipeline"); /* BF3 friendly game modes */ Dictionary<string, string> Modes = new Dictionary<string, string>(); Modes.Add("ConquestLarge0", "Conquest Large"); Modes.Add("ConquestSmall0", "Conquest Smalll"); Modes.Add("RushLarge0", "Rush"); Modes.Add("SquadRush0", "Squad Rush"); Modes.Add("SquadDeathMatch0", "Squad Deathmatch"); Modes.Add("TeamDeathMatch0", "Team Deathmatch"); // Back to Karkand modes Modes.Add("ConquestAssaultLarge0", "Conquest Assault"); Modes.Add("ConquestAssaultSmall0", "Conquest Assault"); Modes.Add("ConquestAssaultSmall1", "Conquest Assault"); // Close Quarters modes Modes.Add("Domination0", "Conquest Domination"); Modes.Add("GunMaster0", "Gun Master"); Modes.Add("TeamDeathMatchC0", "TDM Close Quarters"); // Aftermath Kill modes Modes.Add("TankSuperiority0", "Tank Superiority"); // Armoured Kill modes Modes.Add("Scavenger0", "Scavenger"); // Endgame modes Modes.Add("CaptureTheFlag0", "Capture the Flag"); Modes.Add("AirSuperiority0", "Air Superiority"); plugin.ConsoleWrite(plugin.R("%p_n% wants to know the next map")); if(Maps.ContainsKey(server.NextMapFileName) && Modes.ContainsKey(server.NextGamemode)) { string map_msg = "The next map is " + Maps[server.NextMapFileName] + " on " + Modes[server.NextGamemode]; string rnd_msg = "The current round is " + (server.CurrentRound+1) + " of " + server.TotalRounds; plugin.SendGlobalMessage(map_msg); plugin.SendGlobalMessage(rnd_msg); plugin.ServerCommand("admin.yell", map_msg, "8", "player", player.Name); plugin.ServerCommand("admin.yell", rnd_msg, "5", "player", player.Name); } return false;Charlie, I know IL was updated to support this natively, but I couldn't get it to play nice... This code:- Code: plugin.ConsoleWrite("Next map is: " + server.NextMapFileName + " on mode: " + server.NextGamemode);Returned:-Code: Next map is: MP_017 on mode: TeamDeathMatchC0Which isn't player friendly at all. What am I doing wrong? * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted August 15, 2013 Author Share Posted August 15, 2013 Originally Posted by PapaCharlie9*: Jaythegreat1* said: Also... wouldn't it make more sense to have the limit be evaluated by OnServerInterval instead of OnRoundEnd?___? I said to use OnServerInterval. Where did OnRoundEnd come from? I'm not clear on what you are trying to do with the player count. The way you have it, idle kick is enabled only between 2pm and midnight AND players are more than 48. That means that if players are less than 48, idle kick is disabled, regardless of the time. Is that what you meant? * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted August 15, 2013 Author Share Posted August 15, 2013 Originally Posted by PapaCharlie9*: Singh400* said: Which isn't player friendly at all. What am I doing wrong?RTFM! You need to use the plugin.FriendlyMapName() and plugin.FriendlyModeName() functions. Also, you don't need your own map and mode Dictionaries any more. You can use server.MapFileNameRotation and server.GamemodeRotation properties. You can look up the current map/mode using server.MapIndex and the next map/mode using server.NextMapIndex. So to show the next map/mode, you only need one line of code: Code: plugin.ConsoleWrite("Next map is: " + plugin.FriendlyMapName(server.MapFileNameRotation[server.NextMapIndex]) + " on mode: " + plugin.FriendlyModeName(server.GamemodeRotation[server.NextMapIndex])); * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted August 15, 2013 Author Share Posted August 15, 2013 Originally Posted by Singh400*: PapaCharlie9* said: RTFM! You need to use the plugin.FriendlyMapName() and plugin.FriendlyModeName() functions. Also, you don't need your own map and mode Dictionaries any more. You can use server.MapFileNameRotation and server.GamemodeRotation properties. You can look up the current map/mode using server.MapIndex and the next map/mode using server.NextMapIndex. So to show the next map/mode, you only need one line of code: Code: plugin.ConsoleWrite("Next map is: " + plugin.FriendlyMapName(server.MapFileNameRotation[server.NextMapIndex]) + " on mode: " + plugin.FriendlyModeName(server.GamemodeRotation[server.NextMapIndex])); Ah you sexy beast, nice one. I did look through the manual, but I didn't think the functions were in plugin, I was looking in server. My bad. This works great:- Code: plugin.ConsoleWrite("Next map is: " + plugin.FriendlyMapName(server.NextMapFileName) + " on mode: " + plugin.FriendlyModeName(server.NextGamemode));Obviously admins will have to adapt it, I'm just writing to console for test purposes. Edit* This is a template:- Code: plugin.ConsoleWrite(plugin.R("%p_n% wants to know the next map")); String map_msg = "The next map is " + plugin.FriendlyMapName(server.NextMapFileName) + " on " + plugin.FriendlyModeName(server.NextGamemode); String rnd_msg = "The current round is " + (server.CurrentRound+1) + " of " + server.TotalRounds; plugin.SendGlobalMessage(map_msg); plugin.SendGlobalMessage(rnd_msg); plugin.ServerCommand("admin.yell", map_msg, "8", "player", player.Name); plugin.ServerCommand("admin.yell", rnd_msg, "5", "player", player.Name); return false; * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted August 16, 2013 Author Share Posted August 16, 2013 Originally Posted by Jaythegreat1*: PapaCharlie9* said: ___? I said to use OnServerInterval. Where did OnRoundEnd come from? I'm not clear on what you are trying to do with the player count. The way you have it, idle kick is enabled only between 2pm and midnight AND players are more than 48. That means that if players are less than 48, idle kick is disabled, regardless of the time. Is that what you meant? Sorry, I was referring to the original code located here:myrcon.net/...insane-limits-examples#entry18805 It does it have it check at RoundOver... didn't realize you changed that in your latest post . But yes, Regardless of time, idle kick would be disabled. Then from Midnight - 2PM, as long as the server is over 48 players, idle kick would be set at 5 minutes. It seems like it's doing the trick so far! * Restored post. It could be that the author is no longer active. Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.