1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[h] Roll Dice RC2

Roll Dice in your Posts and see the results with win/loss

  1. Hoffi

    Hoffi Well-Known Member

    Hoffi submitted a new resource:

    [h] Roll Dice - Roll Dice in your Posts and see the results with win/loss

    Read more about this resource...
     
    PhillipJFry and Xon like this.
  2. Xon

    Xon Well-Known Member

    @Hoffi what licence is this under?

    Additionally, you should disclose that this addon phones-home if you upgrade the addon (or reinstall). Especially as it fetches and pushes data to your server.

    Otherwise this addon looks quite good and comprehensive.
     
  3. Xon

    Xon Well-Known Member

    @Hoffi

    After checking, there are a few serious short coming of this addon:
    • Any errors on install are logged to a file and silently ignored, you should use XenForo_Error::logException() where required.
    • Does not use listener hints.
    • There is no check for if the user is logged in on the Hoffi_DM_ControllerPublic_Dice
      • actionRollNow doesn't check if they are allowed to roll.
      • actionDeleteNow doesn't check permissions. Any user can soft-delete every roll on a forum.
      • Should use XenForo_ControllerHelper_ForumThreadPost, as it has standard forum/thread/post is viewable and exists functionality
    • can_see_dice_post & can_delete_diceroll_post permissions don't go through an overridable method and use XenForo_Permission::hasContentPermission() like can_roll_dice_post does.
    • Random 'h_dice_rolls' column added to the xf_thread table without anything using or updating it. This will cause datawriters to fail when fed the contents of xf_thread.* from a select statement.
    • Why are you using the collation 'latin1_swedish_ci' (when the table is marked utf8_general_ci) ?
    • The xf_hoffi_dm_rolls table needs indexes on the following set of columns sets:
      • post_id
      • user_id
      • thread_id, roll_time
      • hash, roll_time
      • roll_state, roll_time
    • The xf_hoffi_dm_rules & xf_hoffi_dm_dice both should have a unique index on the title IMO.
    XML changes:
    Code:
        <listener event_id="load_class" execute_order="10" callback_class="Hoffi_DM_EventListener_Dice" callback_method="listenController" active="1" hint="XenForo_ControllerPublic_Help" description="XenForo_ControllerPublic_Help"/>
        <listener event_id="load_class" execute_order="10" callback_class="Hoffi_DM_EventListener_Dice" callback_method="listenController" active="1" hint="XenForo_ControllerAdmin_Forum" description="XenForo_ControllerAdmin_Forum"/>
        <listener event_id="load_class" execute_order="10" callback_class="Hoffi_DM_EventListener_Dice" callback_method="listenController" active="1" hint="XenForo_ControllerAdmin_Stats" description="XenForo_ControllerAdmin_Stats"/>
        <listener event_id="load_class" execute_order="10" callback_class="Hoffi_DM_EventListener_Dice" callback_method="listenController" active="1" hint="XenForo_ControllerPublic_InlineMod_Post" description="XenForo_ControllerPublic_InlineMod_Post"/>
        <listener event_id="load_class" execute_order="10" callback_class="Hoffi_DM_EventListener_Dice" callback_method="listenController" active="1" hint="XenForo_ControllerPublic_Thread" description="XenForo_ControllerPublic_Thread"/>
        <listener event_id="load_class" execute_order="10" callback_class="Hoffi_DM_EventListener_Dice" callback_method="listenController" active="1" hint="XenForo_ControllerPublic_Forum" description="XenForo_ControllerPublic_Forum"/>
        <listener event_id="load_class" execute_order="10" callback_class="Hoffi_DM_EventListener_Dice" callback_method="listenDataWriter" active="1" hint="XenForo_DataWriter_Forum" description="XenForo_DataWriter_Forum"/>
        <listener event_id="load_class" execute_order="10" callback_class="Hoffi_DM_EventListener_Dice" callback_method="listenDataWriter" active="1" hint="XenForo_DataWriter_Discussion_Thread" description="XenForo_DataWriter_Discussion_Thread"/>
        <listener event_id="load_class" execute_order="10" callback_class="Hoffi_DM_EventListener_Dice" callback_method="listenDataWriter" active="1" hint="XenForo_DataWriter_Discussion" description="XenForo_DataWriter_Discussion"/>
        <listener event_id="load_class" execute_order="10" callback_class="Hoffi_DM_EventListener_Dice" callback_method="listenDataWriter" active="1" hint="XenForo_DataWriter_DiscussionMessage_Post" description="XenForo_DataWriter_DiscussionMessage_Post"/>
        <listener event_id="load_class" execute_order="10" callback_class="Hoffi_DM_EventListener_Dice" callback_method="listenModel" active="1" hint="XenForo_Model_Forum" description="XenForo_Model_Forum"/>
        <listener event_id="load_class" execute_order="10" callback_class="Hoffi_DM_EventListener_Dice" callback_method="listenModel" active="1" hint="XenForo_Model_Thread" description="XenForo_Model_Thread"/>
        <listener event_id="load_class" execute_order="10" callback_class="Hoffi_DM_EventListener_Dice" callback_method="listenModel" active="1" hint="XenForo_Model_User" description="XenForo_Model_User"/>
        <listener event_id="load_class" execute_order="10" callback_class="Hoffi_DM_EventListener_Dice" callback_method="listenModel" active="1" hint="XenForo_Model_Post" description="XenForo_Model_Post"/>
        <listener event_id="load_class" execute_order="10" callback_class="Hoffi_DM_EventListener_Dice" callback_method="listenModel" active="1" hint="XenForo_Model_Stats" description="XenForo_Model_Stats"/>
        <listener event_id="template_create" execute_order="10" callback_class="Hoffi_DM_EventListener_Dice" callback_method="templateCreate" active="1" hint="application_splash" description="adds parameter for Icon"/>
    
    SQL:
    Code:
    CREATE TABLE `xf_hoffi_dm_rolls` (
      `roll_id` int(10) NOT NULL AUTO_INCREMENT,
      `hash` varchar(35) DEFAULT NULL,
      `post_id` int(10) NOT NULL,
      `user_id` int(10) NOT NULL,
      `thread_id` int(10) NOT NULL,
      `comment` varchar(200) DEFAULT NULL,
      `data` text NOT NULL,
      `wins` int(1) DEFAULT NULL,
      `result_sum` int(10) DEFAULT NULL,
      `wireset` varchar(50) DEFAULT NULL,
      `roll_state` enum('visible','moderated','deleted') NOT NULL DEFAULT 'visible',
      `roll_time` int(10) NOT NULL,
      `options` text,
      PRIMARY KEY (`roll_id`),
      KEY `post_id` (`post_id`),
      KEY `user_id` (`user_id`),
      KEY `hash` (`hash`,`roll_time`),
      KEY `thread_id` (`thread_id`,`roll_time`),
      KEY `roll_time` (`roll_state`,`roll_time`),
    INDEX `FK_xf_hoffi_dm_rolls_xf_hoffi_dm_wireset` (`wireset`),
    CONSTRAINT `FK_xf_hoffi_dm_rolls_xf_hoffi_dm_wireset` FOREIGN KEY (`wireset`) REFERENCES `xf_hoffi_dm_wireset` (`tag`) ON UPDATE NO ACTION ON DELETE SET NULL
    ) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci
    
     
    Last edited: Aug 22, 2015
  4. Hoffi

    Hoffi Well-Known Member

    It's described in the readme. And it only connect to my server, if you alowwed it before. But you're right, I will describe it more detailed.

    For the rest of your feedback, I will take a detailed lokk tomorrow.
     
    Xon likes this.
  5. Xon

    Xon Well-Known Member

    The resource guidelines where updated to require addon writers to be explicit about that sort of thing after someone abused it.

    Cheers.
     
  6. Ogreman

    Ogreman Member

    Where is the import folder? I don't see where to import anything to get started.

    Also, I try to add dice to forum or start a new forum with dice and all I get is an error? Is this because I haven't imported anything yet?
     
  7. wEbAddEr

    wEbAddEr Active Member

    I can't recive the key.
     
    Last edited: Nov 24, 2015
  8. Ogreman

    Ogreman Member

    Thanks, still somewhat new to Xenforo after using Vbulletin for many years.

    BTW, is there a separate program called [h] Social Dice? I ask because it says the following:

    "It seems, that you have installed the Social Groups by Waindigo.
    You can install the [h] Social Dice, to roll Dice in the Social Forums."

    Also, still getting the same error when trying to add the dice to a forum:

    Unknown content type 'tinhte_xentag_forum'
     
    Last edited: Nov 24, 2015
  9. Gossamer

    Gossamer Active Member

    @Hoffi

    I just installed this on XF 1.5.1. When I check the box to set the key and save the page, I get this error:
     
  10. Hoffi

    Hoffi Well-Known Member

    An update is coming to end of this month.
     
  11. bmikolajewski

    bmikolajewski New Member

    Hi Hoffi:

    Having some trouble getting this to appear in my forum...

    Dropped folders in upload into their corresponding folders (js/library/styles)
    Ran product-hRollDice.xml

    Not sure where to drop the en and de folders, didn't install them.

    We're seeing the options in our admin, and selected permissions to allow rolling dice in Quick Reply, Posts, and New Threads.

    Nothing is showing on the forum. Also, we can't get a key, could you assist?
     
  12. Laetos

    Laetos New Member

    interesting addon but what keeps a user from re rolling for a better result?
     
  13. Freelancer

    Freelancer Well-Known Member

    Great add-on. Will we see support for XF 2.0?
     
  14. Hoffi

    Hoffi Well-Known Member

    He only can roll dice during creating a Post.
    I hope, yes.
     
    Last edited: Nov 18, 2016
    Freelancer likes this.
  15. Commodore

    Commodore Member

    Is there an English version of this?
     
    Freelancer likes this.
  16. Hoffi

    Hoffi Well-Known Member

    The AddOn is developed in english, the Screenshots are with german language installed.
     
  17. Commodore

    Commodore Member

    Ahh ok.

    But, the dice look all the same no matter how many sides it has... why?
     
  18. Hoffi

    Hoffi Well-Known Member

    Maybe the images weren't upload correctly or the path isn't correct in the settings.

    Edit a die and if there is no preiew on the left, the image can't be found.

    [​IMG]
     
  19. Commodore

    Commodore Member

    Ahh ok if we get English, and the di looks somewhat legit, then this will be a nice surprise for guildies. We are in several D&D online games, so we roll on stuff all the time!! ;)
     
    Hoffi likes this.
  20. PhillipJFry

    PhillipJFry New Member

    Hello, I'm on XenForo 1.5.11 and I can't find the settings for the addon. I didn't do anything with the files in /en/ because I don't know where to upload them.

    Edit: I managed to find the settings, after using the admin set at installation but when I try to roll it says that I have no permissions
     
    Last edited: Nov 25, 2016

Share This Page