misc: storedActionHelper 저장 키에 map, unit 지정

This commit is contained in:
2022-03-23 20:12:59 +09:00
parent b8542b6bce
commit ef911ba5cc
5 changed files with 12 additions and 5 deletions
+3 -1
View File
@@ -150,7 +150,9 @@ if (!$otherTextInfo) {
'lastExecuted' => $gameStor->turntime,
'isLocked' => $plock,
'isTournamentActive' => $isTournamentActive,
'isBettingActive' => $isBettingActive
'isBettingActive' => $isBettingActive,
'mapName' => GameConst::$mapName,
'unitSet' => GameConst::$unitSet,
]
]) ?>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.1/css/all.css" integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" crossorigin="anonymous">
@@ -117,6 +117,8 @@ class GetReservedCommand extends \sammo\BaseAPI
'autorun_limit' => $generalObj->getAuxVar('autorun_limit'),
'officerLevel' => $me['officer_level'],
'commandList' => getChiefCommandTable($generalObj),
'mapName' => GameConst::$mapName,
'unitSet' => GameConst::$unitSet,
];
}
}
+2
View File
@@ -392,6 +392,8 @@ export default defineComponent({
autorun_limit: undefined,
officerLevel: undefined,
commandList: undefined,
mapName: undefined,
unitSet: undefined,
});
async function reloadTable(): Promise<void> {
+2
View File
@@ -223,6 +223,8 @@ export type ChiefResponse = {
category: string;
values: CommandItem[];
}[];
mapName: string,
unitSet: string,
};
+3 -4
View File
@@ -1,5 +1,4 @@
import type { TurnObj } from '@/defs';
import { clone } from 'lodash';
import { ref } from 'vue';
@@ -9,9 +8,9 @@ export class StoredActionsHelper {
public readonly recentActionsKey: string;
public readonly storedActionsKey: string;
constructor(protected serverNick: string, protected type: 'general' | 'nation', protected maxRecent = 10) {
this.recentActionsKey = `${serverNick}_${type}RecentActions`;
this.storedActionsKey = `${serverNick}_${type}StoredActions`;
constructor(protected serverNick: string, protected type: 'general' | 'nation', protected mapName: string, protected unitSet: string, protected maxRecent = 10) {
this.recentActionsKey = `${serverNick}_${mapName}_${unitSet}_${type}RecentActions`;
this.storedActionsKey = `${serverNick}_${mapName}_${unitSet}_${type}StoredActions`;
this.loadRecentActions();
this.loadStoredActions();
}