7fea8807b83cb3612e8f3d4661b16c74176bca22
- 更新 update_machine.lua 和 installer.lua 中的远程资源下载地址,从旧云存储链接切换为 Gitea 仓库提交镜像地址 - 新增双向闸机专用安装脚本 installer_bi.lua - 为所有网页HTML文件更新静态资源的缓存版本号,避免浏览器加载过期的静态文件缓存 - 修复登录页面的乱码文本,替换为标准简体中文内容,修正ICP备案标识文本 - 新增管理后台概览板块、快捷操作按钮,优化IC卡管理界面与响应式布局样式
FTC Ticketing System (Refactored)
A comprehensive ticketing solution for Minecraft (CC:Tweaked) with a modern Web Control Panel.
Features
- Ticket Machine (Lua): Issue tickets, print receipts, write to floppy disks.
- Gate (Lua): Validate tickets, control redstone doors, track entries/exits.
- Web Console:
- Real-time Dashboard: Live updates of sales and passenger flow via Socket.IO.
- Visual Line Editor: Manage stations and lines with an interactive SVG map.
- Fare Management: Configure fares with a visual fare chart.
- Logs: Track ticket usage and system operations.
- System Settings: Configure API endpoints and promotions.
- File Manager: Upload and manage audio files (
.dfpwm) for devices.
Project Structure
server/: Node.js Backend (Express + Socket.IO).services/: Data and logic handling.routes/: API endpoints.
web/: Frontend (Vue 3 + Socket.IO Client).index.html: The new Control Panel.index.js: Vue 3 logic.
Lua/: CC:Tweaked scripts.
Installation
- Prerequisites: Node.js 16+.
- Install Dependencies:
npm install
Running the Server
Development
npm start
Access the console at http://localhost:23333.
Production (PM2)
This project includes an ecosystem.config.js for PM2.
# Start
pm2 start ecosystem.config.js
# View logs
pm2 logs ticket-machine
# Restart
pm2 restart ticket-machine
Configuration
- Server Port: Default
23333. SetPORTenvironment variable to change. - Data Storage: All data is stored in
web/data/. - CC:Tweaked Devices:
- Run
install_machine.luaorinstall_gate.luaon your turtles/computers. - Point them to your server's IP (e.g.,
http://YOUR_IP:23333/api).
- Run
API
/api: Admin API (Stations, Lines, Fares, Logs)./api/public: Public API for devices (Ticket queries, Orders).- WebSocket: Connect to
/for real-time events (stations:updated,stats:ticket:updated, etc.).
Troubleshooting
Error: bind EADDRINUSE 0.0.0.0:23333
This means the port 23333 is already occupied.
- Stop the PM2 process:
pm2 stop ticket-machine - Find the process holding the port:
lsof -i :23333ornetstat -tunlp | grep 23333 - Kill the process:
kill -9 <PID> - Restart PM2:
pm2 restart ticket-machine
Error: Cannot find module 'express'
Run npm install in the project directory to install dependencies.
License
MIT
Description
Languages
JavaScript
47.8%
HTML
23.9%
Lua
18.6%
CSS
9.7%