feat,game: 사전 거병 기능 추가
- 건국은 게임 개시 2턴째부터 가능
This commit is contained in:
@@ -36,7 +36,7 @@ class DieOnPrestart extends \sammo\BaseAPI
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$gameStor->cacheValues(['turnterm', 'opentime', 'turntime', 'year', 'month']);
|
||||
|
||||
$general = $db->queryFirstRow('SELECT no,name,owner_name,npc,lastrefresh FROM general WHERE owner=%i AND npc = 0', $userID);
|
||||
$general = $db->queryFirstRow('SELECT no,name,nation,owner_name,npc,lastrefresh FROM general WHERE owner=%i AND npc = 0', $userID);
|
||||
|
||||
if (!$general) {
|
||||
return '장수가 없습니다';
|
||||
@@ -49,6 +49,10 @@ class DieOnPrestart extends \sammo\BaseAPI
|
||||
return '게임이 시작되었습니다.';
|
||||
}
|
||||
|
||||
if ($general['nation'] != 0){
|
||||
return '이미 국가에 소속되어있습니다.';
|
||||
}
|
||||
|
||||
//서버 가오픈시 할 수 있는 행동
|
||||
$targetTime = addTurn($general['lastrefresh'], $gameStor->turnterm, 2);
|
||||
if ($targetTime > TimeUtil::now()) {
|
||||
|
||||
Reference in New Issue
Block a user