poopki 10 months ago
parent b91f592dc1
commit 6dceb6aebb
  1. 3
      Array/Nation.java
  2. 2
      DB/DBConnect.java
  3. 15
      DB/DBUpdate.java
  4. 4
      InfoGUI/ScoreboardEvent.java
  5. 33
      UserInfo.java
  6. 1
      User_DB.java

@ -38,7 +38,7 @@ public class Nation extends Group{
}
}
}.runTaskTimer(plugin,0,20);
InitResearchItem();
//InitResearchItem();
}
public void InitResearchItem(){
@ -52,6 +52,7 @@ public class Nation extends Group{
public void AddShowResearchProgressBar(Integer index, Player player){
m_ResearchArray.get(index).tech1_progressbar.addPlayer(player);
}
public void ShowResearchProgressBar(Integer index, boolean toggle){
m_ResearchArray.get(index).tech1_progressbar.setVisible(toggle);
}

@ -5,7 +5,7 @@ import java.sql.*;
public class DBConnect {
private static final String DB_DRIVER_CLASS = "org.mariadb.jdbc.Driver";
private static final String DB_URL = "jdbc:mariadb://192.168.0.4:3307/";
private static final String DB_URL = "jdbc:mariadb://192.168.2.4:3307/";
private static final String DB_USERNAME = "mc_dev";
private static final String DB_PASSWORD = "!Rkdalsrn1027";

@ -13,7 +13,7 @@ import java.util.UUID;
public class DBUpdate {
private final String DB_DRIVER_CLASS = "org.mariadb.jdbc.Driver";
private final String DB_URL = "jdbc:mariadb://192.168.0.4:3307/mc_dev";
private final String DB_URL = "jdbc:mariadb://192.168.2.4:3307/mc_dev";
private final String DB_USERNAME = "mc_dev";
private final String DB_PASSWORD = "!Rkdalsrn1027";
private UserInfoArray m_InfoArrayInstance;
@ -264,12 +264,9 @@ public class DBUpdate {
pstmt.setString(5, String.valueOf(m_InfoArrayInstance.getUserGroupUUID(key, "Farm")));
pstmt.setString(6, String.valueOf(m_AccountArray.getAccountInfo(key)));
int cnt = pstmt.executeUpdate();
if( cnt == 0 ){
if( cnt == 0 ) {
System.out.println("[DB] 유저 데이터 입력 실패");
}
else{
System.out.println("[DB] 유저 데이터 입력 성공");
}
}
}
@ -333,9 +330,7 @@ public class DBUpdate {
if( cnt == 0 ){
System.out.println("[DB] 국가 데이터 입력 실패");
}
else{
System.out.println("[DB] 국가 데이터 입력 성공");
}
}
}
@ -397,9 +392,7 @@ public class DBUpdate {
if( cnt == 0 ){
System.out.println("[DB] 분대 데이터 입력 실패");
}
else{
System.out.println("[DB] 분대 데이터 입력 성공");
}
}
if( conn != null && !conn.isClosed()){
conn.close();

@ -53,7 +53,7 @@ public class ScoreboardEvent {
Score score4 = score_obj.getScore("농장 이름: " + m_FarmArray.GetGroupName(m_InfoArrayInstance.getUserGroupUUID(player.getUniqueId(), "Farm")));
score4.setScore(14);
}
/*
if(ZERO_UUID.equals(m_InfoArrayInstance.getUserGroupUUID(player.getUniqueId(), "Nation"))) {
Score score5 = score_obj.getScore("국가 이름: ----");
score5.setScore(13);
@ -71,7 +71,7 @@ public class ScoreboardEvent {
Score score6 = score_obj.getScore("분대 이름: "+m_SquadArray.GetGroupName(m_InfoArrayInstance.getUserGroupUUID(player.getUniqueId(), "Squad")));
score6.setScore(12);
}
*/
player.setScoreboard(scoreboard);
}
}

@ -1,37 +1,28 @@
package org.poopki.duckdns.user_db;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import java.util.*;
public class UserInfo extends Status {
private UUID m_UUID;
private String m_Name;
private static Map<String, Integer> m_status = new HashMap<String, Integer>();
private int m_Nation;
private int m_Squad;
private int m_Farm;
public UserInfo(UUID uuid, String Name, int Nation, int Squad, int Farm){ //UserInfo 초기화
super(100,100,1,10,10,10,10);
private Map<String, UUID> m_GroupUUID = new HashMap<String, UUID>();
public UserInfo(UUID uuid, String Name, UUID Nation, UUID Squad, UUID Farm, UUID Party){ //UserInfo 초기화
super(100,100,1,10,10,10,10); //HP, MP, LEV, STR, DEX, INT, LUK
m_UUID = uuid;
m_Name = Name;
m_Nation = Nation;
m_Squad = Squad;
m_Farm = Farm;
}
public void JoinNation(int Nation) { m_Nation = Nation; }
public void JoinSquad(int Squad) { m_Squad = Squad; }
public void JoinFarm(int Farm) { m_Farm = Farm; }
m_GroupUUID.put("Nation", Nation);
m_GroupUUID.put("Squad", Squad);
m_GroupUUID.put("Farm", Farm);
m_GroupUUID.put("Party", Party);
}
public void SetGroupUUID(String GroupType, UUID m_UUID){ m_GroupUUID.put(GroupType, m_UUID); }
public UUID GetGroupUUID(String GroupType){ return m_GroupUUID.get(GroupType); }
public String getUserName(){
return m_Name;
}
public UUID getUserUUID(){ return m_UUID; }
}
}

@ -41,6 +41,7 @@ public final class User_DB extends JavaPlugin implements Listener {
} catch (SQLException e) {
throw new RuntimeException(e);
}
getCommand("계좌").setExecutor(new AccountEventHandler(m_InfoArrayInstance, m_AccountArrayInstance));
getCommand("농장").setExecutor(new FarmEventHandler(m_InfoArrayInstance, m_FarmArrayInstance, m_AccountArrayInstance));
getCommand("국가").setExecutor(new NationEventHandler(m_InfoArrayInstance, m_NationArrayInstance, m_AccountArrayInstance));

Loading…
Cancel
Save