 |
Crossfire Server, Trunk
1.75.0
|
Go to the documentation of this file.
26 int text = 0, nrofmsg = 0;
28 LOG(
llevDebug,
"Reading messages from %s...\n", filename.c_str());
38 while (cp >
buf && (cp[-1] ==
' ' || cp[-1] ==
'\t'))
45 if (
text && strncmp(
buf,
"ENDMSG", 6) == 0) {
47 LOG(
llevDebug,
"Warning: this string exceeded max book buf size:\n");
68 }
else if (strcmp(
buf,
"TEXT") == 0) {
70 }
else if (strncmp(
buf,
"CHANCE ", 7) == 0) {
72 }
else if (strncmp(
buf,
"TITLE ", 6) == 0) {
74 }
else if (strncmp(
buf,
"QUEST ", 6) == 0) {
76 }
else if (strncmp(
buf,
"FACE ", 5) == 0) {
82 }
else if (strncmp(
buf,
"MSG", 3) == 0) {
109 LOG(
llevDebug,
"done messages %s, found %d messages.\n", filename.c_str(), nrofmsg);
New face structure - this enforces the notion that data is face by face only - you can not change the...
One general message, from the lib/messages file.
size_t bufferreader_current_line(BufferReader *br)
Return the index of the last line returned by bufferreader_next_line().
@ llevError
Error, serious thing.
AssetsTracker * m_tracker
void LOG(LogLevel logLevel, const char *format,...)
Logs a message to stderr, or to file.
MessageLoader(Messages *messages, AssetsTracker *tracker)
sstring title
The message's title, only used for knowledge.
sstring identifier
Message identifier, can be NULL.
const Face * find_face(const char *name)
#define HUGE_BUF
Used for messages - some can be quite long.
Base class to be informed of where an asset is defined.
int chance
Relative chance of the message appearing randomly.
T * define(const Key &name, T *asset)
Define an asset, erasing an existing one.
sstring add_string(const char *str)
This will add 'str' to the hash table.
virtual void assetDefined(const archetype *asset, const std::string &filename)
Function called when an asset is defined in a file.
void fatal(enum fatal_error err)
fatal() is meant to be called whenever a fatal signal is intercepted.
sstring message
The message's body.
static char msgbuf[HUGE_BUF]
#define BOOK_BUF
Maximum message buf size for books.
virtual void load(BufferReader *reader, const std::string &filename) override
Load assets from the specified reader.
int buf_overflow(const char *buf1, const char *buf2, size_t bufsize)
We don't want to exceed the buffer size of buf1 by adding on buf2!
const Face * face
Face the message displays at in the knowledge dialog, NULL if no face defined.
@ llevDebug
Only for debugging purposes.
sstring quest_code
Optional quest code and state this message will start.
in that case they will be relative to whatever the PWD of the crossfire server process is You probably shouldn though Notes on Specific and settings file datadir Usually usr share crossfire Contains data that the server does not need to modify while such as the etc A default install will pack the and treasurelist definitions into a single or trs file and the graphics into a face(metadata) and .tar(bitmaps) file
char * bufferreader_next_line(BufferReader *br)
Return the next line in the buffer, as separated by a newline.