Class MySQL
java.lang.Object
de.simonsator.partyandfriends.communication.sql.DBCommunication
de.simonsator.partyandfriends.communication.sql.pool.PoolSQLCommunication
de.simonsator.partyandfriends.communication.sql.MySQL
- All Implemented Interfaces:
Deactivated
-
Field Summary
Fields inherited from class de.simonsator.partyandfriends.communication.sql.DBCommunication
MYSQL_DRIVER_CLASS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addFriend
(int pIDRequester, int pIDReceiver) Adds a player to friendsint
changeSettingsWorth
(int pPlayerID, int pSettingsID) Sets a settingvoid
deleteFriend
(int pFriend1ID, int pFriend2ID) Deletes a friendvoid
deletePlayerEntry
(int pPlayerId) void
denyRequest
(int pReceiverSender, int pRequesterID) Removes a friend requestint
firstJoin
(net.md_5.bungee.api.connection.ProxiedPlayer pPlayer) Will be executed if a player joins the first time on the serverint
getFriendCount
(int pPlayerId) getFriends
(int pPlayerID) Gives out the IDs of the friends of a playergetFriendsPlayerData
(int pPlayerID) getFriendsPlayerDataForListing
(int pPlayerID) getLastOnline
(int pPlayerID) int
getLastPlayerWroteTo
(int pID) Returns the last player who wrote to the given playergetName
(int pPlayerID) Returns the name of a playergetPlayerData
(int pPlayerId) getPlayerData
(String pPlayerName) getPlayerData
(UUID pUUID) int
getPlayerID
(String pPlayerName) Returns the ID of a playerint
getPlayerID
(UUID pUUID) Returns the ID of a playerint
getPlayerID
(net.md_5.bungee.api.connection.ProxiedPlayer pPlayer) getRequests
(int pPlayerID) Returns the IDs of the friends from a playergetRequestsPlayerData
(int pPlayerID) int
getSettingsWorth
(int pPlayerID, int pSettingsID) getUUID
(int pPlayerID) boolean
hasRequestFrom
(int pReceiver, int pRequester) boolean
isAFriendOf
(int pPlayerID1, int pPlayerID2) boolean
isAFriendOf
(net.md_5.bungee.api.connection.ProxiedPlayer pPlayer1, net.md_5.bungee.api.connection.ProxiedPlayer pPlayer2) Deprecated.void
sendFriendRequest
(int pSenderID, int pQueryID) Send a friend requestvoid
setLastPlayerWroteTo
(int pPlayerID, int pLastWroteTo) void
setSetting
(int pPlayerID, int pSettingsID, int pNewWorth) void
updateLastOnline
(int pPlayerID) void
updatePlayerName
(int pPlayerID, String pNewPlayerName) Updates the name of a playervoid
updateUUID
(int pPlayerID, UUID pNewUUID) Methods inherited from class de.simonsator.partyandfriends.communication.sql.pool.PoolSQLCommunication
close, close, close, getConnection, getDatabase, onDisable
Methods inherited from class de.simonsator.partyandfriends.communication.sql.DBCommunication
close, close, close
-
Constructor Details
-
MySQL
Connects to the MySQL server- Parameters:
pMySQLData
- The MySQL data- Throws:
SQLException
-
-
Method Details
-
getUUID
-
getPlayerID
public int getPlayerID(net.md_5.bungee.api.connection.ProxiedPlayer pPlayer) -
getPlayerID
Returns the ID of a player- Parameters:
pUUID
- The UUID of the player- Returns:
- Returns the ID of a player
-
getPlayerData
-
getPlayerData
- Parameters:
pPlayerId
- The id of the player- Returns:
- Returns a PlayerDataSet where at least ID and UUID are not null or if the player could not be found the ID -1, NAME null and UUID null
-
getPlayerID
Returns the ID of a player- Parameters:
pPlayerName
- Name of the player Returns the ID of a player- Returns:
- Returns the ID of a player
-
getPlayerData
-
firstJoin
public int firstJoin(net.md_5.bungee.api.connection.ProxiedPlayer pPlayer) Will be executed if a player joins the first time on the server- Parameters:
pPlayer
- The player
-
getFriends
Gives out the IDs of the friends of a player- Parameters:
pPlayerID
- The ID of the player- Returns:
- Returns the IDs of the friends of a player
-
getFriendsPlayerData
-
getFriendsPlayerDataForListing
-
getName
Returns the name of a player- Parameters:
pPlayerID
- The ID of the player- Returns:
- Returns the name of a player
-
updatePlayerName
Updates the name of a player- Parameters:
pPlayerID
- The ID of the playerpNewPlayerName
- New name of the player
-
updateUUID
-
hasRequestFrom
public boolean hasRequestFrom(int pReceiver, int pRequester) -
getRequests
Returns the IDs of the friends from a player- Parameters:
pPlayerID
- The ID of the player- Returns:
- Returns the IDs of the friends from a player
-
getRequestsPlayerData
-
getFriendCount
public int getFriendCount(int pPlayerId) -
addFriend
public void addFriend(int pIDRequester, int pIDReceiver) Adds a player to friends- Parameters:
pIDRequester
- The sender of the commandpIDReceiver
- The new friend
-
denyRequest
public void denyRequest(int pReceiverSender, int pRequesterID) Removes a friend request- Parameters:
pReceiverSender
- The ID of the command executorpRequesterID
- The ID of the person who had send the friend request
-
deleteFriend
public void deleteFriend(int pFriend1ID, int pFriend2ID) Deletes a friend- Parameters:
pFriend1ID
- The ID of the command senderpFriend2ID
- The ID of the friend, which should be deleted
-
sendFriendRequest
public void sendFriendRequest(int pSenderID, int pQueryID) Send a friend request- Parameters:
pSenderID
- The ID of Sender of the friend requestpQueryID
- The ID of the player, which gets the friend request
-
changeSettingsWorth
public int changeSettingsWorth(int pPlayerID, int pSettingsID) Sets a setting- Parameters:
pPlayerID
- The id of the playerpSettingsID
- The ID of the setting- Returns:
- Returns the new worth
-
isAFriendOf
@Deprecated public boolean isAFriendOf(net.md_5.bungee.api.connection.ProxiedPlayer pPlayer1, net.md_5.bungee.api.connection.ProxiedPlayer pPlayer2) Deprecated.Checks if somebody is a friend of someone others- Parameters:
pPlayer1
- The playerpPlayer2
- The other player- Returns:
- Returns if player one is a friend of player two true, otherwise false
-
getSettingsWorth
public int getSettingsWorth(int pPlayerID, int pSettingsID) -
setSetting
public void setSetting(int pPlayerID, int pSettingsID, int pNewWorth) -
isAFriendOf
public boolean isAFriendOf(int pPlayerID1, int pPlayerID2) -
getLastPlayerWroteTo
public int getLastPlayerWroteTo(int pID) Returns the last player who wrote to the given player- Parameters:
pID
- The ID of the player- Returns:
- Returns the last player who wrote to the given player
-
setLastPlayerWroteTo
public void setLastPlayerWroteTo(int pPlayerID, int pLastWroteTo) - Parameters:
pPlayerID
- The ID of the playerpLastWroteTo
- The ID of the player who wrote to
-
getLastOnline
-
updateLastOnline
public void updateLastOnline(int pPlayerID) -
deletePlayerEntry
public void deletePlayerEntry(int pPlayerId)
-