Example #1
0
        /// <summary>
        /// Sends a chat message to the player
        /// </summary>
        /// <param name="player"></param>
        /// <param name="message"></param>
        /// <param name="prefix"></param>
        public void Message(IMyPlayer player, string message, string prefix = null)
        {
            if (string.IsNullOrEmpty(message))
            {
                return;
            }

            var msg = new ChatMsg
            {
                Text   = string.IsNullOrEmpty(prefix) ? message : (string.IsNullOrEmpty(message) ? prefix : $"{prefix}: {message}"),
                Author = Sync.ServerId
            };

            MyMultiplayerBase.SendChatMessage(ref msg);
        }