public static void ProcessClient(byte[] data) { if (MyAPIGateway.Utilities.IsDedicated /*|| (!MyAPIGateway.Utilities.IsDedicated && MyAPIGateway.Multiplayer.IsServer)*/) { return; } //This converts your data back to the original type you had before you sent //Depending on what you sent, you may need to parse it back into something usable var receivedData = MyAPIGateway.Utilities.SerializeFromBinary <RailgunTracerData>(data); RailgunCore.DrawProjectileClient(receivedData); }
public static void SendToClients(RailgunTracerData data) { //Below, save your data to string or some other serializable type var sendData = MyAPIGateway.Utilities.SerializeToBinary(data); //Send the message to the ID you registered in Setup, and specify the user via SteamId bool sendStatus = MyAPIGateway.Multiplayer.SendMessageToOthers(NetID, sendData); if (!MyAPIGateway.Utilities.IsDedicated && MyAPIGateway.Multiplayer.IsServer) { RailgunCore.DrawProjectileClient(data); } }