public bool SendMessageTo(ushort id, byte[] message, ulong recipient, bool reliable) { if (message.Length > MAX_MESSAGE_SIZE) { return(false); } if (reliable) { MyMultiplayerMain.RaiseStaticEvent(s => MyMultiplayer.ModMessageClientReliable, id, message, recipient, new EndpointId(recipient)); } else { MyMultiplayerMain.RaiseStaticEvent(s => MyMultiplayer.ModMessageClientUnreliable, id, message, recipient, new EndpointId(recipient)); } return(true); }
public bool SendMessageToServer(ushort id, byte[] message, bool reliable) { if (message.Length > MAX_MESSAGE_SIZE) { return(false); } if (reliable) { MyMultiplayerMain.RaiseStaticEvent(s => MyMultiplayer.ModMessageServerReliable, id, message, Sync.ServerId); } else { MyMultiplayerMain.RaiseStaticEvent(s => MyMultiplayer.ModMessageServerUnreliable, id, message, Sync.ServerId); } return(true); }
public bool SendMessageToOthers(ushort id, byte[] message, bool reliable) { if (message.Length > MAX_MESSAGE_SIZE) { return(false); } if (reliable) { MyMultiplayerMain.RaiseStaticEvent(s => MyMultiplayer.ModMessageBroadcastReliable, id, message); } else { MyMultiplayerMain.RaiseStaticEvent(s => MyMultiplayer.ModMessageBroadcastUnreliable, id, message); } return(true); }
public static void SendScriptedChatMessage(ref ScriptedChatMsg msg) { MyMultiplayer.RaiseStaticEvent(s => MyMultiplayerBase.OnScriptedChatMessageRecieved, msg); }
protected static void SendChatMessage(ref ChatMsg msg) { MyMultiplayer.RaiseStaticEvent(s => MyMultiplayerBase.OnChatMessageRecieved, msg); }
static MyMultiplayer() { Static = new MyMultiplayer(); SyncObject = new MyMultiplayerSyncObject(); }
void IReplicationServerCallback.SendVoxelCacheInvalidated(string storageName, EndpointId endpoint) { Vector3D?position = null; MyMultiplayer.RaiseStaticEvent <string>(s => new Action <string>(MyMultiplayerClientBase.InvalidateVoxelCacheClient), storageName, endpoint, position); }
public void SendPendingReplicablesDone(Endpoint endpoint) { Vector3D?position = null; MyMultiplayer.RaiseStaticEvent(s => new Action(MyMultiplayerClientBase.ReceivePendingReplicablesDone), endpoint.Id, position); }
static MyMultiplayer() { Static = new MyMultiplayer(); }
public static void TeleportControlledEntity(Vector3D location) { MyMultiplayer.RaiseStaticEvent(x => OnTeleport, MySession.Static.LocalHumanPlayer.Id.SteamId, location); }