Author Topic: What the hell is wrong with this tcp object?  (Read 463 times)

I simply cannot get it to do anything.
It won't echo, it wont do any of the commands I send it
I'm pretty sure the problem is in onLine, but, as stated, I don't know what's wrong!
I have tried disabling rtb to no avail.

I've even tried connecting to the server with python, sure enough, it connects, but nothing happens on the blockland side.

Server: http://pastebin.com/raw.php?i=WAdwxnjC

Client: http://pastebin.com/raw.php?i=fXuNf6Uj
« Last Edit: March 26, 2012, 04:33:41 PM by Lugnut1206 »



Try connecting using PuTTY in raw mode.

I did as you said and also got the bright idea to trace it..

http://pastebin.com/raw.php?i=cqXe7frN

It seems to be catching the text properly, it's just not working with the script.
I could probably package TCPObject::onLine... but none of the other TCPObject-using scripts have to package it, why would I?

Oh and I attached echos to EVERYTHING and still nothing.

It seems to not be calling lugnutsTCPServer::onLine
« Last Edit: March 27, 2012, 01:59:10 PM by Lugnut1206 »



I would look at Truce's webserver for reference.
It seems a few things are improperly defined in my script. I made some adjustments which I'll go test now. I'll also go test the tcpclient cause that might actually be working, and it was just my server that was messed up

Nope.

Code: [Select]
package LUGSTCPOBJECT
{
function TCPObject::onLine(%this, %line)
{
if(%this.class $= "lugsTCPServ")
{
echo(%this);
echo(%line);
%mode = getword(%line, 0);
echo(%mode);
%msg = strReplace(%line, getword(%line, 0), "");
echo(%msg);
switch$(%mode)
{
case "CHAT:":
echo("SRVR:CHAT:" SPC %msg);
case "WARNMSG":
warn("SRVR:WARN:" SPC %msg);
case "TALKMSG":
commandToServer('messageSent', %msg);
default:
echo("SRVR:Message received, unknown mode:" SPC %line);
}
return;
}
parent::onLine(%this, %line);
}
};
activatepackage(LUGSTCPOBJECT);
tried that, tried without the %this.class part, tried without package

At least now it isn't giving me a RTB error.
« Last Edit: March 28, 2012, 03:59:23 PM by Lugnut1206 »