Networking*

Overview

The Networking abstraction attempts to unify basic networking features between the different platforms. This includes sending and receiving files between users, marking users that are in multiplayer mode, as well as checking if a user is logged in and has access to multiplayer services on the platform.

Since functionality varies between different platforms, some platform specific functions are required to facilitate the abstraction.

Networking Service Functions

CloseSession

Closes a network session opened with SendPacket between the local user and the specified account.

PlatformsSteam
APICry::GamePlatform::INetworking::CloseSession
Flow Graph NodesGamePlatform:Network:CloseSession
Schematyc NodesFunction::GamePlatform::Service::Networking::CloseSession

FilterText

Censors/filters the specified text on the platform. The output is limited to once per frame.

This is useful for chat censoring; some platforms require you to censor chats depending on the region or rating of a game.

The output may not trigger on the same frame.
PlatformsSteam
APICry::GamePlatform::IService::FilterText
Flow Graph NodesGamePlatform:Network:FilterText
Schematyc NodesFunction::GamePlatform::Service::Networking::FilterText

GetAuthToken

Retrieves the authorization token used for web services on the specified platform.

PlatformsSteam
APICry::GamePlatform::IService::GetAuthToken
Flow Graph NodesGamePlatform:Network:AuthToken
Schematyc NodesFunction::GamePlatform::Service::Networking::GetAuthToken

IsLoggedIn

Checks if the platform is logged in and access to the backend is available.

PlatformsSteam
APICry::GamePlatform::IService::IsLoggedIn
Flow Graph NodesGamePlatform:Network:IsLoggedIn
Schematyc NodesFunction::GamePlatform::Service::Networking::IsLoggedIn

IsPacketAvailable

Checks if there is a data packet available via the platform network and if so, returns the size of the data.

This data is also binary. This means that if you read the data as a string, you may miss part of the data (binary can contain a binary zero, which for strings just means the end of the string).

PlatformsSteam
APICry::GamePlatform::INetworking::IsPacketAvailable
Flow Graph NodesGamePlatform:Network:IsPacketAvailable
Schematyc NodesFunction::GamePlatform::Service::Networking::IsPacketAvailable

ReadPacket

Tries to read the next packet payload. The output of this function would be the Source Account Identifier, the data that was read (can be a string or binary buffer, depending on if C++ API/Flow Graph or Schematyc is used), and the number of bytes that was read from the packet.

The whole packet might have to be read multiple times until the total number of bytes read is equal to the size of the packet (obtained via IsPacketAvailable).

PlatformsSteam
APICry::GamePlatform::INetworking::ReadPacket
Flow Graph NodesGamePlatform:Network:ReadPacket
Schematyc NodesFunction::GamePlatform::Service::Networking::ReadPacket

SendPacket

Sends the data packet to the specified account via the platform network.

This is the counter function to ReadPacket; only packets that are sent can be read. One user will send data via SendPacket to another, who can then check for IsPacketAvailable and then read data using ReadPacket.

PlatformsSteam
APICry::GamePlatform::INetworking::SendPacket
Flow Graph NodesGamePlatform:Network:SendPacket
Schematyc NodesFunction::GamePlatform::Service::Networking::SendPacket

Networking Service Events

OnCheckMultiplayerAccess

Fired when aa multiplayer access check request receives a response.

PlatformsSteam
APIN/A (callback provided to Cry::GamePlatform::IService::CanAccessMultiplayer)
Flow Graph NodesN/A (uses provided callback to activate output directly)
Schematyc Nodes Signal::Receive::[EntityName]::Accounts::PlatformSignalReceiver::Networking::OnCheckMultiplayerAccess

OnGetSteamAuthTicketResponse

Fired when a Steam Authentication token request receives a response.

PlatformsSteam
APICry::GamePlatform::IService::IListener::OnGetSteamAuthTicketResponse
Flow Graph NodesGamePlatform:Listener:Networking:OnGetSteamAuthTicketResponse
Schematyc NodesSignal::Receive::[EntityName]::Accounts::PlatformSignalReceiver::Networking::OnGetSteamAuthTicketResponse