Giter VIP home page Giter VIP logo

afkkick's Introduction

Afk Kick mod for Minetest by GunshipPenguin

Kicks players after they are Afk for an amount of time. By default, players are kicked after five minutes, although this can be configured.

Licence: CC0 (see COPYING file)

This mod can be configured by changing the variables declared in the start of init.lua. The following is a brief explanation of each one.

MAX_INACTIVE_TIME (default 300)

Maximum amount of time that a player may remain AFK (in seconds) before being kicked.

CHECK_INTERVAL (default 1)

Time between checks for inactivity (In seconds)

WARN_TIME (default 20)

Number of seconds remaining before being kicked that a player will start to be warned via chat message.

afkkick's People

Contributors

gunshippenguin avatar smalljoker avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

afkkick's Issues

Crashes server if using the --terminal option and chat

Hi Rhys,

I have a CTF server and it crashes if I try to chat from the terminal. Not that chatting from the server terminal make sense however if I miss-type the / and hit enter, the server crashes.

I have compiled the server with ncurses enabled and am launching the server with the --terminal option. This gives me the ability to run commands from the terminal. Read the wiki document for more detail.

Technically it is not your mod that is causing the issue, it is a copy of it over into the CTF mod however it looks like the same line of code will cause issues in this mod.

The reported issue in the CTF game is on this line: https://github.com/MT-CTF/capturetheflag/blob/b1aa1366f40b099f878edbfcf5c1a6af5d8fd258/mods/other/afkkick/init.lua#L32

That translates to this line within this mod:

players[playerName]["lastAction"] = minetest.get_gametime()

Here is the error message on the console:

2020-05-08 11:55:39: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'afkkick' in callback on_chat_message(): .../../games/capturetheflag/mods/other/afkkick/init.lua:32: attempt to index field '?' (a nil value)
2020-05-08 11:55:39: ERROR[Main]: stack traceback:
2020-05-08 11:55:39: ERROR[Main]: 	.../../games/capturetheflag/mods/other/afkkick/init.lua:32: in function '?'
2020-05-08 11:55:39: ERROR[Main]: 	/minetest/ctf/bin/../builtin/game/register.lua:429: in function </minetest/ctf/bin/../builtin/game/register.lua:413>

I imagine the issue is that there is no player logged in because it is from ther terminal, so the playername values will be null.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.