华为云云耀云服务器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,如果你希望玩家能反馈和联系你,则应该将你的联系方式放在上面** ![请添加图片描述](https://file.jishuzhan.net/article/1709419546441420801/fa72c26d737f6c0f7095ff570bc07dc0.webp) 🔑**运行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 查看服务器运行情况如下 ![请添加图片描述](https://file.jishuzhan.net/article/1709419546441420801/e882ca8d4de8a9fd7cf742a233c822f6.webp) #### **Step.4 游戏客服端连接服务器** 当完成上述工作后,可进入Steam开启CS起源游戏客服端,进入控制台进行连接 ```shell connect xxx.xx.xx.xx:27015 ``` 或者在寻找界面中刷新,找到自己的服务器 ![请添加图片描述](https://file.jishuzhan.net/article/1709419546441420801/f655267133b586117f00de09cdc82703.webp)

相关推荐
程序员JerrySUN14 分钟前
驱动开发硬核特训 · Day 22(下篇): # 深入理解 Power-domain 框架:概念、功能与完整代码剖析
linux·开发语言·驱动开发·嵌入式硬件
白总Server14 分钟前
多智能体系统的中间件架构
linux·运维·服务器·中间件·ribbon·架构·github
未来会更好yes39 分钟前
Centos 7.6安装redis-6.2.6
linux·redis·centos
二猛子41 分钟前
Linux(Centos版本)中安装Docker
linux·docker·centos
浪裡遊2 小时前
跨域问题(Cross-Origin Problem)
linux·前端·vue.js·后端·https·sprint
二狗哈2 小时前
制作一款打飞机游戏26:精灵编辑器
游戏·编辑器
Johny_Zhao2 小时前
OpenStack 全套搭建部署指南(基于 Kolla-Ansible)
linux·python·信息安全·云计算·openstack·shell·yum源·系统运维
2401_867021902 小时前
文件缓冲区(IO与文件 ·III)(linux/C)
linux·运维·服务器·c语言
刘某的Cloud2 小时前
rabbitmq常用命令
linux·运维·分布式·rabbitmq·系统