how to calculate the ammount of times when a player leaves?

Discussion in 'Plugin Development' started by Minecraft93, Jun 20, 2011.

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

    Minecraft93

    How would i calculate the amount of times when a player joins/leaves? i was thinking of making it impossible for a player to leave the server or after 3 joins/leaves in 30 seconds banning the player for 10 min.
     
  2. Just listen to the PLAYER_JOIN and PLAYER_LEAVE events and store a counter for each player in a file.

    Umm, how are you planning on "making it impossible for a player to leave the server"?? Is he forced to stay connected forever? ;)
     
  3. Offline

    Minecraft93

    well to make it so he/she couldnt leave i was just gonna make like a cool down that forced them to stay on for a set time. if he/she force quits it would ban for a timed period
     
  4. I'm sorry but I don't see any sense in this. You obviously can't technically prevent anyone from quitting, and wouldn't it be really rude to tempban someone because he disconnects from the server? Maybe his client crashed or the battery of his laptop ran out ;)
    Well, you are likely to have your reasons to do that, I'm just curious :p
     
  5. Offline

    Minecraft93

    oh ok, if its not 100% worth it then i wont do that part. thanks for the help
     
  6. Offline

    Tagette

    If someone is reloging a lot you can warn them that they are reloging to much then after a certain amount of times it will block the user from the server for a specific amount of time.
     
  7. Offline

    Minecraft93

    Ok So i would have to create a flatfile for that. But how would i punish the player after a 3rd consecutive join/exit.
     
  8. Offline

    DrAgonmoray

    Use HashMaps and store the player name, and amount of times logged in. When they quit, checked if the amount of times logged in is greater than a certain number, and if so, ban them.
     
  9. Offline

    Minecraft93

    :eek: ok thanks.
     
Thread Status:
Not open for further replies.

Share This Page