コード例 #1
0
 void Events_BotStateChangedEvent(BotShell bot, BotStateChangedArgs e)
 {
     if (e.State == 0)
     {
         bot.SendOrganizationMessage(bot.ColorHighlight + bot.Character + " has connected!");
     }
 }
コード例 #2
0
ファイル: vh_ChatLogger.cs プロジェクト: deathlef/VhaBot
 private void Events_BotStateChangedEvent(BotShell bot, BotStateChangedArgs e)
 {
     if (e.IsSlave)
     {
         if (e.State == BotState.Connected)
         {
             this.Output("State", String.Format("[Slave Bot] {0} has connected", e.Character));
         }
         else if (e.State == BotState.Disconnected)
         {
             this.Output("State", String.Format("[Slave Bot] {0} has disconnected", e.Character));
         }
     }
     else
     {
         if (e.State == BotState.Connected)
         {
             this.Output("State", String.Format("[Main Bot] {0} has connected", e.Character));
         }
         else if (e.State == BotState.Disconnected)
         {
             this.Output("State", String.Format("[Main Bot] {0} has disconnected", e.Character));
         }
     }
 }
コード例 #3
0
 private void BotStateChangedEvent(BotShell sender, BotStateChangedArgs e)
 {
     if (e.State != BotState.Connected)
     {
         lock (this.OnlineFriends)
         {
             List <UInt32> remove = new List <UInt32>();
             foreach (KeyValuePair <UInt32, Friend> kvp in this.OnlineFriends)
             {
                 if (e.IsSlave)
                 {
                     if (kvp.Value.OnSlave && kvp.Value.BotID == e.ID)
                     {
                         remove.Add(kvp.Value.UserID);
                     }
                 }
                 else
                 if (!kvp.Value.OnSlave)
                 {
                     remove.Add(kvp.Value.UserID);
                 }
             }
             foreach (UInt32 userID in remove)
             {
                 lock (this.OfflineFriends)
                 {
                     this.OfflineFriends.Add(userID, this.OnlineFriends[userID]);
                     this.OnlineFriends.Remove(userID);
                 }
             }
         }
     }
 }
コード例 #4
0
 internal void OnBotStateChanged(BotShell bot, BotStateChangedArgs e)
 {
     if (this.BotStateChangedEvent != null)
     {
         try { this.BotStateChangedEvent(bot, e); }
         catch { }
     }
 }
コード例 #5
0
 private void Events_BotStateChangedEvent(BotShell bot, BotStateChangedArgs e)
 {
     if (e.IsSlave)
     {
         return;
     }
     if (e.State == BotState.Connected)
     {
         bot.SendPrivateChannelMessage(bot.ColorHighlight + "System »» Online");
     }
 }
コード例 #6
0
ファイル: vh_PrivateGroup.cs プロジェクト: deathlef/VhaBot
 private void Events_BotStateChangedEvent(BotShell bot, BotStateChangedArgs e)
 {
     if (e.IsSlave)
     {
         return;
     }
     if (e.State != BotState.Connected)
     {
         return;
     }
     this._timer.Start();
 }
コード例 #7
0
ファイル: raid_Members.cs プロジェクト: deathlef/VhaBot
 private void Events_BotStateChangedEvent(BotShell sender, BotStateChangedArgs e)
 {
 }