Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Sandbox.ModAPI.Ingame.IMyIntergridCommunicationSystem

Morten Aune Lyrstad edited this page May 8, 2022 · 25 revisions

IndexNamespace Index

IMyIntergridCommunicationSystem Interface

public interface IMyIntergridCommunicationSystem

This is the entry point for all communication operations.

Namespace: Sandbox.ModAPI.Ingame
Assembly: Sandbox.Common.dll

Properties

long Me { get; }

Gets communication address for current programmable block.

IMyUnicastListener UnicastListener { get; }

Gets unicast listener for current programmable block.

Methods

void DisableBroadcastListener(IMyBroadcastListener broadcastListener)

Disables given broadcast listener. In case given broadcast listener is not active nothing happens. Instance of this broadcast listener remains valid and all pending messages may be accepted as normal. Disabling broadcast listener also disables it's message callback, if active. Consuming the last pending message will permanently disable the provided listener and it's never going to be activated again. ==> Registering new broadcast lister with the same tag will allocate new listener instance instead.

void GetBroadcastListeners(List<IMyBroadcastListener> broadcastListeners, Func<IMyBroadcastListener, bool> collect = null)

Retrieves list of all active broadcast listeners and listeners with pending messages, registered by current programmable block. Returned list is snapshot of current state and is not updated by future operations.

bool IsEndpointReachable(long address, TransmissionDistance transmissionDistance = TransmissionDistance.AntennaRelay)

Determines if given endpoint is currently reachable. Similar to sending ICMP message.

IMyBroadcastListener RegisterBroadcastListener(string tag)

Registers broadcast listener with given tag for current programmable block. In case there is already another active broadcast lister with given tag new listener is NOT registered and the already active one is returned instead.

void SendBroadcastMessage<TData>(string tag, TData data, TransmissionDistance transmissionDistance = TransmissionDistance.AntennaRelay)

bool SendUnicastMessage<TData>(long addressee, string tag, TData data)

Clone this wiki locally