[ABD] hanelyp fancy dice

Any abandoned Extensions will be moved to this forum.

WARNING: Extensions in this forum are not currently being supported or maintained by the original Extension author. Proceed at your own risk.
Forum rules
IMPORTANT: Extension Development Forum rules

WARNING: Extensions in this forum are not currently being supported nor updated by the original Extension author. Proceed at your own risk.
User avatar
hanelyp
Registered User
Posts: 124
Joined: Wed Apr 02, 2014 10:20 pm

[ABD] hanelyp fancy dice

Post by hanelyp »

Extension Name: hanelyp fancy dice roller
Author: hanely

Extension Description: process [dice]<spec>[/dice] bbcode extension to produce a dice roll.

Extension Version: 0.9 BETA

Requirements: N/A

Features:
  • Fancy in the sense of supporting a wide variety of dice, including non-numeric.
  • ACP code in current version is completely untested
  • processing is done when posts are submitted
Screenshots:
good roll; DoS code triggered; roll fiddled withImage
images selected by dice
Image
ACP https://raw.githubusercontent.com/hanel ... ot/acp.png

Demo URL: N/A

Extension Download: https://github.com/hanelyp/fancydice
edit: name change.
edit: change download URL.
edit: change screenshots, new version.
edit: going beta!!!
Last edited by hanelyp on Wed May 25, 2016 4:35 pm, edited 7 times in total.
User avatar
alhitary
Registered User
Posts: 868
Joined: Wed Jan 17, 2007 7:51 am
Location: ROY
Name: Bassel Taha

Re: [dev]hanelyp/fancydice

Post by alhitary »

photo plz ?
User avatar
hanelyp
Registered User
Posts: 124
Joined: Wed Apr 02, 2014 10:20 pm

Re: [dev]hanelyp/fancydice

Post by hanelyp »

Screenshot added to description. The mod currently uses the quote block to wrap the dice roll, which I expect will change.
koraldon
Registered User
Posts: 530
Joined: Sat Jun 30, 2007 12:42 pm

Re: [dev]hanelyp/fancydice

Post by koraldon »

Looks great :)
what happens when the user edits the post? does it preserve the dice roll in any case, or do I need to limit editing?
Also, what happens on preview?

p.s. I tried to download it as zip from github, but it only let me download everything, including the jigsaw extension (from here - https://github.com/hanelyp/phpbb)
User avatar
hanelyp
Registered User
Posts: 124
Joined: Wed Apr 02, 2014 10:20 pm

Re: [dev]hanelyp/fancydice

Post by hanelyp »

When a post is edited or quoted the user sees the roll result code block. Quoting of posts with rolls was a key consideration for my current design. An earlier concept rolled dice at display time, using post ID as a random seed. But quotation would break that. Preview seems to get a consistent roll result.

I'll have to look at my github setup.

I'm trying to get an ACP page for configuring dice, but the core code is fighting me on a few points. At the moment the extension registers as "effectively installed" when it is not.
User avatar
Dakin Quelia
Registered User
Posts: 303
Joined: Thu Feb 14, 2008 10:07 pm
Location: Belgium
Name: Daniel Chalsèche

Re: [dev]hanelyp/fancydice

Post by Dakin Quelia »

On phpBB 2 MOD, there is a "anti-cheat" when I was edited the post. It was display "Truncate" in red.

Look at this MOD. ;)
User avatar
hanelyp
Registered User
Posts: 124
Joined: Wed Apr 02, 2014 10:20 pm

Re: [dev]hanelyp/fancydice

Post by hanelyp »

Without tracking down a copy of phpbb2 and applying the mod there are limits to how well I can understand the "anti-cheating" code in the mod. Using the post ID as a seed and rolling dice at display time would work for my 3.1 extension except for quotations... but I just thought of a possible fix for that, tagging the bbcode with the original post ID. For anti-cheat the tag could include a secure hash.
koraldon
Registered User
Posts: 530
Joined: Sat Jun 30, 2007 12:42 pm

Re: [dev]hanelyp/fancydice

Post by koraldon »

Done a test install on 3.1.3

- Install, - successful
- Don't see any ACP settings (am I supposed to ?)
- I don't see the [dice] tag in the bbcode list, which is strange
- After I did preview and than post I got the following error:
constructing listener, fancydice
dice posting
0
2d6 => 6, 4 => 10
2d6 => 6, 4 => 10
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 2360: Cannot modify header information - headers already sent by (output started at [ROOT]/ext/hanelyp/fancydice/event/main_listener.php:26)
However, message was posted... which is strange.
- Well actually I get the above error every time I send a message with tag.
- I can manually edit the quote... and write whatever I want in the quote.
- Uninstall works, however when I try to delete data, I get the following:
fetching update data
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions_acp.php on line 132: Cannot modify header information - headers already sent by (output started at [ROOT]/ext/hanelyp/fancydice/migrations/acp.php:16)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions_acp.php on line 132: Cannot modify header information - headers already sent by (output started at [ROOT]/ext/hanelyp/fancydice/migrations/acp.php:16)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions_acp.php on line 132: Cannot modify header information - headers already sent by (output started at [ROOT]/ext/hanelyp/fancydice/migrations/acp.php:16)
and it fails with:
Something went wrong during the request and an exception was thrown. The changes made before the error occurred were reversed to the best of our abilities, but you should check the board for errors.

A required module info file is missing: \hanelyp\fancydice\acp\main_module

Return to the extension list
Hope I helped :)
User avatar
Dakin Quelia
Registered User
Posts: 303
Joined: Thu Feb 14, 2008 10:07 pm
Location: Belgium
Name: Daniel Chalsèche

Re: [dev]hanelyp/fancydice

Post by Dakin Quelia »

hanelyp wrote:Without tracking down a copy of phpbb2 and applying the mod there are limits to how well I can understand the "anti-cheating" code in the mod. Using the post ID as a seed and rolling dice at display time would work for my 3.1 extension except for quotations... but I just thought of a possible fix for that, tagging the bbcode with the original post ID. For anti-cheat the tag could include a secure hash.
I prefer the style of phpBB 2 MOD. ;)
User avatar
hanelyp
Registered User
Posts: 124
Joined: Wed Apr 02, 2014 10:20 pm

Re: [dev]hanelyp/fancydice

Post by hanelyp »

koraldon, the code currently in gethub has broken ACP code, and apparently a few lines of debug output that will need to be disabled. Next update to code should have a functional ACP. dice in the bbcode list is towards the bottom of my todo list for this project.

Dakin Quelia, Yes, the current code is subject to edit cheating. I'm considering options to prevent that.

Meanwhile, I've been expanding the syntax supported by the underlying dice roll class, adding support for new kinds of randoms.
User avatar
Dakin Quelia
Registered User
Posts: 303
Joined: Thu Feb 14, 2008 10:07 pm
Location: Belgium
Name: Daniel Chalsèche

Re: [dev]hanelyp/fancydice

Post by Dakin Quelia »

And the syntax?
Rolls: 2d10
Results: 10 + 10 = 20
Demo here.

  • Possibility to add a title in quote.
  • Possibility to make a template for syntax via dropdownbox (like template Pages of Extension Page)
;)
Last edited by Dakin Quelia on Sat Mar 28, 2015 12:54 am, edited 1 time in total.
koraldon
Registered User
Posts: 530
Joined: Sat Jun 30, 2007 12:42 pm

Re: [dev]hanelyp/fancydice

Post by koraldon »

Thanks Hanelyp,
Just testing the code to try and help. I will try again after you update.

Great work :)
User avatar
hanelyp
Registered User
Posts: 124
Joined: Wed Apr 02, 2014 10:20 pm

Re: [dev]hanelyp/fancydice

Post by hanelyp »

Syntax docs are in the file fancydice.php in the extension, and have been added to the gethub page. Most ordinary users probably won't have much use for the full syntax. Instead macros covering the dice of interest for your group would be defined. When I get around to adding bbcode buttons, I'm thinking buttons for the configured dice would be nice. Result format is a work in progress, and suggestions will be considered.

By default it supports the basic format like

Code: Select all

[dice]3d6+2[/dice]
where d is defined by

Code: Select all

@[1_>]
which translates to "taking the left number as a count, select in the range of 1 to the number found to the right."
Yes, a bit intimidating for non-programmers, which is why I don't expect non-programmers to use the full syntax.
User avatar
hanelyp
Registered User
Posts: 124
Joined: Wed Apr 02, 2014 10:20 pm

Re: [dev]hanelyp/fancydice

Post by hanelyp »

Status update:
New code on github. ACP should be working now.
Bug spotted in random seed code, should be resolved as part of other changes I'm looking at to better integrate with the core bbcode processing and include anti-cheat.
koraldon
Registered User
Posts: 530
Joined: Sat Jun 30, 2007 12:42 pm

Re: [dev]hanelyp/fancydice

Post by koraldon »

Thanks, looking to become great extension :)
Short testing:
- Delete data now working, yay.
- I don't see anything in ACP, looking at the extensions menu. (see settings for other extensions).
- No more error messages in frontends, seems to work great.
- Tried to roll 30 2d6, seems random, didn't check it vs. bell curve.
- If you can solve edit issue (anti-cheat) it will be awesome
- Let me know if you need more testing.

Two remarks:
A) github still requires me to download everything, maybe it should sit at the root?
B) This version has same version number as previous (0.1.0) in file. This is confusing. Could you also add version check/update info, so everybody get automatic notice for update, see - https://wiki.phpbb.com/Extension_meta_data

Return to “Abandoned Extensions”