搜索
查看: 2294|回复: 3

为什么服务器重起之后记不住已经ban的IP??

[复制链接]
发表于 2003-2-9 16:49:58 | 显示全部楼层 |阅读模式 来自 中国–广东–广州–越秀区
怎么才能记住呢?
匿名  发表于 2003-2-9 17:41:23 来自 Invalid
Kicking & Banning


We have all come across those obnoxious people who purposely kill teammates, constantly spam messages or the obnoxious types who do not leave your server when you forgot to make your clan match private.   It is time to kick them.  But first, an important warning:  Do not be the obnoxious server admin who just randomly kicks people for fun or because you are a control freak.  If you are one of those control freak people, please post your rules in the motd.txt or something so the clients have a clue what they are in for.  The only thing worse than an obnoxious client, is an obnoxious admin.  Think before you kick - watch you server and people's actions and reactions.   If two people blame each other for something, either kick them both, or keep an eye on them for awhile until you can feel out the situation enough to make a fair assessment.  If you are one of those control freak people, please post your rules in the motd.txt or something so the clients have a clue what they are in for.

Before we get into the kicking and banning, we need to get familiar with how players are identified by the server.  The server assigns each player a "userid" (a number generated by the server) and a "uniqueid" (this number is unique per cd key and is assigned by WON, and will usually be around 10 digits).  To find these id's for a player, type "users" into the console.

Kicking Only

Obviously, the most common way to kick a player is to simply type "kick <playername>", and *poof*, they are gone.  Unfortunately, this may not always be the quickest way to boot a player, because some clients change their names to horrifically long names, or use characters that HL does not pick up on, hence making their name unusable in the kick command.  When this happens, you can use the other method of kicking by use of "userid" (this one I prefer).

First type "users" into the server console.  This will list all players and their corresponding "userid".  Find the id number of the player in question, and then type (make note of the spaces, because the spacing must be exact) "kick    #   <userid>" (as in "kick <space> # <space> <userid>", and once again, *poof*, they are gone.

Banning Only

Kicking a player is only temporary, though.  They can come back into the server immediately if they wanted to...   unless you ban them.  Use the "users" command to find their "uniqueid", and then ban them with "banid <minutes> <uniqueid>", where <minutes> is the number of minutes you want to ban the player from the server.  Use 0 minutes to make the ban permanent.  For example, if you wanted to permanently ban uniqueid 123456789, then you would type "banid 0 123456789".  If you want to make sure that someone is banned permanently even after your server has been restarted, be sure to "writeid" before you quit the server to write the banned uniqueid's to the banned.cfg.  Then, add "exec banned.cfg" to your server.cfg, so whenever you restart your server, it will read the uniqueid's listed in the banned.cfg and continue to ban them.

Kicking And Banning At Same Time

Sometimes we come across that player that needs to be kicked and banned at the same time, so they do not come back in after being kicked while we are frantically trying to type in the ban commands.  Now, we can do both in one fell swoop.  Type "users" to get the players "uniqueid".  Then use "banid <minutes> <uniqueid> kick".  And *poof* - the player in question has been both kicked and banned.  Again, be sure to "writeid" in the console next, and add "exec banned.cfg" to the server.cfg.


Getting List Of Banned Players

It is a good idea to keep a list of the users that you have banned permanently from your server.  The easiest way to do this is to "writeid" at the console before you quit the server to write the banned user "uniqueids" to the banned.cfg for.  You can then open up banned.cfg to see who all has been banned.  Also, be sure to add "exec banned.cfg" to your server.cfg so that everytime the map changes or the server restarts, it will reban those uniqueid's.  

Removing Player From Ban

If you want to remove a player from the banned list, use the "removeid <uniqueid>" in the console.  And be sure to remove it from the server.cfg found in the directory of the mod you use for your server if you placed it there as well.

Banning Only Via IP Address

Kicking a player is only temporary, though.  They can come back into the server immediately if they wanted to...   unless you ban them.  Use the "status" command to find their ip address, and then band them with "addip <minutes> <ipaddress>", where <minutes> is the number of minutes you want to ban the player from the server.  Use 0 minutes to make the ban permanent.  For example, if you wanted to permanently ban ip address 24.95.92.138, then you would type "addip 0 24.95.92.138".  Also, be sure to "writeip" before you quit the server to write the banned ip address to the listip.cfg for later use.  Last, add "filterban 1" to your server.cfg so whenever you restart your server, it will read the ip addresses in the listip.cfg and continue to ban them.  Also, if the person you are trying to ban has a dynamic ip addy, and changes it so they can come back in to keep bugging you, then ban their entire subnet.  Back to our example, if you wanted to ban the entire subnet of the ip address 24.95.92.138, you would type "addip 0 24.95.92".  Notice that the last set of numbers was left completely out.  If you check your "listip.cfg" after you "writeip", you will notice that it shows "addip 0.0 24.95.92.0"  The zero on the end acts as a wild card, and anyone whose ip address falls within that subnet is banned.

Adding Complete Lists of Banned ID’s

Some sites such as the CS Blacklist provide lists of supposed cheaters WON ID’s.  If you wanted to add this list to your banned.cfg the server must be OFF.  You can then add all the ID’s to the list.  HLDS has a built in feature that will not let you add to the banned.cfg unless you do it through the console.  Remember writeid and writeip?  Those commands keep it so the banned.cfg is kept intact, and prevent mishaps.  

Easier Way to Kick and Ban

AdminMod is one of the best methods to kick and ban people.  You do not need to use complete names of the person.  Partial, as long as they are unique, is more than adequate.
 楼主| 发表于 2003-2-9 18:55:56 | 显示全部楼层 来自 中国–广东–广州–越秀区
我明白了,要在server.cfg里面加入exec listip.cfg
回复

使用道具 举报

发表于 2003-2-9 19:24:08 | 显示全部楼层 来自 中国–广东–东莞
我又要加先得!
回复

使用道具 举报

游客
回复
您需要登录后才可以回帖 登录 | 注个册吧

快速回复 返回顶部 返回列表