Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: PerlMonks MUD in progress

by l2kashe (Deacon)
on Jul 14, 2003 at 01:02 UTC ( [id://273855]=note: print w/replies, xml ) Need Help??


in reply to PerlMonks MUD in progress

*chuckle*..

I've been working on one as of late myself. I think banging out a MUD is a pretty common task for certain types of programmers. It just seems to cover a very nice range of interesting problems from UI, to input validation, resource management, network communication, etc...

I am interested why you didn't like communication via telnet? Also why the need for a custom client?

With that said, all I can say is POE. Amazing beautiful POE (can you tell what I've been using as my base? ;) ).

I'll be keeping an eye on this, but for now I think I'll stick with scratching my own itch.

MMMMM... Chocolaty Perl Goodness.....

Replies are listed 'Best First'.
Re^2: PerlMonks MUD in progress
by Coruscate (Sexton) on Jul 14, 2003 at 05:20 UTC

    People continue to suggest POE. I installed it, looked at the intro docs, and wanted to hide under a table. There is just too much to handle when using the module. Not only do you have to pick components, filters and wheels, you have to manually modify this 'heap' thing. Then there are so many event handlers that I can't even pick out the ones that are actually needed and which ones are there to bloat examples. I mean, just look at the second code "snippet" in this TCP server example. I see 5 imported modules, 4 calls to constructor methods, and a lot of code for an echo server. :|


    If the above content is missing any vital points or you feel that any of the information is misleading, incorrect or irrelevant, please feel free to downvote the post. At the same time, please reply to this node or /msg me to inform me as to what is wrong with the post, so that I may update the node to the best of my ability.

      Heh, fight the good fight brother.. ;)

      Seriously though. I too was fairly overwhelmed by the initial docs. Until you really grok what is available with POE it all seems so daunting. The way I got over it was I grabbed a perl based mud from sourceforge (I believe its called poe-mud, or some such), and hit http://poe.perl.org. On the poe site there is a simple chat server that I used as my base, and I have been extending since. If memory serves this is all it takes to get a full fledged TCP based server up and functional. ready?
      #!/usr/bin/perl use strict; use POE qw( Component::Server::TCP ); POE::Component::Server::TCP->new( Alias => "MUD", Port => '30000', InlineStates => { 'send' => \&handle_send, }, ClientError => \&c_error, ClientInput => \&c_input, ClientConnected => \&c_connect, ClientDisconnected => \&c_disconnect, ); $poe_kernel->run();
      So the server has predefined events, when those events happen the routines referenced on the right are called.

      In regards to the heap, as far as I have been able to understand it the heap is just that. A session's very own memory space. So that in sub_A you could set $heap->{some_key} = 1, and in sub_B do if ( $heap->{some_key}). The heap is there to get around shared memory issues I think.

      At any rate, stick with POE. I know its disconcerting, but the beauty and power of those modules are simply breathtaking for me. At some point I do believe I will be helping that project out, as it is so useful.

      Spend time reading POE::Kernel, and POE::Session. Once you really grok those 2 modules, then the rest just kind of falls into place. Also grab something written using POE and pull it apart, play with it, and make something slightly different. At some point the light will come on, and you will probably say "Holy @(#$, thats all it takes to do that?!?"

      Update: altered poe.perl.com -> poe.perl.org :P

      MMMMM... Chocolaty Perl Goodness.....

        Thank you very much for that l2kashe. I will follow your advice. It looks much simpler. And as for the heap explanation, that helps a heck of a lot. So thanks again. Off to read some more POE docs I think :)


        If the above content is missing any vital points or you feel that any of the information is misleading, incorrect or irrelevant, please feel free to downvote the post. At the same time, please reply to this node or /msg me to inform me as to what is wrong with the post, so that I may update the node to the best of my ability.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://273855]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (3)
As of 2024-04-16 18:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found