Sinister Smile Posted June 15, 2017 Share Posted June 15, 2017 Im looking for anti over enchant code (when enter game to have check) for Acis Link to comment Share on other sites More sharing options...
0 SweeTs Posted June 15, 2017 Share Posted June 15, 2017 Rofl and what for. Link to comment Share on other sites More sharing options...
0 Sinister Smile Posted June 15, 2017 Author Share Posted June 15, 2017 Rofl and what for. For that the players can have over enchanted items, and they not get kick or jail or ban. That's why :P Link to comment Share on other sites More sharing options...
0 Solomun Posted June 15, 2017 Share Posted June 15, 2017 EnterWorld.java Something like this (i am from phone atm, can't search for the exact methods and etc). Try to do it by yourself, wont be hard. private boolean hasOverEnchantedItems(L2PcInstance player, int enchantLimit) { For (L2ItemInstance item : player.getInventory.getAllItems()) { if (item.getEnchantLevel() > enchantLimit) //player has over enchanted items return true; } return false; Now return in main method of EnterWorld.java and add this somewhere if (hasOverEnchantedItems(activeChar,20) //more than +20, banned { // JAIL - BAN // Steal code from admin commands } Note: This is going to be kinda slow and add some weight to your server... So, there might be another method than getAllItems() which returns only the armors or the weapons (for example getWeapons()). Try to search a little bit...Also, i would give a try to search how an item is added into the game, aka the constructor of L2itemInstance, where and when it is called. You could add a check into this constructor, but this is going to be kinda hard for you (dont wanna offend you, but the thing you ask gives me the clue you are new to this :)), since it might want some research before you do it... Link to comment Share on other sites More sharing options...
0 Sinister Smile Posted June 15, 2017 Author Share Posted June 15, 2017 EnterWorld.java Something like this (i am from phone atm, can't search for the exact methods and etc). Try to do it by yourself, wont be hard. private boolean hasOverEnchantedItems(L2PcInstance player, int enchantLimit) { For (L2ItemInstance item : player.getInventory.getAllItems()) { if (item.getEnchantLevel() > enchantLimit) //player has over enchanted items return true; } return false; Now return in main method of EnterWorld.java and add this somewhere if (hasOverEnchantedItems(activeChar,20) //more than +20, banned { // JAIL - BAN // Steal code from admin commands } Note: This is going to be kinda slow and add some weight to your server... So, there might be another method than getAllItems() which returns only the armors or the weapons (for example getWeapons()). Try to search a little bit...Also, i would give a try to search how an item is added into the game, aka the constructor of L2itemInstance, where and when it is called. You could add a check into this constructor, but this is going to be kinda hard for you (dont wanna offend you, but the thing you ask gives me the clue you are new to this :)), since it might want some research before you do it... yep im new in java, that's why i ask help here cuz i know here have good dev's. Also thx for the suggestion i will search other method for checking the items. P.S. - if someone have other method please post it here :D. Thanks! Link to comment Share on other sites More sharing options...
0 Lioy Posted June 15, 2017 Share Posted June 15, 2017 the only way players have over enchanted items on aCis is corruption. Link to comment Share on other sites More sharing options...
0 Celestine Posted June 15, 2017 Share Posted June 15, 2017 the only way players have over enchanted items on aCis is corruption. 2017 servers w/o corruption? xD impossible Link to comment Share on other sites More sharing options...
0 Solomun Posted June 15, 2017 Share Posted June 15, 2017 yep im new in java, that's why i ask help here cuz i know here have good dev's. Also thx for the suggestion i will search other method for checking the items. P.S. - if someone have other method please post it here :D. Thanks! Like @Lioy mentioned, it is impossible to have items enchanted more than the one set to configs. Of course if your pack is buggish as hell, you could see something like that, or with "backdoors". However, if you want to add this kind of protection because you don't trust your GM team but at the same time you don't wanna to decrease their access level i suggest you something else. Go to admin_enchant and add an if statement and do whatever u want with the char/item/log message Link to comment Share on other sites More sharing options...
0 melron Posted June 15, 2017 Share Posted June 15, 2017 Enterworld check isnt the best case.. i can store my +60 weap into wh , log out, log in , withdraw. Add a check in useItem method . You can do many things like in setEnchant method allow only < ur + . Link to comment Share on other sites More sharing options...
0 Tryskell Posted June 16, 2017 Share Posted June 16, 2017 If you can freely overenchant on a aCis server, that's the least of your fears, believe me. You probably can entirely wipe your server, because you got either a black sheep on administration, a backdoor, or a security breach related to connections (can be website or "crafted" queries where people can write input). It's a totally pointless "protection" and - as said Solomun - a bigger burden than a gain. Link to comment Share on other sites More sharing options...
0 Sinister Smile Posted June 16, 2017 Author Share Posted June 16, 2017 If you can freely overenchant on a aCis server, that's the least of your fears, believe me. You probably can entirely wipe your server, because you got either a black sheep on administration, a backdoor, or a security breach related to connections (can be website or "crafted" queries where people can write input). It's a totally pointless "protection" and - as said Solomun - a bigger burden than a gain. I know the acis have overenchant protection, but my point is if u have wep+++ for e.x. +100 you wont get kick, ban or etc. Also my server is still beta and im testing things .. Link to comment Share on other sites More sharing options...
0 Tryskell Posted June 16, 2017 Share Posted June 16, 2017 (edited) We don't have specific overenchant protection, for the simple reason there is no needs. The chance is calculated server side, and the current enchant value is took from a valid ItemInstance ; it's impossible to trick the server feeding with fake values. Your point is still invalid, for the simple reason it can't happen. Your only possibilities are : you got a corrupted GM you got a security flaw, where people can write their own queries (and it's easier to destroy your server TRUNCATE tables than to provide yourself enchant, believe me). you don't use vanilla aCis, therefore the dude who shared it - shared it with backdoors (and I can only say him : "good job" and to you : "That'll teach you!"). In none of those cases, an overenchant protection will help you, because in any case if the guy can overenchant, he is part of admin crew, from one maneer or another and will probably harm your server more than a simple overenchant crap. Edited June 16, 2017 by Tryskell Link to comment Share on other sites More sharing options...
0 Sinister Smile Posted June 16, 2017 Author Share Posted June 16, 2017 We don't have specific overenchant protection, for the simple reason there is no needs. The chance is calculated server side, and the current enchant value is took from a valid ItemInstance ; it's impossible to trick the server feeding with fake values. Your point is still invalid, for the simple reason it can't happen. Your only possibilities are : you got a corrupted GM you got a security flaw, where people can write their own queries (and it's easier to destroy your server TRUNCATE tables than to provide yourself enchant, believe me). you don't use vanilla aCis, therefore the dude who shared it - shared it with backdoors (and I can only say him : "good job" and to you : "That'll teach you!"). In none of those cases, an overenchant protection will help you, because in any case if the guy can overenchant, he is part of admin crew, from one maneer or another and will probably harm your server more than a simple overenchant crap. Okey, i understand. Thank you. And i wont have Gm's i will be the only one admin ;] Topic can be locked. Link to comment Share on other sites More sharing options...
Question
Sinister Smile
Im looking for anti over enchant code (when enter game to have check) for Acis
Link to comment
Share on other sites
12 answers to this question
Recommended Posts