コード例 #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)
            {
                player.HasSilverCrown = true;
            }

            SilverCrownEvent silverCrownEvent = new SilverCrownEvent()
            {
                Raw    = message,
                Player = player
            };

            connectionBase.RaiseServerEvent <SilverCrownEvent>(silverCrownEvent);
        }
コード例 #2
0
        private void On(SilverCrownEvent e)
        {
            var p = e.Player;

            p.HasSilverCrown = true;
        }