Remove access to shops from scripts

This commit is contained in:
P0nk
2023-03-29 20:38:22 +02:00
parent ec1450cec1
commit 705efb4340
2 changed files with 0 additions and 39 deletions

View File

@@ -1,25 +0,0 @@
/*
This file is part of the HeavenMS MapleStory Server
Copyleft (L) 2016 - 2019 RonanLana
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation version 3 as published by
the Free Software Foundation. You may not use, modify or distribute
this program under any other version of the GNU Affero General Public
License.
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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
function start() {
const ShopFactory = Java.type('server.ShopFactory');
ShopFactory.getInstance().getShop(11000).sendShop(cm.getClient());
cm.dispose();
}

View File

@@ -387,20 +387,6 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
getPlayer().resetStats();
}
public void openShopNPC(int id) {
// TODO: figure out a way to inject ShopFactory.
// NPCConversationManager is instantiated by NPCScriptManager, which is a static singleton.
// NPCScriptManager is accessed from all over, making it really difficult to structure dependencies properly.
Shop shop = ShopFactory.getInstance().getShop(id);
if (shop != null) {
shop.sendShop(c);
} else { // check for missing shopids thanks to resinate
log.warn("Shop ID: {} is missing from database.", id);
ShopFactory.getInstance().getShop(11000).sendShop(c);
}
}
public void maxMastery() {
for (Data skill_ : DataProviderFactory.getDataProvider(WZFiles.STRING).getData("Skill.img").getChildren()) {
try {