Absurd Minds

More than 100 years without a motto.
It is currently 15 Dec 2019 01:59

All times are UTC-04:00




Post new topic  Reply to topic  [ 25 posts ]  Go to page 1 2 Next
Author Message
 Post subject: My FreeBSD HLDS
PostPosted: 11 May 2010 19:16 
Offline
User avatar

Joined: 25 Mar 2010 19:07
Posts: 8391
Recently I set up a half life dedicated server (HLDS) in my home. I'll tell you how I did it:

First off, I had to choose an operating system. There are two ways to make a HLDS - Windows-based server, or Linux-based server. It was a pretty even match up, but I eventually settled for Linux.
  • Windows-based and Linux-based servers both have a TON of support - often with Linux you are left without the compatibility or support that one would have with Windows, but that's not the case with a HLDS.
  • Linux is generally considered a more stable server than Windows.
  • Linux is open source, and thus free.
Before you make this decision, though, it's important to note, you probably won't have GUI when running a Linux-based server. No mouse, no clicking, no drag-and-drop - everything you do will have to be done through a command line. But, I imagine if you're thinking of setting up your own server that you at least know a bit about computers. And that's really all it takes.

After I decided on Linux, I had to decide on a distro. I originally planned on using Ubuntu Server Edition because I had earlier had an Ubuntu dual boot and thus knew my way around it a bit. But I scrapped that idea in favour of FreeBSD. FreeBSD is basically the most stable and efficient server OS there is.

FreeBSD is not linux, but with the right configuration you can basically run any Linux program in FreeBSD. So when installing FreeBSD, I had to make sure I installed all the correct things. This link describes in depth how to enable Linux-compatibility in your FreeBSD install.

I also made sure that when I was installing FreeBSD that I didn't install anything I didn't need. I didn't install X, the Graphical User Interface of Linux systems. I also didn't install any of the audio tools or picture editting tools or anything else that there was no way I would need just to run a HLDS.

The final consideration when installing FreeBSD was optimizing its internet connection for a server. I made sure to disable DHCP and to assign the computer a static internal IP address instead (and I reserved that IP address in my router), so that when it came to forward the correct ports I wasn't always having to change them as my router assigned a new IP address to the server machine.


Some common, FreeBSD-related problems you may run into

I had to major problems right off the bat when trying to get the server to run on FreeBSD. My first error was that every time I tried to run the server, I got a Fatal Error:
Code:
[S_API FAIL] SteamAPI_Init() failed; unable to update local steamclient. Continuing with current version anyway.
[S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.dll.
FATAL ERROR (shutting down): Unable to initialize Steam.
I figured out that I was getting that error because I did not install the linux tools properly. If you end up with that error, verify that you installed everything correctly.



The second problem I encountered came directly thereafter. Every time I tried to load the server, I got the following error message:
Code:
Unable to determine CPU frequency. Try defining CPU_MHZ
I fixed that by typing the following as root:
Code:
# mount -t linprocfs linproc /compat/linux/proc
I'm not exactly sure what that does, but for some reason it makes it so that the computer can "recognize" the CPU. The important thing, though, is that it works!

This is something that needs to be executed every time your computer boots up, but you can write a script (I called it linmount) to run it automatically at startup:
Code:
# cd /usr/local/etc/rc.d/
# nano linmount
add the following lines:
Code:
#!/bin/sh
mount -t linprocfs linproc /compat/linux/proc &
Now save the file and close it.
Next:
Code:
# nano /etc/rc.conf
add the following line:
Code:
linmount_enable="YES"
And that should do it for you.


Top
   
 Post subject: Re: My FreeBSD HLDS
PostPosted: 11 May 2010 21:08 
Offline
User avatar

Joined: 25 Mar 2010 19:07
Posts: 8391
Now that I had FreeBSD installed, it was time to install the HLDS. First off, I created a new user. It's not a good idea to operate as root if you don't have to, so I created a new user to run the server.
Code:
# adduser
It will then ask you for some information about this user you are going to add. This is just about what mine looked like:
Code:
adduser
Username: gamer
Full name: gamer
Vid (Leave empty for default):
Login group [gamer]: gamer
Login group is gamer. Invite gamer into other groups? []:
Login class [default]:
Shell [sh]: bash
Home directory [/home/gamer]:
Home directory permissions (Leave empty for default):
Use password-based authentication? [yes]: yes
Use empty password? (yes/no) [no]: no
Use a random password? (yes/no) [no]: no
Enter password: yourpassword
Enter password again: yourpassword
Lock out the account after creation? [no]: no
At this point, it will recap the user and ask if the information is correct. If it is, type yes; if not, type no, and then type yes when prompted to create another user.

Now that you have created a user, you should create a directory in which to place the server. /usr is your biggest partition, so create it somewhere in there. Perhaps something like this:
Code:
# mkdir /usr/home/gamer/hlds
Next, depending on where you actually put the directory, you may have the change the ownership of the directory. To change that, use
Code:
# chown -R gamer:gamer /usr/home/gamer/hlds
gamer:gamer is user:group (so if you chose a different username and/or group name, be sure to edit that accordingly) and -R makes it so that it changes the ownership of the directory and all subdirectories.


Top
   
 Post subject: Re: My FreeBSD HLDS
PostPosted: 11 May 2010 21:44 
Offline
User avatar

Joined: 25 Mar 2010 19:07
Posts: 8391
Now that you have created your user and your directory, you're ready to begin the actual installation.

Currently, the Half Life Dedicated Server Updatetool is located at http://store.steampowered.com/about/. Down at the bottom, click on "Tools" and choose the Linux Updatetool. If it's not located there by the time you read this tutorial (Steam may change around their site or something), just search the site for it - it's there somewhere.

I'll tell you what to do, and in green I'll explain what it's doing

# su gamer switch user to gamer
Password: Enter your password: it won't mirror your typing with ***, so don't be alarmed
$ cd /usr/home/gamer/hlds Move to the directory you'll be installing the server in
$ fetch http://storefront.steampowered.com/download/hldsupdatetool.bin This is the current link to download the HLDS software.
chmod +x hldsupdatetool.bin Changes the mode of the file to "execute", so you can execute the binary.
$ ./hldsupdatetool.bin ./ means the current directory, so in the current directory, you are executing hldsupdatetool.bin.
type yes to accept the agreement
$ chmod +x steam again, changes "steam" so you can execute it
$ ./steam -command update -game czero -dir . Change "czero" to be whatever game you are installing, such as cstrike or dod. (I made a full list of possible mods here[/ur] for future reference.) I always have to run this command three or four times before it's finished. Just continue running it until you get a finalized installation. This may take a while, depending on your connection speed. Once this is completed, you have a ve ... t=232]link.


Top
   
 Post subject: Re: My FreeBSD HLDS
PostPosted: 11 May 2010 23:32 
Offline
User avatar

Joined: 25 Mar 2010 19:07
Posts: 8391
Now that you've got your very basic server installed, take a look at some of your files, especially those in ./hlds/czero. I'll explain some of those files here:


server.cfg

This file is what contains all of your basic server settings. The server.cfg file gets executed every time the server starts, so if you make a change within this file you'll have to restart your server (or use the rcon command "exec server.cfg") in order for those changes to take effect.

This is what one of my server.cfg files looks like. (Again, everything in green is just my comment about what's happening)

// Use this file to configure your DEDICATED server. Anything with a // in front of it is a comment - it doesn't get executed at all.
// This config file is executed on server start.

sys_ticrate 1000 This is the server's FPS. So my server renders 1000 frames per second
//fps_max 500 fps_max is NOT a valid HLDS server.cfg cvar. fps_max is a CLIENT setting. To control your server's fps, use sys_ticrate. If you use fps_max, you will NOT change your fps.
(fps_max does control your fps in a source server though... just FYI.)


sv_aim 0 Enables/disables the auto aim function. 0-off, 1-on
pausable 0 Sets whether or not you can pause the server
sv_proxies 0 The number of HLTV proxies that can connect to the server.
rcon_password ***** Set your rcon password here
sv_region 0 Your server's region. Check here for a list of regions.
log off Sets whether or not your server logs. Useful for catching people breaking rules, but it can make a lot of log files, so be sure to delete them frequently.
hostname "[AM] Pub|*RECRUITING*|1000fps|FastDL" Sets the name of your server.

sv_downloadurl "http://****" If you have a fast download server, specify the URL here

sv_allowupload 1 Allow players to upload to the server, ie allow them to use custom sprays.
sv_allowdownload 1 Whether or not players can download content from your server (sounds, maps, skins, etc). You should pretty much always have this set to 1.
decalfrequency 15 The frequency in seconds with which a player can spray.

sv_maxrate 15000 The largest number of bytes/second a player can request from a server. 0 is unlimited
sv_minrate 2000 The minimum number of bytes/second a player can request.
sv_maxupdaterate 30 Maximum number of updates/second that the server will send a player.

I have explained how to optimize rates in [uarl=http://absurdminds.net/forums/viewtopic ... 1359#p1359]this post[/url]

sv_voiceenable 1 Sets whether or not players can talk.
sv_voicecodec voice_speex The voice codec used. This codec is automatically installed (you don't have to do it yourself) but this cvar isn't automatically in the server.cfg. If everybody's voices sound robotic, it's probably because you forgot to add this cvar.
sv_voicequality 3 Choose from 1-5. 1 is worst, if you REALLY need to preserve bandwidth. 5 is best, and a good choice to use on a hosted scrim server or something where bandwidth is no issue but voice quality is. 3 is a good middle ground.
sv_alltalk 0 Set whether or not players can hear people who are on the other team.

mp_timelimit 0 This is the amount of time in minutes that the server will stay on one map. 0 is no limit.
mp_maxrounds 21 The maximum number of rounds that a server will stay on one map.
mp_winlimit 0 The maximum number of wins one team can have before the map will change
Use any combination of these three cvars to control how frequently the server changes map.

mp_roundtime 2.5 The amount of time in minutes for each round
mp_chattime 5 The amount of time in seconds that you can talk at the end of a map before the map change actually occurs.

mp_c4timer 35 How long the C4 beeps before explosion.

mp_autoteambalance 1 Set whether or not the server auto-team-balances if the teams are uneven.
mp_limitteams 1 The number of players one team is allowed to have over the other. 0-no limit. 1-one player. 2-two players.
mp_allowspectators 1 Allow people to be in Spectator.
mp_autokick 1 Whether or not it kicks people who are in spectate.


mp_freezetime 5 The amount of time in seconds you have at the beginning of the round where you can't move.
mp_buytime .5 The amount of time in seconds that you're allowed to buy at the beginning of the round.
mp_startmoney 800 The amount of money you start with.

mp_flashlight 1 Set whether or not players can use their flashlight.
mp_footsteps 1 Set whether or not footsteps make noise.
mp_forcechasecam 0 Set how a dead player can spectate living players. 0-no restrictions. 1-view your teammates in locked chase cam. 2-view your teammates in first person view.

mp_friendlyfire 1 Sets friendly fire
mp_hostagepenalty 0 The number of hostages a player can kill before they get kicked.
mp_tkpunish 0 Sets whether a player gets slayed on next spawn for team kill.

sv_cheats 0 Sets the server to VAC secure.
sv_consistency 0 Allows players to use custom models. 0-no consistency check performed. 1-Allows custom models that aren't huge. 2-Will drop any player who doesn't have the same models.
sv_lan 0 Sets whether the server runs on a LAN or over the internet
sv_password Sets a password on the server. Leave blank for a public server.

humans_join_team any Allow humans to join any team.
bot_join_team any Allow bots to join any team.
bot_join_team_ct, for example, would restrict bots to joining just the CT team.

bot_quota 0 The number of bots on the server.
bot_auto_vacate 0 Sets whether or not a bot leaves to make room for a human player.
bot_difficulty 0 The bot skill level. 0-easy. 1-medium. 2-hard. 3-expert.
bot_join_after_player 0 If set to 1, the bots won't join until a human joins. If 0, bots will play on the server without humans.

These are the weapons settings for the bots.
bot_allow_grenades 0
bot_allow_shield 0
bot_allow_snipers 1
bot_allow_machine_guns 1
bot_allow_rifles 1
bot_allow_shotguns 1
bot_allow_sub_machine_guns 1
bot_allow_pistols 1

bot_prefix [AbsurdBot] This prefix will be on the bot's name.
bot_chatter off Set whether the bots talk over the radio.
bot_defer_to_human 1 Set whether or not bots can rescue hostages or defuse the bomb if humans are still alive.
bot_stop 0 With bot_stop 1, the bots won't move or shoot.


// load ban files To add bans, use these files.
exec listip.cfg addip 0.0 1.2.3.4 - that's a permanent ban to IP address 1.2.3.4
exec banned.cfg banid 120.0 STEAM_0:0:00000 - Bans the steam ID 0:0:00000 for 120 minutes.


Top
   
 Post subject: Re: My FreeBSD HLDS
PostPosted: 11 May 2010 23:35 
Offline
User avatar

Joined: 25 Mar 2010 19:07
Posts: 8391
motd.txt

This is the MOTD that people will see when they first join the server, before they choose what team they go on. You can edit this however you want, to make a nice fancy MOTD if you desire. It uses HTML.

Fixing the MOTD scrolling problem

I noticed on my server, after I had added a bunch of lines to the MOTD, that the MOTD needed to scroll. It was too much text to fit on the screen at once, so the MOTD had a scroll bar. For some reason, though, dragging the scoll bar did not work. The scroll bar went down, but the text did not move up. It made it impossible to read the rest of the MOTD.

To fix this problem, delete the following line at the top of the MOTD:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
I have no idea what that line does or why it breaks the scrolling, but removing that line fixes the problem.

mapcycle.txt

These are all the maps that the server cycles through. If you download a custom map, you need to add it to the mapcycle.txt in order for it to show up in the map rotation. This is also the order the maps cycle in. Switch the maps around to change up the order.

Other config files

If you have other config files (perhaps a CEVO config file or something), these files go into this folder as well.


Top
   
 Post subject: Re: My FreeBSD HLDS
PostPosted: 12 May 2010 00:01 
Offline
User avatar

Joined: 25 Mar 2010 19:07
Posts: 8391
Maximizing your server's rates

Steam wrote an article about maximizing server rates, but it's for both HLDS and Source servers. This post tells you about rates specific to HLDS servers.

There are basically five rates your server has:

sys_ticrate
sv_maxrate
sv_minrate
sv_maxupdaterate

sys_ticrate
sys_ticrate controls how many frames per second the server renders.

sys_ticrate is set in the server.cfg file.

sys_ticrate 60 is the default, but a server can be run with as many as 1000 fps.

A higher sys_ticrate will use more resources, so if you're running a really crappy machine, don't try to run 1000 fps.

There is almost no reason to ever have a sys_ticrate 1000. My server happens to run at that because my server hosting company doesn't know what sys_ticrate is, but don't shill out big bucks to get a 1000fps server. There is really no way you wouldn't do perfectly fine with sys_ticrate 500, and going over that is just a waste of money. If you're hosting the server yourself, by all means, boost it up there, but don't pay for something that won't make any difference.

sv_maxrate
This is the maximum number of bytes per second that a player can request from the server. This is set in the server.cfg file.

If you set it low, it will tend to help players who have crappy internet connections to still get pretty good gameplay. It does this by restricting the amount of bandwidth people can use. Thus, people with even the best internet connections can't use a lot of bandwidth and steal it from the people with the bad internet connections. A person with a good internet connection will experience worse gameplay, but the people with worse connections won't have all their bandwidth stole by the good internet connection people. It tends to equalize the gameplay when you have people with lots of very different internet connections who want to play your server.

If you some how had unlimited bandwidth, then that wouldn't matter at all. The people with good internet connections could use as much as they wanted, and the people with worse connections could still transfer all the stuff they possibly can. On the other hand, if you have very limited bandwidth (perhaps you're running the server off a home machine), then you will want to make sure that all the bandwidth isn't being used by a couple of players by setting the rate low.

If you set the rates high, people with good internet connections will have a much better gaming experience, with less lag and better hit registry. If you're running a server where most people who connect have pretty much the same internet connections and are basically the same distance away, and good, lag-free performance is essential (for example, a scrim server located in a central location), then you want to set the rate higher.

I find that sv_maxrate 6500 is a great low rate for my home machine.
My scrim server has sv_maxrate 30000.
A pub server would do plenty well with sv_maxrate 15000.

sv_minrate
This is the minimum number of bytes per second that the player can request. This is set in the server.cfg file.

Set this number really high if you want to keep people with really poor connections from playing on the server.

On all my servers, I have sv_minrate 2000. You can also set sv_minrate 0 if you don't really care at all what the internet connection is like.

If you want to keep people with bad internet connections from joining, set it really high.

sv_maxupdaterate
This is the number of times per second the server will update. This too is set in the server.cfg file.

I find that 30 is a really good rate, and 15 works really well on my servers that running off my mediocre home machine.

Pingboost
Another important factor in a server is ping boosting. Ping boosting is set in the command line of a Linux-based HLDS server. To pingboost a Windows server, you need to download some sort of plugin.

Ping boosting can increase player ping in your server by as much as 20ms. Pingboost increases the CPU load, which decreases server latency.

You can ping boost your server by adding the command line entry -pingboost 1, -pingboost 2, or -pingboost 3.

-pingboost 1 and 2 will both decrease player by about 10ms, but they use a different method. pingboost 3 will decrease player ping by up to 20ms, but it will increase the CPU load a lot.

If you have a good internet connection but a crappy computer, I recommend not using pingboost as it may overload your computer when people are already getting pretty good pings in your server. If you have a good computer and a crappy internet, pingboosting your server might help player performance in your server. If you have a crappy computer and a crappy internet, you could try to improve player pings with pingboosting, but be really careful to pay attention to other aspects of gameplay - be sure you haven't overloaded your system and sacrificed other performance necessities just to try to pingboost.


Top
   
 Post subject: Re: My FreeBSD HLDS
PostPosted: 12 May 2010 10:06 
Offline
User avatar

Joined: 25 Mar 2010 19:07
Posts: 8391
Now that I had my server.cfg file editted to my liking, I decided to add some plugins. An un-modified server is pretty boring - almost every single server you play on is running AMX Mod X, and that's what I installed on my server as well.

For AMXX to work, I first had to install metamod. It's basically the program that lets the server communicate with any plugins you want installed.

I made a directory to put the metamod .so file, downloaded the compressed file, and then decompressed it.
Code:
$ cd /usr/home/gamer/hlds/czero
$ mkdir ./addons
$ mkdir ./addons/metamod
$ mkdir ./addons/metamod/dlls
$ fetch http://downloads.sourceforge.net/project/metamod/Metamod%20Binaries/1.19/metamod-1.19-linux.tar.gz
$ tar xfz metamod-1.19-linux.tar.gz
Now, I have to edit my liblist.gam file so that it references metamod instead of just referencing the normal game.
Code:
$ cd /usr/home/gamer/hlds/czero
$ nano liblist.gam
Edit the line: gamedll_linux "dlls/cs_i386.so"
Replace it with: gamedll_linux "addons/metamod/dlls/metamod_i386.so"


Top
   
 Post subject: Re: My FreeBSD HLDS
PostPosted: 12 May 2010 20:05 
Offline
User avatar

Joined: 25 Mar 2010 19:07
Posts: 8391
With Metamod successfully installed, it was time to install AMX Mod X.

I've got to download both the AMXX base, and also the Counter-Strike addon. If I were making a Day of Defeat server, I'd want to make sure to install the DoD addon instead of the cstrike addon.
Code:
$ cd usr/home/gamer/hlds/czero
$ fetch http://downloads.sourceforge.net/project/amxmodx/AMX%20Mod%20X%20Base/1.8.1/amxmodx-1.8.1-base.tar.gz
$ fetch http://downloads.sourceforge.net/project/amxmodx/Counter-Strike%20Addon/1.8.1/amxmodx-1.8.1-cstrike.tar.gz
$ tar xfz amxmodx-1.8.1-base.tar.gz
$ tar xfz amxmodx-1.8.1-cstrike.tar.gz
Next, I've got let metamod know that it needs to be paying attention to this AMX Mod X thingy I just installed. I'm going to simultaneously make a file called "plugins.ini" in the metamod directory as well as write a specific line to that file:
Code:
$ echo "linux addons/amxmodx/dlls/amxmodx_mm_i386.so" > /usr/home/gamer/hlds/czero/addons/metamod/plugins.ini
If you wanted to, you could cd to /usr/home/gamer/hlds/czero/addons/metamod and check out that there is indeed a file there called plugins.ini. Pretty neat stuff.

Now AMX Mod X is installed. Next up is configuring AMXX.


Top
   
 Post subject: Re: My FreeBSD HLDS
PostPosted: 13 May 2010 00:27 
Offline
User avatar

Joined: 25 Mar 2010 19:07
Posts: 8391
The most important file in your AMX Mod X folder if your amxx.cfg file. It should be in /hlds/czero/addons/amxmodx/configs.
Code:
$ cd /usr/home/gamer/hlds/czero/addons/amxmodx/configs
$ nano amxx.cfg
You should see something like this:
Quote:
// AMX Mod X Configuration File
echo Executing AMX Mod X Configuration File

// Default access for all non admin players (see users.ini for access details)
//
// Default value: "z"
amx_default_access "z"

// Name of setinfo which should store a password on a client (you should change this)
// Note: Always prefix the field with an underscore (aka: "_")
// (Example: setinfo _pw "password")
//
// Default value: "_pw"
amx_password_field "_pw"

// Mode of logging to a server
// 0 - disable logging, players won't be checked (and access won't be set)
// 1 - normal mode which obey flags set in accounts
// 2 - kick all players not on list
//
// Default value: 1
amx_mode 1

// Show admins activity
// 0 - disabled
// 1 - show without admin name
// 2 - show with name
//
// Default value: 2
amx_show_activity 2


[...]


// HUD-statistics display limit relative round freeze end
// Negative time will clear the HUD-statstics before the round freeze time has ended
//
// Default value: -2.0
amx_statsx_freeze -2.0

// Third party cvars

vm_alives 0
vm_deads 2

hpk_ping_max 250
hpk_ping_time 5
hpk_ping_tests 4

amx_mapchooser_type 1
amx_mapchooser_mapsloc 0
amx_mapchooser_mapsfile "maps.ini"
amx_nominfromfile 0
amx_maxnominperplayer 2
amx_map_history 5
amx_extendmap_max 30
amx_extendmap_step 10
amx_ext_round_max 2
amx_ext_round_step 8
amx_rtv 1
amx_rtv_percent 0.5
amx_rtv_min_time 3
amx_rtv_map_time 300




exec /addons/amxmodx/configs/clan.cfg
The amxx.cfg file has lots of explanations about each of the cvars, so I won't go through and explain them. But one important thing to notice is at the bottom, I have a bunch of third party cvars. These are the cvars necessary to run the third party plugins I have installed. In my case, I have Voices Management, mapchooser4, amx_super, and clan tag protection. I'll explain installing plugins later on in the thread.


Top
   
 Post subject: Re: My FreeBSD HLDS
PostPosted: 14 May 2010 18:39 
Offline
User avatar

Joined: 25 Mar 2010 19:07
Posts: 8391
Aside from amxx.cfg, there are a couple of other important config files in the /addons/amxmodx/configs folder.

users.ini

The users.ini file might be the next most important file. This is where you set which admin have access to what commands. It keeps you from having to give out the rcon password (after all, anybody who has the rcon password can do rcon commands), and instead restricts certain commands to certain people.

The users.ini file has a nice description at the top that tells you how to add admin.

I found it really helpful to put a comment after each admin entry that told me who that admin was. That way if I ever needed to edit somebody's admin or delete an admin, it would be a lot easier.
Code:
"STEAM_0:0:11783847" "" "bcdefghijklmnopqrstu" "ce" ;Anubis

cmdaccess.ini

You'll notice at the top of the users.ini file, there is a list of some access flags. For example, a is the access flag for immunity. The ENTIRE list of flags is found in the cmdaccess.ini file. In fact, this file is updated with access flags found in any third party plugin you install as well.

I think it's a really good idea to go through all the command flags and make sure that if you give an admin "c" access (or whatever) that ALL off the flags he has access to are things you want. I found a couple of instances where a very small flag was also linked to a more important flag and I didn't want those two linked together. I found it helpful to make a database that listed all the flags and what each flag did, and then adjust them as needed.


maps.ini

maps.ini servers two purposes: This is the file from which AMX pulls its map votes; it is also the list of maps in the amxmodxmenu map change menu from which an admin can choose. So if you add custom maps to your server, you should make sure to add the map (case sensitive) to the list. I put my list in alphabetical order as it made it much easier to delete maps if I needed to.


plugins.ini

This is where you edit which specific plugins AMX Mod X uses. There are the standard plugins, which are listed at the top, plus a section at the bottom where one can add the names of third party plugins. Make sure that if you add a plugin, you put the name in exactly, and include the .amxx file extension.


modules.ini

This file tells AMX Mod X which modules to use. I have never had to edit this, but some plugins will specify that it needs a certain module to be active in order to function. If you ever come across that, this is the file you need to edit. Just uncomment whatever module it specifies (that is, remove the ; in front of the module name).


Top
   
 Post subject: Re: My FreeBSD HLDS
PostPosted: 14 May 2010 18:58 
Offline
User avatar

Joined: 25 Mar 2010 19:07
Posts: 8391
Putting stuff on your server

Now comes an important question: how do you even get these plugins and maps to put on your server in the first place?

I use two methods: SSH and Lynx.

SSH

SSH is a method of securely transferring files from one machine to another. Once you've got it configured, you can use something like FileZilla to transfer files from one computer to the other. So, you could use your Windows machine to download a plugin, and then use ssh to move that plugin to your FreeBSD machine.

If you didn't install ssh on your FreeBSD machine when you installed the OS, you need to install it.
Code:
# cd /etc
# sysinstall
Configure
Networking
sshd
/etc/ssh/sshd_config is the file to edit if you have to change any of the ssh configurations, but it would be fine to leave it as default, as well.

FreeBSD doesn't normally allow you to log in as root with ssh.

So now to use ssh, you would open up something like FileZilla and set up a transfer with the following information:

Host: sftp://yourIP. If your computer and the FreeBSD computer are on the same network, use the internal IP address. If they are not on the same network, use the external IP. eg sftp://192.168.0.0 or sftp://68.32.253.0
Username: gamer
Password: yourpassword
Port: 22


Lynx

If you'd rather just download the file directly onto the FreeBSD machine instead of downloading to a Windows machine and then transferring to FreeBSD, the program to use is Lynx. This is a fully functional web browser that operates from the command line. Just type lynx into your command line, and it will open up. From there, you can go to google or to other sites in order to find whatever you want to download.


Top
   
 Post subject: Re: My FreeBSD HLDS
PostPosted: 15 May 2010 15:48 
Offline
User avatar

Joined: 25 Mar 2010 19:07
Posts: 8391
Installing maps

If you want to have a server that plays something other than just the few basic czero maps, you're going to have to install those maps onto your server by hand. But don't worry: Installing new maps to your server is pretty easy.

1. Pick a site to get maps from. I have two sites I really like: cstrike-planet and fpsbanana. I prefer cstrike-planet because it's waaaay less buggy than fpsbanana, and a much faster site. But I think fps banana actually has a bigger map database. If I'm looking for a specific map, I will usually check cstrike-planet, then fpsbanana, and if neither of those two sites have it, I will just use google.

2. Download all the files. They usually come in a zip folder or something. Most maps require more than just the .bsp file, and almost every zip file you download is structured with the correct directory structure.

3. Put the correct files in the correct directories. For example, put the .bsp file in the maps folder. Put anything in the "models" folder of the zip file into your "models" folder of your czero folder.

4. Put the map name in your mapcycle.txt file and/or your maps.ini file - whichever file you use as your map-changing file on the server. I always put the name in both files, just in case I decide one day that I don't want to use the maps.ini file anymore, at least I will still have all the maps listed in mapcycle.txt.

5. If you use the Change Level section of your amxmodmenu to try to change the level, the new maps won't show up in the list until the next map change, so don't get worried and think that you did it wrong. (AMX Mod X files only get reloaded every map change.)

6. If your server crashes when you try to change the map, it's probably because you're missing an integral file. verify that you put all of the downloaded files in all of the correct directories. It's pretty easy to accidentally drag the file into the wrong directory or something.


NOTE: A czero server can run 1.6 maps, but a 1.6 server can't use a map that ends with _cz - those are czero-specific maps. Neither server can run a CS:Source map.


Top
   
 Post subject: Re: My FreeBSD HLDS
PostPosted: 15 May 2010 19:36 
Offline
User avatar

Joined: 25 Mar 2010 19:07
Posts: 8391
Installing plugins for AMXX

The next thing you might want to do as an AMXX server runner is install plugins to your server. This requires a couple of steps.

First off, decide which plugins you want. Download those plugins off the internet. I HIGHLY recommend Allied Modders. They have a TON of plugins.

Each thread should have the plugin attached to it. Download the plugin to your /amxmodx/plugins folder. I also highly recommend you download the sma file (the source code) and place it in your /amxmodx/scripting folder.


Compiling a plugin

I recommend downloading the sma file in case you should need to recompile the plugin. Sometimes the plugins are really buggy, and the only way to fix problems is to fix a line or two in the code. If you should happen to do something like that, you'll need to recompile the plugin.
Code:
$ cd /usr/home/gamer/hlds/czero/addons/amxmodx/scripting
$ ./amxxpc [i]sourcefile[/i].sma
As long as you didn't break the code while you were playing around with it, it will spit out a sourcefile.amxx file. Just move that file to your plugins folder and you have your newly compile plugin.
Code:
$ cp sourcefile.amxx ../plugins
(../ means back one directory)


Activating your plugin

Once you have your plugin in the plugins folder, go back to your configs folder.
Code:
$ ../configs
$ nano plugins.ini
At the end of the file, under third party plugins, add the name of your plugin.amxx to the list. Make sure you spell it correctly, that you have the same case, and that you put .amxx at the end of it. Once you put the plugin name here, it should be active.


Configuring your plugin

Most of the threads at Allied Modders have really specific instructions on exactly how to configure the plugin. Usually, it will simply be a list of cvars (configuration variables) that you can edit to your liking. These cvars usually go into your amxx.cfg file. On the rare occasion that they actually go into a different file, the thread will tell you what file to put them in. (Usually that means creating a specific cfg file to put the cvars in.)


Top
   
 Post subject: Re: My FreeBSD HLDS
PostPosted: 17 Aug 2011 11:15 
Offline

Joined: 17 Aug 2011 11:12
Posts: 5
I setup a server thanks to your guide. However, I'm only getting 50fps little - not +, even with "-tos, -pingboost 3 and +sys_ticrate 1000/0.

How can I achieve those high fps?

I installed just a base FreeBSD (minimal) and made it Linux compatible by installing Linux base. And made an absolute clean HLDS installation without any plugins, still getting terrible fps. :(

Thanks and nice share.


Top
   
 Post subject: Re: My FreeBSD HLDS
PostPosted: 17 Aug 2011 12:05 
Offline
User avatar

Joined: 25 Mar 2010 19:07
Posts: 8391
What kind of a machine is it installed on? What is the CPU? How much RAM does it have?

Also, what is -tos? I haven't ever seen that in a list of command line options.


Top
   
 Post subject: Re: My FreeBSD HLDS
PostPosted: 17 Aug 2011 14:23 
Offline

Joined: 17 Aug 2011 11:12
Posts: 5
Well before applying anything I tested it on my own machine which is Core i7-2600k with 6GB ram (2000MHz) triple-channel.

I tried uc'ng it at stock speed, but no luck.

Edit: I found out that I had to set it's kern.hz, I change it to 2000hz now it's running fine.
W/o pingboosting it's giving me 600+fps at an average of 640fps. But bad thing is that with -pingboost 2 it takes no effect whatsoever, it gives the 1000fps constant with -pingboost 3, whereas in Debian it gives 980+fps even with -pingboost 2.

So far the good thing is that without even boosting it impress me. No doubt, it's good but I've to learn about BSDs a little bit more as I'm new to this arena. Inspired from your guide and some other people's views.

Now I've another problem that following method doesn't worked, I tried giving it chmod 777 but still it doesn't starts with the boot. Any help regarding this? Thanks.
Quote:
# cd /usr/local/etc/rc.d/
# nano linmount

add the following lines:
Code:
#!/bin/sh
mount -t linprocfs linproc /compat/linux/proc &


Top
   
 Post subject: Re: My FreeBSD HLDS
PostPosted: 17 Aug 2011 15:55 
Offline
User avatar

Joined: 25 Mar 2010 19:07
Posts: 8391
Ah, cool, I'm glad you figured it out. Thanks for posting the solution.

As for the second problem, did you add linmount_enable="YES" to /etc/rc.conf?


Top
   
 Post subject: Re: My FreeBSD HLDS
PostPosted: 17 Aug 2011 16:14 
Offline

Joined: 17 Aug 2011 11:12
Posts: 5
Yes I did exactly what was mentioned above, but no luck. :(
Also, can you please add auto starting of the server with boot in first post? :)

Thanks.


Top
   
 Post subject: Re: My FreeBSD HLDS
PostPosted: 17 Aug 2011 18:36 
Offline
User avatar

Joined: 25 Mar 2010 19:07
Posts: 8391
I really don't know anything about bash scripting lol. I basically only know how to do exactly what is posted in that thread. I've never bothered with trying to figure out how to script a startup command since the server is pretty much never down.


Top
   
 Post subject: Re: My FreeBSD HLDS
PostPosted: 17 Aug 2011 18:45 
Offline

Joined: 17 Aug 2011 11:12
Posts: 5
Well I found another script at steam forums but that too didn't worked at all. I'll look into that later on, perhaps I myself missing something.

Also you should mention that linmount has to be in executive mode (chmod +x) because I tried running it directly (./linmount) but it denied so I gave it chmod +x and than ran it.

Thanks for the help. :)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 25 posts ]  Go to page 1 2 Next

All times are UTC-04:00


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Limited