Desctags Functions.
[World Functions.]

Manipulate description tags. More...

Functions

F2LINK int F2CALL f2_desctag_reg ()
 Registers a desctag slot.
F2LINK bool F2CALL f2_desctag_unreg (int tag_id)
 Unregisters a desctag slot.
F2LINK bool F2CALL f2_desctag_set (int tag_id, const char *tag)
 Sets the contents of a desctag slot.

Detailed Description

Manipulate description tags.

Oftentimes modules or scripts will want to append some data to the end of the player's description. However, if you have multiple modules or scripts trying to tag/untag the player's desc at the same time, you usually end up with a mess as each module presents what -it- thinks was the original description.

To solve this problem, Furnarchy makes a logical separation between the player's description and any tags scripts or modules want to append to it. When the client sends a `desc or `chdesc command, then Furnarchy appends the tags to the description.

By agreeing to go through Furnarchy for this sort of stuff, modules can tag the desc with whatever they'd like without stepping on each other's toes, and there's no need to track/restore the original description as Furnarchy will handle it all for you.

To use desctags, modules have to register for a desctag slot with f2_desctag_reg(), then use f2_desctag_set() to set its contents. f2_desctag_unreg() should be called when the tag is no longer needed.


Function Documentation

F2LINK int F2CALL furn2::f2_desctag_reg (  ) 

Registers a desctag slot.

The created desctag can be set by f2_desctag_set().

Returns:
A nonzero unique desctag id.
Remarks:
Desctags slots are handed out order-wise on a first-come first-serve basis. You should free the desctag slot with f2_desctag_unreg() when you no longer need it.
See also:
f2_desctag_set() f2_desctag_unreg()

F2LINK bool F2CALL furn2::f2_desctag_set ( int  tag_id,
const char *  tag 
)

Sets the contents of a desctag slot.

Parameters:
[in] tag_id A unique tag identifier previously used in a successful f2_desctag_reg() call.
[in] tag A string to set the slot to.
Remarks:
tag will be trimmed to one line and and cleaned to be human-readable. This may result in an immediate `desc or `chdesc command being sent to the server to reflect the updated desc.
See also:
f2_desctag_reg() f2_desctag_unreg()

F2LINK bool F2CALL furn2::f2_desctag_unreg ( int  tag_id  ) 

Unregisters a desctag slot.

Parameters:
[in] tag_id A unique tag identifier previously returned by a f2_desctag_reg() call.
Returns:
true if tag_id was successfully unregistered.
Remarks:
This may result in an immediate `desc or `chdesc command being sent to the server to reflect the restored desc.
See also:
f2_desctag_reg() f2_desctag_set()


Generated on Tue Jun 24 12:24:07 2008 for Furnarchy Module by  doxygen 1.5.5