Difference between revisions of "Connectivity Guide"

From OpenKore Wiki
Jump to: navigation, search
m
m
Line 10: Line 10:
 
* '''addTableFolders''' to look for tables in
 
* '''addTableFolders''' to look for tables in
  
There are detailed instructions on collecting server information with [http://wpepro.net '''WPE'''] or [http://www.wireshark.org '''Wireshark''']. Other ways and tools for analysing packets may be used too, just find the one which works in case these aren't.
+
There are two ways to collect server information, which is using [http://wpepro.net '''WPE'''] or [http://www.wireshark.org '''Wireshark''']. Other network sniffers can be used, too.
  
 
===WPE (Winsock Packet Editor)===
 
===WPE (Winsock Packet Editor)===
Line 37: Line 37:
 
:[[File:stopjw.png]]
 
:[[File:stopjw.png]]
  
'''8.''' A window will open with recorded data. One of the packets sent to the server would be '''login packet''' which usually contains the server's '''version''', '''master_version''', '''IP''' and '''port''' - write them down because they are going to be used later. The packets will be different on each server, possible login packets may start with '''64 00''' or '''02 B0'''. Other packets (such as 18-byte-long '''02 04''') may be sent before login packet.
+
'''8.''' A window will open with some recorded packets. The server's '''version''' and '''master_version''', '''IP''' and '''port''' can be found there.
 +
The packets will be different on each server, but most of the time it will start with '''64 00'''.
 +
Other possibilities include, but not limited to '''B0 02''' (it may be not a first packet being sent too).
 +
These are the packets that contains the version and master_version. Write them down because they are going to be used later.
 
:[[File:inforb.png]]
 
:[[File:inforb.png]]
  
Line 146: Line 149:
 
secureLogin_account <boolean flag>
 
secureLogin_account <boolean flag>
 
storageEncryptKey <encrypt key>
 
storageEncryptKey <encrypt key>
recvpackets <file name></pre>
+
recvpackets <file name>
 +
masterLogin_packet <packet switch></pre>
  
 
==== Required ====
 
==== Required ====
Line 202: Line 206:
 
; addTableFolders <folder path>
 
; addTableFolders <folder path>
 
: Configures Kore to load tables file from the specified path (relative to the tables directory).
 
: Configures Kore to load tables file from the specified path (relative to the tables directory).
: Used only when there is no --tables specified.
+
: Used only when there is no [[Command Line Arguments|--tables]] specified.
 
: For english ones, you can use
 
: For english ones, you can use
 
  addTableFolders translated/kRO_english
 
  addTableFolders translated/kRO_english
Line 262: Line 266:
 
  master_version 16
 
  master_version 16
 
  version 20
 
  version 20
  serverType kRO_RagexeRE_0
+
  serverType kRO_RagexeRE_2010_01_26a
 
  charBlockSize 108
 
  charBlockSize 108
 
  serverEncoding Western
 
  serverEncoding Western

Revision as of 06:35, 12 June 2011

Getting Server Information

OpenKore comes with a list of official servers information only, because of the high amount of private servers, it is impossible to have and keep them updated, so private servers players should follow this guide to get and update their server information.

Before continuing, read the list of unsupported servers. Your server might have anti-bot protection resulting in not being supported by Openkore.

OpenKore requires the following information about the Ragnarok Online server before it can initialize and login:

  • The server name
  • The server's host (IP address or hostname) and port
  • The server's master version number, server version number, character encoding, charBlockSize
  • addTableFolders to look for tables in

There are two ways to collect server information, which is using WPE or Wireshark. Other network sniffers can be used, too.

WPE (Winsock Packet Editor)

1. Download WPE and extract it.

  • Before downloading, make a sure to disable your anti-virus as it can mark WPE as a virus and delete it. Download at your risk, we will not be resposabilized if your computer crashes.
  • You will need some programs to extract it, the common ones are WinRAR and 7zip.

2. Open your ragnarok but don't login yet! Leave it on the login screen and open WPE.

3. At WPE's window, click on Target Programs button.

Targetyc.png

4. A window will open, search for the server's executable and double-click it.

Clickrag.png
Note. Some servers "hide" their executables by renaming it (like from xxxRO.exe to xxxx.dll or xxxxx.bin), so don't worry if the executable isn't a .exe one.

5. In the WPE's window, click on Play button.

Play.png

6. Switch to your Ragnarok's window, put and try to login.

Note. Valid login information are not needed.

7. Back to WPE's window, click on Stop button

Stopjw.png

8. A window will open with some recorded packets. The server's version and master_version, IP and port can be found there. The packets will be different on each server, but most of the time it will start with 64 00. Other possibilities include, but not limited to B0 02 (it may be not a first packet being sent too). These are the packets that contains the version and master_version. Write them down because they are going to be used later.

Inforb.png
Legend:
  1. version (displayed as 4-byte unsigned number in little-endian, in hex)
  2. IP (as is)
  3. port (as is)
  4. master version (displayed as 1-byte unsigned number, in hex)

9. See Converting Hexadecimal to Decimal numbers to convert the master_version and version before configuring Kore.

Wireshark

1. Download and install Wireshark.

2. Open your ragnarok but don't login yet! Leave it on the login screen and open Wireshark.

3. At Wireshark's window, go to Capture > Options on the upper menu or press Ctrl + K.

Capiture.png

4. In the top right box, select the interface that will be used to capture on. If there isn't any specific interface to use, select the one whose IP address is equal to the your ip address or is not unknown. Alternatively you can try all of them and use the one that records the packets. Set the others settings like the images bellow:

Interface.PNG

5. Click on Start button and go back to the Ragnarok window and login.

Note. Valid information are not needed.

6. Back to Wireshark and click on Stop button.

Stop.png

7. In Wireshark main window, you can see the TCP segments that were captured. Fill in the packet filter, but what to fill in depends on the username you used to login.

Enter this in the "Filter" text box:
eth contains "xxxxxx" or eth contains xxxxxx
Replace xxxxxx with the username that was used to login and press enter. In the example bellow, username was Mushroom.
Filter.png

8. There will be only one entry now, click on it to show some information about it. This is where the IP and port is stored.

Ip.png
Write down the IP and port.

9. On the entry again, right-click on it and go to Follow TCP Stream.

Tcp.png

10. A new window will open, in the bottom left, select Hex Dump.

Hex.png

11. These are the login packets. Take a look at it and write down the packets that contains the version and master version numbers. They are marked on the image bellow.

Packets.png
  • version displayed as 4-byte unsigned number in little-endian, in hex
  • master version displayed as 1-byte unsigned number, in hex

12. See Converting Hexadecimal to Decimal numbers to convert the master_version and version before configuring Kore.

Converting Hexadecimal to Decimal numbers

Master_version and server version collected from the login packets are in hexadecimal number (base-16) and Kore expects a decimal number (base-10), so converting those numbers are needed before Kore can read them.

Converting can be made using Windows' calculator or any other site that has a hex to dec calculator.

1. Open Windows calculator Start > Accessories > Calculator.

Calc.PNG

2. Go to View on the upper menu and click on Scientific.

Sci.PNG

3. Check the circle beside Hex.

Hexa.PNG

4. On the calculator, type the number that you got for master_version and version. In the example, master_version hexadecimal number is 10.

Type.PNG

5. Check the circle beside Dec.

Dec.PNG

6. After checking, the number shown should automatically be converted from hexadecimal to decimal.

Done.PNG
You must convert master_version and version.

Configuring Openkore

OpenKore reads server information from a file named servers.txt. The file is on tables folder.

If your server is not listed in the file, then add a new entry. If your server is already listed, then modify the existing entry.

Syntax

[<server name>]
ip <number/host>
port <number>
version <number>
master_version <number> 
serverType <serverType name>
serverEncoding <enconding>
charBlockSize <number>
addTableFolders <folder path>

#Following configs are optional
captcha <boolean flag>
chatLangCode <boolean flag>
field_<location> <filename>
clientHash <hex string>
gameGuard <number>
private <boolean flag> 
paddedPackets <boolean flag>
paddedPackets_attackID <packet switches>
paddedPackets_skillUseID <packet switches>
secureLogin <boolean flag>
secureLogin_type <type>
secureLogin_requestCode <hex string>
secureLogin_account <boolean flag>
storageEncryptKey <encrypt key>
recvpackets <file name>
masterLogin_packet <packet switch>

Required

[<server name>]
The name of the server that you want to bot. The name must be between [ ].
ip <number/host>
Server's login IP.
port <number>
Server's login port number.
version <number>
Server's version (converted from hex to decimal).
master_version <number>
Server's master_version (converted from hex to decimal).
serverType
Development.pngThe following documentation describes a feature that was greatly changed in SVN trunk (latest development version) since the last release.
It may work differently or not be available if you're using 2.0.7 or any older version.
Server's type. Each official server has its own serverType, private servers must use kRO serverTypes according to executables dates.
serverEncoding
Characters encoding type. The character encoding cannot be automatically detected, but here's a list of possible character encodings that you can use:
Encoding Language used
Western Language which uses a Roman-based alphabet. Example: English, German, French, Portuguese, Indonesian, etc.
Simplified Chinese Simplified Chinese.
Traditional Chinese Traditional Chinese.
Korean Korean
Russian Russian, or a Cyrillic-based language.
Japanese Japanese
Thai Thai
charBlockSize <value>
Length (in bytes) of data block describing each of your characters in the packet with character list (received_characters) on character selection screen.

Correct value for a server may be not supported by a specific serverType or not supported at all, so merely trying values mentioned here may not be enough.

charBlockSize kRO date Kore version Notes
New charBlockSizes are being constantly introduced.
155 a6d3f87 exp int64
147 df50355
146 3aeba6a
145 3001eab and 8fa8dfa iRO's Doram update
144 2011-10-25 876acab
140 2011-09-28 876acab "change slot feature"
136 2011-01-11 b5b8e07 "robe"
132 2010-08-03 b5b8e07 "delete date"
128 daefa83
124 3b07ffe bRO (bifröst update)
116 addabe5
112 9862177 Topic on the forum
108 9862177 Topic on the forum
106 (default)

Dates are for a reference with default Athena configuration only, any server can reconfigure that.

In Athena code base, function mmo_char_tobuf generates character blocks.

Development.pngImplementation of this feature is expected to become outdated with server updates.
As OpenKore is a free project, if you stumble upon such updates, you are expected to fix the problem and contribute your changes back. Usually, server supporters will do that, but there isn't any for random private servers, and some official ones may not always be covered.


addTableFolders <folder path>
Configures Kore to load tables file from the specified path (relative to the tables directory).
Used only when there is no --tables specified.
For english ones, you can use
addTableFolders translated/kRO_english
or
addTableFolders iRO

Optional

captcha <boolean flag>
Configure Kore to use the captcha 'protocol'.
chatLangCode <boolean>
Enables support for language codes (a pipe and two hexadecimal digits) in chat messages.


gameGuard <number>
Used for GameGuard and HackShield. See also: Poseidon.
private <boolean flag>
Set this option if Openkore connects to a wrong map-server IP. Usually for private servers.
recvpackets <file name.txt>
Configures file's name for recvpackets. See also: Packet Length Extractor.
masterLogin_packet <packet switch>
Overrides master login packet switch (but not its structure). Required for XKore 2 if it's different from 0064.

Example

[MushroomRO]
ip 127.0.0.1
port 6900
master_version 16
version 20
serverType kRO_RagexeRE_2010_01_26a
charBlockSize 108
serverEncoding Western
recvpackets mush-recvpackets.txt
addTableFolders iRO