|
|
|
package org.poopki.duckdns.user_db;
|
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
import org.bukkit.event.EventHandler;
|
|
|
|
import org.bukkit.event.Listener;
|
|
|
|
import org.bukkit.event.player.PlayerJoinEvent;
|
|
|
|
import org.poopki.duckdns.user_db.Array.AccountArray;
|
|
|
|
|
|
|
|
import java.util.UUID;
|
|
|
|
|
|
|
|
public class UserJoin implements Listener {
|
|
|
|
private UserInfoArray m_InfoArrayInstance;
|
|
|
|
private AccountArray m_AccountArray;
|
|
|
|
UserJoin(UserInfoArray UIA, AccountArray AA){
|
|
|
|
m_AccountArray = AA;
|
|
|
|
m_InfoArrayInstance = UIA;
|
|
|
|
}
|
|
|
|
@EventHandler
|
|
|
|
public void PlayerLogin(PlayerJoinEvent e) {
|
|
|
|
Player p = e.getPlayer();
|
|
|
|
if(!m_InfoArrayInstance.checkNewUser(p.getUniqueId())){ //새로운 user인 경우 array에 등록
|
|
|
|
m_InfoArrayInstance.putUserInfo(p.getUniqueId(), p.getName(), new UUID(0,0), new UUID(0,0), new UUID(0,0), new UUID(0,0));
|
|
|
|
m_AccountArray.putAccountInfo(p.getUniqueId(), 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|