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
Supported Games
Source Code Special Thanks
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
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:
Quote:
Example Server Output
Extra Command Line Options of Note
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. |
Re: Source Dedicated Server for Mac OS X
Nice work DS!
|
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. :)
|
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. The ResolveSymbol() crash should be fixed as of 1.4-hg3296. |
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. |
Re: Source Dedicated Server for Mac OS X
Quote:
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. |
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 |
Re: Source Dedicated Server for Mac OS X
thx a lot for this ! saved me the trouble of running srcds through parallels ...
|
Re: Source Dedicated Server for Mac OS X
nice
|
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 |
Re: Source Dedicated Server for Mac OS X
Quote:
However, I did start getting a crash that I don't think is related. I've updated the packages linked in the first post with a fix for that. It might be worth giving that a try. If that still doesn't work, make sure you've got a recent copy of the engine binaries extracted (the bin directory). Depending on which Steam option you're using (A or B) either make sure the CS:S client has been run recently or extract a fresh set of files from the "multiplayer ob mac binaries" GCF file. |
Re: Source Dedicated Server for Mac OS X
I'm also getting the same error, trying with option A, all I get is,
./srcds_run -game cstrike -console +map de_dust2 Auto detecting CPU Using OSX binary. Server will auto-restart if there is a crash. Using breakpad minidump system Using breakpad crash handler Console initialized. Game.dll loaded for "Counter-Strike: Source" Host_Error: IDLLFunctions::DLLInit returned false. Looking up breakpad interfaces from steamclient Calling BreakpadMiniDumpSystemInit found breakpad via in process memory: '/Applications/Steam.app/Contents/MacOS/osx32/../Frameworks/Breakpad.framework/Versions/A/Resources' Installing breakpad crash handler ##### Sys_Error: Host_Error: IDLLFunctions::DLLInit returned false. ./srcds_run: line 376: 17970 Bus error $HL_CMD |
Re: Source Dedicated Server for Mac OS X
For Steam options A or B, you need to add -steam to the command line.
|
Re: Source Dedicated Server for Mac OS X
I'm trying out option A, and getting the following:
Code:
~/library/Application Support/Steam/SteamApps/xxxxxxxx/team fortress 2 $ ./srcds_run -game tf +map ctf_2fort -steam I'm running OS X 10.7.2 with both Steam.app and SteamApps installed in their usual places. I'll move on to option C next, but I figured I'd ask. Thanks so much for putting so much work into this! |
Re: Source Dedicated Server for Mac OS X
Peterpants: Thanks for bringing this to my attention. The packages in the first post have been updated with a fix for this.
|
Re: Source Dedicated Server for Mac OS X
Fantastic! Works like a charm. Thank you!
|
Re: Source Dedicated Server for Mac OS X
So here's an odd one. Using method A, again, the TF2 server would advertise itself as game "tf" but with the game id set to 310 (in the udp server browser packet I found in a few places hex 36 01, representing 0x136 = 310), not 440 (0x1b8 or b8 01 in the packet) as it should be. As such, TF2 clients could not connect to it, being told they had the wrong game.
I found the ASCII string "310" in srcds_osx, and on a lark changed those three bytes to "440" and voila! TF2 works now. Thought I'd report what I found, in case it was useful. |
Re: Source Dedicated Server for Mac OS X
The reason 310 is being used is because that's the appid for the Source Dedicated Server tool on Steam. Setting it to 440 (or whatever the game id is) prevents the game client from running at the same time since Steam thinks it's already running. I guess this doesn't matter if you only care about running the server anyways, but some people like myself want to be be to run both for testing plugins or something.
That said, I was pretty sure connecting to the server was working before, but I guess something must have changed. I'll have to look into this more. Thanks for mentioning it! |
Re: Source Dedicated Server for Mac OS X
It looks like I was able to come up with a solution more quickly than I anticipated. Packages have been updated once again. You should be able to run both the server and the client at the same time if you wish, but the correct appid should now be there as well.
There don't seem to be very many users of this, so I'm sorry if it seems like you're a guinea pig. Thanks again for telling me about it! :) |
Re: Source Dedicated Server for Mac OS X
Can this server be accessed outside of the LAN?
|
Re: Source Dedicated Server for Mac OS X
Yes, it should be accessible to the outside world as long as your router or firewall settings allow it.
|
Re: Source Dedicated Server for Mac OS X
Awesome. Thanks I'll give this a try.
|
Re: Source Dedicated Server for Mac OS X
Sorry but I'm still very new to Macs, where do I find my SteamApps folder?
|
Re: Source Dedicated Server for Mac OS X
You can find it under /Users/<username>/Library/Application Support/Steam.
If you're using Lion (10.7) though, the Library folder is hidden. You can unhide this folder by running the following command in Terminal: chflags nohidden ~/Library OR Open Finder's "Go" menu, hold the Option key and click the entry for Library. |
Re: Source Dedicated Server for Mac OS X
Ahh thanks. Thought it was weird that I couldn't find it. Also, there doesn't seem to be a steamclient.dylib in the GCF file.
|
Re: Source Dedicated Server for Mac OS X
Quote:
steam_api.dylib loads steamclient.dylib from the Steam install. |
Re: Source Dedicated Server for Mac OS X
Quote:
|
Re: Source Dedicated Server for Mac OS X
Last login: Tue Dec 6 21:48:32 on ttys002
Mac-Mini:~ Svens$ /Users/Svens/Library/Application\ Support/Steam/SteamApps/mod_raich/counter-strike\ source/srcds_run ; exit; ERROR: Invalid game type 'tf' sepecified. Tue Dec 6 21:48:50 EET 2011: Server Failed logout [Process completed] EDIT: SUCCESS! GOT IT WORKING ;) You have to add -game gamename -map mapname -steam This happens when i launch it. Please step-by-step instructions ;) And yeah, i am trying to use it for half-life 2 deathmatch |
Re: Source Dedicated Server for Mac OS X
It is very useful for me.
|
Re: Source Dedicated Server for Mac OS X
Perfect! I love to my tests.
Quote:
|
Re: Source Dedicated Server for Mac OS X
I'm trying to get this to work on OS X 10.7 Lion with Left 4 Dead 2. I have the server up and running, but it tends to crash a lot. It crashes every time you finish a level in a campaign. This is making it impossible to actually complete a campaign. It's also giving me a whole bunch of errors for missing files and such. I took the files from the 'common' folder in SteamApps, so it should contain all the files, right?
Also when I'm in a game, part-way through it will start giving the following error over and over until either the server crashes or a new map is loaded: Quote:
Quote:
|
Re: Source Dedicated Server for Mac OS X
shadow: The majority of those error messages are actually normal. You'll see them on a Windows or Linux dedicated server too. However, the "Failed to create thread" error along with the crashing certainly is not.
I don't have an L4D2 install in front of me at the moment to confirm what might be happening here, but do you have steamclient.dylib, libtier0_s.dylib, and libvstdlib_s.dylib copied to your bin directory? (This part might not have been too clear). You can copy them from the Steam installation at: /Applications/Steam.app/Contents/MacOS/osx32 Alternatively, you could try adding '-steam' to the command line where it should automatically be able to find those libraries (but Steam would have to running in this case). Let me know if either these fixes the problem. If not, I'll try to take a deeper look at it when time permits. |
Re: Source Dedicated Server for Mac OS X
I had the 3 .dylib files in the left4dead2 directory. I just moved them to the bin directory and there was no change.
I appreciate the help! This has been killing me for the last two days trying to fix. |
Re: Source Dedicated Server for Mac OS X
Hi im sorry but im a complete twat when it comes to stuff like this, could i have a guide how to get a server for garrys mod, me and my friend just want to play a game of garrys mod and its driving us mental (both mac)
|
Re: Source Dedicated Server for Mac OS X
Quote:
It turns out I underestimated the importance of a particular library. So the solution is to also copy libsteam.dylib from your Steam install (/Applications/Steam.app/Contents/MacOS/osx32) and put it into the bin directory along with the other files that were copied. I'll update the opening post with this info as well. Thanks for bringing this problem to my attention! |
Re: Source Dedicated Server for Mac OS X
A note you may find interesting... Valve released a Linux HLDS (GoldSrc) server version yesterday that accidentally included an OSX version of the hltv binary instead of the Linux version...
So, maybe an officially supported version of HLDS and SrcDS for OSX are coming soon? |
Re: Source Dedicated Server for Mac OS X
Is there any new developments here? Is there a more detaied install information somewhere?
|
Re: Source Dedicated Server for Mac OS X
I have been working on option A as this seems to be the first spot to test/try and i am at a stand still. i have placed the files in the correct area and all I get is;
Last login: Sat May 12 07:19:03 on ttys000 server:~ dummel$ /Users/dummel/Library/Application\ Support/Steam/SteamApps/dummel/srcds_run ; exit; /Users/dummel/Library/Application Support/Steam/SteamApps/dummel/srcds_run: line 1: -game: command not found ERROR: Invalid game type 'tf' sepecified. Sat May 12 07:19:42 PDT 2012: Server Failed logout [Process completed] my srcds_run file starts out like this; -game cstrike +map de_dust -steam #!/bin/sh # # Copyright (c) 2004, Valve LLC. All rights reserved. # # a wrapper script for the main Source engine dedicated server binary. # Performs auto-restarting of the server on crash. You can # extend this to log crashes and more. not sure how else to make this work, any help would be greatly appreciated! |
Re: Source Dedicated Server for Mac OS X
1 Attachment(s)
You don't really need to edit the srcds_run file. You run it from the command line and add your server options there. (Any tutorials or documentation about running a Linux server is probably relevant.)
Just open the Terminal application and enter these two commands to take you the directory with the files and run the server: Code:
cd ~/Library/Application Support/Steam/SteamApps/dummel Attachment 103505 |
Re: Source Dedicated Server for Mac OS X
awesome, thank you for the reply!
|
All times are GMT -4. The time now is 17:26. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.