_________ __ __
/ _____// |_____________ _/ |______ ____ __ __ ______
\_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/
/ \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \
/_______ /|__| |__| (____ /__| (____ /\___ /|____//____ >
\/ \/ \//_____/ \/
______________________ ______________________
T H E W A R B E G I N S
Stratagus - A free fantasy real time strategy game engine
#include "stratagus.h"#include "commands.h"#include "actions.h"#include "fov.h"#include "net_message.h"#include "network.h"#include "replay.h"#include "spells.h"#include "unit.h"#include "unit_manager.h"#include "unittype.h"Functions | |
commands.cpp - Global command handler - network support. | |
| void | SendCommandStopUnit (CUnit &unit) |
| Send stop command. More... | |
| void | SendCommandStandGround (CUnit &unit, int flush) |
| Send stand ground command. More... | |
| void | SendCommandDefend (CUnit &unit, CUnit &dest, int flush) |
| Send defend command. More... | |
| void | SendCommandFollow (CUnit &unit, CUnit &dest, int flush) |
| Send follow command. More... | |
| void | SendCommandMove (CUnit &unit, const Vec2i &pos, int flush) |
| Send move command. More... | |
| void | SendCommandRepair (CUnit &unit, const Vec2i &pos, CUnit *dest, int flush) |
| Send repair command. More... | |
| void | SendCommandAutoRepair (CUnit &unit, int on) |
| Send auto repair command. More... | |
| void | SendCommandAttack (CUnit &unit, const Vec2i &pos, CUnit *attack, int flush) |
| Send attack command. More... | |
| void | SendCommandAttackGround (CUnit &unit, const Vec2i &pos, int flush) |
| Send attack ground command. More... | |
| void | SendCommandPatrol (CUnit &unit, const Vec2i &pos, int flush) |
| Send patrol command. More... | |
| void | SendCommandBoard (CUnit &unit, CUnit &dest, int flush) |
| Send board command. More... | |
| void | SendCommandUnload (CUnit &unit, const Vec2i &pos, CUnit *what, int flush) |
| Send unload command. More... | |
| void | SendCommandBuildBuilding (CUnit &unit, const Vec2i &pos, CUnitType &what, int flush) |
| Send build building command. More... | |
| void | SendCommandExplore (CUnit &unit, int flush) |
| Send explore command. More... | |
| void | SendCommandDismiss (CUnit &unit) |
| Send cancel building command. More... | |
| void | SendCommandResourceLoc (CUnit &unit, const Vec2i &pos, int flush) |
| Send harvest location command. More... | |
| void | SendCommandResource (CUnit &unit, CUnit &dest, int flush) |
| Send harvest command. More... | |
| void | SendCommandReturnGoods (CUnit &unit, CUnit *goal, int flush) |
| Send return goods command. More... | |
| void | SendCommandTrainUnit (CUnit &unit, CUnitType &what, int flush) |
| Send train command. More... | |
| void | SendCommandCancelTraining (CUnit &unit, int slot, const CUnitType *type) |
| Send cancel training command. More... | |
| void | SendCommandUpgradeTo (CUnit &unit, CUnitType &what, int flush) |
| Send upgrade to command. More... | |
| void | SendCommandCancelUpgradeTo (CUnit &unit) |
| Send cancel upgrade to command. More... | |
| void | SendCommandResearch (CUnit &unit, CUpgrade &what, int flush) |
| Send research command. More... | |
| void | SendCommandCancelResearch (CUnit &unit) |
| Send cancel research command. More... | |
| void | SendCommandSpellCast (CUnit &unit, const Vec2i &pos, CUnit *dest, int spellid, int flush) |
| Send spell cast command. More... | |
| void | SendCommandAutoSpellCast (CUnit &unit, int spellid, int on) |
| Send auto spell cast command. More... | |
| void | SendCommandDiplomacy (int player, int state, int opponent) |
| Send diplomacy command. More... | |
| void | SendCommandSharedVision (int player, bool state, int opponent) |
| Send shared vision command. More... | |
parse | |
| void | ExecCommand (unsigned char msgnr, UnitRef unum, unsigned short x, unsigned short y, UnitRef dstnr) |
| Execute a command (from network). More... | |
| static const char * | GetDiplomacyName (enum _diplomacy_ e) |
| void | ExecExtendedCommand (unsigned char type, int status, unsigned char arg1, unsigned short arg2, unsigned short arg3, unsigned short arg4) |
| Execute an extended command (from network). More... | |
| void ExecCommand | ( | unsigned char | msgnr, |
| UnitRef | unum, | ||
| unsigned short | x, | ||
| unsigned short | y, | ||
| UnitRef | dstnr | ||
| ) |
Execute a command (from network).
Execute a command (from network).
| msgnr | Network message type |
| unum | Unit number (slot) that receive the command. |
| x | optional X map position. |
| y | optional y map position. |
| dstnr | optional destination unit. |
| void ExecExtendedCommand | ( | unsigned char | type, |
| int | status, | ||
| unsigned char | arg1, | ||
| unsigned short | arg2, | ||
| unsigned short | arg3, | ||
| unsigned short | arg4 | ||
| ) |
Execute an extended command (from network).
Execute an extended command (from network).
| type | Network extended message type |
| status | Bit 7 of message type |
| arg1 | Messe argument 1 |
| arg2 | Messe argument 2 |
| arg3 | Messe argument 3 |
| arg4 | Messe argument 4 |
arg1: 0:true / 1:false
CommandLog(...);
CommandLog(...);
arg1: 0:cShadowCasting / 1:cSimpleRadial
CommandLog(...);
CommandLog(...);
Arg2: Opaque fields flags
CommandLog(...);
CommandLog(...);
arg1: enable/disable fog
arg2: request for update
CommandLog(...);
|
static |
Send attack command.
Send command: Unit attack unit or at position.
| unit | pointer to unit. |
| pos | map tile position to attack. |
| attack | or !=NoUnitP unit to be attacked. |
| flush | Flag flush all pending commands. |
Send attack ground command.
Send command: Unit attack ground.
| unit | pointer to unit. |
| pos | map tile position to fire on. |
| flush | Flag flush all pending commands. |
Send auto repair command.
Send command: Unit auto repair.
| unit | pointer to unit. |
| on | 1 for auto repair on, 0 for off. |
Send auto spell cast command.
Send command: Unit auto spell cast.
| unit | pointer to unit. |
| spellid | Spell type id. |
| on | 1 for auto cast on, 0 for off. |
Send board command.
Send command: Unit board unit.
| unit | pointer to unit. |
| dest | Destination to be boarded. |
| flush | Flag flush all pending commands. |
Send build building command.
Send command: Unit builds building at position.
| unit | pointer to unit. |
| pos | map tile position of construction. |
| what | pointer to unit-type of the building. |
| flush | Flag flush all pending commands. |
Send cancel research command.
Send command: Cancel Building/unit research.
| unit | pointer to unit. |
Send cancel training command.
Send command: Cancel training.
| unit | Pointer to unit. |
| slot | Slot of training queue to cancel. |
| type | Unit-type of unit to cancel. |
Send cancel upgrade to command.
Send command: Cancel building upgrading to.
| unit | Pointer to unit. |
Send defend command.
Send command: Defend some unit.
| unit | pointer to unit. |
| dest | defend this unit. |
| flush | Flag flush all pending commands. |
| void SendCommandDiplomacy | ( | int | player, |
| int | state, | ||
| int | opponent | ||
| ) |
Send diplomacy command.
Send command: Diplomacy changed.
| player | Player which changes his state. |
| state | New diplomacy state. |
| opponent | Opponent. |
Send cancel building command.
Send command: Cancel this building construction.
| unit | pointer to unit. |
Send explore command.
Send command: Unit explores the map.
| unit | pointer to unit. |
| flush | Flag flush all pending commands. |
Send follow command.
Send command: Follow unit to position.
| unit | pointer to unit. |
| dest | follow this unit. |
| flush | Flag flush all pending commands. |
Send move command.
Send command: Move unit to position.
| unit | pointer to unit. |
| pos | map tile position to move to. |
| flush | Flag flush all pending commands. |
Send patrol command.
Send command: Unit patrol between current and position.
| unit | pointer to unit. |
| pos | map tile position to patrol between. |
| flush | Flag flush all pending commands. |
Send repair command.
Send command: Unit repair.
| unit | Pointer to unit. |
| pos | map tile position to repair. |
| dest | Unit to be repaired. |
| flush | Flag flush all pending commands. |
Send research command.
Send command: Building/unit research.
| unit | pointer to unit. |
| what | research-type of the research. |
| flush | Flag flush all pending commands. |
Send harvest command.
Send command: Unit harvest resources
| unit | pointer to unit. |
| dest | pointer to destination (oil-platform,gold mine). |
| flush | Flag flush all pending commands. |
Send harvest location command.
Send command: Unit harvests a location (wood for now).
| unit | pointer to unit. |
| pos | map tile position where to harvest. |
| flush | Flag flush all pending commands. |
Send return goods command.
Send command: Unit return goods.
| unit | pointer to unit. |
| goal | pointer to destination of the goods. (NULL=search best) |
| flush | Flag flush all pending commands. |
| void SendCommandSharedVision | ( | int | player, |
| bool | state, | ||
| int | opponent | ||
| ) |
Send shared vision command.
Send command: Shared vision changed.
| player | Player which changes his state. |
| state | New shared vision state. |
| opponent | Opponent. |
Send spell cast command.
Send command: Unit spell cast on position/unit.
| unit | pointer to unit. |
| pos | map tile position where to cast spell. |
| dest | Cast spell on unit (if exist). |
| spellid | Spell type id. |
| flush | Flag flush all pending commands. |
Send stand ground command.
Send command: Unit stand ground.
| unit | pointer to unit. |
| flush | Flag flush all pending commands. |
Send stop command.
Send command: Unit stop.
| unit | pointer to unit. |
Send train command.
Send command: Building/unit train new unit.
| unit | pointer to unit. |
| what | pointer to unit-type of the unit to be trained. |
| flush | Flag flush all pending commands. |
Send unload command.
Send command: Unit unload unit.
| unit | pointer to unit. |
| pos | map tile position of unload. |
| what | Passagier to be unloaded. |
| flush | Flag flush all pending commands. |
1.8.17
(C) Copyright 1998-2012 by The Stratagus Project under the GNU General Public License.