[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[package][prop] local editing



Hello :)

Wouldn't it be nice if we add a couple of standard packages for basic tasks?
Could such packages be placed in the dns-org-mud-* hierarchy if we have a
concensus for them? (stuff specific to moo could be in  dns-org-mud-moo-*?)
(Note: it's just an idea, I have no control over *.mud.org :)

One of the first things that come to mind is local editing, so I guess  it
would be a good first candidate to an attempt of standardization...

EDIT package:

The goal of this package is to allow the client to locally edit references
on the server. A reference is a generic term that mean anything that can be
edited via the server by the client; it could be an attribute on an object
(e.g. property, verb) or file.

Some of the messages bellow offer an optional type parameter. By default a
simple line content can be considered as a string and a multiple lines
content as a list/array of strings. In case of multi-lines content, if a
simple-line type is provided then all the lines of the content are of that
type; if a multi-lines type is provided then there should be a type line
for each content line which describe the type of the associated line.
(check example c below for an illustration :)


Client to server messages:
--------------------------
* open (reference)
Request the content of the refrence from the server.

* save (reference, content [, type])


Server to client messages:
--------------------------
* content (reference, content [, type])
Send the content of reference to the server, optionally specify the type of
the content.

Note:
Maybe a reserved type could be "_error", in which case a content (refernce,
<error description>, "_error") message would indicate that an error occured
while trying to access the reference and describe the error using the
content parameter?

Another possibility could be to have a new server to client message:
* error (reference, action, error-message [, error-type])
Where action would be either: open or save depending in reply to which
client message the error message is for.
Example: #$#x-edit-error 1234 reference: me.wizard action: save
error-message: "Permission Denied" error-type: E_PERM

Another possibility is to completely leave the error reporting to another
package (the ERROR package?)


Examples of sessions using the EDIT package:
--------------------------------------------

a) changing my description from the default to a multiline one:

C>S  #$#x-edit-open    1234 reference: me.description
S>C  #$#x-edit-content 1234 reference: me.description content: "You see a
player who should type '@describe me as ...'."
C>S  #$#x-edit-save    1234 reference: me.description content*: 2
_data-tag: 567
C>S  #$#* 567 content: Now I am described.
C>S  #$#* 567 content: Hopefully I could get a prog bit!
C>S  #$#: 567


b) editing some property containing an object on #0:

C>S  #$#x-edit-open    1234 reference: #0.hacker
S>C  #$#x-edit-content 1234 reference: #0.hacker content: #38 type: OBJ
C>S  #$#x-edit-save    1234 reference: #0.hacker content: #2  type: OBJ


c) editing a list containing different types of values:

C>S  #$#x-edit-open    1234 reference: me.values_trash
S>C  #$#x-edit-content 1234 reference: me.values_trash content*: 3 type*: 3
_data-tag: 890
S>C  #$#* 890 content: "This is a string!"
S>C  #$#* 890 content: 3.14159
S>C  #$#* 890 content: This is another string.
S>C  #$#* 890 type: STR
S>C  #$#* 890 type: FLOAT
S>C  #$#* 890 type: STR
S>C  #$#: 890
C>S  #$#x-edit-save    1234 reference: me.values_trash content*: 4 type:
STR _data-tag: 568
C>S  #$#* 568 content: Now me.values_trash
C>S  #$#* 568 content: Is a list of strings
C>S  #$#* 568 content: Cool, isn't it?
C>S  #$#* 568 content: E_MOO rocks (free ad:)
C>S  #$#: 568


d) something else that could be possible with those specs:

C>S  #$#x-edit-open    1234 reference: ~mydir/public_html/index.html
S>C  #$#x-edit-content 1234 reference: ~mydir/public_html/index.html
content*: 3 type: text/html _data-tag: 891
S>C  #$#* 891 content: <HTML>
S>C  #$#* 891 content: This is pretty minimalist.
S>C  #$#* 891 content: <HTML>
S>C  #$#: 891
... I guess you get the idea ...


Hmmms now that I reread my mail it looks a bit longer than what I
originally planned to spam you with but... I guess it describe what I have
in mind :)

What do you think about it?