Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

admin2: Add resource settings cache #198

Closed
wants to merge 1 commit into from
Closed

admin2: Add resource settings cache #198

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented May 21, 2020

As suggested in #162 i've added caching for resource settings.

Copy link
Contributor

@qaisjp qaisjp left a comment

Choose a reason for hiding this comment

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

Issue #162 seems to be talking about preventing repeated reads for settings related to the admin resource.

Shouldn't we only be caching the admin resource's settings? I think it's fine to fetch fresh settings when using the settings editor.

Although admin2 has these (and only actually reads the consolecommands setting).

<settings>
<setting name="#pingkicker" value="0"
group="Automatic scripts"
friendlyname="Ping kicker"
accept="0-1000"
desc="Max ping allowed (0 - off)"
/>
<setting name="#fpskicker" value="0"
group="Automatic scripts"
friendlyname="FPS kicker"
accept="0-100"
desc="Lowest fps allowed: 25-75 (0 - off)"
/>
<setting name="#idlekicker" value="0"
group="Automatic scripts"
friendlyname="Idle Kicker"
accept="0-100"
desc="Maximum time a player can stay idle (minutes, 0 - off)."
/>
<setting name="#consolecommands" value="[true]"
group="General"
friendlyname="Enable console commands"
accept="[true],[false]"
desc="Parse console commands."
/>
</settings>

And admin1 has many more (I haven't checked if they are actually in use):

<settings>
<!-- *****************************************************
All these settings are adjustable in the Admin Panel:
1. start admin
2. press 'p'
3. select Resources tab
4. double click on the resource name
***************************************************** -->
<setting name="*maxmsgs" value="99"
friendlyname="Max messages"
accept="1-1000"
desc="Maximum admin messages to keep."
/>
<setting name="*bandurations" value="60,3600,43200,0"
friendlyname="Ban durations"
group="Durations"
examples="60,360,0"
desc="Duration options for the ban window. Comma seperated list in seconds. 0 means no duration limit."
/>
<setting name="*mutedurations" value="60,120,300,600,0"
friendlyname="Mute durations"
group="Durations"
examples="60,360,0"
desc="Duration options for the mute window. Comma seperated list in seconds. 0 means no duration limit."
/>
<setting name="*securitylevel" value="1"
friendlyname="Security level"
group="_Advanced"
accept="0-2"
desc="Detect fake admin packets. 0-No checks 1-Some checks 2-All checks."
/>
<setting name="*clientcheckban" value="false"
friendlyname="clientcheckban"
group="_Advanced"
accept="true,false"
desc="Ban IP's that attempt to send fake admin packets."
/>
<setting name="*useip2c" value="true"
friendlyname="useip2c"
group="_Advanced"
accept="true,false"
desc="Displays country flags next to players, set to false to save about 3MB of server RAM."
/>
<setting name="*nickChangeDelay" value="5000"
friendlyname="Nick change delay"
group="Durations"
accept="500-60000"
desc="Time in miliseconds between a player being able to change their name to prevent nick change spam"
/>
<setting name="*maxchatmsgs" value="10"
friendlyname="Max chat log messages"
accept="1-1000"
desc="Maximum chat log messages per player to store. Decreasing this value may save some of server RAM."
/>
<setting name="*reportCategories" value="Question,Suggestion,Other"
friendlyname="Report categories"
desc="List of non player report categories."
/>
<setting name="*playerReportCategories" value="Cheater/Modder,Spammer"
friendlyname="Player report categories"
desc="List of report categories for reporting players."
/>
</settings>

Other style stuff:

  • your patch uses tabs, but it should use spaces
  • blank lines should be empty / not contain any whitespace
  • please add a space after the if keywords - if (...) then, not if(...) then

@jlillis
Copy link
Contributor

jlillis commented Nov 10, 2020

The user who opened this PR has deleted their account. Given the unresolved feedback and current merge conflicts, I'm going to close this now.

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

Successfully merging this pull request may close these issues.

3 participants