Page 1 of 1

Warning message with Equals and GetHashCode

Posted: 21 Sep 2009, 16:54
by kaligus
Hello Thomas,

I'm making my game inside your API, so far so good. I made a custom Lobby room, where everyone could create their rooms and then enter and click play button, then loads a scene and everyone plays. I used the example scripts you made with SFS Island Demo. I needed to change somethings, because the OnLogin and OnRoomEnter does not work for my game.

Everything run ok, but when I play I cannot see the animations from the other remote players (like theirs players in my windows appears to be flying instead of walking, and it keeps in idle animation), its looks like the message of animation its not working... I only changed the script of NetworkController, but I dont see what could be wrong...

And then I got a warning message in Unity debug: csNetworkScene (where this is my NetworkController script) overrides Object.Equals(object) but does not override Object.GetHasCode().

I tried copy the entire code of SFS Island demo and the same message appears... do you know if this has something to do with the animation problem?

Thanks in advance.

Posted: 22 Sep 2009, 17:23
by kaligus
Anybody can help me? :?

Posted: 23 Sep 2009, 18:47
by Molix
I have this warning too, since our code originated with the sample code, but I do not think it would cause the effect you described.

(it would be nice to get rid of it though; presumably there's a one-line call that would do it....anyone?)

Posted: 23 Sep 2009, 19:02
by kaligus
Hey Molix... yes, I already solved that problem I had, but this warning message keeps appearing to me, I still dont know what it is...

Posted: 24 Sep 2009, 06:31
by ThomasLund
Hey hey

Sorry for not responding earlier - I dont really know what the real cause could be.

What the code does is to send the string of the animation name to other clients. So if your model that you use for avatar doesnt have that animation, then it would definitely not play - and appear to be idle.

Have you checked that the
1) model has animations
2) that they are named similar in case you use different models



Posted: 24 Sep 2009, 06:34
by ThomasLund

On the warning message, its common practice that if you overload one you also have to overload the other. ... 80%29.aspx

"It is recommended that any class that overrides Equals also override System.Object.GetHashCode."


Posted: 24 Sep 2009, 12:45
by kaligus
Hey Thomas, thanks for the answer.

My problem about the animations was simply that the messages were sent by the script of FPSWalker... I did not noticed that, then I worte my own code on this and later I see that FPSWalker sent the animations message :lol: so, my mistake!

About the warning message, I will do as you said... but I did not noticed the override of GetHashCOde on your scripts, thats why is strange... but, anyway :D I will try

Posted: 12 Oct 2009, 21:50
by pankajnagarkoti86
I have this warning too, since our code originated with the sample code, but I do not think it would cause the effect you described.