Esempio n. 1
0
 public IEnumerator <float> UpdateStatus()
 {
     for (;;)
     {
         ProcessSTT.SendData($"updateStatus {PlayerManager.players.Count}/{ConfigFile.ServerConfig.GetInt("max_players")}", 0);
         yield return(Timing.WaitForSeconds(5f));
     }
 }
        public static void HandleQueuedItems()
        {
            while (ProcessSTT.dataQueue.TryDequeue(out SerializedData.SerializedData result))
            {
                string command = result.Data;
                Log.Debug($"STT: Received {result.Data} for {result.Port} at {result.Channel}", Plugin.Singleton.Config.Debug);


                if (result.Data == "ping")
                {
                    Log.Debug("STT: Heartbeat received.", Plugin.Singleton.Config.Debug);
                    ProcessSTT.SendData("ping", 0);
                    return;
                }

                if (result.Data == "set gameid")
                {
                    //GameLogChannelId = result.Channel;
                    Log.Debug($"STT: GameLogChannelId changed: {result.Channel}", Plugin.Singleton.Config.Debug);
                    return;
                }

                if (result.Data == "set cmdid")
                {
                    //CommandLogChannelId = result.Channel;
                    Log.Debug($"STT: CommandLogChannelId changed: {result.Channel}", Plugin.Singleton.Config.Debug);
                    return;
                }

                if (result.Data == "set bansid")
                {
                    //PunishmentsLogChannelId = result.Channel;
                    Log.Debug($"STT: PunishmentsLogChannelId changed: {result.Channel}", Plugin.Singleton.Config.Debug);
                    return;
                }

                if (result.Data.StartsWith("setgroup"))
                {
                    string[] args = result.Data.Split(' ');
                    Methods.SetSyncRole(args[2], args[1]);
                }

                ChannelId = result.Channel;

                try
                {
                    command = command.Substring(1);
                    GameCore.Console.singleton.TypeCommand($"/{command}", new BotSender(result.Name));
                }
                catch (Exception e)
                {
                    Log.Error(e.ToString());
                }
            }
        }
Esempio n. 3
0
 public override void Print(string text)
 {
     ProcessSTT.SendData($"{text}", HandleQueue.ChannelId);
 }
Esempio n. 4
0
 public override void RaReply(string text, bool success, bool logToConsole, string overrideDisplay)
 {
     ProcessSTT.SendData($"{text}", HandleQueue.ChannelId);
 }