GrasscutterCommandGenerator is a Windows Forms (.NET Framework 4.8) desktop application that serves as a comprehensive administration and command-generation tool for Grasscutter, a Genshin Impact private server emulator. It provides a GUI to generate and execute server commands (e.g., give items, teleport, spawn entities, set weather), edit server configuration files (gacha banners, drops, shops, activities), manage player accounts and permissions, and run a MITM proxy to intercept game traffic. The application is heavily data-driven, relying on embedded localized text files for game entity IDs and names, and uses Newtonsoft.Json for serialization. It supports multi-language UI (Chinese, English, Russian, Traditional Chinese) and integrates with a remote command plugin (gc-opencommand-plugin) for direct server interaction. The architecture is a monolith WinForms application with a tabbed page interface. The main entry point is Program.cs, which initializes the main form (FormMain) that hosts multiple pages (e.g., PageGiveItem, PageAvatar, PageQuest, PageProxy) and modal editors (FormGachaBannerEditor, FormShopEditor). A base class (BasePage) provides common lifecycle and command execution methods. The application communicates with the Grasscutter server via HTTP (OpenCommandAPI) and can also modify system proxy settings to redirect game traffic. External dependencies include the .NET Framework, Newtonsoft.Json (embedded), and Windows API calls for proxy and hotkey management. Key data flows involve loading game data from embedded resource files at startup, constructing command strings from user input, and optionally sending them to the server. The proxy module (Eavesdrop) captures and forwards HTTP/HTTPS traffic between the game client and server. The tool also supports importing/exporting player data in the GOOD (Genshin Open Object Description) format. While the codebase is functional and well-organized for its domain, it is tightly coupled to the Grasscutter server API and game data, requiring manual updates with each game patch. No automated tests are present, and the reliance on hardcoded data and Windows-specific features limits portability.
This repository implements a RuneScape game server emulator (build #435, October 2006) in TypeScript/Node.js. It provides a full multiplayer game world with player management, NPCs, skills (mining, woodcutting, smithing, firemaking, runecrafting, crafting, fletching, prayer, etc.), quests (Cook's Assistant, Witch's Potion, Goblin Diplomacy tutorial), combat, banking, shops, and item interactions. The server uses a tick-based game loop (600ms ticks) and supports multiple server roles (game, login, update) that can run standalone or together via a gateway server. The architecture is modular: a core engine provides an action pipeline for handling player events (object interaction, item use, commands, etc.), a task scheduler for delayed/tick-synced actions, a plugin system for content (skills, quests, NPCs, items), and a world manager with chunk-based map, collision detection, and pathfinding (A*). Networking uses custom packet handling with ISAAC cipher encryption. Configuration is data-driven: items, NPCs, shops, spawns, skill guides, and music regions are loaded from JSON/YAML files at startup. The system also integrates with the @runejs/filestore library to decode the game cache. Key entry points include src/server/runner.ts (launches servers), src/server/game/game-server.ts (sets up world and gateway), src/engine/action/action-pipeline.ts (central event dispatcher), and src/engine/plugins/loader.ts (auto-loads plugins from dist/plugins/). The codebase is actively developed but shows signs of technical debt: many TODO references to issue #417 (replacing setInterval with tick-synced code), deprecated patterns (actionsCancelled Subject), incomplete features (Construction skill stubbed, Prayer/Magic partly implemented), and inconsistent plugin module formats. Despite these issues, the core patterns (task system, action pipeline, plugin system) are well-designed and demonstrate non-obvious craftsmanship.