当前位置: 首页>>代码示例>>C++>>正文


C++ PhasorCaller::AddArg方法代码示例

本文整理汇总了C++中PhasorCaller::AddArg方法的典型用法代码示例。如果您正苦于以下问题:C++ PhasorCaller::AddArg方法的具体用法?C++ PhasorCaller::AddArg怎么用?C++ PhasorCaller::AddArg使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PhasorCaller的用法示例。


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

示例1: OnBanCheck

	/*! \todo make function so scripts can check if hash-checking is on */
	bool OnBanCheck(const std::string& hash, const std::string& ip)
	{
		PhasorCaller caller;
		caller.AddArg(hash);
		caller.AddArg(ip);
		return HandleResult<bool>(caller.Call("OnBanCheck", result_bool), true);
	}
开发者ID:PseudoProxen,项目名称:Phasor,代码行数:8,代码来源:ScriptingEvents.cpp

示例2: OnServerCommandAttempt

	bool OnServerCommandAttempt(const halo::s_player& player, const std::string& command,
		const std::string& password)
	{
		PhasorCaller caller;
		AddPlayerArg(&player, caller);
		caller.AddArg(command);
		caller.AddArg(password);
		return HandleResult<bool>(caller.Call("OnServerCommandAttempt", result_bool), false);
	}
开发者ID:PseudoProxen,项目名称:Phasor,代码行数:9,代码来源:ScriptingEvents.cpp

示例3: OnExpiration

	// return true to reset the timer
	virtual bool OnExpiration(Timers& timers) override
	{
		if (!still_valid()) return false;

		PhasorCaller caller;
		caller.AddArg(GetID());
		caller.AddArg(++count);
		if (userdata != nullptr) caller.AddArg(userdata->NewCopy());
		return HandleResult<bool>(caller.Call(*state, callback.c_str(), result_bool), false);
	}
开发者ID:eliteprime,项目名称:Phasor,代码行数:11,代码来源:scripttimers.cpp

示例4: OnDamageApplication

	bool OnDamageApplication(const halo::s_damage_info* dmg, halo::ident receiver, 
		const halo::s_hit_info* hit, bool backtap)
	{
		PhasorCaller caller;
		AddArgIdent(receiver, caller);
		AddArgIdent(dmg->causer, caller);
		AddArgIdent(dmg->tag_id, caller);
		caller.AddArg(std::string(hit->desc));
		caller.AddArg(backtap);
		return HandleResult<bool>(caller.Call("OnDamageApplication", result_bool), true);
	}
开发者ID:PseudoProxen,项目名称:Phasor,代码行数:11,代码来源:ScriptingEvents.cpp

示例5: OnKillMultiplier

	void OnKillMultiplier(const halo::s_player& player, DWORD multiplier)
	{
		PhasorCaller caller;
		AddPlayerArg(&player, caller);
		caller.AddArg(multiplier);
		caller.Call("OnKillMultiplier");
	}
开发者ID:PseudoProxen,项目名称:Phasor,代码行数:7,代码来源:ScriptingEvents.cpp

示例6: OnServerCommand

	bool OnServerCommand(const halo::s_player* player, const std::string& command)
	{
		PhasorCaller caller;
		AddPlayerArg(player, caller);
		caller.AddArg(command);
		return HandleResult<bool>(caller.Call("OnServerCommand", result_bool), true);
	}
开发者ID:PseudoProxen,项目名称:Phasor,代码行数:7,代码来源:ScriptingEvents.cpp

示例7: OnTeamDecision

	bool OnTeamDecision(DWORD in_team, DWORD& out_team)
	{
		PhasorCaller caller;
		caller.AddArg(in_team);
		Result r = caller.Call("OnTeamDecision", result_number);
		if (r.size()) out_team = (DWORD)r.ReadNumber(0).GetValue();
		return r.size() != 0;
	}
开发者ID:PseudoProxen,项目名称:Phasor,代码行数:8,代码来源:ScriptingEvents.cpp

示例8: OnPlayerKill

	bool OnPlayerKill(const halo::s_player& victim, const halo::s_player* killer,
		DWORD mode)
	{
		PhasorCaller caller;
		AddPlayerArg(killer, caller);
		AddPlayerArg(&victim, caller);
		caller.AddArg(mode);
		return HandleResult<bool>(caller.Call("OnPlayerKill", result_bool), true);
	}
开发者ID:PseudoProxen,项目名称:Phasor,代码行数:9,代码来源:ScriptingEvents.cpp

示例9: OnTeamChange

	bool OnTeamChange(const halo::s_player& player, bool relevant, DWORD old_team,
		DWORD new_team)
	{
		PhasorCaller caller;
		// if we're not going to process return values, let scripts know
		if (!relevant) caller.ReturnValueIgnored();
		AddPlayerArg(&player, caller);
		caller.AddArg(old_team);
		caller.AddArg(new_team);
		return HandleResult<bool>(caller.Call("OnTeamChange", result_bool), true);
	}
开发者ID:PseudoProxen,项目名称:Phasor,代码行数:11,代码来源:ScriptingEvents.cpp

示例10: OnWeaponAssignment

	bool OnWeaponAssignment(halo::s_player* player, halo::ident owner, DWORD order,
		halo::ident weap_id, halo::ident& out)
	{
		PhasorCaller caller;
		AddPlayerArg(player, caller);
		AddArgIdent(owner, caller);
		caller.AddArg(order);
		AddArgIdent(weap_id, caller); 
		Result r = caller.Call("OnWeaponAssignment", result_number);
		if (!r.size()) return false; // no results
		out = halo::make_ident((unsigned long)r.ReadNumber(0).GetValue());
		return true;
	}
开发者ID:PseudoProxen,项目名称:Phasor,代码行数:13,代码来源:ScriptingEvents.cpp

示例11: OnDamageLookup

	bool OnDamageLookup(halo::s_damage_info* dmg, void* metaData,
		halo::ident receiver, halo::damage_script_options& out)
	{
		odl::setData(&out, dmg, receiver);
		PhasorCaller caller;
		AddArgIdent(receiver, caller);
		AddArgIdent(dmg->causer, caller);
		AddArgIdent(dmg->tag_id, caller);
		caller.AddArg((DWORD)metaData);
		bool b = HandleResult<bool>(caller.Call("OnDamageLookup", result_bool), true);
		odl::reset();
		return b;
	}
开发者ID:PseudoProxen,项目名称:Phasor,代码行数:13,代码来源:ScriptingEvents.cpp

示例12: OnServerChat

	bool OnServerChat(const halo::s_player* sender, const std::string& msg,
		halo::server::chat::e_chat_types& type, std::string& change_msg)
	{
		using namespace Common;
		static const scripting::results_t expected = {TYPE_BOOL, TYPE_STRING, TYPE_NUMBER};
		
		PhasorCaller caller;
		AddPlayerArg(sender, caller);
		caller.AddArg(type);
		caller.AddArg(msg);
		Result r = caller.Call("OnServerChat", expected);
		if (r.size() == 0) return true; // no scripts returned anything, use defualt
		if (r.size() > 1) change_msg = r.ReadString(1).GetValue();
		if (r.size() > 2 && type != halo::server::chat::e_chat_types::kChatServer) {
			using namespace halo::server::chat;
			int chat_type = (int)r.ReadNumber(2).GetValue();
			if (chat_type >= (int)e_chat_types::kChatAll && 
				chat_type < (int)e_chat_types::kChatPrivate)
				type = (e_chat_types)chat_type;
		}
		return r.ReadBool(0).GetValue();
	}
开发者ID:PseudoProxen,项目名称:Phasor,代码行数:22,代码来源:ScriptingEvents.cpp

示例13: OnVehicleEntry

	bool OnVehicleEntry(const halo::s_player& player, halo::ident veh_id,
		DWORD seat, bool relevant)
	{
		halo::objects::s_halo_object* obj = (halo::objects::s_halo_object*)
			halo::objects::GetObjectAddress(veh_id);
		if (!obj) return true;

		PhasorCaller caller;
		AddPlayerArg(&player, caller);
		AddArgIdent(veh_id, caller);
		caller.AddArg(seat);		
		AddArgIdent(obj->map_id, caller);
		if (!relevant) caller.ReturnValueIgnored();
		return HandleResult<bool>(caller.Call("OnVehicleEntry", result_bool), true);
	}
开发者ID:PseudoProxen,项目名称:Phasor,代码行数:15,代码来源:ScriptingEvents.cpp

示例14: OnNameRequest

	bool OnNameRequest(const std::string& hash, const std::string& name, 
		std::string& change_name)
	{
		using namespace Common;
		static const scripting::results_t expected = {TYPE_BOOL, TYPE_STRING};

		PhasorCaller caller;
		caller.AddArg(hash);
		caller.AddArg(name);

		Result r = caller.Call("OnNameRequest", expected);
		if (r.size() == 0) return true; // no scripts returned anything
		if (r.size() == 2) change_name = r.ReadString(1).GetValue();
		
		return r.ReadBool(0).GetValue();
	}
开发者ID:PseudoProxen,项目名称:Phasor,代码行数:16,代码来源:ScriptingEvents.cpp

示例15: OnObjectCreationAttempt

	e_ident_or_bool OnObjectCreationAttempt(const halo::objects::s_object_creation_disposition* info,
		halo::ident& change_id, bool& allow)
	{
		PhasorCaller caller;
		AddArgIdent(info->map_id, caller);
		AddArgIdent(info->parent, caller);
		if (info->player_ident.valid()) caller.AddArg((DWORD)info->player_ident.slot);
		else caller.AddArgNil();

		e_ident_bool_empty r =  HandleResultIdentOrBool(
			caller.Call("OnObjectCreationAttempt", result_number),
			change_id, allow);

		if (r == e_ident_bool_empty::kEmptySet){
			allow = true;
			return e_ident_or_bool::kBool;
		} else if (r == e_ident_bool_empty::kBoolSet) {
			return e_ident_or_bool::kBool;
		} else {
			return e_ident_or_bool::kIdent;
		}
	}
开发者ID:PseudoProxen,项目名称:Phasor,代码行数:22,代码来源:ScriptingEvents.cpp


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