mirror of
https://e.coding.net/circlecloud/QuickShop.git
synced 2024-11-22 01:58:54 +00:00
fix message error...
Signed-off-by: j502647092 <jtb1@163.com>
This commit is contained in:
parent
f6f061daf3
commit
377710b3c3
@ -26,7 +26,7 @@ import mkremins.fanciful.FancyMessage;
|
|||||||
public class MsgUtil {
|
public class MsgUtil {
|
||||||
private static QuickShop plugin;
|
private static QuickShop plugin;
|
||||||
private static YamlConfiguration messages;
|
private static YamlConfiguration messages;
|
||||||
private static HashMap<String, LinkedList<String>> player_messages = new HashMap<String, LinkedList<String>>();
|
private static HashMap<UUID, LinkedList<String>> player_messages = new HashMap<UUID, LinkedList<String>>();
|
||||||
|
|
||||||
static {
|
static {
|
||||||
plugin = QuickShop.instance;
|
plugin = QuickShop.instance;
|
||||||
@ -84,7 +84,7 @@ public class MsgUtil {
|
|||||||
try {
|
try {
|
||||||
final ResultSet rs = plugin.getDB().getConnection().prepareStatement("SELECT * FROM messages").executeQuery();
|
final ResultSet rs = plugin.getDB().getConnection().prepareStatement("SELECT * FROM messages").executeQuery();
|
||||||
while (rs.next()) {
|
while (rs.next()) {
|
||||||
final String owner = rs.getString("owner");
|
final UUID owner = UUID.fromString(rs.getString("owner"));
|
||||||
final String message = rs.getString("message");
|
final String message = rs.getString("message");
|
||||||
LinkedList<String> msgs = player_messages.get(owner);
|
LinkedList<String> msgs = player_messages.get(owner);
|
||||||
if (msgs == null) {
|
if (msgs == null) {
|
||||||
@ -121,7 +121,7 @@ public class MsgUtil {
|
|||||||
* they're online. Else, if they're not online, queues it for
|
* they're online. Else, if they're not online, queues it for
|
||||||
* them in the database.
|
* them in the database.
|
||||||
*/
|
*/
|
||||||
public static void send(final String player, final String message) { // TODO Converted to UUID
|
public static void send(final UUID player, final String message) { // TODO Converted to UUID
|
||||||
final OfflinePlayer p = Bukkit.getOfflinePlayer(player);
|
final OfflinePlayer p = Bukkit.getOfflinePlayer(player);
|
||||||
if (p == null || !p.isOnline()) {
|
if (p == null || !p.isOnline()) {
|
||||||
LinkedList<String> msgs = player_messages.get(player);
|
LinkedList<String> msgs = player_messages.get(player);
|
||||||
|
Loading…
Reference in New Issue
Block a user