خادم CS2 هو اللعبة نفسها في الوضع المخصّص (dedicated): يشغل نحو 60 GB، لذا تحقّق من المساحة الحرة مسبقًا. ولمباراة من 10 لاعبين دون إضافات، تكفي عادةً 4 GB من RAM.
1. نزّله
باستخدام SteamCMD:
# Windows
C:\steamcmd\steamcmd.exe +force_install_dir C:\cs2 +login anonymous +app_update 730 validate +quit
# Linux (بالمستخدم steam)
~/steamcmd/steamcmd.sh +force_install_dir ~/cs2 +login anonymous +app_update 730 validate +quit
2. احصل على رمزك (GSLT)
من دونه، لن يتمكن أي شخص من خارج شبكتك من الدخول:
- ادخل إلى
steamcommunity.com/dev/managegameserversبحسابك في Steam. - في الحقل App ID اكتب
730، وأضف ملاحظة لتتعرّف عليه. - انسخ الرمز الذي يعطيك إياه. رمز واحد لكل خادم.
لا يمنح Steam هذه الرموز إلا للحسابات غير المقيّدة (limited)، والمرتبطة برقم هاتف، والخالية من أي حظر.
3. في Linux فقط: إصلاح steamclient.so
من دون هذا، يشتكي الخادم من أنه لا يجد Steam:
mkdir -p ~/.steam/sdk64
ln -sf ~/steamcmd/linux64/steamclient.so ~/.steam/sdk64/steamclient.so
4. شغّله
# Windows
C:\cs2\game\bin\win64\cs2.exe -dedicated -usercon +game_type 0 +game_mode 1 +mapgroup mg_active +map de_dust2 +sv_setsteamaccount GSLT_TOKEN
# Linux
~/cs2/game/cs2.sh -dedicated -usercon +game_type 0 +game_mode 1 +mapgroup mg_active +map de_dust2 +sv_setsteamaccount GSLT_TOKEN
في Linux، استخدم دائمًا cs2.sh وليس الملف التنفيذي مباشرة: فهو يجهّز البيئة التي يحتاج إليها الخادم.
| النمط | game_type | game_mode |
|---|---|---|
| Casual (عادي) | 0 | 0 |
| Competitive (تنافسي) | 0 | 1 |
| Wingman | 0 | 2 |
| Deathmatch | 1 | 2 |
5. الاسم وكلمة المرور وRCON
أنشئ الملف game/csgo/cfg/server.cfg:
hostname "My CS2 server"
sv_password ""
rcon_password "LONG_PASSWORD"
اترك sv_password فارغًا لخادم مفتوح. والخيار -usercon في سطر التشغيل هو ما يفعّل RCON.
6. المنافذ
- 27015 UDP: اللعبة. ضروري.
- 27015 TCP: RCON، فقط إذا كنت تستخدمه من الخارج.
- 27020 UDP: SourceTV، فقط إذا فعّلته.
# Windows (PowerShell بصلاحيات المسؤول)
New-NetFirewallRule -DisplayName "CS2 UDP 27015" -Direction Inbound -Protocol UDP -LocalPort 27015 -Action Allow -Profile Any
# Linux
ufw allow 27015/udp
للدخول: افتح وحدة التحكم في اللعبة واكتب connect IP_ADDRESS:27015.