Ejemplo n.º 1
0
void CMarkerRPCs::SetMarkerTarget ( NetBitStreamInterface& bitStream )
{
    // Read out the marker id and if there's a new target
    ElementID ID;
    unsigned char ucTemp;
    if ( bitStream.Read ( ID ) &&
         bitStream.Read ( ucTemp ) )
    {
        // Grab the marker
        CClientMarker* pMarker = m_pMarkerManager->Get ( ID );
        if ( pMarker )
        {
            // Grab the checkpoint marker from it
            CClientCheckpoint* pCheckpoint = pMarker->GetCheckpoint ();
            if ( pCheckpoint )
            {
                // Handle this according to the temp char
                switch ( ucTemp )
                {
                    // No target?
                    case 0:
                    {
                        pCheckpoint->SetIcon ( CClientCheckpoint::ICON_NONE );
                        pCheckpoint->SetDirection ( CVector ( 1.0f, 0.0f, 0.0f ) );
                        pCheckpoint->SetHasTarget ( false );
                        pCheckpoint->ReCreateWithSameIdentifier();
                        break;
                    }

                    // Position target?
                    case 1:
                    {
                        // Read out the position
                        CVector vecPosition;
                        if ( bitStream.Read ( vecPosition.fX ) &&
                            bitStream.Read ( vecPosition.fY ) &&
                            bitStream.Read ( vecPosition.fZ ) )
                        {
                            // Set the icon to arrow and the target position
                            pCheckpoint->SetNextPosition ( vecPosition );
                            pCheckpoint->SetIcon ( CClientCheckpoint::ICON_ARROW );
                            pCheckpoint->SetHasTarget ( true );
                            pCheckpoint->SetTarget ( vecPosition );
                            pCheckpoint->ReCreateWithSameIdentifier();
                        }

                        break;
                    }
                }
            }
        }
    }
}
Ejemplo n.º 2
0
void CMarkerRPCs::SetMarkerSize ( CClientEntity* pSource, NetBitStreamInterface& bitStream )
{
    // Read out the ID and the color
    float fSize;
    if ( bitStream.Read ( fSize ) )
    {
        // Grab the marker
        CClientMarker* pMarker = m_pMarkerManager->Get ( pSource->GetID () );
        if ( pMarker )
        {
            // Set the new position
            pMarker->SetSize ( fSize );
        }
    }
}
Ejemplo n.º 3
0
void CMarkerRPCs::SetMarkerType ( CClientEntity* pSource, NetBitStreamInterface& bitStream )
{
    // Read out the ID and the type
    unsigned char ucType;
    if ( bitStream.Read ( ucType ) )
    {
        // Grab the marker
        CClientMarker* pMarker = m_pMarkerManager->Get ( pSource->GetID () );
        if ( pMarker )
        {
            // Set the new type
            pMarker->SetMarkerType ( static_cast < CClientMarker::eMarkerType > ( ucType ) );
        }
    }
}
Ejemplo n.º 4
0
void CMarkerRPCs::SetMarkerSize ( NetBitStreamInterface& bitStream )
{
    // Read out the ID and the color
    ElementID ID;
    float fSize;
    if ( bitStream.Read ( ID ) &&
         bitStream.Read ( fSize ) )
    {
        // Grab the marker
        CClientMarker* pMarker = m_pMarkerManager->Get ( ID );
        if ( pMarker )
        {
            // Set the new position
            pMarker->SetSize ( fSize );
        }
    }
}
Ejemplo n.º 5
0
void CMarkerRPCs::SetMarkerType ( NetBitStreamInterface& bitStream )
{
    // Read out the ID and the type
    ElementID ID;
    unsigned char ucType;
    if ( bitStream.Read ( ID ) &&
         bitStream.Read ( ucType ) )
    {
        // Grab the marker
        CClientMarker* pMarker = m_pMarkerManager->Get ( ID );
        if ( pMarker )
        {
            // Set the new type
            pMarker->SetMarkerType ( static_cast < CClientMarker::eMarkerType > ( ucType ) );
        }
    }
}
Ejemplo n.º 6
0
void CMarkerRPCs::SetMarkerColor ( CClientEntity* pSource, NetBitStreamInterface& bitStream )
{
    // Read out the ID and the color
    SColor color;
    if ( bitStream.Read ( color.B ) &&
         bitStream.Read ( color.G ) &&
         bitStream.Read ( color.R ) &&
         bitStream.Read ( color.A ) )
    {
        // Grab the marker
        CClientMarker* pMarker = m_pMarkerManager->Get ( pSource->GetID () );
        if ( pMarker )
        {
            // Set the new position
            pMarker->SetColor ( color );
        }
    }
}
Ejemplo n.º 7
0
void CMarkerRPCs::SetMarkerIcon ( CClientEntity* pSource, NetBitStreamInterface& bitStream )
{
    // Read out the marker id and icon
    unsigned char ucIcon;
    if ( bitStream.Read ( ucIcon ) )
    {
        // Grab the marker
        CClientMarker* pMarker = m_pMarkerManager->Get ( pSource->GetID () );
        if ( pMarker )
        {
            // Convert it to a checkpoint
            CClientCheckpoint* pCheckpoint = pMarker->GetCheckpoint ();
            if ( pCheckpoint )
            {
                pCheckpoint->SetIcon ( static_cast < unsigned int > ( ucIcon ) );
            }
        }
    }
}
Ejemplo n.º 8
0
void CMarkerRPCs::SetMarkerColor ( NetBitStreamInterface& bitStream )
{
    // Read out the ID and the color
    ElementID ID;
    SColor color;
    if ( bitStream.Read ( ID ) &&
         bitStream.Read ( color.B ) &&
         bitStream.Read ( color.G ) &&
         bitStream.Read ( color.R ) &&
         bitStream.Read ( color.A ) )
    {
        // Grab the marker
        CClientMarker* pMarker = m_pMarkerManager->Get ( ID );
        if ( pMarker )
        {
            // Set the new position
            pMarker->SetColor ( color );
        }
    }
}