Jump to content

Recommended Posts

Hello everyone, sometimes when I log into the client, the game suddenly closes before I get to the character selection screen (i.e., after logging in and connecting to the server), and it gives a different packet error each time. This closure happens about once every 50 logins. I've recorded the logs every time this has happened. By the way, I'm using the mainline source code.

 

log1:

1102 23:30:06626 :: 

1102 23:30:06626 :: ## Network - Hand Shake Phase ##

1102 23:30:06627 :: 

1102 23:30:06643 :: HANDSHAKE RECV 36044979 0

1102 23:30:06643 :: HANDSHAKE SEND 36044979

1102 23:30:06906 :: HANDSHAKE RECV 36045218 119

1102 23:30:06906 :: HANDSHAKE SEND 36045456

1102 23:30:07071 :: HANDSHAKE RECV 36045377 79

1102 23:30:07071 :: HANDSHAKE SEND 36045535

1102 23:30:07269 :: KEY_AGREEMENT RECV 256

1102 23:30:07334 :: KEY_AGREEMENT SEND 256

1102 23:30:07863 :: KEY_AGREEMENT_COMPLETED RECV

1102 23:30:07880 :: recv ping packet. (securitymode 1)

1102 23:30:07896 :: SYSERR: Unknown packet header: 93, last: 250 44

 

log2:

1123 00:27:07697 ::

1123 00:27:07698 :: ## Network - Hand Shake Phase ##

1123 00:27:07698 ::

1123 00:27:07711 :: HANDSHAKE RECV 82820118 0

1123 00:27:07711 :: HANDSHAKE SEND 82820118

1123 00:27:07893 :: HANDSHAKE RECV 82820318 100

1123 00:27:07893 :: HANDSHAKE SEND 82820518

1123 00:27:08073 :: HANDSHAKE RECV 82820478 80

1123 00:27:08073 :: HANDSHAKE SEND 82820638

1123 00:27:08257 :: KEY_AGREEMENT RECV 256

1123 00:27:08321 :: KEY_AGREEMENT SEND 256

1123 00:27:08965 :: KEY_AGREEMENT_COMPLETED RECV

1123 00:27:08982 :: SYSERR: Unknown packet header: 212, last: 251 250

 

log3:

1102 23:44:37736 :: ## Network - Hand Shake Phase ##

1102 23:44:37737 ::

1102 23:44:37754 :: HANDSHAKE RECV 36902606 0

1102 23:44:37754 :: HANDSHAKE SEND 36902606

1102 23:44:37934 :: HANDSHAKE RECV 36902806 100

1102 23:44:37934 :: HANDSHAKE SEND 36903006

1102 23:44:38100 :: HANDSHAKE RECV 36902965 79

1102 23:44:38100 :: HANDSHAKE SEND 36903123

1102 23:44:38298 :: KEY_AGREEMENT RECV 256

1102 23:44:38364 :: KEY_AGREEMENT SEND 256

1102 23:44:38908 :: KEY_AGREEMENT_COMPLETED RECV

1102 23:44:38926 :: SYSERR: Unknown packet header: 199, last: 251 250

 

There are no errors on the server side, but I added logs for the game->client packets. These are the logs:

 

game:

Nov 23 03:21:40.118705 :: SYSTEM: new connection from [85.107.100.219] fd: 17 handshake 1183962059 output input_len 0, ptr 0x92b16900

Nov 23 03:21:40.318636 :: [GC-SEND] header=255 (0xFF) size=13 seq=0 phase=1 enc=0

Nov 23 03:21:40.478584 :: Handshake: lower than zero -20

Nov 23 03:21:40.478658 :: [GC-SEND] header=255 (0xFF) size=13 seq=0 phase=1 enc=0

Nov 23 03:21:40.638719 :: Handshake: client_time 0 server_time 82820638

Nov 23 03:21:40.715574 :: [GC-SEND] header=251 (0xFB) size=261 seq=0 phase=1 enc=0

Nov 23 03:21:40.918256 :: [GC-SEND] header=250 (0xFA) size=4 seq=0 phase=1 enc=0

Nov 23 03:21:40.920193 :: [GC-SEND] header=253 (0xFD) size=2 seq=0 phase=2 enc=1

Nov 23 03:21:41.678110 :: SYSTEM: closing socket. DESC #17

 

 

auth:

Nov 23 03:21:38.193383 :: SYSTEM: new connection from [85.107.100.219] fd: 15 handshake 1464510736 output input_len 0, ptr 0x28fe9e00

Nov 23 03:21:38.472905 :: [GC-SEND] header=255 (0xFF) size=13 seq=0 phase=1 enc=0

Nov 23 03:21:38.672914 :: Handshake: lower than zero -39

Nov 23 03:21:38.672959 :: [GC-SEND] header=255 (0xFF) size=13 seq=0 phase=1 enc=0

Nov 23 03:21:38.832944 :: Handshake: lower than zero -20

Nov 23 03:21:38.832989 :: [GC-SEND] header=255 (0xFF) size=13 seq=0 phase=1 enc=0

Nov 23 03:21:38.952905 :: Handshake: lower than zero -20

Nov 23 03:21:38.952949 :: [GC-SEND] header=255 (0xFF) size=13 seq=0 phase=1 enc=0

Nov 23 03:21:39.112985 :: Handshake: client_time 0 server_time 82824112

Nov 23 03:21:39.189768 :: [GC-SEND] header=251 (0xFB) size=261 seq=0 phase=1 enc=0

Nov 23 03:21:39.432365 :: [GC-SEND] header=250 (0xFA) size=4 seq=0 phase=1 enc=0

Nov 23 03:21:39.434474 :: [GC-SEND] header=253 (0xFD) size=2 seq=0 phase=10 enc=1

Nov 23 03:21:39.434528 :: AUTH_PHASE 0x28fe9e00

Nov 23 03:21:39.672516 :: InputAuth::Login : ruhqersa(8) desc 0x28fe9e00

Nov 23 03:21:39.672604 :: SetLoginKey 925252471

Nov 23 03:21:39.672647 :: InputAuth::Login : key 925252471:0x5cf90259 login ruhqersa

Nov 23 03:21:39.712307 :: QID_AUTH_LOGIN: START 925252471 0x28fe9e00

Nov 23 03:21:39.712397 :: Create_Time 1759104489 20250929

Nov 23 03:21:39.712423 :: Block Time -1

Nov 23 03:21:39.715244 :: SetRemainSecs ruhqersa 0 type 2

Nov 23 03:21:39.715301 :: SendAuthLogin ruhqersa key 3

Nov 23 03:21:39.912403 :: [GC-SEND] header=150 (0x96) size=6 seq=0 phase=10 enc=1

Nov 23 03:21:39.912482 :: AuthLogin result 1 key 925252471

Nov 23 03:21:40.72337 :: SYSTEM: closing socket. DESC #15

Nov 23 03:21:39.712423 :: Block Time -1

Nov 23 03:21:39.715244 :: SetRemainSecs ruhqersa 0 type 2

Nov 23 03:21:39.715301 :: SendAuthLogin ruhqersa key 3

Nov 23 03:21:39.912403 :: [GC-SEND] header=150 (0x96) size=6 seq=0 phase=10 enc=1

Nov 23 03:21:39.912482 :: AuthLogin result 1 key 925252471

Nov 23 03:21:40.72337 :: SYSTEM: closing socket. DESC #15

Link to comment
https://metin2.dev/topic/34129-sometimes-the-client-closes-when-logging-in/
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • Active+ Member

I’ve solved it by disabling improved_packet_encryption or whatever the name is. To me it happened if the connection lagged for a second 

13 minutes ago, Froslass said:

I’ve solved it by disabling improved_packet_encryption or whatever the name is. To me it happened if the connection lagged for a second 

Well, won't disabling it cause problems?

  • Active+ Member
3 hours ago, Ruhqersa said:

Well, won't disabling it cause problems?

Kinda, but not really. If you search for it on Google, there are already topics of people disabling it:

Spoiler

and more on other forums..

But before you make a decision, you must understand what improved packet encryption does. It is actually pretty straightforward: it adds a layer of protection to your packets by encrypting them. So you may naturally think that you want your packets to have the best protection possible to defend your server from man in the middle attacks, but it is not that easy. First off, with improved packet encryption it is harder to perform a MITM attack, but that does not mean it cannot be done, it is just harder. The drawback is that it can cause an occasional client crash, so you must decide whether it is worth it. In my opinion it is not, because as I already said a MITM attack can still be performed even if it is harder, and because Metin2 bots usually hook the send function in the client to send packets through the normal client logic rather than manipulating packets directly. If your client were perfectly protected from cheats and bots, which is not possible since a client on your machine can always be tampered with, then the extra layer of protection on the packets would be worth it to make your server harder to hack. But since this is not the case, it is not really worth risking crashes for protection that is mostly unnecessary, especially since it is easier and more common for hackers to tamper with the client rather than with the packets themselves. But at the end of the day, you must make your own risk assessment and decide what is best for your server. Another possible solution would be to deeply understand how improved packet encryption works and try to fix the bug rather than disabling it, but I have never seen anybody go down the rabbit hole to do that, and I have never seen any public fix for it, so you are mostly on your own for that. Good luck!

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.