地狱已满服务器搭建教程-1 服务器安装篇 NMRIH Dedicate Server Installation Tutorials

简介:本文记录了地狱已满(No More Room In Hell)游戏服务器的搭建过程,涉及多系统(Windows、Linux),多种方式安装部署。含大量自定义参数及其作用介绍,也有进阶SourceMod插件安装的引言,安装过程常见问题解答等

服务器搭建篇:地狱已满服务器搭建教程-1 服务器安装篇(本文)

网络配置篇   : 地狱已满服务器搭建教程-2 网络配置篇

  • 可行性已证实:多系统(Win11、Win10、Win Server 2012、Centos 7.5),多方案(端口映射、内网穿透)组合搭建成功
  • 教程为个人实践记录,主要用于备忘。如有错误或值得改进的地方,欢迎留言指出
  • 教程无任何 私货 / 后门 夹杂,可放心食用。转载需注明出处

一、硬件配置推荐(可跳过)

  • CPU: 单核性能越强越好,遇到性能瓶颈可能导致卡顿

    当地图上的丧尸数量增加, 对 CPU资源的消耗也会随之增大
    在地图 nmo_broadway 中,共计 32 只丧尸,CPU单核占用率在 30% 左右
    在地图 nmo_quarantine 中,共计 176 只丧尸,CPU单核占用率在 70% 左右
    个人猜测与AI寻找路径或目标有关,因为使用 ai_disable 冻结后,CPU 以及 网络 资源的占用率明显大幅降低

  • 内存: 单台服务器通常占用 300MB - 500MB

    内存方面暂时没遇到性能瓶颈,或者明显感知卡顿的情况
    曾用阿里云的 1核心 1g内存 云服务器架设过 66tick 的服务器,体验很丝滑

  • 网络带宽: 推荐 66tick 下,总上行带宽 ➗ 总人数 ≥ 64kb/s (≈ 0.5 M)

    低于推荐值也能玩,但在实体数增加时,如果遇到瓶颈会出现明显卡顿
    在游戏控制台输入 net_graph 4 就可以查看实时的网络参数,实际占用的带宽量与 tickrate、配置参数、地图、实体数 等诸多因素有关
    如果你的服务器是远程服务器,或者需要与远程玩家共享的需求,最好注意这一项资源是否充足。否则可能导致玩家丢包,出现卡顿等情况 (丢包不一定是带宽不足造成的,也有可能是其他硬件到了性能瓶颈、距离过远线路不稳定等 )

  • 磁盘储存空间: 至少 8 GB,建议 20 GB+

    无插件,仅官方地图 和 官方模型 的经典模式服务器 占用存储空间约 7.5 GB
    占用存储空间较多的一般为地图和模型/材料,插件占用的存储空间很少
    插件数约 30 个、三方模型/材料 0 个、三方任务类(nmo)地图 200 张,单台服务器总占用空间约 20 GB

  • 实际性能测试:

    雨云服务器 4h4g
    CPU:E5-2696v2 2.5GHz
    内存:4GB
    系统环境:Windows Server 2012 R2
    tickrate:66
    游戏版本:v1.13.2
    游戏模式:默认经典
    计数插件:[ Clear Map 1.2.0 ] By Gray83

    测试地图:nmo_broadway
    CPU单核占用百分比 ≈ 30%
    在这里插入图片描述
    测试地图:nmo_quarantine
    CPU单核占用百分比 ≈ 70%在这里插入图片描述

二、网络环境配置

重要!这一步是服务器能否被 互联网玩家 访问到的关键

  • 如果只在服务器只在局域网内使用,可以跳过这一步
  • 如果是云服务器,一般配有公网IP,在防火墙里解锁 UDP 协议的 27015 端口 即可
  • 如果是家用网络,基本没有公网IP,可以尝试 向网络运营商申请公网 IP 或者使用 内网穿透 方案

具体教程参考另一篇文章: 地狱已满服务器搭建教程-2 网络配置篇


三、安装 NMRIH 服务器

  • 如果你设置的路径与本文不相同,需将路径修改成自己的(路径中建议不要有 中文、空格、等特殊字符
  • 遇到问题时,确认你的操作没有跳过/遗漏,且与本文一致
  • 文章末尾有部分特殊状况解答,以及大量的可供参考的资料

Windows 系统

① 使用 steam 安装

  • 适合用自己电脑开服,方便快捷,更新简单
  1. 在 steam 中搜索 No More Room in Hell Dedicated Server 下载安装(有游戏本体的账号,可以搜索库存中是否已有)
  2. 安装完成后,启动 No More Room in Hell Dedicated Server
  3. 游戏选择 No More Room In Hell,设置一个Rcon密码,就可以点击开始服务器启动自己的服务器在这里插入图片描述

② 使用 SRCDS server manager 安装(推荐)

  • 适合部署多台服务器,方便统一管理
  • 提供了一键安装、自动重启、更新等实用功能
  1. 下载 SRCDS server manager
    官方下载链接:OneDriver
    备用下载链接:百度云- 提取码: qwer

  2. 解压压缩包后,打开 xnet_srcdsmanager.exe 文件

    提示:需要中文可以点击:菜单栏 → Settings → Languge → chi.ini → Save

  3. 添加游戏服务器

    支持两种方式,效果是一样的,添加成功后,选中点击启动即可

    • 从网络下载:下载服务端 → 选择 No More Room In Hell → 选择安装位置

    • 从本地添加:加载本地已下载的服务器:菜单 → 添加/编辑 → 填写你的服务器配置

xnet_srcdsmanager 说明:

  • 下载游戏服务器失败可能是网络问题,尝试使用加速器、更换网络环境
  • 添加服务器时,不了解的参数可以参考上方截图,或保持默认。更多使用方法可以参考 SRCDS server manager
  • 类似的软件还有 WindowsGSM,更新相对活跃一些,但不推荐。没有中文是原因之一,主要是会收集用户数据,且在其官网的统计页面中有疑似称 hk、tw 为国家行为

③ 使用 steamCMD 安装

  1. 创建独立的文件夹,用于保存 steamCMD 和 NMRIH 服务器

    rem 小贴士:rem 是 cmd 的注释标记,rem 后面一整行内容会被忽略	 |  md 是 cmd 创建文件夹的命令
    md D:\Game\ServerData\steamCMD
    md D:\Game\ServerData\nmrih_Server
    
  2. 下载 steamCMD,用于下载/更新 NMRIH 服务器 (steamCMD 官方安装教程 [中文]

    ① 下载 steamCMD 安装程序压缩包: https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip

    ② 将压缩包解压到上一步创建的 D:\Game\ServerData\steamCMD 文件夹里

    ③ 运行 steamcmd.exe 等待自动安装完成

  3. 设置 NMRIH 服务器的安装目录(在 steamcmd.exe 命令窗口中输入下列命令)

    force_install_dir D:\Game\ServerData\nmrih_Server
    
  4. 下载 NMRIH 服务器资源

    • 下载应用命令格式                :app_update <应用ID> [validate]

      • 可选参数 validate          :下载完后校验下载的服务器资源是否完整
      • NMRIH 服务器应用 id   :317670
      • 应用 ID查询地址            :steam 数据库          |   V 社开发者社区
    • 登录 steam 账户(注意将账户名修改成你的steam账号)

      rem  输入密码时没有任何提示,一次性输完回车即可  |  登录时长取决于网络环境
      login 账号名
      
    • 也可以用匿名账户登录

      login anonymous
      
    • 下载 NMRIH 服务器资源(下载完成后 steamCMD 命令窗口可以关闭)

      app_update 317670 validate
      
  5. 启动服务器

    • 方案Ⅰ: 命令行
      按下 Win + R 打开 cmd 命令行,输入如下命令即可启动

      D:\Game\ServerData\nmrih_Server\srcds.exe ./srcds_run -game nmrih -port 27015 -maxplayers 8 +map nmo_suzhou
      
    • 方案 Ⅱ:快捷方式(推荐)

      鼠标右键点击 srcds.exe 文件 ⇒ 选择创建快捷方式 ⇒ 将 目标(T): 栏内容修改成如下内容
      然后就可以像打开桌面软件一样双击即可运行服务器(快捷方式启动文件可以放在包括桌面的任意位置)

      D:\Game\ServerData\nmrih_Server\srcds.exe ./srcds_run -game nmrih -port 27015 -maxplayers 8 +map nmo_suzhou
      
    • 方案 Ⅲ :启动脚本

      创建一个文本文件,名字随意,后缀名必须为 .bat。例如:startServer.bat,文件内容如下:

      D:\Game\ServerData\nmrih_Server\srcds.exe ./srcds_run -game nmrih -port 27015 -maxplayers 8 +map nmo_suzhou
      

      双击运行 startServer.bat 文件即可启动服务器(此文件同样可以放在任何位置)

  6. 更新服务器

    与安装过程类似

    • 运行 steamcmd.exe (打开后 steamcmd 一般会先自动更新)

    • 设置 服务器所在目录,并登录 steam 账号

    • 输入 app_update 317670 validate 更新服务器

      force_install_dir D:\Game\ServerData\nmrih_Server
      login anonymous
      app_update 317670 validate
      

CentOS 系统(Linux)

  1. 新建一个用于管理服务器的用户(安全起见,不要使用 root 用户启动游戏服务器!)

    useradd -m steam
    su steam
    
  2. 创建独立的文件夹,用于保存 steamCMD 和 NMRIH 服务器

    mkdir /home/steam/steamCMD
    mkdir /home/steam/serverfiles
    
  3. nmrih 服务器需要 32 位库才能运行,如果你的系统是64位的发行版,需要安装额外的软件包

    yum install glibc.i686 libstdc++.i686
    
  4. 下载 steamCMD 压缩包

    wget -P /home/steam/steamCMD http://media.steampowered.com/client/steamcmd_linux.tar.gz
    
  5. 将压缩包解压到上一步创建的 /home/steam/steamCMD 文件夹里

    tar -xvzf /home/steam/steamCMD/steamcmd_linux.tar.gz -C /home/steam/steamCMD
    
  6. 下载 NMRIH 服务器资源

    • 下载应用命令格式                :app_update <应用ID> [validate]

      • 可选参数 validate          :下载完后校验下载的服务器资源是否完整
      • NMRIH 服务器应用 id   :317670
      • 应用 ID查询地址            :steam 数据库          |   V 社开发者社区
    • 输入如下命令下载 NMRIH 服务器资源(注意将 账号名密码 换成自己的)

      # 输入密码时没有任何提示,一次性输完回车即可  |  登录时长取决于网络环境
      /home/steam/steamCMD/steamcmd.sh +force_install_dir "/home/steam/serverfiles" +login 账号名 密码 +app_update 317670 validate +quit
      
    • 也可以用匿名账户登录

      /home/steam/steamCMD/steamcmd.sh +force_install_dir "/home/steam/serverfiles" +login anonymous +app_update 317670 validate +quit
      
  7. 启动服务器

    • 方式 Ⅰ:前台启动

      命令行输入如下命令。此方法关闭远程连接后,服务器也会关闭

      /home/steam/serverfiles/srcds_run -game nmrih -port 27015 -maxplayers 8 +map nmo_suzhou
      
    • 方式 Ⅱ:screen多视窗启动

    • 方式 Ⅲ:tmux 终端复用软件(推荐)

      • tmux 简介:百度百科 - tmux

      • 推荐理由:知乎 - tmux 介绍

      • 安装 / 使用方法:

        yum install tmux  			# 下载安装tmux
        tmux new -s steam 			# 创建一个名为 steam 的会话
        tmux ls 					# 列出当前用户所有会话
        tmux a -t steam 			# 重新连接名为 steam 的会话
        							# 停止并退出会话:Ctrl + D
        
      • 举例

        tmux new -s nmrihserver    	# 创建一个名为 nmrihserver 的会话
        # 启动服务器
        /home/nmrihserver/serverfiles/srcds_run -game nmrih -port 27015 -maxplayers 8 +map nmo_suzhou  
        
  8. 更新服务器

    • 方案 Ⅰ:手动更新

      命令行输入如下指令,调用 steamcmd 更新服务器

      /home/steam/steamCMD/steamcmd.sh +force_install_dir "/home/steam/serverfiles" +login anonymous +app_update 317670 validate +quit
      
    • 方法 Ⅱ:启动时添加自动更新参数 ( 参考 Valve 开发者社区: [ 服务器启动命令参数列表 [英] ]

      • 创建一个用于自动更新的配置文件,例如: /home/steam/steamCMD/nmrih_update.txt

        vim /home/steam/steamCMD/nmrih_update.txt

        @ShutdownOnFailedCommand 1              	// set to 0 if updating multiple servers at once
        @NoPromptForPassword 1                 	 	// disables promt for password on execution
        force_install_dir /home/steam/serverfiles/	// Your Server instance
        login anonymous                         	// logs in with steams public anonymous account
        app_update 317670
        quit
        
      • 启动服务器时添加自动更新参数 -autoupdate(需要设置 -steam_dirsteamcmd_script
        /home/steam/serverfiles/srcds_run -game nmrih -autoupdate -steam_dir /home/steam/steamCMD -steamcmd_script /home/steam/steamCMD/nmrih_update.txt -port 27015 -maxplayers 8 +map nmo_suzhou
        

########################################################################################
# 到此 纯净经典服务器 部署完成
# 如需新增的第三方地图,将地图文件放到 ./serverfiles/nmrih/maps 文件夹里
# 用户会从服务器下载资源 (如需投票列表显示地图,自行修改文件 ./serverfiles/nmrih/cfg/mapcycle.txt )
########################################################################################

四、自定义服务器参数

  • 服务器配置文件的名称可以在启动服务器时通过参数指定,默认为 server.cfg
  • 文件一般放在服务器配置文件夹内,如 ./serverfiles/nmrih/cfg/server.cfg(没有则需要自己创建)
  • 该文件用于管理服务器的参数配置,启动后或更换地图时会读取这个文件。文件一般包括 服务器的名字、密码、模式、难度、游戏参数 等基本信息,在第三章中下载完就直接启动服务器,所以全部参数将都为默认值,包括服务器名称。

获取配置文件内容:

  1. By zombiegaming:fastdl.zombiegaming.net

  2. By Uknown_Skull:Centos7开地狱已满服 - 第四章

  3. By F1F88:

    • 1.13 更新:精简多余、未开启作弊无法使用的指令,修改了部分注释及参数值
    • 在服务器 cfg 目录里创建 server.cfg 文件,并填入如下内容:
    //***************************************************************************************
    //
    //                       No More Room in Hell - Server.cfg
    //                         Version 1.13 - March 25, 2023
    //      最新版本: https://blog.csdn.net/weixin_43908947/article/details/127372900
    //
    // **************************************************************************************
    
    // ................................... 服务器基本设置 ................................... //
    // 服务器名称
    hostname "[CN] NMRIH Dedicate Server Tutorial By F1F88"
    
    // 加入服务器的密码
    sv_password ""
    
    // 远程控制台密码
    rcon_password ""
    
    sv_region 4                                 // 服务器所在地区.-1 = 世界 | 0 = 美国东 | 1 = 美国西 | 2 = 南美 | 3 = 欧洲 | 4 = 亚洲 | 5 = 澳大利亚 | 6 = 中东 | 7 = 非洲
    sv_lan 0                                    // 服务器网络类型. 0 = Internet 互联网   | 1 = Local Area Network 局域网
    
    // motdfile "motd.txt"                      // 设置 公告栏/每日信息 文件名
    // mapcyclefile "mapcycle.txt"              // 设置 地图列表 文件名
    sv_difficulty "classic"                     // 服务器游戏难度. casual-休闲   | classic-经典  | nightmare-噩梦
    sv_tags "classics"                          // 服务器类型标签. custom-自定义 | classics-经典 | objective-仅nmo地图 | survival-仅nms地图
    
    // ................................... 下载设置 ................................... //
    sv_allowupload 0                            // 允许客户端上传文件. 默认 1
    // sv_allowdownload 1                       // 允许客户端下载文件. 默认 1
    // net_maxfilesize 64                       // 允许客户端下载文件大小上限(MB). 默认 64
    
    // 设置客户端从网站下载文件, 以加快下载速度, 为空则从服务器的资源里下载.
    // 假设服务器地图文件夹中有一个名为 nmo_example.bsp 的地图, 在 Web 服务器中有 nmo_example.bsp
    // Web文件地址为 http://www.网站.com/nmrih/maps/nmo_example.bsp
    // 则应该设置为  sv_downloadurl "http://www.网站.com/nmrih"
    sv_downloadurl ""
    
    // ................................... 性能设置 ................................... //
    // fps_max 0                                // 设置服务器运行帧速率的限制, 0=无限制. 默认 300
    sv_maxrate 0                                // 服务器分配给一个客户端的最大带宽速率, 0=无限制, (字节/秒). 默认 0
    sv_minrate 33000                            // 服务器分配给一个客户端的最小带宽速率, 0=无限制, (字节/秒). 默认 3500
    sv_maxupdaterate 66                         // 服务器每秒允许的最大更新数. 默认 66
    sv_minupdaterate 10                         // 服务器每秒允许的最小更新数. 默认 10
    sv_maxcmdrate 66                            // 服务器每秒允许的最大命令数. 默认 66
    sv_mincmdrate 10                            // 服务器每秒允许的最小命令数. 默认 10
    
    sv_parallel_packentities 1                  // 允许服务器并行打包实体. 默认 1
    sv_parallel_sendsnapshot 1                  // 允许客户端并行接收其他客户端和服务器同时发送的连续快照. 默认 0
    // sv_forcepreload 1                        // 强制服务器端预加载. 默认 0
    // sv_unlag_npcs 1                          // 允许对 NPC 执行滞后补偿(实验性). 默认 1
    // sv_alternateticks 1                      // 允许服务器仅模拟偶数刻度上的实体. 默认 0
    // sv_max_queries_sec 3.0                   // 允许每秒从单个 IP 响应的最大查询数. 默认 3.0
    // sv_max_queries_sec_global 3000           // 允许每秒从任何位置响应的最大查询数. 默认 3000
    // sv_max_queries_window 30                 // 允许每秒平均查询平均值的窗口. 默认 30
    
    net_splitpacket_maxrate 80000               // 设置对拆分数据包块排队时, 每秒的最大字节数. 默认 80000
    net_maxroutable 1260                        // 设置数据包拆分之前, 请求的最大数据包大小(576 - 1260). 默认 1260
    net_maxcleartime 4.0                        // 允许发送前等待下一个数据包的最长秒数, 0=无限制. 默认 4.0
    net_queued_packet_thread 1                  // 允许使用高优先级线程将队列数据包发送出去, 而不是每帧发送一次. 默认 1
    net_compresspackets 1                       // 允许对游戏数据包使用压缩. 默认 1
    net_compresspackets_minsize 1024            // 允许压缩的数据包最小大小(字节). 默认 1024
    net_splitrate 1                             // 允许每帧发送拆分数据包的碎片数. 默认 1
    
    // 用于限制已连接客户端的 cl_interp_ratio 最小值. 默认 1
    // -1 = 让客户端设置 cl_interp_ratio 为任何值 | 其他 = 设置 cl_interp_ratio 的最小值
    sv_client_min_interp_ratio 2
    
    // 用于限制已连接客户端的 cl_interp_ratio 最大值. 默认 5
    // 如果 sv_client_min_interp_ratio = -1,  那么 sv_client_max_interp_ratio 的设置无效
    sv_client_max_interp_ratio 2
    
    // 用于强制连接时客户端的 cl_predict 值. 默认 -1
    // 当本地客户端设置 cl_predict=1 时, 表示激活预测物理、运动、射击等 (推荐)
    // -1 = 让客户端将 cl_predict 设置为任何值    |  0/1 = 强制 cl_predict 为 0/1
    sv_client_predict 1
    
    // 客户端 cl_cmdrate 值被移动到 cl_updaterate 的 sv_client_cmdrate_difference 个单位内
    // 且不超过 sv_mincmdrate 和 sv_maxcmdrate . 默认 20
    sv_client_cmdrate_difference 20
    
    // ................................... 其他额外设置 ................................... //
    // ----------------- 玩家 ------------------ //
    sv_idle_autokick_enabled 1                  // 允许自动踢出挂机玩家. 默认 1
    sv_idle_autokick_time 120                   // 允许自动踢出判定时长(秒). 默认 120
    // sv_max_separation_force 0                // 启用玩家体积碰撞. 默认 1  | (1.11新增)
    // sv_observer_health_display               // 允许观众查看玩家生命值. 默认 1  | (1.11新增)
    // sv_friendly_fire_factor 0.0001           // 设置队友伤害百分比. 默认 0.1
    // mp_friendlyfire 0                        // 启用队友伤害.(0=仅感染时有). 默认 0
    // sv_deathnotice 2                         // 启用死亡提示.(2=仅玩家死亡). 默认 0  | (1.11.5新增)
    // sv_kill_player_on_disconnect 1           // 允许杀死失去连接的玩家.(防止感染退出后仍然变异). 默认 1  | (1.13新增)
    // sv_voiceenable 1                         // 允许玩家用麦克风交流. 默认 1
    // sv_alltalk 1                             // 允许玩家的麦克风交流无视距离. 默认 0
    // mp_show_voice_icons 1                    // 允许玩家说话时显示头顶的播放器语音图标. 默认 1
    // sv_voice_cooldown 3                      // 语音命令冷却时间(秒). 默认 3
    // cl_skip_joingame_dialog 1                // 允许客户端跳过欢迎界面, 自动加入游戏.  默认 0  | (1.11.5新增 | 仅客户端可用)
    
    // --------------- 回合时长 ---------------- //
    mp_timelimit 999                            // 设置自动切换到新地图之前, 在单个地图上花费的时间(分钟). 默认 45
    sv_practice_transtime 45                    // 设置练习时间的时长. 默认 45
    sv_preround_freezetime 5                    // 设置回合开始前的冻结时长. 默认 5
    // sv_extract_previewtime 12.0              // 设置撤离后自由镜头的时间. 默认 12.0
    // sv_wave_begin_grace 30                   // 设置 wave 开始之前的时间. 默认 30
    // sv_roundlag_time 10                      // 设置回合之间的等待时间. 默认 10
    // mp_bonusroundtime 15                     // 设置一轮获胜后到一轮重新开始的时间. 默认 15
    // mp_bonusroundtime_final 15               // 设置最后一轮结束后, 到第二轮重新开始的时间. 默认 15
    // sv_nextlevel_on_round_win                // 设置回合胜利后自动切换下一张地图, 而不是重新开始. 默认 0  | (1.11新增)
    
    // ------------- 游戏难度/模式 ------------- //
    // sv_challenge 0                           // 启用挑战模式. 默认 0
    // sv_realism 0                             // 启用写实模式. 默认 0
    // sv_hardcore_survival 0                   // 启用硬核生存模式. 默认 0
    // sv_realism_allow_respawn 0               // 允许写实模式重生. 默认 0
    // sv_challenge_validate 1                  // 验证挑战模式的返回结果. 默认 1
    // sv_watermelon_rescue 1                   // 启动西瓜救援!带他们去撤离区. 默认 1  | (1.13地图新增了更多西瓜)
    
    // ----------------- 复活 ------------------ //
    // sv_respawn_allowed 0                     // 允许玩家复活. 默认 0
    // sv_respawn_without_tokens                // 允许玩家没有复活令牌时复活. 默认 1
    // sv_respawn_with_weapon 0                 // 允许玩家复活时获得武器. 默认 0
    // sv_respawn_ammo_pct                      // 设置玩家复活时获得武器弹夹的概率. 默认 75
    // sv_respawn_nearby_allowed 0              // 允许在其他玩家附近复活. 默认 0
    // sv_respawn_nearby_min_distance           // 设置在其他玩家附近复活时, 距离目标玩家的最小距离. 默认 100
    // sv_respawn_nearby_max_distance           // 设置在其他玩家附近复活时, 距离目标玩家的最大距离. 默认 300
    // sv_respawn_token_objective               // 允许目标模式下使用复活令牌. 默认 0
    // sv_respawn_token_survival                // 允许生存模式下使用复活令牌. 默认 1
    // sv_respawn_time_token                    // 设置玩家拥有复活令牌时的重生时间. 默认 5
    // sv_respawn_time_notoken                  // 设置玩家没有复活令牌时的重生时间. 默认 30
    // sv_respawn_initial_token_count_objective // 设置任务模式复活令牌初始值. 默认 0
    // sv_respawn_initial_token_count_survival  // 设置生存模式复活令牌初始值. 默认 0
    // sv_respawn_kills_per_token_objective     // 设置目标模式获得一个复活令牌所需分值. 默认 0
    // sv_respawn_kills_per_token_survival      // 设置生存模式获得一个复活令牌所需分值. 默认 40
    // sv_wave_reset_tokens                     // 允许新 wave 时清空复活令牌. 默认 0
    // sv_wave_remove_inflictions               // 允许新 wave 时消除感染. 默认 0
    // sv_wave_heal_amount                      // 设置新 wave 治愈血量值. 默认 0
    // sv_spawn_grace                           // Spawn grace time  | 复活宽限期. 默认 180
    // sv_spawn_grace_wave_percent              // Spawn grace time wave percent  | 复活宽限期 wave百分比. 默认 -1
    // sv_spawn_grace_objectivecount            // 完成多少个任务后, 玩家不能重生. 默认 2
    
    // ---------------- 游戏道具 ---------------- //
    // sv_health_station_health                 // 设置医疗箱的生命值. 默认 200
    // sv_health_station_heal_per_tick          // 设置医疗箱的每秒治愈量. 默认 1
    // sv_flare_gun_supply_limit                // 设置信号枪可以召唤补给的最多次数.(-1=无穷大). 默认 1
    // sv_resupplytime                          // 设置再次提供补给的时间间隔(秒). 默认 60
    // sv_rare_weapon_chance                    // 设置物品盒有机会生成稀有武器(电锯). 默认 0.05
    // sv_rare_tool_chance                      // 设置物品盒产生稀有工具的概率(火炬枪、灭火器、焊工). 默认 0.025
    // sv_ng_zombie_loot                        // 允许 ng 丧尸掉落战利品. 默认 1  | (1.12.1新增)
    
    // ---------------- 投票相关 ---------------- //
    // sv_allow_votes 1                         // 允许玩家投票. 默认 1
    // sv_vote_issue_kick_allowed 0             // 允许玩家通过投票踢出其他玩家. 默认 0
    // sv_vote_allow_spectators 0               // 允许观众投票.(包括死亡玩家). 默认 0
    // sv_allow_dead_votekick_alive 0           // 允许观众投票踢出活着的玩家. 默认 0
    // sv_vote_kick_ban_duration 10             // 设置被踢出后封禁时长. 默认 10
    sv_vote_creation_timer 150                  // 设置玩家需要多长时间才能进行另一次投票. 默认 150
    sv_vote_failure_timer 300                   // 设置投票失败多长时间内不能重新发起投票. 默认 300
    // sv_vote_quorum_ratio 0.6                 // 设置同意投票所需的最低合格玩家比例.(0.5-1.0). 默认 0.6
    // sv_vote_changedifficulty_restart 1       // 设置玩家改变难度后重新开始游戏. 默认 1
    // sv_vote_issue_changechallenge_allowed 1  // 允许玩家通过投票改变游戏挑战. 默认 1
    // sv_vote_issue_changedifficulty_allowed 1 // 允许玩家通过投票改变游戏难度. 默认 0
    // sv_vote_issue_changelevel_allowed 1      // 允许玩家通过投票改变游戏地图. 默认 1
    // sv_vote_issue_nextlevel_allowed 1        // 允许玩家通过投票改变下张地图. 默认 1
    // sv_vote_allow_restart_game_skip 1        // 允许玩家投票跳过练习阶段. 默认 1  | (1.11新增)
    // sv_vote_issue_restart_game_allowed 1     // 允许玩家投票重新开始回合. 默认 1
    // sv_vote_ui_hide_disabled_issues 0        // 允许隐藏被禁止的投票选项. 默认 1
    
    // ------------------ 其他 ------------------ //
    // sv_gravity 800                           // 设置世界重力. 默认 800
    log on                                      // 启用日志 (off/on)
    
    // ***************************************************************************************
    //
    //                          高级服务器设置 (最好不要动!)
    //
    // ***************************************************************************************
    exec banned_user.cfg
    exec banned_ip.cfg
    
    // 这些命令将在切换地图时运行, 服务器崩溃时可能会从banlist中删除最近的封禁信息, 这可以最小化这个问题
    writeid
    writeip
    
    // 封禁玩家, 参考(26楼):https://tieba.baidu.com/p/5316771031?pid=111825849054&cid=#111825849054
    // banid forever [U:1:204954714]    // vvi
    // banid forever [U:1:122213944]    // 汪君
    
    //***************************************************************************************
    //
    //                                 主服务器设置
    //
    //***************************************************************************************
    // sv_master_legacy_mode 0          // 禁用lagacy模式, 因为steam主服务器不再支持它
    heartbeat                           // 发送此服务器准备就绪的心跳信号. 这应该是配置的最后一行
    
    //***************************************************************************************
    
    //-----End of Server.cfg-----
    

五、进阶:SourceMod 插件

安装和入门使用 Sourcemod 非常简单,wiki 百科中也有中文版的教程,本文不再赘述。如果想深度定制化自己的服务器,建议学会自己查阅文档,市面上的翻译软件完全可以解决语言不通的问题。

下面罗列的以及文章末尾的资料里包含了大量详细教程,能够指导你如何使用 Sourcemod 插件,只要有足够的耐心你也可以学会如何自己开发一个插件。


六、疑难解答

下载服务器资源时报错

  • SteamCMD 报错:Please use force_install_dir before logon!
  • 原因:服务器资源没有下载到指定的目录
  • 解决:先设置目录,再登录账号,再下载服务器资源
    force_install_dir D:\Game\ServerData\nmrih_Server
    login anonymous
    app_update 317670 validate
    

启动服务器报错

  1. 启动警告:WARNING: Failed to load 32-bit libtinfo.so.5 or libncurses.so.5.
    需要安装 32位 软件包

    yum install libtinfo.so.5
    
  2. 启动错误:/home/steam/.steam/sdk32/steamclient.so: cannot open shared object file: No such file or directory
    参考-维基百科:NMRIH 服务器安装 [英]

    mkdir -p /home/steam/.steam/sdk32/
    ln -s /home/steam/steamCMD/linux32/steamclient.so /home/steam/.steam/sdk32/steamclient.so
    
  3. 启动错误:Unable to persist cache 'modelsounds.cache', check file permissions
    下载服务器资源时没有切换到 nmrihserver 用户,导致 nmrihserver 用户权限不足

    chown -R steam /home/steam/* # 递归将此目录下所有目录和文件夹所有权设为 nmrihserver
    
  4. 数据库插件错误: [SM] Unable to load extension "dbi.mysql.ext": libz.so.1: cannot open shared object file: No such file or directory
    参考:【Sourcemod】Unable to load extension “dbi.mysql.ext”

七、其他参考资料

1. 游戏入门

2. 服务器

  1. 安装教程

  2. 参数设置 / 技巧教程

3. 性能调优


感谢本文中所有引用、参考的文章及作者等友人提供的帮助。尊重原创,转载需注明出处!
如有服务器或插件方面问题需要帮忙解决,至少在三连以后提问,白嫖党恕不奉陪。
若长时间未回复评论/私信,可发送邮件到:1144048365@qq.com

  • 10
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 35
    评论
### 回答1: My Approach to Difficulties in Learning Learning is not always easy, and we all face difficulties and challenges at some point in our educational journey. When faced with difficulties, it is important to have a strategy for overcoming them. Here are a few approaches that I have found to be effective in tackling learning challenges. One of the most important things to do when faced with a difficult concept is to break it down into smaller, more manageable pieces. This can be done by identifying the key takeaways from the material and focusing on understanding those key points. Another useful approach is to seek help from others. Whether it be talking to a classmate, teacher or tutor, getting a different perspective on a difficult topic can be very beneficial. They can also offer guidance and advice on how to approach the material and provide resources to help with understanding. Practice is also a key aspect of overcoming learning difficulties. By practicing a concept or skill, it will become more familiar and easier to understand. For example, working on practice problems or doing sample questions can help in math or science classes, while using flashcards or repetition can help with memorization. Finally, it's important to be patient with yourself and not give up too easily. Learning is a process and it may take time to fully understand a concept. It's also important to remember that making mistakes is a natural part of the learning process. In summary, my approach to difficulties in learning involves breaking down the material into manageable pieces, seeking help from others, practicing regularly, and being patient and persistent. ### 回答2: My Approach to Difficulties in Learning When faced with difficulties in learning, I adopt a series of strategies to overcome them. Firstly, I break down the problem or concept into smaller, manageable parts. By doing so, I am able to focus on each component individually, gaining a clearer understanding of the whole picture. Secondly, I actively seek help and guidance. Whether it is from my teachers, classmates, or online resources, I am not hesitant to reach out and ask for assistance. Collaborating with others not only enhances my knowledge, but also allows me to learn from their perspectives and experiences. Additionally, I maintain a positive mindset, reminding myself that mistakes are an integral part of the learning process. Rather than becoming discouraged by setbacks, I view them as opportunities for growth and improvement. By embracing challenges, I become more resilient and develop a sense of perseverance. Moreover, I create a structured study routine to effectively manage my time and resources. I prioritize tasks and allocate sufficient time for each subject, ensuring that I dedicate quality attention to all aspects of my learning. This not only helps me stay organized but also prevents procrastination. Lastly, I regularly review and revise the material learnt. Repetition is key to solidifying knowledge and retaining information. By regularly revisiting past lessons, I reinforce my understanding and reinforce the concepts, improving long-term retention. In conclusion, my approach to difficulties in learning involves breaking down problems, seeking help, maintaining a positive mindset, creating a structured study routine, and reviewing regularly. By employing these strategies, I am able to effectively navigate obstacles and enhance my learning experience. ### 回答3: 我的应对困难的方法 Learning is a journey filled with ups and downs. Throughout my academic journey, I have encountered various difficulties that have challenged me and pushed me to find effective ways to overcome them. Here are some of my approaches to dealing with difficulties in learning. Firstly, when faced with a difficult concept or subject, I believe it is essential to seek help. I usually start by reaching out to my teachers or professors for guidance. They have the expertise and knowledge to explain complex ideas in a simplified manner. Additionally, I also consult my classmates who might have a better understanding of the topic. Collaborating with others not only enhances my learning experience but also provides alternative perspectives that help broaden my understanding. Furthermore, time management plays a crucial role in overcoming learning obstacles. I have learned to prioritize tasks and allocate my study time effectively. By setting realistic goals and breaking down larger tasks into smaller manageable chunks, I can stay organized and avoid feeling overwhelmed. This approach allows me to focus on one task at a time, increasing productivity and comprehension. Another strategy I employ is utilizing various resources available to me. Technology has proven to be a valuable tool in my learning process. I take advantage of online platforms, educational apps, and websites that offer tutorials and explanations. These resources provide additional support and allow me to review and reinforce my understanding of challenging concepts at my own pace. Lastly, a positive mindset is crucial when facing difficulties in learning. Instead of viewing challenges as setbacks, I perceive them as opportunities for growth. I remind myself that mistakes and failures are part of the learning process. By embracing a growth mindset, I become more resilient and motivated to push through and find solutions to my difficulties. All in all, my approach to difficulties in learning involves seeking help, effective time management, utilizing various resources, and maintaining a positive mindset. By implementing these strategies, I have been able to overcome obstacles and continue progressing in my academic journey.
评论 35
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值