Esempio n. 1
0
        /// <summary>
        /// Handles the bot event enters world.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The e.</param>
        void HandleBotEventEntersWorld(BotEngine sender, EventBotEntersWorldArgs e)
        {
            _sw1.Stop();
            // start receiving avatar events.
            sender.AvatarEventAdd    += HandleAvatarEventAdd;
            sender.AvatarEventRemove += HandleAvatarEventRemove;

            ConsoleHelpers.WriteLine(string.Format("[{0}] Entered world {1} in {2} ms.", e.ConnectionProperties.LoginName, e.ConnectionProperties.World, _sw1.ElapsedMilliseconds));
            _sw1.Reset();
            sender.ObjectEventScanCompleted += HandleObjectEventScanCompleted;
            ConsoleHelpers.Write("Scanning objects...");
            _sw1.Start();
            sender.ScanObjects();
        }