Open 3D Engine GridMate API Reference  2205.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
Classes | Typedefs | Enumerations | Functions | Variables
GridMate Namespace Reference

Classes

class  BasicHostChunkDescriptor
 
class  BasicThrottle
 
class  BasicThrottle< AZ::Quaternion >
 
class  Carrier
 
class  CarrierACKCallback
 
struct  CarrierDesc
 
class  CarrierEvents
 
class  CarrierEventsBase
 
class  CompressionFactory
 
class  Compressor
 
struct  ConnectionCommon
 
class  ContainerMarshaler
 
class  ConversionMarshaler
 
class  CreateTimePriorityPolicy
 
class  CtorContextBase
 
class  DataSet
 
class  DataSetBase
 
struct  DataSetDefaultTraits
 Default DataSet callbacks traits. More...
 
struct  DataSetInvokeEverywhereTraits
 Turns on DataSet callbacks to be invoked on the primary replica as well as client replicas. More...
 
class  DefaultCarrier
 
class  DefaultHandshake
 
class  DefaultReplicaChunkDescriptor
 
class  DefaultSimulator
 
class  DefaultTrafficControl
 
class  Driver
 
class  DriverAddress
 
class  DriverEBusTraits
 
struct  DriverError
 
class  DriverEvents
 
class  EpsilonThrottle
 
class  EpsilonThrottle< AZ::Vector2 >
 
class  EpsilonThrottle< AZ::Vector3 >
 
class  EpsilonThrottle< AZ::Vector4 >
 
class  FixedTimeStep
 
class  Float16Marshaler
 
class  GridMateAllocator
 
class  GridMateAllocatorMP
 
struct  GridMateDesc
 
struct  GridMateEBusTraits
 
class  GridMateEvents
 
class  GridMateService
 
class  GridMember
 
class  GridSearch
 
class  GridSession
 
class  GridSessionCallbacks
 
struct  GridSessionParam
 
struct  GridSessionSearchParam
 
class  HalfMarshaler
 
class  Handshake
 
class  IGridMate
 
class  IntegerQuantizationMarshaler
 
class  IntegerQuantizationMarshaler< Min, Max, 1 >
 
class  IntegerQuantizationMarshaler< Min, Max, 2 >
 
class  IntegerQuantizationMarshaler< Min, Max, 4 >
 
struct  IsContainerMarshaler
 
struct  IsFixedMarshaler
 
struct  IsFundamentalMarshalType
 
class  IsMarshalerForType
 
struct  JoinParams
 
struct  LANSearchInfo
 
struct  LANSearchParams
 
struct  LANSessionParams
 
class  LANSessionService
 
class  LANSessionServiceInterface
 
class  LinearInterp
 
class  LinearInterpExtrap
 
class  MapContainerMarshaler
 
struct  MarshalContext
 
class  Marshaler
 
class  Marshaler< AZ::Aabb >
 
class  Marshaler< AZ::Color >
 
class  Marshaler< AZ::Crc32 >
 
class  Marshaler< AZ::Matrix3x3 >
 
class  Marshaler< AZ::Matrix4x4 >
 
class  Marshaler< AZ::Obb >
 
class  Marshaler< AZ::Plane >
 
class  Marshaler< AZ::Quaternion >
 
class  Marshaler< AZ::Transform >
 
class  Marshaler< AZ::Uuid >
 
class  Marshaler< AZ::Vector2 >
 
class  Marshaler< AZ::Vector3 >
 
class  Marshaler< AZ::Vector4 >
 
class  Marshaler< AZStd::bitset< Bits > >
 
class  Marshaler< AZStd::chrono::duration< Rep, Period > >
 
class  Marshaler< AZStd::pair< T1, T2 > >
 
class  Marshaler< bool >
 
class  Marshaler< EnumType, typename AZStd::Utils::enable_if_c< AZStd::is_enum< EnumType >::value >::type >
 
class  Marshaler< PackedSize >
 
class  Marshaler< Type, typename AZStd::Utils::enable_if_c< IsContainerMarshaler< Type >::Value >::type >
 
class  Marshaler< Type, typename AZStd::Utils::enable_if_c< IsFundamentalMarshalType< Type >::Value >::type >
 
class  MarshalerShim
 
struct  MemberID
 
class  NullPriorityPolicy
 
class  NullProcessPolicy
 
class  PackedSize
 
class  PeerAckCallbacks
 
struct  PeerFlags
 
class  PointSample
 
struct  PrepareDataResult
 
class  QuatCompMarshaler
 
class  QuatCompNormMarshaler
 
class  QuatCompNormQuantizedMarshaler
 
class  ReadBuffer
 
class  ReferenceCounted
 
class  Replica
 
class  ReplicaChunk
 
class  ReplicaChunkBase
 
class  ReplicaChunkDescriptor
 
class  ReplicaChunkDescriptorTable
 
struct  ReplicaChunkInitContext
 
struct  ReplicaChunkInterface
 
struct  ReplicaContext
 
class  ReplicaDestroyPeerTask
 
class  ReplicaManager
 
struct  ReplicaMarshalFlags
 
class  ReplicaMarshalTask
 
class  ReplicaMarshalTaskBase
 
class  ReplicaMarshalZombieTask
 
class  ReplicaMgrCallbacks
 
struct  ReplicaMgrDesc
 
struct  ReplicaObject
 
class  ReplicaPeer
 
class  ReplicaStatus
 
struct  ReplicaStatusInterface
 
class  ReplicaTarget
 
class  ReplicaTargetAutoDestroyList
 
class  ReplicaTask
 
class  ReplicaTaskManager
 
struct  ReplicationSecurityOptions
 
class  ReplicaUpdateDestroyedProxyTask
 
class  ReplicaUpdateTask
 
class  ReplicaUpdateTaskBase
 
class  RollingSum
 
class  Rpc
 
class  Rpc<>
 
struct  RpcArg
 
struct  RpcArgBase
 
struct  RpcAuthoritativeTraits
 
class  RpcBase
 
struct  RpcContext
 
struct  RpcDefaultTraits
 
struct  RpcUnreliable
 
struct  SampleInfo
 
struct  SearchInfo
 
struct  SearchParams
 
struct  SecurityError
 
class  SendLimitProcessPolicy
 
class  SendPriorityPolicy
 
struct  SessionIdInfo
 
struct  SessionParams
 
class  SessionService
 
class  SessionServiceBusTraits
 
struct  SessionServiceDesc
 
struct  SimpleValueInterpolator
 
class  Simulator
 
class  SocketAddressInfo
 
class  SocketDriver
 
class  SocketDriverAddress
 
class  SocketDriverCommon
 
struct  StatisticsData
 
class  StreamSocketDriver
 
class  StreamSocketDriverEventsInterface
 
class  TargetCallback
 
class  TargetCallbackBase
 
struct  TimeContext
 
class  TrafficControl
 
class  TransformCompressor
 
struct  UnmarshalContext
 
class  Vec2CompMarshaler
 
class  Vec3CompMarshaler
 
class  Vec3CompNormMarshaler
 
class  VlqU32Marshaler
 
class  VlqU64Marshaler
 
class  VoiceChatServiceInterface
 
class  WriteBuffer
 
class  WriteBufferDynamic
 
class  WriteBufferStatic
 
class  WriteBufferStaticInPlace
 

Typedefs

typedef AZ::EBus< CarrierEventsCarrierEventBus
 
using CompressorType = AZ::u32
 
typedef AZ::EBus< DriverEvents, DriverEBusTraitsDriverEventBus
 
using SocketErrorBuffer = AZStd::array< char, 32 >
 
typedef AZ::EBus< StreamSocketDriverEventsInterfaceStreamSocketDriverEventsBus
 
typedef AZ::u16 SequenceNumber
 
template<class T , class Allocator = SysContAlloc>
using list = AZStd::list< T, Allocator >
 
template<class T , class Container = AZStd::deque<T, SysContAlloc>>
using queue = AZStd::queue< T, Container >
 
template<class Key , class MappedType , class Hasher = AZStd::hash<Key>, class EqualKey = AZStd::equal_to<Key>, class Allocator = SysContAlloc>
using unordered_map = AZStd::unordered_map< Key, MappedType, Hasher, EqualKey, Allocator >
 
template<class Key , class MappedType , class Hasher = AZStd::hash<Key>, class EqualKey = AZStd::equal_to<Key>, class Allocator = SysContAlloc>
using unordered_multimap = AZStd::unordered_multimap< Key, MappedType, Hasher, EqualKey, Allocator >
 
template<class Key , class Hasher = AZStd::hash<Key>, class EqualKey = AZStd::equal_to<Key>, class Allocator = SysContAlloc>
using unordered_set = AZStd::unordered_set< Key, Hasher, EqualKey, Allocator >
 
template<class Key , class Hasher = AZStd::hash<Key>, class EqualKey = AZStd::equal_to<Key>, class Allocator = SysContAlloc>
using unordered_multiset = AZStd::unordered_multiset< Key, Hasher, EqualKey, Allocator >
 
template<class T , class Allocator = SysContAlloc>
using vector = AZStd::vector< T, Allocator >
 
typedef AZ::EBus< GridMateEventsGridMateEventsBus
 
typedef AZ::AZStdAlloc< GridMateAllocatorGridMateStdAlloc
 GridMate system container allocator.
 
typedef AZ::AZStdAlloc< GridMateAllocatorMPSysContAlloc
 GridMate system container allocator.
 
typedef AZStd::fixed_vector< ReplicaChunkInitContext, 8 > ReplicaChunkInitContextStack
 
typedef AZStd::intrusive_ptr< ReplicaReplicaPtr
 
typedef AZStd::intrusive_ptr< ReplicaChunkBaseReplicaChunkPtr
 
using CallbackBuffer = AZStd::vector< AZStd::weak_ptr< TargetCallbackBase > >
 
typedef AZ::u16 ReplicaPriority
 
typedef AZ::u32 ReplicaId
 
typedef ReplicaId RepIdSeed
 
typedef ReplicaId CmdId
 
typedef AZ::Crc32 ReplicaChunkClassId
 
typedef AZ::u32 PeerId
 
typedef AZ::u32 ZoneMask
 
typedef unordered_map< ReplicaId, ReplicaObjectReplicaMap
 
typedef AZStd::intrusive_multiset< ReplicaObject, AZStd::intrusive_multiset_base_hook< ReplicaObject > > ReplicaTimeSet
 
typedef list< ReplicaPeer * > ReplicaPeerList
 
typedef AZ::EBus< ReplicaMgrCallbacksReplicaMgrCallbackBus
 
typedef ReplicaTargetAutoDestroyList< ReplicaTarget, AZStd::list_member_hook< ReplicaTarget, &ReplicaTarget::m_replicaHook > > ReplicaTargetList
 
typedef ReplicaTargetAutoDestroyList< ReplicaTarget, AZStd::list_member_hook< ReplicaTarget, &ReplicaTarget::m_peerHook > > PeerTargetList
 
typedef AZ::EBus< LANSessionServiceInterfaceLANSessionServiceBus
 
typedef AZ::u32 MemberIDCompact
 
typedef AZStd::string SessionID
 
typedef AZ::EBus< GridSessionCallbacksSessionEventBus
 
typedef ConnectionCommonConnectionID
 Carrier connection identifier.
 
typedef AZ::u32 VersionType
 
typedef AZStd::chrono::system_clock::time_point TimeStamp
 
typedef AZ::u32 GridMateServiceId
 
typedef AZ::EBus< VoiceChatServiceInterfaceVoiceChatServiceBus
 

Enumerations

enum  CarrierErrorCode : int { CarrierErrorCode::EC_DRIVER = 0, CarrierErrorCode::EC_SECURITY }
 
enum  CarrierDisconnectReason : AZ::u8 {
  CarrierDisconnectReason::DISCONNECT_USER_REQUESTED = 0, CarrierDisconnectReason::DISCONNECT_BAD_CONNECTION, CarrierDisconnectReason::DISCONNECT_BAD_PACKETS, DISCONNECT_DRIVER_ERROR,
  DISCONNECT_HANDSHAKE_REJECTED, DISCONNECT_HANDSHAKE_TIMEOUT, CarrierDisconnectReason::DISCONNECT_WAS_ALREADY_CONNECTED, CarrierDisconnectReason::DISCONNECT_SHUTTING_DOWN,
  DISCONNECT_DEBUG_DELETE_CONNECTION, CarrierDisconnectReason::DISCONNECT_VERSION_MISMATCH, CarrierDisconnectReason::DISCONNECT_MAX
}
 
enum  CompressorError { CompressorError::Ok, CompressorError::InsufficientBuffer, CompressorError::CorruptData }
 
enum  HandshakeErrorCode : int { OK = 0, REJECTED, PENDING, VERSION_MISMATCH }
 
enum  ReservedIds : ReplicaId {
  Invalid_Cmd_Or_Id, Cmd_Greetings, Cmd_NewProxy, Cmd_DestroyProxy,
  Cmd_NewOwner, Cmd_Heartbeat, Cmd_Count, RepId_SessionInfo,
  Max_Reserved_Cmd_Or_Id
}
 Crc32.
 
enum  RemotePeerMode : AZ::u8 { Mode_Undefined, Mode_Peer, Mode_Client }
 
enum  SessionTopology : AZ::u8 { ST_INVALID, ST_CLIENT_SERVER, ST_PEER_TO_PEER, ST_CLIENT_SERVER_DISTRIBUTED }
 
enum  GridSessionSearchOperators : AZ::u8 {
  GridSessionSearchOperators::SSO_OPERATOR_EQUAL = 1, GridSessionSearchOperators::SSO_OPERATOR_NOT_EQUAL, GridSessionSearchOperators::SSO_OPERATOR_LESS_THAN, GridSessionSearchOperators::SSO_OPERATOR_LESS_EQUAL_THAN,
  GridSessionSearchOperators::SSO_OPERATOR_GREATER_THAN, GridSessionSearchOperators::SSO_OPERATOR_GREATER_EQUAL_THAN
}
 
enum  EndianType { BigEndian, LittleEndian, IgnoreEndian }
 
enum  NatType : AZ::u8 { NAT_UNKNOWN = 0, NAT_OPEN, NAT_MODERATE, NAT_STRICT }
 
enum  ServiceType : int {
  ST_LAN, ST_PROVO, ST_SALEM, ST_STEAM,
  ST_JASPER, ST_MAX
}
 

Functions

bool SequenceNumberIsSequential (SequenceNumber a, SequenceNumber b)
 
SequenceNumber SequenceNumberSequentialDistance (SequenceNumber a, SequenceNumber b)
 
bool SequenceNumberGreaterThan (SequenceNumber a, SequenceNumber b)
 
bool SequenceNumberGreaterEqualThan (SequenceNumber a, SequenceNumber b)
 
bool SequenceNumberLessThan (SequenceNumber a, SequenceNumber b)
 
template<class ServiceType , class ... Args>
ServiceTypeStartGridMateService (IGridMate *gridMate, Args &&... args)
 
template<class ServiceType >
void StopGridMateService (IGridMate *gridMate)
 
template<class ServiceType >
bool HasGridMateService (IGridMate *gridMate)
 
IGridMateGridMateCreate (const GridMateDesc &desc)
 Create GridMate interface object. You are allowed to have only one active at a time. More...
 
void GridMateDestroy (IGridMate *gridMate)
 Destroys and frees all GridMate resources.
 
AZ_FORCE_INLINE int encode_float_as_int (float v)
 
AZ_FORCE_INLINE float decode_float_as_int (int v)
 
AZ_FORCE_INLINE AZ::u32 encode_int_as_uint (AZ::s32 val)
 
AZ_FORCE_INLINE AZ::s32 decode_int_as_uint (AZ::u32 val)
 
template<class ChunkType , class ... Args>
ChunkType * CreateReplicaChunk (Args &&... args)
 
template<class ChunkType , class ... Args>
ChunkType * CreateAndAttachReplicaChunk (const ReplicaPtr &replica, Args &&... args)
 
template<class ChunkType , class ... Args>
ChunkType * CreateAndAttachReplicaChunk (Replica *replica, Args &&... args)
 
template<typename T >
void SafeGuardRead (ReadBuffer *, T function)
 
template<typename T >
void SafeGuardWrite (WriteBuffer *, T function)
 
template<class T , class ... Args>
void WaitReplicaTask (const ReplicaTask::RunContext &context, Args &&... args)
 
template<typename T >
void InPlaceNetworkEndian (T &data, EndianType endianType)
 
AZ_FORCE_INLINE bool operator== (const PackedSize &lhs, const PackedSize &rhs)
 
AZ_FORCE_INLINE bool operator!= (const PackedSize &lhs, const PackedSize &rhs)
 
AZ_FORCE_INLINE bool operator> (const PackedSize &lhs, const PackedSize &rhs)
 
AZ_FORCE_INLINE bool operator< (const PackedSize &lhs, const PackedSize &rhs)
 
AZ_FORCE_INLINE bool operator>= (const PackedSize &lhs, const PackedSize &rhs)
 
AZ_FORCE_INLINE bool operator<= (const PackedSize &lhs, const PackedSize &rhs)
 
AZ_FORCE_INLINE PackedSize operator- (const PackedSize &lhs, const PackedSize &rhs)
 
AZ_FORCE_INLINE PackedSize operator+ (const PackedSize &lhs, const PackedSize &rhs)
 

Variables

static const SequenceNumber SequenceNumberMax = 0xffff
 
static const SequenceNumber SequenceNumberHalfSpan = SequenceNumberMax / 2
 
static const ReplicaId InvalidReplicaId = 0
 
static const PeerId InvalidReplicaPeerId = 0
 
static const ReplicaPriority k_replicaPriorityRealTime = 0xFFFF
 
static const ReplicaPriority k_replicaPriorityHighest = 0xFFFE
 
static const ReplicaPriority k_replicaPriorityHigh = 0xC000
 
static const ReplicaPriority k_replicaPriorityNormal = 0x8000
 
static const ReplicaPriority k_replicaPriorityLow = 0x4000
 
static const ReplicaPriority k_replicaPriorityLowest = 0x0000
 
static const ZoneMask ZoneMask_All = (ZoneMask) - 1
 
static const float kDegreesPerQuantizedValue = 1.40625
 
const EndianType kSessionEndian
 
static const ConnectionID AllConnections = reinterpret_cast<const ConnectionID>(-1)
 
static const ConnectionID InvalidConnectionID = NULL
 

Detailed Description

Simple task manager system to execute replica related work (e.g. Marshaling) in ordered manner. Used to avoid execution of unnecessary work. E.g. only execute marshaling for replicas that require to be forwarded to another peer.

Typedef Documentation

◆ ZoneMask

typedef AZ::u32 GridMate::ZoneMask

A user customisable set of flags that are used to logically separate the different node types within the network topology.

Enumeration Type Documentation

◆ CarrierDisconnectReason

enum GridMate::CarrierDisconnectReason : AZ::u8
strong

Reasons for a disconnect callback to be called.

Enumerator
DISCONNECT_USER_REQUESTED 

The user requested to close the connection.

DISCONNECT_BAD_CONNECTION 

Traffic conditions are bad to maintain a connection.

DISCONNECT_BAD_PACKETS 

We received invalid data packets.

DISCONNECT_WAS_ALREADY_CONNECTED 

A connection was initiated while the previous was never closed (properly). As a result the connection will be closed on both sides to synchronize. If you initiated this connection, you should make sure you closed the previous properly and if so you can retry to connect, which will most likely succeed. Since both sides are in sync.

DISCONNECT_SHUTTING_DOWN 

Carrier is shutting down. You should not have connection at this time to begin with.

DISCONNECT_VERSION_MISMATCH 

Attempting to connect to a different application version.

DISCONNECT_MAX 

Must be last for internal reasons.

◆ CarrierErrorCode

enum GridMate::CarrierErrorCode : int
strong

Carrier error codes

Enumerator
EC_DRIVER 

Driver layer error.

EC_SECURITY 

Carrier layer Security error.

◆ CompressorError

Collection of compression related error codes

Enumerator
Ok 

No error, operation finished successfully.

InsufficientBuffer 

Buffer size is insufficient for the operation to complete, increase the size and try again.

CorruptData 

Malformed or hacked packet, potentially security issue.

◆ GridSessionSearchOperators

Enumerator
SSO_OPERATOR_EQUAL 

(==)

SSO_OPERATOR_NOT_EQUAL 

(!=)

SSO_OPERATOR_LESS_THAN 

(<)

SSO_OPERATOR_LESS_EQUAL_THAN 

(<=)

SSO_OPERATOR_GREATER_THAN 

(>)

SSO_OPERATOR_GREATER_EQUAL_THAN 

(>=)

◆ ServiceType

Different on line service types.

Note
if a platform supports multiple you can switch them, but you need to first stop all currently running services.

◆ SessionTopology

Enumerator
ST_INVALID 

Invalid topology, waiting for the host to deliver it's topology data.

ST_CLIENT_SERVER 

Standard client server. When a user joins he will be connected to the server only.

ST_PEER_TO_PEER 

Standard peer to peer. When a user joins he will connect to all other users.

ST_CLIENT_SERVER_DISTRIBUTED 

Client server mode, where client can have the replica/data ownership.

Function Documentation

◆ CreateAndAttachReplicaChunk() [1/2]

template<class ChunkType , class ... Args>
ChunkType* GridMate::CreateAndAttachReplicaChunk ( const ReplicaPtr &  replica,
Args &&...  args 
)

Create a ReplicaChunk that is automatically attached to the replica.

◆ CreateAndAttachReplicaChunk() [2/2]

template<class ChunkType , class ... Args>
ChunkType* GridMate::CreateAndAttachReplicaChunk ( Replica replica,
Args &&...  args 
)

Create a ReplicaChunk that is automatically attached to the replica.

◆ CreateReplicaChunk()

template<class ChunkType , class ... Args>
ChunkType* GridMate::CreateReplicaChunk ( Args &&...  args)

Create a ReplicaChunk that isn't attached to a Replica. To attach it to a replica, call replica->AttachReplicaChunk(chunk).

◆ GridMateCreate()

IGridMate* GridMate::GridMateCreate ( const GridMateDesc desc)

Create GridMate interface object. You are allowed to have only one active at a time.

◆ StartGridMateService()

template<class ServiceType , class ... Args>
ServiceType* GridMate::StartGridMateService ( IGridMate gridMate,
Args &&...  args 
)

Helper function to start service of given type and register it with GridMate. Newly created service instance will be owned by GridMate.

Variable Documentation

◆ kDegreesPerQuantizedValue

const float GridMate::kDegreesPerQuantizedValue = 1.40625
static

Compressed normalized Quaternion Marshaler uses 1-4 bytes by converting to Euler angles. Angles are quantized to angle * (360/255) and stored in a single byte. A leading byte is used to indicate when are 0, or 1 and do not need to be sent in the data.