Former Staff arves100 1543 Posted May 29, 2021 Former Staff Share Posted May 29, 2021 (edited) Welcome hopeless developers, in an attempt to reduce some random questions, and considering I haven't found anything about this there, I'll share this small method to fix the packet errors, which requires thinking. There's no copy/paste here as it requires you to think of what you modified. This tutorial is, of course, indented for new people not for the rest. If you are interested in how to make a new packet, head here: What is it and how metin2 implementes it? Keeping things simple and understandable, a packet is an information exchanged between the Client or the Server. For example, when you press the button Space (to attack), the client will send an information (which is a packet), which will tell the server that we attacking the player Shiba324. Read this if you are more interested: https://en.wikipedia.org/wiki/Network_packet Each packet needs to be identified in an unique way between client and server otherwise the client or server won't understand which thing you are sending, that's why each packet of Metin2 starts with "BYTE bId". We see this numbers inside an enum block (like PACKET_CG_LOGIN2 which identifies the login packet), while it's content is defined inside a struct block (like TPacketGCLogin2). The files which this packets are defines are Packet.h inside UserInterface and game/src. There are two packet types, dynamic and static, the static ones have a fixed length (the structure size), the dynamic have an extra data called (length, usually WORD), which tells the game the size of it. All the packets have a nomenclature, which I'll explain here: CG -> Client to Game (sent by the client) GC -> Game to Client (sent by the server) GG -> Game to Game (used by P2P packets for communicating two cores with eachother) Before seeing how to fix the errors, there's another thing that I will explain called Sequence system. What is the sequence system? It's a system introduced in newer clients (like 34k). It's basically a check which the client will send an extra data after a packet, and the server will verify if it's correct, in case it's not it will kick the player out of the server. The verision system works by sending a different number each time a packet is sent or received to the server, the client can send up to 32768 unique numbers before resetting itself to 0 (it's stored in a big array). Error type 1: Unknown packet header: XXX, last: YYY ZZZ Number explanations: XXX is the packet that the game/client cannot handle YYY and ZZZ are the last two packets sent before this error (usefull for investigating what packet caused this error) This error can happen before of the following issues: You modified the source and you haven't added inside PythonNetworkPhaseGame.cpp or packet_map.cpp the packet You have a packet which size mismatches between client and server Error type 2: SEQUENCE XXXXXXX mismatch 0xYY != 0xZZ header KK This error could happen for some reasons: You specified a packet which uses the sequence in packet_info (last value true/false) and in the client you forgot to add "SendSequence()" or viceversa You have a packet which size mismatches between client and server (the server is thinking a packet data is a sequence data) Error type 3: We don't really have syserrs here but we can see the client fuzzying around or doing wacky things (even crash at some point!) or the server/client fails to process all the data sent. This error could happen for some reasons: You have a packet which size mismatches between client and serve You forgot to add a Send() or forgot to Recv() the data inside the client tl;dr: always check for the following things if you are unsure: Check if you have added SendSequence and modified the true/false in packet_info (if you use sequence system) ALWAYS CHECK if Packet.h has the same ID and structures Check what action causes the issue so you can track down the code Always check the last headers sent, most of the time is just a byte not sent at the end Always check your implementation of input_main (Server) and PythonNetworkPhaseGamexxxxxxx (Client) Pro hack tip: __PACKETDUMP__ and ENABLE_SEQUENCE_SYSTEM are cool bois. Good luck. Edited May 29, 2021 by arves100 bruh fucking browser, finished translation from meme 25 1 1 11 2 17 Everyday you wake up as a Metin2 developer is a bad day... METIN1 src when Link to comment Share on other sites More sharing options...
Management AZICKO 7348 Posted May 29, 2021 Management Share Posted May 29, 2021 Buona fortuna 2 Scamming ? Reselling ? metin2.download | metin2.dev | fr.metin2.dev | metin2dev.org | metin2.top | top-metin2.org Link to comment Share on other sites More sharing options...
Former Staff arves100 1543 Posted May 29, 2021 Author Former Staff Share Posted May 29, 2021 9 minutes ago, ASIKOO said: Buona fortuna shhhh I was translating and wrongly hit the keyboard shortcut to publish the topic, should be ok now 2 Everyday you wake up as a Metin2 developer is a bad day... METIN1 src when Link to comment Share on other sites More sharing options...
Forum Moderator Gurgarath 2514 Posted May 29, 2021 Forum Moderator Share Posted May 29, 2021 Excellent guide, this problem is always tricky as it can come from many things (even the most mundane). I often follow the same pattern when it comes to fixing packets however. There is no magical guide for it and I think the structure itself of the packet system is what can cause us to have this issue when we do not really pay attention. It also can happen when you send, let's say, a DWORD from the server and forgot to tell the client to catch it or vice-versa (tell the client to expect a DWORD and send nothing from the server). Concerning the structure, it can be a little bit discombobulating to have a different packet naming between client / server, unused packet structs and packet related informations in GameType and Packet.h as well as in Common files and packet.h. Thank you for this guide! Definitely useful! 1 1 Gurgarath coming soon Link to comment Share on other sites More sharing options...
Halodorel 5 Posted July 23, 2021 Share Posted July 23, 2021 Nice one, i remember people always said it is not possible to fix this error but here it is a good tutorial Link to comment Share on other sites More sharing options...
VestulSalbatic 507 Posted September 15, 2021 Share Posted September 15, 2021 Useful guide thanks! Link to comment Share on other sites More sharing options...
Recommended Posts