메시지 시스템에 9자 닉네임 적용
This commit is contained in:
@@ -35,6 +35,10 @@
|
||||
background-color:#5d1e1a;
|
||||
}
|
||||
|
||||
.msg_plate_private.msg_plate_dest{
|
||||
background-color:#5d461a;
|
||||
}
|
||||
|
||||
.msg_plate_public{
|
||||
background-color:#141c65;
|
||||
|
||||
@@ -42,7 +46,14 @@
|
||||
|
||||
.msg_plate_national, .msg_plate_diplomacy{
|
||||
background-color:#00582c;
|
||||
}
|
||||
|
||||
.msg_plate_national.msg_plate_dest, .msg_plate_diplomacy.msg_plate_dest {
|
||||
background-color:#704615;
|
||||
}
|
||||
|
||||
.msg_plate_national.msg_plate_src, .msg_plate_diplomacy.msg_plate_src {
|
||||
background-color:#70153b;
|
||||
}
|
||||
|
||||
.public_message{
|
||||
|
||||
@@ -77,11 +77,11 @@ function allButton() {
|
||||
$call = "설문조사";
|
||||
}
|
||||
|
||||
if(\file_exists("d_setting/templates/allButton.php")){
|
||||
$templates = new \League\Plates\Engine('d_setting/templates');
|
||||
if(\file_exists(__dir__."/d_setting/templates/allButton.php")){
|
||||
$templates = new \League\Plates\Engine(__dir__.'/d_setting/templates');
|
||||
}
|
||||
else{
|
||||
$templates = new \League\Plates\Engine('templates');
|
||||
$templates = new \League\Plates\Engine(__dir__.'/templates');
|
||||
}
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ function commandButton() {
|
||||
$bgColor = Util::array_get($nation['color'])?:'#000000';
|
||||
$fgColor = newColor($bgColor);
|
||||
|
||||
$templates = new \League\Plates\Engine('templates');
|
||||
$templates = new \League\Plates\Engine(__dir__.'/templates');
|
||||
$showSecret = false;
|
||||
if($me['level'] >= 2){
|
||||
$showSecret = true;
|
||||
@@ -170,7 +170,7 @@ function formatName(string $name, int $npc): string{
|
||||
|
||||
function getMapHtml(){
|
||||
//NOTE: 필요한가?
|
||||
$templates = new \League\Plates\Engine('templates');
|
||||
$templates = new \League\Plates\Engine(__dir__.'/templates');
|
||||
|
||||
return $templates->render('map');
|
||||
}
|
||||
@@ -11,8 +11,8 @@ $jsonPost = WebUtil::parseJsonPost();
|
||||
$reqSequence = (int)Util::array_get($jsonPost['sequence'], 0);
|
||||
|
||||
|
||||
list($generalID, $nationID) = DB::db()->queryFirstList(
|
||||
'select `no`, `nation` from `general` where owner = %i',
|
||||
list($generalID, $nationID, $generalName) = DB::db()->queryFirstList(
|
||||
'select `no`, `nation`, `name` from `general` where owner = %i',
|
||||
$userID
|
||||
);
|
||||
|
||||
@@ -58,5 +58,6 @@ $result['diplomacy']= array_map(function(Message $msg)use (&$nextSequence){
|
||||
}, Message::getMessagesFromMailBox(Message::MAILBOX_NATIONAL + $nationID, Message::MSGTYPE_DIPLOMACY, 10, 0));
|
||||
|
||||
$result['sequence'] = $nextSequence;
|
||||
|
||||
$result['nationID'] = $nationID;
|
||||
$result['generalName'] = $generalName;
|
||||
Json::die($result);
|
||||
@@ -134,7 +134,21 @@ function redrawMsg(deferred){
|
||||
$('#last_contact').val(contactTarget).html(generalList[contactTarget].textName).show();
|
||||
}
|
||||
|
||||
msg.nationID = obj.nationID;
|
||||
msg.generalName = obj.generalName;
|
||||
msg.msgType = msgType;
|
||||
|
||||
if(msg.src.nation_id == msg.dest.nation_id){
|
||||
msg.nationType = 'local';
|
||||
}
|
||||
else if(msg.nationID == msg.src.nation_id){
|
||||
msg.nationType = 'src';
|
||||
}
|
||||
else{
|
||||
msg.nationType = 'dest';
|
||||
}
|
||||
|
||||
|
||||
msg.defaultIcon = pathConfig.sharedIcon+'/default.jpg';
|
||||
var msgHtml = TemplateEngine(messageTemplate, msg);
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<div
|
||||
class="msg_plate msg_plate_<%msgType%>"
|
||||
class="msg_plate msg_plate_<%msgType%> msg_plate_<%nationType%>""
|
||||
id="msg_<%id%>"
|
||||
data-id="<%id%>"
|
||||
>
|
||||
<div class="msg_icon">
|
||||
<%if(src.icon) { %>
|
||||
<%if(src.icon){ %>
|
||||
<img width='64' height='64' src="<%encodeURI(src.icon)%>">
|
||||
<%} else {%>
|
||||
<img width='64' height='64' src="<%encodeURI(defaultIcon)%>">
|
||||
@@ -13,15 +13,26 @@
|
||||
<div class="msg_body">
|
||||
<div class="msg_header">
|
||||
<%if(msgType == 'private') {%>
|
||||
<span class="msg_target msg_<%src.colorType%>" style="background-color:<%src.color%>;"><%e(src.name)%>:<%e(src.nation)%></span
|
||||
<%if(src.name == generalName){%>
|
||||
<span class="msg_target msg_<%src.colorType%>" style="background-color:<%src.color%>;">나</span
|
||||
><span class="msg_from_to">▶</span
|
||||
><span class="msg_target msg_<%dest.colorType%>" style="background-color:<%dest.color%>;"><%e(dest.name)%>:<%e(dest.nation)%></span>
|
||||
<%} else if(msgType == 'national' && src.nation_id == dest.nation_id){%>
|
||||
<span class="msg_target msg_<%src.colorType%>" style="background-color:<%src.color%>;"><%e(src.name)%>:<%e(src.nation)%></span>
|
||||
<%} else if(msgType == 'national' || msgType == 'diplomacy'){%>
|
||||
<%}else{%>
|
||||
<span class="msg_target msg_<%src.colorType%>" style="background-color:<%src.color%>;"><%e(src.name)%>:<%e(src.nation)%></span
|
||||
><span class="msg_from_to">▶</span
|
||||
><span class="msg_from_to">▶</span
|
||||
><span class="msg_target msg_<%dest.colorType%>" style="background-color:<%dest.color%>;">나</span>
|
||||
<%}%>
|
||||
<%} else if(msgType == 'national' && src.nation_id == dest.nation_id){%>
|
||||
<span class="msg_target msg_<%src.colorType%>" style="background-color:<%src.color%>;"><%e(src.name)%></span>
|
||||
<%} else if(msgType == 'national' || msgType == 'diplomacy'){%>
|
||||
<%if(src.nation_id == nationID){%>
|
||||
<span class="msg_target msg_<%src.colorType%>" style="background-color:<%src.color%>;"><%e(src.name)%></span
|
||||
><span class="msg_from_to">▶</span
|
||||
><span class="msg_target msg_<%dest.colorType%>" style="background-color:<%dest.color%>;"><%e(dest.nation)%></span>
|
||||
<%}else{%>
|
||||
<span class="msg_target msg_<%src.colorType%>" style="background-color:<%src.color%>;"><%e(src.name)%>:<%e(src.nation)%></span
|
||||
><span class="msg_from_to"></span>
|
||||
<%}%>
|
||||
<%} else {%>
|
||||
<span class="msg_target msg_<%src.colorType%>" style="background-color:<%src.color%>;"><%e(src.name)%>:<%e(src.nation)%></span>
|
||||
<%} %>
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ function Error($message='', $url="")
|
||||
}
|
||||
file_put_contents(__dir__."/logs/_db_bug.txt", "{\"url\":\"$url\",\"msg\":\"$message\"}\n", FILE_APPEND);
|
||||
|
||||
$templates = new \League\Plates\Engine('templates');
|
||||
$templates = new \League\Plates\Engine(__dir__.'/templates');
|
||||
|
||||
ob_get_flush();
|
||||
WebUtil::setHeaderNoCache();
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ function processWar($general, $city) {
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$templates = new \League\Plates\Engine('templates');
|
||||
$templates = new \League\Plates\Engine(__dir__.'/templates');
|
||||
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ require(__dir__.'/../vendor/autoload.php');
|
||||
WebUtil::setHeaderNoCache();
|
||||
$session = Session::requireLogin()->setReadOnly();
|
||||
|
||||
$templates = new \League\Plates\Engine('templates');
|
||||
$templates = new \League\Plates\Engine(__dir__.'/templates');
|
||||
|
||||
$db = RootDB::db();
|
||||
$notice = $db->queryFirstField('SELECT `NOTICE` FROM `system` WHERE `NO`=1');
|
||||
|
||||
Reference in New Issue
Block a user