示例#1
0
        /// <summary>
        /// Processes the message
        /// </summary>
        /// <param name="connectionBase">The connection base</param>
        /// <param name="message">The playerio message</param>
        /// <param name="handled">Whether the message was already handled</param>
        public void Process(ConnectionBase connectionBase, Message message, bool handled)
        {
            int userId = message.GetInt(0);

            WorldConnection worldCon = (WorldConnection)connectionBase;
            WorldPlayer     player   = worldCon.Players.GetPlayer(userId);

            if (!handled && player != null)
            {
                if (worldCon.CrownHolder != null)
                {
                    worldCon.CrownHolder.HasCrown = false;
                }

                player.HasCrown      = true;
                worldCon.CrownHolder = player;
            }

            if (player != null)
            {
                CrownEvent crownEvent = new CrownEvent()
                {
                    Raw    = message,
                    Player = player
                };

                connectionBase.RaiseServerEvent <CrownEvent>(crownEvent);
            }
        }
示例#2
0
 private void OnCrown(CrownEvent e)
 {
     if (!this.JoinComplete)
     {
         this.JoinComplete = true;
         new JoinCompleteEvent()
         .RaiseIn(this.BotBits);
     }
 }
示例#3
0
 private void On(CrownEvent e)
 {
     this.CrownPlayer = e.Player;
 }