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

Crashes server if using the --terminal option and chat #4

Open
grantcarthew opened this issue May 8, 2020 · 2 comments
Open

Crashes server if using the --terminal option and chat #4

grantcarthew opened this issue May 8, 2020 · 2 comments

Comments

@grantcarthew
Copy link

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.

@grantcarthew
Copy link
Author

I've raised a cross issue on the CTF server repo.

MT-CTF/capturetheflag#623

Beanzilla pushed a commit to Beanzilla/afkkick that referenced this issue Jul 22, 2021
  It was found that in the CTF repo they fixed this issue... but we just
simply didn't apply the fix they did.

  This was fixed in their repo as issue [623](MT-CTF/capturetheflag#623)
@Beanzilla
Copy link

It appears that they made a fix to this... and we just needed to add their fix to our code.

My PR should fix this.

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

No branches or pull requests

2 participants