• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ NetworkSendCommand函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中NetworkSendCommand函数的典型用法代码示例。如果您正苦于以下问题:C++ NetworkSendCommand函数的具体用法?C++ NetworkSendCommand怎么用?C++ NetworkSendCommand使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了NetworkSendCommand函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: SendCommandStopUnit

/**
** Send command: Unit stop.
**
** @param unit pointer to unit.
*/
void SendCommandStopUnit(CUnit &unit)
{
	if (!IsNetworkGame()) {
		CommandLog("stop", &unit, FlushCommands, -1, -1, NoUnitP, NULL, -1);
		CommandStopUnit(unit);
	} else {
		NetworkSendCommand(MessageCommandStop, unit, 0, 0, NoUnitP, 0, FlushCommands);
	}
}
开发者ID:AMDmi3,项目名称:Wyrmgus,代码行数:14,代码来源:commands.cpp


示例2: SendCommandUpgradeTo

/**
** Send command: Building starts upgrading to.
**
** @param unit     pointer to unit.
** @param what     pointer to unit-type of the unit upgrade.
** @param flush    Flag flush all pending commands.
*/
void SendCommandUpgradeTo(CUnit &unit, CUnitType &what, int flush)
{
	if (!IsNetworkGame()) {
		CommandLog("upgrade-to", &unit, flush, -1, -1, NoUnitP, what.Ident.c_str(), -1);
		CommandUpgradeTo(unit, what, flush);
	} else {
		NetworkSendCommand(MessageCommandUpgrade, unit, 0, 0, NoUnitP, &what, flush);
	}
}
开发者ID:AMDmi3,项目名称:Wyrmgus,代码行数:16,代码来源:commands.cpp


示例3: SendCommandResourceLoc

/**
**  Send command: Unit harvests a location (wood for now).
**
** @param unit     pointer to unit.
** @param pos      map tile position where to harvest.
** @param flush    Flag flush all pending commands.
*/
void SendCommandResourceLoc(CUnit &unit, const Vec2i &pos, int flush)
{
	if (!IsNetworkGame()) {
		CommandLog("resource-loc", &unit, flush, pos.x, pos.y, NoUnitP, NULL, -1);
		CommandResourceLoc(unit, pos, flush);
	} else {
		NetworkSendCommand(MessageCommandResourceLoc, unit, pos.x, pos.y, NoUnitP, 0, flush);
	}
}
开发者ID:AMDmi3,项目名称:Wyrmgus,代码行数:16,代码来源:commands.cpp


示例4: SendCommandReturnGoods

/**
** Send command: Unit return goods.
**
** @param unit    pointer to unit.
** @param goal    pointer to destination of the goods. (NULL=search best)
** @param flush   Flag flush all pending commands.
*/
void SendCommandReturnGoods(CUnit &unit, CUnit *goal, int flush)
{
	if (!IsNetworkGame()) {
		CommandLog("return", &unit, flush, -1, -1, goal, NULL, -1);
		CommandReturnGoods(unit, goal, flush);
	} else {
		NetworkSendCommand(MessageCommandReturn, unit, 0, 0, goal, 0, flush);
	}
}
开发者ID:AMDmi3,项目名称:Wyrmgus,代码行数:16,代码来源:commands.cpp


示例5: SendCommandUnload

/**
** Send command: Unit unload unit.
**
** @param unit    pointer to unit.
** @param pos     map tile position of unload.
** @param what    Passagier to be unloaded.
** @param flush   Flag flush all pending commands.
*/
void SendCommandUnload(CUnit &unit, const Vec2i &pos, CUnit *what, int flush)
{
	if (!IsNetworkGame()) {
		CommandLog("unload", &unit, flush, pos.x, pos.y, what, NULL, -1);
		CommandUnload(unit, pos, what, flush);
	} else {
		NetworkSendCommand(MessageCommandUnload, unit, pos.x, pos.y, what, 0, flush);
	}
}
开发者ID:AMDmi3,项目名称:Wyrmgus,代码行数:17,代码来源:commands.cpp


示例6: SendCommandBuildBuilding

/**
** Send command: Unit builds building at position.
**
** @param unit    pointer to unit.
** @param pos     map tile position of construction.
** @param what    pointer to unit-type of the building.
** @param flush   Flag flush all pending commands.
*/
void SendCommandBuildBuilding(CUnit &unit, const Vec2i &pos, CUnitType &what, int flush)
{
	if (!IsNetworkGame()) {
		CommandLog("build", &unit, flush, pos.x, pos.y, NoUnitP, what.Ident.c_str(), -1);
		CommandBuildBuilding(unit, pos, what, flush);
	} else {
		NetworkSendCommand(MessageCommandBuild, unit, pos.x, pos.y, NoUnitP, &what, flush);
	}
}
开发者ID:AMDmi3,项目名称:Wyrmgus,代码行数:17,代码来源:commands.cpp


示例7: SendCommandPatrol

/**
** Send command: Unit patrol between current and position.
**
** @param unit     pointer to unit.
** @param pos      map tile position to patrol between.
** @param flush    Flag flush all pending commands.
*/
void SendCommandPatrol(CUnit &unit, const Vec2i &pos, int flush)
{
	if (!IsNetworkGame()) {
		CommandLog("patrol", &unit, flush, pos.x, pos.y, NoUnitP, NULL, -1);
		CommandPatrolUnit(unit, pos, flush);
	} else {
		NetworkSendCommand(MessageCommandPatrol, unit, pos.x, pos.y, NoUnitP, 0, flush);
	}
}
开发者ID:AMDmi3,项目名称:Wyrmgus,代码行数:16,代码来源:commands.cpp


示例8: SendCommandAttackGround

/**
** Send command: Unit attack ground.
**
** @param unit     pointer to unit.
** @param pos      map tile position to fire on.
** @param flush    Flag flush all pending commands.
*/
void SendCommandAttackGround(CUnit &unit, const Vec2i &pos, int flush)
{
	if (!IsNetworkGame()) {
		CommandLog("attack-ground", &unit, flush, pos.x, pos.y, NoUnitP, NULL, -1);
		CommandAttackGround(unit, pos, flush);
	} else {
		NetworkSendCommand(MessageCommandGround, unit, pos.x, pos.y, NoUnitP, 0, flush);
	}
}
开发者ID:AMDmi3,项目名称:Wyrmgus,代码行数:16,代码来源:commands.cpp


示例9: SendCommandAttack

/**
** Send command: Unit attack unit or at position.
**
** @param unit     pointer to unit.
** @param pos      map tile position to attack.
** @param attack   or !=NoUnitP unit to be attacked.
** @param flush    Flag flush all pending commands.
*/
void SendCommandAttack(CUnit &unit, const Vec2i &pos, CUnit *attack, int flush)
{
	if (!IsNetworkGame()) {
		CommandLog("attack", &unit, flush, pos.x, pos.y, attack, NULL, -1);
		CommandAttack(unit, pos, attack, flush);
	} else {
		NetworkSendCommand(MessageCommandAttack, unit, pos.x, pos.y, attack, 0, flush);
	}
}
开发者ID:AMDmi3,项目名称:Wyrmgus,代码行数:17,代码来源:commands.cpp


示例10: SendCommandTransformInto

/**
** Send command: Building starts upgrading to.
**
** @param unit     pointer to unit.
** @param what     pointer to unit-type of the unit upgrade.
** @param flush    Flag flush all pending commands.
*/
void SendCommandTransformInto(CUnit &unit, CUnitType &what, int flush)
{
	if (!IsNetworkGame()) {
		CommandLog("transform-into", &unit, flush, -1, -1, NoUnitP, what.Ident.c_str(), -1);
		CommandTransformIntoType(unit, what);
	} else {
		NetworkSendCommand(MessageCommandTransform, unit, 0, 0, NoUnitP, &what, flush);
	}
}
开发者ID:AMDmi3,项目名称:Wyrmgus,代码行数:16,代码来源:commands.cpp


示例11: SendCommandStandGround

/**
** Send command: Unit stand ground.
**
** @param unit     pointer to unit.
** @param flush    Flag flush all pending commands.
*/
void SendCommandStandGround(CUnit &unit, int flush)
{
	if (!IsNetworkGame()) {
		CommandLog("stand-ground", &unit, flush, -1, -1, NoUnitP, NULL, -1);
		CommandStandGround(unit, flush);
	} else {
		NetworkSendCommand(MessageCommandStand, unit, 0, 0, NoUnitP, 0, flush);
	}
}
开发者ID:AMDmi3,项目名称:Wyrmgus,代码行数:15,代码来源:commands.cpp


示例12: SendCommandResource

/**
** Send command: Unit harvest resources
**
** @param unit    pointer to unit.
** @param dest    pointer to destination (oil-platform,gold mine).
** @param flush   Flag flush all pending commands.
*/
void SendCommandResource(CUnit &unit, CUnit &dest, int flush)
{
	if (!IsNetworkGame()) {
		CommandLog("resource", &unit, flush, -1, -1, &dest, NULL, -1);
		CommandResource(unit, dest, flush);
	} else {
		NetworkSendCommand(MessageCommandResource, unit, 0, 0, &dest, 0, flush);
	}
}
开发者ID:KroArtem,项目名称:Wyrmgus,代码行数:16,代码来源:commands.cpp


示例13: SendCommandBoard

/**
** Send command: Unit board unit.
**
** @param unit     pointer to unit.
** @param dest     Destination to be boarded.
** @param flush    Flag flush all pending commands.
*/
void SendCommandBoard(CUnit &unit, CUnit &dest, int flush)
{
	if (!IsNetworkGame()) {
		CommandLog("board", &unit, flush, -1, -1, &dest, NULL, -1);
		CommandBoard(unit, dest, flush);
	} else {
		NetworkSendCommand(MessageCommandBoard, unit, -1, -1, &dest, 0, flush);
	}
}
开发者ID:KroArtem,项目名称:Wyrmgus,代码行数:16,代码来源:commands.cpp


示例14: SendCommandPickUp

/**
** Send command: Pick up item.
**
** @param unit    pointer to unit.
** @param dest    pick up this item.
** @param flush   Flag flush all pending commands.
*/
void SendCommandPickUp(CUnit &unit, CUnit &dest, int flush)
{
	if (!IsNetworkGame()) {
		CommandLog("pick-up", &unit, flush, -1, -1, &dest, NULL, -1);
		CommandPickUp(unit, dest, flush);
	} else {
		NetworkSendCommand(MessageCommandPickUp, unit, 0, 0, &dest, 0, flush);
	}
}
开发者ID:KroArtem,项目名称:Wyrmgus,代码行数:16,代码来源:commands.cpp


示例15: SendCommandAutoRepair

/**
** Send command: Unit auto repair.
**
** @param unit      pointer to unit.
** @param on        1 for auto repair on, 0 for off.
*/
void SendCommandAutoRepair(CUnit &unit, int on)
{
	if (!IsNetworkGame()) {
		CommandLog("auto-repair", &unit, FlushCommands, on, -1, NoUnitP, NULL, 0);
		CommandAutoRepair(unit, on);
	} else {
		NetworkSendCommand(MessageCommandAutoRepair, unit, on, -1, NoUnitP, NULL, FlushCommands);
	}
}
开发者ID:KroArtem,项目名称:Wyrmgus,代码行数:15,代码来源:commands.cpp


示例16: SendCommandQuest

/**
** Send command: Accept new quest for the unit's player.
**
** @param unit    pointer to unit.
** @param pos     map tile position to move to.
*/
void SendCommandQuest(CUnit &unit, CQuest *quest)
{
	if (!IsNetworkGame()) {
		CommandLog("quest", &unit, 0, 0, 0, NoUnitP, quest->Ident.c_str(), -1);
		CommandQuest(unit, quest);
	} else {
		NetworkSendCommand(MessageCommandQuest, unit, quest->ID, 0, NoUnitP, NULL, 0);
	}
}
开发者ID:KroArtem,项目名称:Wyrmgus,代码行数:15,代码来源:commands.cpp


示例17: SendCommandBuy

/**
** Send command: Buy an item from a building.
**
** @param unit    pointer to unit.
** @param pos     map tile position to move to.
*/
void SendCommandBuy(CUnit &unit, CUnit *sold_unit, int player)
{
	if (!IsNetworkGame()) {
		CommandLog("buy", &unit, 0, -1, -1, sold_unit, NULL, player);
		CommandBuy(unit, sold_unit, player);
	} else {
		NetworkSendCommand(MessageCommandBuy, unit, player, 0, sold_unit, 0, 0);
	}
}
开发者ID:KroArtem,项目名称:Wyrmgus,代码行数:15,代码来源:commands.cpp


示例18: SendCommandRallyPoint

/**
** Send command: Set new rally point for unit.
**
** @param unit    pointer to unit.
** @param pos     map tile position to move to.
*/
void SendCommandRallyPoint(CUnit &unit, const Vec2i &pos, int z)
{
	if (!IsNetworkGame()) {
		CommandLog("rally-point", &unit, 0, pos.x, pos.y, NoUnitP, NULL, -1);
		CommandRallyPoint(unit, pos, z);
	} else {
		NetworkSendCommand(MessageCommandMove, unit, pos.x, pos.y, NoUnitP, 0, 0);
	}
}
开发者ID:KroArtem,项目名称:Wyrmgus,代码行数:15,代码来源:commands.cpp


示例19: SendCommandFollow

/**
** Send command: Follow unit to position.
**
** @param unit    pointer to unit.
** @param dest    follow this unit.
** @param flush   Flag flush all pending commands.
*/
void SendCommandFollow(CUnit &unit, CUnit &dest, int flush)
{
	if (!IsNetworkGame()) {
		CommandLog("follow", &unit, flush, -1, -1, &dest, NULL, -1);
		CommandFollow(unit, dest, flush);
	} else {
		NetworkSendCommand(MessageCommandFollow, unit, 0, 0, &dest, 0, flush);
	}
}
开发者ID:KroArtem,项目名称:Wyrmgus,代码行数:16,代码来源:commands.cpp


示例20: SendCommandRepair

/**
** Send command: Unit repair.
**
** @param unit    Pointer to unit.
** @param pos     map tile position to repair.
** @param dest    Unit to be repaired.
** @param flush   Flag flush all pending commands.
*/
void SendCommandRepair(CUnit &unit, const Vec2i &pos, CUnit *dest, int flush)
{
	if (!IsNetworkGame()) {
		CommandLog("repair", &unit, flush, pos.x, pos.y, dest, NULL, -1);
		CommandRepair(unit, pos, dest, flush);
	} else {
		NetworkSendCommand(MessageCommandRepair, unit, pos.x, pos.y, dest, 0, flush);
	}
}
开发者ID:AMDmi3,项目名称:Wyrmgus,代码行数:17,代码来源:commands.cpp



注:本文中的NetworkSendCommand函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ New函数代码示例发布时间:2022-05-30
下一篇:
C++ Netlib_CloseHandle函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap