AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Source Servers (SRCDS) (https://forums.alliedmods.net/forumdisplay.php?f=130)
-   -   Source Dedicated Server for Mac OS X (https://forums.alliedmods.net/showthread.php?t=158240)

DS 06-02-2011 03:48

Source Dedicated Server for Mac OS X
 
14 Attachment(s)
Since Valve has decided not to release SrcDS for OS X, I took things into my own hands.

I noticed that a "dedicated.dylib" binary was included for most available Source engine games. This binary is what handles the logic for dedicated servers. I hoped that I could do something with it and I have -- but not without a lot of hacks.

My primary motivation for this was to make testing easier (for Metamod:Source and SourceMod). I find it nice to be able to develop and test without needing to run the full games on listen servers. This also has the advantage of being able to run inside a virtual machine that lacks the necessary hardware acceleration.

Hopefully someone else out there will find this useful. If you have any problems or questions, feel free to post them.

Download
Requirements
  • macOS 10.9 or later
  • One of the supported games listed below

Supported Games
  • Counter-Strike: Global Offensive
  • Counter-Strike: Source
  • Day of Defeat: Source
  • Day of Infamy
  • Garry's Mod
  • Half-Life Deathmatch: Source
  • Half-Life 2: Deathmatch
  • Insurgency
  • Left 4 Dead
  • Left 4 Dead 2
  • Nuclear Dawn
  • Source SDK Base 2013 Multiplayer Mods
  • Team Fortress 2

Source Code
Special Thanks
  • pRED: Created CDetour
  • psychonic: Checked dyld symbols on version 10.5 and tested under virtual machine
  • Fyren: Pasted some vital output from srcds and gdb on Linux
  • Open Steamworks
  • Udis86 by Vivek Thampi

General Guidelines

There are essentially two options for running a server. You could run it directly from the game's install directory in SteamApps (usually ~/Library/Application Support/Steam/SteamApps/common/<game>). Or you may opt to have a separate copy of the game by copying it either from the SteamApps/common directory or from a SteamCMD install.

Once you have downloaded the package, place the srcds-cli.bundle and srcds.sh files from it into the server's root directory.

Counter-Strike: Source Example
  • Note: The Library folder may be hidden in Finder by default. To get there you can either use Finder's Go menu while holding the Option/Alt key or you can unhide it semi-permanently it by running the following Terminal command:
    Quote:

    chflags nohidden ~/Library
    You may have to reapply this nohidden flag after a macOS update.

Once the files from the package have been extracted/copied, you can run the server by navigating to the server root directory in Terminal:
Quote:

cd ~/Library/Application\ Support/Steam/SteamApps/common/Counter-Strike\ Source/
Then you can start the server by running srcds.sh with the game name, map, and any other options you'd like:
Quote:

./srcds.sh -game cstrike +map de_dust -maxplayers 16 +log on
Example Server Output

Extra Command Line Options of Note
  • -32 : Force the 32-bit version of the dedicated server to run instead of the 64-bit one. This option currently only applies to Day of Infamy.
  • -nosteamupdate : Disable automatic download and updating of Steam libraries. It is highly recommended NOT to use this unless you are having problems or Steam download servers are down.
  • -noupdate : Disable automatic update of srcds binaries. It is highly recommended NOT to use this unless you are having problems or are stuck on "Checking for srcds updates..."
  • -steambeta : Switch to beta branch for Steam libraries. Much like you can switch your Steam client to opt into the beta version, you can also use the beta version of Steam libraries with your server. Unless you having problems or there is something specific you need from the beta version, you probably don't want this either.
Note on Counter-Strike: Global Offensive

The game is now 64-bit on macOS. The latest development builds of Metamod:Source and SourceMod will run on this.

Note on Insurgency

You may use the client install of the game to run a server, but Mac binaries are also included in the dedicated server install. You can download this by using steamcmd with appid 237410. Alternatively, you can get it in the Tools section of the Steam client where it's currently labeled Insurgency Dedicated Server.

Notes on Day of Infamy

Like Insurgency, you may use the client install of the game to run a server, but Mac binaries are also included in the dedicated server install. You can download this using steamcmd and appid 462310.

Also note that a 64-bit version of this now exists and is the one that runs by default. Metamod:Source and SourceMod currently do not run on this, but they should in the near future. So if you need to continue running the 32-bit version, make sure you add -32 to your command line.

asherkin 06-02-2011 03:56

Re: Source Dedicated Server for Mac OS X
 
Nice work DS!

GoD-Tony 06-10-2011 04:35

Re: Source Dedicated Server for Mac OS X
 
Wow this is very nice. You should sticky this in the SRCDS section so it doesn't get lost. :)

DS 06-15-2011 02:34

Re: Source Dedicated Server for Mac OS X
 
I had some time to test this on Lion (10.7) and found that it didn't work at all. There was also a problem when using the latest Steam client beta along with the -steam option on Orange Box/Source 2009 games.

Both problems have now been fixed. The source code and binaries have been updated.

It should also be noted that SourceMod will likely crash when trying to resolve symbols on Lion due to a very similar issue. I hope to have a fix for that tomorrow.
The ResolveSymbol() crash should be fixed as of 1.4-hg3296.

KyleS 06-21-2011 17:50

Re: Source Dedicated Server for Mac OS X
 
Great work!

While I realize this may seem like a silly request, but is there any chance this could be ported to Linux? I'd much rather run as much open source code as I can. While I'd like to do it myself, it would probably result in an unfinished/unstable product.

DS 06-21-2011 18:07

Re: Source Dedicated Server for Mac OS X
 
Quote:

Originally Posted by KyleS (Post 1493081)
While I realize this may seem like a silly request, but is there any chance this could be ported to Linux?

This would be a pretty easy thing to do since there would be no hacks required, but keep in mind, it'd only be a replacement for the srcds_linux binary. So I don't really see much point in it.

It's not as though I re-implemented the dedicated lib or any of the others for OS X. I only made use of the existing libraries with a few hacks thrown in to make it work.

KyleS 06-22-2011 03:51

Re: Source Dedicated Server for Mac OS X
 
I know nothing has been rewritten gamewise. I'm more after inner binary loading instead of using LD_PRELOAD which has some marginal overhead per call.

I love customization :P

neo_gis 07-17-2011 16:45

Re: Source Dedicated Server for Mac OS X
 
thx a lot for this ! saved me the trouble of running srcds through parallels ...

oday91 07-19-2011 12:04

Re: Source Dedicated Server for Mac OS X
 
nice

ajstorey915 08-09-2011 18:59

Re: Source Dedicated Server for Mac OS X
 
I am trying to use this dedicated server by adding to my current Steam CS:S installation and I cannot get it to work correctly. I am running 10.7.

When I try and start the server I get the following error.

##### Sys_Error: Host_Error: IDLLFunctions::DLLInit returned false


All times are GMT -4. The time now is 19:59.

Powered by vBulletin®
Copyright ©2000 - 2019, vBulletin Solutions, Inc.