限时抢购 50% 全场服务器优惠 最后一天!
距结束还剩: 00D 00H 00M 00S
background image
Game Servers 380 7 Days to Die 4 Abiotic Factor 2 Aloft 2 alt:V 2 Americas Army Proving Grounds 2 Among Us 2 Archean 2 ARK Survival Ascended 6 ARK Survival Evolved 3 Arma 3 3 Arma Reforger 2 Aska 2 AssaultCube 2 Assetto Corsa 3 Astro Colony 2 Astroneer 2 Automobilista 2 2 Avorion 2 Banana Shooter 2 Barotrauma 3 BATTALION Legacy 2 BeamNG.drive (BeamMP) 2 Black Mesa 2 Brickadia 2 Call of Duty 2 Citadel: Forged with Fire 2 ClassiCube 2 Clone Hero 2 Colony Survival 2 Conan Exiles 4 Contagion 2 Core Keeper 2 Counter-Strike 2 3 Craftopia 2 CryoFall 2 CS2D 2 Cube 2: Sauerbraten 2 Cubic Odyssey 2 DayZ 4 DDNet 2 DDRaceNetwork 2 Dead Matter 2 Dont Starve Together 4 Eco 2 Empyrion Galactic Survival 2 Enshrouded 3 Escape from Tarkov 2 Euro Truck Simulator 2 2 Factorio 2 Farming Simulator 25 2 Fistful of Frags 2 FiveM 3 FortressCraft Evolved 2 Foundry 2 Foundry VTT 2 Frozen Flame 2 FTL Tachyon 2 Garrys Mod 3 Ground Branch 2 Half-Life 2 Deathmatch 2 Hogwarp 2 Holdfast: Nations at War 2 HumanitZ 2 Hurtworld 2 Hytale 1 Icarus 2 Insurgency Sandstorm 2 IOSoccer 2 Just Cause 3 Multiplayer 2 Kerbal Space Program 2 Killing Floor 2 3 LeagueSandbox 2 Left 4 Dead 2 Left 4 Dead 2 3 Longvinter 2 Los Angeles Crimes 2 Medal of Honor 2 Midnight Ghost Hunt 2 Mindustry 2 Minecraft 4 Minetest 2 Modiverse 2 Mordhau 3 Mount & Blade II: Bannerlord 2 Myth of Empires 2 Nazi Zombies Portable 2 Necesse 2 NeosVR 2 Neverwinter Nights EE 2 Night of the Dead 2 Nightingale 2 No Love Lost 2 No More Room in Hell 2 No One Survived 2 Nova-Life Amboise 2 Nuclear Option 2 Onset 2 Open Fortress 2 OpenArena 2 OpenRA 2 OpenRCT2 2 OpenTTD 2 Operation Harsh Doorstop 2 Palworld 3 Path of Titans 2 Pavlov VR 3 PixARK 2 Plains of Pain 2 Portal Knights 2 Post Scriptum 2 Project Zomboid 8 Puck 2 Quake Live 2 R5Reloaded 2 RedM 2 Renown 2 Resonite 2 Return to Moria 2 Rimworld Together 2 Rising World 2 Risk of Rain 2 1 Rust 4 Satisfactory 1 SCP Secret Laboratory 3 SCUM 2 Smalland 2 Solace Crafting 2 Soldat 2 Soldat 2 2 Sonic Robo Blast 2 2 Sons of the Forest 2 Soulmask 2 SourceCoop 2 Space Engineers 3 Space Station 14 2 Squad 3 Starbound 3 StarMade 2 Stationeers 2 Stormworks 2 Subnautica Nitrox 2 Sunkenland 2 SuperTuxKart 2 Sven Co-op 2 Swords 'n Magic and Stuff 2 Team Fortress 2 3 Teeworlds 2 Terraria 3 TerraTech Worlds 2 TF2 Classified 2 The Forest 3 The Front 2 The Isle 2 Tower Unite 2 Trackmania 2 Unturned 4 Urban Terror 2 V Rising 3 Valheim 3 VEIN 2 Veloren 2 Vintage Story 3 Voyagers of Nera 2 Wolfenstein: Enemy Territory 2 Wreckfest 2 Wurm Unlimited 2 Xonotic 2 Zandronum 2 Getting Started 2 Network & Connectivity 1 Server Management 2
分类

RedM 服务器设置指南

ZH redm rdr2 setup cfx 1 人觉得有帮助

在 Legion Hosting 上设置 RedM 服务器的完整指南。RedM 是 Red Dead Redemption 2 的多人游戏修改框架,由 Cfx.re(FiveM 背后的同一团队)开发。本指南涵盖许可证密钥注册、服务器配置、资源管理和玩家连接。如果遇到问题,请参阅我们的 RedM 故障排除 指南。

什么是 RedM?

RedM 是 Red Dead Redemption 2 的社区驱动多人游戏框架,由 Cfx.re Collective 开发和维护——与 FiveM(GTA V 多人游戏框架)背后的同一组织。RedM 提供:

  • 用于托管自定义 RDR2 多人游戏体验的专用服务器平台
  • 使用 Lua、C# 和 JavaScript 的资源/脚本系统
  • 支持自定义游戏模式、角色扮演框架和社区模组
  • 将玩家连接到自定义服务器的客户端启动器
  • 用于广泛游戏修改的原生函数访问
有 FiveM 经验? 如果您有 FiveM 服务器经验,您会发现 RedM 非常熟悉。服务器配置、资源系统和许多概念在两个平台之间是共通的。主要区别在于特定于游戏的原生函数和为 RDR2 构建的资源。

获取 Cfx.re 许可证密钥

每个 RedM 服务器都需要有效的 Cfx.re 许可证密钥。此密钥是免费的,与您的 Cfx.re 账户绑定。

  1. 前往 Cfx.re Keymaster,地址为 https://keymaster.fivem.net/
  2. 使用您的 Cfx.re 账户登录(如果没有账户请先创建一个)。
  3. 点击 Register a new server(或当前界面显示的"New Server")。
  4. 填写表单:
    • Label: 为您的服务器取个名字(仅供您参考)。
    • Server IP: 输入 GPanel 中显示的服务器 IP 地址。您可以在服务器概览页面找到此信息。
    • Server Type: 选择适当的类型(托管服务器通常选择"Other/VPS")。
  5. 点击 Generate。您的许可证密钥将会显示。请复制并安全保存。
重要: 每个许可证密钥绑定到特定的服务器 IP 地址。如果您的服务器 IP 发生变化,您需要在 Keymaster 中生成新密钥或更新现有密钥。请妥善保管您的 Cfx.re 账户凭据——任何有权限的人都可以管理您的服务器密钥。

首次启动和 GPanel 启动变量

从 Legion Hosting 购买 RedM 服务器后,登录 GPanel 并导航到您的服务器。

设置启动变量

在 GPanel 中进入 Startup 选项卡。您将看到多个可配置变量:

变量 描述 示例
CFX_LICENSE 来自 Keymaster 的 Cfx.re 许可证密钥。必填。 cfxk_xxxxxxxxxxxxxxxxxxxx_xxxxx
SERVER_HOSTNAME 在服务器列表中显示的服务器名称。 My new FXServer!
MAX_PLAYERS 最大连接玩家数(1–32)。 32
CFX_VERSION 要安装的 CFX 服务器构建版本。使用 latestrecommended 或特定的构建编号。 latest
STEAM_WEBAPIKEY 用于 Steam 身份验证的 Steam Web API 密钥。在 steamcommunity.com/dev/apikey 获取。设置为 none 可禁用。 none

首次启动

  1. CFX_LICENSE 字段中输入您的 Cfx.re 许可证密钥。
  2. 设置您期望的服务器名称和最大玩家数。
  3. 进入 Console 选项卡并点击 Start
  4. 服务器将在首次启动时下载 RedM 服务器构件。这可能需要几分钟。
  5. 当您看到指示服务器正在监听的消息(例如 Started resource manager)时,您的服务器已上线。
注意: 如果服务器因许可证密钥错误无法启动,请仔细检查密钥输入是否正确且无尾随空格,以及 Keymaster 中的 IP 是否与服务器实际 IP 地址匹配。

server.cfg 配置

server.cfg 文件是 RedM 服务器的主要配置文件。通过 GPanel 的 File Manager 或 SFTP 访问它。以下是一个全面的配置示例:

# ========================================
# RedM Server Configuration
# ========================================

# Network Endpoints
# These define what IP and port the server listens on.
# 0.0.0.0 means listen on all available interfaces.
endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"

# Server Identity
sv_hostname "My RedM Roleplay Server"
sv_maxclients 32
sv_licenseKey "cfxk_xxxxxxxxxxxxxxxxxxxx_xxxxx"

# Server Password (leave empty for no password)
# sv_password "MyServerPassword"

# Server Description and Tags (shown in server browser)
sets sv_projectName "My RedM RP"
sets sv_projectDesc "A Wild West roleplay experience"
sets tags "roleplay, rp, economy, custom"

# Locale
sets locale "en-US"

# Steam Web API Key (optional, for Steam identity)
# Get one from https://steamcommunity.com/dev/apikey
# set steam_webApiKey "YOUR_STEAM_API_KEY"

# OneSync (networked entity sync)
# "on" = standard OneSync, "legacy" = legacy mode
set onesync on

# RCON Password (for remote console access)
rcon_password "YourRconPassword123"

# Resource Directories
# Ensure resources are loaded from these directories
ensure mapmanager
ensure chat
ensure spawnmanager
ensure sessionmanager
ensure basic-gamemode
ensure hardcap
ensure rconlog

# ========================================
# Add your custom resources below
# ========================================
# ensure my_custom_resource
# ensure vorp_core
# ensure oxmysql

关键配置选项说明

指令 描述
endpoint_add_tcp 客户端连接的 TCP 端点。必须与 GPanel 分配的端口匹配。
endpoint_add_udp 游戏数据的 UDP 端点。必须与 TCP 使用相同的端口。
sv_hostname 在 RedM 服务器浏览器和客户端直连中显示的服务器名称。
sv_maxclients 最大玩家槽位数。不得超过您的托管计划所支持的数量。
sv_licenseKey 您的 Cfx.re 许可证密钥。也可以通过 GPanel 启动变量设置。
sets 设置在服务器浏览器中可见的服务器控制台变量(复制到客户端)。
set 设置仅在服务器端可见的服务器控制台变量。
set onesync 启用 OneSync 以获得更好的实体同步。建议保持为 on
ensure 加载并启动资源。资源必须存在于 resources/ 子目录中。
提示: endpoint_add_tcpendpoint_add_udp 端口必须与 GPanel 中分配给服务器的端口匹配。除非您拥有私有 IP,否则服务器将被分配一个随机端口。如果 GPanel 显示您的服务器在端口 30120 上,您的端点应为 "0.0.0.0:30120"。使用不匹配的端口将导致服务器无法正确启动。

资源管理

资源是 RedM 服务器的构建模块。它们包含为服务器添加功能的脚本、资产和配置。

资源结构

每个资源是 resources/ 目录中的一个文件夹,至少包含一个 fxmanifest.lua(或旧版 __resource.lua)文件:

resources/
    [system]/
        chat/
            fxmanifest.lua
            cl_chat.lua
            sv_chat.lua
        spawnmanager/
            fxmanifest.lua
            ...
    [custom]/
        my_resource/
            fxmanifest.lua
            client.lua
            server.lua
            config.lua

加载资源

使用 server.cfg 中的 ensure 命令加载资源:

# Load a specific resource
ensure my_resource

# You can also use 'start' (functionally equivalent to ensure)
start another_resource

ensurestart 的区别:ensure 会在资源停止时启动它,或在资源已运行时重启它。start 仅在资源未运行时启动它。

安装新资源

  1. 从来源(GitHub、社区论坛等)下载资源。
  2. 通过 SFTP(参见 SFTP 上传指南)或 GPanel 文件管理器将资源文件夹上传到服务器的 resources/ 目录。
  3. server.cfg 中添加 ensure resource_name 行。
  4. 重启服务器以加载资源。

热门 RedM 框架和资源

框架/资源 描述
VORP Core RedM 上流行的角色扮演框架。提供角色创建、背包、经济系统等。相当于 FiveM 中的 ESX/QBCore。
RSG Core (RedEM:RP) 另一个完整的 RP 框架,具有角色管理、职业和经济系统。
oxmysql Cfx.re 服务器的 MySQL 库。大多数框架进行数据库操作时所必需的。
ox_lib 提供共享函数、UI 组件和辅助模块的实用工具库。
vorp_inventory 基于 VORP 的服务器背包系统。
重要: 始终检查资源与您的 RedM 服务器版本和框架的兼容性。RedM 资源与 FiveM 资源不能直接兼容——它们必须专门为 RedM 构建或移植。

如何连接

玩家需要 RedM 客户端才能连接到您的服务器。以下是入门方法:

安装 RedM

  1. 玩家必须拥有在 Steam、Epic Games Store 或 Rockstar Games Launcher 上购买的正版 Red Dead Redemption 2
  2. redm.net 下载 RedM 客户端。
  3. 安装 RedM。它将自动检测 RDR2 安装位置。
  4. 启动 RedM。首次启动时,它将更新并缓存游戏文件。

通过服务器浏览器连接

  1. 启动 RedM。
  2. 从主菜单点击 Play 打开服务器浏览器。
  3. 按名称搜索您的服务器(配置中的 sv_hostname 值)。
  4. 选择您的服务器并点击 Connect。如果设置了密码,请输入密码。

直接连接

  1. 启动 RedM。
  2. F8 打开客户端控制台。
  3. 输入以下命令,使用您服务器的 IP 和端口:
connect YOUR_SERVER_IP:PORT

例如:

connect 192.168.1.100:30120

在 GPanel 的服务器概览页面查找您的服务器 IP 和端口,或参阅 如何查找服务器 IP 和端口

提示: 如果您的服务器没有出现在服务器浏览器中,请确保它已运行至少几分钟(注册到 Cfx.re 主列表需要时间)。同时验证您的许可证密钥是否有效,以及服务器是否未设置为私密/不公开模式。更多详情请参阅我们的 RedM 故障排除 指南。

FiveM 共通概念

由于 RedM 和 FiveM 都构建在 Cfx.re 平台上,许多概念可以直接互通:

  • server.cfg 语法 在 FiveM 和 RedM 之间完全相同。
  • 资源清单fxmanifest.lua)使用相同的格式和字段。
  • 服务器端脚本(Lua、C#、JavaScript)的工作方式相同。
  • oxmysql 和其他共享库在两个平台上都可使用。
  • txAdmin 管理面板适用于 FiveM 和 RedM 服务器。
  • OneSync 实体同步在两个平台上都可用。

主要区别在于客户端原生函数(特定于游戏的函数)、资源兼容性(FiveM 资源需要为 RDR2 移植)以及可用的游戏世界/实体。

相关文章

需要帮助?

如果您在设置 RedM 服务器、获取许可证密钥或配置资源方面需要帮助,请 提交工单,我们的团队将帮助您启动和运行。


这篇文章对您有帮助吗?

Ready to Get Started?

The servers are booted, select your plan and become our latest satisfied client.