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 "control/C4PlayerInfo.h"
24 #include "gui/C4KeyboardInput.h"
25 #include "network/C4PacketBase.h"
26 #include "network/C4Client.h"
27 #include "object/C4Id.h"
28 #include "object/C4ObjectList.h"
29 
30 // *** control base classes
31 
33 {
34 public:
36  ~C4ControlPacket() override;
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  void CompileFunc(StdCompiler *pComp) override;
58 };
59 
60 #define DECLARE_C4CONTROL_VIRTUALS \
61  void Execute() const override; \
62  void CompileFunc(StdCompiler *pComp) override;
63 
64 class C4Control : public C4PacketBase
65 {
66 public:
67  C4Control();
68  ~C4Control() override;
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  void CompileFunc(StdCompiler *pComp) override;
96 };
97 
98 // *** control packets
99 
101 {
108 };
109 
110 class C4ControlSet : public C4ControlPacket // sync, lobby
111 {
112 public:
113  C4ControlSet() = default;
115  : eValType(eValType), iData(iData)
116  { }
117 protected:
119  int32_t iData{0};
120 public:
121  // C4CVT_TeamDistribution and C4CVT_TeamColors are lobby-packets
122  bool Lobby() const override { return eValType == C4CVT_TeamDistribution || eValType == C4CVT_TeamColors; }
123 
125 };
126 
127 class C4ControlScript : public C4ControlPacket // sync
128 {
129 public:
130  enum { SCOPE_Console=-2, SCOPE_Global=-1 }; // special scopes to be passed as target objects
131 
132  C4ControlScript() = default;
133  C4ControlScript(const char *szScript, int32_t iTargetObj, bool fUseVarsFromCallerContext = false, bool editor_select_result = false)
135  { }
136 protected:
137  int32_t iTargetObj{-1};
139  bool editor_select_result; // if true and executed script from local client in editor mode, select the object returned by this script
141 public:
142  void SetTargetObj(int32_t iObj) { iTargetObj = iObj; }
144 };
145 
147 {
148 public:
150  : player(NO_OWNER)
151  {}
152  C4ControlMsgBoardReply(const char *reply, int32_t target, int32_t player)
153  : reply(reply), target(target), player(player)
154  {}
155 
156 private:
157  StdCopyStrBuf reply;
158  int32_t target{-1};
159  int32_t player;
160 
161 public:
163 };
164 
165 class C4ControlMsgBoardCmd : public C4ControlPacket // sync
166 {
167 public:
169  : player(NO_OWNER)
170  {}
171  C4ControlMsgBoardCmd(const char *command, const char *parameter, int32_t player)
172  : command(command), parameter(parameter), player(player)
173  {}
174 
175 private:
176  StdCopyStrBuf command;
177  StdCopyStrBuf parameter;
178  int32_t player;
179 
180 public:
182 };
183 
185 {
186 public:
187  C4ControlPlayerSelect() = default;
188  C4ControlPlayerSelect(int32_t iPlr, const C4ObjectList &Objs, bool fIsAlt);
189  ~C4ControlPlayerSelect() override { delete[] pObjNrs; }
190 protected:
191  int32_t iPlr{-1};
192  bool fIsAlt{false};
193  int32_t iObjCnt{0};
194  int32_t *pObjNrs{nullptr};
195 public:
197 };
198 
200 {
201 public:
202  C4ControlPlayerControl() = default;
204  : iPlr(iPlr), state(state), ExtraData(rExtraData) { }
205  C4ControlPlayerControl(int32_t iPlr, int32_t iControl, int32_t iExtraData) // old-style menu com emulation
206  : iPlr(iPlr), state(C4PlayerControl::CONS_Down), ExtraData(iExtraData,0,0,0,0) { AddControl(iControl,0); }
207 
208  struct ControlItem
209  {
210  int32_t iControl{-1};
211  int32_t iTriggerMode{0};
212  ControlItem() = default;
213  ControlItem(int32_t iControl, int32_t iTriggerMode) : iControl(iControl), iTriggerMode(iTriggerMode) {}
214  void CompileFunc(StdCompiler *pComp);
215  bool operator ==(const struct ControlItem &cmp) const { return iControl==cmp.iControl && iTriggerMode == cmp.iTriggerMode; }
216  };
217  typedef std::vector<ControlItem> ControlItemVec;
218 protected:
219  int32_t iPlr{-1};
222  ControlItemVec ControlItems;
223 public:
225  void AddControl(int32_t iControl, int32_t iTriggerMode)
226  { ControlItems.emplace_back(iControl, iTriggerMode); }
227  const ControlItemVec &GetControlItems() const { return ControlItems; }
229  const C4KeyEventData &GetExtraData() const { return ExtraData; }
230  void SetExtraData(const C4KeyEventData &new_extra_data) { ExtraData = new_extra_data; }
231 };
232 
233 class C4ControlPlayerMouse : public C4ControlPacket // sync
234 {
235 public:
236  enum Action
237  {
239 
240  CPM_Hover = 0x01,
241  CPM_Drop = 0x02
242  };
243 
245  static C4ControlPlayerMouse *Hover(const C4Player *player, const C4Object *target, const C4Object *old_target, const C4Object *drag = nullptr);
246  static C4ControlPlayerMouse *DragDrop(const C4Player *player, const C4Object *target, const C4Object *drag);
247 
248 private:
249  int32_t action{CPM_NoAction};
250  int32_t player;
251  int32_t target_obj{0};
252  int32_t drag_obj{0};
253  int32_t old_obj{0};
254 public:
256 };
257 
258 class C4ControlMenuCommand : public C4ControlPacket // sync
259 {
260 public:
261  C4ControlMenuCommand() = default;
262  C4ControlMenuCommand(int32_t actionID, int32_t player, int32_t menuID, int32_t subwindowID,
263  C4Object *target, int32_t actionType);
264 protected:
265  int32_t actionID, player, menuID{0}, subwindowID{0}, target, actionType;
266 public:
268 };
269 
271 {
272 public:
273  enum Action
274  {
276 
281 
283  CPA_SetTeam = 0x11,
284 
287  };
288 
289  C4ControlPlayerAction(const C4Player *source = nullptr);
290  static C4ControlPlayerAction *Surrender(const C4Player *source);
291  static C4ControlPlayerAction *Eliminate(const C4Player *source);
292  static C4ControlPlayerAction *ActivateGoalMenu(const C4Player *source);
293  static C4ControlPlayerAction *ActivateGoal(const C4Player *source, const C4Object *target);
294  static C4ControlPlayerAction *SetHostility(const C4Player *source, const C4Player *target, bool hostile);
295  static C4ControlPlayerAction *SetTeam(const C4Player *source, int32_t team);
296  static C4ControlPlayerAction *InitScenarioPlayer(const C4Player *source, int32_t team);
297  static C4ControlPlayerAction *InitPlayerControl(const C4Player *source, const C4PlayerControlAssignmentSet *ctrl_set = nullptr);
298 
299 private:
300  Action action{CPA_NoAction};
301  int32_t source;
302  int32_t target;
303  int32_t param_int{0};
304  StdCopyStrBuf param_str;
305 
306  enum IpcParam
307  {
308  CPA_IPC_HasKeyboard = 1<<0,
309  CPA_IPC_HasMouse = 1<<1,
310  CPA_IPC_HasGamepad = 1<<2
311  };
312 
313 public:
315 };
316 
317 class C4ControlSyncCheck : public C4ControlPacket // not sync
318 {
319 public:
321 protected:
322  int32_t Frame;
323  int32_t ControlTick;
324  int32_t RandomCount;
325  int32_t AllCrewPosX;
326  int32_t PXSCount;
327  int32_t MassMoverIndex;
328  int32_t ObjectCount;
330  int32_t SectShapeSum;
331 public:
332  void Set();
333  int32_t getFrame() const { return Frame; }
334  bool Sync() const override { return false; }
336 protected:
337  static int32_t GetAllCrewPosX();
338 };
339 
340 class C4ControlSynchronize : public C4ControlPacket // sync
341 {
342 public:
345  { }
346 protected:
348 public:
350 };
351 
352 class C4ControlClientJoin : public C4ControlPacket // not sync, lobby
353 {
354 public:
355  C4ControlClientJoin() = default;
356  C4ControlClientJoin(const C4ClientCore &Core) : Core(Core) { }
357 public:
359 public:
360  bool Sync() const override { return false; }
361  bool Lobby() const override { return true; }
363 };
364 
366 {
368 };
369 
370 class C4ControlClientUpdate : public C4ControlPacket // sync, lobby
371 {
372 public:
373  C4ControlClientUpdate() = default;
375  : iID(iID), eType(eType), iData(iData)
376  { }
377 private:
378  static const int32_t MinReadyAnnouncementDelay = 1; // seconds that need to pass between ready-state announcements to prevent spam
379 public:
380  int32_t iID{0};
382  int32_t iData{0};
383 public:
384  bool Sync() const override { return false; }
385  bool Lobby() const override { return true; }
387 };
388 
389 class C4ControlClientRemove : public C4ControlPacket // not sync, lobby
390 {
391 public:
392  C4ControlClientRemove() = default;
393  C4ControlClientRemove(int32_t iID, const char *szReason = "") : iID(iID), strReason(szReason) { }
394 public:
395  int32_t iID;
397 public:
398  bool Sync() const override { return false; }
399  bool Lobby() const override { return true; }
401 };
402 
403 // control used for initial player info, as well as for player info updates
404 class C4ControlPlayerInfo : public C4ControlPacket // not sync, lobby
405 {
406 public:
407  C4ControlPlayerInfo() = default;
409  : PlrInfo(PlrInfo)
410  { }
411 protected:
413 public:
414  const C4ClientPlayerInfos &GetInfo() const { return PlrInfo; }
415  bool Sync() const override { return false; }
416  bool Lobby() const override { return true; }
418 };
419 
420 struct C4ControlJoinPlayer : public C4ControlPacket // sync
421 {
422 public:
423  C4ControlJoinPlayer() = default;
424  C4ControlJoinPlayer(const char *szFilename, int32_t iAtClient, int32_t iIDInfo, C4Network2ResCore ResCore);
425  C4ControlJoinPlayer(const char *szFilename, int32_t iAtClient, int32_t iIDInfo);
426 protected:
428  int32_t iAtClient{-1};
429  int32_t idInfo{-1};
430  bool fByRes{false};
431  StdBuf PlrData; // for fByRes == false
432  C4Network2ResCore ResCore; // for fByRes == true
433 public:
435  bool PreExecute() const override;
436  void PreRec(C4Record *pRecord) override;
437  void Strip();
438 };
439 
441 {
442  EMMO_Move, // move objects by offset
443  EMMO_MoveForced,// move objects by offset and ignore HorizontalFixed
444  EMMO_Enter, // enter objects into iTargetObj
445  EMMO_Duplicate, // duplicate objects at same position; reset EditCursor
446  EMMO_Script, // execute Script
447  EMMO_Remove, // remove objects
448  EMMO_Exit, // exit objects
449  EMMO_Create, // create a new object (used by C4Game::DropDef)
450  EMMO_Transform // adjust rotation / con of selected object
451 };
452 
454 {
455 public:
458  int32_t iObjectNum = 0, int32_t *pObjects = nullptr, const char *szScript = nullptr, bool drag_finished = false);
459  static C4ControlEMMoveObject *CreateObject(const C4ID &id, C4Real x, C4Real y, C4Object *container);
460  ~C4ControlEMMoveObject() override;
461 protected:
462  C4ControlEMObjectAction eAction{EMMO_Move}; // action to be performed
463  C4Real tx,ty; // target position
464  int32_t iTargetObj{0}; // enumerated ptr to target object
465  int32_t iObjectNum{0}; // number of objects moved
466  int32_t *pObjects{nullptr}; // pointer on array of objects moved
467  StdStrBuf StringParam; // script to execute, or ID of object to create
468  bool drag_finished{false}; // Movement only: Set when mouse drag operation concluded (i.e. mouse up)
469 private:
470  void MoveObject(C4Object *moved_object, bool move_forced) const;
471 public:
473 };
474 
476 {
477  EMDT_SetMode, // set new landscape mode
478  EMDT_Brush, // drawing tool
479  EMDT_Fill, // drawing tool
480  EMDT_Line, // drawing tool
481  EMDT_Rect // drawing tool
482 };
483 
484 enum class LandscapeMode;
485 class C4ControlEMDrawTool : public C4ControlPacket // sync
486 {
487 public:
488  C4ControlEMDrawTool() = default;
490  int32_t iX=-1, int32_t iY=-1, int32_t iX2=-1, int32_t iY2=-1, int32_t iGrade=-1,
491  const char *szMaterial=nullptr, const char *szTexture=nullptr,
492  const char *szBackMaterial=nullptr, const char *szBackTexture=nullptr);
493 protected:
494  C4ControlEMDrawAction eAction{EMDT_SetMode}; // action to be performed
495  LandscapeMode iMode; // new mode, or mode action was performed in (action will fail if changed)
496  int32_t iX{0},iY{0},iX2{0},iY2{0},iGrade{0}; // drawing parameters
497  StdStrBuf Material; // used material
498  StdStrBuf Texture; // used texture
499  StdStrBuf BackMaterial; // used background material
500  StdStrBuf BackTexture; // used background texture
501 public:
503 };
504 
506 {
508  C4CMT_Me = 1,
512  C4CMT_Sound = 5, // "message" is played as a sound instead
513  C4CMT_Alert = 6, // no message. just flash taskbar for inactive clients.
515 };
516 
517 class C4ControlMessage : public C4ControlPacket // not sync, lobby
518 {
519 public:
520  C4ControlMessage() = default;
521  C4ControlMessage(C4ControlMessageType eType, const char *szMessage, int32_t iPlayer = -1, int32_t iToPlayer = -1)
522  : eType(eType), iPlayer(iPlayer), iToPlayer(iToPlayer), Message(szMessage, true)
523  { }
524 protected:
526  int32_t iPlayer{-1}, iToPlayer;
528 public:
529  bool Sync() const override { return false; }
530  bool Lobby() const override { return true; }
532 };
533 
534 class C4ControlRemovePlr : public C4ControlPacket // sync
535 {
536 public:
537  C4ControlRemovePlr() = default;
539  : iPlr(iPlr), fDisconnected(fDisconnected) { }
540 protected:
541  int32_t iPlr{-1};
542  bool fDisconnected{false};
543 public:
545 };
546 
547 class C4ControlDebugRec : public C4ControlPacket // sync
548 {
549 public:
550  C4ControlDebugRec() = default;
552  : Data(Data) { }
553 protected:
555 public:
557 };
558 
560 {
561  VT_None = -1,
565 };
566 
568 {
569 public:
570  C4ControlVote(C4ControlVoteType eType = VT_None, bool fApprove = true, int iData = 0)
571  : eType(eType), fApprove(fApprove), iData(iData)
572  { }
573 
574 private:
575  C4ControlVoteType eType;
576  bool fApprove;
577  int32_t iData;
578 
579 public:
580  C4ControlVoteType getType() const { return eType; }
581  bool isApprove() const { return fApprove; }
582  int32_t getData() const { return iData; }
583 
584  StdStrBuf getDesc() const;
585  StdStrBuf getDescWarning() const;
586 
587  bool Sync() const override { return false; }
588 
590 };
591 
593 {
594 public:
595  C4ControlVoteEnd(C4ControlVoteType eType = VT_None, bool fApprove = true, int iData = 0)
596  : C4ControlVote(eType, fApprove, iData)
597  { }
598 
599  bool Sync() const override { return true; }
600 
602 };
603 
605 {
606 public:
608 protected:
610 public:
612 };
613 
614 class C4ControlEditGraph : public C4ControlPacket // sync
615 {
616 public:
617  enum Action
618  {
626  };
627  C4ControlEditGraph() = default;
628  C4ControlEditGraph(const char *path, Action action, int32_t index, int32_t x, int32_t y)
629  : path(path), action(action), index(index), x(x), y(y) { }
630 private:
631  StdCopyStrBuf path;
632  Action action=CEG_None;
633  int32_t index=-1, x=0, y=0;
634 public:
636 
637  const char *GetPath() const { return path.getData(); }
638  Action GetAction() const { return action; }
639  int32_t GetIndex() const { return index; }
640  int32_t GetX() const { return x; }
641  int32_t GetY() const { return y; }
642 };
643 
644 #endif
const char * getData() const
Definition: StdBuf.h:442
StdStrBuf BackTexture
Definition: C4Control.h:500
C4ControlClientRemove()=default
C4PlayerControl::ControlState GetState() const
Definition: C4Control.h:228
C4IDPacket * firstPkt() const
Definition: C4Control.h:78
C4ControlDebugRec(StdBuf &Data)
Definition: C4Control.h:551
C4ControlEMDrawTool()=default
bool Sync() const override
Definition: C4Control.h:415
int32_t iTargetObj
Definition: C4Control.h:137
void SetByClient(int32_t iByClient)
Definition: C4Control.cpp:65
StdStrBuf Message
Definition: C4Control.h:527
C4ControlMessageType eType
Definition: C4Control.h:525
C4ControlClientJoin(const C4ClientCore &Core)
Definition: C4Control.h:356
Definition: StdBuf.h:29
C4ControlVote(C4ControlVoteType eType=VT_None, bool fApprove=true, int iData=0)
Definition: C4Control.h:570
C4Network2ResCore ResCore
Definition: C4Control.h:432
void Remove(C4IDPacket *pPkt)
Definition: C4Control.h:87
static int32_t GetAllCrewPosX()
Definition: C4Control.cpp:759
void Add(C4IDPacket *pPkt)
Definition: C4Packet2.cpp:279
static C4ControlPlayerAction * ActivateGoalMenu(const C4Player *source)
Definition: C4Control.cpp:580
void PreRec(C4Record *pRecord) const
Definition: C4Control.cpp:128
C4ControlMsgBoardReply(const char *reply, int32_t target, int32_t player)
Definition: C4Control.h:152
void Delete(C4IDPacket *pPkt)
Definition: C4Control.h:88
C4ControlPlayerControl(int32_t iPlr, int32_t iControl, int32_t iExtraData)
Definition: C4Control.h:205
bool Lobby() const override
Definition: C4Control.h:385
C4ControlPlayerSelect()=default
bool operator==(const struct ControlItem &cmp) const
Definition: C4Control.h:215
bool Sync() const override
Definition: C4Control.h:384
void Add(C4PacketType eType, C4ControlPacket *pCtrl)
Definition: C4Control.h:82
bool Sync() const override
Definition: C4Control.h:587
C4ControlJoinPlayer()=default
C4ControlPlayerControl()=default
C4ControlEMDrawAction
Definition: C4Control.h:475
C4ControlEditGraph(const char *path, Action action, int32_t index, int32_t x, int32_t y)
Definition: C4Control.h:628
int32_t iByClient
Definition: C4Control.h:39
C4PacketType
Definition: C4PacketBase.h:76
C4ControlVoteType
Definition: C4Control.h:559
C4ControlSet(C4CtrlValueType eValType, int32_t iData)
Definition: C4Control.h:114
bool Sync() const override
Definition: C4Control.h:360
bool PreExecute() const
Definition: C4Control.cpp:90
LandscapeMode iMode
Definition: C4Control.h:495
bool isApprove() const
Definition: C4Control.h:581
bool Lobby() const override
Definition: C4Control.h:399
int32_t GetY() const
Definition: C4Control.h:641
StdStrBuf Filename
Definition: C4Control.h:427
static C4ControlPlayerAction * SetHostility(const C4Player *source, const C4Player *target, bool hostile)
Definition: C4Control.cpp:587
C4PacketList Pkts
Definition: C4Control.h:71
~C4Control() override
Definition: C4Control.cpp:80
bool Lobby() const override
Definition: C4Control.h:530
const C4KeyEventData & GetExtraData() const
Definition: C4Control.h:229
void Append(const C4PacketList &List)
Definition: C4Packet2.cpp:311
int32_t GetX() const
Definition: C4Control.h:640
C4ControlPlayerAction(const C4Player *source=nullptr)
Definition: C4Control.cpp:552
C4ControlRemovePlr()=default
Action GetAction() const
Definition: C4Control.h:638
Definition: C4Real.h:58
C4KeyEventData ExtraData
Definition: C4Control.h:221
C4CtrlValueType eValType
Definition: C4Control.h:118
C4ControlScript()=default
C4ClientPlayerInfos PlrInfo
Definition: C4Control.h:412
C4ControlEMObjectAction eAction
Definition: C4Control.h:462
virtual bool Lobby() const
Definition: C4Control.h:53
bool fUseVarsFromCallerContext
Definition: C4Control.h:138
C4ControlClientUpdate(int32_t iID, C4ControlClientUpdType eType, int32_t iData=0)
Definition: C4Control.h:374
void Execute() const
Definition: C4Control.cpp:110
C4ControlClientUpdType
Definition: C4Control.h:365
int32_t getByClient() const
Definition: C4Control.h:42
static C4ControlPlayerAction * SetTeam(const C4Player *source, int32_t team)
Definition: C4Control.cpp:597
int32_t AllCrewPosX
Definition: C4Control.h:325
C4CtrlValueType
Definition: C4Control.h:100
std::vector< ControlItem > ControlItemVec
Definition: C4Control.h:217
virtual void PreRec(C4Record *pRecord)
Definition: C4Control.h:50
ControlItem(int32_t iControl, int32_t iTriggerMode)
Definition: C4Control.h:213
void SetExtraData(const C4KeyEventData &new_extra_data)
Definition: C4Control.h:230
bool LocalControl() const
Definition: C4Control.cpp:60
void Take(C4PacketList &List)
Definition: C4Packet2.cpp:304
bool Lobby() const override
Definition: C4Control.h:122
~C4ControlPlayerSelect() override
Definition: C4Control.h:189
C4ControlClientJoin()=default
int32_t iData
Definition: C4Control.h:119
void PreRec(C4Record *pRecord) override
Definition: C4Control.cpp:1167
bool Sync() const override
Definition: C4Control.h:398
bool HostControl() const
Definition: C4Control.h:44
static C4ControlPlayerAction * Eliminate(const C4Player *source)
Definition: C4Control.cpp:564
virtual bool PreExecute() const
Definition: C4Control.h:48
C4ClientCore Core
Definition: C4Control.h:358
~C4ControlPacket() override
C4IDPacket * nextPkt(C4IDPacket *pPkt) const
Definition: C4PacketBase.h:278
C4ControlClientRemove(int32_t iID, const char *szReason="")
Definition: C4Control.h:393
void Clear()
Definition: C4Control.cpp:85
C4ControlEMObjectAction
Definition: C4Control.h:440
const int NO_OWNER
Definition: C4Constants.h:137
void Copy(const C4Control &Ctrl)
Definition: C4Control.h:86
int32_t ControlTick
Definition: C4Control.h:323
void Delete(C4IDPacket *pPkt)
Definition: C4Packet2.cpp:344
StdStrBuf Script
Definition: C4Control.h:140
static C4ControlPlayerAction * InitScenarioPlayer(const C4Player *source, int32_t team)
Definition: C4Control.cpp:605
C4ControlScript(const char *szScript, int32_t iTargetObj, bool fUseVarsFromCallerContext=false, bool editor_select_result=false)
Definition: C4Control.h:133
Definition: C4Id.h:25
C4ControlVoteEnd(C4ControlVoteType eType=VT_None, bool fApprove=true, int iData=0)
Definition: C4Control.h:595
static C4ControlPlayerMouse * Hover(const C4Player *player, const C4Object *target, const C4Object *old_target, const C4Object *drag=nullptr)
Definition: C4Control.cpp:446
StdCopyStrBuf strReason
Definition: C4Control.h:396
StdStrBuf BackMaterial
Definition: C4Control.h:499
C4ControlMessage()=default
C4ControlMenuCommand()=default
static C4ControlPlayerAction * InitPlayerControl(const C4Player *source, const C4PlayerControlAssignmentSet *ctrl_set=nullptr)
Definition: C4Control.cpp:613
DECLARE_C4CONTROL_VIRTUALS void AddControl(int32_t iControl, int32_t iTriggerMode)
Definition: C4Control.h:225
C4ControlSet()=default
StdStrBuf Material
Definition: C4Control.h:497
StdStrBuf getDesc() const
Definition: C4Control.cpp:1675
bool editor_select_result
Definition: C4Control.h:139
C4ControlVoteType getType() const
Definition: C4Control.h:580
C4ControlClientUpdType eType
Definition: C4Control.h:381
ControlItemVec ControlItems
Definition: C4Control.h:222
LandscapeMode
Definition: C4Landscape.h:29
int32_t getData() const
Definition: C4Control.h:582
int32_t iPlayer
Definition: C4Control.h:526
const C4ClientPlayerInfos & GetInfo() const
Definition: C4Control.h:414
int32_t SectShapeSum
Definition: C4Control.h:330
bool Sync() const override
Definition: C4Control.h:529
C4ControlClientUpdate()=default
C4IDPacket * nextPkt(C4IDPacket *pPkt) const
Definition: C4Control.h:79
C4ControlPlayerInfo()=default
void AddHead(C4IDPacket *pPkt)
Definition: C4Packet2.cpp:286
static C4ControlPlayerAction * Surrender(const C4Player *source)
Definition: C4Control.cpp:557
void CompileFunc(StdCompiler *pComp)
Definition: C4Control.cpp:429
C4ControlDebugRec()=default
C4ControlEMDrawAction eAction
Definition: C4Control.h:494
void Remove(C4IDPacket *pPkt)
Definition: C4Packet2.cpp:323
void Append(const C4Control &Ctrl)
Definition: C4Control.h:85
static C4ControlPlayerAction * ActivateGoal(const C4Player *source, const C4Object *target)
Definition: C4Control.cpp:571
C4ControlPlayerControl(int32_t iPlr, C4PlayerControl::ControlState state, const C4KeyEventData &rExtraData)
Definition: C4Control.h:203
void CompileFunc(StdCompiler *pComp) override
Definition: C4Control.cpp:70
int32_t ObjectEnumerationIndex
Definition: C4Control.h:329
void AddHead(C4PacketType eType, C4ControlPacket *pCtrl)
Definition: C4Control.h:81
DECLARE_C4CONTROL_VIRTUALS const char * GetPath() const
Definition: C4Control.h:637
int32_t MassMoverIndex
Definition: C4Control.h:327
StdStrBuf StringParam
Definition: C4Control.h:467
static C4ControlEMMoveObject * CreateObject(const C4ID &id, C4Real x, C4Real y, C4Object *container)
Definition: C4Control.cpp:1214
C4ControlEditGraph()=default
bool Lobby() const override
Definition: C4Control.h:416
void SetTargetObj(int32_t iObj)
Definition: C4Control.h:142
int32_t getFrame() const
Definition: C4Control.h:333
~C4ControlEMMoveObject() override
Definition: C4Control.cpp:1224
C4ControlSynchronize(bool fSavePlrFiles=false, bool fSyncClearance=false)
Definition: C4Control.h:343
int32_t GetIndex() const
Definition: C4Control.h:639
int32_t RandomCount
Definition: C4Control.h:324
void Take(C4Control &Ctrl)
Definition: C4Control.h:84
C4ControlMsgBoardCmd(const char *command, const char *parameter, int32_t player)
Definition: C4Control.h:171
virtual bool Sync() const
Definition: C4Control.h:55
static C4ControlPlayerMouse * DragDrop(const C4Player *player, const C4Object *target, const C4Object *drag)
Definition: C4Control.cpp:459
C4ControlPlayerInfo(const C4ClientPlayerInfos &PlrInfo)
Definition: C4Control.h:408
C4ControlRemovePlr(int32_t iPlr, bool fDisconnected)
Definition: C4Control.h:538
int32_t iToPlayer
Definition: C4Control.h:526
C4ControlMessageType
Definition: C4Control.h:505
virtual void Execute() const =0
const ControlItemVec & GetControlItems() const
Definition: C4Control.h:227
void CompileFunc(StdCompiler *pComp) override
Definition: C4Control.cpp:138
C4ControlMessage(C4ControlMessageType eType, const char *szMessage, int32_t iPlayer=-1, int32_t iToPlayer=-1)
Definition: C4Control.h:521
bool Sync() const override
Definition: C4Control.h:599
C4IDPacket * firstPkt() const
Definition: C4PacketBase.h:277
DECLARE_C4CONTROL_VIRTUALS bool PreExecute() const override
Definition: C4Control.cpp:1150
bool Sync() const override
Definition: C4Control.h:334
StdStrBuf getDescWarning() const
Definition: C4Control.cpp:1704
bool Lobby() const override
Definition: C4Control.h:361
const int32_t C4ClientIDHost
Definition: C4Client.h:25
#define DECLARE_C4CONTROL_VIRTUALS
Definition: C4Control.h:60
const C4Real Fix0
Definition: C4Real.h:312
int32_t ObjectCount
Definition: C4Control.h:328
StdStrBuf Texture
Definition: C4Control.h:498