自動セーブシステム

Go down

自動セーブシステム

投稿 by 構築さん on 2014-05-30, 15:35

autosavefunc.jseventフォルダに入れてください

Code:
var setupTask;

function init() {
scheduleNew();
}

function scheduleNew() {
var cal = java.util.Calendar.getInstance();
cal.set(java.util.Calendar.HOUR, 0);
cal.set(java.util.Calendar.MINUTE, 5);
cal.set(java.util.Calendar.SECOND, 0);
var nextTime = cal.getTimeInMillis();
while (nextTime <= java.lang.System.currentTimeMillis())
nextTime += 60000 * 5;
setupTask = em.scheduleAtTimestamp("start", nextTime);
}

function cancelSchedule() {
setupTask.cancel(true);
}

function start() {
em.save();
// em.getChannelServer().broadcastPacket(net.sf.odinms.tools.MaplePacketCreator.serverNotice(6, "AutoSaved."));
}

scripting.event.EventManager.java

Code:
public void save() {
for (ChannelServer chan : ChannelServer.getAllInstances()) {
for (MapleCharacter chr : chan.getPlayerStorage().getAllCharacters()) {
chr.saveToDB(true);
http://BackUpper.backUpSQL(chr.getClient(), "");
}
}
}

world.properties

Code:
,autosavefunc

scripting.event.EventManager.java

Code:
import.client.MapleCharacter
avatar
構築さん
Admin

Posts : 193
Join date : 2014/05/29

http://maplescience.forumjap.com

トップに戻る Go down

トップに戻る


 
Permissions in this forum:
返信投稿: 不可