Hey,
I have zero knowledge about sending packets over the net so i need a little help.
Im trying to use Lua+LuaSocket to send commands to the ET server rcon without any success.
i’ve tried this
local host = "localhost"
local address = '127.0.0.1' -- ip adress
local port = 27960 -- port number
local password = "life" -- rcon password
-- load namespace
socket = require("socket")
-- create a new UDP object
udp = assert(socket.udp())
print (udp)
-- Associate this object with our server
udp:setpeername(address, port)
print (udp)
local s,err = (udp:send("\xFF\xFFrconpassword\x00".. password .. "\x00\x00"))
print (udp)
print(s)
print(err)
print (assert(udp:receive()))
print (udp)
udp:close() -- disconnect and free the socket
i’m not sure, maybe it needs to be coded somehow?
like here
<html>
<body>
<form action="rcon.php" method="post">
Command:<input type="text" name="command" />
<input type="submit" value="send command" />
</form>
<?php
function etrcon() {
$ip = ""; //enter server ip between quotes
$port = ""; //enter server port between quotes
$pass = ""; //enter rcon password between quotes
$command = $_POST['command'];
$fp = fsockopen("udp://$ip",$port,$errno,$errstr, 2);
// We don't need the preceding / since it's going straight over the network..
$passinput = "\xFF\xFFrconpassword\x00". $pass . "\x00\x00"; //Input rcon pass In et console: rconpassword <password>
$cmdinput = "\xFF\xFFrcon\x00". $command . "\x00\x00"; //Input command: rcon <command>
fwrite($fp,$passinput/*second parameter is (optional) length*/);
fwrite($fp, $cmdinput);
}
/* ??????
if(!$command) {
print("$errstr");
} else {
*/
if(!empty($_POST['command']))
etrcon();
// } ???
?>
</html>
or
http://forums.warchest.com/showthread.php/32770-Little-C-RCON-Tool
all i need is for the server rcon to get my strings and if its possible to also catch the server’s replay that would be great.
