GitXplorerGitXplorer
R

MushFlatFileReader

public
1 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
9992eeb60c667c86abff728d1a5880cfa484e6aa

Update README.md.

RRichardVasquez committed 12 years ago
Unverified
4b646dd0245dac02b2df3b86dc80d241eb8e0d83

Added/updated DGML files after refactoring.

RRichardVasquez committed 12 years ago
Unverified
99705d09cb4e038d4d7263186882f76b97c4b329

Moved the data structures into their own assembly.

RRichardVasquez committed 12 years ago
Unverified
e9ded70135c53b5d43e816e145f611986bb6a2b0

Fixed typo in README.md

RRichardVasquez committed 12 years ago
Unverified
077d8b847e19d5d5113a7ae9ecb4285e35496b55

Cleanup. Documentation. License.

RRichardVasquez committed 12 years ago
Unverified
92be9fb297db33854d2e0dedc926a813cfa873bd

Fixed name spaces. More separation of responsibilities.

RRichardVasquez committed 12 years ago

README

The README file for this repository.

TinyMUSH Flat File Reader

This reads your standard TinyMUSH 3.X ASCII flat file and turns it into a JSON file. The JSON file returns everything, including related DbRefs, flags, attributes, flags and owners of attributes, and more.

This was written for some personal research I'm doing, so it has a few hardcoded options in it, and it doesn't deal with every single edge case that might be designated in your game's configuration. Additionally, it looks for the ASCII file to be named "flatfile.txt" and it outputs "tinymush.json".

It's pretty fast though, and I could likely make it faster if I cached some of the parsers, but it processes a bit over 4000 objects in about 28 seconds on my machine, so I can live with that.

I'm throwing this out there as proof of concept, and as a jumping off point for others who might be able to use it. Feel free to send me pull requests.

I split out an assembly since it's going to be used in another project. It's still a basic library with a simple executable to read the database and spit out a JSON file with some reporting information.

Example Output

[
  {
    "Flags": [
      "Dark",
      "HasCommands",
      "Dirty"
    ],
    "Powers": [],
    "Attributes": [
      {
        "Name": "DESC",
        "Id": 6,
        "Owner": 3,
        "Text": "%tYou are in the center of a vast field of foggy white. There is no visible light source, yet everything is illuminated.%r%tParticles, felt though invisible, bump into you, pushing you to and fro in an orgy of brownian motion.%r%r%tWhen you are ready to enter this not so brave, new world, type \\\"START\\\" (Without the quotes.)",
        "Flags": []
      },
      {
        "Name": "XDENSITY",
        "Id": 43608,
        "Owner": 3,
        "Text": "152",
        "Flags": [
          "Wizard",
          "Mdark"
        ]
      },
      {
        "Name": "ADJACENT",
        "Id": 46979,
        "Owner": 1,
        "Text": "#2 #-2",
        "Flags": []
      }
    ],
    "Data": {
      "DbRef": 0,
      "Location": -1,
      "Zone": -1,
      "Contents": 232,
      "Exits": 1515,
      "Link": -1,
      "Next": -1,
      "Owner": 3,
      "Parent": -1,
      "Money": 0,
      "AccessTime": "2005-09-05T13:04:55",
      "ModTime": "2004-12-27T18:07:20",
      "LockKey": "",
      "ObjectType": "Room"
    },
    "Name": "Nowhere"
  }
]

Your results should be much longer than this. This is just one room of the MUSH I'm testing.

License

For right now, for this version, this is the license I'm releasing this under.

alt text

This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License

Requirements: