gui43

Member
Mar 15, 2019
187
52
Welp i discovered what was wrong with my game, my save was buged i had all the items and clothes but none of the main-quest or side-quest updated. to fix that all i need to do was destroy all my data and restart from zero
 

gui43

Member
Mar 15, 2019
187
52
After questing myself what was wrong i decided to wait untill the next update to see if fix
 

l8rdude

Member
Jan 13, 2020
157
602
Hi, l8rdude

I'm trying to write an api server for this game, on my Android phone. But I can't forge a success response of /gamedata/map since all I get from communications between the game and the real server is either "no token provided" or "invalid token".

Can you give a example of valid response of /gamedata/map? Thanks!

By the way, if the game is using libcurl, the proxy can be set with environment variables like http_proxy or ALL_PROXY. And if that works, it woudn't be necessary to patch the game files anymore, right?
Hey, I am glad you are writing your own version for the android community!

First of all, thanks very much for hinting at the environment variable, I had no idea these exist... I should have checked the docs haha. Great info!

As for the /gamedata/map response. The game expects the file contents of the requested map (.tmx file) as a response. No JSON or other markup, sending just the file contents will be enough (the game explicitly checks for header code 200 also, but that's pretty much a given).

Cheers,
 

felixthetrap

New Member
May 13, 2019
13
61
Hey, I am glad you are writing your own version for the android community!

First of all, thanks very much for hinting at the environment variable, I had no idea these exist... I should have checked the docs haha. Great info!

As for the /gamedata/map response. The game expects the file contents of the requested map (.tmx file) as a response. No JSON or other markup, sending just the file contents will be enough (the game explicitly checks for header code 200 also, but that's pretty much a given).

Cheers,
Thanks for the information!

I have found that map files on can be accessed without authentication. Including maps for 0.0.14
 
  • Love
Reactions: l8rdude

l8rdude

Member
Jan 13, 2020
157
602
Thanks for the information!

I have found that map files on can be accessed without authentication. Including maps for 0.0.14
Oh wow, I never bothered to check the storage. That's huuuuge, nice. Hope I will have the time to download and update my post later.

Cheers,
 
  • Like
Reactions: Know-how

felixthetrap

New Member
May 13, 2019
13
61
Two Horns API Server

General Instructions:
1. Append "127.0.0.1 api.pinkcafeart.com" to hosts file of your system.
2. Import certificate.
3. Install Node.js
4. Run "node server.js" with root or administrator privilege. Since listening on port 443 may require root / Administrator privilege.
5. Run the game and you should be able to login now. Note that you should keep the server running while playing the game.


Instructions for Android:
// You can only do this on a rooted Android device!
1. Append "127.0.0.1 api.pinkcafeart.com" to /system/etc/hosts
2. Copy 85c9734f.0 to /system/etc/security/cacerts/ and change it's owner to root:root, permissions to 644
3. Install Termux( ).
4. Open Termux and install Node.js and tsu package with "pkg install nodejs tsu".
// You may need to run "termux-setup-storage" to gain access to internal SD card.
5. cd into the directory where server.js is located, run "sudo node server.js"

I have only tested it on Android, but it should work on any other platforms as well in theory.
 
Last edited:

l8rdude

Member
Jan 13, 2020
157
602
Two Horns API Server

General Instructions:
1. Append "127.0.0.1 api.pinkcafeart.com" to hosts file of your system.
2. Import certificate.
3. Install Node.js
4. Run "node server.js" with root or administrator privilege. Since listening on port 443 may require root / Administrator privilege.
5. Run the game and you should be able to login now. Note that you should keep the server running while playing the game.


Instructions for Android:
// You can only do this on a rooted Android device!
1. Append "127.0.0.1 api.pinkcafeart.com" to /system/etc/hosts
2. Copy 85c9734f.0 to /system/etc/security/cacerts/ and change it's owner to root:root, permissions to 644
3. Install Termux( ).
4. Open Termux and install Node.js and tsu package with "pkg install nodejs tsu".
// You may need to run "termux-setup-storage" to gain access to internal SD card.
5. cd into the directory where server.js is located, run "sudo node server.js"

I have only tested it on Android, but it should work on any other platforms as well in theory.
I've updated my previous post to include the 0.0.14 maps now and also put a link to your solution as the automatic map download and caching is definitely a nice touch.

Cheers,
 

HarryRM

Newbie
Dec 25, 2019
34
64
Confirming felix's method works on Windows. One does indeed need to run the cmd as admin.

Took me longer trying to figure out why my save was borked than to set it up. Turns out if you saved at the Sister Mart branch savepoint causes a memory leak/buffer overlflow(?). Saving at the main house in the older version then loading the save did the trick.
 

JenMistress

Engaged Member
Oct 1, 2019
2,605
2,950
Alright, a few things changed behind the scenes in Two Horns 0.0.14 to combat piracy. The most important one is that version 0.0.14 is no longer providing the actual map files in the release. You're getting the image tilesets but not the actual maps. When a patreon user logs in and plays the game it downloads the map files during runtime when map changes occur or when a new savegame is started. So in order to play the 0.0.14 content you must be a patron to Pink Cafe Art.

What we can do is run our own API server and instead of providing 0.0.14 map files, we'll provide the ones from 0.0.13 (since the author released those for the old client). The benefits of doing that is we can play using the new 0.0.14 client that introduced the new cheat menu and also enjoy several bugfixes.

This also means a patreon user can share their 0.0.14 map files with us if they desire to do so.


Thanks to felixthetrap 's discovery the 0.0.14 map files are publicly accessible so parts of my previous paragraph are no longer true. If you want an easy and automated way to just play, use their solution instead.

Here's what you need to do to get started:
  1. Download and install 0.0.14 map files:
    Mega

    Extract the contents of the zip to C:\Users\<username>\AppData\Local\TwoHorns\PinkCafeArt\OgreData\ScenarioData\ogre_alpha_scenario\map\

    A fast way to get there would be WIN+R and enter %LocalAppData%\TwoHorns\PinkCafeArt\OgreData\ScenarioData\ogre_alpha_scenario\map\
  2. Download the Two Horns proxy from the attachment and extract it to the game folder. When asked, overwrite all files with the ones from the zip.
  3. Launch TwoHornsProxy.exe. The first time you run it you will be asked to install and trust a root certificate to your system. This is required to decrypt the https traffic. After accepting the message it will no longer popup in the future. Important: You must leave this proxy window open while you are playing.
  4. Launch the game normally using the TwoHorns.exe file and click through the title screen. When asked for a login enter any data you like and hit okay. It will be accepted and you're ready to play.

If everything went well, you will see something similiar to this:
View attachment 929410

FAQ
  • Q: Is it required to always run the proxy if I want to play?
  • A: Yes, without the proxy no data can be spoofed and modified for the client to accept it.

  • Q: The proxy can't start or shows errors.
  • A: The proxy requires at least .NET Framework 4.7.2. Most computers have it already installed if they're running Win7/8.1/10 and do system updates frequently. Also make sure port 8888 is available and not already bound by any other application.

  • Q: Why do you supply a different libcocos2d.dll file?
  • A: The game engine uses cocos2d-x to handle many parts of the game, e.g. sound, rendering and networking. By default all connections to the server are direct and no proxy can be configured to intercept the data. In order to tell the game to connect to a proxy anyway, I patched the cocos2d library to tell libcurl to connect using a proxy:
    View attachment 929403
    Whenever this patched libcocos2d.dll file is used all connections will go through a proxy at 127.0.0.1:8888.

  • Q: My game appdata is in a non-default folder, how can I change the path for the proxy?
    A: Open TwoHornsProxy.exe.config and edit the value for "MapPath" at the end of the file. You will also find all the spoofed messages there.

Let me know if there's any problems, any feedback is appreciated. I didn't have an old "endgame" save so testing everything beforehand was not possible.

Cheers,
Maybe because I've not slept yet, but took a bit to figure this out, but finally did, and got it to work. Thank you so much for this.
 
4.10 star(s) 13 Votes