Top Mud Sites Forum

Top Mud Sites Forum (http://www.topmudsites.com/forums/index.php)
-   Advanced MUD Concepts (http://www.topmudsites.com/forums/forumdisplay.php?f=7)
-   -   CURSES enabled Mudserver (http://www.topmudsites.com/forums/showthread.php?t=84)

xanes 02-22-2003 03:58 PM

Hi

Aren't we always struggling to find the "next big thing"? My entire life, I've pushed myself, not always successfully, toward the cutting edge of whatever I'm involved in.

Recently, I came across an old Xerox PARC article about conferencing software based on MUD servers. While I didn't think multi-casting video was such a good idea, musing over this article did give me a thought about screen control.

curses is a terminal control library, as I'm sure many of you know, for UNIX that allows a program to move past the line-printer abstraction we've been stuck in so long and draw characters arbitrarily on a screen.

Now, it's a little complicated to extend this to a MUD, but very possible. Here's how we'd get a screen from a client:
[code]
int sock; /* file descriptor of client */
FILE *fd;
SCREEN s; /* curses-defined type for screen control */

fd = fdopen( sock, "r+" );
s = newterm( "vt100", fd, fd );
[/quote]

Then, we can do something creative like this:
[code]
set_term( connection->screen );
move( 10, 10);
printw( "Hello World!" );
[/quote]

This would print Hello World on the tenth line at the tenth column on the screen controlled by connection.

The concept of pop-up windows, one-touch menus and the like pop into my mind.

I've sucessfully tested the server (Thanks Visko) with Windows Telnet, and zMUD suppossedly supports vt102, so that shouldn't be a problem.

Anyway, let me know your thoughts. Hopefully, some good will come of this.

-Xanes -=- Lone Coder WinterMUTE

xanes 02-22-2003 04:01 PM

Correction to the previous post:

newterm returns a pointer, so I should have defined 's' that way in the example.

I apologize if this was confusing, or if you didn't even notice and THIS post has wasted your time.

-Xanes Lone Coder WinterMUTE

Ingham 02-22-2003 04:49 PM

Why curses, isn't curses being replaced by ncurses?

xanes 02-22-2003 07:15 PM

ncurses is a curses implementation. In fact, ncurses is what I'm using on the test server.

-Xanes -=- Lone Programmer WinterMute


All times are GMT -4. The time now is 06:49 PM.

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright Top Mud Sites.com 2022