Skip to content

Commit ba247bc

Browse files
committed
script fixes
1 parent f4a42ee commit ba247bc

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

cgss/main.php

+6-4
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ function do_commit($TruthVersion, $db = NULL) {
121121
case 35: { return 'Motif Vocal'; }
122122
case 36: { return 'Motif Dance'; }
123123
case 37: { return 'Motif Visual'; }
124+
case 38: { return 'Trico Symphony'; }
125+
case 39: { return 'Alternate'; }
124126
default: { return 'Skill '.$a; }
125127
}
126128
})($a['skill_type']).
@@ -150,11 +152,11 @@ function do_commit($TruthVersion, $db = NULL) {
150152
exec('git commit -m "'.implode("\n", $commitMessage).'"');
151153
exec('git rev-parse HEAD', $hash);
152154
$versionDiff['hash'] = $hash[0];
153-
require_once __DIR__.'/../mysql.php';
154-
$mysqli->select_db('db_diff');
155-
$mysqli->query('REPLACE INTO cgss (ver,should_rechk_date,data) vALUES ('.$TruthVersion.','.$rechk_date.',"'.$mysqli->real_escape_string(brotli_compress(
155+
$diff_db = new PDO('sqlite:'.__DIR__.'/../db_diff.db');
156+
$stmt = $diff_db->prepare('REPLACE INTO cgss (ver,should_rechk_date,data) VALUES (?,?,?)');
157+
$stmt->execute([$TruthVersion, $rechk_date, brotli_compress(
156158
json_encode($versionDiff, JSON_UNESCAPED_SLASHES), 11, BROTLI_TEXT
157-
)).'")');
159+
)]);
158160
exec('git push origin master');
159161

160162
$data = json_encode(array(

redive/main.php

+8-6
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,12 @@ function do_commit($TruthVersion, $db = NULL, $extraMsg = '') {
152152
exec('git commit -m "'.implode("\n", $commitMessage).'"');
153153
exec('git rev-parse HEAD', $hash);
154154
$versionDiff['hash'] = $hash[0];
155-
require_once __DIR__.'/../mysql.php';
156-
$mysqli->select_db('db_diff');
155+
$diff_db = new PDO('sqlite:'.__DIR__.'/../db_diff.db');
157156

158157
$col = ['ver','data'];
159-
$val = [$TruthVersion, '"'.$mysqli->real_escape_string(brotli_compress(
158+
$val = [$TruthVersion, brotli_compress(
160159
json_encode($versionDiff, JSON_UNESCAPED_SLASHES), 11, BROTLI_TEXT
161-
)).'"'];
160+
)];
162161
$chkTypes = [
163162
'clan_battle',
164163
'dungeon_area',
@@ -176,7 +175,8 @@ function do_commit($TruthVersion, $db = NULL, $extraMsg = '') {
176175
$val[] = 1;
177176
}
178177
}
179-
$mysqli->query('REPLACE INTO redive ('.implode(',', $col).') VALUES ('.implode(',', $val).')');
178+
$stmt = $diff_db->prepare('REPLACE INTO redive ('.implode(',', $col).') VALUES ('.implode(',', array_map(function (){return '?';}, $val)).')');
179+
$stmt->execute($val);
180180
exec('git push origin master');
181181

182182
$data = json_encode(array(
@@ -422,7 +422,7 @@ function main() {
422422
file_put_contents('data/+manifest_'.substr($manifestName, 9, -14).'.txt', $manifest);
423423
}
424424
}
425-
curl_setopt($curl, CURLOPT_URL, 'http://prd-priconne-redive.akamaized.net/dl/Resources/'.$TruthVersion.'/Jpn/Movie/SP/High/manifest/sound2manifest');
425+
curl_setopt($curl, CURLOPT_URL, 'http://prd-priconne-redive.akamaized.net/dl/Resources/'.$TruthVersion.'/Jpn/Sound/manifest/sound2manifest');
426426
$manifest = curl_exec($curl);
427427
file_put_contents('data/+manifest_sound.txt', $manifest);
428428
curl_setopt($curl, CURLOPT_URL, 'http://prd-priconne-redive.akamaized.net/dl/Resources/'.$TruthVersion.'/Jpn/Movie/SP/High/manifest/moviemanifest');
@@ -555,6 +555,8 @@ function main() {
555555
do_commit($TruthVersion, $db);
556556
unset($db);
557557

558+
if (file_exists(__DIR__.'/action_after_update.php')) require_once __DIR__.'/action_after_update.php';
559+
558560
checkAndUpdateResource($TruthVersion);
559561

560562
file_put_contents(RESOURCE_PATH_PREFIX.'spine/still/index.json', json_encode(

0 commit comments

Comments
 (0)