Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2008
    Location
    Iran / Tehran
    Posts
    285

    New problem at the end of Deferred Integration video

    This is making me nuts, basically, i just started chapter 11, i followed videos up to where nelson implements Deferred and integrates it to mmo project and runs unity and gets the result, now, here is the problem, the unit tests return success on me, but, when i hit the success or fail button in unity i get invalid cast exception on Deferred<T>.Load when we cast error = (string) errorObj;

    why is this cast gives exception? i double checked that video from start to end and everything is 100% as nelson coded !!!!
    If you want to learn something, start teaching about it to others, nothing will help you more than that !

  2. #2
    Join Date
    Jun 2008
    Location
    Iran / Tehran
    Posts
    285
    o~k more bizzar result : first of all, this is my code in deferred.cs :

    Code:
    protected void SaveOperationResult (Dictionary<byte, object> parameters, ISerializer serializer)        {
                parameters [(byte) OperationParameter.ResponseIsValid] = IsValid;
                if (Error != null)
                    parameters[(byte) OperationParameter.ResponseOperationError] = Error;
            }
    now, because of that nasty type cast error, i commented the line in deferred`1.cs and put this :

    Code:
    public override void Load (Dictionary <byte, object> parameters, ISerializer serializer)
    {
        var isValid = (bool) parameters[(byte) OperationParameter.ResponseIsValid];
        string error = null;
        object errorObj;
        if (parameters.TryGetValue ((byte) OperationParameter.ResponseOperationError, out errorObj))
            //error = (string) errorObj;
            error = errorObj.ToString ();
        object resultBytesObj;
        if (parameters.TryGetValue ((byte) OperationParameter.ResultBytes, out resultBytesObj))
        {
            using (var ms = new MemoryStream ((byte []) resultBytesObj))
            {
                using (var br = new BinaryReader (ms))
                {
                    SetResult (isValid, error, (TResult) serializer.ReadObject (br, typeof(TResult)));
                }
            }
        }
        else
            SetResult (isValid, error);
    }
    when i hit fail on the unity window, the isvalid returns properly, but guess what is the error message : System.object[] !!!!!! why array of objects instead of System.object or System.string?????
    Last edited by css_maya; 07-20-2016 at 08:02 AM.
    If you want to learn something, start teaching about it to others, nothing will help you more than that !

  3. #3
    Join Date
    Jun 2008
    Location
    Iran / Tehran
    Posts
    285
    Fking damn, the photon server was old version !!! Damn team city, i need to get rid of it, followed nelson's code refactoring on photon servers and now this is working ! pffff
    nelson, can't we ditch team city and work with build scripts so that each project handle his own build stuff instead of dealing with team city?
    If you want to learn something, start teaching about it to others, nothing will help you more than that !

  4. #4
    Join Date
    Feb 2014
    Posts
    277
    I've never had any problems with TeamCity. After all, all it does is run commands we've already made (at least in the way we are using it.)

    As I see it, in Nelson's videos, TeamCity suffers from having to compile from msbuild using .net rather than using VS itself. As I've said on many occasions, installing VS on the TC server solves that completely. I've gone through the TC videos several times without any dramas.

    When Nelson originally did those videos, there was no such thing as the community edition of VS. To get Resharper to work Nelson couldn't use any of the free versions of VS. That changed, and as a result, I see no issues at all with using VS2015 community edition on the TC server. It simplifies upgrades too, as anything that compiles on my dev machine will be sure to compile on the TC machine. I can't stress how important I think that is.

    I see more of a problem with Photon. Whenever I use an older version of Photon (say 3.4.28) everything works well. If I was to start the series from scratch using all the newest and latest releases of everything, I suspect Photon would be the main issue. Too many things changed making the old code Nelson developed useless. In fact if I was starting again, I'd probably stick with 3.4.28 right up until Nelson upgrades photon in the video released last week (well part 1 was released, we haven't seen the end of that upgrade to Photon yet. It might prove to be a bigger issue than expected).

    I'd like more of Nelson's thoughts in these forum posts by the way. We can 'rave' all we like, but sometimes I'd like Nelson's feedback too just to get his viewpoint.

    In any case, it's been a really long time since Nelson did anything with the production environment and TC. There was a hint that much of it would need to be redone. To get to the point of the demo we do have to get the prod environment working again before the end of chapter 12, so we must be near!

    Version management might be the key to all the problems we all are all facing.

    I am tempted to go back and start at chapter 10 all over again, but then again, I am doing your chapter 1 'core' series as well and to my disgust I don't have time to do everything. Sometimes I'd just rather play a game like Supreme Commander Forged Alliance and escape from all this coding!

  5. #5
    Join Date
    Jun 2008
    Location
    Iran / Tehran
    Posts
    285
    grey, there are issues with team city, i don't have a separate development environment, in other words, teamcity, visual studio, photon and everything else sits in the same operating system. few days ago, team city stopped downloading the repo from bit bucket, apparently, the bit bucket website had changed something related to ssl system and team city was failing, then team city comes with a patch until next version gets out, now, team city downloads the fresh repo, but fails to build !!!!
    on the side note, i didn't have much trouble with photon other than change from peer to the other class name but now i have a slight issue where building inside visual studio gives error on not being able to replace the dll in some file and i am sure it should be something in my .proj file because as i see it, it puts the dll inside the unity folder but still gives the error, at least, this one is something i know i caused myself by deleting the obj and bin folders of the project, done by reading a post on a site about team city issue, and i think it ruined something in my project file.

    still, i think using team city is a bit over kill for this project, after all, if someone needs to transfer the data to a separate env for the real game, all he need to do is to pack the website and deploy it manually, copy the photon folder entirely and copy mysql data base or build the project once in there and get done with it
    If you want to learn something, start teaching about it to others, nothing will help you more than that !

Posting Permissions

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