Skip to content

[Request] I Need Help With a Little Code (do not already exist)

Featured Replies

I need a code to search the C3P0 library if there is any line then the server starts. for example:

this "code" there is only an explanation!

 

if getfrom c3p0 library example c3p0.com.mchange.util.AssertException

(

    line maxcheater don't exist

)

return;

 

if getform c3p0 library c3p0.com.mchange.util.AssertException

(

   lineage 2 maxcheaters

)

continue;

 

for start GS

 

anyway tx for read

First of all: GS wont start if C3P0 does not exist (will throw an error and will

end abnormally)

 

didnt understood the question clarify, but here we go:

 

check if the library exists:

 

try
{
File mainjar = new File("l2jserver.jar");
String libpath = mainjar.getAbsolutePath().split("gameserver")[0];
File c3p0 = new File(libpath + "lib/c3p0jarname.jar");
return c3p0.exists();
}
catch(Exception e)
{ }
return false;

 

check if any class inside c3p0 exists:

 

try
{	
Class<?> func = Class.forName("package.path.here");
Object obj = func.newInstance();
return obj != null;
}
catch(ClassNotFoundException cnfe)
{ 
}
return false;

  • Author

I was looking for this, sorry for my bad explanation. you're the man! very ty bigboss

now i can continue ;)

really ty. :)

locked.if you want something else pm me to unlock it

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.