Skip to content

FCDB auth.get_username has incorrect parameter type #2877

Description

@XHawk87

Describe the bug
There is an error while attempting to get the username of the connecting client when they join the server that prevents them joining while authentication via sqlite database is active using the standard database.lua.

To Reproduce
Steps to reproduce the behavior:

  1. Follow the instructions in the manual for setting up an sqlite database.
  2. Attempt to connect to the server.
  3. Observe error in console log.

Expected behavior
The function should return the username of the connecting client without error.

Console logs

[critical] freeciv21-server (/usr/src/freeciv21/server/scripting/script_fcdb.cpp:332) - stack index 1, expected userdata, received tolua.Connection: value at this index does not properly reflect the desired type (bad argument into 'const char*(server_connection*)')
stack traceback:
	[C]: in field 'get_username'
	/home/freeciv21/.config/freeciv21/database.lua:131: in function 'user_exists'

Platform and version (please complete the following information):

  • OS: Debian
  • Freeciv21 version: 3.2-dev (f2eca12)
  • Ruleset/Longturn game (if applicable): CTF

Additional context
See discord discussion

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingluaIssues related to our Lua scriptcoreserverThis issue requires changes to the server

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions