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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFriend(int pIDRequester, int pIDReceiver) Adds a player to friendsintchangeSettingsWorth(int pPlayerID, int pSettingsID) Sets a settingvoiddeleteFriend(int pFriend1ID, int pFriend2ID) Deletes a friendvoiddeletePlayerEntry(int pPlayerId) voiddenyRequest(int pReceiverSender, int pRequesterID) Removes a friend requestintfirstJoin(net.md_5.bungee.api.connection.ProxiedPlayer pPlayer) Will be executed if a player joins the first time on the serverintgetFriendCount(int pPlayerId) getFriends(int pPlayerID) Gives out the IDs of the friends of a playergetFriendsPlayerData(int pPlayerID) getFriendsPlayerDataForListing(int pPlayerID) getLastOnline(int pPlayerID) intgetLastPlayerWroteTo(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) intgetPlayerID(String pPlayerName) Returns the ID of a playerintgetPlayerID(UUID pUUID) Returns the ID of a playerintgetPlayerID(net.md_5.bungee.api.connection.ProxiedPlayer pPlayer) getRequests(int pPlayerID) Returns the IDs of the friends from a playergetRequestsPlayerData(int pPlayerID) intgetSettingsWorth(int pPlayerID, int pSettingsID) getUUID(int pPlayerID) booleanhasRequestFrom(int pReceiver, int pRequester) booleanisAFriendOf(int pPlayerID1, int pPlayerID2) booleanisAFriendOf(net.md_5.bungee.api.connection.ProxiedPlayer pPlayer1, net.md_5.bungee.api.connection.ProxiedPlayer pPlayer2) Deprecated.voidsendFriendRequest(int pSenderID, int pQueryID) Send a friend requestvoidsetLastPlayerWroteTo(int pPlayerID, int pLastWroteTo) voidsetSetting(int pPlayerID, int pSettingsID, int pNewWorth) voidupdateLastOnline(int pPlayerID) voidupdatePlayerName(int pPlayerID, String pNewPlayerName) Updates the name of a playervoidupdateUUID(int pPlayerID, UUID pNewUUID) Methods inherited from class de.simonsator.partyandfriends.communication.sql.pool.PoolSQLCommunication
close, close, close, getConnection, getDatabase, onDisableMethods 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)
-