한계정내 두군대혈 가입못하게하는소스
먼저 C_JoinClan.java 에 아래 파란색 을 검색하시고 빨간색 을 추가합니다.
if (target.getId() != clan.getLeaderId()) { // 상대가 혈맹주 이외
player.sendPackets(new S_ServerMessage(92, target.getName())); // \f1%0은 프린스나 프린세스가 아닙니다.
return;
}
// 같은계정에 다른 클란으로 있는지 검색 클란번호를 알아낸다.
if( player.getClanid()==0){ //혈에 가입하지 않았으면서 현재캐릭이 클란에 가입 하려하면
String[] ClanId_ary = L1PcInstance.clanid_search1( player.getClanid() );
for(int i=0; i == ClanId_ary.length; i++ ){
if( ClanId_ary[i] != null){ // 클랜아이디 값이 널이 아니면
if( target.getClanid() != Integer.parseInt(ClanId_ary[i]) ){ // 상대의 클랜아디이와 다르면 가입을 거부시킨다.
player.sendPackets(new S_SystemMessage("당신의 계정내 한캐릭은 이미 다른 혈맹에 가입중입니다. "));
player.sendPackets(new S_SystemMessage("한 계정내 캐릭들은 같은 혈맹만 가입 가능합니다. "));
return ;
}
}
}
}
다음 은 L1PcInstance.java 파일 제일 하단 } 관호 바로 위에 이것을 추가합니다.
public static String[] clanid_search1( int i ) { // 캐릭명이 디비에 있는지 검사하고 정보를 넘겨준다.
try {
String ClanID_Array[] = { null, null, null, null } ;
int count = 0 ;
java.sql.Connection accountObjid = null ; // 이름으로 objid를 검색하기 위해
accountObjid = L1DatabaseFactory.getInstance().getConnection() ;
PreparedStatement Query_objid = null ;
Query_objid = accountObjid.prepareStatement("select " +
"ClanID " +
"from characters where ClanID = '"+ i + "'") ;
ResultSet rs = Query_objid.executeQuery() ;
while (rs.next()) {
ClanID_Array[count] = rs.getString(1);
count++ ;
}
rs.close() ;
Query_objid.close() ;
return ClanID_Array;
} catch (Exception e) {}
return null ;
}
}

오징어소녀 님의 최근 댓글
db 부분에서 추가 하시면 됩니다 2016 04.18