Skip to content

Add guest login branch, smarter Doudizhu bot logic, and responsive Guandan layout tweaks#10

Merged
TypeThe0ry merged 1 commit into
mainfrom
codex/ui
Jun 27, 2026
Merged

Add guest login branch, smarter Doudizhu bot logic, and responsive Guandan layout tweaks#10
TypeThe0ry merged 1 commit into
mainfrom
codex/ui

Conversation

@TypeThe0ry

Copy link
Copy Markdown
Owner

Motivation

  • Allow ordinary players to enter as guests via a URL branch without forcing Discuz SSO while preserving the Discuz login path.
  • Improve automated bot behavior in Doudizhu so bots make smarter call-score decisions and can play all cards when the rules allow.
  • Fix layout and responsiveness for Guandan player/top UI and small styling adjustments to improve mobile/centered presentation.

Description

  • Expose guest login mode via URL param by adding authMode and initializing guestMode from getURLParam('auth'), and make auto-login token lookup conditional on authMode in static/index.html and the client bootstrap.
  • Update login UI conditionals so Discuz auto-login and buttons are shown only when authMode === 'discuz' and show guest input when authMode === 'guest'.
  • Add evaluateDoudizhuHand and shouldCallDoudizhuScore helper functions in server.js and use them in botCallScore to derive call decisions from the bot's hand, reducing purely random calls.
  • Improve botPlayCard to detect an immediate allOut via game.validate(posId, handRaw) and play the whole hand when valid, while keeping the existing AISuggest fallback and defensive validation.
  • Update config.example.json with login mode guidance (_LOGIN_MODES) and minor formatting, and add a README line mentioning the guest login entry.
  • Change viewport meta in static/index.html and apply multiple CSS adjustments in static/css/style.css to center and scale .room-guandan .player-top, add .guandan-teams layout, reposition .team-tag, and tweak mobile transform/scale values for better centering and z-index.

Testing

  • No automated tests were added or executed for these changes.

Codex Task

@TypeThe0ry

Copy link
Copy Markdown
Owner Author

@codex[agent] Code review

@Codex

Codex AI commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • registry.npm.taobao.org
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/_temp/ghcca-node/node/bin/npm ci (dns block)
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/_temp/ghcca-node/node/bin/npm install (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@TypeThe0ry TypeThe0ry marked this pull request as ready for review June 27, 2026 11:30
@TypeThe0ry TypeThe0ry merged commit b9a22d5 into main Jun 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants