public void SoftKickUser(uint UserId, bool Forced = false, bool NotifyUser = false, bool OverrideOwner = false) { RoomActor Actor = GetActorByReferenceId(UserId); if (Actor == null || Actor.Type != RoomActorType.UserCharacter) { return; } Session ActorSession = SessionManager.GetSessionByCharacterId(Actor.ReferenceId); if (ActorSession != null) { if (!OverrideOwner && CheckUserRights(ActorSession, true)) { return; // this is the room owner or a moderator, no kicking allowed! } if (NotifyUser) { ActorSession.SendData(GenericErrorComposer.Compose(4008)); } } Actor.LeaveRoom(Forced); }
private static void UserExit(Session Session, ClientMessage Message) { RoomInstance Instance = RoomManager.GetInstanceByRoomId(Session.CurrentRoomId); if (Instance == null) { return; } RoomActor Actor = Instance.GetActorByReferenceId(Session.CharacterId); if (Actor == null) { return; } Actor.LeaveRoom(); }