Botnak icon indicating copy to clipboard operation
Botnak copied to clipboard

Global namefaces

Open gmansoliver opened this issue 10 years ago • 7 comments

Currently, namefaces in Botnak only show on the broadcaster's end, i.e. nobody else can see the namefaces in a channel but the broadcaster (unless they have added them locally).

I've created a website / server application where users can upload (or remove) their nameface to http://gmanserver.info/faces/nameface.php. They must connect with Twitch to do this, so user A can't modify the nameface of user B. The website provides a preview section for the new nameface, eliminating the problem of people having to re-add their nameface in Botnak multiple times until it looks right.

All added faces are saved onto the server (accessible from http://gmanserver.info/faces/namefaces/.png). A record for each user is also added to a MySQL database, where the url of their nameface is stored, as well as the channel permission level. Channel permission level (0-3) allows a user to pick whose namefaces will appear in their chat (everyone, subs+, mods+, broadcaster only). This setting can be changed from the main website.

For use in Botnak, users' data can be pulled from http://gmanserver.info/faces/getface.php?username=, which will return a JSON object with their unique ID, username, the URL to their nameface (JSON encoded), and their channel permission level.

Users are free to modify or remove their nameface, or update the channel permission level at any time from the main website (http://gmanserver.info/faces/nameface.php).

global namefaces actions

global namefaces add

global namefaces channel permission level

gmansoliver avatar Aug 19 '15 20:08 gmansoliver

Small issue with the site: after performing an action (adding/removing or changing channel permission) the options disappear, and you're forced to reload the site in order to see them again.

Another request: can you implement the white-space trimmer/cropper I made into your image processing somehow so that it matches Botnak's?

Other than that, I'm working on implementing this, so it'll be added soon!

Gocnak avatar Aug 19 '15 22:08 Gocnak

I can make it so that after processing an action, it brings back the options selection box. The user should stay authenticated (i.e. won't need to reconnect with twitch), though, so clicking the "connect with twitch" button again will go right back to the options without having to login again.

I can look into the cropper; would you prefer it to crop just the preview, or crop the final saved file as well? The preview would mean writing it in JavaScript, and then doing it again in PHP for the saved file.

gmansoliver avatar Aug 19 '15 23:08 gmansoliver

You could do it for the preview. Either way, Botnak is still going to have the cropper, so it wouldn't matter, but it would be more accurate for the preview.

Gocnak avatar Aug 19 '15 23:08 Gocnak

If anybody has suggestions for implementing the cropper in JavaScript / HTML for the preview, they would be much appreciated. I have begun implementing it in PHP.

I'll add a note reminding people to remove whitespace, hopefully when they see it in the preview that will at least prompt them to do so themselves.

gmansoliver avatar Aug 20 '15 00:08 gmansoliver

After performing an action, the "Choose an action" box always comes up now (after removing leftovers from other actions from the page.

gmansoliver avatar Aug 20 '15 01:08 gmansoliver

Descriptive errors are now returned on http://gmanserver.info/faces/getface.php?username=%username% if the nameface is not found.

gmansoliver avatar Aug 29 '15 02:08 gmansoliver

It is now also possible to request multiple faces. To do so, perform a normal username GET request but separate usernames by a "[" (open bracket). For example, http://gmanserver.info/faces/getface.php?username=gmansoliver[gocnak will return a JSON array with both face objects.

I'll hopefully find a better place to document this than in the comments on this issue soon.

gmansoliver avatar Aug 29 '15 03:08 gmansoliver