02-03-2012, 12:23 AM | #1 |
Member
Join Date: Sep 2011
Home MUD: Aarchon
Posts: 62
|
Pulling information from MUD to website
What's the easiest / most efficient way to pull information from the MUD and put it on the website.
For example : Current list of online players Would also like to get all of our helpfiles online in the near future as well. I'm pretty sure this should be done with a PHP/mysql database, but am kind of at a loss of where to look. Anyone have some references they can point me to? |
02-03-2012, 01:22 AM | #2 |
Member
|
Re: Pulling information from MUD to website
Easiest? Probably having code regularly dumping that info to a txt file and having a symbolic link to it in public_html.
|
02-06-2012, 11:01 AM | #3 |
New Member
Join Date: Aug 2009
Posts: 10
|
Re: Pulling information from MUD to website
What Zeno said basically. NarutoMUD does just that. If you go to we do a couple of techniques. Firstly, dumping that data to a text file and parsing it on the fly, second is just opening a socket via PHP and using a home rolled protocol I called MRP (MUD Request Protocol) which works a bit like MSSP. The helpfile/skills section works like that and the Bingo Book section uses MRP.
If you store your helpfiles in a database (like MySQL) then obviously you'll want to do a query against it and use something like PHP (or JSTL or whatever) to parse it and send it to the user, but if you store your helpfiles like 99% of MUD engines do in files then you might just want to write out that file in a special folder viewable by your website (somewhere in the public_html). Then do some research on REGEX and be able to use one to troll your data file and rip out what you want. The last bit I did, as a party bonus, was to convert the SMAUG style color tags to HTML color tags, but that is done on the fly and I did that as a last step of polish. I hope some of that helps, and good luck! I think adding content to your website dynamically like that adds a lot of extra value for players. |
02-06-2012, 12:42 PM | #4 |
Member
Join Date: Jun 2004
Name: Ben
Location: Zelienople, PA
Home MUD: Adventures Unlimited
Posts: 68
|
Re: Pulling information from MUD to website
Text dump, or if you used a database (sql etc) you may be able to pull straight form that database for the site.
|
02-06-2012, 04:23 PM | #5 |
Member
Join Date: Sep 2011
Home MUD: Aarchon
Posts: 62
|
Re: Pulling information from MUD to website
Thanks for all the replies everyone. Coding is unfortunately not a strong suit of mine (still learning) but after posting this thread I remembered that one of our long time players does web development stuff for a living. He was able to put together some basic stuff for me that works well enough for now. It's not beautiful and it's not flawless, but it works.
A lot of the help files are being rewritten and cleaned up as they've been neglected for a few years. I've got another .php page with a searchable function.. just not sure which one I want to use. Maybe both. We'll have an "online players" page soon enough too. Nice to see the forum being so helpful |
02-07-2012, 04:14 AM | #6 |
Member
Join Date: Mar 2010
Home MUD: Unwritten Legends
Posts: 135
|
Re: Pulling information from MUD to website
Gee, where have I heard that before? xD
|
02-07-2012, 11:37 AM | #7 |
Member
Join Date: Apr 2008
Home MUD: Alter Aeon
Posts: 245
|
Re: Pulling information from MUD to website
I don't know about the easiest, but the most efficient (if you're going for generated pages) is definitely to serve them directly out of the mud server on a second http port. That's what we do on Alter Aeon, and it guarantees that whatever is exported out of the http interface is current and synced with the actual server state:
-dentin Alter Aeon MUD |
02-07-2012, 04:24 PM | #8 |
Member
Join Date: Sep 2011
Home MUD: Aarchon
Posts: 62
|
Re: Pulling information from MUD to website
? .. is that a common thing around here? We were down for about 10 months and prior to that the IMPs were basically missing for a year. I was able to get in touch with one of them again and we've really started turning things around.
Dentin -- I love the way that looks but have no idea how to do it . I'll stick with what we have for now but might look into that more later. Love your guys' website in general btw. I read your article on gold/mud economy. Absolutely fascinating work. |
02-07-2012, 10:01 PM | #9 |
Member
Join Date: Mar 2010
Home MUD: Unwritten Legends
Posts: 135
|
Re: Pulling information from MUD to website
It's at least been true for just about every MUD, ever. |