| Author |
Message |
|
jaceace01
Veteran Op
Joined: Wed Jul 13, 2011 1:20 pm Posts: 87
|
 Re: C# open source client
Mongoose wrote: How are you connecting to TWGS without implementing Telnet? When I started messing with my own helper, I found that TWGS 2.07 sends the Telnet option negotiation "IAC WILL AYT". If you don't respond to this (malformed) option, TWGS decides you're not a Telnet client and disconnects you.
If I understand the Telnet RFC correctly, "IAC WILL AYT" is wrong; AYT is a command, not an option, so it should just be "IAC AYT". It satisfies the TWGS if you simply respond with "IAC DONT AYT", and that's how Telnet NVT should respond to unrecognized or unsupported options, anyway.
[Edited: DONT is the correct response to an unrecognized WILL. WONT is the correct response to an unrecognized DO. I forget which it is that TWGS does. Either way, a proper Telnet client shouldn't have a problem with it.] I got that response when i didnt connect right. After i connected in the correct sequence that response went away. just tell the server to supress go ahead and all is good!
_________________ Server: jaceace.com Port 2002 Nodes: 14
 On Facebook: http://www.facebook.com/pages/TradeWars-Jaces-Night-Club/184408004953128 Website: http://tradewars.jaceace.com
|
| Thu Aug 25, 2011 3:01 pm |
|
 |
|
Micro
Ambassador
Joined: Wed Apr 20, 2011 1:19 pm Posts: 2559 Location: Oklahoma City, OK 73170 US
|
 Re: C# open source client
FirstMate and MicroBot share the same scripting language. Well that's not really correct, as .net "scripting" was discontinued in .net v2 (I think). What I am actually using the .net CodeDom runtime compiler to compile a "plug-in" on the fly. You can also use any .net IDE to create a compiled .DLL library or plug-in for FirstMate. I prefer C#, but scripts can be written in VB, or any .net language.
Right now there are only a few commands that MicroBot needed to script a BBS login and parse the game settings screen, and it works very well.
_________________ Regards, Micro Website: http://www.microblaster.net TWGS2.20b/TW3.34: telnet://twgs.microblaster.net:2002
ICQ is Dead Jim! Join us on Discord: https://discord.gg/zvEbArscMN
|
| Thu Aug 25, 2011 3:04 pm |
|
 |
|
John Pritchett
Site Admin
Joined: Sun Dec 24, 2000 3:00 am Posts: 3151 Location: USA
|
 Re: C# open source client
The telnet login negotiation is actually less restrictive than that. If I receive an IAC (255) back, regardless of what follows it, you're in as Telnet ;) If I receive anything else, it's assumed RLogin.
If TWGS is configured to accept Telnet connections, it allows in anyone who passes this simple "telnet" test. If RLogin, it has a different test. It expects a NULL (0) character.
_________________ John Pritchett EIS --- Help fund the TradeWars websites! If you open a hosting account with A2 Hosting, the service EIS uses for all of its sites, EIS will earn credits toward its hosting bill.
|
| Thu Aug 25, 2011 3:08 pm |
|
 |
|
jaceace01
Veteran Op
Joined: Wed Jul 13, 2011 1:20 pm Posts: 87
|
 Re: C# open source client
Micro wrote: FirstMate and MicroBot share the same scripting language. Well that's not really correct, as .net "scripting" was discontinued in .net v2 (I think). What I am actually using the .net CodeDom runtime compiler to compile a "plug-in" on the fly. You can also use any .net IDE to create a compiled .DLL library or plug-in for FirstMate. I prefer C#, but scripts can be written in VB, or any .net language.
Right now there are only a few commands that MicroBot needed to script a BBS login and parse the game settings screen, and it works very well. These kind of talks are what Tradewars has been needing. Im sure we all have different experiences from our computer histories but as we all talk about this kind of stuff... Hopefully the programmers around the twgs community will grab the ball and start helping to build useful clients and helpers. It all begins with some kind of free client that new users can use to get into the game. Lets face it. A new user doesnt want to spend money on a client when they arent even sure if they like the game! We client/helper builders could really help the twgs server ... if we work together 
_________________ Server: jaceace.com Port 2002 Nodes: 14
 On Facebook: http://www.facebook.com/pages/TradeWars-Jaces-Night-Club/184408004953128 Website: http://tradewars.jaceace.com
|
| Thu Aug 25, 2011 3:11 pm |
|
 |
|
Micro
Ambassador
Joined: Wed Apr 20, 2011 1:19 pm Posts: 2559 Location: Oklahoma City, OK 73170 US
|
 Re: C# open source client
Speaking of RLOGIN, what can be passed in addition to the handle and password? i.e. time remaining
_________________ Regards, Micro Website: http://www.microblaster.net TWGS2.20b/TW3.34: telnet://twgs.microblaster.net:2002
ICQ is Dead Jim! Join us on Discord: https://discord.gg/zvEbArscMN
|
| Thu Aug 25, 2011 3:12 pm |
|
 |
|
jaceace01
Veteran Op
Joined: Wed Jul 13, 2011 1:20 pm Posts: 87
|
 Re: C# open source client
John Pritchett wrote: The telnet login negotiation is actually less restrictive than that. If I receive an IAC (255) back, regardless of what follows it, you're in as Telnet  If I receive anything else, it's assumed RLogin. If TWGS is configured to accept Telnet connections, it allows in anyone who passes this simple "telnet" test. If RLogin, it has a different test. It expects a NULL (0) character. And after i learned that from our other thread conversation. The free client began to grow. Especially since I no longer have to deal with telnet coding. I can build a complete telnet client. But I would rather build a twgs client  Connect and begin handling ANSI. I love it! You are very wise JP!
_________________ Server: jaceace.com Port 2002 Nodes: 14
 On Facebook: http://www.facebook.com/pages/TradeWars-Jaces-Night-Club/184408004953128 Website: http://tradewars.jaceace.com
|
| Thu Aug 25, 2011 3:13 pm |
|
 |
|
John Pritchett
Site Admin
Joined: Sun Dec 24, 2000 3:00 am Posts: 3151 Location: USA
|
 Re: C# open source client
Micro wrote: Speaking of RLOGIN, what can be passed in addition to the handle and password? i.e. time remaining User name is the only thing supported at this time. I could support other information passed on the RLogin connection, but that wouldn't be official RLogin support. RLogin will send client name, server name and terminal type. I'm sure some RLogin implementations for BBS pass additional info, but I never looked into that. The main purpose of RLogin is just to keep a strict correlation between the BBS user base and the TWGS user base. If you're UserX on the BBS, you're UserX on TWGS.
_________________ John Pritchett EIS --- Help fund the TradeWars websites! If you open a hosting account with A2 Hosting, the service EIS uses for all of its sites, EIS will earn credits toward its hosting bill.
|
| Thu Aug 25, 2011 4:14 pm |
|
 |
|
ElderProphet
Commander
Joined: Tue Oct 07, 2003 2:00 am Posts: 1134 Location: Augusta, GA
|
 Re: C# open source client
TWX Proxy has a fairly complete telnet implementation, since it also has to play the role of telnet server, but it'd be great to know the minimum telnet negotiation required on the twgs client side. Does TWGS behave differently if it receives WILL SGA, or ECHO, or Transmit Binary?
_________________ Claim to Fame: only guy to ever crack the TW haggle algorithm, and fig/shield/hold price formula, twice.
|
| Sun Aug 28, 2011 11:36 pm |
|
 |
|
John Pritchett
Site Admin
Joined: Sun Dec 24, 2000 3:00 am Posts: 3151 Location: USA
|
 Re: C# open source client
TWGS doesn't negotiate telnet settings. It is completely unresponsive to any telnet commands sent to it other than what it uses to detect connection type. It tells the telnet client what it expects and then assumes that those expectations are met. Sort of the way my wife would describe me ;)
_________________ John Pritchett EIS --- Help fund the TradeWars websites! If you open a hosting account with A2 Hosting, the service EIS uses for all of its sites, EIS will earn credits toward its hosting bill.
|
| Sun Aug 28, 2011 11:45 pm |
|
 |
|
Master Blaster
Gameop
Joined: Mon Apr 16, 2001 2:00 am Posts: 419 Location: Denver Colorado
|
 Re: C# open source client
LOL !! FINALLY, A sentence I can understand!
_________________ twarbase.com:23
|
| Mon Aug 29, 2011 12:39 am |
|
 |
|
jaceace01
Veteran Op
Joined: Wed Jul 13, 2011 1:20 pm Posts: 87
|
 Re: C# open source client
Quick update. Still working on the future open source client in C#. I have about 3 different versions of the client. I have made it up to the new player logging in and typing a password. Still working out the details. I have been doing alot of reading on the rfc's for telnet. ansi code. etc. This may sound easy...dont know. But I have been working on how the program will be notified when bytes are in the recieve buffer, how to know when all the data has arrived. When to display a prompt and what kind of prompts. The secret to these answers appear to be that NVT is sent as "line" data. I just ran a little test and it does appear that data is sent in "lines". or better known as "\n\r" or just "\n" . Still working all that info out. This should help to understand when and how to "prompt" users. Anyway... just a little update ... in case anyone is wondering... still working on it  Once I complete this, I may tackle a phone app... for tradewars.
_________________ Server: jaceace.com Port 2002 Nodes: 14
 On Facebook: http://www.facebook.com/pages/TradeWars-Jaces-Night-Club/184408004953128 Website: http://tradewars.jaceace.com
|
| Wed Aug 31, 2011 5:10 pm |
|
 |
|
Mongoose
Commander
Joined: Mon Oct 29, 2001 3:00 am Posts: 1096 Location: Tucson, AZ
|
 Re: C# open source client
I know you're resisting using any third-party code, but I highly recommend learning about state machines, lexers, and parsers. A lexer would solve most of the problems you're struggling with. For example, you could describe the command prompt using a regular expression, and then whenever the lexer sees it, it will call some code that you've specified.
_________________ Suddenly you're Busted!
|
| Wed Aug 31, 2011 5:19 pm |
|
 |
|
jaceace01
Veteran Op
Joined: Wed Jul 13, 2011 1:20 pm Posts: 87
|
 Re: C# open source client
Quick question for any programmers out there.... It does appear that all the data is more managable as "lines". Read a line from the recieve buffer... display ... read a line .. display... etc.... My question: Does anyone know if the "\n\r" that determines a line is needed in the display? Can we remove the "\n\r" and display the ansi coded line without the "\n\r"? Obviously, I will experiment. But if anyone knows for sure let me know 
_________________ Server: jaceace.com Port 2002 Nodes: 14
 On Facebook: http://www.facebook.com/pages/TradeWars-Jaces-Night-Club/184408004953128 Website: http://tradewars.jaceace.com
|
| Wed Aug 31, 2011 5:21 pm |
|
 |
|
jaceace01
Veteran Op
Joined: Wed Jul 13, 2011 1:20 pm Posts: 87
|
 Re: C# open source client
Mongoose wrote: I know you're resisting using any third-party code, but I highly recommend learning about state machines, lexers, and parsers. A lexer would solve most of the problems you're struggling with. For example, you could describe the command prompt using a regular expression, and then whenever the lexer sees it, it will call some code that you've specified. Well, I know all about regular expressions like an example would be javascripts date function or I understand how to object orient program. I know how to program in Threads. I know how to fire events to handle situations. Thanks for the advice. At no time am I writing this to represent in a negative light. I am very happy to recieve advice. I have been programming for over 20 years. I know alot of languages. I got tons of books... I love having a challenge. I have never built a telnet client. Obviously, twgs does not need a telnet client. But, I am always learning new stuff when I program. That is why I program. To learn.  I will have to study what you stated later on. Obviously, I dont use any 3rd party code in my programs due to legal issues. I like my code to be Copyright me  Thanks for your advice 
_________________ Server: jaceace.com Port 2002 Nodes: 14
 On Facebook: http://www.facebook.com/pages/TradeWars-Jaces-Night-Club/184408004953128 Website: http://tradewars.jaceace.com
|
| Wed Aug 31, 2011 5:31 pm |
|
 |
|
Mongoose
Commander
Joined: Mon Oct 29, 2001 3:00 am Posts: 1096 Location: Tucson, AZ
|
 Re: C# open source client
The problem with reading everything from TWGS as lines is that prompts do not have a line terminator until a response is sent.
There's a lot of third-party code out there that you can use without limiting your options for distributing your program. If you use GPL code, for example, you have to make the source of your program available to anyone who has the binary. But other open-source licenses, like the Apache or BSD license, don't include any restrictions like that. You can do pretty much whatever you want with the code. (Microsoft has been known to use BSD code in their products, and Mac OSX is based entirely on a version of the BSD OS.) At most, they ask you to give credit to the original author.
_________________ Suddenly you're Busted!
|
| Wed Aug 31, 2011 5:43 pm |
|
 |
|
Who is online |
Users browsing this forum: No registered users and 60 guests |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|