Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added ajqueue.make-room permission (disabled by default)
- Loading branch information
1 parent
0b715ca
commit 0c7769f
Showing
8 changed files
with
179 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
api/src/main/java/us/ajg0702/queue/api/ServerTimeManager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package us.ajg0702.queue.api; | ||
|
||
import us.ajg0702.queue.api.players.AdaptedPlayer; | ||
|
||
public interface ServerTimeManager { | ||
/** | ||
* Gets the time that the player specified was last seen switching servers | ||
* @param player The player to check | ||
* @return The time that they last switched servers, in miliseconds since midnight, January 1, 1970, UTC | ||
*/ | ||
long getLastServerChange(AdaptedPlayer player); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
common/src/main/java/us/ajg0702/queue/common/ServerTimeManagerImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package us.ajg0702.queue.common; | ||
|
||
import us.ajg0702.queue.api.ServerTimeManager; | ||
import us.ajg0702.queue.api.players.AdaptedPlayer; | ||
|
||
import java.util.Map; | ||
import java.util.UUID; | ||
import java.util.concurrent.ConcurrentHashMap; | ||
|
||
public class ServerTimeManagerImpl implements ServerTimeManager { | ||
|
||
Map<UUID, Long> serverSwitches = new ConcurrentHashMap<>(); | ||
|
||
|
||
@Override | ||
public long getLastServerChange(AdaptedPlayer player) { | ||
return serverSwitches.get(player.getUniqueId()); | ||
} | ||
|
||
public void playerChanged(AdaptedPlayer player) { | ||
serverSwitches.put(player.getUniqueId(), System.currentTimeMillis()); | ||
} | ||
|
||
public void removePlayer(AdaptedPlayer player) { | ||
serverSwitches.remove(player.getUniqueId()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters