华为云云耀云服务器L实例评测|搭建CounterStrike Source Delicated Server(CS起源游戏服务器)

华为云云耀云服务器L实例评测|搭建CounterStrike Source Delicated Server(CS起源游戏服务器)

#【有奖征文】华为云云服务器焕新上线,快来亲身感受评测吧!#

⭐️ CounterStrikeSource(CS起源是Valve的一款多人游戏,允许玩家自由的假设社区服务器,并且可以通过Sourcemod等插件进行自定义)

🌫前言:

Valve提供了Source Delicated Server允许玩家搭建大多数的Source引擎的游戏,本文介绍的是在云耀服务器提供的Ubuntu系统中安装CounterStrike Source Delicated Server。

该游戏服务器支持linux和Windows操作系统,且配置要求不高,非常适合在轻型服务器中部署。

安装前请更新软件包和源

shell 复制代码
apt-get update
apt-get upgrade

Step.1 安装Steamcmd

Steamcmd是Steam的命令行工具,可以在命令行中执行命令,在下载CounterStrike Source Deilicated Server前,需要先行登录Steamcmd.

🏅方法一--->从仓库安装:

shell 复制代码
sudo apt install steamcmd

PS: 64位系统需要替换为如何命令

shell 复制代码
 sudo add-apt-repository multiverse
 sudo dpkg --add-architecture i386
 sudo apt update
 sudo apt install lib32gcc1 
 sudo apt install steamcmd 

如果lib32gcc1下载不了,可能需要替换为lib32gcc1-s1

不是所有源都提供了steamcmd,大概率需要手动下载

🥇方法二--->手动安装:

shell 复制代码
sudo apt-get install lib32gcc1 #同上如果提示lib32gcc1被lib32gcc-s1替换,则使用后者
shell 复制代码
mkdir ~/Steam && cd ~/Steam  #创建存放用的文件夹,当然你也可以创建新用户来操作
shell 复制代码
curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf -
  1. 下载并解压后可以看到

    ,直接执行steamcmd.sh脚本即可安装steamcmd

再次执行steamcmd.sh脚本,成功进入steamcmd即为安装成功

Step.2 安装CounterStrikeSource Delicated Server服务器

当你进入steamcmd中后,可以选择登录自己的steam账号,也可以选择匿名登录,并不需要登录也可以下载CounterStrikeSource Delicated Server。

PS:有一些服务器的下载需要登录Steam账号,具体请查看

Dedicated Servers List - Valve Developer Community (valvesoftware.com)

🔑先匿名登录steamcmd

shell 复制代码
login anonymous
shell 复制代码
force_install_dir ./css_server/   #指定下载的文件的存放路径

🔑下载CounterStrikeSource Delicated Server

shell 复制代码
app_update 232330   #根据游戏编号下载对应Server

Step.3 配置Server.cfg和motd.txt并运行Server

安装完成后进入安装的文件夹,进入cstrike文件夹寻找目标文件

创建并编辑server.cfg文件

⭐️PS:(server.cfg是服务器的配置文件,可以在其中详细定义服务器的设置,比如对局时间,最大比分...)

这里给出一个样例,具体的设置可以查阅文档

CFG - Valve Developer Community (valvesoftware.com)

SRCDS CFG Maker *UPDATED* [Counter-Strike: Source Modding Tools (gamebanana.com)](https://gamebanana.com/tools/1550)

shell 复制代码
// server.cfg
//****************************************
// Servername, Rcon-Passwort, Framerate
//****************************************
hostname "your server-name"
rcon_password "your-rcon-password"
fps_max "66.66"

//***********************************
// Bots
//***********************************
bot_add
bot_all_weapons
bot_allow_grenades 1
bot_allow_grenades 1
bot_allow_machine_guns 1
bot_allow_pistols 1
bot_allow_rifles 1
bot_allow_rogues 1
bot_allow_shotguns 1
bot_allow_snipers 1
bot_allow_sub_machine_guns 1
bot_auto_follow 0
bot_auto_vacate 1
bot_chatter off
bot_defer_to_human 0
bot_difficulty 0
bot_eco_limit 2000
bot_join_after_player 0
bot_join_team any
bot_prefix "[0]" // hier die bot_difficulty eintragen
bot_quota 8 // <<<<<<<<<<<<------------------------ 6
bot_quota_mode fill
bot_walk 0

//***************************************
// Spraylogos maximal alle 40 Sekunden
//***************************************
decalfrequency 40

//***********************************
// Bannlistenverwaltung
//***********************************
exec banned_ip.cfg
exec banned_user.cfg

//***********************************
// Logging
//***********************************
log on

//***********************************
// Alle Multiplayer-Parameter
//***********************************
mp_allowspectators 1
mp_autokick 0
mp_autoteambalance 1
mp_c4timer 35
mp_chattime 10
mp_falldamage 1
mp_flashlight 1
mp_flashlight 1
mp_footsteps 1
mp_footsteps 1
mp_forcecamera 0
mp_fraglimit 40
mp_freezetime 1
mp_friendlyfire 1
mp_friendlyfire 1
mp_hostagepenalty 3
mp_limitteams 1
mp_maxrounds 0
mp_playerid 1 // Bei CrosshairOver: 0=AlleNamen 1=NurTeammates 2=KeineNamen
mp_roundtime 3
mp_spawnprotectiontime 4
mp_startmoney 1000
mp_teamplay 1 // TDM
mp_timelimit 13 // 1 Map wird max 13 Minuten gespielt.
mp_tkpunish 0
mp_winlimit 0

//***********************************
// *** Maximale Mapgroesse ***
//***********************************
net_maxfilesize 64

//***********************************
// *** Die Serverparameter ***
//***********************************
sv_allowdownload 1
sv_allowupload 1
sv_alltalk 0
sv_cheats 0
sv_consistency 1
sv_downloadurl ""
sv_ignoregrenaderadio 1 // abschalten von 'fire in the hole' serverseitig
sv_lan 0 // 0=Internet+LAN 1=LAN
sv_maxspeed 320
sv_pausable 0
sv_rcon_maxfailures 2
sv_rcon_minfailures 1
sv_region 3 // Europa
sv_tags "your-tags"
sv_timeout 65
sv_voiceenable 1

//***********************************
// *** Gameplay ***
//***********************************
//phys_pushscale 12

// //sv_pure 0

添加完成后,可以考虑修改motd.txt的内容,(非必要)

💃PS:motd_default.txt里保存进入游戏的初始页,支持html,如果你希望玩家能反馈和联系你,则应该将你的联系方式放在上面

🔑运行CounterStrikeSource Delicated Server

当配置完成后,则可以运行server,在运行之前,请注意如下几点

  1. server的默认端口为27015,可通过参数-port更改,需要开放需要服务器端口

    复制代码
    27015 TCP/UDP (游戏数据传输, pings 和 服务器远程控制台) - 可以通过-port来改变
    27020 UDP (SourceTV 数据传输) - 可以通过+tv_port来改变
    27005 UDP (客户端端口) - 可以通过-clientport来改变
    26900 UDP (Steam端口, outgoing) - 可以通过-sport来改变
  2. 如果没有图形化界面的话,请安装screen等会话管理的工具进行启动(非必要)

🌀退回到安装目录,输入运行服务器参数

shell 复制代码
./srcds_run -game cstrike +map de_dust +maxplayers 24

PS:具体参数可查阅文档
https://developer.valvesoftware.com/wiki/Command_line_options#Source_Games

查看服务器运行情况如下

Step.4 游戏客服端连接服务器

当完成上述工作后,可进入Steam开启CS起源游戏客服端,进入控制台进行连接

shell 复制代码
connect xxx.xx.xx.xx:27015

或者在寻找界面中刷新,找到自己的服务器

相关推荐
AlfredZhao6 小时前
vi 删除指定范围的行,不用再反复按 dd
linux·vi
用户97183563346612 小时前
银河麒麟 KY10 申威(SW64) 安装 nginx-1.16.1-2.p01.ky10.sw_64.rpm 详细步骤
linux
猪脚踏浪14 小时前
linux 拷贝文件或目录到指定的位置
linux
大树881 天前
金刚石散热越强,管路越先见顶
大数据·运维·服务器·人工智能·ai
摇滚侠1 天前
Linux CentOS7 rpm 安装 MySQL 5.7
linux·运维·mysql
bush41 天前
嵌入式linux学习记录十四、术语
linux·嵌入式
载数而行5201 天前
Linux 11 动态监控指令top
linux
小宇宙Zz1 天前
Maven依赖冲突
java·服务器·maven
不会C语言的男孩1 天前
Linux 系统编程 · 第 8 章:进程基础
linux·c语言
古城小栈1 天前
Unix 与 Linux 异同小叙
linux·服务器·unix