convert moonscript to lua#52
Open
plally wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Mechanical conversion of the addon's MoonScript sources under moon/ to hand-written Lua under lua/, preserving behavior across the server core, modules, and client UI/networking. No functional changes are intended.
Changes:
- Delete every
moon/**/*.moonsource file. - Add equivalent
lua/**/*.luafiles (autorun entry points, serverinit.lua/avatar_service.lua/player_count.lua/remote_messages.lua, servermodules/*.lua, and clientinit.lua/menu.lua/receive_remote_message.lua). - Translate MoonScript idioms (
import ... from,\-method calls,=>fat-arrow methods,withblocks, list comprehensions,or=) into plain Lua, including a manualsetmetatable-basedAvatarService"class" and explicitguard(function(...) ChatTransit:Method(...) end)wrappers.
Reviewed changes
Copilot reviewed 36 out of 36 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| moon/**/*.moon (deleted) | Removes the MoonScript sources now superseded by Lua equivalents. |
| lua/autorun/server/sv_chat_transit_init.lua | Server autorun: requires steamlookup, includes server files, AddCSLuaFiles client files. |
| lua/autorun/client/cfc_chat_transit_init.lua | Client autorun bootstrap including cfc_chat_transit/client/init.lua. |
| lua/cfc_chat_transit/server/init.lua | Core server: creates ChatTransit, sets up the WebSocket on Think, defines Send, GetRankColor, and guard. |
| lua/cfc_chat_transit/server/avatar_service.lua | Manual Lua "class" for AvatarService with avatar URL building, outline POST, and player_connect/PlayerDisconnected hooks. |
| lua/cfc_chat_transit/server/player_count.lua | Tracks ChatTransit.playerCount via connect/disconnect/ClientSignOnStateChanged. |
| lua/cfc_chat_transit/server/remote_messages.lua | Server side of remote message preference + BroadcastMessage net send. |
| lua/cfc_chat_transit/server/modules/anticrash.lua | Relays z_anticrash_* events as anticrash_event. |
| lua/cfc_chat_transit/server/modules/chat.lua | Relays player_say as message, honoring CFC_ChatTransit_ShouldRelayChatMessage. |
| lua/cfc_chat_transit/server/modules/connect.lua | Relays player_connect/PlayerInitialSpawn as connect/spawn. |
| lua/cfc_chat_transit/server/modules/disconnect.lua | Relays player_disconnect as disconnect with player counts. |
| lua/cfc_chat_transit/server/modules/pvp.lua | Relays `CFC_PvP_Player(Enter |
| lua/cfc_chat_transit/server/modules/round_modifiers.lua | Relays RoundModifiers_ModifierEnabled as round_modifier_enabled. |
| lua/cfc_chat_transit/server/modules/startup.lua | Relays InitPostEntity (delayed) as map_init. |
| lua/cfc_chat_transit/server/modules/ulx.lua | Wraps ulx.logString/ulx.fancyLogAdmin and relays as ulx_action. |
| lua/cfc_chat_transit/server/modules/voice.lua | Relays voice transcripts subject to proximity/gag/convar checks. |
| lua/cfc_chat_transit/client/init.lua | Client bootstrap: creates ChatTransit and includes receive_remote_message.lua. |
| lua/cfc_chat_transit/client/menu.lua | Client tool-menu/preference panel (note: not currently included by client/init.lua). |
| lua/cfc_chat_transit/client/receive_remote_message.lua | Receives CFC_ChatTransit_RemoteMessageReceive, displays in chat, registers tool menu, sends initial preference. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+1
to
+8
| require("steamlookup") | ||
|
|
||
| include("cfc_chat_transit/server/init.lua") | ||
| include("cfc_chat_transit/server/remote_messages.lua") | ||
|
|
||
| AddCSLuaFile("cfc_chat_transit/client/init.lua") | ||
| AddCSLuaFile("cfc_chat_transit/client/menu.lua") | ||
| AddCSLuaFile("cfc_chat_transit/client/receive_remote_message.lua") |
| local body = TableToJSON({ avatarUrl = avatarUrl, outlineColor = outlineColor, realm = realm, steamID = steamID64 }) | ||
| self.logger:debug("Sending data to outliner: ", body) | ||
|
|
||
| local failed = self.logger:error() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.