本文整理汇总了C++中MessageEnd函数的典型用法代码示例。如果您正苦于以下问题:C++ MessageEnd函数的具体用法?C++ MessageEnd怎么用?C++ MessageEnd使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了MessageEnd函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: UTIL_PlayerByIndex
void NDebugOverlay::BoxAngles(const Vector &origin, const Vector &mins, const Vector &maxs, const QAngle &angles, int r, int g, int b, int a, float duration)
{
// --------------------------------------------------------------
// Have to do clip the boxes before sending so we
// don't overflow the client message buffer
// --------------------------------------------------------------
CBasePlayer *player = UTIL_PlayerByIndex(1);
if ( !player )
return;
// ------------------------------------
// Clip boxes that are far away
// ------------------------------------
if ((player->GetAbsOrigin() - origin).LengthSqr() > MAX_OVERLAY_DIST_SQR)
return;
// ------------------------------------
// Clip boxes that are behind the client
// ------------------------------------
Vector clientForward;
player->EyeVectors( &clientForward );
// Build a rotation matrix from orientation
matrix3x4_t fRotateMatrix;
AngleMatrix(angles, fRotateMatrix);
// Transform the mins and maxs
Vector tmins, tmaxs;
VectorRotate( mins, fRotateMatrix, tmins);
VectorAdd(tmins,origin,tmins);
VectorRotate( maxs, fRotateMatrix, tmaxs);
VectorAdd(tmaxs,origin,tmaxs);
Vector toMins = tmins - player->GetAbsOrigin();
Vector toMaxs = tmaxs - player->GetAbsOrigin();
float dotMins = DotProduct(clientForward,toMins);
float dotMaxs = DotProduct(clientForward,toMaxs);
if (dotMins < 0 && dotMaxs < 0)
return;
CSingleUserRecipientFilter user( player );
MessageBegin( user, SVC_DEBUG_BOX_OVERLAY );
WRITE_VEC3COORD(origin);
WRITE_VEC3COORD(mins);
WRITE_VEC3COORD(maxs);
WRITE_ANGLES(angles);
WRITE_SHORT(r);
WRITE_SHORT(g);
WRITE_SHORT(b);
WRITE_SHORT(a);
WRITE_FLOAT(duration);
MessageEnd();
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:55,代码来源:ndebugoverlay.cpp
示例2: UTIL_GetLocalPlayer
void CCredits::InputShowLogo( inputdata_t &inputdata )
{
CBasePlayer *pPlayer = UTIL_GetLocalPlayer();
CSingleUserRecipientFilter user( pPlayer );
user.MakeReliable();
if ( m_flLogoLength )
{
UserMessageBegin( user, "LogoTimeMsg" );
WRITE_FLOAT( m_flLogoLength );
MessageEnd();
}
else
{
UserMessageBegin( user, "CreditsMsg" );
WRITE_BYTE( 1 );
MessageEnd();
}
}
开发者ID:0xFEEDC0DE64,项目名称:UltraGame,代码行数:20,代码来源:envmessage.cpp
示例3: UserMessageBegin
void CASW_Sentry_Top::MakeTracer( const Vector &vecTracerSrc, const trace_t &tr, int iTracerType )
{
CBroadcastRecipientFilter filter;
UserMessageBegin( filter, "ASWSentryTracer" );
WRITE_SHORT( entindex() );
WRITE_FLOAT( tr.endpos.x );
WRITE_FLOAT( tr.endpos.y );
WRITE_FLOAT( tr.endpos.z );
MessageEnd();
}
开发者ID:Nightgunner5,项目名称:Jastian-Summer,代码行数:11,代码来源:asw_sentry_top.cpp
示例4: Assert
void CBaseMultiplayerPlayer::AwardAchievement( int iAchievement, int iCount )
{
Assert( iAchievement >= 0 && iAchievement < 0xFFFF ); // must fit in short
CSingleUserRecipientFilter filter( this );
UserMessageBegin( filter, "AchievementEvent" );
WRITE_SHORT( iAchievement );
WRITE_SHORT( iCount );
MessageEnd();
}
开发者ID:mkane848,项目名称:HLPlague,代码行数:11,代码来源:basemultiplayerplayer.cpp
示例5: EntityMessageBegin
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CVehicleMortar::OnFinishedDeploy( void )
{
BaseClass::OnFinishedDeploy();
EntityMessageBegin( this, true );
WRITE_STRING( "OnDeployed" );
MessageEnd();
m_flMortarYaw = 0;
m_flMortarPitch = 45;
}
开发者ID:Axitonium,项目名称:SourceEngine2007,代码行数:14,代码来源:tf_vehicle_mortar.cpp
示例6: HapticMsg_Punch
void HapticMsg_Punch(CBasePlayer* pPlayer, float x, float y, float z)
{
CSingleUserRecipientFilter user(pPlayer);
user.MakeReliable();
UserMessageBegin(user,"HapPunch");
WRITE_FLOAT(x);
WRITE_FLOAT(y);
WRITE_FLOAT(z);
MessageEnd();
}
开发者ID:Adidasman1,项目名称:source-sdk-2013,代码行数:11,代码来源:haptic_msgs.cpp
示例7: HapticMsg_SetConstantForce
void HapticMsg_SetConstantForce(CBasePlayer* pPlayer, Vector force)
{
// portal does not network this.
CSingleUserRecipientFilter user( pPlayer );
user.MakeReliable();
UserMessageBegin( user, "HapSetConst" );
WRITE_SHORT(force.x);
WRITE_SHORT(force.y);
WRITE_SHORT(force.z);
MessageEnd();
}
开发者ID:Adidasman1,项目名称:source-sdk-2013,代码行数:11,代码来源:haptic_msgs.cpp
示例8: HapticMsg_HapDmg
void HapticMsg_HapDmg(CBasePlayer* pPlayer, float pitch, float yaw, float dmg, float dmgType )
{
CSingleUserRecipientFilter user(pPlayer);
user.MakeReliable();
UserMessageBegin(user,"HapDmg");
WRITE_FLOAT(pitch);
WRITE_FLOAT(yaw);
WRITE_FLOAT(dmg);
WRITE_LONG(dmgType);
MessageEnd();
}
开发者ID:Adidasman1,项目名称:source-sdk-2013,代码行数:12,代码来源:haptic_msgs.cpp
示例9: UTIL_GetLocalPlayer
void CTimer::DispatchStageCountMessage()
{
CBasePlayer* cPlayer = UTIL_GetLocalPlayer();
if (cPlayer)
{
CSingleUserRecipientFilter user(cPlayer);
user.MakeReliable();
UserMessageBegin(user, "Timer_StageCount");
WRITE_LONG(m_iStageCount);
MessageEnd();
}
}
开发者ID:kirkelifson,项目名称:game,代码行数:12,代码来源:Timer.cpp
示例10: EntityMessageBegin
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CGrenadeHopwire::EndThink( void )
{
if ( hopwire_vortex.GetBool() )
{
EntityMessageBegin( this, true );
WRITE_BYTE( 1 );
MessageEnd();
}
SetThink( &CBaseEntity::SUB_Remove );
SetNextThink( gpGlobals->curtime + 1.0f );
}
开发者ID:Muini,项目名称:Nag-asw,代码行数:15,代码来源:grenade_hopwire.cpp
示例11: Msg
// if we've already started showing the credits and another player has joined up, show him them too
void CASW_Intro_Control::PlayerSpawned(CASW_Player *pPlayer)
{
Msg("CASW_Intro_Control::PlayerSpawned, showncredits = %d\n", m_bShownCredits);
if (m_bShownCredits && pPlayer)
{
Msg("Sending user message to this player telling him to show the credits\n");
CRecipientFilter filter;
filter.AddRecipient(pPlayer);
UserMessageBegin( filter, "LaunchCredits" );
MessageEnd();
}
}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:13,代码来源:asw_intro_control.cpp
示例12: GetLocalOrigin
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CSDKPlayer::UpdateClientData( void )
{
if (m_DmgTake || m_DmgSave || m_bitsHUDDamage != m_bitsDamageType)
{
// Comes from inside me if not set
Vector damageOrigin = GetLocalOrigin();
// send "damage" message
// causes screen to flash, and pain compass to show direction of damage
damageOrigin = m_DmgOrigin;
// only send down damage type that have hud art
int iShowHudDamage = g_pGameRules->Damage_GetShowOnHud();
int visibleDamageBits = m_bitsDamageType & iShowHudDamage;
m_DmgTake = clamp( m_DmgTake, 0, 255 );
m_DmgSave = clamp( m_DmgSave, 0, 255 );
// If we're poisoned, but it wasn't this frame, don't send the indicator
// Without this check, any damage that occured to the player while they were
// recovering from a poison bite would register as poisonous as well and flash
// the whole screen! -- jdw
if ( visibleDamageBits & DMG_POISON )
{
float flLastPoisonedDelta = gpGlobals->curtime - m_tbdPrev;
if ( flLastPoisonedDelta > 0.1f )
{
visibleDamageBits &= ~DMG_POISON;
}
}
CSingleUserRecipientFilter user( this );
user.MakeReliable();
UserMessageBegin( user, "Damage" );
WRITE_BYTE( m_DmgSave );
WRITE_BYTE( m_DmgTake );
WRITE_LONG( visibleDamageBits );
WRITE_FLOAT( damageOrigin.x ); //BUG: Should be fixed point (to hud) not floats
WRITE_FLOAT( damageOrigin.y ); //BUG: However, the HUD does _not_ implement bitfield messages (yet)
WRITE_FLOAT( damageOrigin.z ); //BUG: We use WRITE_VEC3COORD for everything else
MessageEnd();
m_DmgTake = 0;
m_DmgSave = 0;
m_bitsHUDDamage = m_bitsDamageType;
// Clear off non-time-based damage indicators
int iTimeBasedDamage = g_pGameRules->Damage_GetTimeBased();
m_bitsDamageType &= iTimeBasedDamage;
}
BaseClass::UpdateClientData();
}
开发者ID:gamenew09,项目名称:SourceSDK2010,代码行数:55,代码来源:sdk_player.cpp
示例13: UTIL_GetListenServerHost
void CASW_Intro_Control::InputShowCainMail( inputdata_t &inputdata )
{
// listen server goes back to the default mission
if ( !engine->IsDedicatedServer() && ASWGameRules() && gpGlobals->maxClients > 1 )
{
CBasePlayer *pPlayer = UTIL_GetListenServerHost();
if (pPlayer)
{
CSingleUserRecipientFilter filter(pPlayer);
filter.MakeReliable();
UserMessageBegin( filter, "LaunchCainMail" );
MessageEnd();
}
}
else
{
CReliableBroadcastRecipientFilter filter;
UserMessageBegin( filter, "LaunchCainMail" );
MessageEnd();
}
}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:22,代码来源:asw_intro_control.cpp
示例14: user
//-----------------------------------------------------------------------------
// Purpose:
// Input : *player -
//-----------------------------------------------------------------------------
void CForceFeedback::ResumeAll( CBasePlayer *player )
{
if ( !player )
return;
CSingleUserRecipientFilter user( player );
UserMessageBegin( user, "ForceFeedback" );
WRITE_BYTE( FFMSG_RESUME ); // Resume effects
MessageEnd();
}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:17,代码来源:forcefeedback.cpp
示例15: DevWarning
//-----------------------------------------------------------------------------
// Purpose: The act has finished
//-----------------------------------------------------------------------------
void CInfoAct::FinishAct( )
{
if ( g_hCurrentAct.Get() != this )
{
DevWarning( 2, "Attempted to finish an act which wasn't started!\n" );
return;
}
ShutdownRespawnTimers();
switch( m_iWinners)
{
case 0:
m_OnFinishedTeamNone.FireOutput( this, this );
break;
case 1:
m_OnFinishedTeam1.FireOutput( this, this );
break;
case 2:
m_OnFinishedTeam2.FireOutput( this, this );
break;
default:
Assert(0);
break;
}
g_hCurrentAct = NULL;
// Tell all the clients
CRelieableBroadcastRecipientFilter filter;
UserMessageBegin( filter, "ActEnd" );
WRITE_BYTE( m_iWinners );
MessageEnd();
// Am I an intermission?
if ( HasSpawnFlags( SF_ACT_INTERMISSION ) )
{
// Cycle through all players and end the intermission for them
for ( int i = 1; i <= gpGlobals->maxClients; i++ )
{
CBaseTFPlayer *pPlayer = (CBaseTFPlayer*)UTIL_PlayerByIndex( i );
if ( pPlayer )
{
EndIntermission( pPlayer );
}
}
}
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:54,代码来源:info_act.cpp
示例16: GetAttachment
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CPropAPC2::FireMachineGun( void )
{
if ( m_flMachineGunTime > gpGlobals->curtime )
return;
// If we're still firing the salvo, fire quickly
m_iMachineGunBurstLeft--;
if ( m_iMachineGunBurstLeft > 0 )
{
m_flMachineGunTime = gpGlobals->curtime + MACHINE_GUN_BURST_TIME;
}
else
{
// Reload the salvo
m_iMachineGunBurstLeft = MACHINE_GUN_BURST_SIZE;
m_flMachineGunTime = gpGlobals->curtime + MACHINE_GUN_BURST_PAUSE_TIME;
}
Vector vecMachineGunShootPos;
QAngle vecMachineGunAngles;
GetAttachment( m_nMachineGunMuzzleAttachment, vecMachineGunShootPos, vecMachineGunAngles );
Vector vecMachineGunDir;
AngleVectors( vecMachineGunAngles, &vecMachineGunDir );
// Fire the round
int bulletType = GetAmmoDef()->Index("StriderMiniGun");
FireBulletsInfo_t info;
info.m_iShots = 1;
info.m_vecSrc = vecMachineGunShootPos;
info.m_vecDirShooting = vecMachineGunDir;
info.m_vecSpread = VECTOR_CONE_8DEGREES;
info.m_pAttacker = (CBaseEntity *) m_hPlayer;
info.m_flDistance = MAX_TRACE_LENGTH;
info.m_iAmmoType = bulletType;
info.m_flDamage = 30;
info.m_iPlayerDamage= 30;
info.m_iTracerFreq = 1;
FireBullets( info );
EntityMessageBegin( this, true );
WRITE_BYTE( APC_MSG_MACHINEGUN );
WRITE_VEC3COORD(vecMachineGunShootPos);
WRITE_VEC3COORD(vecMachineGunDir);
WRITE_VEC3COORD(VECTOR_CONE_8DEGREES);
WRITE_BYTE( bulletType );
MessageEnd();
DoMuzzleFlash();
m_iAmmoCount--;
EmitSound( "Weapon_AR2.Single" );
}
开发者ID:WorldGamers,项目名称:Mobile-Forces-Source,代码行数:53,代码来源:vehicle_apc2.cpp
示例17: ASWGameRules
void CASW_Intro_Control::LaunchCampaignMap()
{
if (m_bLaunchedCampaignMap || !ASWGameRules())
return;
ASWGameRules()->SetGameState(ASW_GS_CAMPAIGNMAP);
CReliableBroadcastRecipientFilter filter;
UserMessageBegin( filter, "LaunchCampaignMap" );
MessageEnd();
m_bLaunchedCampaignMap = true;
}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:14,代码来源:asw_intro_control.cpp
示例18: MessageBegin
//-----------------------------------------------------------------------------
// Purpose: Send debug overlay text to the client
// Input :
// Output :
//-----------------------------------------------------------------------------
void NDebugOverlay::EntityText( int entityID, int text_offset, const char *text, float duration, int r, int g, int b, int a )
{
CBroadcastRecipientFilter filter;
MessageBegin( filter, SVC_DEBUG_ENTITYTEXT_OVERLAY);
WRITE_SHORT(entityID);
WRITE_SHORT(text_offset);
WRITE_FLOAT(duration);
WRITE_SHORT(r);
WRITE_SHORT(g);
WRITE_SHORT(b);
WRITE_SHORT(a);
WRITE_STRING(text);
MessageEnd();
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:20,代码来源:ndebugoverlay.cpp
示例19: user
void CGameMessageEntity::InputDisplayMessage( inputdata_t &data )
{
// Only send this message the local player
CSingleUserRecipientFilter user( UTIL_PlayerByIndex(1) );
user.MakeReliable();
// Start the message block
UserMessageBegin( user, "GameMessage" );
// Send our text to the client
WRITE_STRING( STRING( m_strText ) );
// End the message block
MessageEnd();
}
开发者ID:AluminumKen,项目名称:hl2sb-src,代码行数:15,代码来源:sdk_env_message.cpp
示例20: internal_flush
bool CryptoOutputFilter::internal_flush(){
auto filter = this->get_filter();
size_t size;
auto buffer = this->get_buffer(size);
if (!this->flushed){
filter->MessageEnd();
this->flushed = true;
}
while (1){
auto read = filter->Get(buffer, size);
if (!read)
break;
this->next_write((const char *)buffer, read);
}
return OutputFilter::internal_flush();
}
开发者ID:Helios-vmg,项目名称:zekvok,代码行数:16,代码来源:CryptoFilter.cpp
注:本文中的MessageEnd函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论