4 changed files with 93 additions and 2 deletions
@ -0,0 +1,52 @@ |
|||
package app.entities.db; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonGetter; |
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import lombok.Data; |
|||
|
|||
import java.sql.Timestamp; |
|||
|
|||
@Data |
|||
public class Gametime { |
|||
|
|||
@JsonIgnore |
|||
int id; |
|||
String player_name; |
|||
@JsonIgnore |
|||
String steam_id; |
|||
@JsonIgnore |
|||
String connect_ip; |
|||
@JsonIgnore |
|||
long account_id; |
|||
@JsonIgnore |
|||
Timestamp timestamp; |
|||
@JsonIgnore |
|||
String map; |
|||
@JsonIgnore |
|||
String connection_type; |
|||
int connect_duration; |
|||
String reason; |
|||
|
|||
public Gametime(Object[] obj) { |
|||
id = (int) obj[0]; |
|||
player_name = (String) obj[1]; |
|||
steam_id = (String) obj[2]; |
|||
connect_ip = (String) obj[3]; |
|||
account_id = (long) obj[4]; |
|||
timestamp = (Timestamp) obj[5]; |
|||
map = (String) obj[6]; |
|||
connection_type = (String) obj[7]; |
|||
connect_duration = (int) obj[8]; |
|||
reason = (String) obj[9]; |
|||
} |
|||
|
|||
@JsonGetter |
|||
public String getMap() { |
|||
return map.replace("workshop/","").split(".ugc", 2)[0]; |
|||
} |
|||
|
|||
@JsonGetter |
|||
public Long getUtime() { |
|||
return timestamp.toInstant().getEpochSecond(); |
|||
} |
|||
} |
Loading…
Reference in new issue