//-----------------------------------------------------------------------------
// Exports MRecipientFilter
//-----------------------------------------------------------------------------
void export_mrecipientfilter(scope _recipients)
{
	class_<IRecipientFilter, IRecipientFilter*, boost::noncopyable>("_IRecipientFilter", no_init)
		.def("is_reliable",
			&IRecipientFilter::IsReliable,
			"Whether this recipient filter will be network reliable (sent in-order)"
		)

		.def("is_init_message",
			&IRecipientFilter::IsInitMessage,
			"Whether the message has been initialised?"
		)

		.def("__len__",
			&IRecipientFilter::GetRecipientCount,
			"Return the recipient count."
		)

		.def("get_recipient_index",
			&IRecipientFilter::GetRecipientIndex,
			"Obtains the player index at the slot in the filter",
			args("slot")
		)

		ADD_MEM_TOOLS(IRecipientFilter)
	;

	class_<MRecipientFilter, boost::shared_ptr<MRecipientFilter>, bases<IRecipientFilter>, boost::noncopyable >("_RecipientFilter")
		.def("add_all_players",
			&MRecipientFilter::AddAllPlayers,
			"Adds all the players on the server to the filter"
		)

		.def("add_recipient",
			&MRecipientFilter::AddRecipient,
			"Adds the index of the player to the filter",
			args("index")
		)

		.def("remove_all_players",
			&MRecipientFilter::RemoveAllPlayers,
			"Removes all the players on the server from the filter"
		)

		.def("remove_recipient",
			&MRecipientFilter::RemoveRecipient,
			"Removes the index of the player from the filter",
			args("index")
		)

		.def("__contains__",
			&MRecipientFilter::HasRecipient,
			"Return True if the given index is in the recipient filter.",
			args("index")
		)
			

		ADD_MEM_TOOLS(MRecipientFilter)
	;
}
//-----------------------------------------------------------------------------
// Expose MRecipientFilter
//-----------------------------------------------------------------------------
void export_mrecipientfilter()
{
	class_<IRecipientFilter, boost::noncopyable>("_RecipientFilter", no_init)
		.def("is_reliable",
			&IRecipientFilter::IsReliable,
			"Whether this recipient filter will be network reliable (sent in-order)"
		)

		.def("is_init_message",
			&IRecipientFilter::IsInitMessage,
			"Whether the message has been initialised?"
		)

		.def("get_recipient_count",
			&IRecipientFilter::GetRecipientCount,
			"Obtain the amount of clients in this filter"
		)

		.def("get_recipient_index",
			&IRecipientFilter::GetRecipientIndex,
			"Obtains the player index at the slot in the filter",
			args("slot")
		)

		ADD_MEM_TOOLS(IRecipientFilter, "_RecipientFilter")
	;

	// TODO: Rename class
	class_<MRecipientFilter, bases<IRecipientFilter>, boost::noncopyable >("CMRecipientFilter")
		.def("add_all_players",
			&MRecipientFilter::AddAllPlayers,
			"Adds all the players on the server to the filter"
		)

		.def("add_recipient",
			&MRecipientFilter::AddRecipient,
			"Adds the index of the player to the filter",
			args("iPlayer")
		)

		.def("remove_all_players",
			&MRecipientFilter::RemoveAllPlayers,
			"Removes all the players on the server from the filter"
		)

		.def("remove_recipient",
			&MRecipientFilter::RemoveRecipient,
			"Removes the index of the player from the filter",
			args("iPlayer")
		)

		.def("has_recipient",
			&MRecipientFilter::HasRecipient,
			"Returns true if the given index is in the recipient, false otherwise.",
			args("iPlayer")
		)

		ADD_MEM_TOOLS(MRecipientFilter, "CMRecipientFilter")
	;
}
//-----------------------------------------------------------------------------
// Exports CEffectData.
//-----------------------------------------------------------------------------
void export_dispatch_effect_data(scope _effects)
{
	class_<CEffectData> DispatchEffectData("DispatchEffectData");
	
	// Properties...
	DispatchEffectData.def_readwrite("origin", &CEffectData::m_vOrigin);
	DispatchEffectData.def_readwrite("start", &CEffectData::m_vStart);
	DispatchEffectData.def_readwrite("normal", &CEffectData::m_vNormal);
	DispatchEffectData.def_readwrite("angles", &CEffectData::m_vAngles);
	DispatchEffectData.def_readwrite("flags", &CEffectData::m_fFlags);
	DispatchEffectData.def_readwrite("entity_index", &CEffectData::m_nEntIndex);
	DispatchEffectData.def_readwrite("scale", &CEffectData::m_flScale);
	DispatchEffectData.def_readwrite("magnitude", &CEffectData::m_flMagnitude);
	DispatchEffectData.def_readwrite("radius", &CEffectData::m_flRadius);
	DispatchEffectData.def_readwrite("attachement_index", &CEffectData::m_nAttachmentIndex);
	DispatchEffectData.def_readwrite("surface_prop", &CEffectData::m_nSurfaceProp);
	DispatchEffectData.def_readwrite("material", &CEffectData::m_nMaterial);
	DispatchEffectData.def_readwrite("damage_type", &CEffectData::m_nDamageType);
	DispatchEffectData.def_readwrite("hitbox", &CEffectData::m_nHitBox);
	DispatchEffectData.def_readwrite("color", &CEffectData::m_nColor);
	
	// CS:GO properties...
	DispatchEffectData.NOT_IMPLEMENTED_ATTR("other_entity_index");
	
	// Methods...
	DispatchEffectData.def("get_effect_name_index", &CEffectData::GetEffectNameIndex);
	
	// Engine specific stuff...
	export_engine_specific_dispatch_effect_data(_effects, DispatchEffectData);
	
	// Add memory tools...
	DispatchEffectData ADD_MEM_TOOLS(CEffectData);
}
//-----------------------------------------------------------------------------
// Exports IPredictionSystem.
//-----------------------------------------------------------------------------
void export_prediction_system(scope _effects)
{
	class_<IPredictionSystem>("PredictionSystem")
		.def("get_next",
			&IPredictionSystem::GetNext,
			"Returns the next prediction system.",
			reference_existing_object_policy()
		)

		.def("set_suppress_event",
			&IPredictionSystem::SetSuppressEvent,
			"Set the SuppressEvent state.",
			args("state")
		)
		
		.def("can_predict",
			&IPredictionSystem::CanPredict
		)

		.def_readwrite("prediction_systems",
			&IPredictionSystem::g_pPredictionSystems
		)

		.def("suppress_events",
			&IPredictionSystem::SuppressEvents
		)
		.staticmethod("suppress_events")

		ADD_MEM_TOOLS(IPredictionSystem)
	;
}
Beispiel #5
0
//-----------------------------------------------------------------------------
// Exports mstudiobone_t.
//-----------------------------------------------------------------------------
void export_bone(scope _studio)
{
    class_<mstudiobone_t, mstudiobone_t *, boost::noncopyable> ModelBone("ModelBone");

    // Properties...
    ModelBone.add_property("name", &ModelBoneExt::get_name);
    ModelBone.def_readwrite("parent", &mstudiobone_t::parent);

    ModelBone.add_property("position", make_getter(&mstudiobone_t::pos, reference_existing_object_policy()));
    ModelBone.add_property("quaternion", make_getter(&mstudiobone_t::quat, reference_existing_object_policy()));
    ModelBone.add_property("radiant_euler", make_getter(&mstudiobone_t::rot, reference_existing_object_policy()));
    ModelBone.add_property("position_scale", make_getter(&mstudiobone_t::posscale, reference_existing_object_policy()));
    ModelBone.add_property("radiant_euler_scale", make_getter(&mstudiobone_t::rotscale, reference_existing_object_policy()));

    ModelBone.add_property("position_to_bone", make_getter(&mstudiobone_t::poseToBone, reference_existing_object_policy())); // TODO: Export matrix3x4_t...

    ModelBone.add_property("alignment", make_getter(&mstudiobone_t::qAlignment, reference_existing_object_policy()));
    ModelBone.add_property("surface_name", &ModelBoneExt::get_surface_name);

    ModelBone.def_readwrite("flags", &mstudiobone_t::flags);
    ModelBone.def_readwrite("procedural_type", &mstudiobone_t::proctype);
    ModelBone.def_readwrite("physics_bone", &mstudiobone_t::physicsbone);
    ModelBone.def_readwrite("flags", &mstudiobone_t::flags);
    ModelBone.def_readwrite("contents", &mstudiobone_t::contents);

    // Methods...
    ModelBone.def("get_procedure", &ModelBoneExt::get_procedure, manage_new_object_policy());

    // Add memory tools...
    ModelBone ADD_MEM_TOOLS(mstudiobone_t);
}
Beispiel #6
0
//-----------------------------------------------------------------------------
// Exports CServerUnknown.
//-----------------------------------------------------------------------------
void export_server_unknown(scope _entities)
{
	class_< IServerUnknown, bases<IHandleEntity>, boost::noncopyable >("ServerUnknown", no_init)
		.def("get_collideable",
			&IServerUnknown::GetCollideable,
			"Returns the Collideable object for this entity.",
			reference_existing_object_policy()
		)

		.def("get_networkable",
			&IServerUnknown::GetNetworkable,
			"Returns the ServerNetworkable object for this entity.",
			reference_existing_object_policy()
		)

		.def("get_base_entity",
			&IServerUnknown::GetBaseEntity,
			"Returns the CBasEntity pointer for this entity.",
			return_by_value_policy()
		)

		.add_property("classname",
			&IServerUnknownExt::GetClassname,
			"Return the entity's classname."
		)

		.def("is_networked",
			&IServerUnknownExt::IsNetworked,
			"Return True if the entity is networked."
		)

		ADD_MEM_TOOLS(IServerUnknown)
	;
}
//-----------------------------------------------------------------------------
// Expose CCommand.
//-----------------------------------------------------------------------------
void export_command(scope _commands)
{
	class_<CCommand>("Command")
		.def("__len__",
			&CCommand::ArgC,
			"Return the number of arguments in the command."
		)

		.add_property("arg_string",
			&CCommandExt::ArgS,
			"Return the argument string for the command (does not include the command itself)."
		)

		.add_property("command_string",
			&CCommandExt::GetCommandString,
			"Return the entire command string including the command itself."
		)

		.def("__getitem__",
			&CCommandExt::GetArg,
			"Return the argument at the given index.",
			args("index")
		)

		.def("tokenize",
			&CCommandExt::Tokenize
		)

		.add_static_property("max_command_length",
			&CCommand::MaxCommandLength
		)

		ADD_MEM_TOOLS(CCommand)
	;
}
//-----------------------------------------------------------------------------
// Expose DVariant.
//-----------------------------------------------------------------------------
void export_send_prop_variant(scope _props)
{
	class_<DVariant, DVariant *> SendPropVariant("SendPropVariant");

	// Properties...
	SendPropVariant.def_readonly("type", &DVariant::m_Type);

	// Methods...
	SendPropVariant.def("to_string", &DVariant::ToString);

	// Getter methods...
	SendPropVariant.def("get_float", &SendPropVariantExt::get_typed_value<DPT_Float, float, &DVariant::m_Float>);
	SendPropVariant.def("get_int", &SendPropVariantExt::get_int);
	SendPropVariant.def("get_string", &SendPropVariantExt::get_string);
	SendPropVariant.def("get_data", &SendPropVariantExt::get_data, manage_new_object_policy());
	SendPropVariant.def("get_vector", &SendPropVariantExt::get_vector, manage_new_object_policy());

	// Setter methods...
	SendPropVariant.def("set_float", &SendPropVariantExt::get_typed_value<DPT_Float, float, &DVariant::m_Float>);
	SendPropVariant.def("set_string", &SendPropVariantExt::set_string);
	SendPropVariant.def("set_int", &SendPropVariantExt::set_int);
	SendPropVariant.def("set_data", &SendPropVariantExt::set_data);
	SendPropVariant.def("set_vector", &SendPropVariantExt::set_vector);

	// CS:GO specific methods...
	SendPropVariant.NOT_IMPLEMENTED("get_int64");
	SendPropVariant.NOT_IMPLEMENTED("set_int64");

	// Engine specific stuff...
	export_engine_specific_send_prop_variant(_props, SendPropVariant);

	// Add memory tools...
	SendPropVariant ADD_MEM_TOOLS(DVariant);
}
//-----------------------------------------------------------------------------
// Expose IEntityFactoryDictionary.
//-----------------------------------------------------------------------------
void export_entity_factory_dictionary_interface(scope _factories)
{
	class_<IEntityFactoryDictionary, IEntityFactoryDictionary *,
		boost::noncopyable> _EntityFactoryDictionary("_EntityFactoryDictionary", no_init);

	// Methods...
	_EntityFactoryDictionary.def("install_factory", &IEntityFactoryDictionary::InstallFactory);

	_EntityFactoryDictionary.def("create",
		&IEntityFactoryDictionary::Create,
		reference_existing_object_policy()
	);

	_EntityFactoryDictionary.def("destroy", &IEntityFactoryDictionary::Destroy);

	_EntityFactoryDictionary.def("find_factory",
		&IEntityFactoryDictionary::FindFactory,
		reference_existing_object_policy()
	);

	_EntityFactoryDictionary.def("get_cannonical_name", &IEntityFactoryDictionary::GetCannonicalName);

	// Add memory tools...
	_EntityFactoryDictionary ADD_MEM_TOOLS(IEntityFactoryDictionary);
}
//-----------------------------------------------------------------------------
// Expose SendTable.
//-----------------------------------------------------------------------------
void export_send_table(scope _props)
{
	class_<SendTable, SendTable *> SendTable_("SendTable", no_init);
	
	// Properties...
	SendTable_.def_readonly("props", &SendTable::m_pProps);
	SendTable_.def_readonly("length", &SendTable::m_nProps);
	SendTable_.add_property("name", &SendTable::GetName);
	
	// Methods...
	SendTable_.def("get_name", &SendTable::GetName);
	SendTable_.def("get_length", &SendTable::GetNumProps);
	SendTable_.def("is_initialized", &SendTable::IsInitialized);
	SendTable_.def("set_initialized", &SendTable::SetInitialized);
	
	SendTable_.def("get_prop", &SendTable::GetProp,
		reference_existing_object_policy()
	);
	
	SendTable_.def("set_write_flag", &SendTable::SetWriteFlag);
	SendTable_.def("get_write_flag", &SendTable::GetWriteFlag);
	SendTable_.def("has_props_encoded_against_tick_count", &SendTable::HasPropsEncodedAgainstTickCount);
	SendTable_.def("set_has_props_encoded_against_tick_count", &SendTable::SetHasPropsEncodedAgainstTickcount);
	
	// Special methods...
	SendTable_.def("__getitem__",
		&SendTableSharedExt::__getitem__,
		reference_existing_object_policy()
	);
	
	SendTable_.def("__len__", &SendTable::GetNumProps);
	
	// Add memory tools...
	SendTable_ ADD_MEM_TOOLS(SendTable);
}
Beispiel #11
0
//-----------------------------------------------------------------------------
// Exports mstudioanimdesc_t.
//-----------------------------------------------------------------------------
void export_animation(scope _studio)
{
    class_<mstudioanimdesc_t, mstudioanimdesc_t *, boost::noncopyable> Animation("Animation");

    // Properties...
    Animation.add_property("model_header", make_function(&mstudioanimdesc_t::pStudiohdr, reference_existing_object_policy()));
    Animation.add_property("name", &AnimationExt::get_name);

    Animation.def_readwrite("flags", &mstudioanimdesc_t::flags);
    Animation.def_readwrite("frames_count", &mstudioanimdesc_t::numframes);
    Animation.def_readwrite("movements_count", &mstudioanimdesc_t::nummovements);
    Animation.def_readwrite("movements_offset", &mstudioanimdesc_t::movementindex);
    Animation.def_readwrite("anim_block", &mstudioanimdesc_t::animblock);
    Animation.def_readwrite("anim_offset", &mstudioanimdesc_t::animindex);
    Animation.def_readwrite("local_hierarchy_count", &mstudioanimdesc_t::numlocalhierarchy);
    Animation.def_readwrite("local_hierarchy_offset", &mstudioanimdesc_t::localhierarchyindex);
    Animation.def_readwrite("section_offset", &mstudioanimdesc_t::sectionindex);
    Animation.def_readwrite("section_frames", &mstudioanimdesc_t::sectionframes);
    Animation.def_readwrite("zero_frame_span", &mstudioanimdesc_t::zeroframespan);
    Animation.def_readwrite("zero_frame_count", &mstudioanimdesc_t::zeroframecount);
    Animation.def_readwrite("zero_frame_index", &mstudioanimdesc_t::zeroframeindex);
    Animation.def_readwrite("zero_frame_stall_time", &mstudioanimdesc_t::zeroframestalltime);

    // Methods...
    Animation.def("get_movement", &AnimationExt::get_movement, reference_existing_object_policy());
    // Animation.def("get_hierarchy", &mstudioanimdesc_t::pHierarchy, reference_existing_object_policy());

    // Add memory tools...
    Animation ADD_MEM_TOOLS(mstudioanimdesc_t);
}
//-----------------------------------------------------------------------------
// Exports ITempEntsSystem.
//-----------------------------------------------------------------------------
void export_temp_entities_system(scope _effects)
{
	class_<ITempEntsSystem, bases<IPredictionSystem>, boost::noncopyable> TempEntities("_TempEntities", no_init);

	// Methods...
	TempEntities.def("armor_ricochet", &ITempEntsSystem::ArmorRicochet);
	TempEntities.def("beam_ent_point", &ITempEntsSystem::BeamEntPoint);
	TempEntities.def("beam_ents", &ITempEntsSystem::BeamEnts);
	TempEntities.def("beam_follow", &ITempEntsSystem::BeamFollow);
	TempEntities.def("beam_points", &ITempEntsSystem::BeamPoints);
	TempEntities.def("beam_laser", &ITempEntsSystem::BeamLaser);
	TempEntities.def("beam_ring", &ITempEntsSystem::BeamRing);
	TempEntities.def("beam_ring_point", &ITempEntsSystem::BeamRingPoint);
	TempEntities.def("beam_spline", &ITempEntsSystem::BeamSpline);
	TempEntities.def("blood_stream", &ITempEntsSystem::BloodStream);
	TempEntities.def("blood_sprite", &ITempEntsSystem::BloodSprite);
	TempEntities.def("break_model", &ITempEntsSystem::BreakModel);
	TempEntities.def("bsp_decal", &ITempEntsSystem::BSPDecal);
	TempEntities.def("project_decal", &ITempEntsSystem::ProjectDecal);
	TempEntities.def("bubbles", &ITempEntsSystem::Bubbles);
	TempEntities.def("bubble_trail", &ITempEntsSystem::BubbleTrail);
	TempEntities.def("decal", &ITempEntsSystem::Decal);
	TempEntities.def("dynamic_light", &ITempEntsSystem::DynamicLight);
	TempEntities.def("explosion", &ITempEntsSystem::Explosion);
	TempEntities.def("shatter_surface", &ITempEntsSystem::ShatterSurface);
	TempEntities.def("glow_sprite", &ITempEntsSystem::GlowSprite);
	TempEntities.def("footprint_decal", &ITempEntsSystem::FootprintDecal);
	TempEntities.def("kill_player_attachments", &ITempEntsSystem::KillPlayerAttachments);
	TempEntities.def("large_funnel", &ITempEntsSystem::LargeFunnel);
	TempEntities.def("metal_sparks", &ITempEntsSystem::MetalSparks);
	TempEntities.def("energy_splash", &ITempEntsSystem::EnergySplash);
	TempEntities.def("player_decal", &ITempEntsSystem::PlayerDecal);
	TempEntities.def("show_line", &ITempEntsSystem::ShowLine);
	TempEntities.def("smoke", &ITempEntsSystem::Smoke);
	TempEntities.def("sparks", &ITempEntsSystem::Sparks);
	TempEntities.def("sprite", &ITempEntsSystem::Sprite);
	TempEntities.def("sprite_spray", &ITempEntsSystem::SpriteSpray);
	TempEntities.def("world_decal", &ITempEntsSystem::WorldDecal);
	TempEntities.def("muzzle_flash", &ITempEntsSystem::MuzzleFlash);
	TempEntities.def("dust", &ITempEntsSystem::Dust);
	TempEntities.def("gauss_explosion", &ITempEntsSystem::GaussExplosion);
	TempEntities.def("physics_prop", &ITempEntsSystem::PhysicsProp);
	TempEntities.def("trigger_temp_entity", &ITempEntsSystem::TriggerTempEntity);

	TempEntities.def("fizz", &ITempEntsSystem::Fizz);
	TempEntities.def("client_projectile", &ITempEntsSystem::ClientProjectile);

	// OrangeBox methods...
	TempEntities.NOT_IMPLEMENTED("dispatch_effect");

	// Engine specific stuff...
	export_engine_specific_temp_entities_system(_effects, TempEntities);

	// Add memory tools...
	TempEntities ADD_MEM_TOOLS(ITempEntsSystem);
}
Beispiel #13
0
//-----------------------------------------------------------------------------
// Exports CServerNetworkable.
//-----------------------------------------------------------------------------
void export_server_networkable(scope _entities)
{
	class_< IServerNetworkable, IServerNetworkable *, boost::noncopyable >("ServerNetworkable", no_init)
		.def("get_entity_handle",
			&IServerNetworkable::GetEntityHandle,
			"Returns the HandleEntity instance of this entity.",
			reference_existing_object_policy()
		)

		.def("get_server_class",
			&IServerNetworkable::GetServerClass,
			"Returns the ServerClass instance of this entity.",
			reference_existing_object_policy()
		)

		.def("get_edict",
			&IServerNetworkable::GetEdict,
			"Returns the edict_t instance of this entity.",
			reference_existing_object_policy()
		)

		.def("get_class_name",
			&IServerNetworkable::GetClassName,
			"Returns the class name of this entity."
		)

		.def("release",
			&IServerNetworkable::Release
		)

		.def("area_num",
			&IServerNetworkable::AreaNum
		)

		/*
		.def("get_base_networkable",
			&IServerNetworkable::GetBaseNetworkable,
			reference_existing_object_policy()
		)
		*/

		.def("get_base_entity",
			&IServerNetworkable::GetBaseEntity,
			return_by_value_policy()
		)

		.def("get_pvs_info",
			&IServerNetworkable::GetPVSInfo,
			"Returns the current visible data.",
			reference_existing_object_policy()
		)

		ADD_MEM_TOOLS(IServerNetworkable)
	;
}
Beispiel #14
0
//-----------------------------------------------------------------------------
// Exports mstudioanimsections_t.
//-----------------------------------------------------------------------------
void export_anim_sections(scope _studio)
{
    class_<mstudioanimsections_t, mstudioanimsections_t *, boost::noncopyable> AnimSections("AnimSections");

    // Properties...
    AnimSections.def_readwrite("block", &mstudioanimsections_t::animblock);
    AnimSections.def_readwrite("index", &mstudioanimsections_t::animindex);

    // Add memory tools...
    AnimSections ADD_MEM_TOOLS(mstudioanimsections_t);
}
//-----------------------------------------------------------------------------
// Exports CHandleEntity.
//-----------------------------------------------------------------------------
void export_handle_entity(scope _entities)
{
	class_<IHandleEntity, boost::noncopyable>("HandleEntity", no_init)
		.add_property("basehandle",
			make_function(&IHandleEntity::GetRefEHandle, reference_existing_object_policy()),
			&IHandleEntity::SetRefEHandle
		)

		ADD_MEM_TOOLS(IHandleEntity)
	;
}
//-----------------------------------------------------------------------------
// Expose CEntityFactoryDictionary.
//-----------------------------------------------------------------------------
void export_entity_factory_dictionary(scope _factories)
{
	class_<CEntityFactoryDictionary, CEntityFactoryDictionary *, bases<IEntityFactoryDictionary>,
		boost::noncopyable> EntityFactoryDictionary("EntityFactoryDictionary", no_init);

	// Special methods...
	EntityFactoryDictionary.def("__getitem__",&EntityFactoryDictionarySharedExt::__getitem__);

	// Engine specific stuff...
	export_engine_specific_entity_factory_dictionary(_factories, EntityFactoryDictionary);

	// Add memory tools...
	EntityFactoryDictionary ADD_MEM_TOOLS(CEntityFactoryDictionary);
}
Beispiel #17
0
//-----------------------------------------------------------------------------
// Exports mstudiohitboxset_t.
//-----------------------------------------------------------------------------
void export_hitbox_set(scope _studio)
{
    class_<mstudiohitboxset_t, mstudiohitboxset_t *> HitboxSet("HitboxSet");

    // Properties...
    HitboxSet.add_property("name", &HitboxSetExt::get_name);
    HitboxSet.def_readwrite("hitboxes_count", &mstudiohitboxset_t::numhitboxes);

    // Methods...
    HitboxSet.def("get_hitbox", &mstudiohitboxset_t::pHitbox, reference_existing_object_policy());

    // Add memory tools...
    HitboxSet ADD_MEM_TOOLS(mstudiohitboxset_t);
}
Beispiel #18
0
//-----------------------------------------------------------------------------
// Exports mstudioattachment_t.
//-----------------------------------------------------------------------------
void export_attachment(scope _studio)
{
    class_<mstudioattachment_t, mstudioattachment_t *, boost::noncopyable> ModelAttachment("ModelAttachment");

    // Properties...
    ModelAttachment.def_readwrite("name_offset", &mstudioattachment_t::sznameindex);
    ModelAttachment.add_property("name", &ModelAttachmentExt::get_name);
    ModelAttachment.def_readwrite("flags", &mstudioattachment_t::flags);
    ModelAttachment.def_readwrite("local_bone", &mstudioattachment_t::localbone);
    ModelAttachment.def_readwrite("local", &mstudioattachment_t::local); // TODO: Export matrix3x4_t...

    // Add memory tools...
    ModelAttachment ADD_MEM_TOOLS(mstudioattachment_t);
}
//-----------------------------------------------------------------------------
// Expose ServerClass.
//-----------------------------------------------------------------------------
void export_server_class(scope _props)
{
	class_<ServerClass, ServerClass *> ServerClass_("ServerClass", no_init);
	
	// Properties...
	ServerClass_.def_readonly("table", &ServerClass::m_pTable);
	ServerClass_.def_readonly("next", &ServerClass::m_pNext);
	ServerClass_.def_readonly("class_index", &ServerClass::m_ClassID);
	
	// Engine specific stuff...
	export_engine_specific_server_class(_props, ServerClass_);
	
	// Add memory tools...
	ServerClass_ ADD_MEM_TOOLS(ServerClass);
}
Beispiel #20
0
//-----------------------------------------------------------------------------
// Exports mstudiobonecontroller_t.
//-----------------------------------------------------------------------------
void export_bone_controller(scope _studio)
{
    class_<mstudiobonecontroller_t, mstudiobonecontroller_t *> BoneController("BoneController");

    // Properties...
    BoneController.def_readwrite("bone", &mstudiobonecontroller_t::bone);
    BoneController.def_readwrite("type", &mstudiobonecontroller_t::type);
    BoneController.def_readwrite("start", &mstudiobonecontroller_t::start);
    BoneController.def_readwrite("end", &mstudiobonecontroller_t::end);
    BoneController.def_readwrite("rest", &mstudiobonecontroller_t::rest);
    BoneController.def_readwrite("input_field", &mstudiobonecontroller_t::inputfield);

    // Add memory tools...
    BoneController ADD_MEM_TOOLS(mstudiobonecontroller_t);
}
Beispiel #21
0
//-----------------------------------------------------------------------------
// Exports CHandleEntity.
//-----------------------------------------------------------------------------
void export_handle_entity(scope _entities)
{
	class_<IHandleEntity, boost::noncopyable>("HandleEntity", no_init)
		.def("set_ref_ehandle",
			&IHandleEntity::SetRefEHandle,
			args("handle")
		)

		.def("get_ref_ehandle",
			&IHandleEntity::GetRefEHandle,
			reference_existing_object_policy()
		)

		ADD_MEM_TOOLS(IHandleEntity)
	;
}
Beispiel #22
0
//-----------------------------------------------------------------------------
// Exports mstudiolocalhierarchy_t.
//-----------------------------------------------------------------------------
void export_hierarchy(scope _studio)
{
    class_<mstudiolocalhierarchy_t, mstudiolocalhierarchy_t *, boost::noncopyable> Hierarchy("Hierarchy");

    // Properties...
    Hierarchy.def_readwrite("bone", &mstudiolocalhierarchy_t::iBone);
    Hierarchy.def_readwrite("new_parent", &mstudiolocalhierarchy_t::iNewParent);
    Hierarchy.def_readwrite("start", &mstudiolocalhierarchy_t::start);
    Hierarchy.def_readwrite("peak", &mstudiolocalhierarchy_t::peak);
    Hierarchy.def_readwrite("tail", &mstudiolocalhierarchy_t::tail);
    Hierarchy.def_readwrite("end", &mstudiolocalhierarchy_t::end);
    Hierarchy.def_readwrite("start", &mstudiolocalhierarchy_t::iStart);

    // Add memory tools...
    Hierarchy ADD_MEM_TOOLS(mstudiolocalhierarchy_t);
}
Beispiel #23
0
//-----------------------------------------------------------------------------
// Exports mstudiobbox_t.
//-----------------------------------------------------------------------------
void export_hitbox(scope _studio)
{
    class_<mstudiobbox_t, mstudiobbox_t *, boost::noncopyable> Hitbox("Hitbox");

    // Properties...
    Hitbox.add_property("name", &mstudiobbox_t::pszHitboxName);

    Hitbox.def_readwrite("bone", &mstudiobbox_t::bone);
    Hitbox.def_readwrite("group", &mstudiobbox_t::group);

    Hitbox.add_property("min", make_getter(&mstudiobbox_t::bbmin, reference_existing_object_policy()));
    Hitbox.add_property("max", make_getter(&mstudiobbox_t::bbmax, reference_existing_object_policy()));

    // Add memory tools...
    Hitbox ADD_MEM_TOOLS(mstudiobbox_t);
}
Beispiel #24
0
//-----------------------------------------------------------------------------
// Exports CBaseEntityHandle.
//-----------------------------------------------------------------------------
void export_base_entity_handle(scope _entities)
{
	class_<CBaseHandle>("BaseEntityHandle")
		.def(init<CBaseHandle&>())
		.def(init<unsigned long>())
		.def(init<int, int>())

		.def("init",
			&CBaseHandle::Init,
			args("entry", "serial_number")
		)

		.def("term",
			&CBaseHandle::Term
		)

		.def("is_valid",
			&CBaseHandle::IsValid,
			"Returns whether the handle has been initted with any values."
		)

		.def("get_entry_index",
			&CBaseHandle::GetEntryIndex
		)

		.def("get_serial_number",
			&CBaseHandle::GetSerialNumber
		)

		.def("to_int",
			&CBaseHandle::ToInt
		)

		.def(self != self)
		.def(self == self)
		.def(self < self)

		.def("set",
			&CBaseHandle::Set,
			args("entity"),
			"Assigns a value to the handle.",
			reference_existing_object_policy()
		)

		ADD_MEM_TOOLS(CBaseHandle)
	;
}
//-----------------------------------------------------------------------------
// Expose SendProp.
//-----------------------------------------------------------------------------
void export_send_prop(scope _props)
{
	class_<SendProp, SendProp *, boost::noncopyable> SendProp_("SendProp", no_init);
	
	// Properties...
	SendProp_.def_readonly("type", &SendProp::m_Type);
	SendProp_.def_readonly("bits", &SendProp::m_nBits);
	SendProp_.def_readonly("low_value", &SendProp::m_fLowValue);
	SendProp_.def_readonly("high_value", &SendProp::m_fHighValue);
	SendProp_.def_readonly("array_prop", &SendProp::m_pArrayProp);
	SendProp_.def_readonly("length", &SendProp::m_nElements);
	SendProp_.def_readonly("element_stride", &SendProp::m_ElementStride);
	SendProp_.def_readonly("exclude_data_table_name", &SendProp::m_pExcludeDTName);
	SendProp_.def_readonly("parent_array_prop_name", &SendProp::m_pParentArrayPropName);
	SendProp_.add_property("name", &SendProp::GetName);
	SendProp_.def_readonly("high_low_mul", &SendProp::m_fHighLowMul);
	SendProp_.add_property("flags", &SendProp::GetFlags);
	
	SendProp_.add_property("data_table",
		make_function(
			&SendProp::GetDataTable,
			reference_existing_object_policy()
		)
	);
	
	SendProp_.add_property("offset", &SendProp::GetOffset);
	
	// CS:GO specific properties...
	SendProp_.NOT_IMPLEMENTED_ATTR("priority");
	
	// Methods...

	SendProp_.def("is_signed", &SendProp::IsSigned);
	SendProp_.def("is_exclude_prop", &SendProp::IsExcludeProp);
	SendProp_.def("is_inside_array", &SendProp::IsInsideArray);

	SendProp_.def("get_proxy_function", &SendPropSharedExt::get_proxy_function, manage_new_object_policy());

	// CS:GO specific methods...
	SendProp_.NOT_IMPLEMENTED("get_priority");
	
	// Engine specific stuff...
	export_engine_specific_send_prop(_props, SendProp_);
	
	// Add memory tools...
	SendProp_ ADD_MEM_TOOLS(SendProp);
}
Beispiel #26
0
//-----------------------------------------------------------------------------
// Exports mstudioevent_t.
//-----------------------------------------------------------------------------
void export_sequence_event(scope _studio)
{
    class_<mstudioevent_t, mstudioevent_t *, boost::noncopyable> SequenceEvent("SequenceEvent");

    // Properties...
    SequenceEvent.def_readwrite("cycle", &mstudioevent_t::cycle);
    SequenceEvent.def_readwrite("event", &mstudioevent_t::event);
    SequenceEvent.def_readwrite("type", &mstudioevent_t::type);
    SequenceEvent.add_property("options", &mstudioevent_t::pszOptions);
    SequenceEvent.def_readwrite("event_offset", &mstudioevent_t::szeventindex);

    // Methods...
    SequenceEvent.def("get_name", &SequenceEventExt::get_name);

    // Add memory tools...
    SequenceEvent ADD_MEM_TOOLS(mstudioevent_t);
}
Beispiel #27
0
//-----------------------------------------------------------------------------
// Exports mstudioanimdesc_t.
//-----------------------------------------------------------------------------
void export_movement(scope _studio)
{
    class_<mstudiomovement_t, mstudiomovement_t *, boost::noncopyable> Movement("Movement");

    // Properties...
    Movement.def_readwrite("end_frame", &mstudiomovement_t::endframe);
    Movement.def_readwrite("motion_flags", &mstudiomovement_t::motionflags);
    Movement.def_readwrite("velocity_start", &mstudiomovement_t::v0);
    Movement.def_readwrite("velocity_end", &mstudiomovement_t::v1);
    Movement.def_readwrite("angle", &mstudiomovement_t::angle);

    Movement.add_property("vector", make_getter(&mstudiomovement_t::vector, reference_existing_object_policy()));
    Movement.add_property("position", make_getter(&mstudiomovement_t::position, reference_existing_object_policy()));

    // Add memory tools...
    Movement ADD_MEM_TOOLS(mstudiomovement_t);
}
//-----------------------------------------------------------------------------
// Exports CServerEntity.
//-----------------------------------------------------------------------------
void export_server_entity(scope _entities)
{
	class_< IServerEntity, bases<IServerUnknown>, boost::noncopyable >("ServerEntity", no_init)
		.add_property("model_index",
			&IServerEntity::GetModelIndex,
			&IServerEntity::SetModelIndex,
			"Returns the model index for this entity."
		)

		.add_property("model_name",
			&IServerEntity::GetModelName,
			"Returns the name of the model this entity is using."
		)

		ADD_MEM_TOOLS(IServerEntity)
	;
}
//-----------------------------------------------------------------------------
// Expose CServerCommandManager.
//-----------------------------------------------------------------------------
void export_server_command_manager(scope _server)
{
	class_<CServerCommandManager, bases<ConCommand>, boost::noncopyable>("ServerCommandDispatcher", no_init)
		.def("add_callback",
			&CServerCommandManager::AddCallback,
			"Adds a callback to the server command's list.",
			args("callable")
		)

		.def("remove_callback",
			&CServerCommandManager::RemoveCallback,
			"Removes a callback from the server command's list.",
			args("callable")
		)

		ADD_MEM_TOOLS(CServerCommandManager)
	;
}
//-----------------------------------------------------------------------------
// Expose IEntityFactory.
//-----------------------------------------------------------------------------
void export_entity_factory(scope _factories)
{
	class_<IEntityFactory, boost::noncopyable> EntityFactory("EntityFactory", no_init);
	
	// Methods...
	EntityFactory.def("create",
		&IEntityFactory::Create,
		reference_existing_object_policy()
	);
	
	EntityFactory.def("destroy", &IEntityFactory::Destroy);
	
	// Properties...
	EntityFactory.add_property("size", &IEntityFactory::GetEntitySize);
	
	// Add memory tools...
	EntityFactory ADD_MEM_TOOLS(IEntityFactory);
}