View Single Post
Old 02-06-2012, 10:01 AM   #3
Gatz
New Member
 
Join Date: Aug 2009
Posts: 10
Gatz is on a distinguished road
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.
Gatz is offline   Reply With Quote