Crossfire Server, Trunk
CREPrePostPanel.cpp
Go to the documentation of this file.
1 /*
2  * Crossfire -- cooperative multi-player graphical RPG and adventure game
3  *
4  * Copyright (c) 2022 the Crossfire Development Team
5  *
6  * Crossfire is free software and comes with ABSOLUTELY NO WARRANTY. You are
7  * welcome to redistribute it under certain conditions. For details, please
8  * see COPYING and LICENSE.
9  *
10  * The authors can be reached via e-mail at <crossfire@metalforge.org>.
11  */
12 
13 #include <QtWidgets>
14 #include "CREPrePostPanel.h"
15 #include "QuestConditionScript.h"
16 #include "assets.h"
17 #include "AssetsManager.h"
18 #include "CREPixmap.h"
19 #include "quest.h"
20 
22 {
23  QGridLayout* layout = new QGridLayout(this);
24 
25  mySubItems = new QListWidget(this);
26  mySubItems->setViewMode(QListView::ListMode);
27  layout->addWidget(mySubItems, 0, 0, 1, 2);
28 
29  QPushButton* addSubItem = new QPushButton(tr("add"), this);
30  connect(addSubItem, SIGNAL(clicked(bool)), this, SLOT(onAddSubItem(bool)));
31  layout->addWidget(addSubItem, 1, 0);
32 
33  QPushButton* delSubItem = new QPushButton(tr("delete"), this);
34  connect(delSubItem, SIGNAL(clicked(bool)), this, SLOT(onDeleteSubItem(bool)));
35  layout->addWidget(delSubItem, 1, 1);
36 
37  connect(mySubItems->itemDelegate(), SIGNAL(closeEditor(QWidget*, QAbstractItemDelegate::EndEditHint)), this, SLOT(endEdition(QWidget*, QAbstractItemDelegate::EndEditHint)));
38 }
39 
40 void CRESubItemList::addItem(const QString& item)
41 {
42  QListWidgetItem* wi = new QListWidgetItem(item);
43  wi->setFlags(wi->flags() | Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable);
44  mySubItems->addItem(wi);
45 }
46 
47 void CRESubItemList::setData(const QStringList& data)
48 {
49  QStringList d(data);
50  d.takeFirst();
51  mySubItems->clear();
52  for (const QString& item : d)
53  addItem(item);
54 }
55 
56 QStringList CRESubItemList::data() const
57 {
58  QStringList values;
59  for (int i = 0; i < mySubItems->count(); i++)
60  values.append(mySubItems->item(i)->text());
61  return values;
62 }
63 
64 void CRESubItemList::endEdition(QWidget*, QAbstractItemDelegate::EndEditHint)
65 {
66  emit dataModified(data());
67 }
68 
70 {
71  addItem("(item)");
72  mySubItems->setCurrentRow(mySubItems->count() - 1);
73  mySubItems->editItem(mySubItems->currentItem());
74 
75  emit dataModified(data());
76 }
77 
79 {
80  if (mySubItems->currentRow() < 0)
81  return;
82 
83  delete mySubItems->takeItem(mySubItems->currentRow());
84  mySubItems->setCurrentRow(0);
85  emit dataModified(data());
86 }
87 
89 {
90  QVBoxLayout* layout = new QVBoxLayout(this);
91 
92  layout->addWidget(new QLabel(tr("Connection number:"), this));
93  myEdit = new QLineEdit(this);
94  myEdit->setValidator(new QIntValidator(1, 65000, myEdit));
95  connect(myEdit, SIGNAL(textChanged(const QString&)), this, SLOT(editChanged(const QString&)));
96  layout->addWidget(myEdit);
97  myWarning = new QLabel(this);
98  myWarning->setVisible(false);
99  layout->addWidget(myWarning);
100  layout->addStretch();
101 }
102 
103 void CRESubItemConnection::setData(const QStringList& data)
104 {
105  if (data.size() < 2)
106  {
107  showWarning(tr("Not enough arguments"));
108  return;
109  }
110 
111  bool ok = false;
112  int value = data[1].toInt(&ok);
113  if (!ok || value <= 0 || value > 65000)
114  {
115  showWarning(tr("Invalid number %1, must be a number between 1 and 65000").arg(data[1]));
116  value = 1;
117  }
118 
119  myWarning->setVisible(false);
120  myEdit->setText(QString::number(value));
121 }
122 
123 void CRESubItemConnection::showWarning(const QString& warning)
124 {
125  myWarning->setText(warning);
126  myWarning->setVisible(true);
127 }
128 
130 {
131  bool ok = false;
132  int value = text.toInt(&ok);
133  if (!ok || value <= 0 || value > 65000)
134  {
135  showWarning(tr("Invalid number %1, must be a number between 1 and 65000").arg(text));
136  return;
137  }
138 
139  myWarning->setVisible(false);
140  emit dataModified(QStringList(text));
141 }
142 
144 {
145  myInit = true;
146 
147  QVBoxLayout* layout = new QVBoxLayout(this);
148 
149  layout->addWidget(new QLabel(tr("Quest:"), this));
150 
151  myQuestList = new QComboBox(this);
152  layout->addWidget(myQuestList);
153 
155  {
156  myAtStep = new QRadioButton(tr("at step"), this);
157  layout->addWidget(myAtStep);
158  myBelowStep = new QRadioButton(tr("below step"), this);
159  layout->addWidget(myBelowStep);
160  myBelowStep->setVisible(mode == PrePostWidget::SetWhen);
161  myFromStep = new QRadioButton(tr("from step"), this);
162  layout->addWidget(myFromStep);
164  myStepRange = new QRadioButton(tr("from step to step"), this);
165  layout->addWidget(myStepRange);
166 
167  connect(myAtStep, SIGNAL(toggled(bool)), this, SLOT(checkToggled(bool)));
168  connect(myBelowStep, SIGNAL(toggled(bool)), this, SLOT(checkToggled(bool)));
169  connect(myFromStep, SIGNAL(toggled(bool)), this, SLOT(checkToggled(bool)));
170  connect(myStepRange, SIGNAL(toggled(bool)), this, SLOT(checkToggled(bool)));
171  }
172  else
173  {
174  layout->addWidget(new QLabel(tr("New step:"), this));
175  myAtStep = NULL;
176  myBelowStep = nullptr;
177  myFromStep = NULL;
178  }
179 
180  myFirstStep = new QComboBox(this);
181  layout->addWidget(myFirstStep);
182 
184  {
185  mySecondStep = new QComboBox(this);
186  layout->addWidget(mySecondStep);
187  }
188  else
189  mySecondStep = NULL;
190 
191  layout->addStretch();
192 
193  connect(myQuestList, SIGNAL(currentIndexChanged(int)), this, SLOT(selectedQuestChanged(int)));
194  getManager()->quests()->each([&] (auto quest) {
195  myQuestList->addItem(QString(quest->quest_title) + " [" + quest->quest_code + "]", quest->quest_code);
196  myQuestList->setItemData(myQuestList->count() - 1, QString(quest->quest_description), Qt::ToolTipRole);
197  if (quest->face) {
198  myQuestList->setItemIcon(myQuestList->count() - 1, CREPixmap::getIcon(quest->face->number));
199  }
200  });
201  connect(myFirstStep, SIGNAL(currentIndexChanged(int)), this, SLOT(selectedStepChanged(int)));
202  if (mySecondStep)
203  connect(mySecondStep, SIGNAL(currentIndexChanged(int)), this, SLOT(selectedStepChanged(int)));
204 
205  myInit = false;
206 }
207 
208 void CRESubItemQuest::setData(const QStringList& data)
209 {
210  if (data.size() < 3)
211  {
212  if (myAtStep)
213  myAtStep->setChecked(true);
214  return;
215  }
216 
217  int index = myQuestList->findData(data[1], Qt::UserRole);
218  if (index == -1)
219  {
220  return;
221  }
222 
223  myInit = true;
224  myQuestList->setCurrentIndex(index);
225 
227  {
228  myFirstStep->setCurrentIndex(myFirstStep->findData(data[2], Qt::UserRole));
229  myInit = false;
230  return;
231  }
232 
233  QString steps = data[2];
234  int idx = steps.indexOf('-');
235 
236  if (idx == -1)
237  {
238  int start = 0;
239  if (steps.startsWith("<="))
240  {
241  myBelowStep->setChecked(true);
242  start = 2;
243  }
244  else if (steps.startsWith('=') || myMode == PrePostWidget::SetWhen)
245  {
246  myAtStep->setChecked(true);
247  start = myMode == PrePostWidget::SetWhen ? 0 : 1;
248  }
249  else
250  {
251  myFromStep->setChecked(true);
252  }
253 
254  myFirstStep->setCurrentIndex(myFirstStep->findData(steps.mid(start), Qt::UserRole));
255  }
256  else
257  {
258  myStepRange->setChecked(true);
259  myFirstStep->setCurrentIndex(myFirstStep->findData(steps.left(idx), Qt::UserRole));
260  mySecondStep->setCurrentIndex(mySecondStep->findData(steps.mid(idx + 1), Qt::UserRole));
261  }
262 
263  myInit = false;
264 }
265 
267 {
268  myFirstStep->clear();
270  myFirstStep->addItem("(not started)", "0");
271 
272  if (mySecondStep)
273  mySecondStep->clear();
274 
275  if (index < 0 || index >= myQuestList->count())
276  return;
277 
278  auto quest = getManager()->quests()->find(myQuestList->currentData().toString().toStdString());
279  if (!quest)
280  return;
281 
282  QString desc;
283  auto it = quest->steps.cbegin();
284  while (it != quest->steps.cend()) {
285  auto step = *it;
286  desc = tr("%1 (%2)").arg(QString(step->step_description).left(50), QString::number(step->step));
287  if (step->is_completion_step)
288  desc += " (end)";
289  myFirstStep->addItem(desc, QString::number(step->step));
290  myFirstStep->setItemData(myFirstStep->count() - 1, QString(step->step_description), Qt::ToolTipRole);
291  if (mySecondStep)
292  mySecondStep->addItem(desc, QString::number(step->step));
293 
294  ++it;
295  }
296 }
297 
299 {
300  if (myInit)
301  return;
302 
303  QStringList data;
304 
305  data << myQuestList->itemData(myQuestList->currentIndex(), Qt::UserRole).toString();
306 
308  {
309  QString value;
310  if (myStepRange->isChecked())
311  {
312  value = myFirstStep->itemData(myFirstStep->currentIndex(), Qt::UserRole).toString();
313  value += "-";
314  value += mySecondStep->itemData(mySecondStep->currentIndex(), Qt::UserRole).toString();
315  }
316  else
317  {
318  if (myAtStep->isChecked() && myMode != PrePostWidget::SetWhen)
319  value = "=";
320  else if (myBelowStep->isChecked())
321  value = "<=";
322  value += myFirstStep->itemData(myFirstStep->currentIndex(), Qt::UserRole).toString();
323  }
324 
325  data << value;
326  }
327  else
328  {
329  data << myFirstStep->itemData(myFirstStep->currentIndex(), Qt::UserRole).toString();
330  }
331 
332  emit dataModified(data);
333 }
334 
336 {
337  if (checked == false)
338  return;
339 
340  mySecondStep->setEnabled(myStepRange->isChecked());
341  updateData();
342 }
343 
345 {
346  if (index == -1)
347  return;
348 
349  updateData();
350 }
351 
352 CRESubItemToken::CRESubItemToken(bool isPre, QWidget* parent) : CRESubItemWidget(parent)
353 {
354  QVBoxLayout* layout = new QVBoxLayout(this);
355 
356  layout->addWidget(new QLabel(tr("Token:"), this));
357  myToken = new QLineEdit(this);
358  layout->addWidget(myToken);
359  connect(myToken, SIGNAL(textChanged(const QString&)), this, SLOT(tokenChanged(const QString&)));
360 
361  if (isPre)
362  {
363  layout->addWidget(new QLabel(tr("Values the token can be (one per line):"), this));
364  myValues = new QTextEdit(this);
365  myValues->setAcceptRichText(false);
366  layout->addWidget(myValues);
367  connect(myValues, SIGNAL(textChanged()), this, SLOT(valuesChanged()));
368  myValue = NULL;
369  }
370  else
371  {
372  layout->addWidget(new QLabel(tr("Value to set for the token:"), this));
373  myValue = new QLineEdit(this);
374  layout->addWidget(myValue);
375  connect(myValue, SIGNAL(textChanged(const QString&)), this, SLOT(tokenChanged(const QString&)));
376  myValues = NULL;
377  }
378  layout->addStretch();
379 }
380 
381 void CRESubItemToken::setData(const QStringList& data)
382 {
383  QStringList copy(data);
384 
385  if (data.size() < 2)
386  {
387  myToken->clear();
388  if (myValues != NULL)
389  myValues->clear();
390  if (myValue != NULL)
391  myValue->clear();
392 
393  return;
394  }
395  copy.removeFirst();
396  myToken->setText(copy.takeFirst());
397  if (myValues != NULL)
398  myValues->setText(copy.join("\n"));
399  else if (copy.size() > 0)
400  myValue->setText(copy[0]);
401  else
402  myValue->clear();
403 }
404 
406 {
407  QStringList values;
408  values.append(myToken->text());
409  if (myValues != NULL)
410  values.append(myValues->toPlainText().split("\n"));
411  else
412  values.append(myValue->text());
413  emit dataModified(values);
414 }
415 
416 void CRESubItemToken::tokenChanged(const QString&)
417 {
418  updateData();
419 }
420 
422 {
423  updateData();
424 }
425 
426 CREPrePostPanel::CREPrePostPanel(PrePostWidget::Mode mode, const QList<QuestConditionScript*> scripts, QWidget* parent) : QDialog(parent), myMode(mode)
427 {
428  setModal(true);
429  switch (mode) {
431  setWindowTitle(tr("Message pre-condition"));
432  break;
434  setWindowTitle(tr("Message post-condition"));
435  break;
437  setWindowTitle(tr("Step set when"));
438  break;
439  }
440 
441  QVBoxLayout* layout = new QVBoxLayout(this);
442 
443  layout->addWidget(new QLabel(tr("Script:"), this));
444 
445  myChoices = new QComboBox(this);
446  layout->addWidget(myChoices);
447 
448  mySubItemsStack = new QStackedWidget(this);
449 
450  for(int script = 0; script < scripts.size(); script++)
451  {
452  if (mode == PrePostWidget::SetWhen && scripts[script]->name() != "quest")
453  continue;
454  myChoices->addItem(scripts[script]->name());
455  myChoices->setItemData(script, scripts[script]->comment(), Qt::ToolTipRole);
457  mySubItemsStack->addWidget(mySubWidgets.last());
458  connect(mySubWidgets.last(), SIGNAL(dataModified(const QStringList&)), this, SLOT(subItemChanged(const QStringList&)));
459  }
460 
461  layout->addWidget(mySubItemsStack);
462 
463  QPushButton* reset = new QPushButton(tr("reset changes"), this);
464  connect(reset, SIGNAL(clicked(bool)), this, SLOT(onReset(bool)));
465  layout->addWidget(reset);
466 
467  connect(myChoices, SIGNAL(currentIndexChanged(int)), this, SLOT(currentChoiceChanged(int)));
468 
469  if (PrePostWidget::SetWhen == mode) {
470  myChoices->setVisible(false);
471  layout->itemAt(0)->widget()->setVisible(false);
472  }
473 }
474 
476 {
477 }
478 
480 {
481  return myData;
482 }
483 
484 void CREPrePostPanel::setData(const QStringList& data)
485 {
486  myData = data;
487  if (myMode == PrePostWidget::SetWhen && !myData.empty() && myData[0] != "quest")
488  myData.push_front("quest");
489  myOriginal = myData;
490  if (myData.isEmpty())
491  return;
492 
493  myChoices->setCurrentIndex(myChoices->findText(myOriginal[0]));
494 
495  mySubWidgets[myChoices->currentIndex()]->setData(myOriginal);
496 }
497 
499 {
500  if (myData.size() == 0)
501  myData.append(myChoices->currentText());
502  else
503  myData[0] = myChoices->currentText();
504 
505  mySubItemsStack->setCurrentIndex(myChoices->currentIndex());
506  mySubWidgets[myChoices->currentIndex()]->setData(myData);
507 }
508 
509 void CREPrePostPanel::subItemChanged(const QStringList& data)
510 {
511  while (myData.size() > 1)
512  myData.removeLast();
513  myData.append(data);
514 }
515 
517 {
518  if (myMode == PrePostWidget::PostConditions && script->name() == "connection")
519  return new CRESubItemConnection(this);
520 
521  if (script->name() == "quest")
522  return new CRESubItemQuest(myMode, this);
523 
524  if (script->name() == "token" || script->name() == "settoken" || script->name() == "npctoken" || script->name() == "setnpctoken")
526 
527  return new CRESubItemList(this);
528 }
529 
531 {
532  if (QMessageBox::question(this, "Confirm reset", "Reset the condition to initial initial values, losing all changes?") != QMessageBox::StandardButton::Yes)
533  return;
535 }
CRESubItemQuest
Definition: CREPrePostPanel.h:69
CRESubItemToken::myValue
QLineEdit * myValue
Definition: CREPrePostPanel.h:115
CRESubItemWidget::dataModified
void dataModified(const QStringList &data)
layout
Definition: main.cpp:84
it
**Media tags please refer to the protocol file in doc Developers protocol Quick for your pleasure an example[/b][i] This is an old full of dirt and partially destroyed[hand] My dear as you two years i had to leave quickly Words have come to me of powerful magic scrolls discovered in an old temple by my uncle I have moved to study them I not forgot your knowledge in ancient languages I need your help for[print][b] Some parts of document are to damaged to be readable[/b][arcane] Arghis[color=Red] k h[color=dark slate blue] ark[color=#004000] fido[/color][hand] please come as fast as possible my friend[print][b] The bottom of letter seems deliberatly shredded What is it
Definition: media-tags.txt:28
CREPrePostPanel::myOriginal
QStringList myOriginal
Definition: CREPrePostPanel.h:173
CREPrePostPanel::CREPrePostPanel
CREPrePostPanel(PrePostWidget::Mode mode, const QList< QuestConditionScript * > scripts, QWidget *parent)
Definition: CREPrePostPanel.cpp:426
python_init.scripts
scripts
Definition: python_init.py:11
CRESubItemToken::tokenChanged
void tokenChanged(const QString &)
Definition: CREPrePostPanel.cpp:416
CRESubItemList::mySubItems
QListWidget * mySubItems
Definition: CREPrePostPanel.h:141
CRESubItemConnection::myWarning
QLabel * myWarning
Definition: CREPrePostPanel.h:58
CREPrePostPanel::myMode
PrePostWidget::Mode myMode
Definition: CREPrePostPanel.h:181
CREPrePostPanel::~CREPrePostPanel
virtual ~CREPrePostPanel()
Definition: CREPrePostPanel.cpp:475
CRESubItemQuest::CRESubItemQuest
CRESubItemQuest(PrePostWidget::Mode mode, QWidget *parent)
Definition: CREPrePostPanel.cpp:143
CRESubItemQuest::myStepRange
QRadioButton * myStepRange
Definition: CREPrePostPanel.h:89
CREPrePostPanel::getData
QStringList getData()
Definition: CREPrePostPanel.cpp:479
CRESubItemQuest::updateData
void updateData()
Definition: CREPrePostPanel.cpp:298
QuestConditionScript.h
CRESubItemConnection
Definition: CREPrePostPanel.h:47
CRESubItemToken::setData
virtual void setData(const QStringList &data)
Definition: CREPrePostPanel.cpp:381
CRESubItemList::data
QStringList data() const
Definition: CREPrePostPanel.cpp:56
CRESubItemQuest::checkToggled
void checkToggled(bool checked)
Definition: CREPrePostPanel.cpp:335
mode
linux kernel c mode(defun linux-c-mode() "C mode with adjusted defaults for use with the Linux kernel."(interactive)(c-mode)(c-set-style "K&R")(setq c-basic-offset 8))
CRESubItemConnection::setData
virtual void setData(const QStringList &data)
Definition: CREPrePostPanel.cpp:103
CRESubItemQuest::mySecondStep
QComboBox * mySecondStep
Definition: CREPrePostPanel.h:85
CREPrePostPanel::onReset
void onReset(bool)
Definition: CREPrePostPanel.cpp:530
AssetsManager.h
getManager
AssetsManager * getManager()
Definition: assets.cpp:305
CREPrePostPanel::myChoices
QComboBox * myChoices
Definition: CREPrePostPanel.h:175
name
Plugin animator file specs[Config] name
Definition: animfiles.txt:4
CRESubItemQuest::myFirstStep
QComboBox * myFirstStep
Definition: CREPrePostPanel.h:83
QuestConditionScript
Definition: QuestConditionScript.h:21
CRESubItemWidget
Definition: CREPrePostPanel.h:31
quest
Definition: quest.py:1
AssetsManager::quests
Quests * quests()
Definition: AssetsManager.h:71
CRESubItemQuest::setData
virtual void setData(const QStringList &data)
Definition: CREPrePostPanel.cpp:208
CRESubItemToken::CRESubItemToken
CRESubItemToken(bool isPre, QWidget *parent)
Definition: CREPrePostPanel.cpp:352
CREPrePostPanel::myData
QStringList myData
Definition: CREPrePostPanel.h:171
CRESubItemList::endEdition
void endEdition(QWidget *editor, QAbstractItemDelegate::EndEditHint hint)
Definition: CREPrePostPanel.cpp:64
CRESubItemQuest::myQuestList
QComboBox * myQuestList
Definition: CREPrePostPanel.h:81
CRESubItemToken::updateData
void updateData()
Definition: CREPrePostPanel.cpp:405
AssetsCollection::find
T * find(const Key &name)
Definition: AssetsCollection.h:108
CRESubItemToken
Definition: CREPrePostPanel.h:104
CRESubItemList::addItem
void addItem(const QString &item)
Definition: CREPrePostPanel.cpp:40
script
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
Definition: README.txt:19
CREPrePostPanel.h
navar-midane_time.data
data
Definition: navar-midane_time.py:11
CRESubItemConnection::showWarning
void showWarning(const QString &warning)
Definition: CREPrePostPanel.cpp:123
CREPrePostPanel::setData
void setData(const QStringList &data)
Definition: CREPrePostPanel.cpp:484
CRESubItemQuest::myMode
PrePostWidget::Mode myMode
Definition: CREPrePostPanel.h:79
step
How to Install a Crossfire Server on you must install a python script engine on your computer Python is the default script engine of Crossfire You can find the python engine you have only to install them The VisualC Crossfire settings are for but you habe then to change the pathes in the VC settings Go in Settings C and Settings Link and change the optional include and libs path to the new python installation path o step
Definition: INSTALL_WIN32.txt:20
d
How to Install a Crossfire Server on you must install a python script engine on your computer Python is the default script engine of Crossfire You can find the python engine you have only to install them The VisualC Crossfire settings are for d
Definition: INSTALL_WIN32.txt:13
CREPrePostPanel::mySubItemsStack
QStackedWidget * mySubItemsStack
Definition: CREPrePostPanel.h:179
CREPrePostPanel::createSubItemWidget
CRESubItemWidget * createSubItemWidget(const QuestConditionScript *script)
Definition: CREPrePostPanel.cpp:516
CRESubItemList::onAddSubItem
void onAddSubItem(bool)
Definition: CREPrePostPanel.cpp:69
CRESubItemQuest::myBelowStep
QRadioButton * myBelowStep
Definition: CREPrePostPanel.h:87
quest.h
CRESubItemList
Definition: CREPrePostPanel.h:128
CRESubItemList::CRESubItemList
CRESubItemList(QWidget *parent)
Definition: CREPrePostPanel.cpp:21
PrePostWidget::PreConditions
@ PreConditions
Definition: CREPrePostList.h:27
CRESubItemConnection::CRESubItemConnection
CRESubItemConnection(QWidget *parent)
Definition: CREPrePostPanel.cpp:88
CREPixmap.h
AssetsCollection::each
void each(std::function< void(T *)> op)
Definition: AssetsCollection.h:158
item
Definition: item.py:1
CRESubItemQuest::selectedStepChanged
void selectedStepChanged(int index)
Definition: CREPrePostPanel.cpp:344
autojail.value
value
Definition: autojail.py:6
CRESubItemQuest::myAtStep
QRadioButton * myAtStep
Definition: CREPrePostPanel.h:86
CRESubItemQuest::myInit
bool myInit
Definition: CREPrePostPanel.h:90
assets.h
npc_dialog.index
int index
Definition: npc_dialog.py:102
CRESubItemList::setData
void setData(const QStringList &data)
Definition: CREPrePostPanel.cpp:47
reset
Python Guilds Quick outline Add a guild(mapmakers) this is still a problem *after dropping the token to gain access to the stove a woodfloor now appears which is Toolshed Token(found in Guild_HQ) *Note also have multiple gates in place to protect players and items from the mana explosion drop x for Jewelers room *Jewelers room works just need to determine what x is drop x for Thaumaturgy room *Thaumaturgy room works just need to determine what x is drop gold dropping the Firestar named fearless allows access to but I suspect that the drop location of the chest is not as intended because the player is in the way once you enter the chest the exit back to the basement is things such as the message et al reside on teleporters which then transport items to the map as they are when the map is reset(which is normal)
CRESubItemConnection::editChanged
void editChanged(const QString &text)
Definition: CREPrePostPanel.cpp:129
CRESubItemQuest::selectedQuestChanged
void selectedQuestChanged(int index)
Definition: CREPrePostPanel.cpp:266
CRESubItemQuest::myFromStep
QRadioButton * myFromStep
Definition: CREPrePostPanel.h:88
ok
No space after the left no space before the right paren Comma right after the formal space right after the comma Local variable names Just a rules of thumb These are ok
Definition: style-guide.txt:222
CRESubItemList::onDeleteSubItem
void onDeleteSubItem(bool)
Definition: CREPrePostPanel.cpp:78
CREPrePostPanel::currentChoiceChanged
void currentChoiceChanged(int index)
Definition: CREPrePostPanel.cpp:498
CREPrePostPanel::subItemChanged
void subItemChanged(const QStringList &data)
Definition: CREPrePostPanel.cpp:509
connect
Definition: connect.py:1
PrePostWidget::PostConditions
@ PostConditions
Definition: CREPrePostList.h:27
CRESubItemToken::valuesChanged
void valuesChanged()
Definition: CREPrePostPanel.cpp:421
PrePostWidget::SetWhen
@ SetWhen
Definition: CREPrePostList.h:27
CRESubItemConnection::myEdit
QLineEdit * myEdit
Definition: CREPrePostPanel.h:57
text
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
Definition: protocol.txt:84
PrePostWidget::Mode
Mode
Definition: CREPrePostList.h:27
if
if(!(yy_init))
Definition: loader.c:2626
CREPrePostPanel::mySubWidgets
QList< CRESubItemWidget * > mySubWidgets
Definition: CREPrePostPanel.h:177
CRESubItemToken::myValues
QTextEdit * myValues
Definition: CREPrePostPanel.h:116
CRESubItemToken::myToken
QLineEdit * myToken
Definition: CREPrePostPanel.h:114