Dice Mod + mChat (support/request)

Support area for phpBB's mChat extension
Post Reply
Bgagger
Donor
Posts: 34
Joined: 28 Nov 2018, 15:57

Dice Mod + mChat (support/request)

#1

Post by Bgagger » 15 Dec 2018, 17:08

Hello again.

I have a bit of an odd request, I understand if it can not be supported, it involves a third party extension after all. but I have to ask.

I am migrating a forum, and the old forum used a chat client that had a dice rolling feature built into it.
To try and include dice rolling in some form is important to our community. But there is no such feature in mChat and sadly no officially supported Dice mod for phpBB 3.2 overall.

I have managed to dig out an experimental dice rolling mod though that does work with phpBB 3.2.4 and could suit our needs.
https://dsaforum.de/app.php/dlext/?view ... &df_id=220
(for anyone interested note that you need to rename the first folder under extensions to 'oxpus', so it's /ext/oxpus/dice/ , for some reason the developer neglected this.)

But there is one problem. This dice mod extension has a setting that enables the extension to work per forum. So from the ACP you have to change a new setting under each sub-forum you want it to work in. Rolling the dice is after that done by a simple BBcode in any forum post.

Code: Select all

[dice]2d6[/dice]
But, and here is the catch. mChat does not belong to any subforum in the boardware. We use the separate mChat page (which work great otherwise, we don't want to clutter up the forums front page). FORUMNAME/mchat
So when we try to use the BBcode in mChat it simply does not recognize it at all. It just prints out the command in clear text. The dice extension does not seem to be involved with the page at all.
I have found no way to enable the dice extension in the forum overall, it seems tied to work with individual subforums.

Does anyone have any suggestion for how this might be resolved? Could mChat somehow be linked to or inserted into a subforum?
We might otherwise try to alter the dice extensions code, or mChat itself to somehow force them to work together. But I thought it best to first see if anyone here could help, or if the mighty Kasimi had some insight into how this might work ;)

User avatar
kasimi
mChat developer
Posts: 887
Joined: 06 Oct 2016, 09:56
Location: Germany
Contact:

Re: Dice Mod + mChat (support/request)

#2

Post by kasimi » 15 Dec 2018, 17:40

Bgagger wrote:
15 Dec 2018, 17:08
Could mChat somehow be linked to or inserted into a subforum?
Yes, see here: viewtopic.php?f=4&t=62 However, this will not make the Dice extension you linked work with mChat because it only listens to phpBB core events. The Dice extension would have to listen to mChat's dmzx.mchat.action_add_after event (and possibly dmzx.mchat.action_edit_after and dmzx.mchat.action_delete_after) and then perform the same operations it would when making/editing/deleting a post in a regular forum that has Dice enabled.

Bgagger
Donor
Posts: 34
Joined: 28 Nov 2018, 15:57

Re: Dice Mod + mChat (support/request)

#3

Post by Bgagger » 15 Dec 2018, 18:57

Thank you Kasimi! That makes the problem more clear to me.

I think I can get the dice extension to listen to mchat events (by altering it's main_listener.php), but this only makes mChat respond with a 'Service Unavailable' error and breaks down the chat post function, so nothing gets posted.
It seems to get this combination to work somehow, I will have to alter the mChat code as well, which I'm reluctant to do, I would rather keep it intact.

I will continue to look into the problem. If I make any significant headway, I'll give an update here.

If someone has any suggestion for an alternative dice rolling function that works with mChat, somehow, in some shape or form, please let me know.

User avatar
kasimi
mChat developer
Posts: 887
Joined: 06 Oct 2016, 09:56
Location: Germany
Contact:

Re: Dice Mod + mChat (support/request)

#4

Post by kasimi » 15 Dec 2018, 19:51

Bgagger wrote:
15 Dec 2018, 18:57
but this only makes mChat respond with a 'Service Unavailable' error and breaks down the chat post function, so nothing gets posted.
This sounds like your edits in the Dice's listener are correct and the handler method is called correctly, but the code in it is getting unexpected data from mChat. To be clear, you can't reuse the code of the Dice listener for mChat, i.e. you can't do 'dmzx.mchat.action_add_after' => 'check_and_role_dices', because the check_and_role_dices handler method was written for the core.posting_modify_submit_post_after event and its event data is not compatible with mChat's dmzx.mchat.action_add_after event data. You will need to write a new event handler and copy (most of) the code in the check_and_role_dices method to it and then adjust all places where $event is accessed so that the correct event arguments of the dmzx.mchat.action_add_after event are used. You might also have to remove a few chunks of code, for example you don't need to check for any forum permissions ($auth->acl_get()).

I'm not familiar with dice rolling but have you seen this topic and this link in particular?

Bgagger
Donor
Posts: 34
Joined: 28 Nov 2018, 15:57

Re: Dice Mod + mChat (support/request)

#5

Post by Bgagger » 15 Dec 2018, 20:31

kasimi wrote:
15 Dec 2018, 19:51
Bgagger wrote:
15 Dec 2018, 18:57
but this only makes mChat respond with a 'Service Unavailable' error and breaks down the chat post function, so nothing gets posted.
This sounds like your edits in the Dice's listener are correct and the handler method is called correctly, but the code in it is getting unexpected data from mChat. To be clear, you can't reuse the code of the Dice listener for mChat, i.e. you can't do 'dmzx.mchat.action_add_after' => 'check_and_role_dices', because the check_and_role_dices handler method was written for the core.posting_modify_submit_post_after event and its event data is not compatible with mChat's dmzx.mchat.action_add_after event data. You will need to write a new event handler and copy (most of) the code in the check_and_role_dices method to it and then adjust all places where $event is accessed so that the correct event arguments of the dmzx.mchat.action_add_after event are used. You might also have to remove a few chunks of code, for example you don't need to check for any forum permissions ($auth->acl_get()).

I'm not familiar with dice rolling but have you seen this topic and this link in particular?
You're good, you knew exactly what I was trying to do and why it's not working :)
That gives me even more to go on, I will need some time to get down and gritty with this. Thanks again!

And yeah, I have come across the link you mentioned, that is what lead me to (in a roundabout way) the version of that extension that I found and linked in my original post. So back to square one, but thanks for noting it anyway.

terry2
Donor
Posts: 169
Joined: 22 Oct 2016, 18:22
Location: My castle

Re: Dice Mod + mChat (support/request)

#6

Post by terry2 » 15 Dec 2018, 23:16

Why not just use the mchat dice addon ? With a small tweet to a style html file it will work with mchat and within any forum.

Bgagger
Donor
Posts: 34
Joined: 28 Nov 2018, 15:57

Re: Dice Mod + mChat (support/request)

#7

Post by Bgagger » 16 Dec 2018, 16:10

terry2 wrote:
15 Dec 2018, 23:16
Why not just use the mchat dice addon ? With a small tweet to a style html file it will work with mchat and within any forum.
I have looked around but haven't found any such thing. Could you please link or refer to where I can find another dice function solution for mChat? It has to be compatible with phpBB 3.2.4

The dice extension I'm working with now is fairly advanced. But I am making progress and think with some time I might be able to make it work with mChat. If anyone wants to lend a hand looking over the code, please let me know.
If I come up with a working solution, I will share it here. The dice extension is open source and free to use according to the creator, but appears to have been abandoned and is not supported in any way.

terry2
Donor
Posts: 169
Joined: 22 Oct 2016, 18:22
Location: My castle

Re: Dice Mod + mChat (support/request)

#8

Post by terry2 » 16 Dec 2018, 19:08

mchat dice and mchat rps both can be got from here https://www.martins-phpbb.com or https://www.dmzx-web.net they was free to use but some kind fellow thought he would clone them as his so now there vip only but do as what you want.
Selection_001.png
Selection_001.png (153.67 KiB) Viewed 119 times
Selection_001.png
Selection_001.png (153.67 KiB) Viewed 119 times

Bgagger
Donor
Posts: 34
Joined: 28 Nov 2018, 15:57

Re: Dice Mod + mChat (support/request)

#9

Post by Bgagger » 13 Jan 2019, 03:18

Still haven't gotten oxpus old dice extension to play nice with mChat. But I checked out Martins forum and turns out he has indeed made a working dice roller for mChat. You have to donate to gain access to it though, which I did. Well worth it, he was very friendly and helpful when I had some trouble getting it installed and working on our test forum.
After some tinkering to customize it, Martins dice roller now works fine. And oxpus BBcode dice roller still works for forum posts, they are not interfering with each other.

Whatever you do though, don't delete the BBcode entries for oxpus dice roller! it needs both the [dice] and [dice=] entries, for some reason. Even though [dice=] doesn't work in posts. Then you will have to disable it, delete the extension data, re-enabled it and configure all the forum sections again to get it to work.

Anyone interested in how Martins dice roller for mChat works, check his site out, it's enabled in the chatroom there. Just register to be able to see it.
https://www.martins-phpbb.com
You should also post something on the forum, as accounts with no posts don't get any access and are regularly purged. Don't be a leech, just say something constructive :)

Thank you for the suggestion terry2 :D

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest