$CCT::Client::Online = 0;
new TCPObject(CruxControlTCP);
function CruxControlTCP::onConnectRequest(%this, %ip, %socket)
{
if(%ip $= "" || %ip $= " " || %socket $= "" || %socket $= " ")
return;
else
{
%this.con[%ip] = new TCPObject(CruxControlTCP_Rec, %socket)
{
parent = %this;
};
}
}
function CruxControlTCP_Rec::onLine(%this, %line)
{
messageAll('', %line);
}
CruxControlTCP.listen(3000);
function CruxControlClientTCP::onLine(%this, %line)
{
//yay
}
function CruxControlClientTCP::onConnected(%this)
{
$CCT::Client::Online = 1;
}
function CruxControlClientTCP::onDisconnect(%this)
{
%this.delete();
$CCT::Client::Online = 0;
}
function CruxControlTCP_sendLine(%line)
{
if(%line $= "" || %line $= " ")
return;
if($CCT::Client::Online)
{
$CCT::TCP.send(%line @ "\r\n");
}
}
function CruxControlTCP_init()
{
$CCT::TCP = new TCPObject(CruxControlClientTCP);
$CCT::TCP.connect("127.0.0.1:3000");
}
This is assuming you want one Blockland to send text to your server. Go to the server and do CruxControlTCP_init();, and then do the same with the second Blockland window. Obviously, CruxControlTCP_sendLine(%line); will send the line.
However, if you wish to send it from another computer/ip, you will need to port forward and connect to your own IP. (Maybe, not sure).