Arakne / Araknemu

Simple Dofus server in Java
GNU Lesser General Public License v3.0
105 stars 28 forks source link

ERROR - RateLimit : close session #252

Closed ghost closed 2 years ago

ghost commented 2 years ago

Hi, first of all thanks for your work. I'm python dev, and I'm interested to work a bit on the project.

I'm trying to connect to the server with a client, but I have this error during the authentication step:

2022-04-29 12:19:52,257 ERROR [ip=127.0.0.1; account=1] RateLimit : close session

I also try to change the configuration, but there is no impact: packetRateLimit = 1000

What I did (I work on Linux):

I use client v1.29.

Thanks.

vincent4vx commented 2 years ago

Hello, can you enable TRACE logs by changing root level on log4j2.xml :

        <Root level="INFO">
            <AppenderRef ref="STDOUT" level="TRACE"/>
            <AppenderRef ref="errors" level="ERROR" />
        </Root>

to :

        <Root level="TRACE">
            <AppenderRef ref="STDOUT" level="TRACE"/>
            <AppenderRef ref="errors" level="WARN" />
        </Root>

and see exchanged packets ?

ghost commented 2 years ago

Here this is the log after enabled TRACE when I try to connect to the account:

2022-05-01 15:56:22,889 DEBUG -Dio.netty.buffer.checkAccessible: true
2022-05-01 15:56:22,890 DEBUG -Dio.netty.buffer.checkBounds: true
2022-05-01 15:56:22,891 DEBUG Loaded default ResourceLeakDetector: io.netty.util.ResourceLeakDetector@66627eb4
2022-05-01 15:56:22,926 DEBUG [ip=127.0.0.1] Session created
2022-05-01 15:56:22,927 DEBUG [ip=127.0.0.1] Send >> HCkbrrozdneucghwjlsacstjjrjbiigidk
2022-05-01 15:56:22,933 DEBUG -Dio.netty.recycler.maxCapacityPerThread: 4096
2022-05-01 15:56:22,933 DEBUG -Dio.netty.recycler.maxSharedCapacityFactor: 2
2022-05-01 15:56:22,933 DEBUG -Dio.netty.recycler.linkCapacity: 16
2022-05-01 15:56:22,933 DEBUG -Dio.netty.recycler.ratio: 8
2022-05-01 15:56:22,933 DEBUG -Dio.netty.recycler.delayedQueue.ratio: 8
2022-05-01 15:56:22,957 DEBUG [ip=127.0.0.1] Recv << 1.29.1
2022-05-01 15:56:22,958 DEBUG [ip=127.0.0.1] Recv << martin
#1X4OJ524719
2022-05-01 15:56:22,959 DEBUG Prepare query SELECT * FROM ACCOUNT WHERE USERNAME = ?
2022-05-01 15:56:22,969 DEBUG Prepare query SELECT COUNT(*) FROM BANISHMENT WHERE ACCOUNT_ID = ? AND START_DATE <= ? AND END_DATE >= ?
2022-05-01 15:56:23,150 DEBUG Prepare query REPLACE INTO CONNECTION_LOG (`ACCOUNT_ID`, `START_DATE`, `IP_ADDRESS`) VALUES (?, ?, ?)
2022-05-01 15:56:23,161 DEBUG [ip=127.0.0.1; account=1] Send >> Admartinmatin
2022-05-01 15:56:23,162 DEBUG [ip=127.0.0.1; account=1] Send >> Ac0
2022-05-01 15:56:23,163 DEBUG [ip=127.0.0.1; account=1] Send >> AlK0
2022-05-01 15:56:23,165 DEBUG [ip=127.0.0.1; account=1] Send >> AQblabla
2022-05-01 15:56:23,165 DEBUG [ip=127.0.0.1; account=1] Send >> AH1;1;110;1
2022-05-01 15:56:23,166 DEBUG [ip=127.0.0.1; account=1] Recv << Af
2022-05-01 15:56:23,166 DEBUG [ip=127.0.0.1; account=1] Send >> Aq1
2022-05-01 15:56:23,167 DEBUG [ip=127.0.0.1; account=1] Recv << Af
2022-05-01 15:56:23,167 DEBUG [ip=127.0.0.1; account=1] Send >> Aq1
2022-05-01 15:56:23,167 DEBUG [ip=127.0.0.1; account=1] Recv << Af
2022-05-01 15:56:23,167 DEBUG [ip=127.0.0.1; account=1] Send >> Aq1
...
...
2022-05-01 15:56:23,167 DEBUG [ip=127.0.0.1; account=1] Recv << Af
2022-05-01 15:56:23,167 DEBUG [ip=127.0.0.1; account=1] Send >> Aq1
2022-05-01 15:56:23,239 ERROR [ip=127.0.0.1; account=1] RateLimit : close session
2022-05-01 15:56:23,261 DEBUG [ip=127.0.0.1; account=1] Session closed

Also there are 2 errors when I start the server:

2022-05-01 16:02:11,387 DEBUG direct buffer constructor: unavailable
java.lang.UnsupportedOperationException: Reflective setAccessible(true) disabled
        at io.netty.util.internal.ReflectionUtil.trySetAccessible(ReflectionUtil.java:31) ~[araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
        at io.netty.util.internal.PlatformDependent0$4.run(PlatformDependent0.java:253) ~[araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
        at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
        at io.netty.util.internal.PlatformDependent0.<clinit>(PlatformDependent0.java:247) [araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
        at io.netty.util.internal.PlatformDependent.isAndroid(PlatformDependent.java:294) [araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
        at io.netty.util.internal.PlatformDependent.<clinit>(PlatformDependent.java:88) [araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
        at io.netty.util.ConstantPool.<init>(ConstantPool.java:34) [araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
        at io.netty.util.AttributeKey$1.<init>(AttributeKey.java:27) [araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
        at io.netty.util.AttributeKey.<clinit>(AttributeKey.java:27) [araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
        at fr.quatrevieux.araknemu.core.network.netty.SessionHandlerAdapter.<init>(SessionHandlerAdapter.java:41) [araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
        at fr.quatrevieux.araknemu.core.network.netty.NettyServer.start(NettyServer.java:72) [araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
        at fr.quatrevieux.araknemu.realm.RealmService.boot(RealmService.java:67) [araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
        at fr.quatrevieux.araknemu.Araknemu.boot(Araknemu.java:88) [araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
        at fr.quatrevieux.araknemu.Araknemu.main(Araknemu.java:186) [araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
2022-05-01 16:02:11,402 DEBUG jdk.internal.misc.Unsafe.allocateUninitializedArray(int): unavailable
java.lang.IllegalAccessException: class io.netty.util.internal.PlatformDependent0$6 cannot access class jdk.internal.misc.Unsafe (in module java.base) because module java.base does not export jdk.internal.misc to unnamed module @d737b89
        at jdk.internal.reflect.Reflection.newIllegalAccessException(Reflection.java:361) ~[?:?]
        at java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:591) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:558) ~[?:?]
        at io.netty.util.internal.PlatformDependent0$6.run(PlatformDependent0.java:375) ~[araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
        at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
        at io.netty.util.internal.PlatformDependent0.<clinit>(PlatformDependent0.java:366) [araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
        at io.netty.util.internal.PlatformDependent.isAndroid(PlatformDependent.java:294) [araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
        at io.netty.util.internal.PlatformDependent.<clinit>(PlatformDependent.java:88) [araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
        at io.netty.util.ConstantPool.<init>(ConstantPool.java:34) [araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
        at io.netty.util.AttributeKey$1.<init>(AttributeKey.java:27) [araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
        at io.netty.util.AttributeKey.<clinit>(AttributeKey.java:27) [araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
        at fr.quatrevieux.araknemu.core.network.netty.SessionHandlerAdapter.<init>(SessionHandlerAdapter.java:41) [araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
        at fr.quatrevieux.araknemu.core.network.netty.NettyServer.start(NettyServer.java:72) [araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
        at fr.quatrevieux.araknemu.realm.RealmService.boot(RealmService.java:67) [araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
        at fr.quatrevieux.araknemu.Araknemu.boot(Araknemu.java:88) [araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
        at fr.quatrevieux.araknemu.Araknemu.main(Araknemu.java:186) [araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
vincent4vx commented 2 years ago

For your issue, this is caused by the spamming of Af packet. This is probably due to invalid SWF redirection : the configuration item C.DELAY_WAIT_QUEUE_REFRESH cannot be loaded from lang_xxx_xx.swf, so il will ask for que position (i.e. Af packet) with an interval of 0 ms.

For the two other messages it's not an issue : it's simply means that netty cannot access to some optimisation because of JVM version or configuration.

ghost commented 2 years ago

Thanks for your answer. Actually, I'm not really sure of how to configure lang in the client.

After some research, this is what I did:

I know that is client configuration and, it's maybe out of scope. I will try to find a solution by myself. But if you have any idea, it can be really useful to me.

EDIT:

I found an archive with all lang, I served this files, now it's work! The authentication works well :+1:. Following this, I have 2 questions:

Thanks.

vincent4vx commented 2 years ago

For your first question, yes it's required to have a server which provide lang files. But you can use official ankama URL if you don't want to run your own web server. But it's totally out of the scope of the game server : it's for client. For the basic data set I can send you a dump by email if you want.

ghost commented 2 years ago

Ok, I was thinking that is mandatory to run a server in local to serve those files, so in this case that make sense to add some documentation in the project. But i misunderstood. Thanks to take time to solve my issue.

PS: I just send you an email for the dataset, on your gmail address (it's a protonmail address)