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.
43 lines
1.4 KiB
43 lines
1.4 KiB
3 years ago
|
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.Connection;
|
||
3 years ago
|
import java.sql.SQLException;
|
||
3 years ago
|
import java.sql.Statement;
|
||
|
|
||
|
|
||
2 years ago
|
public final class The_Seed extends JavaPlugin implements Listener {
|
||
3 years ago
|
|
||
|
AccountArray m_AccountArrayInstance = new AccountArray();
|
||
3 years ago
|
UserInfoArray m_InfoArrayInstance = new UserInfoArray(); // UserInfo저장하는 Array instance 생성
|
||
3 years ago
|
PartyArray m_PartyArrayInstance = new PartyArray(m_InfoArrayInstance);
|
||
3 years ago
|
|
||
3 years ago
|
DBUpdate Database_backup = new DBUpdate(m_InfoArrayInstance, m_AccountArrayInstance);
|
||
3 years ago
|
@Override
|
||
|
public void onEnable() {
|
||
|
// Plugin startup logic
|
||
3 years ago
|
try {
|
||
|
Database_backup.InitDB();
|
||
3 years ago
|
Database_backup.LoadDB();
|
||
3 years ago
|
} catch (SQLException e) {
|
||
|
throw new RuntimeException(e);
|
||
|
}
|
||
3 years ago
|
getCommand("계좌").setExecutor(new AccountEventHandler(m_AccountArrayInstance));
|
||
3 years ago
|
getCommand("파티").setExecutor(new PartyEventHandler(m_PartyArrayInstance, m_InfoArrayInstance));
|
||
3 years ago
|
getServer().getPluginManager().registerEvents(new UserJoin(m_InfoArrayInstance, m_AccountArrayInstance),this);
|
||
3 years ago
|
|
||
3 years ago
|
}
|
||
|
|
||
|
@Override
|
||
|
public void onDisable() {
|
||
|
// Plugin shutdown logic
|
||
3 years ago
|
try{
|
||
|
Database_backup.UpdateDB();
|
||
|
} catch (SQLException e){
|
||
|
throw new RuntimeException(e);
|
||
|
}
|
||
3 years ago
|
}
|
||
3 years ago
|
}
|