![]() If there is no record then, it will unzip the data/items.zip file. This file basically check the database for records. ![]() For items src/core/database/defaults/item.ts file will executed. After connecting the database defaults will executed. and we can't simply use json file to read it. For example item definitions won't change. Socket // then we bind it to model export const Account = model ( 'Account', AccountSchema, 'accounts' ) Defaults You can create server cluster (you can listen multiple sockets at one time) by calling KOServerFactory function.Įxport interface IKOSocket extends net. To create a socket server, the definition of factory is defined in src/core/server.ts folder. In this folder we define all the common stuff for both login and game server. Thats why we have src/core folder in our project. How this standards effect our codeĪlways we will send and receive same format over and over again. It will wraps with 0xAA55 and sends a operation code. This examples will cover the client side, but server side works same. so server will tell which files to download) (Operation byte "2" simply DOWNLOADINFO_REQ signal) "\xAA\x55\x03\x00\x02\x00\x00\x55\xAA" (after 0x02 client sends \x00\x00 this is actually current version of game. Launcher asks ftp information and which files to download.Launcher asks the server's last version: (Operation byte "1" simply LOGIN_REQ signal) "\xAA\x55\x01\x00\x01\x55\xAA".Knight Online Client will send specific operation bytes to say things. All operation codes are reversed engineered. Operation standardĪfter wrapping the packet with 0x55AA and 0xAA55, we send a byte to define our operation. Example "DOGAN" byte-string: "\x05DOGAN" short-string: "\x05\x00DOGAN". Client and server always know using the right one, if client expects byte-string then server has to send byte-string. short-string is 2 byte of length then content. it basically have 1 byte of length, then content. byte-string is for sending character names. If we want to send HELLO message, message that we will send will be "\xAA\x55\x05\x00HELLO\x55\xAA"Īll short, integer, long values have to be little-endian style (most significant binaries go to next byte) ![]() After the start bytes there will be a short value that says the length of real message.All messages has to be end with 0x55 and 0xAA bytes.All messages has to be start with 0xAA and 0x55 bytes.Packet structureĪll messages that send or received has to be in ko communication standard. Packets are in same structure so we can easily detech errors. (10061 is tcp error code) Standardsīoth login and game server will use tcp for communication. If client cant reach the server, user will see 10061 or similiar error that tells couldn't reach the server. After user logins, login server advises to connect game server. Launcher will pick random port when starts. New port range is starts with 15100 ends with 15109. This project will cover all ports that required. ![]() But this port value is changed in later versions to help load balancing. When user opens launcher, tcp connection will be establish between server and client. Login server is the first endpoint to reach. Knight Online client uses several ports to operate. Project is all about to serve knight online client. Project designed to run in node v10.14.x .Īs database we use mongodb. Also all tests have to be written as typescript. You have to compile the code before running. Curiosity of Knight Online's backbone lead to me construct this.
0 Comments
Leave a Reply. |