class MultipeerNetworkingFactory (Niantic.ARDK.Networking.MultipeerNetworkingFactory)

Overview

A class to create new MultipeerNetworking instances as well as to be notified of their creation. More...

class MultipeerNetworkingFactory {
public:
    // properties

    ArdkEventHandler<AnyMultipeerNetworkingInitializedArgs> NetworkingInitialized;
    IReadOnlyCollection<IMultipeerNetworking> Networkings;

    // methods

    static IMultipeerNetworking Create(Guid stageIdentifier = default(Guid));

    static IMultipeerNetworking Create(
        RuntimeEnvironment env,
        Guid stageIdentifier = default(Guid)
    );

    static IMultipeerNetworking Create(
        RuntimeEnvironment env,
        ServerConfiguration serverConfiguration,
        Guid stageIdentifier = default(Guid)
    );

    static IMultipeerNetworking Create(
        ServerConfiguration serverConfiguration,
        Guid stageIdentifier = default
    );
};

Detailed Documentation

A class to create new MultipeerNetworking instances as well as to be notified of their creation.

Properties

ArdkEventHandler<AnyMultipeerNetworkingInitializedArgs> NetworkingInitialized

Event called when a new MultipeerNetworking instance is initialized.

IReadOnlyCollection<IMultipeerNetworking> Networkings

A collection of all current networking stacks.

Methods

static IMultipeerNetworking Create(Guid stageIdentifier = default(Guid))

Create a MultipeerNetworking appropriate for the current device.

On a mobile device, the attempted order will be LiveDevice, Remote, and finally Mock. In the Unity Editor, the attempted order will be Remote, then Mock.

Parameters:

stageIdentifier

The identifier used by the C++ library to connect all related components.

Returns:

The created MultipeerNetworking, or throws if it was not possible to create a session.

static IMultipeerNetworking Create(
    RuntimeEnvironment env,
    Guid stageIdentifier = default(Guid)
)

Create a MultipeerNetworking with the specified RuntimeEnvironment.

Parameters:

env

The env used to create the MultipeerNetworking.

stageIdentifier

The identifier used by the C++ library to connect all related components.

Returns:

The created MultipeerNetworking, or throws if it was not possible to create a session.

static IMultipeerNetworking Create(
    RuntimeEnvironment env,
    ServerConfiguration serverConfiguration,
    Guid stageIdentifier = default(Guid)
)

Create a MultipeerNetworking with the specified RuntimeEnvironment.

Parameters:

env

The env used to create the MultipeerNetworking.

serverConfiguration

The ServerConfiguration that this MultipeerNetworking will use to communicate with ARBEs

stageIdentifier

The identifier used by the C++ library to connect all related components.

Returns:

The created MultipeerNetworking, or throws if it was not possible to create a session.