ID:154625
 
As I've been playing around with the browse() function, I've been thinking of how players can write their own books, letters, notes, etc within the game.


==========================
It serves several purposes:

1. Internal, in-character post office and mailing system can be devised

2. Players can write their own history books

3. Players can write their own spell research books within game (actual spell research recording will be different, this will just be individual player notes)

4. Players can create song books (lots of bardic types out there)

5. Players can write their own strategy guides

3. Any other uses I can't think of

========================
The basic requirements:

1. Ability to limit space (a single sheet of paper is smaller than a bound book of fifty pages)

2. When read, shows in the browser window

3. Players do not need to know HTML or any markup language (though it can be used)
========================

Nominally, I don't really want them writing files to the server, though I'd say okay if this was the only way. The text should be stored with the object.

Originally, I thought I'd just store the information in a variable like obj/book/var/bookContent with some routine to check the number of words or character spaces.

Does anyone have some thoughts on this?
On 7/17/00 8:51 pm Gabriel wrote:
As I've been playing around with the browse() function, I've been thinking of how players can write their own books, letters, notes, etc within the game.


==========================
It serves several purposes:

1. Internal, in-character post office and mailing system can be devised

2. Players can write their own history books

3. Players can write their own spell research books within game (actual spell research recording will be different, this will just be individual player notes)

4. Players can create song books (lots of bardic types out there)

5. Players can write their own strategy guides

3. Any other uses I can't think of

========================
The basic requirements:

1. Ability to limit space (a single sheet of paper is smaller than a bound book of fifty pages)

2. When read, shows in the browser window

3. Players do not need to know HTML or any markup language (though it can be used)
========================

Nominally, I don't really want them writing files to the server, though I'd say okay if this was the only way. The text should be stored with the object.

Originally, I thought I'd just store the information in a variable like obj/book/var/bookContent with some routine to check the number of words or character spaces.

Does anyone have some thoughts on this?


Might be interesting to find some in-depth uses for this. Very easy to support with savefiles -- just a question of disk space.
I have no idea if this would work. Basically it just writes and reads a file.

I was thinking that, if I'm going to allow people to write files, I may as well allow them to upload them in html as well.

How will the BYOND browser handle malicious java code?


Let me know of any ideas better than this :)

Gabriel


obj/book/var
        length=100      // total length in characters possible
        editable=1      // 0=false|1=true|2=restricted
        list/Author[0]  // for restricted edit rights, this stores who can edit the book
        tag=1           // unique tag to identify saved book files

obj/proc/gsWriteBook(obj/O)
        // check to see if it can be edited
        if(O.editable == 0)
                usr << "You can't write in the [O.name]."
                return
        // check to see if usr has rights to edit
        if(O.editable == 2)
                if(O.Author.Find(usr)) == 0
                        usr << "You are not allowed to write in the [O.name]."
                        return
        // check to see if there's enough space to edit
        var/X
        X=file2text('/book/[O.tag].html')
        if(lentext(X) >= 50)
                usr << "The [O.name] is full."
                return
        // allow the player to write to the book
        var/P
        P=prompt("What would you like to write?") as text
        if(lentext(P)+lentext(X) > 50)
                usr << "There's not enough space to write that."
                return
        X=addtext(X,P)
        text2file(X,'/book/[O.tag].html)
                usr << "You finish writing in the [O.name]."
                return
        return

In response to Gabriel
How will the BYOND browser handle malicious java code?

You can always parse the snippet they upload, and if it contains -script- tags or the tags you need to implement apps, simply refuse their upload. If they try to go through the trouble of putting up code (which in most cases wouldn't even be debugged), they'll have done it all for nought. You might want to ban -meta http-equiv="blah"- tags as well.
In response to Spuzzum
why not just make it to where they have to supply the space on mabey a personal webpage or something and it just links to .txt documents instead of html...so no one can go and add in a link to a page with java on it or a file that would be downloaded when they try to read the book
In response to Rat
On 7/18/00 5:51 pm Rat wrote:
why not just make it to where they have to supply the space on mabey a personal webpage or something and it just links to .txt documents instead of html...so no one can go and add in a link to a page with java on it or a file that would be downloaded when they try to read the book

The current system, unfortunately, doesn't support direct conversion from DM text to .txt. The language itself uses its own subset of HTML, as well as its own macros. Unless there were some extreme exceptions, such as actually physically forcing people to download the messages to their hard drive to read them, it is impossible to do it that way.

It would be nice if it were possible, though.


In response to Spuzzum
On 7/19/00 3:11 am Spuzzum wrote:
On 7/18/00 5:51 pm Rat wrote:
why not just make it to where they have to supply the space on mabey a personal webpage or something and it just links to .txt documents instead of html...so no one can go and add in a link to a page with java on it or a file that would be downloaded when they try to read the book

The current system, unfortunately, doesn't support direct conversion from DM text to .txt. The language itself uses its own subset of HTML, as well as its own macros. Unless there were some extreme exceptions, such as actually physically forcing people to download the messages to their hard drive to read them, it is impossible to do it that way.

It would be nice if it were possible, though.

I don't quite understand the situation. What feature should we be supporting here?
I got the main idea from Asheron's Call - there were books that you could find/purchase and write inside of them.

I've been sitting here thinking that, unless it were as easy and convienient to do (ie, clicking in a box and having ten lines to type in and make edits) that it wouldn't really be worth doing.

For writing actual in-game books, a Staff member can simply create/edit/load the HTML and link the object behind the scenes and the players would just email additions to the library.
In response to Tom H.
I don't quite understand the situation. What feature should we be supporting here?

Wasn't really a feature request. But the end effect would be similar to selecting everything on a webpage, hitting Ctrl+C, and then pasting it into Notepad; all the links would disappear and keep the text intact. In other words, HTML email to plain-text email =)

So if there was an image, a bunch of text, a Java applet, a hyperlink, and some more text, it would skip the image, copy down the text, skip the applet, convert the link to plain text, and then copy the rest of the text.

I guess all you'd have to do is run a filter proc to ignore every DMHTML tag as well as text macros... but that would be a job in itself...