Exemple #1
0
 /// <summary>
 /// Fired when an avatar leaves the world
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The e.</param>
 static void AvatarEventRemove(BotEngine sender, EventAvatarRemoveArgs e)
 {
     // Wait 5 seconds, before the leave message is sent. The message will not be send if the avatar reenters the world within that time.
     // This is to prevent message flooding.
     sender.ConsoleMessage(5000, SessionArgumentType.AvatarSessionMustNotExist,
                           e.Avatar, System.Drawing.Color.DarkSlateGray, true, false, string.Format("{0} has left {1}.", e.Avatar.Name, sender.LoginConfiguration.Connection.World));
 }
Exemple #2
0
        /// <summary>
        /// Fired when an avatar leaves the world
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The e.</param>
        void AvatarEventRemove(BotEngine sender, EventAvatarRemoveArgs e)
        {
            var query  = from AvatarStatus p in _statusList where p.Avatar.Citizen == e.Avatar.Citizen select p;
            var status = query.Single();

            status.LastSeen = DateTime.Now;
            _db.Store(status);
            _db.Commit();
            _statusList.Remove(status);
        }
Exemple #3
0
 /// <summary>
 /// Handles the avatar event remove.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The e.</param>
 static void HandleAvatarEventRemove(BotEngine sender, EventAvatarRemoveArgs e)
 {
     ConsoleHelpers.WriteLine(string.Format("Avatar {0} with session {1} has been removed.", e.Avatar.Name, e.Avatar.Session));
     // the rest is now running in the gbot plugin.
 }
Exemple #4
0
 /// <summary>
 /// Fired when an avatar leaves the world. It removes the color setting from the in memory generic list.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The e.</param>
 private void AvatarEventRemove(BotEngine sender, EventAvatarRemoveArgs e)
 {
     _settings.Remove((from AvatarColorChatSetting p in _settings where p.Citizen == e.Avatar.Citizen select p).Single());
 }