Find the proper support area, Saga-Version.
Darkfeiter
Posts: 329 Joined: Tue Dec 16, 2008 6:48 pm
Post
by Darkfeiter » Thu May 27, 2010 8:37 am
here the code and red marked are the errors.
Code: Select all
if (Config.L2JMOD_COUNT_DUALBOX) { int onlineboxes= 0; onlineboxes=[color=#FF0000]countIP[/color](activeChar); if (onlineboxes>Config.L2JMOD_COUNT_DUALBOX_MAX_PER_IP) { activeChar.sendPacket(new ExShowScreenMessage("Only " + Integer.toString(Config.L2JMOD_COUNT_DUALBOX_MAX_PER_IP)+ " boxes per IP allowed! Bye!", 15000)); activeChar.sendMessage("Only " + Integer.toString(Config.L2JMOD_COUNT_DUALBOX_MAX_PER_IP)+ " boxes per IP allowed! Bye!"); activeChar.getClient().[color=#FF0000]handleCheat[/color]("Too much boxes per IP"); } }
so some more :S
Code: Select all
private int countIP(L2PcInstance activeChar) { int connections = 0; String IPadress =""; try { IPadress = activeChar.getClient().getConnection().getSocketChannel().socket().getInetAddress().getHostAddress(); } catch (Exception e) { return 0; //no adress (fake online) } //_log.warning("PlayerIP: " + IPadress); Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers().values(); for (L2PcInstance player : pls) { try { if (IPadress.equalsIgnoreCase(player.getClient().getConnection().getSocketChannel().socket().getInetAddress().getHostAddress())) connections = connections +1 ; //_log.warning("CheckIP: " + player.getClient().getConnection().getSocketChannel().socket().getInetAddress().getHostAddress()); } catch (Exception e) { continue; //no adress or fake online } }
Collection and values are error sry the furom will scroll up if wanna make and add red
thanks for help me
Last edited by
Darkfeiter on Thu May 27, 2010 8:40 am, edited 1 time in total.
janiii
L2j Veteran
Posts: 4269 Joined: Wed May 28, 2008 3:15 pm
Location: Slovakia
Post
by janiii » Thu May 27, 2010 8:39 am
again - wrong section. custom server mods is for contribution of custom server mods, not for support. and for interlude support, use just the section for legacy server! next time you write for interlude support in other section, you will get a warning.
and again - what is the error? not what is red, but what is the error there - what does eclipse says there? or what the compilation says..
when you want support for a custom mod, you should give us the source of the whole mod, not only of a part.
or you should just get support from where you have the mod:
1. it is custom mod and not supported by l2j
2. legacy support
3. mod was not posted on l2j forum
DO NOT EVEN TRY TO MESS WITH ME!
forum flOO der dancing dEVIL oper ♀
I don't give private support - PM will be ignored!
Darkfeiter
Posts: 329 Joined: Tue Dec 16, 2008 6:48 pm
Post
by Darkfeiter » Thu May 27, 2010 8:42 am
its just marked red in eclipse so and this is maybe code from final or whatever but i need it :S
Darkfeiter
Posts: 329 Joined: Tue Dec 16, 2008 6:48 pm
Post
by Darkfeiter » Thu May 27, 2010 8:43 am
ok here complete code :
Code: Select all
Index: java/com/l2jserver/Config.java===================================================================--- java/com/l2jserver/Config.java (revision 3968)+++ java/com/l2jserver/Config.java (working copy)@@ -658,7 +658,17 @@ public static String ANNOUNCE_PK_MSG; public static String ANNOUNCE_PVP_MSG; public static boolean L2JMOD_CHAT_ADMIN; public static int L2JMOD_GAK_KARMA; public static int L2JMOD_GAK_ITEM_ID; public static int L2JMOD_GAK_ITEM_COUNT; public static int L2JMOD_GAK_TIME; public static int L2JMOD_BOOM_X; public static int L2JMOD_BOOM_Y; public static int L2JMOD_BOOM_Z;+ public static boolean L2JMOD_COUNT_DUALBOX;+ public static int L2JMOD_COUNT_DUALBOX_MAX_PER_IP;+ //-------------------------------------------------- // NPC Settings //--------------------------------------------------@@ -2173,6 +2206,15 @@ ANNOUNCE_PVP_MSG = L2JModSettings.getProperty("AnnouncePvpMsg", "$killer has defeated $target"); L2JMOD_CHAT_ADMIN = Boolean.parseBoolean(L2JModSettings.getProperty("ChatAdmin", "false")); L2JMOD_GAK_KARMA = Integer.parseInt(L2JModSettings.getProperty("GAKKarmaAmout", "1000")); L2JMOD_GAK_ITEM_ID = Integer.parseInt(L2JModSettings.getProperty("GAKItemId", "57")); L2JMOD_GAK_ITEM_COUNT = Integer.parseInt(L2JModSettings.getProperty("GAKItemCount", "1")); L2JMOD_GAK_TIME = Integer.parseInt(L2JModSettings.getProperty("GAKReuseTime", "12")); L2JMOD_BOOM_X = Integer.parseInt(L2JModSettings.getProperty("BoomX", "1")); L2JMOD_BOOM_Y = Integer.parseInt(L2JModSettings.getProperty("BoomY", "1")); L2JMOD_BOOM_Z = Integer.parseInt(L2JModSettings.getProperty("BoomZ", "1"));+ L2JMOD_COUNT_DUALBOX = Boolean.parseBoolean(L2JModSettings.getProperty("CountDualBoxes", "False"));+ L2JMOD_COUNT_DUALBOX_MAX_PER_IP = Integer.parseInt(L2JModSettings.getProperty("MaxCountDualBoxesPerIP", "1")); } catch (Exception e) {Index: java/com/l2jserver/gameserver/network/clientpackets/EnterWorld.java===================================================================--- java/com/l2jserver/gameserver/network/clientpackets/EnterWorld.java (revision 3968)+++ java/com/l2jserver/gameserver/network/clientpackets/EnterWorld.java (working copy)@@ -384,7 +390,64 @@+ + if (Config.L2JMOD_COUNT_DUALBOX)+ { + int onlineboxes= 0;+ onlineboxes=countIP(activeChar);+ if (onlineboxes>Config.L2JMOD_COUNT_DUALBOX_MAX_PER_IP)+ {+ activeChar.sendPacket(new ExShowScreenMessage("Only " + Integer.toString(Config.L2JMOD_COUNT_DUALBOX_MAX_PER_IP)+ " boxes per IP allowed! Bye!", 15000));+ activeChar.sendMessage("Only " + Integer.toString(Config.L2JMOD_COUNT_DUALBOX_MAX_PER_IP)+ " boxes per IP allowed! Bye!");+ activeChar.getClient().handleCheat("Too much boxes per IP");+ }+ }+ @@ -638,4 +701,91 @@+ + private int countIP(L2PcInstance activeChar)+ {+ int connections = 0;+ String IPadress ="";+ try+ {+ IPadress = activeChar.getClient().getConnection().getInetAddress().getHostAddress();+ }+ catch (Exception e)+ {+ return 0; //no adress (fake online)+ }+ //_log.warning("PlayerIP: " + IPadress); + Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers().values();+ for (L2PcInstance player : pls)+ {+ try+ {+ if (IPadress.equalsIgnoreCase(player.getClient().getConnection().getInetAddress().getHostAddress())) connections = connections +1 ;+ //_log.warning("CheckIP: " + player.getClient().getConnection().getInetAddress().getHostAddress());+ }+ catch (Exception e)+ {+ continue; //no adress or fake online+ } + }+ //_log.warning("count: " + Integer.toString(connections));+ return connections;+ } }Index: java/config/l2jmods.properties===================================================================--- java/config/l2jmods.properties (revision 3968)+++ java/config/l2jmods.properties (working copy)@@ -334,3 +334,23 @@ # Check access_levels.sql and admin_command_access_rights for details. # Default: False ChatAdmin = False++# ---------------------------------------------------------------------------+# Boxing controll+# ---------------------------------------------------------------------------+# This option controls dualboxes count. Default punish is given if count > than preset. Default: False,1+CountDualBoxes = False+MaxCountDualBoxesPerIP = 1
and the lines that i say is something wrong whatever and i need help and sorry about wrong section
janiii
L2j Veteran
Posts: 4269 Joined: Wed May 28, 2008 3:15 pm
Location: Slovakia
Post
by janiii » Thu May 27, 2010 8:45 am
it is not whatever error, you have to tell the error! check the red marks in eclipse or try to compile and paste here the errors!
DO NOT EVEN TRY TO MESS WITH ME!
forum flOO der dancing dEVIL oper ♀
I don't give private support - PM will be ignored!
Darkfeiter
Posts: 329 Joined: Tue Dec 16, 2008 6:48 pm
Post
by Darkfeiter » Thu May 27, 2010 8:50 am
the method handlecheat (String) is undifined for the type L2GameClient.
so thats first red thing
Collection cannot be resolved to a type
the method Values() is undifined for the type collection.
so that eclipse says to me :S
janiii
L2j Veteran
Posts: 4269 Joined: Wed May 28, 2008 3:15 pm
Location: Slovakia
Post
by janiii » Thu May 27, 2010 8:53 am
if eclipse says something cannot be resolved, that means it is not imported or cannot be found in classpath.
import Collection -> ctrl+shift+o in eclipse for organize imports (yeah, i already told you this last time..)
for the other, check L2GameClient class and if it has a similar method to handle cheat. or check other classes how they handle cheats and punishment and apply it instead of the handleCheat method.
this is what handleCheat method does:
Code: Select all
public boolean handleCheat(String punishment) { if (_activeChar != null) { Util.handleIllegalPlayerAction(_activeChar, toString()+": "+punishment, Config.DEFAULT_PUNISH); return true; } Logger _logAudit = Logger.getLogger("audit"); _logAudit.log(Level.INFO, "AUDIT: Client "+toString()+" kicked for reason: "+punishment); closeNow(); return false; }
DO NOT EVEN TRY TO MESS WITH ME!
forum flOO der dancing dEVIL oper ♀
I don't give private support - PM will be ignored!
JIV
L2j Veteran
Posts: 1882 Joined: Sun Jan 06, 2008 8:17 pm
Location: Slovakia
Contact:
Post
by JIV » Thu May 27, 2010 8:55 am
handleCheat() can be replaced with kick (eg com.l2jserver.gameserver.network.L2GameClient.closeNow())
others are easy, just think first.
Darkfeiter
Posts: 329 Joined: Tue Dec 16, 2008 6:48 pm
Post
by Darkfeiter » Thu May 27, 2010 9:28 am
so i have just 1 the Values .
Code: Select all
return 0; //no adress (fake online) } //_log.warning("PlayerIP: " + IPadress); Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers().[color=#FF0000]values[/color](); for (L2PcInstance player : pls) { try
if i try with eclipse quick fix it dont work so what can i do with that ?sorry i am beginner with java and eclipse and sorry about my english
janiii
L2j Veteran
Posts: 4269 Joined: Wed May 28, 2008 3:15 pm
Location: Slovakia
Post
by janiii » Thu May 27, 2010 9:29 am
check what the method getAllPlayers() return. probably you can just delete the values() from there.
DO NOT EVEN TRY TO MESS WITH ME!
forum flOO der dancing dEVIL oper ♀
I don't give private support - PM will be ignored!
Darkfeiter
Posts: 329 Joined: Tue Dec 16, 2008 6:48 pm
Post
by Darkfeiter » Thu May 27, 2010 9:37 am
i deletet it and test it thx for your help
so tryed the client dont load up but console show error like this :
also 1 i can use at 2 show the error so if i edit config i can use 2 and on 3 error so donno :S pls help me
Darkfeiter
Posts: 329 Joined: Tue Dec 16, 2008 6:48 pm
Post
by Darkfeiter » Thu May 27, 2010 12:09 pm
anyone can help ??
janiii
L2j Veteran
Posts: 4269 Joined: Wed May 28, 2008 3:15 pm
Location: Slovakia
Post
by janiii » Thu May 27, 2010 12:15 pm
be more specific what you did - how you "fixed" the errors in eclipse. how does your handleCheat method looks like?
DO NOT EVEN TRY TO MESS WITH ME!
forum flOO der dancing dEVIL oper ♀
I don't give private support - PM will be ignored!
Darkfeiter
Posts: 329 Joined: Tue Dec 16, 2008 6:48 pm
Post
by Darkfeiter » Thu May 27, 2010 2:28 pm
i used your handleCheat just go with mouse over it and see quick fix from eclipse side so donno if its right or not
just at Value that i delete from the code
JIV
L2j Veteran
Posts: 1882 Joined: Sun Jan 06, 2008 8:17 pm
Location: Slovakia
Contact:
Post
by JIV » Thu May 27, 2010 3:12 pm
it was only as example, you shouldn't copy paste method but create similar one.