Raised This Month: $ Target: $400
 0% 

Source Dedicated Server for Mac OS X


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DS
SourceMod Developer
Join Date: Sep 2004
Location: WI, USA
Old 06-02-2011 , 03:48   Source Dedicated Server for Mac OS X
Reply With Quote #1

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.

Last edited by DS; 12-22-2017 at 12:03. Reason: Revamped for srcds-nx
DS is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 06-02-2011 , 03:56   Re: Source Dedicated Server for Mac OS X
Reply With Quote #2

Nice work DS!
__________________

Last edited by asherkin; 06-02-2011 at 08:51. Reason: Needed more !.
asherkin is offline
GoD-Tony
Veteran Member
Join Date: Jul 2005
Old 06-10-2011 , 04:35   Re: Source Dedicated Server for Mac OS X
Reply With Quote #3

Wow this is very nice. You should sticky this in the SRCDS section so it doesn't get lost.
GoD-Tony is offline
DS
SourceMod Developer
Join Date: Sep 2004
Location: WI, USA
Old 06-15-2011 , 02:34   Re: Source Dedicated Server for Mac OS X
Reply With Quote #4

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.

Last edited by DS; 06-16-2011 at 17:10.
DS is offline
KyleS
SourceMod Plugin Approver
Join Date: Jul 2009
Location: Segmentation Fault.
Old 06-21-2011 , 17:50   Re: Source Dedicated Server for Mac OS X
Reply With Quote #5

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.
KyleS is offline
DS
SourceMod Developer
Join Date: Sep 2004
Location: WI, USA
Old 06-21-2011 , 18:07   Re: Source Dedicated Server for Mac OS X
Reply With Quote #6

Quote:
Originally Posted by KyleS View Post
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.
DS is offline
KyleS
SourceMod Plugin Approver
Join Date: Jul 2009
Location: Segmentation Fault.
Old 06-22-2011 , 03:51   Re: Source Dedicated Server for Mac OS X
Reply With Quote #7

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
KyleS is offline
neo_gis
Member
Join Date: Sep 2009
Location: Rabat
Old 07-17-2011 , 16:45   Re: Source Dedicated Server for Mac OS X
Reply With Quote #8

thx a lot for this ! saved me the trouble of running srcds through parallels ...
__________________
neo_gis is offline
Send a message via MSN to neo_gis Send a message via Skype™ to neo_gis
oday91
Junior Member
Join Date: Jun 2011
Old 07-19-2011 , 12:04   Re: Source Dedicated Server for Mac OS X
Reply With Quote #9

nice
__________________
oday91 is offline
ajstorey915
New Member
Join Date: Jul 2011
Old 08-09-2011 , 18:59   Re: Source Dedicated Server for Mac OS X
Reply With Quote #10

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:LLInit returned false
ajstorey915 is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:20.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode