/********************************************************************************************* * UFBCOM Lite Server side Plugin v06 **********************************************************************************************/ /********************************************************************************************* * Don't modify this plugin in order to abuse of the service, of whatever which may cause lags, * problems,... to our servers. Just because I can be really more dolt than you :) * * This plugin is open source and under LGPLv3 Licence. * * This plugin allows to access to some of the service provided by UFBTEAM * -The main service is the banlist, based on cheater catch with UFBCOM. * -All other services are OPTIONNALS * * A web front end of the anticheat is available at http://steamid.eu * * This plugin is the LITE version of the administation plugin of the -=UFB=- Community * If you want to be one of our partner (access to more informations, having your server in the client,...) * please contact us @ staff@ufbteam.com or on our website http://ufbteam.com * * * BAN SUPPORT * We are reviewing ALL the unban request. On request differents admins can check your request ! * * **********************************************************************************************/ /********************************************************************************************* * UFBCOM by hackziner * hackzner@ufbteam.com * hackziner@hotmail.com * UFBTEAM (Running under law 1901 (France)) * staff@ufbteam.com * http://ufbteam.com **********************************************************************************************/ /* Commands: amx_force :: Force a STEAM_ID to install UFBCOM to play on your server amx_unforce :: Unforce a STEAM_ID to install UFBCOM to play on your server say: /screenshotall /ssa :: Take a screenshot of all players with ufbcom /forcemenu :: Open a menu to force someone to install UFBCOM on your server /ufbcomlist :: List the players with UFBCOM cvar: ufbcomlite_version :: Version of the plugin... You should check on http://steamid.eu if you have the lastest version ufbcomlite_required :: Optionnal :: If UFBCOM is mandatory to play on the server (Players will have to install UFBCOM Client to play on the server) ufbcomlite_login :: Username (Going to replace ip address for login in futur versions @ http://ufbteam.com/ufbcom/community/ ) ufbcomlite_password :: Password for the web interface ufbcomlite_onlybanlist :: (Default 1) :: Use only the banlist function. ufbcomlite_nokickwatched :: (required onlybanlist=0) :: 0 = kick "watched" player who haven't UFBCOM 1= Watched player with UFBCOM can play but the server display a warning message ufbcomlite_noautoban :: Disable the Autoban (based on process) for this server (So only ban based on screenshot will be enable) ufbcomlite_tag :: Change the tag of player with UFBCOM (add a * at the beginning) */ #include #include #include #define PLUGIN "UFBCOM Lite" #define VERSIONP "0.6" #define VERSION "001" #define AUTHOR "hackziner" #define SOCKET_TASK 23233 #define SOCKET_PORT 20069 #define CHEATER_BAN_DURATION 30 #define UFBCOM_SERVER "94.23.6.124" //reverse: ufbteam.com #define TASK_SLOW 0.2 //You can change this value from 0.2 to 1.0... It's the interval between to check of incoming packets //Options related var new required new onlybanlist new nokickwatch new noautoban new tag new maxplayers //Current max players of the server new ufbcom[33]; //If a player has ufbcom or not new sckRemoteServer //Chaussette new port[16] //Port of this server new cmd[512] //Buffer for cmd //statics string new szIP[64] new szAuthID[64] new szName[128] new CurrentMap[64] new players // Current number of players public plugin_init() { new error new password[64] //Uncript password new username[64] //Username (Going to replace ip address for login in futur versions ) new passwordmd5[34] //md5 hash of the password register_plugin(PLUGIN, VERSIONP, AUTHOR) register_clcmd("say", "handle_say") //No need to explain register_cvar("ufbcomlite_version",VERSIONP,FCVAR_SERVER) //Version of the plugin... You should check on http://steamid.eu if you have the lastest version register_cvar("ufbcomlite_required","0",FCVAR_SERVER) // Optionnal :: If UFBCOM is mandatory to play on the server (Players will have to install UFBCOM Client to play on the server) register_cvar("ufbcomlite_login","",FCVAR_PROTECTED) // Username (Going to replace ip address for login in futur versions ) register_cvar("ufbcomlite_password","",FCVAR_PROTECTED) //Uncript password for web interface register_cvar("ufbcomlite_onlybanlist","1",FCVAR_SERVER) //Only act as a banlist register_cvar("ufbcomlite_nokickwatched","0",FCVAR_SERVER) //0 = kick "watched" player who haven't UFBCOM 1= Watched player with UFBCOM can play register_cvar("ufbcomlite_noautoban","0",FCVAR_SERVER) //Disable the Autoban (based on process) for this server (So only ban based on screenshot will be enable) register_cvar("ufbcomlite_tag","0",FCVAR_SERVER) // Change the tag of player with UFBCOM register_concmd("amx_force","CMD_force",ADMIN_KICK,"") // Add someone to the watchlist of the server register_concmd("amx_unforce","CMD_unforce",ADMIN_KICK,"") //Remove someone of the watchlist of the server get_mapname (CurrentMap,64) get_cvar_string("port",port,15) get_cvar_string("ufbcomlite_password",password,63) get_cvar_string("ufbcomlite_login",username,63) required=get_cvar_num("ufbcomlite_required") onlybanlist=get_cvar_num("ufbcomlite_onlybanlist") nokickwatch=get_cvar_num("ufbcomlite_nokickwatch") noautoban=get_cvar_num("ufbcomlite_noautoban") tag=get_cvar_num("ufbcomlite_tag") sckRemoteServer = socket_open(UFBCOM_SERVER,SOCKET_PORT, SOCKET_UDP,error) if(sckRemoteServer <= 0 || error) server_print("UFBCOM: Couldn't connect to ufbcom master server") set_task(TASK_SLOW, "receive_info", SOCKET_TASK, "",0, "b") md5(password, passwordmd5) format(cmd, 255, "%s|MAPCHANGE|%sē%dē%sē%sē%dē",VERSION,port,required,passwordmd5,username,noautoban,CurrentMap) socket_send2(sckRemoteServer, cmd,strlen(cmd)) cmd="" maxplayers = get_maxplayers() new temps[32] format_time ( temps,32, "%S") if(containi(temps, "2")!=-1 || containi(temps, "5")!=-1 || containi(temps, "5")!=-3 ) { set_task(random_float(100.00,800.00) , "auto_screenshot", 23236) //IF you server has a very big map time, you can change this to add a "periodical" screenshot. You can also reduce the time if you map time is very short } } public plugin_end () { socket_close(sckRemoteServer) //avoid 55555x sockets open at the same time :) remove_task(SOCKET_TASK) } public client_putinserver(id) { ufbcom[id]=0 //The guy haven't UFBCOM if (!is_user_bot(id)) { get_user_authid(id,szAuthID,32) get_user_ip(id,szIP,64) get_user_name(id,szName,128) szName=format_name(szName) players = get_playersnum(1) //Update current player number formatex(cmd, 256, "%s|CONNECT|%sē%sē%sē%sē%dē",VERSION,szAuthID,szIP,szName,port,players) //Send player information to UFBCOM server. socket_send2(sckRemoteServer, cmd,strlen(cmd)) cmd="" } } public client_disconnect(id) { if (!is_user_bot(id)) { static szIP[64] static szAuthID[64] static szName[128] ufbcom[id]=0 get_user_authid(id,szAuthID,32) get_user_ip(id,szIP,64) get_user_name(id,szName,128) szName=format_name(szName) players = get_playersnum(1) formatex(cmd, 256, "%s|DONNECT|%sē%sē%sē%sē%dē",VERSION,szAuthID,szIP,szName,port,players) socket_send2(sckRemoteServer, cmd,strlen(cmd)) cmd="" } } public CMD_force(pid,level,cid) { if(!cmd_access (pid,level,cid,1)) return PLUGIN_HANDLED new arg[32],id read_argv(1,arg,31) id = cmd_target(id,arg,8) get_user_authid(id,szAuthID,32) get_user_ip(id,szIP,64) get_user_name(id,szName,128) szName=format_name(szName) formatex(cmd, 256, "%s|EXFORCE|%sē%sē%sē%sē",VERSION,szAuthID,szIP,szName,port) socket_send2(sckRemoteServer, cmd,strlen(cmd)) return PLUGIN_HANDLED } public CMD_unforce(pid,level,cid) { if(!cmd_access (pid,level,cid,1)) return PLUGIN_HANDLED new arg[32] read_argv(1,arg,31) formatex(cmd, 256, "%s|EXUNFORCE|%sē ē ē%sē",VERSION,arg,port) socket_send2(sckRemoteServer, cmd,strlen(cmd)) return PLUGIN_HANDLED } public receive_info() { new len,id len=0 if (socket_change(sckRemoteServer,1)) { static recv[1024] len=socket_recv(sckRemoteServer, recv,1024) if (len > 8 ) { static string_b[1024] static version[8] static command[32] static sid[32] static ssid[32] strtok(recv,version,8,string_b,1299,'|') strtok(string_b,command,32,recv,1299,'|') if( containi(command, "BANNED") != -1 ) { //Ban for xx minuts a player that's ban from UFBCOM strtok(recv,sid,32,string_b,1299,'|') server_cmd(";amx_ban %c%s%c %d %cUFBCOM Ban: http://ufbteam.com%c ",'"',sid,'"',CHEATER_BAN_DURATION,'"','"') server_print("UFBCOM: %s is in the banlist and has been banned from the server",sid) } if( containi(command, "PING") != -1 ) //Keep the spirit alive { formatex(cmd, 256, "%s|PONG|%sē",VERSION,port) socket_send2(sckRemoteServer, cmd,strlen(cmd)) } if( containi(command, "UNLOG") != -1 && onlybanlist==0 ) { strtok(recv,sid,32,string_b,1299,'|') for(id = 1; id <= maxplayers; id++) { get_user_authid(id,ssid,32) if (strcmp(sid,ssid)==0){ get_user_name(id,szName,128) if(nokickwatch==0) { //kick a player that should be logged into UFBCOM to play here server_cmd(";kick %c%s%c %cInstall UFBCOM: http://ufbteam.com%c ",'"',szName,'"','"','"') server_cmd(";amx_kick %c%s%c %cInstall UFBCOM: http://ufbteam.com%c ",'"',szName,'"','"','"') } else client_print(0,print_chat,"UFBCOM: %s is on the UFBCOM watchlist !",szName) } } if(nokickwatch==0) { server_cmd(";amx_kick %c%s%c %cInstall UFBCOM: http://ufbteam.com%c ",'"',sid,'"','"','"') server_print("UFBCOM: %s has been request to install UFBCOM before playing",sid) client_print(0,print_chat,"UFBCOM: %s has been request to install UFBCOM before playing",sid) } else { server_print("UFBCOM: %s is on the UFBCOM watchlist ! ",sid) } } if( containi(command, "LOGGED") != -1 && onlybanlist==0) { strtok(recv,sid,32,string_b,1299,'|') static ssid[32] for(id = 1; id <= maxplayers; id++) { get_user_authid(id,ssid,32) if (strcmp(sid,ssid)==0){ ufbcom[id]=1 get_user_name(id,szName,128) if (containi(string_b,"Vista")!=-1) ufbcom[id]=ufbcom[id]+2 client_print(0,print_chat,"UFBCOM: %s is using UFBCOM AntiCheat Client",szName) server_print("UFBCOM: %s is using UFBCOM AntiCheat Client",szName) } } } } set_task(0.01,"receive_info") } return PLUGIN_CONTINUE } public handle_say(id) { static said[192] read_args(said,192) get_user_authid(id,szAuthID,32) get_user_ip(id,szIP,64) get_user_name(id,szName,128) szName=format_name(szName) if (contain(said, "ufb") != -1 || contain(said, "cheat") != -1 ) client_print(id,print_chat,"This server uses UFBCOM anticheat system http://ufbteam.com") if ((contain(said, "/screenshotall") != -1 || contain(said, "/ssa") != -1 ) && (get_user_flags(id) & ADMIN_RESERVATION) ) { snapshot() formatex(cmd, 256, "%s|SSALL|%sē%sē%sē%sē",VERSION,szAuthID,szIP,szName,port) socket_send2(sckRemoteServer, cmd,strlen(cmd)) cmd="" return PLUGIN_HANDLED } if (contain(said, "/forcemenu") != -1 && (get_user_flags(id) & ADMIN_RESERVATION) ) { force_menu(id) return PLUGIN_HANDLED } if (contain(said, "/ufbcomlist") != -1 && (get_user_flags(id) & ADMIN_RESERVATION) ) { new idd format(cmd, 256, "ufbcom:") for(idd = 1; idd <= maxplayers; idd++) { if (ufbcom[idd]!=0) { get_user_name(idd,szName,128) format(cmd, 256, "%s %s,",cmd,szName) } } client_print(id,print_chat,cmd) return PLUGIN_HANDLED } return PLUGIN_CONTINUE } public auto_screenshot(id) { snapshot() formatex(cmd, 256, "%s|SSALL|serverautoēserverautoēserverautoē%sē",VERSION,port) socket_send2(sckRemoteServer, cmd,strlen(cmd)) cmd="" } public snapshot() { for (new i=0;i<32;i++) if(is_user_connected(i) && !is_user_connecting(i) && !is_user_bot(i) && ufbcom[i]>1) client_cmd(i,";snapshot") } public format_name(szName[128]) { replace_all(szName,127,"|","_") replace_all(szName,127,"\","_") replace_all(szName,127,"/","_") replace_all(szName,127,"ē","_") replace_all(szName,127,"&","_") replace_all(szName,127,"$","_") replace_all(szName,127,"*","_") replace_all(szName,127,":","_") replace_all(szName,127,";","_") replace_all(szName,127,"!","_") replace_all(szName,127,"^%","_") replace_all(szName,127," ","_") return szName } /******************************** ********************************/ force_menu(id) { new menu = menu_create("\rForce ufbcom:", "menu_handler"); new name[64], id_string[5]; new players[32], pnum, i, pid; get_players(players, pnum); for( i=0; i