Class ServerWorldDatabase
java.lang.Object
zombie.network.ServerWorldDatabase
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intbooleanstatic ServerWorldDatabase -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddUserlog(String username, Userlog.UserlogType type, String text, String issuedBy, int amount) addWarningPoint(String username, String reason, int amount, String issuedBy) authClient(long steamID) authClient(String user, String pass, String ip, long steamID, int authType) authOwner(long steamID, long ownerID) banSteamID(String steamID, String reason, boolean ban) changePassword(String username, String newPwd) changeUsername(String user, String newUsername) voidclose()voidconnect()booleanbooleancontainsUser(String user) booleancontainsUser(String user, String world) voidcreate()static StringintgetDefaultRoleId(String name) getDisplayName(String username) getFirstBannedIPForUser(String username) getTickets(String playerName) getTOTPCode(String secretKey) getUserGoogleKey(String username) getUserlog(String username) voidgetUserlogUsers(HashMap<String, NetworkUser> users) getUserRoleNameByUsername(String username) voidgetWhitelistUsers(HashMap<String, NetworkUser> users) googleAuthClient(String user, String code) isSteamIdBanned(String _steamID) static booleanisValidUserName(String user) voidvoidremoveRole(Role role, Role newRoleInsteadExist) voidremoveTicket(int ticketID) removeUser(String username) removeUser(String username, String world) voidremoveUserLog(String username, String type, String text) voidresetUserGoogleKey(String username) voidsaveDefaultRole(Role role, String name) voidvoidsaveRoleCapabilities(Role role) voidsetPassword(String username, String encryptedPwd) booleansetUserGoogleKey(String username, String key) setUserSteamID(String user, String steamID) voidupdateDisplayName(String user, String displayName) voidvoidupdateUserCounters(Collection<NetworkUser> users) voidviewedTicket(int ticketID, boolean viewed)
-
Field Details
-
AUTH_TYPE_USERNAME_PASSWORD
public static final int AUTH_TYPE_USERNAME_PASSWORD- See Also:
-
AUTH_TYPE_GOOGLE_AUTH
public static final int AUTH_TYPE_GOOGLE_AUTH- See Also:
-
AUTH_TYPE_TWO_FACTOR
public static final int AUTH_TYPE_TWO_FACTOR- See Also:
-
instance
-
commandLineAdminUsername
-
commandLineAdminPassword
-
doAdmin
public boolean doAdmin
-
-
Constructor Details
-
ServerWorldDatabase
public ServerWorldDatabase()
-
-
Method Details
-
getWhitelistUsers
-
getUserlogUsers
-
updateUserCounters
-
containsUser
-
containsUser
-
containsCaseinsensitiveUser
-
changeUsername
- Throws:
SQLException
-
getTOTPCode
-
addUser
- Throws:
SQLException
-
addUser
- Throws:
SQLException
-
updateDisplayName
-
getDisplayName
-
removeUser
- Throws:
SQLException
-
removeUser
- Throws:
SQLException
-
removeUserLog
- Throws:
SQLException
-
connect
public void connect() -
create
- Throws:
SQLExceptionClassNotFoundException
-
close
public void close() -
isValidUserName
-
saveRole
-
removeRole
-
saveDefaultRole
-
getDefaultRoleId
-
saveRoleCapabilities
-
loadRoles
-
googleAuthClient
-
authClient
public ServerWorldDatabase.LogonResult authClient(String user, String pass, String ip, long steamID, int authType) -
authClient
-
authOwner
-
encrypt
-
changePassword
- Throws:
SQLException
-
changePwd
- Throws:
SQLException
-
setRole
- Throws:
SQLException
-
getUserlog
-
addUserlog
public void addUserlog(String username, Userlog.UserlogType type, String text, String issuedBy, int amount) -
getUserRoleNameByUsername
-
banUser
- Throws:
SQLException
-
getFirstBannedIPForUser
-
banIp
- Throws:
SQLException
-
isSteamIdBanned
-
banSteamID
- Throws:
SQLException
-
setUserSteamID
-
setPassword
- Throws:
SQLException
-
getUserGoogleKey
- Throws:
SQLException
-
setUserGoogleKey
- Throws:
SQLException
-
resetUserGoogleKey
- Throws:
SQLException
-
updateLastConnectionDate
-
addWarningPoint
public String addWarningPoint(String username, String reason, int amount, String issuedBy) throws SQLException - Throws:
SQLException
-
addTicket
- Throws:
SQLException
-
viewedTicket
- Throws:
SQLException
-
getBannedIPs
- Throws:
SQLException
-
getBannedSteamIDs
- Throws:
SQLException
-
getTickets
- Throws:
SQLException
-
removeTicket
- Throws:
SQLException
-