[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.
koraldon
Registered User
Posts: 530
Joined: Sat Jun 30, 2007 12:42 pm

Re: [dev]hanelyp/fancydice

Post by koraldon »

Hi,
Still getting the same error when rolling dice
(However language strings in the admin are now okay)
User avatar
hanelyp
Registered User
Posts: 124
Joined: Wed Apr 02, 2014 10:20 pm

Re: [dev]hanelyp/fancydice

Post by hanelyp »

Ah, looks like you tripped over a hazard of shifting internal design for an extension under development. The value of second_pass_replace for dice in the bbcodes table changed to

Code: Select all

hanelyp\fancydice\event\main_listener::singlet()->bb_replace_dice("$3",$1,"$2")
An ACP function to fix up that def was already in the queue to recover from using the standard bbcode editor on that hand coded pattern.

That recovery option, possibly some customization option in roll presentation, and this extension may be ready for beta.
User avatar
hanelyp
Registered User
Posts: 124
Joined: Wed Apr 02, 2014 10:20 pm

Re: [dev]hanelyp/fancydice

Post by hanelyp »

New code in github. Now covers all the features I had in mind.
koraldon
Registered User
Posts: 530
Joined: Sat Jun 30, 2007 12:42 pm

Re: [dev]hanelyp/fancydice

Post by koraldon »

Working now, sort of
A) When I deleted previous version, I also deleted previous bbcode. When enabling new version it didn't create new bbcode. Only After I Manually created bbcode I was able to "reset" it (I created empty [dice] bbcode)
B) There is no default for dice style. i.e. when I rolled a dice I didn't see anything. Only after I copy pasted the sample <div> from the setting into the Presentation HTML for roll results, I saw the result.
C) Anti-cheat works, partially. I can still change it if I go, for example:
2d4 -> 2d4 = results doesn't change
2d4 -> 1d6 -> 2d4 = results change.
D) CSS is great idea
E) Thanks a lot :)
F) Can you add version check at beta?
G) Presentation HTML for roll results is not encoded in UTF-8, so doesn't support other languages.
User avatar
hanelyp
Registered User
Posts: 124
Joined: Wed Apr 02, 2014 10:20 pm

Re: [dev]hanelyp/fancydice

Post by hanelyp »

koraldon, some of the problems you describe suggest a leftover in the migrations table preventing the install from running correctly.

The anti-cheat isn't intended to prevent rolls from being edited, but to tag edited rolls. The roll result isn't recorded. The random seed is, along with a checksum. Changes in how the checksum was calculated would give a false cheat alarm for older rolls.

What exactly do you mean by "version check at beta"?

Can you give me a test case for utf8?
koraldon
Registered User
Posts: 530
Joined: Sat Jun 30, 2007 12:42 pm

Re: [dev]hanelyp/fancydice

Post by koraldon »

A+B - Sure, I'm using my live board for testing, so it is not a clean install
C - How does it tag the posts? I don't see it.
F- Version check at ACP - https://wiki.phpbb.com/Extension_meta_data
G -

Code: Select all

<div class="dicebox">קוביות: {SPEC}
Roll results: {DICE}. Total: {TOTAL} {VALID}</div>
The Hebrew is turned into ?????? which is an encoding issue.
User avatar
hanelyp
Registered User
Posts: 124
Joined: Wed Apr 02, 2014 10:20 pm

Re: [dev]hanelyp/fancydice

Post by hanelyp »

C - How does it tag the posts? I don't see it.
edit a post with a dice roll, or hit preview when making a post. The dice tag is modified in a fairly obvious fashion.

Going to have to do some digging on the unicode issue. Nothing in my code stands out for being a problem.

Next release will have version check if I've got it right.
User avatar
hanelyp
Registered User
Posts: 124
Joined: Wed Apr 02, 2014 10:20 pm

Re: [dev]hanelyp/fancydice

Post by hanelyp »

Fixing the unicode input was easy enough, needed a flag in $request->variable() (upload pending). But the mix of left to right and right to left characters does something strange when a roll is assembled:
קוביות: 3d6 => 6, 5, 6 => 17
User avatar
hanelyp
Registered User
Posts: 124
Joined: Wed Apr 02, 2014 10:20 pm

Re: [dev]hanelyp/fancydice

Post by hanelyp »

Another fix easier to implement than figure out: any right to left text in the display spec needs to be followed by &lrm;

Updates in gethub.
koraldon
Registered User
Posts: 530
Joined: Sat Jun 30, 2007 12:42 pm

Re: [dev]hanelyp/fancydice

Post by koraldon »

Hebrew now working,
If the board language if RTL, everything is okay, no need to add code.
Still don't see version check though, says it fails to find info.
Also I see in the screenshot that there is a text of "fiddled" I don't see it when I edit a dice roll.

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

Re: [dev]hanelyp/fancydice

Post by hanelyp »

viewtopic.php?f=461&t=2311021 seems relevant to version check. Had to dig into the code to be sure, but it looks like version check wants an http served file, and my current hosting on github doesn't work with that.

The anti-cheat is designed to trigger if the roll itself is edited, not if the post containing the roll is edited or quoted. Latest version has 'fiddled' changed to 'invalid' and defined in the language file.
User avatar
hanelyp
Registered User
Posts: 124
Joined: Wed Apr 02, 2014 10:20 pm

Re: [dev]hanelyp/fancydice

Post by hanelyp »

New code in github.

Latest version:
- enhances dice seed generation to keep seeds if a player reloads post preview.
- demos image selection with defs:
- - sm = @smilie [smtag]
- - smilie = "<img src="./images/smilies/icon_>.gif">"
- - smtag = ["e_biggrin","e_sad","e_ugeek","evil","lol","neutral","redface","cool","e_confused","e_smile","e_wink","mad","rolleyes","cry","e_geek","e_surprised","eek","mrgreen","razz","twisted"]

Smilies were used as a handy image set. Other images could be uploaded to a forum and used for game specific dice.
Image
koraldon
Registered User
Posts: 530
Joined: Sat Jun 30, 2007 12:42 pm

Re: [dev]hanelyp/fancydice

Post by koraldon »

Using images instead of numbers is cool :)
Can I use a roll d6 for example and show different faces of a die this way?

btw, I don't see new code on gitbhub.
Also, do you consider this extension to still be [dev] or is it [beta]? I would love to use it on my live board soon.
User avatar
hanelyp
Registered User
Posts: 124
Joined: Wed Apr 02, 2014 10:20 pm

Re: [dev]hanelyp/fancydice

Post by hanelyp »

Oops, forgot the git push step.

Unless someone finds a bug I don't anticipate more than a bit of cleanup between here and RC, so beta status would be fair.

You could define something like:
dsix = @facessix [1_>]
facessix = "<img src="./images/dice/d6_>.gif">"
(I haven't tested this)
where images/dice contains dice images d6_<face>.gif. That would lose the dynamic size option and summation of the default d macro.
koraldon
Registered User
Posts: 530
Joined: Sat Jun 30, 2007 12:42 pm

Re: [dev]hanelyp/fancydice

Post by koraldon »

Installed - not sure why, but when I use the same rolls on subsequent posts in the same topic - I get the same result.

Return to “Abandoned Extensions”