I'm a database / utility coder. I don't know beans about TCP, Sockets and Ports, which is making the initial step into this process very difficult. That and I don't have a lot of free time to research this stuff. So, if someone wants to throw me a bone it will be humbly appreciated.
I'm using the "lich.rbw --login [charactername] --without-frontend --detachable-client=8000" command line option with Lich, and I'm able to see the game feed in a browser pointing to http://127.0.0.1:8000/ so I know that I'm connected.
Unfortunately this is where I currently am with the project:
Code:
private void btnSendCommand_Click(object sender, EventArgs e)
{
TcpClient tcpClient = new TcpClient("127.0.0.1", 8000);
using (NetworkStream ns = tcpClient.GetStream())
{
using (BufferedStream bs = new BufferedStream(ns))
{
byte[] messageBytesToSend = Encoding.UTF8.GetBytes("say hello from C#");
bs.Write(messageBytesToSend, 0, messageBytesToSend.Length);
}
}
Console.WriteLine("Operation complete.");
}
This is giving me a wonderful error:
An unhandled exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
Additional information:
No connection could be made because the target machine actively refused it
System.Net.Sockets.SocketException was unhandled
ErrorCode=10061
Message=No connection could be made because the target machine actively refused it 127.0.0.1:8000
NativeErrorCode=10061
Source=System
If someone can get me started here it would be greatly appreciated. Once I'm able to receive the game stream, and send commands back up the line, it will progress fairly quickly. The learning curve up to that point is a tad steep right now. Once I have XML stream to work with I'll be able to ramp this up pretty quickly.
I'm coding this in C#, so any assistance will need to be of that flavor to be helpful.
Thanks in advance for any constructive help.