Подключение бота к серверу
В списках опенкоры имеется много информации о серверах. Но некоторых серверов в этих списках нет, и иногда информация меняется (например меняется IP сервера или обновляется софт). Этот гайд вам поможет определить нужную информацию для подключения к серверу. Прочтите данный гайд полностью и внимательно! Если вы сталкнулись с проблемами, дочитайте этот гайд до конца, прежде чем задавать вопросы на форуме или IRC! Прежде чем пытаться подключится к серверу, проверьте не находится ли данный сервер в списке "неподдерживаемых", чтобы все ваши усилия не стали напрасными. Для того чтобы OpenKore смогла подключится к серверу ей потребуется следующая информация:
- Название сервера.
- Ip и порт сервера.
- Master Version сервера.
- Version сервера. (не путайте с master version)
- Кодировка сервера(на русских серверах везде стоит ставить ServerEncoding Russian).
- Тип сервера (serverType).
Получение информации сервера
Есть 2 способа получения данных, с помощью WPE или Wireshark. Самый легкий это способ через WPE, потому что многие игроки знают, что это такое и с чем его едят. Но некоторые сервера блокирует WPE, но не будем отчаиватся ведь нам может помочь Wireshark.
WPE (Сниффер пакетов)
- 1. Скачайте и распакуйте WPE. Скачать его можно тут [1].
- Перед закачкой, удостоверьтесь что антивирусы выключены, т.к антивирусы определяют WPE как вирус, но на самом деле это очень полезный сниффер, после установки добавте его в исключения, чтобы антивирус нам не надоедал.
- 2. Запустите клиент но не логинтесь! Перед вами окошко с логином и вводом пароля, запускаем WPE.
- В появившемся окошке находим экзешник с вашим клиентом и нажимаем OPEN.
- Примечание. Некоторые .exe файлы сныканы, т.е переименованы (например xxxRO.exe имеет название binadds.dll), так что особо не парьтесь.
- 4. Далее жмем Play button.
- 5. Логинемся. Вам не нужно подключатся к мап-серверу, только логинимся т.е вводим логин пароль и ОК.
- Примечание. Чтобы не увели аккаунт не выкладывайте полную информацию о своем логине.
- 6. Возвращаемся к WPE и жмем Stop button
- В появшемся окне мы видим различные пакеты. Здесь мы можем найти version and master_version, IP and port сервера.
- Пакеты могут отличатся в зависимости от сервера, но многие из них начинаются вот с таких вот циферок 64 00.
- Это пакеты версии сервера и мастер версии.
- Обведеное красным это:
- Version.
- IP
- Port
- Master version
- 7. Теперь эти циферки версии и мастер версии нужно перевести, т.к они находятся в 16ой системе, а кора у нас читает 10ю . Используем кулькулятор. Теперь с преобразованными числами нами всеми любимая кора может работать. Смотрим тут Passing server information to OpenKore.
Wireshark
- 1. Качаем и устанавливаем Wireshark. (Жмакаем тут [2]).
- 2. Открываем клиент не логинемся! Перед вами окошко с логином и вводом пароля, запускаем Wireshark.
- 4. В "Interface" всплывающем меню, выбирают ту строку, которая представляет ваше интернет-соединение. Если вы не уверены какая из них представляет ваше интернет-соединение: выберите ту, чей адрес IP не начинается с 192.168. Остальные настройки оставте без изменений, которые указаны ниже на картинке:
- 5. После настройки жмем Start button и открываем клиент с окном ввода пароля. Логинится на мап-сервер не нужно..
- Примечание. Чтобы не увели аккаунт не выкладывайте полную информацию о своем логине.
- 6. После логина, вновь окрываем Wireshark и жмем Stop button.
- 7. В главном окне Wireshark вы увидите сегменты TCP, которые вы поймали. Заполните packet filter, при заполнение фильтра вы должны использовать имя которое вводили при логине.
- Введитe в "Filter":
eth contains "xxxxxx" или eth contains xxxxxx
- Замените xxxxxx на ваше имя использованное при логине и нажмите enter. В моем примере, имя было Mushroom.
- 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.
- 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.
- 10. A new window will open, in the bottom left, select Hex Dump.
- 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.
- 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.