Подключение бота к серверу — различия между версиями

Материал из Руководство по OpenKore
Перейти к: навигация, поиск
Строка 18: Строка 18:
 
::'''<span style="color:red">Перед закачкой, удостоверьтесь что антивирусы выключены, т.к антивирусы определяют WPE как вирус, но на самом деле это очень полезный сниффер, после установки добавте его в исключения, чтобы антивирус нам не надоедал.</span>'''
 
::'''<span style="color:red">Перед закачкой, удостоверьтесь что антивирусы выключены, т.к антивирусы определяют WPE как вирус, но на самом деле это очень полезный сниффер, после установки добавте его в исключения, чтобы антивирус нам не надоедал.</span>'''
  
::'''''Note.''''': Для распаковки нам понадобятся программы, одну из них можно скачать тут [http://www.rarlab.com/ WinRAR], а другую тут [http://www.7-zip.org/ 7zip].
+
::'''''Примечание.''''': Для распаковки нам понадобятся программы, одну из них можно скачать тут [http://www.rarlab.com/ WinRAR], а другую тут [http://www.7-zip.org/ 7zip].
  
 
:'''2.''' Запустите клиент '''''но не логинтесь!''''' Перед вами окошко с логином и вводом пароля, запускаем WPE.
 
:'''2.''' Запустите клиент '''''но не логинтесь!''''' Перед вами окошко с логином и вводом пароля, запускаем WPE.

Версия 20:07, 23 февраля 2010

В списках опенкоры имеется много информации о серверах. Но некоторых серверов в этих списках нет, и иногда информация меняется (например меняется IP сервера или обновляется софт). Этот гайд вам поможет определить нужную информацию для подключения к серверу. Прочтите данный гайд полностью и внимательно! Если вы сталкнулись с проблемами, дочитайте этот гайд до конца, прежде чем задавать вопросы на форуме или IRC! Прежде чем пытаться подключится к серверу, проверьте не находится ли данный сервер в списке "неподдерживаемых", чтобы все ваши усилия не стали напрасными. Для того чтобы OpenKore смогла подключится к серверу ей потребуется следующая информация:

  • Название сервера.
  • Ip и порт сервера.
  • Master Version сервера.
  • Version сервера. (не путайте с master version)
  • Encoding сервера(на русских серверах везде стоит ставить ServerEcoding Russian).
  • Тип сервера (serverType).


Получение информации сервера

Есть 2 способа получения данных, с помощью WPE или Wireshark. Самый легкий это способ через WPE, потому что многие игроки знают, что это такое и с чем его едят. Но некоторые сервера блокирует WPE, но не будем отчаиватся ведь нам может помочь Wireshark.

WPE (Winsock Packet Editor)

1. Скачайте и распакуйте WPE. Скачать его можно тут [1].
Перед закачкой, удостоверьтесь что антивирусы выключены, т.к антивирусы определяют WPE как вирус, но на самом деле это очень полезный сниффер, после установки добавте его в исключения, чтобы антивирус нам не надоедал.
Примечание.: Для распаковки нам понадобятся программы, одну из них можно скачать тут WinRAR, а другую тут 7zip.
2. Запустите клиент но не логинтесь! Перед вами окошко с логином и вводом пароля, запускаем WPE.
3. В окне WPE кликаем на кнопочку Target Programs.
Targetyc.png


В появившемся окошке находим экзешник с вашим клиентом и нажамаем на ОК.
Файл:clickrag.png
Примечание. Некоторые .exe файлы сныканы, т.е переименованы (например xxxRO.exe имеет название binadds.dll), так что особо не парьтесь.


4. Далее жмем Play button.
Файл:play.png


5. Логинемся. Вам не нужно подключатся к мап-серверу, только логинимся т.е вводим логин пароль и ОК.
Примечание. Действительная информация логина не нужна.


6. Возвращаемся к WPE и жмем Stop button
Файл:stopjw.png


A window will open with some packets. Here we can find the server's version and master_version, IP and port.
The packets will be different on each server, but most of the time it will start with 64 00.
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.
  2. IP
  3. Port
  4. Master version


7. Now, the version and master version need to be converted, because they are a hexadecimal number (base-16) and Kore expects a decimal number (base-10). Use this calculator. With the numbers converted, you can now make openkore use it. See Passing server information to OpenKore.


Wireshark

1. Download and install Wireshark. (Download link here).
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 "Interface" dropdown box, select an interface which you want to capture on. If you're unsure which interface to use, select the one whose IP address is equal to 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:
Файл:options.png


5. After configuring the options, click on Start button and go back to your ragnarok and login. Loginning to the map-server is not needed, the login-server is enough.
Note. Valid information are not needed.
6. After loginning, go back to Wireshark and press the Stop button.
Файл:stop.png


7. In the 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 your username that you used to login and press enter. In my example, my username was Mushroom.
Файл:filter.png


8. You will now have only one entry, click on it and you will have some information about it. This is where you are going to get the server's IP and port.
Файл:ip.png


Write down your ip and port because you are going to need them later.


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. Now we got 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


12. With the informations above, you have to convert them, because they're a hexadecimal number (base-16) and Kore expects a decimal number (base-10). You can use this calculator. With the numbers converted, you can now make openkore use it. See the section bellow for how to use it.


Passing server information to 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. Here is the format:

[Server's Name]		-> Your server's name. Must be between '[' and ']'
ip x.x.x.x		-> Your server's IP.
port xxxx		-> Your server's port number.
master_version xx	-> Your server's master_version. The one that you converted from hex to
			   decimal.
version xx		-> The server's version. The one that you converted from hex to decimal.
serverType xxx		-> Your serverType. For privates default one is 8_4. Officials one have
			   their own.
charBlockSize xx	-> Set this if you are getting wrong char name and job name. Default is 106.
serverEncoding xxxx	-> Character encoding. More information read bellow.
private 1		-> Only set this if the bot connects to the wrong map server IP.
			   Used by private servers.
recvpackets xxxxxx.txt	-> Your recvpackets' name file. It this option is not set, it will use
			   the default one (recvpackets.txt). More informations read bellow.


And here is an example:

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

After having modified servers.txt, restart OpenKore.


Character encoding

The character encoding cannot be automatically detected, but here's a list of possible character encodings that you can use:

Encoding Language used
Western English, or a language which uses a Roman-based alphabet. For example, German, French, Portuguese, etc., but also Indonesian.
Simplified Chinese Simplified Chinese.
Traditional Chinese Traditional Chinese.
Korean Korean
Russian Russian, or a Cyrillic-based language.
Japanese Japanese
Thai Thai

Packet Length Extractor

Packet Length Extractor is a program which retreives the packet lengths from the RO client and stores them in recvpackets.txt. If you're having server problems, such as:

  • Packet Tokenizer: Unknown switch: xxxx
  • Getting disconnected after a few seconds
  • NPCs, players and monsters are not recognized by Kore

Then generating a new recvpackets.txt might solve the problem. It's advisable to always extract the recvpackets for any server that you will play. The file must be on tables folder.

Note. You may have problems extracting the recvpackets if your server's client has some kind of protection.


About Recvpackets

The network data that the server sends to Kore, is a byte stream. Kore must be able to recognize messages inside that byte stream to be able to do something with it. But the size of the messages can vary from to server to server. Recvpackets.txt contains information about the size of each message, so Kore can correctly split the byte stream into messages.


Download

There are two programs you can use to extract the recvpackets:

  • JCV's RO Tools
  • OpenKore Packet Length Extractor

It's better to use JCV's RO Tools as it is more up to date and have some fixes for newer clients. Also it's much easier to maintain, but it has undesirable and outdated options in addition to the packet extractor.