Night.png);">
Apprendre


Vous êtes
nouveau sur
Oniromancie?

Visite guidée
du site


Découvrir
RPG Maker

RM 95
RM 2000/2003
RM XP
RM VX/VX Ace
RM MV/MZ

Apprendre
RPG Maker

Tutoriels
Guides
Making-of

Dans le
Forum

Section Entraide

Sorties: Star Trek: Glorious Wolf - (...) / Sorties: Dread Mac Farlane - episode 3 / News: Plein d'images cools créées par (...) / Sorties: Star Trek: Glorious Wolf - (...) / Jeux: Final Fantasy 2.0 / Chat

Bienvenue
visiteur !




publicité RPG Maker!

Statistiques

Liste des
membres


Contact

Mentions légales

232 connectés actuellement

29185324 visiteurs
depuis l'ouverture

5589 visiteurs
aujourd'hui



Barre de séparation

Partenaires

Indiexpo

Akademiya RPG Maker

Blog Alioune Fall

Fairy Tail Constellations

Kingdom Ultimate

Eclipso

Guelnika & E-magination

Tous nos partenaires

Devenir
partenaire



Backup Database Plugin

Un plugin pour RPG Maker MZ qui sauvegarde vos fichiers data à chaque test de jeu.

Script pour RPG Maker MV
Ecrit par triacontane (site de l'auteur)
Publié par Gari (lui envoyer un message privé)
Signaler un script cassé

❤ 0

Auteur : triacontane (Blog ; Twitter)
Logiciel : RPG Maker MZ
Nombre de plugins : 1
Source : https://forums.rpgmakerweb.com/index.php?threads/backup-database-plugin.127858/

Fonctionnalités
- Chaque fois que vous testez le projet, les dossiers avec les fichiers data sont sauvegardés.
- Les dossiers sont sauvegardés par date à l'endroit que vous spécifiez, sans limite.
- Ce plugin ne fonctionne que lorsque le jeu est en playtest. Il ne fonctionne pas lorsque vous testez un combat, un event, en jeu normal ou sur internet.
- Gardez à l'esprit que malgré de nombreux test, ce plugin ne garantit pas que vos fichiers pourront être restaurés en cas de corruption du jeu.

Conditions d'utilisation
Ce plugin est sous licence MIT :
- Vous devez créditer l'auteur sous cette forme : (c) 2020, Triacontane
- Vous pouvez distribuer ce plugin ou une version modifiée sans permission de l'auteur.
- Il n'y a pas de restriction d'usage : vous pouvez l'utiliser dans vos jeux commerciaux ou pour du contenu sensible (-18 ans)

Portion de code : Tout sélectionner

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
//=============================================================================
// BackUpDatabase.js
// ----------------------------------------------------------------------------
// (C)2018 Triacontane
// This software is released under the MIT License.
// http://opensource.org/licenses/mit-license.php
// ----------------------------------------------------------------------------
// Version
// 2.0.1 2020/09/20 リファクタリング
// 2.0.0 2020/09/19 MZ版として非同期処理で全面的に再構築
// 1.1.1 2018/05/13 1.1.0でエラーになる問題を修正
// 1.1.0 2018/05/13 バックアップフォルダを時間単位で作成できる機能を追加
// 1.0.0 2018/04/21 初版
// ----------------------------------------------------------------------------
// [Blog]   : https://triacontane.blogspot.jp/
// [Twitter]: https://twitter.com/triacontane/
// [GitHub] : https://github.com/triacontane/
//=============================================================================
 
/*:
 * @plugindesc BackUpDatabasePlugin
 * @target MZ
 * @url https://github.com/triacontane/RPGMakerMV/tree/mz_master/BackUpDatabase.js
 * @base PluginCommonBase
 * @author triacontane
 *
 * @param backUpPathText
 * @desc The output path of the file. Relative and absolute paths are available.
 * @default /backup
 *
 * @param includeSave
 * @desc The folder that contains the saved data will also be backed up.
 * @default false
 * @type boolean
 *
 * @param timeUnit
 * @desc When enabled, creates a folder by time. If disabled, folders are created by date.
 * @default false
 * @type boolean
 *
 * @help BackUpDatabase.js
 *
 * Each time you start the game, you copy a set of data folders to a designated location.
 * The folders are stored by date and there is no limit.
 * This plugin only works during test play.
 * It won't do anything in normal play, combat testing, event testing, or browser play.
 * Please note that although the plugin has been thoroughly tested, the
 * This plugin does not guarantee that the project will always be restored in the event of a problem.
 *
 * This plugin is released under the MIT License.
 */
/*:ja
 * @plugindesc データバックアッププラグイン
 * @target MZ
 * @url https://github.com/triacontane/RPGMakerMV/tree/mz_master/BackUpDatabase.js
 * @base PluginCommonBase
 * @author トリアコンタン
 *
 * @param backUpPathText
 * @text バックアップパス
 * @desc ファイルの出力パスです。相対パス、絶対パスが利用できます。
 * @default /backup
 *
 * @param includeSave
 * @text セーブデータも含む
 * @desc セーブデータが含まれているフォルダもバックアップの対象にします。
 * @default false
 * @type boolean
 *
 * @param timeUnit
 * @text 時間単位でフォルダ作成
 * @desc 有効にすると時間単位でフォルダを作成します。無効にすると日付単位でフォルダを作成します。
 * @default false
 * @type boolean
 *
 * @help BackUpDatabase.js
 *
 * ゲームを起動するたびにデータフォルダ一式を所定の場所にコピーします。
 * フォルダは日付ごとに蓄積され、上限はありません。
 * このプラグインはテストプレー時のみ効果があります。
 * 通常プレー、戦闘テスト、イベントテスト、ブラウザプレーでは何もしません。
 * なお、プラグインの動作テストは十分に行っていますが、
 * 当プラグインは問題発生時のプロジェクト復元を常に保証するものではありません。
 *
 * このプラグインの利用にはベースプラグイン『PluginCommonBase.js』が必要です。
 * 『PluginCommonBase.js』は、RPGツクールMZのインストールフォルダ配下の
 * 以下のフォルダに格納されています。
 * dlc/BasicResources/plugins/official
 *
 * 利用規約:
 *  作者に無断で改変、再配布が可能で、利用形態(商用、18禁利用等)
 *  についても制限はありません。
 *  このプラグインはもうあなたのものです。
 */
 
(()=> {
    'use strict';
 
    if (!Utils.isNwjs()) {
        return;
    }
    const script = document.currentScript;
    const param = PluginManagerEx.createParameter(script);
 
    const _SceneManager_initialize = SceneManager.initialize;
    SceneManager.initialize = function() {
        _SceneManager_initialize.apply(this, arguments);
        DataManager.backupAllData();
    };
 
    DataManager.backupAllData = function() {
        if (!Utils.isOptionValid('test') || this.isBattleTest() || this.isEventTest()) {
            return;
        }
        BackUpUtil.backup().then(() => {
            console.log(`Backup complete by ${PluginManagerEx.findPluginName(script)}`);
        });
    };
 
    /**
     * BackUpUtil
     *  バックアップファイルを作成するためのユーティリティです。
     */
    class BackUpUtil {
 
        static async backup() {
            this._date = new Date();
            await this._copy('data');
            await this._copy('', /\w+\.rmmzproject/);
            if (param.includeSave) {
                await this._copy('save');
            }
        }
 
        static async _copy(targetDirectory, regExp = null) {
            const src = this._getProjectPath(targetDirectory);
            const dist = this._getBackupPath(targetDirectory);
            const copyModel = new FileCopyModel(src, dist);
            await copyModel.copyAllFiles(regExp);
        }
 
        static _getProjectPath(directory) {
            const path = require('path');
            const base = path.dirname(process.mainModule.filename);
            return path.join(base, `${directory}/`);
        }
 
        static _getBackupPath(dirName) {
            const root = this._getBackupRoot();
            if (!dirName) {
                return root;
            }
            const year = this._date.getFullYear();
            const month = (this._date.getMonth() + 1).padZero(2);
            const day = this._date.getDate().padZero(2);
            return `${root}${dirName}_${year}-${month}-${day}${this._getTimeText()}/`;
        }
 
        static _getBackupRoot() {
            const filePath = param.backUpPathText;
            if (!filePath.match(/^[A-Z]:/)) {
                return this._getProjectPath(filePath);
            }
            return filePath.match(/\/$/) ? filePath : filePath + '/';
        };
 
        static _getTimeText() {
            if (!param.timeUnit) {
                return '';
            }
            const hour = this._date.getHours().padZero(2);
            const minute = this._date.getMinutes().padZero(2);
            const second = this._date.getSeconds().padZero(2);
            return `_${hour}${minute}${second}`;
        }
    }
 
    /**
     * FileCopyModel
     * 再帰的な非同期ファイルコピーを実装します。
     */
    class FileCopyModel {
        constructor(src, dist) {
            this._fs = require('fs').promises;
            this._src = src;
            this._dist = dist;
        }
 
        async copyAllFiles(fileReqExp = null) {
            await this._fs.mkdir(this._dist, {recursive: true});
            const dirents = await this._fs.readdir(this._src, {withFileTypes: true});
            for (const dirent of dirents) {
                const name = dirent.name;
                if (fileReqExp && !fileReqExp.test(name)) {
                    continue;
                }
                if (dirent.isDirectory()) {
                    await this._copyDirectory(name + '/');
                } else {
                    await this._copyFile(name);
                }
            }
        }
 
        async _copyDirectory(dirName) {
            const path = require('path');
            const src = path.join(this._src, dirName);
            const dist = path.join(this._dist, dirName);
            await this._fs.mkdir(dist, {recursive: true});
            const subCopyModel = new FileCopyModel(src, dist);
            await subCopyModel.copyAllFiles();
        }
 
        async _copyFile(fileName) {
            const src = this._src + fileName;
            const dist = this._dist + fileName;
            await this._fs.copyFile(src, dist);
        }
    }
})();


Backup : https://raw.githubusercontent.com/triacontane/RPGMakerMV/mz_master/BackUpDatabase.js




Gari - posté le 03/03/2021 à 16:38:49 (5899 messages postés) - honor

❤ 0

Ce plugin ne remplace pas une sauvegarde régulière du jeu sur un disque dur ou le cloud, mais ça permet d'être plus tranquille en cas de petit pépin ou de modification abusive. :ange2

Suite à de nombreux abus, le post en invités a été désactivé. Veuillez vous inscrire si vous souhaitez participer à la conversation.

Haut de page

Merci de ne pas reproduire le contenu de ce site sans autorisation.
Contacter l'équipe - Mentions légales

Plan du site

Communauté: Accueil | Forum | Chat | Commentaires | News | Flash-news | Screen de la semaine | Sorties | Tests | Gaming-Live | Interviews | Galerie | OST | Blogs | Recherche
Apprendre: Visite guidée | RPG Maker 95 | RPG Maker 2003 | RPG Maker XP | RPG Maker VX | RPG Maker MV | Tutoriels | Guides | Making-of
Télécharger: Programmes | Scripts/Plugins | Ressources graphiques / sonores | Packs de ressources | Midis | Eléments séparés | Sprites
Jeux: Au hasard | Notre sélection | Sélection des membres | Tous les jeux | Jeux complets | Le cimetière | RPG Maker 95 | RPG Maker 2000 | RPG Maker 2003 | RPG Maker XP | RPG Maker VX | RPG Maker VX Ace | RPG Maker MV | Autres | Proposer
Ressources RPG Maker 2000/2003: Chipsets | Charsets | Panoramas | Backdrops | Facesets | Battle anims | Battle charsets | Monstres | Systems | Templates
Ressources RPG Maker XP: Tilesets | Autotiles | Characters | Battlers | Window skins | Icônes | Transitions | Fogs | Templates
Ressources RPG Maker VX: Tilesets | Charsets | Facesets | Systèmes
Ressources RPG Maker MV: Tilesets | Characters | Faces | Systèmes | Title | Battlebacks | Animations | SV/Ennemis
Archives: Palmarès | L'Annuaire | Livre d'or | Le Wiki | Divers