많은 버그 수정

커맨드 실행 중 로그아웃 된 경우 버그 수정
국기 변경에 에러 있던 점 수정
등용장 수락시 송신자 명성 안 늘어나는 버그 수정
This commit is contained in:
2018-04-28 20:10:33 +09:00
parent 088260bbc6
commit 2d1a3f5da9
8 changed files with 21 additions and 22 deletions
+4
View File
@@ -80,6 +80,10 @@ function myCommandList() {
$query = "select no,turntime,term,turn0,turn1,turn2,turn3,turn4,turn5,turn6,turn7,turn8,turn9,turn10,turn11,turn12,turn13,turn14,turn15,turn16,turn17,turn18,turn19,turn20,turn21,turn22,turn23 from general where owner='{$userID}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if(!$me){
echo "로그인 되어있지 않습니다.";
return;
}
$turn = getTurn($me, 2);
echo "<table width=300 height=700 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg2>
+1 -1
View File
@@ -1,7 +1,7 @@
<?php
namespace sammo;
function getTurn($general, $type, $font=1) {
function getTurn(array $general, $type, $font=1) {
//TODO: 왜 'Type' 인가. 그냥 count로 하자.
$str = [];
$db = DB::db();
+1 -3
View File
@@ -43,7 +43,7 @@ function responseMessage(msgID, response){
}
function refreshMsg(result){
if(!result.result){
if(result && !result.result){
alert(result.reason);
}
return redrawMsg(fetchMsg());
@@ -62,8 +62,6 @@ function fetchMsg(){
}
function redrawMsg(deferred){
console.log(deferred);
function registerSequence(obj){
if(!obj.result){
+3 -8
View File
@@ -2769,13 +2769,8 @@ function command_81($turn, $command) {
if($nation['level'] <= 0){
continue;
}
if(isset($nationcolor[$nation['color']])){
$nationcolor[$nation['color']] = 1;
}
else{
$nationcolor[$nation['color']]++;
}
$colorUsed[$nation['color']]+=1;
}
$colorUsedCnt = 0;
@@ -2798,7 +2793,7 @@ function command_81($turn, $command) {
<form name=form1 action=c_double.php method=post>
색깔 : <select name=double size=1>";
foreach(GetNationColors() as $idx=>$color) {
if($colorUsed[$color] > 0){
if($colorUsed[$color]>0){
continue;
}
echo "<option value={$idx} style=background-color:{$color};color:".newColor($color).";>국가명</option>";
+5 -3
View File
@@ -11,6 +11,7 @@ use \sammo\ScoutMessage;
class Personnel{
protected $nation = null;//TODO: 상속체로 변경.
protected $senderID = null;
public $valid = false;
public $startYear = 0;
@@ -18,7 +19,7 @@ class Personnel{
public $month = 0;
public $killturn = 0;
public function __construct(int $nationID){
public function __construct(int $nationID, int $senderID){
$db = DB::db();
$nation = $db->queryFirstRow(
'SELECT nation, `name`, `level`, capital, scout FROM nation WHERE nation=%i',
@@ -29,6 +30,7 @@ class Personnel{
return;
}
$this->senderID = $senderID;
$this->nation = $nation;
$this->valid = true;
@@ -179,12 +181,12 @@ class Personnel{
$setValues['dedication'] = $db->sqleval('experience + %i', 100);//XXX: 상수
}
if($me['npc'] < 2){
if($general['npc'] < 2){
$setValues['killturn'] = $this->killturn;
}
$db->update('general', $setValues, 'no=%i', $generalID);
$db->update('general', $setSenderValues, 'no=%i', $this->src->generalID);
$db->update('general', $setSenderValues, 'no=%i', $this->senderID);
$db->update('nation', $setOriginalNationValues, 'nation=%i', $general['nation']);
$db->update('nation', $setScoutNationValues, 'nation=%i', $this->nation['nation']);
if($setOriginalCityValues){
+3 -3
View File
@@ -72,7 +72,7 @@ class ScoutMessage extends Message{
return $result;
}
$helper = new Engine\Personnel($this->src->nationID);
$helper = new Engine\Personnel($this->src->nationID, $this->src->senderID);
list($result, $reason) = $helper->scoutGeneral($receiverID);
@@ -113,7 +113,7 @@ class ScoutMessage extends Message{
self::MSGTYPE_PRIVATE,
$this->src,
$this->dest,
"{$scoutNation['name']}(으)로 등용 제의 수락",
"{$this->src->nationName}(으)로 등용 제의 수락",
new \DateTime(),
new \DateTime('9999-12-31'),
Json::encode([
@@ -134,7 +134,7 @@ class ScoutMessage extends Message{
self::MSGTYPE_PRIVATE,
$this->src,
$this->dest,
"{$scoutNation['name']}(으)로 등용 제의 거부",
"{$this->src->nationName}(으)로 등용 제의 거부",
new \DateTime(),
new \DateTime('9999-12-31'),
Json::encode([
+2 -2
View File
@@ -74,8 +74,8 @@ $sendResult = $restAPI->talk_to_me_default([
"object_type"=> "text",
"text"=> "임시 비밀번호는 $newPassword 입니다. 로그인 후 바로 다른 비밀번호로 변경해주세요.",
"link"=> [
"web_url"=> RootDB::getServerBasepath(),
"mobile_web_url" => RootDB::getServerBasepath()
"web_url"=> ServConfig::getServerBasepath(),
"mobile_web_url" => ServConfig::getServerBasepath()
],
"button_title"=> "로그인 페이지 열기"
]);
+2 -2
View File
@@ -27,7 +27,7 @@ $result = $restAPI->create_access_token($auth_code);
if (Util::array_get($result['expires_in'], -1) <= 0) {
die('알 수 없는 에러:'.$result['msg']);
die('알 수 없는 에러:'.Util::array_get($result['msg'], ''));
}
$session = Session::getInstance();
@@ -48,7 +48,7 @@ $oauth_mode = 'login';
$me['code'] = Util::array_get($me['code'], 0);
if($me['code']< 0){
switch($me['msg']){
switch(Util::array_get($me['msg'])){
case 'NotRegisteredUserException':
$oauth_mode = 'join';
break;