Package zombie.network
Class ServerWorldDatabase
java.lang.Object
zombie.network.ServerWorldDatabase
public class ServerWorldDatabase
extends java.lang.Object
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
ServerWorldDatabase.LogonResult
-
Field Summary
Fields Modifier and Type Field Description java.lang.String
CommandLineAdminPassword
java.lang.String
CommandLineAdminUsername
DBSchema
dbSchema
boolean
doAdmin
static ServerWorldDatabase
instance
-
Constructor Summary
Constructors Constructor Description ServerWorldDatabase()
-
Method Summary
Modifier and Type Method Description void
addTicket(java.lang.String author, java.lang.String message, int ticketID)
java.lang.String
addUser(java.lang.String user, java.lang.String pass)
void
addUserlog(java.lang.String username, Userlog.UserlogType type, java.lang.String text, java.lang.String issuedBy, int amount)
java.lang.String
addWarningPoint(java.lang.String username, java.lang.String reason, int amount, java.lang.String issuedBy)
ServerWorldDatabase.LogonResult
authClient(long steamID)
ServerWorldDatabase.LogonResult
authClient(java.lang.String user, java.lang.String pass, java.lang.String ip, long steamID)
ServerWorldDatabase.LogonResult
authOwner(long steamID, long ownerID)
java.lang.String
banIp(java.lang.String ip, java.lang.String username, java.lang.String reason, boolean ban)
java.lang.String
banSteamID(java.lang.String steamID, java.lang.String reason, boolean ban)
java.lang.String
banUser(java.lang.String username, boolean ban)
java.lang.String
changePwd(java.lang.String username, java.lang.String previousPwd, java.lang.String newPwd)
java.lang.String
changeUsername(java.lang.String user, java.lang.String newUsername)
void
close()
boolean
containsUser(java.lang.String user)
void
create()
void
executeQuery(java.lang.String query)
DBSchema
getDBSchema()
java.util.ArrayList
getTableResult(java.lang.String table)
java.util.ArrayList
getTickets(java.lang.String playerName)
java.util.ArrayList
getUserlog(java.lang.String username)
java.lang.String
grantAdmin(java.lang.String username, boolean setAdmin)
static boolean
isValidUserName(java.lang.String user)
void
removeTicket(int ticketID)
java.lang.String
removeUser(java.lang.String username)
void
removeUserLog(java.lang.String username, java.lang.String type, java.lang.String text)
void
saveAllTransactionsID(java.util.HashMap map)
void
saveTransactionID(java.lang.String username, java.lang.Integer transactionID)
java.lang.String
setAccessLevel(java.lang.String username, java.lang.String accessLevel)
void
setPassword(java.lang.String username, java.lang.String password)
java.lang.String
setUserSteamID(java.lang.String user, java.lang.String steamID)
void
updateDisplayName(java.lang.String user, java.lang.String displayName)
void
updateLastConnectionDate(java.lang.String u, java.lang.String p)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
instance
-
CommandLineAdminUsername
public java.lang.String CommandLineAdminUsername -
CommandLineAdminPassword
public java.lang.String CommandLineAdminPassword -
doAdmin
public boolean doAdmin -
dbSchema
-
-
Constructor Details
-
ServerWorldDatabase
public ServerWorldDatabase()
-
-
Method Details
-
getDBSchema
-
executeQuery
public void executeQuery(java.lang.String query) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
getTableResult
public java.util.ArrayList getTableResult(java.lang.String table) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
saveAllTransactionsID
public void saveAllTransactionsID(java.util.HashMap map) -
saveTransactionID
public void saveTransactionID(java.lang.String username, java.lang.Integer transactionID) -
containsUser
public boolean containsUser(java.lang.String user) -
changeUsername
public java.lang.String changeUsername(java.lang.String user, java.lang.String newUsername) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
addUser
public java.lang.String addUser(java.lang.String user, java.lang.String pass) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
updateDisplayName
public void updateDisplayName(java.lang.String user, java.lang.String displayName) -
removeUser
public java.lang.String removeUser(java.lang.String username) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
removeUserLog
public void removeUserLog(java.lang.String username, java.lang.String type, java.lang.String text) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
create
public void create() throws java.sql.SQLException, java.lang.ClassNotFoundException- Throws:
java.sql.SQLException
java.lang.ClassNotFoundException
-
close
public void close() -
isValidUserName
public static boolean isValidUserName(java.lang.String user) -
authClient
public ServerWorldDatabase.LogonResult authClient(java.lang.String user, java.lang.String pass, java.lang.String ip, long steamID) -
authClient
-
authOwner
-
changePwd
public java.lang.String changePwd(java.lang.String username, java.lang.String previousPwd, java.lang.String newPwd) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
grantAdmin
public java.lang.String grantAdmin(java.lang.String username, boolean setAdmin) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
setAccessLevel
public java.lang.String setAccessLevel(java.lang.String username, java.lang.String accessLevel) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
getUserlog
public java.util.ArrayList getUserlog(java.lang.String username) -
addUserlog
public void addUserlog(java.lang.String username, Userlog.UserlogType type, java.lang.String text, java.lang.String issuedBy, int amount) -
banUser
public java.lang.String banUser(java.lang.String username, boolean ban) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
banIp
public java.lang.String banIp(java.lang.String ip, java.lang.String username, java.lang.String reason, boolean ban) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
banSteamID
public java.lang.String banSteamID(java.lang.String steamID, java.lang.String reason, boolean ban) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
setUserSteamID
public java.lang.String setUserSteamID(java.lang.String user, java.lang.String steamID) -
setPassword
public void setPassword(java.lang.String username, java.lang.String password) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
updateLastConnectionDate
public void updateLastConnectionDate(java.lang.String u, java.lang.String p) -
addWarningPoint
public java.lang.String addWarningPoint(java.lang.String username, java.lang.String reason, int amount, java.lang.String issuedBy) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
addTicket
public void addTicket(java.lang.String author, java.lang.String message, int ticketID) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
getTickets
public java.util.ArrayList getTickets(java.lang.String playerName) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
removeTicket
public void removeTicket(int ticketID) throws java.sql.SQLException- Throws:
java.sql.SQLException
-