callofduty4x / CoD4x_Server

Extended Call of Duty 4 server
https://cod4x.ovh
GNU Affero General Public License v3.0
336 stars 120 forks source link

LinuxGSM Support for CoD4 #103

Closed dgibbs64 closed 7 years ago

dgibbs64 commented 8 years ago

Hello,

I am the head developer of LinuxGSM http://gameservermanagers.com and am looking to add support for CoD4 https://github.com/GameServerManagers/LinuxGSM/issues/183 and thought you guys might be able to help. The guides out there for Linux servers are a little out dated and confusing. I wanted to see if there was an "official" way for go about it.

Normally I prefer not to use any modifications from the original server files and keep the server as vanilla as possible. However it might be a good idea in this case to use CoD4x (Im looking at adding ET Legacy for example). I do not know much about CoD4 server hosting and can see there are several mods available. So I am a little in the dark here. If you could point me in the direction of the proper and correct way to install CoD4 servers or guides/resources that would be really helpful.

Thank you

D4edalus commented 8 years ago

A simpler installation routine would be nice via LGSM since many have problems to install our server.

I don't know how LGSM works exactly, but I will try to explain a basic server setup

The CoD4 game client contains two folders main and zone which are needed to run a server. Our latest server release can be found here https://cod4x.me/. Also note that the archive to download contains another file that has to go into the main folder: xbase_00.iwd. We do not host the files contained in the game client. ( I don't think we would be even allowed to? - not sure )

Here you can find the list of files that are needed from the client: https://github.com/callofduty4x/CoD4x_Server/blob/master/scriptdocumentation/MULTIPLE_SERVERS_TUTORIAL.md#setting-up-base-game-server

The server can then be run with ./cod4x18_dedrun +map mp_killhouse +set net_port 28961

+exec server.cfg can be used to execute a configuration file with additional settings.

Some common pitfalls: The map argument is required, otherwise no map will be loaded and you cannot connect to the server. (You can also type that into the servers shell tho.) net_port is 28960 standard. However, if you run a client on the same machine too you have to change the servers port.

What also might be worth noting:

If you have any further questions feel free to ask.

T-Maxxx commented 8 years ago

@D4edalus forgot to mention, both games_mp.log and console_mp.log you might need are located always in directory called main but can be changed by fs_homepath dvar like you can see under link above. This is not a default behaviour, but it allows you to setup few servers using same basic files.

IceNinjaman commented 8 years ago

Interesting project (LGSM) you have there. I did not even know until yet about it. For getting CoD4 files inside zone and main SteamCMD could be a way. However it would only work for admins who own CoD4 on Steam.

dgibbs64 commented 8 years ago

thanks for the feedback. I may have a way of getting g the files from steam using f LGSM. I might also contact. The developers and see what response I get from them (if any)

dgibbs64 commented 7 years ago

I have a version up and running. https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/feature/cod4/CallOfDuty4/cod4server

Change the github branch to "feature/cod4" to get it to work. Its not quite finished but mostly works.

Im looking for a decent default config for COD 4 to add to https://github.com/GameServerManagers/Game-Server-Configs So if anyone has a good simple "vanilla" config they wish to submit please let me know. The same for the other COD servers if anyone has any.

A note about the server files. I looked at this and found a full version available and checked this against the game client. Basicly the version I am using only hasthe minimum files required to start a server and would not be able to start a client (as its missing the executable files and more) from these files. This also means the server is at around 3-4GB rather than around 10GB.

Let me know what you think :)

LWSS commented 7 years ago

That looks pretty good, I did notice that you check for the username root. On some of my servers, I have the root user renamed.

If you did something like this, I think it be better

if [ "$EUID" -ne 0 ]

Here's a basic server.cfg i'm using

sv_hostname "server name"

set g_gametype "sd"
set sv_mapRotation "gametype sd map mp_crossfire gametype sd map mp_crash"

rcon_password "serverOwnerPass"

sv_floodProtect "1"
sv_reconnectLimit "10"

sv_cheats "0"
sv_voice "1"
scr_teambalance "0"
g_allowvote "0"
sv_authorizemode "0"
sv_punkbuster 1

sv_allowDownload "1"
sv_wwwDownload "1"
sv_wwwbaseURL "http://website.com/cod4"
sv_wwwdldisconnected "0"

Also any custom files need to be hosted on a web server or ftp server. The server can deliver them built in, but the speed is only ~15kBps. That's what the last paragraph is for. The folder names on the webserver have to mirror the server directory too.

D4edalus commented 7 years ago

https://gameservermanagers.com/lgsm/cod4server