[Feature]: Single machine-readable data file for server metadata and default ports

Đang mở
#5,196 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
bash, github-actions, json, shell
Lĩnh vực
cli, tooling

Hướng nghiên cứu

Start by reading lgsm/modules/info_messages.sh, the per-server lgsm/config-default/config-lgsm/<server>/_default.cfg files, and lgsm/data/serverlist.csv to see how port metadata is currently represented. The issue proposes a new lgsm/data/servers.json and CI validation, but leaves the schema, coverage of every server, and handling of ports without known defaults to be worked out. Done means the metadata is complete and dependable enough for scripts, CI, and the website to use.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

engine: source game: Counter-Strike: Global Offensive info: steamcmd info: website type: docs type: feature
Summary

Add one machine-readable data file that holds the definitive per-server metadata, starting with port definitions, so the scripts, the docs and the website all read the same source instead of each working it out separately.

Problem

Default ports are currently spread across several places:

  • the port tables printed by details live in lgsm/modules/info_messages.sh (labels, protocols and variable names)
  • the default values live in lgsm/config-default/config-lgsm/<server>/_default.cfg, but only for some servers and only some ports
  • other defaults are only implied by lgsm/modules/info_game.sh fallbacks or by the game's own default config in Game-Server-Configs
  • some games have no default anywhere in LinuxGSM and the value only exists in the game's own documentation

Anything outside the main script that needs ports has to scrape shell code. The new linuxgsm.com site needs a port table for every server, and building it from the current files gave only about half of the default values directly from this repo. The rest had to be guessed or taken from another source, which is not reliable enough to publish.

Proposal

Add a data file (for example lgsm/data/servers.json, next to serverlist.csv) with one entry per server. For ports:

{
  "csgoserver": {
    "ports": [
      { "setting": "port", "label": "Game", "default": 27015, "protocol": "udp" },
      { "setting": "port", "label": "Game", "default": 27015, "protocol": "tcp" },
      { "setting": "sourcetvport", "label": "SourceTV", "default": 27020, "protocol": "udp" }
    ]
  }
}

Then:

  1. Generate or validate the fn_port lines in info_messages.sh and the port values in _default.cfg from that file, or have CI fail if they disagree, so there is only one place to edit.
  2. Add a check in CI that every server in serverlist.csv has an entry, and every port the details command prints has a default value.
  3. Publish the file so linuxgsm.com, the docs and other tools can read it directly.
Other uses

The same file could hold other facts that are currently scattered or only in the docs, for example engine, whether SteamCMD is used, whether a Steam login or a game server token is needed, default install size, supported distros, and the config file paths. The linuxgsm.com server pages already show several of these.

Notes
  • Servers where LinuxGSM currently has no default for a port would need the value confirmed from the game's own documentation before it goes in.
  • A follow-up could let details read from the same file, but that is not required for the first version.
Ngôn ngữ chính
Shell
Star
4.9k
Fork
866
Merge trung bình
17 giờ 58 phút
Pull request đã merge (30 ngày)
100

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của GameServerManagers/LinuxGSM

Tất cả issue của GameServerManagers/LinuxGSM

Issue tương tự

Thêm issue về Shell/Bash

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.