Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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

CanAccessMultiplayer

Sends an asynchronous request to check whether the platform can access multiplayer services at this time.

PlatformsPlayStation, XboxAPICry::GamePlatform::IService::CanAccessMultiplayerFlow Graph NodesGamePlatform:Network:CanAccessMultiplayerSchematyc NodesFunction::GamePlatform::Service::Networking::CheckMultiplayerAccess

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. 

Info

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


Note
The output may not trigger on the same frame.


PlatformsSteam, PlayStation, Xbox
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, PlayStation, Xbox
APICry::GamePlatform::IService::GetAuthToken
Flow Graph NodesGamePlatform:Network:AuthToken
Schematyc NodesFunction::GamePlatform::Service::Networking::GetAuthToken

GetConnectionStatus

Retrieves the connection status of the service for the specified platform.

PlayStation, Xbox
Platforms
APICry::GamePlatform::IService::GetConnectionStatus
Flow Graph NodesGamePlatform:Network:ConnectionStatus
Schematyc NodesFunction::GamePlatform::Service::Networking::GetConnectionStatus

IsLoggedIn

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

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

IsPacketAvailable
Anchor
ispacketavailable
ispacketavailable

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

Note

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.

Info

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.

Anchor
sendpacket
sendpacket

Info

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

SetIsInMultiplayer

Used to tell the platform service that multiplayer platform features are being used.

PlatformsPlayStation
APICry::GamePlatform::IService::SetIsInMultiplayer
Flow Graph NodesGamePlatform:Network:SetIsInMultiplayer
Schematyc NodesFunction::GamePlatform::Service::Networking::SetIsInMultiplayer

Networking Service Events

OnAuthTokenReceived

Fired when an authorization token request receives a response.

PlatformsPlayStation, Xbox

APICry::GamePlatform::IService::IListener::OnAuthTokenReceivedFlow Graph NodesGamePlatform:Listener:Networking:OnAuthTokenReceivedSchematyc NodesSignal::Receive::[EntityName]::Accounts::PlatformSignalReceiver::Networking::OnAuthTokenReceived

OnCheckMultiplayerAccess

Fired when aa multiplayer access check request receives a response.

PlatformsSteam, PlayStation, Xbox
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

OnLogInStateChanged

Fired when the local user's login state changes.

PlatformsPlayStationAPICry::GamePlatform::IService::IListener::OnLogInStateChangedFlow Graph NodesGamePlatform:Listener:Networking:OnLogInStateChangedSchematyc NodesSignal::Receive::[EntityName]::Accounts::PlatformSignalReceiver::Networking::OnLogInStateChanged

OnNetworkStatusChanged

Fired when the local user network status changes.

PlatformsPlayStation, Xbox
APICry::GamePlatform::IService::IListener::OnNetworkStatusChanged
Flow Graph NodesGamePlatform:Listener:Networking:OnNetworkStatusChanged
Schematyc NodesSignal::Receive::[EntityName]::Accounts::PlatformSignalReceiver::Networking::OnNetworkStatusChanged


On This Page

Table of Contents
excludeOn This Page