コード例 #1
0
 public void HandleConsoleMessage(ClientStructure client, ChatConsoleMsgData message)
 {
     if (client.Authenticated && AdminCommands.Retrieve().Contains(client.PlayerName))
     {
         CommandHandler.HandleServerInput(message.Message);
     }
 }
コード例 #2
0
        public static void SendConsoleMessageToAdmins(string text)
        {
            var admins = AdminCommands.Retrieve();

            foreach (var client in ClientRetriever.GetAuthenticatedClients().Where(c => admins.Contains(c.PlayerName)))
            {
                var messageData = new ChatConsoleMsgData
                {
                    From    = GeneralSettings.SettingsStore.ConsoleIdentifier,
                    Message = text
                };

                MessageQueuer.SendToClient <ChatSrvMsg>(client, messageData);
            }
        }