Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2002-02

telnet proxy help

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

ron wilson

i have been reading this group for about a year and a half, and i am very impressed with the freedom that people show in helping (even the most incompetent) programmers, through language and cultural barriers, to solve their problems. well, i need some help getting started with a project that i have absolutely no experience with. i am pretty familiar with freepascal console programming and have done quite a bit of hobby coding for a telnet game called "tradewars 2002".

here is my project: i need to write a telnet proxy for this game. it is 100% ansi-text based and my proxy program will maintain a database of game information by parsing each line of text that passes through the proxy as i play the game from a standard telnet application. the target os is windows (all flavors since win98). i would like the application to run as a tray application, or as a small floating menubar only. my experience in freepascal is limited to console applications, so i lack experience writing windows gui code. i have also never written any code dealing with the internet. what i would like to see is a simple state-machine approach to monitoring the game, parsing the incoming and outgoing text on a char-by-char basis, and a free-single-user database to manage game information.

i'm not asking anyone to write the thing FOR me. what i need is guidance and a little bit of hand-holding to get me off the ground. i'm pretty sure i can figure out the database part. i need to get my feet wet with the windows interface (menu and/or tray icon) and the internet connection.

regards,
ron wilson

Thomas Schatzl
to ron wilson

Hi,

here is my project: i need to write a telnet proxy for this game. it is 100% ansi-text based and my proxy program will maintain a database of game information by parsing each line of text that passes through the proxy as

i

[...]

At http://members.yline.com/~tom_at_work/selectserver.zip (19k) I've put an example of such a small telnet proxy (a quick conversion from a C example program which I included). It simply forwards all data sent to it to all other connected clients, e.g. allows chatting via telnet. Don't worry about the size of the zip, but it uses a slightly modified winsock2 unit from the contribs page which I included (the actual code is 3k..). Note that it's definitely not the best code, but definitely something to get started.

Maybe it might be easier to use the socket stream classes provided by the delphi-like-RTL.

i would like the application to run as a tray application, or as a small floating menubar only. [..]

* FPC / Win32 includes a small example program which shows basic GUI handling on the lowest possible level ^^. Since you don't need any GUI stuff I think it's inappropiate to fire up a GUI library... Hmm... there's a contribution called "Commented examples under Windows 95" on the contribs list. I guess this will help a little bit too.

* To avoid the program being shown in the task bar and the desktop, create it as WS_POPUP only (not WS_VISIBLE).
The tray icon stuff is completely handled by the Win32 "Shell_NotifyIcon()" function.... there's a unit on the contribs' list called ShellAPI or similar which provides an interface to it (I hope so).

Regards,
Thomas