Go to the documentation of this file.
13 #include <qiodevice.h>
15 #include <qscriptengine.h>
189 int length =
value.property(
"length").toInt32();
190 for (
int l = 0;
l < length;
l++)
193 QScriptValue sub =
value.property(
l);
195 int subl = sub.property(
"length").toInt32();
196 for (
int s = 0; s < subl; s++)
197 items.append(sub.property(s).toString());
207 file.open(QIODevice::ReadOnly);
210 if (
data.size() == 0)
213 if (!
script.startsWith(
'['))
217 QScriptEngine engine;
219 if (engine.hasUncaughtException())
221 qDebug() <<
"message file evaluate error" <<
myPath << engine.uncaughtException().toString();
229 int length =
rules.property(
"length").toInt32();
230 for (
int r = 0;
r < length;
r++)
234 QScriptValue v =
rules.property(
r);
236 rule->setComment(v.property(
"comment").toString());
239 qScriptValueToSequence(v.property(
"match"), items);
240 rule->setMatch(items);
242 QList<QStringList>
lists;
243 QScriptValue p = v.property(
"pre");
247 p = v.property(
"post");
252 qScriptValueToSequence(v.property(
"include"), items);
253 rule->setInclude(items);
256 qScriptValueToSequence(v.property(
"msg"), items);
257 rule->setMessages(items);
259 p = v.property(
"replies");
279 return tmp.replace(
'"',
"\\\"").replace(
'\n',
"\\n");
289 return "[" + one.join(
", ") +
"]";
296 foreach(
const QStringList&
list,
data)
301 return "[" + lines.join(
", ") +
"]";
308 if (!
rule->include().isEmpty())
311 if (!
rule->preconditions().isEmpty())
319 if (!
rule->comment().isEmpty())
321 result +=
" \"comment\" : \"";
326 result +=
" \"match\" : ";
329 result +=
",\n \"pre\" : ";
332 result +=
",\n \"post\" : ";
335 result +=
",\n \"msg\" : ";
338 if (!
rule->replies().isEmpty())
340 result +=
",\n \"replies\" : ";
354 if (
rule->isModified())
363 qDebug() <<
"MessageFile saving" <<
myPath;
365 QString
data =
"{\n";
368 data +=
" \"rules\": [\n ";
374 rule->setModified(
false);
382 file.open(QIODevice::WriteOnly | QIODevice::Truncate);
403 QList<QStringList> conditions =
rule->preconditions();
404 conditions.append(
rule->postconditions());
405 foreach(QStringList
list, conditions) {
406 if (
list.size() > 1 && (
list[0] ==
"quest" ||
list[0] ==
"questdone") &&
list[1] ==
quest->wrappedItem()->quest_code) {
MessageFile * duplicate() const
Install Bug reporting Credits so make sure you have version or later There are files involved in the automatic convert convertall and filelist py GuildList has the list of guilds for the server GuildLocations is what is used by the install script for setting up the maps It has columns in the first is the name of the no spaces The second is the region of the the third is the destination folder for the the fourth is the exit the fifth and sixth are the x and y coords within the exit the seventh eighth and ninth are the exit location for the storage hall If field seven is then it uses the same exit map as for the guild hall itself filelist py has a list of which files to process for each guild hall convert py takes all the files in filelist py and customises them to the specific guild then outputs them into a in the same order that they are listed in GuildLocations convertall py reads the lines from GuildLocations and runs line by line
void setModified(bool modified=true)
QList< MessageRule * > & rules()
const QList< QStringList > & replies() const
void setMessages(const QStringList &messages)
void setPath(const QString &path)
const QString & comment() const
QList< QStringList > myPreconditions
const QList< QStringList > & postconditions() const
Install Bug reporting Credits so make sure you have version or later There are files involved in the automatic convert convertall and filelist py GuildList has the list of guilds for the server GuildLocations is what is used by the install script for setting up the maps It has columns in the first is the name of the no spaces The second is the region of the the third is the destination folder for the the fourth is the exit location(usually the world map)
Install Bug reporting Credits but rather whatever guild name you are using *With the current map and server there are three they and GreenGoblin *Whatever name you give the folder should but it will still use GUILD_TEMPLATE *You can change what guild it uses by editing the map files Modify Map or objects if you want to use the optional Python based Guild Storage hall The first three are on the main the next two are in the guild_hq and the final one is in hallofjoining Withe the Storage three objects are found on the main floor and the last two are in the basement It s not that but you will need a map editor You find the object that has the script
void setModified(bool modified=true)
void setMatch(const QStringList &match)
const QList< QStringList > & preconditions() const
QList< CREMapInformation * > & maps()
void setPreconditions(const QList< QStringList > &preconditions)
pluglist shows those as well as a short text describing each the list will simply appear empty The keyword for the Python plugin is Python plugout< keyword > Unloads a given identified by its _keyword_ So if you want to unload the Python you need to do plugout Python plugin< libname > Loads a given whose _filename_ is libname So in the case of you d have to do a plugin cfpython so Note that all filenames are relative to the default plugin path(SHARE/plugins). Console messages. ----------------- When Crossfire starts
virtual PossibleUse uses(const AssetWrapper *asset, std::string &) const override
QList< CREMapInformation * > myMaps
void convert(QScriptValue &value, QList< QStringList > &list)
void setComment(const QString &comment)
void setInclude(const QStringList &include)
MessageFile(AssetWrapper *parent, const QString &path)
QList< QStringList > myReplies
void setPostconditions(const QList< QStringList > &postconditions)
void setLocation(const QString &location)
const QStringList & match() const
void setReplies(const QList< QStringList > &replies)
Crossfire Protocol most of the time after the actual code was already omit certain important and possibly make life miserable any new developer or curious player should be able to find most of the relevant information here If inconsistencies are found or this documentation proves to be consider the latest server side protocol code in the public source code repository as the authoritative reference Introduction If you were ever curious enough to telnet or netcat to a Crossfire chances are you were sorely disappointed While the protocol may seem to use plain text at it actually uses a mix of ASCII and binary data This handbook attempts to document various aspects of the Crossfire protocol As consult the README file to find out how to get in touch with helpful people via mailing lists
QList< QStringList > myPostconditions
QList< MessageRule * > myRules
Crossfire Protocol most of the time after the actual code was already omit certain important and possibly make life miserable any new developer or curious player should be able to find most of the relevant information here If inconsistencies are found or this documentation proves to be consider the latest server side protocol code in the public source code repository as the authoritative reference Introduction If you were ever curious enough to telnet or netcat to a Crossfire chances are you were sorely disappointed While the protocol may seem to use plain text at first
void copy(const MessageFile *other)
const QStringList & include() const
Crossfire Protocol most of the time after the actual code was already omit certain important and possibly make life miserable any new developer or curious player should be able to find most of the relevant information here If inconsistencies are found or this documentation proves to be consider the latest server side protocol code in the public source code repository as the authoritative reference Introduction If you were ever curious enough to telnet or netcat to a Crossfire chances are you were sorely disappointed While the protocol may seem to use plain text at it actually uses a mix of ASCII and binary data This handbook attempts to document various aspects of the Crossfire protocol As consult the README file to find out how to get in touch with helpful people via mailing and more History the communications plan was set to be a text based system It was up to the server and client to parse these messages and determine what to do These messages were assumed to be line per message At a reasonably early stage of Eric Anderson wrote a then the data itself you could send many data and after the other end could decode these commands This works fairly but I think the creation of numerous sub packets has some performance hit the eutl was not especially well so writing a client for a different platform became more Eric left to work on other products shortly after writing his which didn t really leave anyone with a full understanding of the socket code I have decided to remove the eutl dependency At least one advantage is that having this network related code directly in the client and server makes error handling a bit easier cleaner Packet Format the outside packet method the byte size for the size information is not included here Eutl originally used bytes for the size to bytes seems it makes a least some sense The actual data is something of the nature of the commands listed below It is a text followed by possible other data The remaining data can be binary it is up to the client and server to decode what it sent The commands as described below is just the data portion of the packet If writing a new remember that you must take into account the size of the packet There is no termination of other than knowing how long it should be For most everything that is sent is text This is more or less how things worked under except it packed the ints into bytes in a known order In some we handle ints as in they are sent as binary information How any command handles it is detailed below in the command description The S and C represent the direction of the we use MSB as well as any ints or shorts that get sent inside the packets All packets are defined to have at least one word of text
const QStringList & messages() const