메시지 전송 시스템을 새 시스템에 맞게 수정
국가의 기본 정보를 중복 쿼리 없이 받아오는 함수 추가 - 해당 함수를 위해 국가색, 건국 등의 국가 정보가 바뀌는 경우 refresh 새 메시지 시스템 적용을 위해 메인 페이지 틀 변경
This commit is contained in:
+8
-16
@@ -74,13 +74,6 @@ if($con >= 2) {
|
||||
]);
|
||||
}
|
||||
|
||||
//FIXME: 원래는 필요없는 값이지만 예전 코드와 꼬일 수 있어 유지함.
|
||||
$msg = str_replace('|', '', $msg);
|
||||
|
||||
//TODO: 몰라서 임시로 값 세팅해봄. 추후에 용도를 확인하고 수정 필요
|
||||
//$s = 50;
|
||||
//$msg = _String::SubStrForWidth($msg, $s, 198);
|
||||
|
||||
//SubStrForWidth는 반각은 1, 전각은 2로 측정하는듯 보이나, 대부분 글자수 단위로 카운트 하고 있어 mb_substr로 처리함.
|
||||
$msg = mb_substr($msg, 0, 99, 'UTF-8');
|
||||
$msg = trim($msg);
|
||||
@@ -109,7 +102,7 @@ if($src['nation_id'] != 0) {
|
||||
|
||||
// 전체 메세지
|
||||
if($destMailbox == 9999) {
|
||||
sendMessage('public', $src, [], $msg, $date);
|
||||
sendMessage('public', $src, null, $msg, $date);
|
||||
// 국가 메세지
|
||||
} elseif($destMailbox >= 9000) {
|
||||
|
||||
@@ -119,9 +112,9 @@ if($destMailbox == 9999) {
|
||||
else{
|
||||
$real_nation = $dest - 9000;
|
||||
}
|
||||
$nation = $db->queryFirstRow('select nation,name,color from nation where nation=%i',$real_nation);
|
||||
$nation = getNationStaticInfo($real_nation);
|
||||
|
||||
if($nation === NULL || empty($nation)){
|
||||
if($nation === null || empty($nation)){
|
||||
$dest = ['nation_id' => 0];
|
||||
}
|
||||
else{
|
||||
@@ -167,15 +160,14 @@ if($destMailbox == 9999) {
|
||||
'id' => $destMailbox,
|
||||
'name' => $dest_user['name']
|
||||
];
|
||||
if($dest_user['nation'] != 0){
|
||||
$nation = $db->queryFirstRow('select nation,name,color from nation where nation=%i',$dest_user['nation']);
|
||||
|
||||
$color = $nation['color'];
|
||||
$destNation = getNationStaticInfo($dest_user['nation']);
|
||||
if($destNation){
|
||||
$color = $destNation['color'];
|
||||
$color = str_replace('##', '#', $color);
|
||||
//FIXME: nation table에서 color가 #포함된 걸로 바뀔 경우를 대비
|
||||
$dest['color'] = $color;
|
||||
$dest['nation'] = $nation['name'];
|
||||
$dest['nation_id'] = $nation['nation'];
|
||||
$dest['nation'] = $destNation['name'];
|
||||
$dest['nation_id'] = $destNation['nation'];
|
||||
}
|
||||
sendMessage('private', $src, $dest, $msg, $date);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user