/// <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); } }
private void OnCrown(CrownEvent e) { if (!this.JoinComplete) { this.JoinComplete = true; new JoinCompleteEvent() .RaiseIn(this.BotBits); } }
private void On(CrownEvent e) { this.CrownPlayer = e.Player; }