Client error/disconnect (but no crash) when using Conversation

Discussion in 'Plugin Development' started by pie_flavor, Jan 16, 2016.

Thread Status:
Not open for further replies.
  1. Offline

    pie_flavor

    Title says it all.
    LegacyDiscipline.class
    There is no error listed in the launcher's log. The server log only says that I lost connection with an internal exception: ArrayIndexOutOfBoundsException: 1. No stack-trace, no line numbers, no reason. I have just clicked an item in the inventory, and told the conversation 'Test Reason'.
     
  2. Offline

    pie_flavor

  3. Offline

    SolarStrafe

    Bump, please fix this. I need this to work for the plugin that @pie_flavor is making for me
     
  4. Offline

    TheMexicanKirby

    ArrayIndexOutOfBoundsException gets thrown when you are trying to access an index of an array which is not valid as it is not in between the bounds.
     
  5. Offline

    pie_flavor

    @TheMexicanKirby First of all, I already knew that. Second, on the off chance that I didn't, how would that have helped me?
     
  6. Offline

    mcdorli

    Do you use any sort of custom inventory, while doing this?
     
  7. Offline

    pie_flavor

    @mcdorli Yes, directly before. However, as mentioned in the title, it breaks during the subsequent Conversation.
     
  8. Offline

    SolarStrafe

  9. Offline

    teej107

    So the error occurs in the InventoryClickEvent?
     
  10. Offline

    Zombie_Striker

    Code:
    package flavor.pie;
    First, please follow package naming conventions. This should be "me.[name].[project]"
    Code:
        enum Discipline {
            BAN, KICK, MUTE, TEMPBAN, TEMPMUTE
        }
        class ReasonPrompt extends StringPrompt {
            Discipline d;
            ReasonPrompt(Discipline d) {
                ReasonPrompt.this.d = d;
            }
    
    Please do not create subclasses. Instead, please move all classes to their own separate files, and please clean up your code. Your naming of methods/variables and your formatting makes it unreadable.
     
  11. Offline

    pie_flavor

    @Zombie_Striker I keep everything in the same file for organizational purposes. Saves bouncing around a lot. Habit I picked up from programming in Scala. Code is completely readable, so please don't give me formatting criticism until you actually have a solution. No comment on the package thing, it doesn't actually affect anything.
    @teej107 No, the event proceeds fine. A Conversation is created, and immediately after I respond to the first prompt, my client disconnects, and the server says that there was an ArrayIndexOutOfBoundsException, but doesn't provide a stack trace.
     
  12. Offline

    teej107

    Can we see the ReasonPrompt?
     
  13. Offline

    pie_flavor

    @teej107 everything's in the pastebin
     
  14. Offline

    teej107

    Do you get to the DurationPrompt?
     
  15. Offline

    pie_flavor

    @teej107 I don't actually know. As soon as I enter the message, it disconnects.
     
  16. Offline

    mythbusterma

    I'm not sure in what world any of that is readable, but it certainly isn't. Also, having no effect on functionality is a very poor reason to avoid convention. I could name all my variables with Unicode escapes by that logic. We have conventions for a reason, you should use them.

    Try debugging, what code is reached, what code isn't reached? Also, since it's fairly unreadable, some explanation as to what the code does would be pertinent to us helping you. What code is run when you open the conversation? Have you tried opening that inventory separate from the Conversations API?
     
Thread Status:
Not open for further replies.

Share This Page