// Send Chat ChatIC.Message public bool SendMessage(string txt) { Racon.RtiLayer.HlaInteraction interaction = new Racon.RtiLayer.HlaInteraction(Som.ChatIC, "Chat"); // Add Values interaction.AddParameterValue(Som.ChatIC.Sender, NickName); // String interaction.AddParameterValue(Som.ChatIC.Message, txt); // String // Other Types interaction.AddParameterValue(Som.ChatIC.TimeStamp, DateTime.Now); // DateTime //interaction.AddParameterValue(Som.ChatIC.TimeStamp, 1); // int, long //interaction.AddParameterValue<double>(Som.ChatIC.TimeStamp, 5.5); // double //interaction.AddParameterValue(Som.ChatIC.TimeStamp, 1.6f); // float //interaction.AddParameterValue<uint>(Som.ChatIC.TimeStamp, 1); // uint // Enums //interaction.AddParameterValue(this.ChatIC.TimeStamp, (uint)StatusTypes.READY); // Alternative use // update parameter values //Som.ChatIC.Sender.AddValue(NickName); // Add parameters //interaction.AddParameter(Som.ChatIC.Sender); // Send interaction return(SendInteraction(interaction, Tags.SendReceive)); }
// Send Chat ChatIC.Message with Timestamp public Racon.RtiLayer.MessageRetraction SendMessage(string txt, double ts) { Racon.RtiLayer.HlaInteraction interaction = new Racon.RtiLayer.HlaInteraction(Som.ChatIC, "Chat"); // Add Values interaction.AddParameterValue(Som.ChatIC.Sender, NickName); interaction.AddParameterValue(Som.ChatIC.Message, txt); interaction.AddParameterValue(Som.ChatIC.TimeStamp, DateTime.Now); // Enums //interaction.AddParameterValue(this.ChatIC.TimeStamp, (uint)StatusTypes.READY); // Send interaction return(SendInteraction(interaction, ts)); }
// Send radio message public bool SendMessage(string txt) { HlaInteraction interaction = new Racon.RtiLayer.HlaInteraction(Som.RadioMessageIC, "RadioMessage"); // Add Values interaction.AddParameterValue(Som.RadioMessageIC.Callsign, manager.ShipObjects[0].Ship.Callsign); // String interaction.AddParameterValue(Som.RadioMessageIC.Message, txt); // String interaction.AddParameterValue(Som.RadioMessageIC.TimeStamp, DateTime.Now); // DateTime //interaction.AddParameterValue(Som.RadioMessageIC.TimeStamp, 1); // int, long //interaction.AddParameterValue<double>(Som.RadioMessageIC.TimeStamp, 5.5); // double //interaction.AddParameterValue(Som.RadioMessageIC.TimeStamp, 1.6f); // float //interaction.AddParameterValue<uint>(Som.RadioMessageIC.TimeStamp, 1); // uint //interaction.AddParameterValue(this.ChatIC.TimeStamp, (uint)StatusTypes.READY);// Enums // Send interaction return(SendInteraction(interaction)); }
public bool SendMessage(string s) { try { Racon.RtiLayer.HlaInteraction interaction = new Racon.RtiLayer.HlaInteraction(federate.Som.MessageIC, "Content"); interaction.AddParameterValue(federate.Som.MessageIC.Content, "Human_" + s); return(federate.SendInteraction(interaction, "")); } catch { return(false); } }
// Send radio message public bool SendMessage(string txt, double timestamp) { HlaInteraction interaction = new Racon.RtiLayer.HlaInteraction(Som.RadioMessageIC, "RadioMessage"); // Add Values interaction.AddParameterValue(Som.RadioMessageIC.Callsign, Program.StationObjects[0].StationName); // String interaction.AddParameterValue(Som.RadioMessageIC.Message, txt); // String interaction.AddParameterValue(Som.RadioMessageIC.TimeStamp, DateTime.Now); // DateTime // Send interaction with timestamp try { //SendInteraction(interaction); MessageRetraction handle = SendInteraction(interaction, timestamp); Retract(handle); return(true); } catch (Exception) { return(false); } }