Kick command proposal

Discussions About CyanWorlds.com Engine Client & Plugin
User avatar
JWPlatt
Member
Posts: 1099
Joined: Sun Dec 07, 2008 7:32 pm
Location: Everywhere, all at once

Re: Kick command proposal

Post by JWPlatt » Tue Jun 12, 2012 2:35 am

Uninvite is more descriptive. Revoke what? People normally use "invite." Even the previous post mixes the metaphor with "revoke their invites". /uninvite FTW.
Perfect speed is being there.

Deledrius
Member
Posts: 95
Joined: Sun Dec 28, 2008 6:29 pm

Re: Kick command proposal

Post by Deledrius » Tue Jun 12, 2012 2:55 am

I forgot there even was an invite command (is there?). I always use the KI... *shudder*

User avatar
D'Lanor
Member
Posts: 142
Joined: Tue Dec 23, 2008 11:23 pm

Re: Kick command proposal

Post by D'Lanor » Tue Jun 12, 2012 10:12 am

I implemented the invite revocation because it was specified during the long discussions about kicking last year. I can implement this so that it only revokes the invitation for the age one is kicked from. That would make more sense IMO.

User avatar
Hoikas
Member
Posts: 286
Joined: Fri Jun 03, 2011 8:38 pm

Re: Kick command proposal

Post by Hoikas » Tue Jun 12, 2012 10:03 pm

I have completed work on PtKickClient in my fork of the H'uru codebase. The kick message will work properly for any two clients on MOSS or Cyan Server shards that understand it. I will have to write a reader for DirtSand. I will port to CWE-ou soon.

Some things I added since I last talked about the command... Specifying a client that is not in the age (or yourself) will raise a ValueError. Also, on receipt of a kick message, the kicked client will display a status message [You have been kicked by (kicker) ("reason")], then link out approximately one second later. The delay is to ensure that the kicked player has an opportunity to grok why they faded out of the age.
Image

User avatar
D'Lanor
Member
Posts: 142
Joined: Tue Dec 23, 2008 11:23 pm

Re: Kick command proposal

Post by D'Lanor » Tue Jun 12, 2012 11:42 pm

I did some work on the Python code earlier today but it is not in my repo yet because I wanted to make sure I'm calling the function as intended. I see you have addressed the first comment in my code with that ValueError which I am adding to the Python code now. Would this be the correct way to call the function?

Code: Select all

        if chatmessage.lower().startswith('/kick'):
            (pid, msg) = self.IGetPIDMsg(chatmessage[len('/kick'):])
            if pid:
                # Age player list check removed. Make sure the client code checks this!
                # We don't want to kick anyone from a different age if a KI# was entered.
                if len(msg):
                    msg = msg.strip()
                else:
                    msg = None
                # The actual kick
                try:
                    result = PtKickClient(pid, msg)
                except NameError:
                    # Function was not implemented
                    return 
                except ValueError:
                    # Player in different age
                    return 
                if (not result):
                    return 
                self.IAddRTChat(None, "Player kicked", 0)
                # Kick was successful. Now revoke visitor privileges to this age if needed.
                AgeName = PtGetAgeName()
                # For sub ages we must substitute the main age (hard-coded unfortunately).
                if (AgeName == 'Ahnonay'):
                    AgeName = 'AhnonayCathedral'
                if (AgeName == 'ErcanaCitySilo'):
                    AgeName = 'Ercana'
                AgesIOwnFolder = ptVault().getAgesIOwnFolder()
                contents = AgesIOwnFolder.getChildNodeRefList()
                for content in contents:
                    link = content.getChild()
                    link = link.upcastToAgeLinkNode()
                    if (type(link) == type(None)):
                        continue
                    AgeInfo = link.getAgeInfo()
                    if (type(AgeInfo) != type(None)):
                        if (AgeInfo.getAgeFilename() == AgeName):
                            CanVisitFolder = AgeInfo.getCanVisitFolder()
                            if CanVisitFolder.playerlistHasPlayer(pid):
                                self.IRevokeToVisit(pid, AgeInfo)
                                self.IAddRTChat(None, "Player's visitation to this age removed", 0)
                            break

            return None

User avatar
Hoikas
Member
Posts: 286
Joined: Fri Jun 03, 2011 8:38 pm

Re: Kick command proposal

Post by Hoikas » Wed Jun 13, 2012 12:16 am

That is indeed correct. The function will also accept the ptKey of a remote client as well, but I doubt you'll need to utilize that. Also, the msg argument is optional.
Image

User avatar
Ehren
Member
Posts: 31
Joined: Sun Feb 05, 2012 7:20 am

Re: Kick command proposal

Post by Ehren » Wed Jun 13, 2012 12:28 am

D'Lanor, would you consider having the /kick command just kick people out of the age and NOT doing anything with invitations? Why make it so complicated? If they don't want the kicked player to come back, then they can manually do the uninviting (or have this uninviting thing as a separate command).

There might be some cases that someone wants to kick a player, but not get rid of that player's invitations. What if you wanted to kick someone who was just afk too long in one of your ages, or any reason other than actually disliking that person. Granted, it would probably be rare... but one would hope the need of this command at all would be rare.

User avatar
D'Lanor
Member
Posts: 142
Joined: Tue Dec 23, 2008 11:23 pm

Re: Kick command proposal

Post by D'Lanor » Wed Jun 13, 2012 9:19 am

Ehren wrote:D'Lanor, would you consider having the /kick command just kick people out of the age and NOT doing anything with invitations? Why make it so complicated? If they don't want the kicked player to come back, then they can manually do the uninviting (or have this uninviting thing as a separate command).

There might be some cases that someone wants to kick a player, but not get rid of that player's invitations. What if you wanted to kick someone who was just afk too long in one of your ages, or any reason other than actually disliking that person. Granted, it would probably be rare... but one would hope the need of this command at all would be rare.
This was a feature request during the discussions which received a fair amount of support. I don't remember seeing any objections back then so I implemented it. You know as well as I do that if we wait for community consensus nothing will ever get done around here. ;)

I have now made it so that only the kicked player's visitation to the age he/she was kicked from will be removed. The kicker will receive a notification of this. I think this is a good compromise.

User avatar
D'Lanor
Member
Posts: 142
Joined: Tue Dec 23, 2008 11:23 pm

Re: Kick command proposal

Post by D'Lanor » Wed Jun 13, 2012 5:55 pm

A new /kick command is now available in my BitBucket repo. Essentially the same as posted above but with a few error messages added.

User avatar
JWPlatt
Member
Posts: 1099
Joined: Sun Dec 07, 2008 7:32 pm
Location: Everywhere, all at once

Re: Kick command proposal

Post by JWPlatt » Wed Jun 13, 2012 9:07 pm

FYI - I thought it would be prudent to see if this particular feature is worthwhile to consider for MOULa - managed expectations and all that. Chogon says it sounds okay.
Perfect speed is being there.

Post Reply

Return to “CyanWorlds.com Engine - Client & Plugin”

Who is online

Users browsing this forum: No registered users and 1 guest