Jump to content

Insane Limits Requests


ImportBot

Recommended Posts

Originally Posted by DownArrowMagnet*:

 

No worries and yep you're right, the thread wouldn't need to worry about clearing the flag provided you don't want the possibility of a new thread running when the old ends.

Yep. The main limit is OnIntervalServer at 30 or 60 seconds, and that's the one that does the check, then starts the thread if needed to monitor the condition, countdown, and take action if the countdown ends. The thread and that limit use setObject and issetObject to make sure that only one thread ever is running at a time. And the thread clears the object "lock" if it exits on its own.

 

If the thread ever happened to sleep all the way through the between-round time and into another round, it would terminate naturally at the next check, because all the numbers it monitors would be reset, so the problem condition would no longer exist. It's possible, but probably unlikely, that it ever would sleep through past the start of the next round, since it never sleeps more than 60 seconds. Worst case it will wake up sometime very early in the new round and then just exit when it checks the current state and finds nothing amiss.

 

That said . . .

 

. . . now that I have realized that the plugin.Data interface is available, I think I may not need to use a background thread at all. I probably could collapse the thread's work directly into the OnIntervalServer limit, and just use a flag to track whether it is "alerted" or not. And then that limit could just do nothing and skip out if the between round lockout flag is set.

* Restored post. It could be that the author is no longer active.
Link to comment
  • Replies 3.2k
  • Created
  • Last Reply

Originally Posted by DownArrowMagnet*:

 

Can someone help me figure out why this code in a limit:

Code:

//
// Round Stats Logger
//
// 1. Make a new limit with trigger OnRoundOver
// 2. Set first_check to Code and insert the code below
// 

using MySql.Data.MySqlClient;

return false;
Generates this error:

 

Code:

[20:59:19 12] [Insane Limits] ERROR: (CS1003, line: 34, column: 19):  Syntax error, '(' expected
[20:59:19 12] [Insane Limits] ERROR: (CS1026, line: 34, column: 41):  ) expected
I'm trying to just make a simple limit that triggers OnRoundOver and logs a bit of data to my database, but I'm baffled as to why the using statement is causing a compile error. If I try just the basic connection code without the using, then the compiler gripes about a namespace and asks if I'm missing it. If I put the using statement in, then I get this weird error about missing parens.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by DownArrowMagnet*:

 

You can't use using from a limit, unfortunately.

Ah. That's what I suspected. I wound up making a tiny little plug-in to do it, which seems to be working ok.

 

Is it correct that there isn't a way to access a MySQL database from within a limit then?

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

Originally Posted by LCARSx64*:

 

Ah. That's what I suspected. I wound up making a tiny little plug-in to do it, which seems to be working ok.

 

Is it correct that there isn't a way to access a MySQL database from within a limit then?

Actually, I'm not sure, I've been looking at this myself. If I figure out a way then I'll let you know. :ohmy:
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by bckrv*:

 

Hello.

I am looking to rent a knife server and put a special rules against abuser, for this I would like introduce a limit for spawnkiller.

 

I give an exemple; "Player A" was killed by "Player B", "Player C" revive "Player A" but "Player B" killed him directly after rez with defib or knife, and doing this 4-6 times, he literally raped "Player A".

 

Two questions: :cool:

 

1.Is possible to limit defibrillator kill during few seconds when the player is rez? The player who abuse is directly punished by kill?

 

2.Is possible to limit defibrillator kill time during few seconds, like 2-3 secondes? The player who abuse is directly punished by kill?

 

Thanks for your support.

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

Originally Posted by Wiggles*:

 

hi

 

i have this code for kicking when using the n-word. it works great, even works when someone misspelled engineer (quite badly though).

 

Code:

List<String> bad_words = new List<String>();
	
	bad_words.Add(@"n+[1i]+g+[3ea]+r*");
	
	    foreach(String bad_word in bad_words)
		    if (Regex.Match(player.LastChat, bad_word, RegexOptions.IgnoreCase).Success)
			{
        plugin.SendGlobalMessage("Kicked for racism!");
        plugin.PRoConChat("^2Insane Limits - ^7Bad Word Kicker ^2> ^8" + player.Name + ": ^0Kicked for racism!");
	    plugin.KickPlayerWithMessage(player.Name, plugin.R("Kicked for racism!"));
			}	
			
	return false;
what i was wondering is it possible to make several "lists" of words with different "actions" based on each list? i also wanted it to be easily scaleable so i could add/remove without much changing of the code (ie different messages or punishments)

 

what i was thinking was, lets say, "list a", "list b", "list c", and "list d" where "a" is warning, "b" is warning then kill, "c" is kill then kick, and "d" is straight kick. i also want it to have a "memory" for some time (ie 6 hrs) so that during each session (rather than map or forever) they get a fresh "start".

 

is this possible to have in one limit or would it need a limit for each?

 

also is it possible to have a white list for just this limit (or for a list) (for admining) rather than the entire plugin?

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

Originally Posted by DownArrowMagnet*:

 

Arrow, what information are you logging?

I just uploaded my plugin to the approvals forum actually. It logs some basic round stats: Round ended time and duration; map name and game mode; winning team ID; and the ticket count, scores, kills, deaths, and number of players for each team.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ColColonCleaner*:

 

Yeah, sorry. I edited to actually answer your question.

Interesting. That's right, stat logger doesn't log some of that information at round end, just a few basic things. Good idea.

 

Are you running AdKats? If so, look at the tbl_extendedroundstats table that was released with this latest version. It logs a lot of the extra stuff you mentioned, but does it throughout the round so the data can be plotted. I don't think i included kills and deaths though.

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

Originally Posted by DownArrowMagnet*:

 

Are you running AdKats? If so, look at the tbl_extendedroundstats table that was released with this latest version. It logs a lot of the extra stuff you mentioned, but does it throughout the round so the data can be plotted. I don't think i included kills and deaths though.

Interesting. I looked at AdKats before, but I didn't notice that. I'll take a look.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

. . . now that I have realized that the plugin.Data interface is available, I think I may not need to use a background thread at all. I probably could collapse the thread's work directly into the OnIntervalServer limit, and just use a flag to track whether it is "alerted" or not. And then that limit could just do nothing and skip out if the between round lockout flag is set.

That's right. OnIntervalServer already has a long-lived thread behind it. You can use it for any kind of timed control, communicating to it through plugin.Data, server.RoundData, etc.

 

Most interval based timer actions can be handled with OnIntervalServer, unless you need timing less than 10 seconds, which is the minimum allowed (to prevent naive users creating dozens of limits with sub-second timing and flooding the CPU).

 

Limits are class methods, wrapped in method signatures for First_Check and Second_Check. So you can only use code that is legal in the body of a method. That's why using doesn't compile. You can used fully specified names, like System.Data.DataTable, etc., as long as the plugin compiler includes that assembly.

 

Here are the compiler params used by Insane Limits:

 

Code:

private CompilerParameters GenerateCompilerParameters()
        {

            CompilerParameters parameters = new CompilerParameters();
            parameters.ReferencedAssemblies.Add("System.dll");
            parameters.ReferencedAssemblies.Add("System.Data.dll");
            parameters.ReferencedAssemblies.Add("System.Windows.Forms.dll");
            parameters.ReferencedAssemblies.Add("System.Xml.dll");
            //parameters.ReferencedAssemblies.Add("System.Linq.dll");
            if (game_version == "BF4")
                parameters.ReferencedAssemblies.Add("Plugins/BF4/InsaneLimits.dll");
            else
                parameters.ReferencedAssemblies.Add("Plugins/BF3/InsaneLimits.dll");

            parameters.GenerateInMemory = true;
            parameters.IncludeDebugInformation = false;

            String procon_path = Directory.GetParent(Application.ExecutablePath).FullName;
            String plugins_path = Path.Combine(procon_path, Path.Combine("Plugins", "BF3"));

            parameters.TempFiles = new TempFileCollection(plugins_path);
            //parameters.TempFiles.KeepFiles = false;


            return parameters;
        }
Hmm, just noticed that all temp files go into BF3. Guess it doesn't matter, since they are temp files.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

Hello.

I am looking to rent a knife server and put a special rules against abuser, for this I would like introduce a limit for spawnkiller.

 

I give an exemple; "Player A" was killed by "Player B", "Player C" revive "Player A" but "Player B" killed him directly after rez with defib or knife, and doing this 4-6 times, he literally raped "Player A".

 

Two questions: :cool:

 

1.Is possible to limit defibrillator kill during few seconds when the player is rez? The player who abuse is directly punished by kill?

 

2.Is possible to limit defibrillator kill time during few seconds, like 2-3 secondes? The player who abuse is directly punished by kill?

 

Thanks for your support.

BF3 or BF4?

 

1) No, it is not possible to determine that a player was rez'd.

 

2) It is possible to limit consecutive Defib kills within a specified number of seconds.

 

I'm going to assume the weapon code for defibrillator kill is Defib. If it is something else, like Death, this won't work.

 

Create a limit to evaluate OnKill, call it "No defib spawnkils".

 

Set first_check to this Code:

 

Code:

double Seconds = 60; // CHANGE, number of seconds between Defib kills must be more than this

String key = "LastKillWeapon";
String last = null;
double ut = 0;
if (killer.RoundData.issetString(key))
    last = killer.RoundData.getString(key);
killer.RoundData.setString(key, kill.Weapon);
if (killer.RoundData.issetDouble(key))
    ut = killer.RoundData.getDouble(key);
killer.RoundData.setDouble(key, server.TimeRound);
if (last == null || !last.Contains("Defib") || !kill.Weapon.Contains("Defib"))
    return false;
double elapsedTime = server.TimeRound - ut;
if (elapsedTime > Seconds)
    return false;
// Otherwise, two Defib kills in a row in less than Seconds
return true;
Set Action to whatever punishment actions you want, Say, Yell, Kick, etc.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by LCARSx64*:

 

Papa, is there any chance you could officially add the following line to Insane Limits?

Code:

private CompilerParameters GenerateCompilerParameters()
        {

            CompilerParameters parameters = new CompilerParameters();
            parameters.ReferencedAssemblies.Add("System.dll");
            parameters.ReferencedAssemblies.Add("System.Data.dll");
            parameters.ReferencedAssemblies.Add("System.Windows.Forms.dll");
            parameters.ReferencedAssemblies.Add("System.Xml.dll");
            //parameters.ReferencedAssemblies.Add("System.Linq.dll");
            parameters.ReferencedAssemblies.Add("MySql.Data.dll");
            if (game_version == "BF4")
                parameters.ReferencedAssemblies.Add("Plugins/BF4/InsaneLimits.dll");
            else
                parameters.ReferencedAssemblies.Add("Plugins/BF3/InsaneLimits.dll");

            parameters.GenerateInMemory = true;
            parameters.IncludeDebugInformation = false;

            String procon_path = Directory.GetParent(Application.ExecutablePath).FullName;
            String plugins_path = Path.Combine(procon_path, Path.Combine("Plugins", "BF3"));

            parameters.TempFiles = new TempFileCollection(plugins_path);
            //parameters.TempFiles.KeepFiles = false;


            return parameters;
        }
It would allow MySQL Database access from a limit.

I've tested this and it works, the MySql.Data.dll is included with Procon.

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

Originally Posted by PapaCharlie9*:

 

Papa, is there any chance you could officially add the following line to Insane Limits?

Code:

private CompilerParameters GenerateCompilerParameters()
        {

            CompilerParameters parameters = new CompilerParameters();
            parameters.ReferencedAssemblies.Add("System.dll");
            parameters.ReferencedAssemblies.Add("System.Data.dll");
            parameters.ReferencedAssemblies.Add("System.Windows.Forms.dll");
            parameters.ReferencedAssemblies.Add("System.Xml.dll");
            //parameters.ReferencedAssemblies.Add("System.Linq.dll");
            parameters.ReferencedAssemblies.Add("MySql.Data.dll");
            if (game_version == "BF4")
                parameters.ReferencedAssemblies.Add("Plugins/BF4/InsaneLimits.dll");
            else
                parameters.ReferencedAssemblies.Add("Plugins/BF3/InsaneLimits.dll");

            parameters.GenerateInMemory = true;
            parameters.IncludeDebugInformation = false;

            String procon_path = Directory.GetParent(Application.ExecutablePath).FullName;
            String plugins_path = Path.Combine(procon_path, Path.Combine("Plugins", "BF3"));

            parameters.TempFiles = new TempFileCollection(plugins_path);
            //parameters.TempFiles.KeepFiles = false;


            return parameters;
        }
It would allow MySQL Database access from a limit.

I've tested this and it works, the MySql.Data.dll is included with Procon.

Well, I initially said yes, but the more I thought about it, the more I worried. That may cross a couple of lines that maybe shouldn't be crossed.

 

One is the on-going concern that Insane Limits inhibits creation of new plugins. For a lot of cases, such as plugins where the core feature code is less than a couple dozen lines, that's actually a good thing. Who needs a dozen plugins that kick for bad language or for having a KDR that's too high? But for a lot of other cases, like generally useful large-scale utilities (cheat detectors, team balancers, teamspeak synchronizers, stats collectors), it's bad for the community as a whole for that code to end up as Insane Limits instead of plugins that everyone would benefit from.

 

The other is support. If I add the MySql.Data assembly, I'll have to support it, and I don't know squat about MySQL. Even with the things I know about, like HttpWebRequest, I'd almost wish that wasn't supported, given the problems people have using it incorrectly in the context of Insane Limits or the abuses people have but the plugin through.

 

Let me think about it some more, and of course if other people have feedback, let's hear it.

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

Originally Posted by LCARSx64*:

 

Thanks for considering this Papa. You do make some valid points. That being said, I have never written a plugin and honestly I find it a bit overwhelming. I will have a crack at it eventually but until then, I have limits.

 

As an example of my reason for wanting this, say I wanted to track data from some servers, and possibly even Insane Limits itself, then display that data on a website.

A rather simplified (and definitely not the best) example would be as follows:-

 

Say I have 5 different BF4 servers, each restarts every 24 hours. I want to track all of the following for a month:

 

  • All players joining the servers.
  • Who joins each server the most frequently.
  • Which clan joins most frequently.
  • Which role have they joined as most frequently.
  • Which country each is from.
  • What is their highest score in each server.
  • How many times has each activated a specific limit (eg. a weapon restriction limit).

As it is now, I'd have to collect this data per server then:

 

  • Save it to a file on the layer each day, remembering that's per server.
  • Load the file every restart per server.
  • Track the number of days and/or months per server.
  • At the end of the required period, upload each of those saved files to my web host.
  • Delete the files on the layer.
  • Regularly check for the uploaded data on the web host.
  • Extact the data per file and display it.
  • If it's a new start of the period, clear the data in the database.

Using a database:

 

  • I'd only have to update the data if needed (e.g. join count, score if higher).
  • The webhost could then run a scheduled script which would retrieve the data directly from the database.
  • Display the data.
  • If required, clear the data.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by DownArrowMagnet*:

 

Let me think about it some more, and of course if other people have feedback, let's hear it.

I would say, as to the balance between plugins and limits (and speaking as someone who has written semi-non-trivial instances of each for my own purposes now), that I don't see much of a conflict between the two. The choice should be based more on the scale and hardness of the problem, rather than that one has the pieces you need and the other doesn't.

 

Hard problems and big problems should be solved with plugins, by people who know what they're doing, and most often will be addressed to solving those problems for the general case.

 

Small problems and easy problems could be solved with a plugin, but often will be better solved with a limit, and, more important, could be solved with a limit a lot more often by the person who actually has the problem, just for their special case.

 

I don't think whether a problem needs a database to solve is a good of bigness or hardness. Lots of small and easy problems involve stuffing something into someplace where we can get it back again later.

 

On the other hand, if you can't figure out how to make a respectable plugin, how likely is it that you have any clue what SQL is, or how to use it to do things to a database without winding up sticking yourself in the eye with the pointy bits?

 

I wrote my little toy Round Stats Logger as a plugin because it could not be done as a limit. But does being a plugin make it better? I doubt it. As a plugin it's probably on the extreme lower bound of even being worth making, or using. As a limit, it would not have seemed overgrown at all. And the limit code would have been a lot shorter, so I would have had less chances to get it wrong.

 

I also can appreciate your concern that if you add it, then you have to support it. But there is a pretty huge gain in utility from that one line of code, assuming as a limit writer you know that it's there and what to do with it.

 

Maybe the best solution would be, add that one line of code, but comment it out. And don't document it. Ever. Anywhere.

 

The nice thing about C# is that everyone who uses IL has full source code access, so those who know what they're doing can easily turn the DB access on by uncommenting one line of code. And if they do, then they know they're enabling an unsupported feature, and they're on their own. If you can reach that switch, then you probably know what to do once you've flipped it.

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

Originally Posted by LCARSx64*:

 

On the other hand, if you can't figure out how to make a respectable plugin, how likely is it that you have any clue what SQL is, or how to use it to do things to a database without winding up sticking yourself in the eye with the pointy bits?

While I agree with the majority of your reply and thank you for it, I'm sorry, but I find this quoted section to be a rather inaccurate assumption. Believe it or not, C# is a relatively new language to me, in fact, if you look back at my earliest code postings on the forums, they are my very first attempts at C# coding and personally, I don't think I'm doing too badly so far. Now does this mean I have no idea about SQL? Of course not, it simply means I don't have vast knowledge of C# yet. A person that can code in one language can not automatically code in another. For instance, if I were a C++, JS, PHP, ASM or even Basic coder, sure I may be able to look at C# code and get the gist of it but that doesn't mean I completely understand the code nor does it mean I know nothing about it or some other language. Please don't take this is as any kind of disrespect, that is not my intention, I am simply trying to make a point. :smile:
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by DownArrowMagnet*:

 

While I agree with the majority of your reply and thank you for it, I'm sorry, but I find this quoted section to be a rather inaccurate assumption. Believe it or not, C# is a relatively new language to me, in fact, if you look back at my earliest code postings on the forums, they are my very first attempts at C# coding and personally, I don't think I'm doing too badly so far. Now does this mean I have no idea about SQL? Of course not, it simply means I don't have vast knowledge of C# yet. A person that can code in one language can not automatically code in another. For instance, if I were a C++, JS, PHP, ASM or even Basic coder, sure I may be able to look at C# code and get the gist of it but that doesn't mean I completely understand the code nor does it mean I know nothing about it or some other language. Please don't take this is as any kind of disrespect, that is not my intention, I am simply trying to make a point. :smile:

I see the dividing line between limits and plugins in terms of accessibility being this.

 

Anyone who has done even a little bit of scripting with a language as simple as Perl or PHP can muddle through writing a limit. It's the sort of linear, direct style of coding that someone who ever has done a little bit of casual system administration probably has done at some point, in some utility language.

 

But I don't think you will have an easy time figuring out even where to start with a plugin unless you have experience coding with at least one object-based language in an event driven application environment.

 

I didn't have too much trouble figuring out how to make a working plugin, at least starting from PapaCharlie9's hello world example. And I had zero knowledge of C# before I started on that. But I also was starting from a baseline of a decade doing system admin and DBA work, as well as a ton of front end and back end application programming in a dozen different languages. I had to look up the syntax and read some of the Procon source code, but I knew what I was looking for and what it would look like when I found it.

 

Anyone who has ever done a little bit of database maintenance or even used the advanced features of Microsoft Access probably knows what INSERT and SELECT do, but I assume that most people that know even a little about SQL don't just know that; they usually know it because they've written applications in some programming or scripting language that had to connect to a database.

 

There are plenty of dedicated DBAs out there and probably a lot of people who know SQL backwards and forwards who have never had the need to program in any object based language. But I assume that most of the people who have the minimal SQL knowledge needed to make a table and put stuff in it have that because they needed it at some point in their programming work. And I assume that most programmers working today will have been forced to use at least one object language at some point.

 

I'm just saying, I think limits are accessible to the 80% of people who have had any job at some point in their lives where they were "the computer guy" and have done even a little bit of non-trivial utility scripting. Plugins are only going to be easy to figure out for the 20% who have been working programmers at some point, and maybe not for all of them, depending on what they've done before.

 

And I think there is value in people who have access to one toolbox but maybe not the other still having a full set of tools to work with.

 

On the other hand, in the entire world, how many people are there that actually care about using MySQL from within Insane Limits, or even know that they want it? You and me might be every single one of them. And since you figured out how, now we both know how to do it by adding one line to the source code.

 

That might be all the solution this problem ever needs. :smile:

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

Originally Posted by ColColonCleaner*:

 

We are running modded versions of several plugins on our layers. We like using official versions though so that is why we request additions and enhancements to the official code of plugins, instead of just running directly to modding them for our purposes.

 

In the end it's a conflict between what you specifically need vs. what's best for all users of the plugin. And that's the call of the plugin's main dev.

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

Originally Posted by PapaCharlie9*:

 

Thanks for the feedback, keep it coming.

 

On the other hand, if you can't figure out how to make a respectable plugin, how likely is it that you have any clue what SQL is, or how to use it to do things to a database without winding up sticking yourself in the eye with the pointy bits?

This caught my attention as well, but for a different reason. The likelihood is higher than you might expect, based on past experience. For example, I've added multihreaded code to several of the limits I've written for other people by request. Other people have trolled through all the written limits to customize for their own uses. That's a good thing ... until someone who has little or no coding skills tries to cut & paste their custom limit together. Then my inbox (literally, my inbox, despite my signature) fills with pleas for help. Now, while that situation is bad, I don't plan to remove the threaded examples, or HTTP requests, or anonymous delegates, or other more advanced stuff I've used, just to avoid these sorts of headaches. But I'm not all that thrilled about offering yet another hammer that people can hit me on the head with.

 

BTW, I like the idea of a secret, advanced, enabled only for l33t, option. It will be part of the official release, but disabled for everyone's safety. And to save myself time, I can just figure out all of the assemblies Procon links to, and offer all of them, so I don't have to revisit this by ones and twos.

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

Originally Posted by ColColonCleaner*:

 

BTW, I like the idea of a secret, advanced, enabled only for l33t, option. It will be part of the official release, but disabled for everyone's safety. And to save myself time, I can just figure out all of the assemblies Procon links to, and offer all of them, so I don't have to revisit this by ones and twos.

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

Originally Posted by LCARSx64*:

 

BTW, I like the idea of a secret, advanced, enabled only for l33t, option. It will be part of the official release, but disabled for everyone's safety. And to save myself time, I can just figure out all of the assemblies Procon links to, and offer all of them, so I don't have to revisit this by ones and twos.

That sounds sweet! :biggrin:
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by bckrv*:

 

BF3 or BF4?

 

1) No, it is not possible to determine that a player was rez'd.

 

2) It is possible to limit consecutive Defib kills within a specified number of seconds.

 

I'm going to assume the weapon code for defibrillator kill is Defib. If it is something else, like Death, this won't work.

 

Create a limit to evaluate OnKill, call it "No defib spawnkils".

 

Set first_check to this Code:

 

Code:

double Seconds = 60; // CHANGE, number of seconds between Defib kills must be more than this

String key = "LastKillWeapon";
String last = null;
double ut = 0;
if (killer.RoundData.issetString(key))
    last = killer.RoundData.getString(key);
killer.RoundData.setString(key, kill.Weapon);
if (killer.RoundData.issetDouble(key))
    ut = killer.RoundData.getDouble(key);
killer.RoundData.setDouble(key, server.TimeRound);
if (last == null || !last.Contains("Defib") || !kill.Weapon.Contains("Defib"))
    return false;
double elapsedTime = server.TimeRound - ut;
if (elapsedTime > Seconds)
    return false;
// Otherwise, two Defib kills in a row in less than Seconds
return true;
Set Action to whatever punishment actions you want, Say, Yell, Kick, etc.
Hello Papa,

 

Thanks for your reply.

 

It is for BF3.

 

About time, if want limit every 10 secondes, I have to change this code: "double Seconds = 10; // CHANGE, number of seconds between Defib kills must be more than this"is right?

 

Another question, if I want add a message when a player abuse defibrillator, like "Don't abuse defibrillator - Limit 10 sec per kill" how I can do?

 

Thanks for your support.

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

Originally Posted by DownArrowMagnet*:

 

I would like to log a single line of information to a file on my layer server from within a limit, each time the limit takes a certain action, and I wonder if this code will do what I expect:

 

Code:

plugin.Log("mylogfile.csv", msg);
Will that write to "mylogfile.csv" in the plugin directory? Or will it put it somewhere else?

 

Is the default directory path that this log file would wind up in typically writeable from within a limit, or do I need to use some other specific directory path that is writeable?

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

Originally Posted by PapaCharlie9*:

 

I would like to log a single line of information to a file on my layer server from within a limit, each time the limit takes a certain action, and I wonder if this code will do what I expect:

 

Code:

plugin.Log("mylogfile.csv", msg);
Will that write to "mylogfile.csv" in the plugin directory? Or will it put it somewhere else?

 

Is the default directory path that this log file would wind up in typically writeable from within a limit, or do I need to use some other specific directory path that is writeable?

The first parameter is a path relative to the application .exe location, e.g., if you have procon.exe in ~/procon, then plugin.Log("mylogfile.csv", msg) will be ~/procon/mylogfile.csv. The path may also be an absolute path, like "/Users/xxx/foo.txt". I don't think you can specify a disk, though (the plugin tests the first parameter with Path.IsPathRooted).

 

Best practice is to use this code to form the path:

 

Code:

String logName = Path.Combine("Logs", Path.Combine(server.Host + "_" + server.Port, DateTime.Now.ToString("yyyyMMdd") + "_mylogfile.csv"));
plugin.Log(logName, msg);
That insures that the log file is deposited in the appropriate Log folder for a specific connection, and that it is log rolled for each date, just like plugin.log and console.log and chat.log, etc.
* 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.