반응형
서버내에서도 기본적으로 누가 접속하는지 저도는 표시를 해주는데요..
문제가 되는게..

게임상 이용하는 닉네임이야 누구든지 아무렇게나 변경이 가능하고..
콘솔에서 접속이 표시되고.. Spectators나 팀으로 이동하는것이 채팅창에 표시가 안되기에..
누가 왔는지 혹은 나갔는지를 알수가 없습니다..



이를 악용하는 경우도 있고
본의아니게 .. 어 님 언제 왔어요? 라고 묻는 경우도 생기지요...

머 대단한것도 아니고..
누가 누구인지 확인하기도 요긴할뿐더러... 또 단점도 존재하기는 하지만 장점이 좀 있기에 설정해보았습니다..


Connect Announce - By Arg!


http://forums.alliedmods.net/showthread.php?t=77306

원래는 서버에 접속할때마다.. 국가와 스팀아이디 그리고 조인하는 사람의 아이피를 보여주는데요..
굳이 국가 까지는 표기할 필요가 없어서.. 위에처럼.. 스팀아이디와 아이피정도만 표기해보았습니다.

Commands:

    * sm_geolist <name or #userid> - lists player(s) and their country.
    * sm_joinmsg [message] - (console command) player can use this to set their custom join message (if allowed) or if no message provided will display their currently set message.
    * sm_joinmsgon <name or #userid> - allow target to set their custom join message.
    * sm_joinmsgonid '<steamId>' '<player name>' - allows specified steam id to set a custom join message, useful if player not in game. Player name is only an indicator so the file storing the messages is human readable.
    * sm_joinmsgoff <name or #userid> - disallow target from having a custom join message.
    * sm_joinmsgoffid '<steamId>' - disallow specified steam id from having a custom join message.
    * sm_setjoinmsg <name or #userid> '<message>' - set a custom join message for target, if they are allowed to have one.
    * sm_setjoinmsgid '<steamId>' '<message>' - set a custom join message for steam id, if it is allowed
    * sm_setjoinsnd <name or #userid> '<sound file path>' - set a custom join sound for target, if they are allowed to have one.
    * sm_setjoinsndid '<steamId>' '<sound file path>' - set a custom join sound for steam id, if it is allowed
    * sm_playsnd '<sound file path>' - plays sound file to all clients, useful for testing sound files before applying to a client.

Cvars:

    * sm_ca_connectdisplaytype - <1|0> if 1 then displays enhanced connect message after admin check and allows the {PLAYERTYPE} placeholder. If 0 displays enhanced connect message on client auth (earlier) and disables the {PLAYERTYPE} placeholder
    * sm_ca_showenhanced <1|0> - shows the enhanced player connect message from this plugin.
    * sm_ca_showenhanceddisc <1|0> - shows the enhanced player disconnect message from this plugin.
    * sm_ca_showstandard <1|0> - shows the standard player connect message.
    * sm_ca_showstandarddisc <1|0> - shows the standard player disconnect message.
    * sm_ca_showenhancedadmins <1|0> - shows a different enhanced connect/disconnect message to admins with the generic flag. Message customised in /data/cannounce_settings.txt'
    * sm_ca_autoallowmsg <1|0> - allows admins with the kick flag to always be able to set a custom join message.
    * sm_ca_playsound <1|0> - if enabled, plays a sound on each player connect.
    * sm_ca_playsoundfile <sound file path> - specifies sound file to play if sm_ca_playsound is enabled.
    * sm_ca_playdiscsound <1|0> - if enabled, plays a sound on each player disconnect.
    * sm_ca_playdiscsoundfile <sound file path> - specifies sound file to play if sm_ca_playdiscsound is enabled.
    * 'sm_mapstartnosound' (float, defaults to 30.0) - specify time to play NO connect sounds after map start

명령어나.. Cvars들이 어지럽게 설명되어 있지만 굳이.. 머 따로 설정할 필요는 없습니다.
그래도 .. 나중에 확인해야 할지도 모르니 포함시켰구요..

자 이제 설치하는 방법을 확인해보죠..
위에 파일을 받으신후 (혹은 해당 페이지에서 받으신후) 압축을 풀게되면..



이렇게 풀리게 되는데요..
Plugins 에는 cannounce.smx 파일이 있고..
Translations 에는 cannounce.phrases.txt 파일이 있습니다.

plugins/cannounce.smx 에 있는 파일은.. 서버 설치되어 있는곳에서 addons 란에 안에 있는 sourcemod/plugins 에 넣어주시면 되구요
translations/cannounce.phrases.txt 파일은 addons 란에 sourcemod/translations 안에 넣어주시면 됩니다.

이렇게 넣어준후.. 서버를 재 실행하게 되면..

cstrike/cfg/sourcemod/cannounce.cfg  그리고 cstriks/addons/sourcemod/data/cannounce_settings.txt 파일이 생성됩니다.

어짜피 설정은 굳이 건들을 필요는 없는터라.. cannounce.cfg 파을은 그냥 내버려두구요..
우리가 수정해줘야 할부분은... cannounce_settings.txt 파일입니다..

"CountryShow"
{
    "messages"
    {
        "playerjoin"        "{GREEN}{PLAYERNAME}{DEFAULT} 님이 {DEFAULT}[{LIGHTGREEN}{STEAMID}{DEFAULT}][{GREEN}{PLAYERIP}{DEFAULT}] 접속했습니다."
        "playerdisc"        "{GREEN}{PLAYERNAME}{DEFAULT} 님의 {DEFAULT}[{LIGHTGREEN}{STEAMID}{DEFAULT}][{GREEN}{PLAYERIP}{DEFAULT}] 접속이 끊기셨습니다. {GREEN}이유: {DEFAULT}{DISC_REASON}"
    }
    "messages_admin"
    {
        "playerjoin"        "{GREEN}{PLAYERNAME}{DEFAULT} 님이 {DEFAULT}[{LIGHTGREEN}{STEAMID}{DEFAULT}][{GREEN}{PLAYERIP}{DEFAULT}] 접속했습니다."
        "playerdisc"        "{GREEN}{PLAYERNAME}{DEFAULT} 님의 {DEFAULT}[{LIGHTGREEN}{STEAMID}{DEFAULT}][{GREEN}{PLAYERIP}{DEFAULT}] 접속이 끊기셨습니다. {GREEN}이유: {DEFAULT}{DISC_REASON}"
    }
}


저는 cannounce_settings.txt 파일을 위와같이 수정을 해줬는데요..
여기서 사용되는 명령어들을 설명하자면..

    * {PLAYERNAME} - 플레이어 이름
    * {PLAYERTYPE} - 등록된 관리자는 admin 으로 일반 플레이어는 player 라고 표시됩니다.
    * {STEAMID} - 스팀아이디
    * {PLAYERCOUNTRY} - 접속 국가..
    * {PLAYERCOUNTRYSHORT} - 접속 국가.. 코드명 (kr 같은거)
    * {PLAYERIP} - 접속한이의 아이피
    * {DISC_REASON} - 접속이 끊긴 이유.. 인터넷이 끊기거나 사용자가 직접 끊거나.. 를 구분하는 목적인듯.

이건 글자색을 꾸밀때 쓰는거 같아요..

    * {DEFAULT} - 원래 글 색..
    * {LIGHTGREEN} - 연두색 글자로 표기
    * {GREEN} - 녹색 글자로 표기
    * {YELLOW} - 노란색인데 TF2 만 되는듯


요렇게만 설정하고 저장하시면..


이런식으로 접속할때 표시가 됩니다.

반응형