Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 30

Thread: Console Client

  1. #11
    Join Date
    Nov 2006
    Location
    Vancouver, WA
    Posts
    236
    Ok still have not figured out the fix for this bug but I am learning more about using VS Debug.
    Here a a few screen shots of the stack.Click image for larger version. 

Name:	Debug_1.png 
Views:	72 
Size:	74.5 KB 
ID:	74656Click image for larger version. 

Name:	Debug_2.png 
Views:	57 
Size:	49.7 KB 
ID:	74657Click image for larger version. 

Name:	Debug_3.png 
Views:	63 
Size:	63.4 KB 
ID:	74658Click image for larger version. 

Name:	Debug_4.png 
Views:	61 
Size:	57.0 KB 
ID:	74659Click image for larger version. 

Name:	Debug_5.png 
Views:	76 
Size:	46.6 KB 
ID:	74660
    The only way to fail is to give up or die...

  2. #12
    Join Date
    Feb 2014
    Posts
    277
    yeah. Put a breakpoint at the start of the method and inspect all the arguments that are passed in when it pauses. That should tell you something!

  3. #13
    Join Date
    Nov 2006
    Location
    Vancouver, WA
    Posts
    236
    Debug set at the start of main
    Something is happening with the Client.Console.cs
    Code:
    transport.Connect("127.0.0.1:5055", "MMOFramework.Server.Master");

    SyncSystemsComponentMap Debug get to here and dies
    var componentMapBytes = (byte[]) parameters[(byte) EventCodeParameter.ComponentMapBytes];
    Additional information: Unable to cast object of type 'System.String' to type 'System.Byte[]'.

    Code:
    private void SyncSystemsComponentMap(EventCode code, Dictionary<byte, object> parameters)
            {
                var formatter = new ComponentMapBinaryFormatter();
                var componentMapBytes = (byte[]) parameters[(byte) EventCodeParameter.ComponentMapBytes];
    
                using (var ms = new MemoryStream(componentMapBytes))
                using (var br = new BinaryReader(ms))
                    formatter.Load(br, _systems.ComponentMap);
            }
    I am at a total loss as to why the componentMapBytes does not like the IP address string or Server.Master string and wants to convert it to a byte.
    The only way to fail is to give up or die...

  4. #14
    Join Date
    Nov 2006
    Location
    Vancouver, WA
    Posts
    236
    Hi OldnGrey, Could you put a break point on this function and step through it and post the steps so I can check and see if it leads me to as solution. It is after I hit this variable that the application fails I think.

    var componentMapBytes = (byte[]) parameters[(byte) EventCodeParameter.ComponentMapBytes];

    In the Client/Systems/SystemsEventReader.cs

    Code:
    private void SyncSystemsComponentMap(EventCode code, Dictionary<byte, object> parameters)
            {
                var formatter = new ComponentMapBinaryFormatter();
                var componentMapBytes = (byte[]) parameters[(byte) EventCodeParameter.ComponentMapBytes];
    
                using (var ms = new MemoryStream(componentMapBytes))
                using (var br = new BinaryReader(ms))
                    formatter.Load(br, _systems.ComponentMap);
            }
    Thank you MJTrottier
    The only way to fail is to give up or die...

  5. #15
    Join Date
    Mar 2005
    Posts
    930
    Just as a casual observer I notice that you pass an event code to the function but don't use it. I wonder if that could be the source of the problem.
    "I don't WANT to pet the chicken."

  6. #16
    Join Date
    Feb 2014
    Posts
    277
    Fortunately I do a backup at the end of each video, so I should be able to help you - there have possibly been a ton of changes to related code since this video so I won't even attempt to run it until I know where you run it from.

    Are you doing the video named "Client Console" or the following one called "Client Implementation"?
    The first one ends the videos with compiler errors..... so I better know exactly where in which video you are getting runtime errors.

  7. #17
    Join Date
    Nov 2006
    Location
    Vancouver, WA
    Posts
    236
    I am at the end of the Client Console video and have even gone as far back as the beginning of the RPC sections and reviewed my code against the videos and still have not found any difference.

    Thank you for looking at your code to help me get this fixed.

    MJ Trottier

  8. #18
    Join Date
    Aug 2010
    Posts
    160
    What are you using to host your code. GitHub, BitBucket, VSTS? I would be happy to download your branch and try to debug it. My username on GitHub and BitBucket are both am385. It would be a lot easier to just debug the code myself then try to match up something from a historical branch that might have differences in it.

  9. #19
    Join Date
    Feb 2014
    Posts
    277
    My backup of the "Client Console" video won't compile (just like Nelson's) so I am unable to run it and do any breakpoints.
    I had to go to the end of the next video to show output. Indeed it's not until late in that video that it can run.
    At the end of the "Client Implementation" video the console output says it's connected but SyncSystemsComponentMap is never called.
    So that's clearly useless to you.

    How are you running that code when it won't compile? Nelson's video shows 10 errors in 4 files.

    This is clearly going to take some time, so you might want am385 to look over your code. After all, he's a code professional. It doesn't hurt my ego

  10. #20
    Join Date
    Nov 2006
    Location
    Vancouver, WA
    Posts
    236
    Quote Originally Posted by am385 View Post
    What are you using to host your code. GitHub, BitBucket, VSTS? I would be happy to download your branch and try to debug it. My username on GitHub and BitBucket are both am385. It would be a lot easier to just debug the code myself then try to match up something from a historical branch that might have differences in it.
    Not sure if I did it right added a project to my bitbucket repo imported the repo to the project and added you to the project, thank you for taking the time to look at my code.

    MJ Trottier
    The only way to fail is to give up or die...

Page 2 of 3 FirstFirst 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •