CentOS8 构建ReHLDS Server

CentOS8下使用ReHLDS等组件构建CS1.6 Linux Server

版本信息

Protocol version 48

Exe version 1.1.2.7/Stdio (cstrike)

Exe build: 15:16:04 Jul 24 2019 (8308)


服务端组件地址

[ReHLDS] https://github.com/dreamstalker/rehlds
[ReGameDLL] https://github.com/s1lentq/ReGameDLL_CS
[ReAPI] https://github.com/s1lentq/reapi
[ReHLDSAddons] https://github.com/SanjaySRocks/ReHLDSAddons 
[Metamod-R] https://github.com/theAsmodai/metamod-r
[AMXMODX] https://www.amxmodx.org/downloads-new.php

文件摆放

[steam@localhost ReHLDS]$ tree
.
├── core.so
├── cstrike
│   ├── addons
│   │   ├── amxmodx
│   │   │   ├── modules
│   │   │   │   ├── reapi_amxx.dll
│   │   │   │   └── reapi_amxx_i386.so
│   │   │   └── scripting
│   │   │       ├── include
│   │   │       │   ├── cssdk_const.inc
│   │   │       │   ├── reapi_engine_const.inc
│   │   │       │   ├── reapi_engine.inc
│   │   │       │   ├── reapi_gamedll_const.inc
│   │   │       │   ├── reapi_gamedll.inc
│   │   │       │   ├── reapi.inc
│   │   │       │   ├── reapi_rechecker.inc
│   │   │       │   ├── reapi_reunion.inc
│   │   │       │   ├── reapi_version.inc
│   │   │       │   └── reapi_vtc.inc
│   │   │       └── reapi_test.sma
│   │   ├── metamod
│   │   │   ├── config.ini
│   │   │   ├── metamod_i386.so
│   │   │   └── plugins.ini
│   │   ├── reauthcheck
│   │   │   ├── reauthcheck.cfg
│   │   │   └── reauthcheck_mm_i386.so
│   │   ├── rechecker
│   │   │   ├── rechecker_mm_i386.so
│   │   │   └── resources.ini
│   │   ├── resemiclip
│   │   │   ├── config.ini
│   │   │   ├── maps
│   │   │   │   ├── _de_dust2.ini
│   │   │   │   └── _prefix_de.ini
│   │   │   └── resemiclip_mm_i386.so
│   │   ├── resrdetector
│   │   │   ├── config.cfg
│   │   │   └── resrdetector_mm_i386.so
│   │   ├── reunion
│   │   │   └── reunion_mm_i386.so
│   │   ├── VoiceTranscoder
│   │   │   ├── VoiceTranscoder.cfg
│   │   │   └── VoiceTranscoder.so
│   │   └── whblocker
│   │       ├── config.ini
│   │       └── whblocker_mm_i386.so
│   ├── dlls
│   │   └── cs.so
│   ├── game.cfg
│   ├── game_init.cfg
│   └── reunion.cfg
├── demoplayer.so
├── engine_i486.so
├── filesystem_stdio.so
├── hlds_linux
├── hltv
├── proxy.so
└── valve
    └── dlls
        └── director.so

18 directories, 43 files


安装系统组件

sed -i '/SELINUX/s/enforcing/disabled/' /etc/selinux/config  && setenforce 0 
systemctl stop firewalld.service && systemctl disable firewalld.service  
dnf install -y epel-release
dnf install -y glibc.i686 libstdc++.i686 screen libXtst.i686 ncompress libgcc.x86_64 libgcc.i686 zlib.i686 ncurses-libs.i686


系统配置

vim /etc/sysctl.conf
添加
fs.file-max=100000

vim /etc/pam.d/common-session
添加
session required pam_limits.so

vim /etc/security/limits.conf
添加
* soft nofile 100000
* hard nofile 100000


下载服务端

useradd -m steam
su - steam
mkdir ~/steamcmd && cd ~/steamcmd
curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf -
./steamcmd.sh +login anonymous +force_install_dir ./hlds/ +app_set_config 90 mod cstrike +app_update 90 validate +quit
mkdir /home/steam/steamcmd/hlds/./cstrike/SAVE
touch /home/steam/steamcmd/hlds/./cstrike/listip.cfg
touch /home/steam/steamcmd/hlds/./cstrike/banned.cfg


配置服务端

加载metamod

vim /home/steam/steamcmd/hlds/cstrike/liblist.gam
改为
game "Counter-Strike"
url_info "www.counter-strike.net"
url_dl ""
version "1.6"
size "184000000"
svonly "0"
secure "0"
type "multiplayer_only"
cldll "1"
hlversion "1111"
nomodels "1"
nohimodel "1"
mpentity "info_player_start"
//gamedll "dlls\mp.dll"
//gamedll_linux "dlls/cs.so"
gamedll_linux "addons/metamod/metamod_i386.so"
//gamedll_osx "dlls/cs.dylib"
trainmap "tr_1"
edicts  "1800"


设置motd

vim /home/steam/steamcmd/hlds/cstrike/motd.txt
改为
<!DOCTYPE html>
<html>
<head>
<title>Cstrike MOTD</title>
<style type="text/css">
<!--
BODY {background-image: url(https://www.vos.cn/zb_users/theme/vOS/style/images/pro.jpg);
background-position: center;
background-repeat: no-repeat;
background-attachment: fixed;}
-->
</style>
</head>
<body>
<noembed><bgsound src="https://www.vos.cn/zb_users/theme/vOS/style/media/punk.mp3"></noembed>
</body>
</html>


配置config

vim /home/steam/steamcmd/hlds/cstrike/server.cfg
改为
//General//
sv_cheats 0             
sv_aim 0           
sv_gravity 800  
sv_bounce 1   
sv_restart 0            
sv_restartround 0         
sv_region 255       
sv_wateraccelerate 10   
sv_waterfriction 1 
sv_wateramp 0     
sv_accelerate 5         
sv_enableoldqueries 1    
sv_maxspeed 320         
sv_timeout 35         
sv_stopspeed 75         
sv_stepsize 18          
sv_friction 4           
sv_clipmode 0           
sv_clienttrace 1.0                  
sv_airmove 1            
sv_airaccelerate 10   
sv_unlagpush 0          
sv_unlagsamples 1      
sv_unlag 1  
sv_maxunlag .5 
sv_maxvelocity 2000       
sv_logsecret 0
sv_filetransfermaxsize 10
sv_spectalk 1
sv_spectatormaxspeed 1000
sv_spetalk 1
mp_lowlag 1          
mp_flashlight 1        
mp_footsteps 1         
mp_falldamage 1         
mp_autokick 0          
mp_fadetoblack 0        
mp_hostagepenalty 0 
mp_ghostfrenquency 0.1  
mp_fraglimit 0          
mp_winlimit 0    
mp_mirrordamage 0       
mp_mapvoteratio 1.0     
mp_ghostfrequency 0.1   
mp_consistency 1        
mp_autocrosshair 0      
mp_kickpercent 1        
mp_fragsleft 0    
mp_decals 300     
mp_chattime 10                 
mp_startmoney 16000              
mp_friendlyfire 0               
mp_friendly_grenade_damage 1     
mp_tkpunish 0                    
mp_maxrounds 0         
mp_freezetime 0          
mp_roundtime 2.00        
mp_timelimit 999        
mp_buytime 0.25  
mp_c4timer 35            
mp_playerid 0           
mp_forcechasecam 2       
mp_forcecamera 2         
mp_autoteambalance 0     
mp_limitteams 0   

//Log//         
sv_logbans 0    
sv_logecho 0
sv_logfile 0
sv_log_onefile 0                 
mp_logfile 0            
mp_logmessages 0       
mp_logdetail 0          
//log on                

//Important//
sv_lan 0
sv_lan_rate 70000
sv_sendvelocity 1 
sv_fullupdate_action 0     
sv_maxupdaterate 100   
sv_minupdaterate 30     
sv_maxrate 100000       
sv_minrate 50000  
sys_ticrate 1100

//HLTV//
sv_hltv 0
sv_proxies 0
         
//Voice//
sv_voiceenable 1 
sv_alltalk 2
sv_voicecodec voice_speex        
sv_voicequality 5                
sv_visiblemaxplayers 15 
        
//Resources//
sv_allow_dlfile 1
sv_downloadurl "http://192.168.1.2/cstrike/"
sv_allowdownload 1      
sv_send_logos 1         
sv_send_resources 0
sv_allowupload 1 

//Other//
sv_filterban 1
sv_contact hlds@vos.cn       
sv_password "" 
hostname "Half-Life ReHLDS"                    
pausable 0    
allow_spectators 1   
hpk_maxsize 0
sv_filetransfercompression 0
decalfrequency 5
host_framerate 0         
edgefriction 2  

//Rcon//   
rcon_password "vos"     
sv_rcon_maxfailures 99999         
sv_rcon_minfailures 10000      
sv_rcon_banpenalty 0
sv_rcon_minfailuretime 1440

//Rechecker logs//
rch_log 0

// Extras//
exec rehlds.cfg
exec game.cfg
exec game_init.cfg
exec bots.cfg
exec listip.cfg
exec banned.cfg
echo "Executing Server Configuration File"

vim /home/steam/steamcmd/hlds/cstrike/bots.cfg
改为 
//Bots//
bot_quota "2"                         
bot_quota_mode "normal"                
bot_quota_match                       
bot_join_team "any"                 
bot_difficulty "3"   
bot_deathmatch "0"                
bot_auto_vacate "1"                  
bot_prefix ""                        
bot_join_after_player "0"            
bot_defer_to_human "1"   
bot_auto_follow "0"              
bot_walk "0"                            
bot_stop "0"                         
bot_allow_pistols "1"                  
bot_allow_shotguns "0"                 
bot_allow_sub_machine_guns "1"         
bot_allow_rifles "1"                   
bot_allow_machine_guns "0"             
bot_allow_grenades "1"                 
bot_allow_snipers "1"                 
bot_allow_shield "0"                  
bot_chatter "off"       
bot_allow_rogues "1"                                                                   
bot_all_weapons  
echo "Executing Bots Configuration File"

vim /home/steam/steamcmd/hlds/cstrike/game_init.cfg
改为
// Sets mins/maxs hull bounds for the player.
// 0 - disabled (default behaviour, sets engine)
// 1 - enabled  (sets gamedll)
// Default value: "1"
mp_hullbounds_sets "1"

vim /home/steam/steamcmd/hlds/cstrike/reunion.cfg
改为
cid_Steam = 1
cid_SteamPending = 9
cid_HLTV = 7
cid_NoSteam47 = 8
cid_NoSteam48 = 8
cid_RevEmu = 1
cid_RevEmu2013 = 1
cid_SC2009 = 1
cid_OldRevEmu = 1
cid_SteamEmu = 1
cid_AVSMP = 1
cid_Setti = 3
cid_SXEI = 1
cid_SSE3 = 1
ServerInfoAnswerType = 0
EnableSXEIdGeneration = 0
SC2009_RevCompatMode = 1
SteamIdHashSalt = 
SteamIdHashDProtoCompat = 0
EnableGenPrefix2 = 0
FixBuggedQuery = 1
HLTVExcept_IP = 127.0.0.1
EnableQueryLimiter = 1
QueryFloodBanTime = 10
IPGen_Prefix1 = 0
IPGen_Prefix2 = 4
Native_Prefix1 = 0;
RevEmu_Prefix1 = 1;
RevEmu2013_Prefix1 = 1;
SC2009_Prefix1 = 1;
OldRevEmu_Prefix1 = 2;
SteamEmu_Prefix1 = 3;
AVSMP_Prefix1 = 4;
Setti_Prefix1 = 5;
SXEI_Prefix1 = 6;
SSE3_Prefix1 = 7;
LoggingMode = 0

vim /home/steam/steamcmd/hlds/cstrike/rehlds.cfg
改为
//ReHLDS cvar//
echo Executing ReHLDS Configuration File
listipcfgfile "listip.cfg"
syserror_logfile "sys_error.log"
sv_auto_precache_sounds_in_models "0"
sv_delayed_spray_upload "0"
sv_echo_unknown_cmd "0"
sv_rcon_condebug "1"
sv_force_ent_intersection "1"
sv_rehlds_force_dlmax "0"
sv_rehlds_hull_centering "0"
sv_rehlds_movecmdrate_max_avg "9999"
sv_rehlds_movecmdrate_avg_punish "-1"
sv_rehlds_movecmdrate_max_burst "-1"
sv_rehlds_movecmdrate_burst_punish "-1"
sv_rehlds_send_mapcycle "0"
sv_rehlds_stringcmdrate_max_avg "9999"
sv_rehlds_stringcmdrate_avg_punish "-1"
sv_rehlds_stringcmdrate_max_burst "9999"
sv_rehlds_stringcmdrate_burst_punish "-1"
sv_rehlds_userinfo_transmitted_fields "\name\model\*sid\*hltv\bottomcolor\topcolor"
sv_rehlds_attachedentities_playeranimationspeed_fix "1"
sv_rehlds_maxclients_from_single_ip "5"
sv_use_entity_file "0"

vim /home/steam/steamcmd/hlds/cstrike/game.cfg
改为
//ReGameDLL//
echo Executing ReGameDLL Configuration File
mp_freeforall 0
mp_autoteambalance 0
mp_buytime 1.5
mp_maxmoney 99999
mp_round_infinite 0
mp_roundover 0
mp_round_restart_delay 5
mp_hegrenade_penetration 0
mp_nadedrops 0
mp_roundrespawn_time 20
mp_auto_reload_weapons "1"
mp_refill_bpammo_weapons 1
mp_auto_join_team 0
mp_max_teamkills 3
mp_fraglimit 0
mp_timelimit 0
mp_forcerespawn 0
mp_hostage_hurtable 1
mp_show_radioicon 1
mp_old_bomb_defused_sound 1
bot_deathmatch 0
bot_quota_mode "normal"
showtriggers 0
sv_alltalk 2
mp_item_staytime 300
mp_legacy_bombtarget_touch "1"
mp_respawn_immunitytime "0"
mp_kill_filled_spawn "1"
mp_allow_point_servercommand "0"
mp_scoreboard_showhealth "3"
mp_scoreboard_showmoney "3"
ff_damage_reduction_bullets "0.35"
ff_damage_reduction_grenade "0.25"
ff_damage_reduction_grenade_self "1.0"
ff_damage_reduction_other "0.25"


其他设置

exit
chmod -R 777 /home/steam/steamcmd/hlds/

#修复/home/steam/.steam/sdk32/steamclient.so: cannot open shared object file: No such file or directory错误
mkdir ~/.steam/sdk32/
cp /home/steam/steamcmd/linux32/steamclient.so ~/.steam/sdk32/steamclient.so


启动

su - steam
cd /home/steam/steamcmd/hlds
screen ./hlds_run -game cstrike +exec server.cfg -pingboost 3 +port 27015 -nomaster -insecure +maxplayers 15 +map de_dust2 -noipx -tos +ip 0.0.0.0 -bots

如果要返回原回话,按CTRL+a,然后再按d

如果要进入HLDS运行的窗口,screen ls查回话名,比如是22218,然后输入screen -r 22218


输出信息 

Auto-restarting the server on crash

Console initialized.
Using breakpad crash handler
Setting breakpad minidump AppID = 10
Forcing breakpad minidump interfaces to load
Looking up breakpad interfaces from steamclient
Calling BreakpadMiniDumpSystemInit
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
Exe build: 18:58:01 Sep 21 2019 (1988)
STEAM Auth Server
Enabling LOWDELAY TOS option
Server IP address 0.0.0.0:27015

   Metamod-r version 1.3.0.128 Copyright (c) 2016-2018 ReHLDS Team (rebuild of original Metamod by Will Day and Jussi Kivilinna)
   Metamod-r comes with ABSOLUTELY NO WARRANTY; for details type `meta gpl'.
   This is free software, and you are welcome to redistribute it
   under certain conditions; type `meta gpl' for details.

Metamod-r v1.3.0.128, API (5:13)
Metamod-r build: 17:47:48 Aug 24 2018
Metamod-r from: https://github.com/theAsmodai/metamod-r/commit/0cf2f70

   AMX Mod X version 1.8.3-Re Copyright (c) 2004-2016 AMX Mod X Development Team (modification ReHLDS Team)
   AMX Mod X comes with ABSOLUTELY NO WARRANTY; for details type `amxx gpl'.
   This is free software and you are welcome to redistribute it under
   certain conditions; type 'amxx gpl' for details.

[ReAPI]: ReGameDLL API minor version mismatch; expected at least 13, real 9
[ReAPI]: Please update the ReGameDLL up to a minor version API >= 13
[ReAuthCheck] Version: 0.1.6 Linux 'Counter-Strike 1.6'
[ReAuthCheck] Success: Configuration executed.
[ReAuthCheck] Success: Build ReHLDS version defined Linux '1988'
ReGameDLL version: 5.9.0.387-dev
Executing ReGameDLL Configuration File
Navigation map loaded.
Executing AMX Mod X Configuration File
[S_API FAIL] SteamAPI_Init() failed; SteamAPI_IsSteamRunning() failed.
CAppInfoCacheReadFromDiskThread took 1 milliseconds to initialize
CApplicationManagerPopulateThread took 2 milliseconds to initialize (will have waited on CAppInfoCacheReadFromDiskThread)
Looking up breakpad interfaces from steamclient
Calling BreakpadMiniDumpSystemInit
Master server communication disabled.

Executing ReHLDS Configuration File
Executing ReGameDLL Configuration File
Executing Bots Configuration File
Executing Server Configuration File
Connection to Steam servers successful.
   VAC secure mode disabled.

CentOS8 构建ReHLDS Server

服务器不需要安装mmtimer1.6FPS为1000+,几个addons均运行正常


更新日期: 2020年01月08日
文章标签: Linux
文章链接: https://www.vos.cn/other/382.html  
版权说明:如非注明,本站文章均为vOS原创,转载请注明出处和附带本文链接。