
Re: C# open source client
Mongoose wrote:
Right. But if you're using something like Java's BufferedReader.readLine() to read text from the game, it'll hang on prompts because they're not terminated. You have to use a character-based read instead of a line-based read if you want to recognize prompts before the player sends a response.
Using C# Socket Class. In simple terms.
1. Check for data in the recieve buffer of the socket. Saves alot of time not to read data unless there is something to read.
2. Read out the data from the recieve buffer. (this can be any and all data that the server has sent. No matter what the input.
3. Store data into a buffer for manipulation and compulation.
(haha. I always wanted to use those words.)
Note: the socket recieve buffer is completely different than the buffer you store the data. I am not even sure if you can access the socket class buffer.
So I am not reading one buffer to store into another just for fun. Its so I have a readable buffer of my own.
4. Perform whatever I want prior to display.
5. Display.
Now currently,
i have the main thread. A sender thread. and a reciever thread.
Maybe even more threads not sure.
The recieving of data, the sending of data, and the user interface all operate independantly of each other.
I am reading the buffer in 8 byte characters. I convert to string as needed. Or leave as byte - depends on what I am doing

Note: I am reading 8 byte information from the buffer converted to the 1252 video display ( which is the iso-8859-1 display ). I have the ability to read the most important bit which is a 1 for a telnet command and a 0 for data. Also note this is not needed due to the way the server is operating

As far as I can tell the server is sending data and I am getting a "\n\r" at the end of every line. Here is an example of what I get so far:
Code:
"\0ÿýöÿû\0ÿý\0ÿûÿûÿüÿþÿþÿþ ÿþ!ÿþ\"ÿü'ÿþ'ÿü$ÿþ$Telnet connection detected."
"\n\r"
"\n\rPlease enter your name (ENTER for none): "
All the wierd characters when read as bytes are numbers (telnet negotiation stuff - like 255 IAC) . Every line ends with a "\n\r" except the last line which is a prompt. And I am sure I wont be surprised at what else I see
