You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.4 KiB
41 lines
1.4 KiB
package org.poopki.duckdns.user_db; |
|
|
|
import org.bukkit.event.Listener; |
|
import org.bukkit.plugin.java.JavaPlugin; |
|
import org.poopki.duckdns.user_db.DB.*; |
|
|
|
import java.sql.SQLException; |
|
|
|
|
|
public final class User_DB extends JavaPlugin implements Listener { |
|
|
|
AccountArray m_AccountArrayInstance = new AccountArray(); |
|
UserInfoArray m_InfoArrayInstance = new UserInfoArray(); // UserInfo 저장하는 Array instance 생성 |
|
GroupArray m_GroupArrayInstance = new GroupArray(m_InfoArrayInstance); |
|
|
|
DBUpdate Database_backup = new DBUpdate(m_InfoArrayInstance, m_AccountArrayInstance); |
|
@Override |
|
public void onEnable() { |
|
// Plugin startup logic |
|
try { |
|
Database_backup.InitDB(); |
|
Database_backup.LoadDB(); |
|
} catch (SQLException e) { |
|
throw new RuntimeException(e); |
|
} |
|
getCommand("계좌").setExecutor(new AccountEventHandler(m_AccountArrayInstance)); |
|
getCommand("그룹").setExecutor(new GroupEventHandler(m_GroupArrayInstance, m_InfoArrayInstance)); |
|
getServer().getPluginManager().registerEvents(new UserJoin(m_InfoArrayInstance, m_AccountArrayInstance),this); |
|
|
|
} |
|
|
|
@Override |
|
public void onDisable() { |
|
// Plugin shutdown logic |
|
try{ |
|
Database_backup.UpdateDB(); |
|
} catch (SQLException e){ |
|
throw new RuntimeException(e); |
|
} |
|
} |
|
}
|
|
|