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

C++ bf_read类代码示例

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

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



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

示例1: __MsgFunc_HapSetDrag

void __MsgFunc_HapSetDrag( bf_read &msg )
{
#ifdef WIN32
	float drag = msg.ReadFloat();
	HapticsHandleMsg_HapSetDrag( drag );
#endif // WIN32
}
开发者ID:EspyEspurr,项目名称:game,代码行数:7,代码来源:haptic_msgs.cpp


示例2: ReceiveMessage

//-----------------------------------------------------------------------------
// Purpose: Receive messages from the server
// Input  : classID - class to receive the message
//			&msg - message in question
//-----------------------------------------------------------------------------
void C_GrenadeHopwire::ReceiveMessage( int classID, bf_read &msg )
{
	if ( classID != GetClientClass()->m_ClassID )
	{
		// Message is for subclass
		BaseClass::ReceiveMessage( classID, msg );
		return;
	}

	int messageType = msg.ReadByte();
	switch( messageType )
	{
	case HOPWIRE_START_EXPLOSION:
		{
			m_ExplosionEffect.SetActive();
			m_ExplosionEffect.SetOwner( this );
			m_ExplosionEffect.StartExplosion();
		}
		break;
	case HOPWIRE_STOP_EXPLOSION:
		{
			m_ExplosionEffect.StopExplosion();
		}
		break;
	default:
		break;
	}
}
开发者ID:paralin,项目名称:hl2sdk,代码行数:33,代码来源:c_weapon_hopwire.cpp


示例3: ReceiveMessage

// Server to client message received
void C_NPC_Advisor::ReceiveMessage( int classID, bf_read &msg )
{
	if ( classID != GetClientClass()->m_ClassID )
	{
		// message is for subclass
		BaseClass::ReceiveMessage( classID, msg );
		return;
	}

	int messageType = msg.ReadByte();
	switch( messageType )
	{
	case ADVISOR_MSG_START_BEAM:
		{
			int eindex = msg.ReadLong();
			StartBeamFX(IndexToEntity(eindex));
		}
		break;

	case ADVISOR_MSG_STOP_BEAM:
		{
			int eindex = msg.ReadLong();
			StopBeamFX(IndexToEntity(eindex));

		}
		break;

	case ADVISOR_MSG_STOP_ALL_BEAMS:
		{
			ParticleProp()->StopEmission();
		}
		break;
	case ADVISOR_MSG_START_ELIGHT:
		{
			StartElight();
		}
		break;
	case ADVISOR_MSG_STOP_ELIGHT:
		{
			StopElight();
		}
		break;

	default:
		AssertMsg1( false, "Received unknown message %d", messageType);
	}
}
开发者ID:Mangmasta,项目名称:MangsterMod,代码行数:48,代码来源:c_npc_advisor.cpp


示例4: ReadLocalizedString

//-----------------------------------------------------------------------------
// Purpose: Reads in a player's Chat text from the server
//-----------------------------------------------------------------------------
void CBaseHudChat::MsgFunc_SayText2( bf_read &msg )
{
	// Got message during connection
	if ( !g_PR )
		return;

	int client = msg.ReadByte();
	bool bWantsToChat = msg.ReadByte();

	wchar_t szBuf[6][256];
	char untranslated_msg_text[256];
	wchar_t *msg_text = ReadLocalizedString( msg, szBuf[0], sizeof( szBuf[0] ), false, untranslated_msg_text, sizeof( untranslated_msg_text ) );

	// keep reading strings and using C format strings for subsituting the strings into the localised text string
	ReadChatTextString ( msg, szBuf[1], sizeof( szBuf[1] ) );		// player name
	ReadChatTextString ( msg, szBuf[2], sizeof( szBuf[2] ) );		// chat text
	ReadLocalizedString( msg, szBuf[3], sizeof( szBuf[3] ), true );
	ReadLocalizedString( msg, szBuf[4], sizeof( szBuf[4] ), true );

	g_pVGuiLocalize->ConstructString( szBuf[5], sizeof( szBuf[5] ), msg_text, 4, szBuf[1], szBuf[2], szBuf[3], szBuf[4] );

	char ansiString[512];
	g_pVGuiLocalize->ConvertUnicodeToANSI( ConvertCRtoNL( szBuf[5] ), ansiString, sizeof( ansiString ) );

	if ( bWantsToChat )
	{
		int iFilter = CHAT_FILTER_NONE;

		if ( client > 0 && (g_PR->GetTeam( client ) != g_PR->GetTeam( GetLocalPlayerIndex() )) )
		{
			iFilter = CHAT_FILTER_PUBLICCHAT;
		}

		// print raw chat text
		ChatPrintf( client, iFilter, "%s", ansiString );

		Msg( "%s\n", RemoveColorMarkup(ansiString) );

		CLocalPlayerFilter filter;
		C_BaseEntity::EmitSound( filter, SOUND_FROM_LOCAL_PLAYER, "HudChat.Message" );
	}
	else
	{
		// print raw chat text
		ChatPrintf( client, GetFilterForString( untranslated_msg_text), "%s", ansiString );
	}
}
开发者ID:Epic-xx,项目名称:impending,代码行数:50,代码来源:hud_basechat.cpp


示例5: __MsgFunc_PyNetworkCls

// Message handler for PyNetworkCls
void __MsgFunc_PyNetworkCls( bf_read &msg )
{
	int iClassID;
	char networkName[PYNETCLS_BUFSIZE];

	iClassID = msg.ReadWord();
	msg.ReadString( networkName, PYNETCLS_BUFSIZE );

	DbgStrPyMsg( "__MsgFunc_PyNetworkCls: Registering Python network class message %d %s\n", iClassID, networkName );

	// Get module path
	const char *pch = V_strrchr( networkName, '.' );
	if( !pch )
	{
		Warning( "Invalid python class name %s\n", networkName );
		return;
	}
	int n = pch - networkName + 1;

	char modulePath[PYNETCLS_BUFSIZE];
	V_strncpy( modulePath, networkName, n );

	// Make sure the client class is imported
	SrcPySystem()->Import( modulePath );

	// Read which client class we are modifying
	PyClientClassBase *p = FindPyClientClassByID( iClassID );
	if( !p )
	{
		Warning( "__MsgFunc_PyNetworkCls: Invalid networked class %d\n", iClassID );
		return;
	}

	// Read network class name
	V_strncpy( p->m_strPyNetworkedClassName, networkName, sizeof( p->m_strPyNetworkedClassName ) );

	// Attach if a network class exists
	unsigned short lookup = m_NetworkClassDatabase.Find( networkName );
	if ( lookup != m_NetworkClassDatabase.InvalidIndex() )
	{
		m_NetworkClassDatabase.Element(lookup)->AttachClientClass( p );
	}
	else
	{
		Warning( "__MsgFunc_PyNetworkCls: Invalid networked class %s\n", networkName );
	}
}
开发者ID:Sandern,项目名称:py-source-sdk-2013,代码行数:48,代码来源:srcpy_client_class.cpp


示例6: MsgFunc_ShowObjectives

static void MsgFunc_ShowObjectives( bf_read &msg )
{
    CASWHudObjective *pObjectives = GET_HUDELEMENT( CASWHudObjective );
    if ( !pObjectives )
        return;

    pObjectives->ShowObjectives( msg.ReadFloat() );
}
开发者ID:Romikus33,项目名称:MoreGreenTea,代码行数:8,代码来源:asw_hud_objective.cpp


示例7: MsgFunc_ForceFeedback

//-----------------------------------------------------------------------------
// Purpose: 
// Input  : *pszName - 
//			iSize - 
//			*pbuf - 
//-----------------------------------------------------------------------------
void CForceFeedback::MsgFunc_ForceFeedback( bf_read &msg )
{
	byte msgType = msg.ReadByte();

	switch ( msgType )
	{
	default:
		{
			Warning( "Bad parse in MsgFunc_ForceFeedback!\n" );
		}
		break;
	case FFMSG_STOPALL:
		{
			Internal_StopAllEffects();
		}
		break;
	case FFMSG_START:
		{
			FORCEFEEDBACK_t effectType = (FORCEFEEDBACK_t)msg.ReadByte();

			FFBaseParams_t params;
			params.m_flDirection = 360.0f * ( (byte)msg.ReadByte() / 255.0f );
			params.m_flDuration = (float)msg.ReadLong() / 1000.0f;
			params.m_flGain = ( (byte)msg.ReadByte() / 255.0f );
			params.m_nPriority = msg.ReadByte();
			params.m_bSolo = msg.ReadByte() == 0 ? false : true;

			if ( effectType >= 0 && effectType < NUM_FORCE_FEEDBACK_PRESETS )
			{
				Internal_StartEffect( effectType, params );
			}
			else
			{
				Warning( "Bad parse in MsgFunc_ForceFeedback, FFMSG_START (%i)!\n", effectType );
			}
		}
		break;
	case FFMSG_STOP:
		{
			FORCEFEEDBACK_t effectType = (FORCEFEEDBACK_t)msg.ReadByte();

			Internal_StopEffect( effectType );
		}
		break;
	case FFMSG_PAUSE:
		{
			Internal_PauseAll();
		}
		break;
	case FFMSG_RESUME:
		{
			Internal_ResumeAll();
		}
		break;
	}
}
开发者ID:AluminumKen,项目名称:hl2sb-src,代码行数:62,代码来源:c_forcefeedback.cpp


示例8: __MsgFunc_SPHapWeapEvent

void __MsgFunc_SPHapWeapEvent( bf_read &msg )
{
#ifdef WIN32
	int iActivity = msg.ReadLong();

	HapticsHandleMsg_SPHapWeapEvent( iActivity );
#endif // WIN32
}
开发者ID:Adidasman1,项目名称:source-sdk-2013,代码行数:8,代码来源:haptic_msgs.cpp


示例9: MsgFunc_SendAudio

void CHud::MsgFunc_SendAudio( bf_read &msg )
{
	char szString[2048];
	msg.ReadString( szString, sizeof(szString) );
	
	CLocalPlayerFilter filter;
	C_BaseEntity::EmitSound( filter, SOUND_FROM_LOCAL_PLAYER, szString );
}
开发者ID:1n73rf4c3,项目名称:source-sdk-2013,代码行数:8,代码来源:hud_msg.cpp


示例10: __MsgFunc_ReloadEffect

void __MsgFunc_ReloadEffect( bf_read &msg )
{
	int iPlayer = msg.ReadShort();
	C_SDKPlayer *pPlayer = dynamic_cast< C_SDKPlayer* >( C_BaseEntity::Instance( iPlayer ) );
	if ( pPlayer )
		pPlayer->PlayReloadEffect();

}
开发者ID:iosoccer,项目名称:iosoccer-game,代码行数:8,代码来源:c_sdk_player.cpp


示例11: __MsgFunc_LessonLearned

void __MsgFunc_LessonLearned( bf_read &msg )
{
	char szString[256];
	msg.ReadString(szString, sizeof(szString));

	C_SDKPlayer* pPlayer = C_SDKPlayer::GetLocalSDKPlayer();

	pPlayer->Instructor_LessonLearned(szString);
}
开发者ID:jlwitthuhn,项目名称:DoubleAction,代码行数:9,代码来源:da_instructor.cpp


示例12: HandleVoiceMaskMsg

void CVoiceStatus::HandleVoiceMaskMsg(bf_read &msg)
{
	unsigned long dw;
	for(dw=0; dw < VOICE_MAX_PLAYERS_DW; dw++)
	{
		m_AudiblePlayers.SetDWord(dw, (unsigned long)msg.ReadLong());
		m_ServerBannedPlayers.SetDWord(dw, (unsigned long)msg.ReadLong());

		if( voice_clientdebug.GetInt())
		{
			Msg("CVoiceStatus::HandleVoiceMaskMsg\n");
			Msg("    - m_AudiblePlayers[%d] = %lu\n", dw, m_AudiblePlayers.GetDWord(dw));
			Msg("    - m_ServerBannedPlayers[%d] = %lu\n", dw, m_ServerBannedPlayers.GetDWord(dw));
		}
	}

	m_bServerModEnable = msg.ReadByte();
}
开发者ID:SizzlingStats,项目名称:hl2sdk-ob-valve,代码行数:18,代码来源:voice_status.cpp


示例13: MsgFunc_ItemPickup

//-----------------------------------------------------------------------------
// Purpose: Handle an item pickup event from the server
//-----------------------------------------------------------------------------
void CHudHistoryResource::MsgFunc_ItemPickup( bf_read &msg )
{
	char szName[1024];
	
	msg.ReadString( szName, sizeof(szName) );

	// Add the item to the history
	AddToHistory( HISTSLOT_ITEM, szName );
}
开发者ID:BoXorz,项目名称:MasterSword-Source,代码行数:12,代码来源:history_resource.cpp


示例14: MsgFunc_ASWOrderStopItemFX

void CASW_Hud_Squad_Hotbar::MsgFunc_ASWOrderStopItemFX( bf_read &msg )
{
	int iMarine = msg.ReadShort();	
	C_ASW_Marine *pMarine = dynamic_cast<C_ASW_Marine*>(ClientEntityList().GetEnt(iMarine));		// turn iMarine ent index into the marine
	if ( !pMarine )
		return;

	bool bShouldDelay = msg.ReadOneBit() ? true : false;
	bool bFailed = msg.ReadOneBit() ? true : false;

	// loops through to see if we already have an order effect for this marine
	if ( bFailed )
		StopItemFX( pMarine, gpGlobals->curtime + 2.0f, true );
	else if ( bShouldDelay )
		StopItemFX( pMarine, gpGlobals->curtime + 2.0f );
	else
		StopItemFX( pMarine );
}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:18,代码来源:asw_hud_squad_hotbar.cpp


示例15: MsgFunc_HintText

void CHudLessonPanel::MsgFunc_HintText( bf_read &msg )
{
	// Read the string(s)
	char szString[255];
	msg.ReadString( szString, sizeof(szString) );

	char *tmpStr = hudtextmessage->LookupString( szString, NULL );
	LocalizeAndDisplay( tmpStr, szString );
}
开发者ID:jlwitthuhn,项目名称:DoubleAction,代码行数:9,代码来源:da_instructor.cpp


示例16: MsgFunc_HudNotifyCustom

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CHudNotificationPanel::MsgFunc_HudNotifyCustom( bf_read &msg )
{
	// Ignore notifications in minmode
	ConVarRef cl_hud_minmode( "cl_hud_minmode", true );
	if ( cl_hud_minmode.IsValid() && cl_hud_minmode.GetBool() )
		return;

	// Reload the base
	LoadControlSettings( "resource/UI/notifications/base_notification.res" );

	char szText[256];
	char szIcon[256];

	msg.ReadString( szText, sizeof(szText) );
	msg.ReadString( szIcon, sizeof(szIcon) );
	int iBackgroundTeam = msg.ReadByte();

	SetupNotifyCustom( szText, szIcon, iBackgroundTeam );
}
开发者ID:staticfox,项目名称:TF2Classic,代码行数:22,代码来源:tf_hud_notification_panel.cpp


示例17: HandlePacket_FORCE_PASSWORD_CHANGE

void HandlePacket_FORCE_PASSWORD_CHANGE( bf_read &buf, const CIPAddr &ipFrom )
{
	char newPassword[512];
	buf.ReadString( newPassword, sizeof( newPassword ) );
	
	Msg( "Got a FORCE_PASSWORD_CHANGE (%s) packet.\n", newPassword );
	
	SetPassword( newPassword );
	if ( g_pConnMgr )
		g_pConnMgr->SendCurStateTo( -1 );
}
开发者ID:DeadZoneLuna,项目名称:SourceEngine2007,代码行数:11,代码来源:vmpi_service.cpp


示例18: MsgFunc_SayText

//-----------------------------------------------------------------------------
// Purpose: 
// Input  : *pszName - 
//			iSize - 
//			*pbuf - 
//-----------------------------------------------------------------------------
void CHudChat::MsgFunc_SayText( bf_read &msg )
{
	char szString[256];

	int client = msg.ReadByte();
	msg.ReadString( szString, sizeof(szString) );
	bool bWantsToChat = msg.ReadByte();
	
	if ( bWantsToChat )
	{
		// print raw chat text
		 ChatPrintf( client, "%s", szString );
	}
	else
	{
		// try to lookup translated string
		 Printf( "%s", hudtextmessage->LookupString( szString ) );
	}

	Msg( "%s", szString );
}
开发者ID:Bubbasacs,项目名称:FinalProj,代码行数:27,代码来源:sdk_hud_chat.cpp


示例19: MsgFunc_HoloMessage

void CHoloShipComm::MsgFunc_HoloMessage( bf_read &msg )
{
	char szDisplayName[ 128 ];
	char szWaveName[ 128 ];
	msg.ReadString( szDisplayName, sizeof( szDisplayName ) );
	msg.ReadString( szWaveName, sizeof( szWaveName ) );
	const float flDuration = msg.ReadFloat();

	//Msg( "Holo message received: %s, %s, %f\n", szDisplayName, szWaveName, flDuration );

	wchar_t wszFormatted[ 64 ];
	g_pVGuiLocalize->ConstructString( wszFormatted, sizeof( wszFormatted ),
		SafeLocalizeInline( "#holo_gui_comm_incoming" ).Get(),
		1, SafeLocalizeInline( szDisplayName ).Get() );
	m_pLabelHeader->SetText( wszFormatted );

	m_flResetTimer = flDuration;
	m_flFlashTimer = 0.5f;

	ResetWaveForm( szWaveName );
}
开发者ID:Biohazard90,项目名称:g-string_2013,代码行数:21,代码来源:holo_ship_comm.cpp


示例20: MsgFunc_GameMessage

void CHudGameMessage::MsgFunc_GameMessage( bf_read &msg )
{
	// Read in our string
	char szString[256];
	msg.ReadString( szString, sizeof(szString) );

	// Convert it to localize friendly unicode
	g_pVGuiLocalize->ConvertANSIToUnicode( szString, m_pText, sizeof(m_pText) );

	// Setup our time trackers
	m_flStartTime = gpGlobals->curtime;
	m_flDuration = 5.0f;
}
开发者ID:AluminumKen,项目名称:hl2sb-src,代码行数:13,代码来源:sdk_hud_message.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ bigint类代码示例发布时间:2022-05-31
下一篇:
C++ be_ClientHeader类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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