Ejemplo n.º 1
0
 // Method to initiate host of a streamer
 private void hostStreamer(Host streamer)
 {
     Common.ChatClient.SendMessage(string.Format(".host {0}", streamer.Streamer));
     currentHost = streamer;
     if (defaultMinuteLimit - curMinute < (defaultMinuteLimit - 1))
         curMinute -= defaultMinuteLimit - (defaultMinuteLimit - curMinute);
 }
Ejemplo n.º 2
0
 // Function that is run on first host, returns true if successful, false if failed
 private bool firstHost()
 {
     switch (startType)
     {
         case StartType.RANDOM:
             Common.ChatClient.SendMessage("Multihost started. Discovering a random online multihost streamer...", Common.DryRun);
             List<Host> onlineHosts = WebCalls.getOnlineMultihostStreamers(hosts).Result;
             if (onlineHosts.Count != 0)
             {
                 currentHost = onlineHosts[new Random().Next(0, onlineHosts.Count - 1)];
                 if (currentHost.Information != "")
                     Common.ChatClient.SendMessage(string.Format("We'll kick things off with '{0}'. {1}", currentHost.Streamer, currentHost.Information), Common.DryRun);
                 else
                     Common.ChatClient.SendMessage(string.Format("We'll kick things off with '{0}'.", currentHost.Streamer), Common.DryRun);
                 Common.ChatClient.SendMessage(multihostInfo);
             } else
             {
                 Common.ChatClient.SendMessage("No online hosts detected.  Multihost random function failed.", Common.DryRun);
                 return false;
             }
             break;
         case StartType.SET_HOST:
             foreach (Host streamer in hosts)
             {
                 if (streamer.Streamer.ToLower() == setHostName.ToLower())
                 {
                     currentHost = streamer;
                     if (streamer.Information != "")
                         Common.ChatClient.SendMessage(string.Format("Multihost started with '{0}'. {1}", streamer.Streamer, streamer.Information), Common.DryRun);
                     else
                         Common.ChatClient.SendMessage(string.Format("Multihost started with '{0}'.", streamer.Streamer), Common.DryRun);
                     currentHost = streamer;
                     hostStreamer(streamer);
                     return true;
                 }
             }
             Host newHost = new Host(setHostName, "");
             hosts.Add(newHost);
             currentHost = newHost;
             Common.ChatClient.SendMessage(string.Format("Multihost started with '{0}'.", newHost.Streamer), Common.DryRun);
             hostStreamer(newHost);
             Common.ChatClient.SendMessage(multihostInfo);
             break;
         case StartType.MANUAL:
             Common.ChatClient.SendMessage(string.Format("Multihost started, remaining on the current host! Use !extend to extend the host by {0} minutes. Use !remaining to see how many minutes remain in the host!", extendDuration), Common.DryRun);
             break;
     }
     return true;
 }