com.aol.acc.AccException: IAccSession_SignOn when trying to login with a very simple bot.

I'm trying to create a very simple bot following the accjbot example, that does nothing except log each event in AccEventListener interface.

After having some problems getting the native library to load (you have to configure the DYLD_LIBRARY_PATH environment variable on OSX) I was able to get the program to link and run, but I'm getting a mysterious exception when trying to execute AccSession.signOn();

I've checked and double checked that my password is correct, which leads me to believe that I have something misconfigured somewhere.

I did find this thread: http://dev.aol.com/node/995 but I'm not sure if that's related.

here is my class:

package net.tfs.league.shell.aim;

import com.aol.acc.*;
import static org.apache.commons.lang.StringUtils.join;

import java.lang.reflect.*;

public class SendMessage {


	public static void main(String[] args) throws AccException {
		String key = "GameOn Leagues (Key:XXXXXXXX)";
		String name = "gamexonbot";

		AccSession session = new AccSession();
		AccClientInfo info = session.getClientInfo();

		info.setDescription(key);

		session.setIdentity(name);
		session.setEventListener(AIMListener.create());

		session.signOn("XXXXX");

		for (;;) {

			try {
				AccSession.pump(50);
			} catch (Exception e) {
				e.printStackTrace();
			}

			try {
				Thread.sleep(50);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}

	}

	private static class AIMListener implements InvocationHandler {
	
		public static AccEvents create() {
			return (AccEvents) Proxy.newProxyInstance(AIMListener.class.getClassLoader(), new Class[] {AccEvents.class}, new AIMListener());
		}

		public Object invoke(Object o, Method method, Object[] objects) throws Throwable {
			System.out.printf("%s(%s)\n", method.getName(), join(objects, ","));
			return Void.TYPE;
		}
	}
}

and it receives the following exception:

Exception in thread "main" com.aol.acc.AccException: IAccSession_SignOn
	at com.aol.acc.AccSession.SignOn(Native Method)
	at com.aol.acc.AccSession.signOn(AccSession.java:113)
	at net.tfs.league.shell.aim.SendMessage.main(SendMessage.java:53)

What am I misconfiguring? Is there a way to get at the error of the underlying native library?

Also, here is the files which are in my java.library.path and also my DYLD_LIBRARY_PATH. It's just the release directory of the download for OSX.

gandalf:~/devlibs/accsdk_macosx_univ_1_6_7/C++ cowboyd$ ls -l dist/release/
total 27480
-rwxr-xr-x   1 cowboyd  cowboyd   580416 Mar  4 10:37 accbuddy
-rw-r--r--   1 cowboyd  cowboyd   157790 Mar  4 10:35 accjwrap.jar
-rwxr-xr-x   1 cowboyd  cowboyd  1930516 Mar  4 10:35 libacccore.dylib
-rwxr-xr-x   1 cowboyd  cowboyd  1085312 Mar  4 10:35 libaccjwrap.jnilib
-rwxr-xr-x   1 cowboyd  cowboyd  4818100 Mar  4 17:18 libcoolcore52.dylib
-rwxr-xr-x   1 cowboyd  cowboyd   671116 Mar  3 11:48 libfreebl3.dylib
-rwxr-xr-x   1 cowboyd  cowboyd   533544 Mar  3 11:48 libnspr4.dylib
-rwxr-xr-x   1 cowboyd  cowboyd  1091616 Mar  3 11:48 libnss3.dylib
-rwxr-xr-x   1 cowboyd  cowboyd   631640 Mar  3 11:48 libnssckbi.dylib
-rwxr-xr-x   1 cowboyd  cowboyd   138528 Mar  3 11:48 libplc4.dylib
-rwxr-xr-x   1 cowboyd  cowboyd   128816 Mar  3 11:48 libplds4.dylib
-rwxr-xr-x   1 cowboyd  cowboyd   347176 Mar  3 11:48 libsmime3.dylib
-rwxr-xr-x   1 cowboyd  cowboyd   766232 Mar  3 11:48 libsoftokn3.dylib
-rwxr-xr-x   1 cowboyd  cowboyd   366592 Mar  3 11:48 libssl3.dylib
-rwxr-xr-x   1 cowboyd  cowboyd   793444 Mar  4 17:18 libxprt6.dylib

Unknown Error

Thanks,

The errorCode of the exception is:

e.errorCode = UNKNOWNVALUE
e.errorCode.value() = -2147483640

I'm not sure if that sheds any light on the issue.

Re: Unknown Error

That's E_FAIL. That could be the problem discussed in the other thread you mentioned. Have you checked your computer's clock?

Yes, but maybe against the wrong time?

I checked the system clock, and as far as I can tell it is accurate (certainly within a few seconds)

How accurate does it have to be?

Re: Yes, but maybe against the wrong time?

I'm told it would have to be off by hours for that to be the problem.

Re: com.aol.acc.AccException: IAccSession_SignOn when trying to

To get at the error code in the exception, I believe it's something like this...

try {
...
}
catch (AccException e) {
System.out.println(e.errorCode);
}

Found the problem

For some reason, it works whenever the working directory of the JVM is the C++/dist/release directory of the SDK. Even though I put my java.library.path and the DYLD_LIBRARY_PATH to include that directory, it will not function unless it's actually run from that directory.

Obviously that won't work in production.

In fact, it appears that the only thing that matters is that the working directory contain the dynlibs. Is there any way around this?

Uggly solution

I had the same problem while trying to launch a robot from within a web app running on Tomcat, I tried copying/linking the libraries/jars to my tomcat/bin, which is in my case where Im starting the app. and It worked!!.

This might be some design issue on how and from were the wrapper expects to load the libraries. Hopefully it will be solved in a later release

Need to put the libraries in the same dir as the app.

Hi,

We are looking into other ways of solving this problem, but right now you need to put the libraries in the same dir as the app.
This is the only solution we have at this moment.

Thanks.

Re: Found the problem

The nss dylibs are required, but it should be possible to load them from a different directory. In C languages, one would call AccSetDelayLoadRoot(), but I don't see a way to call that from Java. Asking our Java expert...

Any Progress?

I'm continuing to develop, but would need to have this issue resolved first before going live with the application. I've tried loading the libraries manually with a call to System.load() and System.loadLibrary() but that only serves to make matters worse.

Is anybody successfully able to control the working directory of a java AIMBot on unix?

Need to put the libraries in the same dir as the app.

Hi,

We are looking into other ways of solving this problem, but right now you need to put the libraries in the same dir as the app.
This is the only solution we have at this moment.

Thanks.

Did you hear back from the java expert?

I've been developing aimbot integration with our app as a side project for around 15 minutes/day, and I'm really impressed with how easy it is. If I could solve this problem it would mean being able to deploy it that much sooner.

Bundling Native Libraries with accjwrap.jar

Once this problem is resolved, perhaps AOL should provide a version of the SDK with all the native libraries bundled inside one jar file. That way, java users only need to put a single file in their classpath.

JLine does this, and it makes life alot easier. Basically, there would be a little bit of bootstrapping java code to manually load the native libraries.