forked from MagicBane/Server
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.7 KiB
52 lines
1.7 KiB
3 years ago
|
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||
|
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||
|
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||
|
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||
|
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||
|
// Magicbane Emulator Project © 2013 - 2022
|
||
|
// www.magicbane.com
|
||
|
|
||
|
package engine.jobs;
|
||
|
|
||
|
import engine.gameManager.GroupManager;
|
||
|
import engine.job.AbstractScheduleJob;
|
||
|
import engine.job.JobScheduler;
|
||
|
import engine.objects.Group;
|
||
|
import engine.objects.PlayerCharacter;
|
||
|
import engine.server.MBServerStatics;
|
||
|
import org.pmw.tinylog.Logger;
|
||
|
|
||
|
public class UpdateGroupJob extends AbstractScheduleJob {
|
||
|
|
||
|
private final Group group;
|
||
|
|
||
|
public UpdateGroupJob(Group group) {
|
||
|
super();
|
||
|
this.group = group;
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
protected void doJob() {
|
||
|
|
||
|
if (this.group == null)
|
||
|
return;
|
||
|
|
||
|
PlayerCharacter lead = group.getGroupLead();
|
||
|
|
||
|
if (lead == null)
|
||
|
return;
|
||
|
|
||
|
try {
|
||
|
GroupManager.RefreshWholeGroupList(lead, lead.getClientConnection(), this.group);
|
||
|
} catch (Exception e) {
|
||
|
Logger.error( e);
|
||
|
}
|
||
|
|
||
|
JobScheduler.getInstance().scheduleJob(this, MBServerStatics.UPDATE_GROUP_RATE);
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
protected void _cancelJob() {
|
||
|
}
|
||
|
}
|