TripleA Logo TripleA Forum
    • TripleA Website
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Tags
    • Register
    • Login

    [Open] Connection Lost

    Scheduled Pinned Locked Moved Bug Reports
    29 Posts 6 Posters 15.3k Views 6 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • redrumR Offline
      redrum Admin @RoiEX
      last edited by

      @RoiEX Yeah, probably should.

      TripleA Developer with a Passion for AI: https://forums.triplea-game.org/topic/105/ai-development-discussion-and-feedback

      1 Reply Last reply Reply Quote 0
      • ssoloffS Offline
        ssoloff Admin @RoiEX
        last edited by

        @RoiEX We may already be logging it, but it is at FINER level. I traced the call in ClientModel back, and it may be coming from either NioReader or NioWriter. The NioWriter code is:

        https://github.com/triplea-game/triplea/blob/912c63331f89f6fa2c537242b5fdf57b7f131020/game-core/src/main/java/games/strategy/net/nio/NioWriter.java#L116-L119

        (The NioReader code is almost identical.)

        Unfortunately, everything below INFO level is dropped by Console even if All Messages is selected for the log level.

        Note also that if you were to add a log where you proposed, depending on the log level you choose, two message boxes may be displayed for the one error: one from ErrorMessage and one from EventThreadJOptionPane.

        1 Reply Last reply Reply Quote 1
        • RoiEXR Offline
          RoiEX Admin
          last edited by

          So would you suggest to increase the logging level to info?
          Or do you think modifying the vmoptions file to log this level just for debugging would be sufficient here?
          I think I managed to do it when trying to debug scousemart's issue so time ago

          ssoloffS 1 Reply Last reply Reply Quote 0
          • ssoloffS Offline
            ssoloff Admin @RoiEX
            last edited by

            @RoiEX There's probably a short-term solution and a long-term solution here.

            The short-term issue is assisting @VanBattlesick in debugging his issue. In that case, I'd say do whatever is the quickest. If you can provide a one or two-line change to the .vmoptions file that will display the exception, that sounds good.

            In the long term, I think we need to consider what to do about all the log messages below INFO level that we're losing (without a possible manual workaround). At the time the ErrorMessage feature was introduced, I believe there was a discussion about having a way, via the Console UI, for the user to really see all the logs. That may be as simple as adding a third option that only displays INFO and above (similar to what happens today when you select All Messages) and then having All Messages truly display ALL log levels.

            1 Reply Last reply Reply Quote 1
            • RoiEXR Offline
              RoiEX Admin
              last edited by

              I finally found the post where I proposed the original solution.
              I modified the properties file to be

              handlers=games.strategy.debug.ConsoleHandler
              
              games.strategy.net.nio.NioWriter.level=FINEST
              games.strategy.net.nio.NioReader.level=FINEST
              

              but unfortunately I got a

              Can't load log handler "games.strategy.debug.ConsoleHandler"
              java.lang.InstantiationException: games.strategy.debug.ConsoleHandler
              

              Because the ConsoleHandler class no longer has a default constructor.
              So we need a code change either way unfortunately, adding a default constructor might be the fastest way nevertheless though.

              ssoloffS 2 Replies Last reply Reply Quote 1
              • ssoloffS Offline
                ssoloff Admin @RoiEX
                last edited by

                @RoiEX Ugh, too bad about that.

                One other thing to consider... If it looks like we'll just be hacking up the 1.9 branch to get something working, it might be better to produce a private build for @VanBattlesick to test instead of committing the changes to the 1.9 branch. I can show you how to do that in your fork (it's like a 10-line change to two files), or I can set up such a branch in my fork and you can submit PRs there.

                1 Reply Last reply Reply Quote 0
                • RoiEXR Offline
                  RoiEX Admin
                  last edited by

                  @ssoloff I'd appreciate if you could setup a branch for this.
                  If you could do this within the next 7 hours I'd try submitting a PR this evening

                  ssoloffS 1 Reply Last reply Reply Quote 0
                  • RoiEXR Offline
                    RoiEX Admin
                    last edited by

                    Also if we're going to create a hack anyways, I'll just going to increase the log level to error, so that @VanBattlesick doesn't need to set something up, even if it might open too much windows

                    1 Reply Last reply Reply Quote 1
                    • ssoloffS Offline
                      ssoloff Admin @RoiEX
                      last edited by

                      @RoiEX I created the branch spike/topic-1104-connection-lost-debugging in my fork for your use. I sent you a collaborator invite to my fork so you don't have to wait for me to merge PRs. Please be careful while it's in effect. 😄 (GitHub collaboration seems to be an all-or-nothing affair--I couldn't find a way to limit collaboration to specific branches.)

                      Pushing to the above branch will generate a new GitHub release here: https://github.com/ssoloff/triplea-game-triplea/releases. Once you post a link to a testable release in this thread, I'll clean up any previous releases that were generated.

                      1 Reply Last reply Reply Quote 3
                      • RoiEXR Offline
                        RoiEX Admin
                        last edited by

                        @VanBattlesick So I modified the code in a way that should force it to display an error message even for "harmless errors" i.e. normal disconnects.
                        Please install the modified version you can find here, and try to reproduce your steps.
                        This time you should get an error dialog with a "Show Details" button you can click.
                        This will open an error console window, which could perhaps be out-of focus and behind the main window, so check your opened windows if nothing seems to appear for you.
                        If you finally found the console, please post the content here so we can proceed to help you with your issue.

                        Thanks @ssoloff for providing the infrastructure 👍

                        1 Reply Last reply Reply Quote 4
                        • V Offline
                          VanBattlesick
                          last edited by

                          0_1543461880395_c20ca659-dd8d-4de8-9db8-c290e10c8b51-image.png

                          1 Reply Last reply Reply Quote 1
                          • RoiEXR Offline
                            RoiEX Admin
                            last edited by

                            @VanBattlesick
                            Ok, that definitely helps, but not as much as I thought.
                            I googled this error message and it seems to be a known problem that appears to occur to a lot of Minecraft players.
                            I didn't find a definite answer on how to fix this though, so I can't guarantee they will work for you.

                            Option 1

                            If you have java installed and can access the java configuration via the control panel which looks like this, except in your language: Control Panel
                            If you switch to the "Advanced" Tab and scroll down to check this checkbox this is supposed to help some people
                            Option
                            I don't really kow why this is supposed to work, but I just wanted to note it down.

                            Option 2

                            This one is a little bit more complicated and not that straightforward, but is more promising IMO.
                            Basically redoing your local Firewall rules to allow java to communicate with the internet:
                            Try searching for this Firewall menu in your local control panel: (Unfortunately I can't really tell you the english terms for the individual setting windows, I don't have an english windows installation)
                            Firewall
                            And check if theres an entry for java in the outgoing or the incoming rules section.
                            If there's an entry try removing it.
                            If you then start TripleA again it should ask you if you want to allow java in certain network types.
                            Try selecting all checkboxes (public and private) and see if that helps.

                            @ssoloff We should really modify the NioReader and NioWriter classes to actually log those IOExceptions with a higher level, this one shouldn't be treated as a "normal disconnect"

                            V 1 Reply Last reply Reply Quote 2
                            • V Offline
                              VanBattlesick @RoiEX
                              last edited by VanBattlesick

                              @RoiEX Playing tonight and it went good for a little while and then started lagging. It froze and jumped ahead again once my opponent typed in chat screen. Then I got disconnected.
                              0_1543631317654_3ca8095c-9408-4354-a79a-d210f46308fd-image.png

                              Also lost connection to server
                              0_1543631341840_e1ba69aa-7eeb-4991-8d85-2acc39d60ad7-image.png

                              1 Reply Last reply Reply Quote 0
                              • RoiEXR Offline
                                RoiEX Admin
                                last edited by

                                Which "Option" did you try?

                                1 Reply Last reply Reply Quote 0
                                • V Offline
                                  VanBattlesick
                                  last edited by

                                  I tried option one. I will try the other one next.

                                  1 Reply Last reply Reply Quote 0
                                  • ssoloffS Offline
                                    ssoloff Admin
                                    last edited by

                                    @RoiEX I'm cleaning up my fork. Do you still need the spike/topic-1104-connection-lost-debugging branch? If you don't need it now but think you'll need it again in the future, it's pretty simple to re-create.

                                    1 Reply Last reply Reply Quote 0
                                    • RoiEXR Offline
                                      RoiEX Admin
                                      last edited by

                                      Not anymore. We have all the debug information we can get for now, so we should be fine

                                      1 Reply Last reply Reply Quote 1
                                      • ssoloffS Offline
                                        ssoloff Admin @RoiEX
                                        last edited by

                                        @RoiEX said in Connection Lost:

                                        I finally found the post where I proposed the original solution.
                                        I modified the properties file to be

                                        handlers=games.strategy.debug.ConsoleHandler
                                        
                                        games.strategy.net.nio.NioWriter.level=FINEST
                                        games.strategy.net.nio.NioReader.level=FINEST
                                        

                                        but unfortunately I got a

                                        Can't load log handler "games.strategy.debug.ConsoleHandler"
                                        java.lang.InstantiationException: games.strategy.debug.ConsoleHandler
                                        

                                        Because the ConsoleHandler class no longer has a default constructor.
                                        So we need a code change either way unfortunately, adding a default constructor might be the fastest way nevertheless though.

                                        I was playing around with the logging system recently. I discovered that specifying the games.strategy.debug.ConsoleHandler in the configuration file appears to be unnecessary since it is registered in code during application startup. That means you can remove the handlers property to avoid the InstantiationException, but the logger level configuration lines continue to be processed as expected.

                                        In summary, even though our ConsoleHandler doesn't provide a default constructor, the approach you proposed above should continue to be a viable solution if we ever need to provide a custom logger configuration (at least with respect to log levels).

                                        1 Reply Last reply Reply Quote 2
                                        • V Offline
                                          VanBattlesick
                                          last edited by

                                          Hi,
                                          Sorry I have not updated on what happened while playing but I got so fed up that I just said "Forget it!". I find myself still wanting to play at times however and now wonder if their has been any progress with a fix for my problem. What else can I do to make this work?
                                          VanB.........

                                          1 Reply Last reply Reply Quote 0
                                          • RoiEXR Offline
                                            RoiEX Admin
                                            last edited by

                                            @VanBattlesick You wanted to try option 2

                                            1 Reply Last reply Reply Quote 0

                                            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                            With your input, this post could be even better 💗

                                            Register Login
                                            • 1
                                            • 2
                                            • 1 / 2
                                            • First post
                                              Last post
                                            Copyright © 2016-2018 TripleA-Devs | Powered by NodeBB Forums