Filled UniqueLastSeen

Discussion in 'Plugin Requests' started by madtomic, Oct 30, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    madtomic

    Suggested name: UniqueLastSeen

    What I want: What I need is a plugin that broadcast when...

    - When a new player joins the server for the first time and show unique logins.
    - How many total player logins we had so far.
    - How long it's been since a player was seen on the server.

    The message comes up after player had login with AuthMeReloaded.

    First login, show NEWPLAYERJOIN and HITS_MESSSAGE.
    Return login, show JOINDAYS/HOURS/MINUTES and HITS_MESSSAGE.

    config.yml
    NEWPLAYERJOIN: '&eWelcome, &b&player &eto our server! We have had&b &unique&e unique visitors.'
    HITS_MESSSAGE: '&eWe have &6&count players logged into our server so far!'
    JOINDAYS: '&eWelcome back, &b&player&e. Last seen &timeday and &timehour ago.'
    JOINHOURS: '&eWelcome back, &b&player&e. Last seen &timehour and &timeminute ago.'
    JOINMINUTES: '&eWelcome back, &b&player&e. Last seen &timeminute and &timesecond ago.'

    A flatfile to track player login and logout time. Support UUID as well as playername

    Requirement:

    No commands or permissions needed.

    Build against 1.7.10 and hook with AuthMeReloaded.

    When I'd like it by: When you have time to code this!

    Thanks,
    madtomic
     
    Last edited: Nov 1, 2015
  2. Offline

    Scimiguy

    This plugin already exists, I've seen it everywhere

    I just don't know the name
     
  3. Offline

    madtomic

    I know what you mean but they are not hook into authmereloaded or have delay.
     
  4. Offline

    oceantheskatr

    @madtomic Is your server in offline mode?
     
  5. Offline

    madtomic

    No, online mode.
     
  6. Offline

    oceantheskatr

  7. Offline

    madtomic

    Extra security and anti bots!
     
    Last edited: Nov 1, 2015
  8. Offline

    madtomic

    I just changed and updated the plugin request! I hope someone is able to do this! Thanks
     
  9. Offline

    grrocks

    Plugin category: EXAMPLE

    Suggested name: ExamplePlugin

    What I want: I'd like to see perhaps properly formatted posts, or at least an attempt beyond the average all caps scrawl that has come to dominate this forum. What people need to learn is that it's much easier to read a nicely formatted post, even if it's a bit longer than it needs to be, you can easily identify key points via proper formatting.

    Also, skim-reading is much easier with paragraphs!

    Ideas for commands: No commands needed for this plugin.

    Ideas for permissions: player.canread. Set it to false if they can't read this post.

    When I'd like it by: Yesterday.

    please use this format for all your posts soooo much nicer to read
     
  10. Offline

    oceantheskatr

    @grrocks OP used nearly that exact (non-mandatory) format... How is what they said not good enough? :p
     
  11. Offline

    grrocks

    He edited:p I just find this so much easier to read to see if im able to make it really quick or not
     
  12. Offline

    oceantheskatr

    @grrocks Haha lol! I didn't see the last edited time stamp, been looking at too many plugin requests to remember what this one looked like :p
     
  13. Offline

    madtomic

    Yes, I edited it.
     
  14. @madtomic
    Hi. I decided to finish another plugin. It's currently 3:42 am so my brain isn't probably working the best but the plugin should work fine :)
    Download | Source

    Default config:
    Code:
    joinMessage: '&eWelcome back, &b{player}&e. Last seen {timeday} day[s], {timehour} hour[s], {timeminute} minute[s] and {timesecond} second[s] ago.'
    newJoinMessage: '&eWelcome, &b{player} &eto our server! We have had &b{unique} &eunique visitors.'
    If you're wondering about the "[ s ]" (ignore spaces), it just makes it grammatically a bit more correct by adding an "s" to the end of the word if the value is 0 or greater than 1. For example, I have images of the both messages here:

    New player join message:
    Show Spoiler

    Existing player join message:
    Show Spoiler

    I decided not to include the "hits" message since you can already see the unique players in the "new player join" message. I can change this if you want. I also include the full time in 1 message since last login, instead of using 3 different messages based on the time since they've last logged in. I can change this too if you want.

    The player quit dates are saved in an YAML file called "players" within the plugin directory.
    Code:
    e8899118-3de2-4c39-a7f6-c7fbc3af7da0:
      name: PremiumSound
      lastQuit: 1446687644898
    lastQuit is the time in milliseconds when they quit the server. I use this value to see when they last played on the server.

    Compiled in Java 1.7, built using craftbukkit 1.7.10.

    Edit: You said "hook with AuthMeReloaded". If the plugin has an API, then sure. What do you want me to do with the hook though?
    Edit 2: I probably misunderstood the "hits". Is this the current amount of players on the server and not the total amount of unique players?
     
    Last edited: Nov 4, 2015
  15. Offline

    madtomic

    @Assist

    Edit: You said "hook with AuthMeReloaded". If the plugin has an API, then sure. What do you want me to do with the hook though?

    Yes, The message should load after player had /login into the server. As this is what I will be using to greet the players when they login in.

    https://github.com/Xephi/AuthMeReloaded

    Edit 2: I probably misunderstood the "hits". Is this the current amount of players on the server and not the total amount of unique players?


    What I wanted was to show total players had logged in before. Like non-unique logins.

    newjoin: Welcome, playername to our server! We had 6 unique visitors and 25 players had logged into our server!

    join: Welcome back, playername. Last seen 0 days, 0 hours, 0 minutes and 11 seconds ago. We had 26 players had logged into our server!

    Thank you as always!
     
  16. @madtomic
    I've added the AuthMe hook (using AuthMe-5.0-beta3 for craftbukkit 1.8.1). If the plugin is able to hook to AuthMe (aka the plugin is found in the plugins directory), then AuthMe hook will be enabled. If this is enabled, it overrides the default and custom join messages created by this plugin, and instead these will be broadcasted when players finish registering or logging in.

    I've also added the online player count to the join messages:
    Show Spoiler

    You may want to remove the AuthMe welcome message if you haven't already.

    New default config:
    Code:
    joinMessage: '&eWelcome back, &b{player}&e. Last seen {timeday} day[s], {timehour} hour[s], {timeminute} minute[s] and {timesecond} second[s] ago. We now have {players} player[s] online right now!'
    newJoinMessage: '&eWelcome, &b{player} &eto our server! We have had &b{unique} &eunique visitors and {players} player[s] online right now!'
    If you'd like the player count to be in a separate message rather than being appended to the join message, then just ask me and I'll do it :).

    Download here.

    Edit: Updated download to possibly fix a maybe-non-existent issue.
     
    Last edited: Nov 5, 2015
  17. Offline

    madtomic

    You may want to remove the AuthMe welcome message if you haven't already.

    Gotcha!

    If you'd like the player count to be in a separate message rather than being appended to the join message, then just ask me and I'll do it :).

    What you had is fine but maybe add &n for newline if someone choose to use it?

    Change: The joinMessage is a bit long I think. Would it be possible to detect time and output a shorter message?

    JOINDAYS: '&eWelcome back, &b{player}&e. Last seen {timeday} day and {timehour} hour ago. We now have {players} player online right now!'
    JOINHOURS: '&eWelcome back, &b{player}&e. Last seen {timehour} hour and {timeminute} minute ago. We now have {players} player online right now!'
    JOINMINUTES: &eWelcome back, &b{player}&e. Last seen {timeminute} minute and {timesecond} second ago. We now have {players} player online right now!'
     
  18. Will do!

    I'm assuming that the plugin would choose which of these messages to use based on the last time they've played? So if they've been gone for over 24 hours, it would display JOINDAYS?
     
  19. Offline

    madtomic

    I'm assuming that the plugin would choose which of these messages to use based on the last time they've played? So if they've been gone for over 24 hours, it would display JOINDAYS?

    You are correct!

    One more thing. The plugin don't work unless AuthmeReloaded is installed.

    Maybe have option to use it or not?
     
  20. @madtomic
    Oops. That was an option, but apparently I didn't do something correctly. I'll fix this now and redo the messages after.

    Edit: Took a while because I was eating. Everything should be done now. I've tested it with and without AuthMe and it worked. I didn't add the line break for player count because you didn't seem to need it.
    Download.
     
    Last edited: Nov 5, 2015
  21. Offline

    madtomic

    @Assist

    Thank you for making this! This is a wrap!
     
Thread Status:
Not open for further replies.

Share This Page