Check the functions defined in this mod
There's one that goes by 'onConnectRequest' or something, and it needs to be defined or something
I'll look through and get a more definitive answer for you now
http://dl.dropbox.com/u/58130173/Releases/Script_TelChat.zipGot it
function RPS::onConnectRequest(%this, %ip, %socket) //Handle connections to the chat server
{
if(isObject(%this.connection[%ip]))
{
echo(%this.getName() @ ": Got duplicate connection from" SPC %ip);
%this.connection[%ip].disconnect();
%this.connection[%ip].delete();
}
echo(%this.getName() @ ": Creating connection to" SPC %ip);
%this.connection[%ip] = new TCPobject("ClientTCPObject", %socket)
{
IP = %ip;
};
}
That's presumably all you need, that function would support one client, another client connecting would overwrite the first and then all the data being sent to the first would be sent to the second.
To send data to the client, do
ClientTCPObject.send(%data @ "/r/n");This should be fully functional and compatible with your code.
Use arrays for more than one client. I do that in the linked add on.