Addition of OnServerStart event.

This commit is contained in:
MobiusDevelopment
2022-09-17 21:06:11 +00:00
parent 2ec22b0f56
commit cbeca82b65
81 changed files with 1300 additions and 75 deletions

View File

@@ -160,6 +160,8 @@ import org.l2jmobius.gameserver.instancemanager.events.EventDropManager;
import org.l2jmobius.gameserver.instancemanager.games.MonsterRace;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.events.EventDispatcher;
import org.l2jmobius.gameserver.model.events.EventType;
import org.l2jmobius.gameserver.model.events.impl.OnServerStart;
import org.l2jmobius.gameserver.model.olympiad.Hero;
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
import org.l2jmobius.gameserver.network.ClientNetworkManager;
@@ -442,6 +444,11 @@ public class GameServer
CustomMailManager.getInstance();
}
if (EventDispatcher.getInstance().hasListener(EventType.ON_SERVER_START))
{
EventDispatcher.getInstance().notifyEventAsync(new OnServerStart());
}
PunishmentManager.getInstance();
Runtime.getRuntime().addShutdownHook(Shutdown.getInstance());

View File

@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.model.events;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
import org.l2jmobius.gameserver.model.events.impl.OnDayNightChange;
import org.l2jmobius.gameserver.model.events.impl.OnServerStart;
import org.l2jmobius.gameserver.model.events.impl.ceremonyofchaos.OnCeremonyOfChaosMatchResult;
import org.l2jmobius.gameserver.model.events.impl.clan.OnClanWarFinish;
import org.l2jmobius.gameserver.model.events.impl.clan.OnClanWarStart;
@@ -286,14 +287,16 @@ public enum EventType
// Trap events
ON_TRAP_ACTION(OnTrapAction.class, void.class),
ON_DAY_NIGHT_CHANGE(OnDayNightChange.class, void.class),
// Instance events
ON_INSTANCE_CREATED(OnInstanceCreated.class, void.class),
ON_INSTANCE_DESTROY(OnInstanceDestroy.class, void.class),
ON_INSTANCE_ENTER(OnInstanceEnter.class, void.class),
ON_INSTANCE_LEAVE(OnInstanceLeave.class, void.class),
ON_INSTANCE_STATUS_CHANGE(OnInstanceStatusChange.class, void.class);
ON_INSTANCE_STATUS_CHANGE(OnInstanceStatusChange.class, void.class),
// Server events
ON_SERVER_START(OnServerStart.class, void.class),
ON_DAY_NIGHT_CHANGE(OnDayNightChange.class, void.class);
private final Class<? extends IBaseEvent> _eventClass;
private final Class<?>[] _returnClass;

View File

@@ -0,0 +1,35 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.l2jmobius.gameserver.model.events.impl;
import org.l2jmobius.gameserver.model.events.EventType;
/**
* @author Mobius
*/
public class OnServerStart implements IBaseEvent
{
public OnServerStart()
{
}
@Override
public EventType getType()
{
return EventType.ON_SERVER_START;
}
}