Skip to content

Say why the login was refused when the client quits on it - #48

Open
Sosotess93 wants to merge 1 commit into
NosCoreIO:mainfrom
Sosotess93:fix/login-refused-message
Open

Sosotess93 wants to merge 1 commit into
NosCoreIO:mainfrom
Sosotess93:fix/login-refused-message

Conversation

@Sosotess93

Copy link
Copy Markdown

Fixes #28.

Problem

On some refusals, the client shows nothing. For a banned account (failc 7) it hides its main window and exits: the port log shows ShowWindow ... 0, WinHelpA cmd=2 (the VCL's normal shutdown), then guest ExitProcess(0). There is no message box call to catch, and the page is left black.

Refusals the client handles itself are fine. A wrong password (failc 5), for example, shows the client's own "Your account name or password is incorrect" box and keeps running.

Change

  • rt_port.c: the login-packet hook posts {type: 'login-refused', code} for every failc the client receives, whether or not the packet log is on.
  • index.html: when the game exits after such a refusal, the page shows a "Login refused" box with the reason, for example "This account is banned. (failc 7)". The texts follow LoginFailType; an unknown code gets a generic line.

Testing

On a local NosCore, with a running ban on the account (a PenaltyLog row with Penalty 1):

  • Without the packet log, the login answers failc 7 and the page shows "Login refused — This account is banned. (failc 7)" instead of a black screen.
  • After the ban was removed, the same account logs in normally, and the packet log still records its lines (NsTeST ...).

On some refusals the client gives no message: for a banned account
(failc 7) it hides its window and exits, and the page was left black.

The port now tells the page the code of every failc it receives, whether
or not the packet log is on, and when the game exits after one the page
shows the reason in a box ("This account is banned. (failc 7)"). Refusals
the client handles itself, such as a wrong password, keep its own message.
@coderabbitai

coderabbitai Bot commented Nov 22, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1c2b83de-6757-46c7-836e-dae2cce13365
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

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

Successfully merging this pull request may close these issues.

A refused login shows no message

1 participant