iChun / ContentCreatorIntegration-IssuesAndDocumentation

Primarily documentation for the Content Creator Integration mod for Minecraft. Secondary as an issue tracker for the mod itself.
MIT License
7 stars 4 forks source link

[Feature Request] DonationAlerts Support? #8

Closed DenisMasterHerobrine closed 4 years ago

DenisMasterHerobrine commented 5 years ago

Hi! Recently found your mod, it's very cool and interesting. While the Streamlabs and StreamElements is implemented, a lot of russian streamers want DonationAlerts to be supported. (It's very famous russian "Streamlabs" with their own very tricky system.) This support was for Pay2Spawn for 1.7.10 and 1.10.2 and "lost" the sources. Hope you interested in idea and this feature will be in the mod. If you need more info, you can ask me.

iChun commented 5 years ago

Hi!

I've had a look at DonationAlerts but it might be difficult to add support for it if I can't find an API to interface, meaning i don't really know what to connect to or what to expect for the mod to handle. If you could link me to some such documentation, that would be great

On Wed, 26 Sep 2018, 12:57 AM DenisMasterHerobrine, < notifications@github.com> wrote:

Hi! Recently found your mod, it's very cool and interesting. While the Streamlabs and StreamElements is implemented, a lot of russian streamers want DonationAlerts to be supported. (It's very famous russian "Streamlabs" with their own very tricky system.) This support was for Pay2Spawn for 1.7.10 and 1.10.2 and "lost" the sources. Hope you interested in idea and this feature will be in the mod. If you need more info, you can ask me.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/iChun/ContentCreatorIntegration-IssuesAndDocumentation/issues/8, or mute the thread https://github.com/notifications/unsubscribe-auth/ACMSTCWyGQug-IT_7IkKlE8FSY8joq2Jks5uemBkgaJpZM4W5Dfx .

DenisMasterHerobrine commented 5 years ago

As I meant before: DonationAlerts have their own very tricky system. They do not have a public API, but they have a socket to handle the donations with JSON. Unfortunely, there's a lack of documentation about this and there's what only can be found. The next code handles a donation with socket.io library.

var socket = io("socket.donationalerts.ru:3001");
socket.emit('add-user', {token: "<Token>", type: "minor"});
socket.on('donation', function(msg){
  // Function to handle a donation. 
});

Then you getting a JSON with this:

{
    "id": "<id of a donation>",
    "alert_type": "1",
    "additional_data": "{\"randomness\":517}",
    "username": "<Name of the donator>",
    "amount": "50.00",
    "amount_formatted": "50",
    "amount_main": "50.00",
    "currency": "RUB",
    "message": "<Message>",
    "date_paid": "2017-06-01 11:46:56",
    "emotes": null,
    "_is_test_alert": true
}

Example can be found here. , ...but it's a JavaScript, not Java,

And there's nothing more about it.

There was support of 1.7.10 and 1.10.2 and it "lost" the sources. but I can still get a 1.7.10 version (to know, what to handle and how), if you need it.

iChun commented 5 years ago

If you could, that's be great. I'll be able to support more than just donations if I know what kind of socket events they trigger out. Might require son extensive testing on my end though. Will probably try to look into it this weekend.

iChun commented 5 years ago

But if you're fine with just donations then something can be worked out I suppose. Them having a socket.io interface already helps loads.

DenisMasterHerobrine commented 5 years ago

They support mostly donations, but they supports twitch subs as well, twitch chat with bits and subs are already implemented. And, sorry, I can't get the 1.7.10 version, since the original author of DonationAlerts support stated to abandoned state and it cannot be got anymore, except the some people.

iChun commented 4 years ago

I've attempted to add DonationAlerts support and that will be in v1.1.0. I wasn't able to test it out however, if you could test it and let me know if it works, that would be great!

DenisMasterHerobrine commented 4 years ago

I tried to test DonationAlerts (DA) support, I'm not really sure about doing something wrong, but default config file and DA token throws this error in logs:

io.socket.engineio.client.EngineIOException: websocket error

...and nothing more. I think the problem is wrong socket adress. I think "socket.donationalerts.ru" without the port should solve the issue, because they have reworked their site.

iChun commented 4 years ago

I've updated the URL and confirmed it connecting, just pushed out an update, can you try with 1.2.0 and see if it works?

iChun commented 4 years ago

@DenisMasterHerobrine bump

DenisMasterHerobrine commented 4 years ago

Hello again. sorry for the long delay of the messages, I rarely check Github and ping works randomly and I can get notifications in a couple of days or in a few months. Sorry :(

After some tests and couple of hours playing around with CCI I got crashed by pressing "Events" button, if no tokens is written in configs. Maybe add a warning which tells that there is no tokens? Crashlog can be found here. I was using 1.15.2-1.5.1 version of CCI and Forge 31.1.49.

After ~6 hours playing around with Streamlabs. Got it somehow to work. Tried DonationAlerts - I have no idea of what I need to do with the events, after new UI update I was looking to be able to change the name through UI, but I can't do it because Double-Click doesn't work for some reason (was reading Help button multiple times, but no idea). Tried to see logs through Debug Mode: Mod gets DonationAlerts' packets with donations, but mod doesn't recognize a donation and test events doesn't work, which is mostly copied from streamlabs one. Maybe I do something wrong? Or it's something wrong on the mod side? DonationAlerts JSON file: https://pastebin.com/pZw5k0D7 (Not working at all) Streamlabs JSON file: https://pastebin.com/pGcFLtKc (Working as intended)

Sorry again for late reply, I hope this somehow helps you.

iChun commented 4 years ago

Sorted out and fixed in 1.5.3. Thanks for the help!