Ejemplo n.º 1
0
        public static bool RemoveUserFromSpace(Session Session, bool SendKick = true)
        {
            bool flag            = false;
            uint absoluteSpaceId = Session.AbsoluteSpaceId;

            if (absoluteSpaceId > 0)
            {
                if (Session.SpaceJoined)
                {
                    SpaceInstance instanceBySpaceId = GetInstanceBySpaceId(absoluteSpaceId);
                    if (instanceBySpaceId != null)
                    {
                        instanceBySpaceId.RemoveCharacterFromSpace(Session.CharacterId);
                    }
                }
                Session.AbsoluteSpaceId = 0;
                Session.SpaceAuthed     = false;
                Session.SpaceJoined     = false;
                LaptopHandler.MarkUpdateNeeded(Session, 0, false);
                flag = true;
            }
            if (SendKick)
            {
                Session.SendData(SpaceUserRemovedComposer.SingleCompose());
            }
            return(flag);
        }