HLMOD.HU Forrás Megtekintés
- www.hlmod.hu/*************************** Ingame remote rcon control ************* ********
Ingame remote rcon control ( yes it's an useless plugin )
This plugin is a short implemenation of the hlds rcon protocol
Idea : Alka ;) He wanted this plugin ... even if I tell him it's useless
usage : amx_remote_rcon <ip> <port> <rcon> <command>
ip & port = ip and port of the remote server
rcon = rcon of the remote server
command = command to execute, please use ""
Note: The hlds rcon protocol is unsecure ... so I don't support this thing :)
Contact :
mail: hackziner@gmail.com
msn: hackziner@hotmail.com
*******************************************************************************/
#include <amxmodx>
#include <amxmisc>
#include <sockets>
#define PLUGIN "Ingame remote server control"
#define VERSION "0.1"
#define AUTHOR "hackziner"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_concmd("amx_remote_rcon","Remote_RCON",ADMIN_BAN,"<ip> <port> <rcon jelszo> <parancs>")
}
public Remote_RCON(id,level,cid)
{
new sckRemoteServer
if (!cmd_access(id,level,cid,2))
return PLUGIN_HANDLED
new ip[32]
new port[8]
new rcon[32]
new command[128]
new cmd[255]
new nothing[64]
new rconid[32]
new error
read_argv(1, ip, 31)
read_argv(2, port, 7)
read_argv(3, rcon, 31)
read_argv(4, command, 128)
sckRemoteServer = socket_open(ip,str_to_num(port), SOCKET_UDP,error) //csatlakozas a szerverhez
format(cmd, 256, "%c%c%c%cchallenge rcon",255,255,255,255) //..
socket_send2(sckRemoteServer, cmd,255) //parancs kuldese..
if(socket_change(sckRemoteServer,500000 )) //Valaszra varas ( alapertelmezett beallitas 1masodperc )
socket_recv(sckRemoteServer, cmd,255) //Csomag megszerzese
parse(cmd,nothing,63,nothing,63,rconid,31) // "\xff\xff\xff\xffchallenge" drop, "rcon drop", rconid catch
format(cmd, 256, "%c%c%c%crcon %d ^"%s^" %s ^n",255,255,255,255,str_to_num(rconid),rcon,command,255,255) //parancs formazasa..
socket_send2(sckRemoteServer, cmd,255) //parancs kuldese...
socket_close(sckRemoteServer)
return PLUGIN_HANDLED
}