GameObject_Macros

Macros used in CryAction GameObject.

CHANGED_NETWORK_STATE Macro
C++
#define CHANGED_NETWORK_STATE(object,aspects) do {/* IEntity * pEntity = object->GetGameObject()->GetEntity(); CryLogAlways("%s changed aspect %x (%s %d)", pEntity ? pEntity->GetName() : "NULL", aspects, __FILE__, __LINE__); */ object->GetGameObject()->ChangedNetworkState(aspects);} while (0)
File

IGameObject.h

CHANGED_NETWORK_STATE_GO Macro
C++
#define CHANGED_NETWORK_STATE_GO(object,aspects) do {/* IEntity * pEntity = object->GetEntity(); CryLogAlways("%s changed aspect %x (%s %d)", pEntity ? pEntity->GetName() : "NULL", aspects, __FILE__, __LINE__); */ object->ChangedNetworkState(aspects);} while (0)
File

IGameObject.h

CHANGED_NETWORK_STATE_REF Macro
C++
#define CHANGED_NETWORK_STATE_REF(object,aspects) do {/* IEntity * pEntity = object.GetGameObject()->GetEntity(); CryLogAlways("%s changed aspect %x (%s %d)", pEntity ? pEntity->GetName() : "NULL", aspects, __FILE__, __LINE__); */ object.GetGameObject()->ChangedNetworkState(aspects);} while (0)
File

IGameObject.h

DECLARE_CLIENT_RMI_INDEPENDENT Macro
C++
#define DECLARE_CLIENT_RMI_INDEPENDENT(name, params, reliability) DECLARE_CLIENT_RMI_NOATTACH(name, params, reliability)
File

IGameObject.h

DECLARE_CLIENT_RMI_NOATTACH Macro
C++
#define DECLARE_CLIENT_RMI_NOATTACH(name, params, reliability) DECLARE_RMI(name, params, reliability, eRAT_NoAttach, false, false)
File

IGameObject.h

DECLARE_CLIENT_RMI_NOATTACH_FAST Macro
C++
#define DECLARE_CLIENT_RMI_NOATTACH_FAST(name, params, reliability) DECLARE_RMI(name, params, reliability, eRAT_NoAttach, false, true)
File

IGameObject.h

DECLARE_CLIENT_RMI_POSTATTACH Macro
C++
#define DECLARE_CLIENT_RMI_POSTATTACH(name, params) DECLARE_RMI(name, params, eNRT_UnreliableOrdered, eRAT_PostAttach, false, false)
File

IGameObject.h

DECLARE_CLIENT_RMI_POSTATTACH_FAST Macro
C++
#define DECLARE_CLIENT_RMI_POSTATTACH_FAST(name, params) DECLARE_RMI(name, params, eNRT_UnreliableOrdered, eRAT_PostAttach, false, true)
File

IGameObject.h

DECLARE_CLIENT_RMI_PREATTACH Macro
C++
#define DECLARE_CLIENT_RMI_PREATTACH(name, params) DECLARE_RMI(name, params, eNRT_UnreliableOrdered, eRAT_PreAttach, false, false)
File

IGameObject.h

DECLARE_CLIENT_RMI_PREATTACH_FAST Macro
C++
#define DECLARE_CLIENT_RMI_PREATTACH_FAST(name, params) DECLARE_RMI(name, params, eNRT_UnreliableOrdered, eRAT_PreAttach, false, true)
File

IGameObject.h

DECLARE_CLIENT_RMI_URGENT Macro
C++
#define DECLARE_CLIENT_RMI_URGENT(name, params, reliability) DECLARE_CLIENT_RMI_NOATTACH(name, params, reliability)
File

IGameObject.h

DECLARE_IMPLEMENTATION_RMI Macro
C++
#define DECLARE_IMPLEMENTATION_RMI(name) \
    private: \
        INetAtSyncItem * Decode_##name( TSerialize, EntityId, INetChannel* ); \
        static bool Handle_##name( const Params_##name&, INetChannel* ); \
        static MethodInfo_##name m_info##name; \
    public: \
        const MethodInfo_##name& name() { return m_info##name; }
File

IGameObject.h

DECLARE_INTERFACE_CLIENT_RMI_POSTATTACH Macro
C++
#define DECLARE_INTERFACE_CLIENT_RMI_POSTATTACH(name, params, reliability) DECLARE_INTERFACE_RMI(name, params, reliability, eRAT_PostAttach, false, false)
File

IGameObject.h

DECLARE_INTERFACE_CLIENT_RMI_POSTATTACH_FAST Macro
C++
#define DECLARE_INTERFACE_CLIENT_RMI_POSTATTACH_FAST(name, params, reliability) DECLARE_INTERFACE_RMI(name, params, reliability, eRAT_PostAttach, false, true)
File

IGameObject.h

DECLARE_INTERFACE_CLIENT_RMI_PREATTACH Macro
C++
#define DECLARE_INTERFACE_CLIENT_RMI_PREATTACH(name, params, reliability) DECLARE_INTERFACE_RMI(name, params, reliability, eRAT_PreAttach, false, false)
File

IGameObject.h

DECLARE_INTERFACE_CLIENT_RMI_PREATTACH_FAST Macro
C++
#define DECLARE_INTERFACE_CLIENT_RMI_PREATTACH_FAST(name, params, reliability) DECLARE_INTERFACE_RMI(name, params, reliability, eRAT_PreAttach, false, true)
File

IGameObject.h

DECLARE_INTERFACE_RMI Macro
C++
#define DECLARE_INTERFACE_RMI(name, params, reliability, attachment, isServer, lowDelay) \
    protected: \
        static const ERMIAttachmentType Attach_##name = attachment; \
        static const bool ServerCall_##name = isServer; \
        static const ENetReliabilityType Reliability_##name = reliability; \
        static const bool LowDelay_##name = lowDelay; \
        typedef params Params_##name; \
    public: \
        struct MethodInfo_##name \
        { \
            MethodInfo_##name( const SGameObjectExtensionRMI * pMethodInfo ) { this->pMethodInfo = pMethodInfo; } \
            const SGameObjectExtensionRMI * pMethodInfo; \
            ILINE void Verify( const params& p ) const \
            { \
            } \
        }; \
        virtual const MethodInfo_##name& name() = 0
File

IGameObject.h

DECLARE_INTERFACE_SERVER_RMI_POSTATTACH Macro
C++
#define DECLARE_INTERFACE_SERVER_RMI_POSTATTACH(name, params, reliability) DECLARE_INTERFACE_RMI(name, params, reliability, eRAT_PostAttach, true, false)
File

IGameObject.h

DECLARE_INTERFACE_SERVER_RMI_POSTATTACH_FAST Macro
C++
#define DECLARE_INTERFACE_SERVER_RMI_POSTATTACH_FAST(name, params, reliability) DECLARE_INTERFACE_RMI(name, params, reliability, eRAT_PostAttach, true, true)
File

IGameObject.h

DECLARE_INTERFACE_SERVER_RMI_PREATTACH Macro
C++
#define DECLARE_INTERFACE_SERVER_RMI_PREATTACH(name, params, reliability) DECLARE_INTERFACE_RMI(name, params, reliability, eRAT_PreAttach, true, false)
File

IGameObject.h

DECLARE_INTERFACE_SERVER_RMI_PREATTACH_FAST Macro
C++
#define DECLARE_INTERFACE_SERVER_RMI_PREATTACH_FAST(name, params, reliability) DECLARE_INTERFACE_RMI(name, params, reliability, eRAT_PreAttach, true, true)
File

IGameObject.h

DECLARE_RMI Macro
C++
#define DECLARE_RMI(name, params, reliability, attachment, isServer, lowDelay) \
    public: \
        struct MethodInfo_##name \
        { \
            MethodInfo_##name( const SGameObjectExtensionRMI * pMethodInfo ) { this->pMethodInfo = pMethodInfo; } \
            const SGameObjectExtensionRMI * pMethodInfo; \
            ILINE void Verify( const params& p ) const \
            { \
            } \
        }; \
    private: \
        static INetAtSyncItem * Decode_##name( TSerialize, EntityId*, INetChannel* ); \
        bool Handle_##name( const params&, INetChannel* ); \
        static const ERMIAttachmentType Attach_##name = attachment; \
        static const bool ServerCall_##name = isServer; \
        static const ENetReliabilityType Reliability_##name = reliability; \
        static const bool LowDelay_##name = lowDelay; \
        typedef params Params_##name; \
        static MethodInfo_##name m_info##name; \
    public: \
        static const MethodInfo_##name& name() { return m_info##name; }
File

IGameObject.h

DECLARE_SERVER_RMI_INDEPENDENT Macro
C++
#define DECLARE_SERVER_RMI_INDEPENDENT(name, params, reliability) DECLARE_SERVER_RMI_NOATTACH(name, params, reliability)
File

IGameObject.h

Description
DECLARE_SERVER_RMI_NOATTACH Macro
C++
#define DECLARE_SERVER_RMI_NOATTACH(name, params, reliability) DECLARE_RMI(name, params, reliability, eRAT_NoAttach, true, false)
File

IGameObject.h

DECLARE_SERVER_RMI_NOATTACH_FAST Macro
C++
#define DECLARE_SERVER_RMI_NOATTACH_FAST(name, params, reliability) DECLARE_RMI(name, params, reliability, eRAT_NoAttach, true, true)
File

IGameObject.h

DECLARE_SERVER_RMI_POSTATTACH Macro
C++
#define DECLARE_SERVER_RMI_POSTATTACH(name, params) DECLARE_RMI(name, params, eNRT_UnreliableOrdered, eRAT_PostAttach, true, false)
File

IGameObject.h

DECLARE_SERVER_RMI_POSTATTACH_FAST Macro
C++
#define DECLARE_SERVER_RMI_POSTATTACH_FAST(name, params) DECLARE_RMI(name, params, eNRT_UnreliableOrdered, eRAT_PostAttach, true, true)
File

IGameObject.h

DECLARE_SERVER_RMI_PREATTACH Macro
C++
#define DECLARE_SERVER_RMI_PREATTACH(name, params) DECLARE_RMI(name, params, eNRT_UnreliableOrdered, eRAT_PreAttach, true, false)
File

IGameObject.h

Description

PreAttach/PostAttach RMI's cannot have their reliability specified (see CGameObjectDispatch::RegisterInterface() for details)

DECLARE_SERVER_RMI_PREATTACH_FAST Macro
C++
#define DECLARE_SERVER_RMI_PREATTACH_FAST(name, params) DECLARE_RMI(name, params, eNRT_UnreliableOrdered, eRAT_PreAttach, true, true)
File

IGameObject.h

Description

PreAttach/PostAttach RMI's cannot have their reliability specified (see CGameObjectDispatch::RegisterInterface() for details)

DECLARE_SERVER_RMI_URGENT Macro
C++
#define DECLARE_SERVER_RMI_URGENT(name, params, reliability) DECLARE_SERVER_RMI_NOATTACH(name, params, reliability)
File

IGameObject.h

IMPLEMENT_INTERFACE_RMI Macro
C++
#define IMPLEMENT_INTERFACE_RMI(cls, name) \
    cls::MethodInfo_##name cls::m_info##name = cls::Helper_AddMessage( &cls::Decode_##name, "RMI:" #cls ":" #name, cls::Attach_##name, cls::ServerCall_##name, cls::Reliability_##name, cls::LowDelay_##name ); \
    INetAtSyncItem * cls::Decode_##name( TSerialize ser, INetChannel * pChannel ) \
    { \
        Params_##name params; \
        params.SerializeWith( ser ); \
        return CRMIAtSyncItem::Create( params, id, m_info##name.pMethodInfo, &cls::Handle_##name, pChannel ); \
    } \
    ILINE bool cls::Handle_##name( const Params_##name& params, INetChannel* pNetChannel )
File

IGameObject.h

IMPLEMENT_RMI Macro
C++
#define IMPLEMENT_RMI(cls, name) \
    cls::MethodInfo_##name cls::m_info##name = cls::Helper_AddMessage( &cls::Decode_##name, "RMI:" #cls ":" #name, cls::Attach_##name, cls::ServerCall_##name, cls::Reliability_##name, cls::LowDelay_##name ); \
    INetAtSyncItem * cls::Decode_##name( TSerialize ser, EntityId * pID, INetChannel* pChannel ) \
    { \
        CRY_ASSERT(pID); \
        Params_##name params; \
        params.SerializeWith( ser ); \
        NetLogRMIReceived( params, pChannel ); \
        return CRMIAtSyncItem::Create( params, *pID, m_info##name.pMethodInfo, &cls::Handle_##name, pChannel ); \
    } \
    ILINE bool cls::Handle_##name( const Params_##name& params, INetChannel* pNetChannel )
File

IGameObject.h