otland / forgottenserver

A free and open-source MMORPG server emulator written in C++
https://otland.net
GNU General Public License v2.0
1.55k stars 1.04k forks source link

[Bug]: Cant login to game world - "Malformed session key." #4739

Closed ArturKnopik closed 1 month ago

ArturKnopik commented 1 month ago

By submitting this bug issue, you agree to the following.

Does this bug crash tfs?

no

Server Version

1.5 (Development)

Operation System

Windows

OS Description

No response

Bug description

Cant login to game world, returns

Possible Pull Requests which are to blame

N/A

Steps to reproduce

  1. Use Windows 10/11
  2. Setup ENV
  3. Run client 13.1
  4. Try login

Actual Behavior

Zrzut ekranu 2024-06-06 152955 Character not enter to game world.

Expected Behavior

Character enter to game world.

Backtrace

No response

Additional Notes

Release build (debug is not working)

Zrzut ekranu 2024-06-06 152352 Zrzut ekranu 2024-06-06 152725 Client: Zrzut ekranu 2024-06-06 153013

ranisalt commented 1 month ago

You are using a third-party login server that needs to be updated to store session tokens in the sessions table.

You can drop that now and use the embedded login server by configuring it in config.lua

ArturKnopik commented 1 month ago

TY, i will check it!

ArturKnopik commented 1 month ago

update, tested on latest MyAcc and i got the same issue..

ranisalt commented 1 month ago

MyAAC needs to store in the database and Base64-encode the key before sending to the client, around here: https://github.com/slawkens/myaac/blob/81b6652738a7b04be3980cbf55443a6fbe437b34/login.php#L226-L243

ArturKnopik commented 1 month ago

To be honest, i used znote acc for a while and it's work without issue until openssl changes... i tested on another(MyAcc release from last last week) accmakert to check if this is my fault. Maybe someone can provide 13.1 client for test.

ArturKnopik commented 1 month ago

I found source of problems 1) invalid setup for port (in my case should be 80 instead 8080 for http server) 2) probably bronek schema.sql (session table)

I want to add information about my env, im using xampp to setup DB Probably xampp reinterpretate invalid query to something valid(if can) in this case session table is broken (image from mysql execution) image xampp probably is trying to fix this issue by set default value for expired_at as 0000-00-00 00:00:00 but tfs is expecting this value as null, when i manualy changed this record to set default value as null it's start working

ranisalt commented 1 month ago

What version of XAMPP are you using?

ArturKnopik commented 1 month ago

image reinstalled 2 or 3 days ago, i assume this may be the source of the problem