Skip to content

convert moonscript to lua#52

Open
plally wants to merge 2 commits into
mainfrom
moonscript-to-lua
Open

convert moonscript to lua#52
plally wants to merge 2 commits into
mainfrom
moonscript-to-lua

Conversation

@plally
Copy link
Copy Markdown
Member

@plally plally commented May 31, 2026

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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/**/*.moon source file.
  • Add equivalent lua/**/*.lua files (autorun entry points, server init.lua/avatar_service.lua/player_count.lua/remote_messages.lua, server modules/*.lua, and client init.lua/menu.lua/receive_remote_message.lua).
  • Translate MoonScript idioms (import ... from, \-method calls, => fat-arrow methods, with blocks, list comprehensions, or=) into plain Lua, including a manual setmetatable-based AvatarService "class" and explicit guard(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()
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.

2 participants