Skip to content

Conversation

@ostrichman1
Copy link

@ostrichman1 ostrichman1 commented Oct 23, 2025

Modified the description of each log in :leavelogs to show the Roblox reason they have left the game

image image

Summary by CodeRabbit

  • Improvements
    • Departure logs now include a clear reason for player removals (e.g., platform kick, creator kick, or unknown), so server leave entries show "left the server ()" for easier auditing and troubleshooting.

@coderabbitai
Copy link

coderabbitai bot commented Oct 23, 2025

Walkthrough

The PlayerRemoving handler now accepts a removal reason parameter and maps reason.Name values to human-readable strings; server Leaves log entries include that reason in the description ("left the server ()"). No other behavioral changes were made.

Changes

Cohort / File(s) Summary
Player removal reason logging
MainModule/Server/Core/Process.luau
Updated PlayerRemoving handler signature from (p) to (p, r) to capture removal reason. Added a reasons mapping for Unknown, PlatformKick, and CreatorKick. Updated Leaves log entry to include the computed reason string in the message "left the server ()".

Sequence Diagram

sequenceDiagram
    actor Roblox as Roblox Platform
    participant Handler as PlayerRemoving Handler
    participant Mapping as Reasons Mapping
    participant Log as Server Log

    Roblox->>Handler: PlayerRemoving(player, reason)
    Handler->>Mapping: Look up reason.Name (or fallback)
    Mapping-->>Handler: Human-readable reason string
    Handler->>Log: Write "left the server (reason)"
    Log-->>Handler: Entry recorded
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped by the logs and sniffed the air,
A reason found, no longer rare.
Kicked or gone, the tale is clear,
The leaves now say what drew them near.
Cheers from a rabbit—logs sing near and dear!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The pull request title "Add the leave reason to :leavelogs" is clear, concise (6 words), and directly reflects the primary change described in the raw_summary. It accurately communicates that the modification adds player exit reason information to the leave logs. The title uses present tense ("Add"), avoids vague terminology, and is specific enough that a teammate scanning history would immediately understand the main change. It aligns well with both the code changes (updating the PlayerRemoving handler to capture and log the reason) and the stated objectives.
Description Check ✅ Passed The pull request description provides a clear summary of what was done: modifying log descriptions to show the Roblox PlayerExitReason. It includes rationale by linking to the official Roblox documentation for PlayerExitReason, and provides proof of functionality through two before/after screenshots demonstrating the updated logs. The description adequately explains the change and its practical impact, meeting the template's requirements for description of work, rationale, and proof. While it's brief, it contains all essential information needed to understand the change.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ac59b67 and eca6949.

📒 Files selected for processing (1)
  • MainModule/Server/Core/Process.luau (2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{lua,luau}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{lua,luau}: Use task.wait() instead of wait()
Use interpolated strings instead of string concatenation

Files:

  • MainModule/Server/Core/Process.luau
🔇 Additional comments (1)
MainModule/Server/Core/Process.luau (1)

837-837: LGTM - Function signature correctly updated.

The signature change properly accepts the PlayerRemoveReason parameter from Roblox's PlayerRemoving event.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (1)
MainModule/Server/Core/Process.luau (1)

861-861: Add nil safety for the exit reason parameter (duplicate concern).

The current implementation lacks defensive coding: if r is nil, accessing r.Name will cause a runtime error. This concern was raised in previous reviews but remains unaddressed.

Apply this diff to add nil safety:

-			local reason = reasons[r.Name] or r.Name
+			local reason = "Unknown Reason"
+			if r and r.Name then
+				reason = reasons[r.Name] or r.Name
+			end
🧹 Nitpick comments (1)
MainModule/Server/Core/Process.luau (1)

855-859: Consider mapping additional exit reasons.

The reasons table currently maps only three exit reasons (Unknown, PlatformKick, CreatorKick). According to the Roblox documentation, the PlayerExitReason enum includes additional values such as GameShutdown, LostConnection, PlayerMutuallyDisconnected, and others. While the fallback to r.Name handles unmapped cases, adding more human-readable mappings would improve log clarity for administrators.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between eca6949 and 0e336b0.

📒 Files selected for processing (1)
  • MainModule/Server/Core/Process.luau (2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{lua,luau}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{lua,luau}: Use task.wait() instead of wait()
Use interpolated strings instead of string concatenation

Files:

  • MainModule/Server/Core/Process.luau
🔇 Additional comments (1)
MainModule/Server/Core/Process.luau (1)

837-837: Approved: Function signature correctly updated.

The addition of the r parameter properly captures the PlayerExitReason from Roblox's PlayerRemoving event.

@Epix-Incorporated Epix-Incorporated deleted a comment from coderabbitai bot Oct 23, 2025
@Dimenpsyonal Dimenpsyonal added the 📱 UI Frontend Adonis user interfaces label Nov 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📱 UI Frontend Adonis user interfaces

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants