public class Session extends Object
Includes:
Following data can be derived from Sessions in the database (Between any time span):
Constructor and Description |
---|
Session(int id,
long sessionStart,
long sessionEnd,
int mobKills,
int deaths)
Re-Creates a session data object for viewing.
|
Session(long sessionStart,
String world,
String gm)
Creates a new session with given start and end of -1.
|
Modifier and Type | Method and Description |
---|---|
void |
changeState(String world,
String gm,
long time)
Updates WorldTimes state.
|
void |
died() |
void |
endSession(long endOfSession)
Ends the session with given end point.
|
boolean |
equals(Object o) |
int |
getDeaths() |
long |
getLength()
Get the length of the session in milliseconds.
|
int |
getMobKills() |
List<PlayerKill> |
getPlayerKills() |
long |
getSessionEnd()
Get the end of the session.
|
int |
getSessionID()
Used to get the ID of the session in the Database.
|
long |
getSessionStart()
Get the start of the session.
|
WorldTimes |
getWorldTimes() |
int |
hashCode() |
boolean |
isFetchedFromDB() |
void |
mobKilled() |
void |
playerKilled(PlayerKill kill) |
void |
setPlayerKills(List<PlayerKill> playerKills) |
void |
setSessionID(int sessionID) |
void |
setWorldTimes(WorldTimes worldTimes) |
static Session |
start(long time,
String world,
String gm)
Starts a new Session.
|
String |
toString() |
public Session(long sessionStart, String world, String gm)
sessionStart
- Epoch millisecond the session was started.public Session(int id, long sessionStart, long sessionEnd, int mobKills, int deaths)
sessionStart
- Epoch millisecond the session was started.sessionEnd
- Epoch millisecond the session ended.public static Session start(long time, String world, String gm)
time
- Time the session started.world
- World the session started in.gm
- GameMode the session started in.public void endSession(long endOfSession)
(Changes the end to the parameter.).
endOfSession
- Epoch millisecond the session ended.public void changeState(String world, String gm, long time)
world
- World Name the player has moved togm
- GameMode the player is in.time
- Epoch ms of the event.public void playerKilled(PlayerKill kill)
public void mobKilled()
public void died()
public long getLength()
public long getSessionStart()
public long getSessionEnd()
public WorldTimes getWorldTimes()
public void setWorldTimes(WorldTimes worldTimes)
public List<PlayerKill> getPlayerKills()
public void setPlayerKills(List<PlayerKill> playerKills)
public int getMobKills()
public int getDeaths()
public boolean isFetchedFromDB()
public int getSessionID()
NullPointerException
- if Session was not fetched from DB. Check using isFetchedFromDB
public void setSessionID(int sessionID)
Copyright © 2017. All rights reserved.