OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
C4Control.h
Go to the documentation of this file.
1 /*
2  * OpenClonk, http://www.openclonk.org
3  *
4  * Copyright (c) 1998-2000, Matthes Bender
5  * Copyright (c) 2001-2009, RedWolf Design GmbH, http://www.clonk.de/
6  * Copyright (c) 2009-2016, The OpenClonk Team and contributors
7  *
8  * Distributed under the terms of the ISC license; see accompanying file
9  * "COPYING" for details.
10  *
11  * "Clonk" is a registered trademark of Matthes Bender, used with permission.
12  * See accompanying file "TRADEMARK" for details.
13  *
14  * To redistribute this file separately, substitute the full license texts
15  * for the above references.
16  */
17 
18 /* Control packets contain all player input in the message queue */
19 
20 #ifndef INC_C4Control
21 #define INC_C4Control
22 
23 #include "object/C4Id.h"
24 #include "network/C4PacketBase.h"
25 #include "control/C4PlayerInfo.h"
26 #include "network/C4Client.h"
27 #include "gui/C4KeyboardInput.h"
28 #include "object/C4ObjectList.h"
29 
30 // *** control base classes
31 
33 {
34 public:
37 
38 protected:
39  int32_t iByClient;
40 
41 public:
42  int32_t getByClient() const { return iByClient; }
43  bool LocalControl() const;
44  bool HostControl() const { return iByClient == C4ClientIDHost; }
45 
46  void SetByClient(int32_t iByClient);
47 
48  virtual bool PreExecute() const { return true; }
49  virtual void Execute() const = 0;
50  virtual void PreRec(C4Record *pRecord) { }
51 
52  // allowed in lobby (without dynamic loaded)?
53  virtual bool Lobby() const { return false; }
54  // allowed as direct/private control?
55  virtual bool Sync() const { return true; }
56 
57  virtual void CompileFunc(StdCompiler *pComp);
58 };
59 
60 #define DECLARE_C4CONTROL_VIRTUALS \
61  virtual void Execute() const; \
62  virtual void CompileFunc(StdCompiler *pComp);
63 
64 class C4Control : public C4PacketBase
65 {
66 public:
67  C4Control();
68  ~C4Control();
69 
70 protected:
72 
73 public:
74 
75  void Clear();
76 
77  // packet list wrappers
78  C4IDPacket *firstPkt() const { return Pkts.firstPkt(); }
79  C4IDPacket *nextPkt(C4IDPacket *pPkt) const { return Pkts.nextPkt(pPkt); }
80 
81  void AddHead(C4PacketType eType, C4ControlPacket *pCtrl) { Pkts.AddHead(eType, pCtrl); }
82  void Add(C4PacketType eType, C4ControlPacket *pCtrl) { Pkts.Add(eType, pCtrl); }
83 
84  void Take(C4Control &Ctrl) { Pkts.Take(Ctrl.Pkts); }
85  void Append(const C4Control &Ctrl) { Pkts.Append(Ctrl.Pkts); }
86  void Copy(const C4Control &Ctrl) { Clear(); Pkts.Append(Ctrl.Pkts); }
87  void Remove(C4IDPacket *pPkt) { Pkts.Remove(pPkt); }
88  void Delete(C4IDPacket *pPkt) { Pkts.Delete(pPkt); }
89 
90  // control execution
91  bool PreExecute() const;
92  void Execute() const;
93  void PreRec(C4Record *pRecord) const;
94 
95  virtual void CompileFunc(StdCompiler *pComp);
96 };
97 
98 // *** control packets
99 
101 {
108 };
109 
110 class C4ControlSet : public C4ControlPacket // sync, lobby
111 {
112 public:
114  : eValType(C4CVT_None), iData(0)
115  { }
117  : eValType(eValType), iData(iData)
118  { }
119 protected:
121  int32_t iData;
122 public:
123  // C4CVT_TeamDistribution and C4CVT_TeamColors are lobby-packets
124  virtual bool Lobby() const { return eValType == C4CVT_TeamDistribution || eValType == C4CVT_TeamColors; }
125 
127 };
128 
129 class C4ControlScript : public C4ControlPacket // sync
130 {
131 public:
132  enum { SCOPE_Console=-2, SCOPE_Global=-1 }; // special scopes to be passed as target objects
133 
136  { }
137  C4ControlScript(const char *szScript, int32_t iTargetObj, bool fUseVarsFromCallerContext = false, bool editor_select_result = false)
139  { }
140 protected:
141  int32_t iTargetObj;
143  bool editor_select_result; // if true and executed script from local client in editor mode, select the object returned by this script
145 public:
146  void SetTargetObj(int32_t iObj) { iTargetObj = iObj; }
148 };
149 
151 {
152 public:
154  : target(-1), player(NO_OWNER)
155  {}
156  C4ControlMsgBoardReply(const char *reply, int32_t target, int32_t player)
157  : reply(reply), target(target), player(player)
158  {}
159 
160 private:
161  StdCopyStrBuf reply;
162  int32_t target;
163  int32_t player;
164 
165 public:
167 };
168 
169 class C4ControlMsgBoardCmd : public C4ControlPacket // sync
170 {
171 public:
173  : player(NO_OWNER)
174  {}
175  C4ControlMsgBoardCmd(const char *command, const char *parameter, int32_t player)
176  : command(command), parameter(parameter), player(player)
177  {}
178 
179 private:
180  StdCopyStrBuf command;
181  StdCopyStrBuf parameter;
182  int32_t player;
183 
184 public:
186 };
187 
189 {
190 public:
192  : iPlr(-1), fIsAlt(false), iObjCnt(0), pObjNrs(nullptr) { }
193  C4ControlPlayerSelect(int32_t iPlr, const C4ObjectList &Objs, bool fIsAlt);
195 protected:
196  int32_t iPlr;
197  bool fIsAlt;
198  int32_t iObjCnt;
199  int32_t *pObjNrs;
200 public:
202 };
203 
205 {
206 public:
209  : iPlr(iPlr), state(state), ExtraData(rExtraData) { }
210  C4ControlPlayerControl(int32_t iPlr, int32_t iControl, int32_t iExtraData) // old-style menu com emulation
211  : iPlr(iPlr), state(C4PlayerControl::CONS_Down), ExtraData(iExtraData,0,0,0,0) { AddControl(iControl,0); }
212 
213  struct ControlItem
214  {
215  int32_t iControl;
216  int32_t iTriggerMode;
217  ControlItem() : iControl(-1), iTriggerMode(0) {}
218  ControlItem(int32_t iControl, int32_t iTriggerMode) : iControl(iControl), iTriggerMode(iTriggerMode) {}
219  void CompileFunc(StdCompiler *pComp);
220  bool operator ==(const struct ControlItem &cmp) const { return iControl==cmp.iControl && iTriggerMode == cmp.iTriggerMode; }
221  };
222  typedef std::vector<ControlItem> ControlItemVec;
223 protected:
224  int32_t iPlr;
225  int32_t state;
227  ControlItemVec ControlItems;
228 public:
230  void AddControl(int32_t iControl, int32_t iTriggerMode)
231  { ControlItems.push_back(ControlItem(iControl, iTriggerMode)); }
232  const ControlItemVec &GetControlItems() const { return ControlItems; }
234  const C4KeyEventData &GetExtraData() const { return ExtraData; }
235  void SetExtraData(const C4KeyEventData &new_extra_data) { ExtraData = new_extra_data; }
236 };
237 
238 class C4ControlPlayerMouse : public C4ControlPacket // sync
239 {
240 public:
241  enum Action
242  {
244 
245  CPM_Hover = 0x01,
246  CPM_Drop = 0x02
247  };
248 
249  C4ControlPlayerMouse() : action(CPM_NoAction), player(NO_OWNER), target_obj(0), drag_obj(0), old_obj(0) {}
250  static C4ControlPlayerMouse *Hover(const C4Player *player, const C4Object *target, const C4Object *old_target, const C4Object *drag = nullptr);
251  static C4ControlPlayerMouse *DragDrop(const C4Player *player, const C4Object *target, const C4Object *drag);
252 
253 private:
254  int32_t action;
255  int32_t player;
256  int32_t target_obj;
257  int32_t drag_obj;
258  int32_t old_obj;
259 public:
261 };
262 
263 class C4ControlMenuCommand : public C4ControlPacket // sync
264 {
265 public:
267  : menuID(0), subwindowID(0) { }
268  C4ControlMenuCommand(int32_t actionID, int32_t player, int32_t menuID, int32_t subwindowID,
269  C4Object *target, int32_t actionType);
270 protected:
272 public:
274 };
275 
277 {
278 public:
279  enum Action
280  {
282 
287 
289  CPA_SetTeam = 0x11,
290 
293  };
294 
295  C4ControlPlayerAction(const C4Player *source = nullptr);
296  static C4ControlPlayerAction *Surrender(const C4Player *source);
297  static C4ControlPlayerAction *Eliminate(const C4Player *source);
298  static C4ControlPlayerAction *ActivateGoalMenu(const C4Player *source);
299  static C4ControlPlayerAction *ActivateGoal(const C4Player *source, const C4Object *target);
300  static C4ControlPlayerAction *SetHostility(const C4Player *source, const C4Player *target, bool hostile);
301  static C4ControlPlayerAction *SetTeam(const C4Player *source, int32_t team);
302  static C4ControlPlayerAction *InitScenarioPlayer(const C4Player *source, int32_t team);
303  static C4ControlPlayerAction *InitPlayerControl(const C4Player *source, const C4PlayerControlAssignmentSet *ctrl_set = nullptr);
304 
305 private:
306  Action action;
307  int32_t source;
308  int32_t target;
309  int32_t param_int;
310  StdCopyStrBuf param_str;
311 
312  enum IpcParam
313  {
314  CPA_IPC_HasKeyboard = 1<<0,
315  CPA_IPC_HasMouse = 1<<1,
316  CPA_IPC_HasGamepad = 1<<2
317  };
318 
319 public:
321 };
322 
323 class C4ControlSyncCheck : public C4ControlPacket // not sync
324 {
325 public:
327 protected:
328  int32_t Frame;
329  int32_t ControlTick;
330  int32_t RandomCount;
331  int32_t AllCrewPosX;
332  int32_t PXSCount;
333  int32_t MassMoverIndex;
334  int32_t ObjectCount;
336  int32_t SectShapeSum;
337 public:
338  void Set();
339  int32_t getFrame() const { return Frame; }
340  virtual bool Sync() const { return false; }
342 protected:
343  static int32_t GetAllCrewPosX();
344 };
345 
346 class C4ControlSynchronize : public C4ControlPacket // sync
347 {
348 public:
351  { }
352 protected:
354 public:
356 };
357 
358 class C4ControlClientJoin : public C4ControlPacket // not sync, lobby
359 {
360 public:
362  C4ControlClientJoin(const C4ClientCore &Core) : Core(Core) { }
363 public:
365 public:
366  virtual bool Sync() const { return false; }
367  virtual bool Lobby() const { return true; }
369 };
370 
372 {
374 };
375 
376 class C4ControlClientUpdate : public C4ControlPacket // sync, lobby
377 {
378 public:
381  : iID(iID), eType(eType), iData(iData)
382  { }
383 private:
384  static const int32_t MinReadyAnnouncementDelay = 1; // seconds that need to pass between ready-state announcements to prevent spam
385 public:
386  int32_t iID;
388  int32_t iData;
389 public:
390  virtual bool Sync() const { return false; }
391  virtual bool Lobby() const { return true; }
393 };
394 
395 class C4ControlClientRemove : public C4ControlPacket // not sync, lobby
396 {
397 public:
399  C4ControlClientRemove(int32_t iID, const char *szReason = "") : iID(iID), strReason(szReason) { }
400 public:
401  int32_t iID;
403 public:
404  virtual bool Sync() const { return false; }
405  virtual bool Lobby() const { return true; }
407 };
408 
409 // control used for initial player info, as well as for player info updates
410 class C4ControlPlayerInfo : public C4ControlPacket // not sync, lobby
411 {
412 public:
414  { }
416  : PlrInfo(PlrInfo)
417  { }
418 protected:
420 public:
421  const C4ClientPlayerInfos &GetInfo() const { return PlrInfo; }
422  virtual bool Sync() const { return false; }
423  virtual bool Lobby() const { return true; }
425 };
426 
427 struct C4ControlJoinPlayer : public C4ControlPacket // sync
428 {
429 public:
430  C4ControlJoinPlayer() : iAtClient(-1), idInfo(-1), fByRes(false) { }
431  C4ControlJoinPlayer(const char *szFilename, int32_t iAtClient, int32_t iIDInfo, const C4Network2ResCore &ResCore);
432  C4ControlJoinPlayer(const char *szFilename, int32_t iAtClient, int32_t iIDInfo);
433 protected:
435  int32_t iAtClient;
436  int32_t idInfo;
437  bool fByRes;
438  StdBuf PlrData; // for fByRes == false
439  C4Network2ResCore ResCore; // for fByRes == true
440 public:
442  virtual bool PreExecute() const;
443  virtual void PreRec(C4Record *pRecord);
444  void Strip();
445 };
446 
448 {
449  EMMO_Move, // move objects by offset
450  EMMO_MoveForced,// move objects by offset and ignore HorizontalFixed
451  EMMO_Enter, // enter objects into iTargetObj
452  EMMO_Duplicate, // duplicate objects at same position; reset EditCursor
453  EMMO_Script, // execute Script
454  EMMO_Remove, // remove objects
455  EMMO_Exit, // exit objects
456  EMMO_Create, // create a new object (used by C4Game::DropDef)
457  EMMO_Transform // adjust rotation / con of selected object
458 };
459 
461 {
462 public:
465  int32_t iObjectNum = 0, int32_t *pObjects = nullptr, const char *szScript = nullptr, bool drag_finished = false);
466  static C4ControlEMMoveObject *CreateObject(const C4ID &id, C4Real x, C4Real y, C4Object *container);
468 protected:
469  C4ControlEMObjectAction eAction; // action to be performed
470  C4Real tx,ty; // target position
471  int32_t iTargetObj; // enumerated ptr to target object
472  int32_t iObjectNum; // number of objects moved
473  int32_t *pObjects; // pointer on array of objects moved
474  StdStrBuf StringParam; // script to execute, or ID of object to create
475  bool drag_finished; // Movement only: Set when mouse drag operation concluded (i.e. mouse up)
476 private:
477  void MoveObject(C4Object *moved_object, bool move_forced) const;
478 public:
480 };
481 
483 {
484  EMDT_SetMode, // set new landscape mode
485  EMDT_Brush, // drawing tool
486  EMDT_Fill, // drawing tool
487  EMDT_Line, // drawing tool
488  EMDT_Rect // drawing tool
489 };
490 
491 enum class LandscapeMode;
492 class C4ControlEMDrawTool : public C4ControlPacket // sync
493 {
494 public:
495  C4ControlEMDrawTool() : eAction(EMDT_SetMode), iX(0), iY(0), iX2(0), iY2(0), iGrade(0) { }
497  int32_t iX=-1, int32_t iY=-1, int32_t iX2=-1, int32_t iY2=-1, int32_t iGrade=-1,
498  const char *szMaterial=nullptr, const char *szTexture=nullptr,
499  const char *szBackMaterial=nullptr, const char *szBackTexture=nullptr);
500 protected:
501  C4ControlEMDrawAction eAction; // action to be performed
502  LandscapeMode iMode; // new mode, or mode action was performed in (action will fail if changed)
503  int32_t iX,iY,iX2,iY2,iGrade; // drawing parameters
504  StdStrBuf Material; // used material
505  StdStrBuf Texture; // used texture
506  StdStrBuf BackMaterial; // used background material
507  StdStrBuf BackTexture; // used background texture
508 public:
510 };
511 
513 {
515  C4CMT_Me = 1,
519  C4CMT_Sound = 5, // "message" is played as a sound instead
520  C4CMT_Alert = 6, // no message. just flash taskbar for inactive clients.
522 };
523 
524 class C4ControlMessage : public C4ControlPacket // not sync, lobby
525 {
526 public:
528  : eType(C4CMT_Normal), iPlayer(-1) { }
529  C4ControlMessage(C4ControlMessageType eType, const char *szMessage, int32_t iPlayer = -1, int32_t iToPlayer = -1)
530  : eType(eType), iPlayer(iPlayer), iToPlayer(iToPlayer), Message(szMessage, true)
531  { }
532 protected:
534  int32_t iPlayer, iToPlayer;
536 public:
537  virtual bool Sync() const { return false; }
538  virtual bool Lobby() const { return true; }
540 };
541 
542 class C4ControlRemovePlr : public C4ControlPacket // sync
543 {
544 public:
546  : iPlr(-1), fDisconnected(false) { }
548  : iPlr(iPlr), fDisconnected(fDisconnected) { }
549 protected:
550  int32_t iPlr;
552 public:
554 };
555 
556 class C4ControlDebugRec : public C4ControlPacket // sync
557 {
558 public:
560  { }
562  : Data(Data) { }
563 protected:
565 public:
567 };
568 
570 {
571  VT_None = -1,
575 };
576 
578 {
579 public:
580  C4ControlVote(C4ControlVoteType eType = VT_None, bool fApprove = true, int iData = 0)
581  : eType(eType), fApprove(fApprove), iData(iData)
582  { }
583 
584 private:
585  C4ControlVoteType eType;
586  bool fApprove;
587  int32_t iData;
588 
589 public:
590  C4ControlVoteType getType() const { return eType; }
591  bool isApprove() const { return fApprove; }
592  int32_t getData() const { return iData; }
593 
594  StdStrBuf getDesc() const;
595  StdStrBuf getDescWarning() const;
596 
597  virtual bool Sync() const { return false; }
598 
600 };
601 
603 {
604 public:
605  C4ControlVoteEnd(C4ControlVoteType eType = VT_None, bool fApprove = true, int iData = 0)
606  : C4ControlVote(eType, fApprove, iData)
607  { }
608 
609  virtual bool Sync() const { return true; }
610 
612 };
613 
615 {
616 public:
618 protected:
620 public:
622 };
623 
624 class C4ControlEditGraph : public C4ControlPacket // sync
625 {
626 public:
627  enum Action
628  {
636  };
638  C4ControlEditGraph(const char *path, Action action, int32_t index, int32_t x, int32_t y)
639  : path(path), action(action), index(index), x(x), y(y) { }
640 private:
641  StdCopyStrBuf path;
642  Action action=CEG_None;
643  int32_t index=-1, x=0, y=0;
644 public:
646 
647  const char *GetPath() const { return path.getData(); }
648  Action GetAction() const { return action; }
649  int32_t GetIndex() const { return index; }
650  int32_t GetX() const { return x; }
651  int32_t GetY() const { return y; }
652 };
653 
654 #endif
const char * getData() const
Definition: StdBuf.h:450
StdStrBuf BackTexture
Definition: C4Control.h:507
C4PlayerControl::ControlState GetState() const
Definition: C4Control.h:233
virtual bool Lobby() const
Definition: C4Control.h:391
C4IDPacket * firstPkt() const
Definition: C4Control.h:78
virtual bool Sync() const
Definition: C4Control.h:366
C4ControlDebugRec(StdBuf &Data)
Definition: C4Control.h:561
int32_t iTargetObj
Definition: C4Control.h:141
void SetByClient(int32_t iByClient)
Definition: C4Control.cpp:72
StdStrBuf Message
Definition: C4Control.h:535
C4ControlMessageType eType
Definition: C4Control.h:533
C4ControlClientJoin(const C4ClientCore &Core)
Definition: C4Control.h:362
Definition: StdBuf.h:37
C4ControlVote(C4ControlVoteType eType=VT_None, bool fApprove=true, int iData=0)
Definition: C4Control.h:580
C4Network2ResCore ResCore
Definition: C4Control.h:439
void Remove(C4IDPacket *pPkt)
Definition: C4Control.h:87
static int32_t GetAllCrewPosX()
Definition: C4Control.cpp:771
void Add(C4IDPacket *pPkt)
Definition: C4Packet2.cpp:297
static C4ControlPlayerAction * ActivateGoalMenu(const C4Player *source)
Definition: C4Control.cpp:590
void PreRec(C4Record *pRecord) const
Definition: C4Control.cpp:138
C4ControlMsgBoardReply(const char *reply, int32_t target, int32_t player)
Definition: C4Control.h:156
void Delete(C4IDPacket *pPkt)
Definition: C4Control.h:88
C4ControlPlayerControl(int32_t iPlr, int32_t iControl, int32_t iExtraData)
Definition: C4Control.h:210
bool operator==(const struct ControlItem &cmp) const
Definition: C4Control.h:220
void Add(C4PacketType eType, C4ControlPacket *pCtrl)
Definition: C4Control.h:82
C4ControlEMDrawAction
Definition: C4Control.h:482
C4ControlEditGraph(const char *path, Action action, int32_t index, int32_t x, int32_t y)
Definition: C4Control.h:638
virtual bool Sync() const
Definition: C4Control.h:390
int32_t iByClient
Definition: C4Control.h:39
C4PacketType
Definition: C4PacketBase.h:76
C4ControlVoteType
Definition: C4Control.h:569
C4ControlSet(C4CtrlValueType eValType, int32_t iData)
Definition: C4Control.h:116
bool PreExecute() const
Definition: C4Control.cpp:100
LandscapeMode iMode
Definition: C4Control.h:502
bool isApprove() const
Definition: C4Control.h:591
virtual bool Sync() const
Definition: C4Control.h:597
int32_t GetY() const
Definition: C4Control.h:651
StdStrBuf Filename
Definition: C4Control.h:434
static C4ControlPlayerAction * SetHostility(const C4Player *source, const C4Player *target, bool hostile)
Definition: C4Control.cpp:597
C4PacketList Pkts
Definition: C4Control.h:71
const C4KeyEventData & GetExtraData() const
Definition: C4Control.h:234
void Append(const C4PacketList &List)
Definition: C4Packet2.cpp:329
int32_t GetX() const
Definition: C4Control.h:650
C4ControlPlayerAction(const C4Player *source=nullptr)
Definition: C4Control.cpp:562
Action GetAction() const
Definition: C4Control.h:648
Definition: C4Real.h:58
C4KeyEventData ExtraData
Definition: C4Control.h:226
C4CtrlValueType eValType
Definition: C4Control.h:120
virtual bool Lobby() const
Definition: C4Control.h:124
C4ClientPlayerInfos PlrInfo
Definition: C4Control.h:419
C4ControlEMObjectAction eAction
Definition: C4Control.h:469
virtual bool Lobby() const
Definition: C4Control.h:53
bool fUseVarsFromCallerContext
Definition: C4Control.h:142
C4ControlClientUpdate(int32_t iID, C4ControlClientUpdType eType, int32_t iData=0)
Definition: C4Control.h:380
void Execute() const
Definition: C4Control.cpp:120
C4ControlClientUpdType
Definition: C4Control.h:371
int32_t getByClient() const
Definition: C4Control.h:42
static C4ControlPlayerAction * SetTeam(const C4Player *source, int32_t team)
Definition: C4Control.cpp:607
int32_t AllCrewPosX
Definition: C4Control.h:331
C4CtrlValueType
Definition: C4Control.h:100
std::vector< ControlItem > ControlItemVec
Definition: C4Control.h:222
virtual void PreRec(C4Record *pRecord)
Definition: C4Control.h:50
ControlItem(int32_t iControl, int32_t iTriggerMode)
Definition: C4Control.h:218
void SetExtraData(const C4KeyEventData &new_extra_data)
Definition: C4Control.h:235
bool LocalControl() const
Definition: C4Control.cpp:67
void Take(C4PacketList &List)
Definition: C4Packet2.cpp:322
int32_t iData
Definition: C4Control.h:121
bool HostControl() const
Definition: C4Control.h:44
static C4ControlPlayerAction * Eliminate(const C4Player *source)
Definition: C4Control.cpp:574
virtual bool PreExecute() const
Definition: C4Control.h:48
C4ClientCore Core
Definition: C4Control.h:364
C4IDPacket * nextPkt(C4IDPacket *pPkt) const
Definition: C4PacketBase.h:278
C4ControlClientRemove(int32_t iID, const char *szReason="")
Definition: C4Control.h:399
void Clear()
Definition: C4Control.cpp:95
C4ControlEMObjectAction
Definition: C4Control.h:447
virtual void PreRec(C4Record *pRecord)
Definition: C4Control.cpp:1179
const int NO_OWNER
Definition: C4Constants.h:138
void Copy(const C4Control &Ctrl)
Definition: C4Control.h:86
int32_t ControlTick
Definition: C4Control.h:329
void Delete(C4IDPacket *pPkt)
Definition: C4Packet2.cpp:362
StdStrBuf Script
Definition: C4Control.h:144
static C4ControlPlayerAction * InitScenarioPlayer(const C4Player *source, int32_t team)
Definition: C4Control.cpp:615
C4ControlScript(const char *szScript, int32_t iTargetObj, bool fUseVarsFromCallerContext=false, bool editor_select_result=false)
Definition: C4Control.h:137
Definition: C4Id.h:28
virtual bool Sync() const
Definition: C4Control.h:404
C4ControlVoteEnd(C4ControlVoteType eType=VT_None, bool fApprove=true, int iData=0)
Definition: C4Control.h:605
static C4ControlPlayerMouse * Hover(const C4Player *player, const C4Object *target, const C4Object *old_target, const C4Object *drag=nullptr)
Definition: C4Control.cpp:456
StdCopyStrBuf strReason
Definition: C4Control.h:402
StdStrBuf BackMaterial
Definition: C4Control.h:506
virtual bool Lobby() const
Definition: C4Control.h:423
static C4ControlPlayerAction * InitPlayerControl(const C4Player *source, const C4PlayerControlAssignmentSet *ctrl_set=nullptr)
Definition: C4Control.cpp:623
DECLARE_C4CONTROL_VIRTUALS void AddControl(int32_t iControl, int32_t iTriggerMode)
Definition: C4Control.h:230
StdStrBuf Material
Definition: C4Control.h:504
StdStrBuf getDesc() const
Definition: C4Control.cpp:1687
bool editor_select_result
Definition: C4Control.h:143
C4ControlVoteType getType() const
Definition: C4Control.h:590
C4ControlClientUpdType eType
Definition: C4Control.h:387
ControlItemVec ControlItems
Definition: C4Control.h:227
LandscapeMode
Definition: C4Landscape.h:30
int32_t getData() const
Definition: C4Control.h:592
int32_t iPlayer
Definition: C4Control.h:534
virtual bool Sync() const
Definition: C4Control.h:422
virtual void CompileFunc(StdCompiler *pComp)
Definition: C4Control.cpp:77
const C4ClientPlayerInfos & GetInfo() const
Definition: C4Control.h:421
virtual bool Lobby() const
Definition: C4Control.h:367
int32_t SectShapeSum
Definition: C4Control.h:336
C4IDPacket * nextPkt(C4IDPacket *pPkt) const
Definition: C4Control.h:79
void AddHead(C4IDPacket *pPkt)
Definition: C4Packet2.cpp:304
static C4ControlPlayerAction * Surrender(const C4Player *source)
Definition: C4Control.cpp:567
void CompileFunc(StdCompiler *pComp)
Definition: C4Control.cpp:439
virtual bool Sync() const
Definition: C4Control.h:609
C4ControlEMDrawAction eAction
Definition: C4Control.h:501
void Remove(C4IDPacket *pPkt)
Definition: C4Packet2.cpp:341
void Append(const C4Control &Ctrl)
Definition: C4Control.h:85
virtual bool Lobby() const
Definition: C4Control.h:538
static C4ControlPlayerAction * ActivateGoal(const C4Player *source, const C4Object *target)
Definition: C4Control.cpp:581
C4ControlPlayerControl(int32_t iPlr, C4PlayerControl::ControlState state, const C4KeyEventData &rExtraData)
Definition: C4Control.h:208
int32_t ObjectEnumerationIndex
Definition: C4Control.h:335
void AddHead(C4PacketType eType, C4ControlPacket *pCtrl)
Definition: C4Control.h:81
DECLARE_C4CONTROL_VIRTUALS const char * GetPath() const
Definition: C4Control.h:647
int32_t MassMoverIndex
Definition: C4Control.h:333
StdStrBuf StringParam
Definition: C4Control.h:474
static C4ControlEMMoveObject * CreateObject(const C4ID &id, C4Real x, C4Real y, C4Object *container)
Definition: C4Control.cpp:1226
void SetTargetObj(int32_t iObj)
Definition: C4Control.h:146
int32_t getFrame() const
Definition: C4Control.h:339
C4ControlSynchronize(bool fSavePlrFiles=false, bool fSyncClearance=false)
Definition: C4Control.h:349
int32_t GetIndex() const
Definition: C4Control.h:649
int32_t RandomCount
Definition: C4Control.h:330
void Take(C4Control &Ctrl)
Definition: C4Control.h:84
C4ControlMsgBoardCmd(const char *command, const char *parameter, int32_t player)
Definition: C4Control.h:175
virtual bool Sync() const
Definition: C4Control.h:55
static C4ControlPlayerMouse * DragDrop(const C4Player *player, const C4Object *target, const C4Object *drag)
Definition: C4Control.cpp:469
virtual void CompileFunc(StdCompiler *pComp)
Definition: C4Control.cpp:148
C4ControlPlayerInfo(const C4ClientPlayerInfos &PlrInfo)
Definition: C4Control.h:415
C4ControlRemovePlr(int32_t iPlr, bool fDisconnected)
Definition: C4Control.h:547
int32_t iToPlayer
Definition: C4Control.h:534
C4ControlMessageType
Definition: C4Control.h:512
virtual bool Sync() const
Definition: C4Control.h:537
virtual void Execute() const =0
const ControlItemVec & GetControlItems() const
Definition: C4Control.h:232
C4ControlMessage(C4ControlMessageType eType, const char *szMessage, int32_t iPlayer=-1, int32_t iToPlayer=-1)
Definition: C4Control.h:529
C4IDPacket * firstPkt() const
Definition: C4PacketBase.h:277
virtual DECLARE_C4CONTROL_VIRTUALS bool PreExecute() const
Definition: C4Control.cpp:1162
StdStrBuf getDescWarning() const
Definition: C4Control.cpp:1716
const int32_t C4ClientIDHost
Definition: C4Client.h:25
virtual bool Sync() const
Definition: C4Control.h:340
#define DECLARE_C4CONTROL_VIRTUALS
Definition: C4Control.h:60
const C4Real Fix0
Definition: C4Real.h:312
virtual bool Lobby() const
Definition: C4Control.h:405
int32_t ObjectCount
Definition: C4Control.h:334
StdStrBuf Texture
Definition: C4Control.h:505