2015-04-21 13:06:47

Hello,
So I've been working on a project for a little while now with little to no success.
I am attempting to write a simple mud client in c#/CSharp. However, I am stumbling across a few strange querks of System.Net.Sockets.TCPClient.
In fact, I'm not even sure if I'm using the right approach.
As the errors are sort of too numerous to list here, I would be greatful if anyone who knows and understand .NET would get in contact with me. Either through the use of this topic, or PMs.
Thanks,

Underworld Tech.
Accessibility from us, to you.
Visit us

2015-04-21 22:43:58

Hi,
Oh yes. A MUD client can certainly be achieved in .NET code. If you would mind listing all the errors that have ocured here, I'd be glad to help out, although I have never messed with that, so may have to check the MSDN for a reference.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2015-04-22 11:17:07

Hi,
The main issue I'm having seems to be that the output function keeps repeating its self on the screen. For example, I can log into my MUD, type my username, and it displays the welcome all over again. Other than that...it works perfectly!

Underworld Tech.
Accessibility from us, to you.
Visit us

2015-04-22 12:28:06

Good morning,

As Ethin said, it's possible, and it's not hard at all (at least some basic features. In fact a mud client it's a kind of telnet client).

But we cannot help without much more details. No idea how are you dealing with tcp input/output...  The problem could be in your output method or in your receibe data loop or whatever...

Try to isolate the problem or show us some code.

Good luck!

2015-04-22 12:51:16

Hi,
Lets see. I'm using byte arrays to hold send and receive data. I'm using string decoding.encoding to make it human readable, or to convert human readable to bytes. I'm using System.Net.Sockets.TCPClient to connect, I'm using TCPClient.GetStream() to get a network stream and assigning it to a network stream object.
I refuse to give anybody code that might be used in production...I'm sorry!

Underworld Tech.
Accessibility from us, to you.
Visit us

2015-04-22 19:02:41

You said you are getting the welcome message repeated after you send the username.
Are you closing and re-opening the TcpClient between requests?
This would cause the welcome message to be sent to you again.
Instead you should open the TcpClient once and keep it open as long as you are connected to the mud.

~ Ian Reed
Visit BlindGamers.com to rate blind accessible games and see how others have rated them.
Try my free JGT addon, the easy way to play Japanese games in English.
Or try the free games I've created.

2015-04-22 20:53:35

Hi,
Not so that I'm aware. Also, the way I've got it set up its in a loop.

Underworld Tech.
Accessibility from us, to you.
Visit us

2015-04-23 12:59:03

All we can do at this point is speculate. For example, do you flush your output buffer before printing it again? This might cause it to print twice.
I don't get why people are so unbelievably closed minded about sharing code. Especially for a mud client. There are quite a number of amazing open-source clients out there. tongue And we're not even asking for the entirety of your code.
In short, we might be able to help you here, but with the no code attitude, especially if it's a more complex problem, nobody will be able to help you, not because they don't want to, but simply because they don't know what you're doing wrong.

--
Talon
Wanna play my Games? Listen to my Music? Follow me on Twitter, and say hi~
Code is poetry.

2015-04-23 15:23:20

Hi,
I'm all for the open source attitude -- but you never know who is out there who might run with this kind of idea. For what its worth, I don't flush the output buffer, so that might be the issue. However, I didn't realise it was necisary and to be honest, thought I had done so.

Underworld Tech.
Accessibility from us, to you.
Visit us

2015-04-25 22:00:47

As said before, your problem is impossible to solve this way. So, just a tip: try connecting your client to a telnet server on your own computer, and check what are send and receibed in both server and client. You'll see exactly what's wrong, and where the data is going to.

Good luck.