Warning message with Equals and GetHashCode

Post here all your questions related with SmartFoxServer .Net/Unity3D API

Moderators: Lapo, Bax

kaligus
Posts: 45
Joined: 01 Sep 2009, 13:26

Warning message with Equals and GetHashCode

Postby kaligus » 21 Sep 2009, 16:54

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.
kaligus
Posts: 45
Joined: 01 Sep 2009, 13:26

Postby kaligus » 22 Sep 2009, 17:23

Anybody can help me? :?
Molix
Posts: 40
Joined: 01 Apr 2009, 19:34
Location: Toronto, ON, Canada

Postby Molix » 23 Sep 2009, 18:47

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?)
kaligus
Posts: 45
Joined: 01 Sep 2009, 13:26

Postby kaligus » 23 Sep 2009, 19:02

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...
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 24 Sep 2009, 06:31

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

?

/Thomas
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 24 Sep 2009, 06:34

Oh

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

http://msdn.microsoft.com/en-us/library ... 80%29.aspx

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

/Thomas
kaligus
Posts: 45
Joined: 01 Sep 2009, 13:26

Postby kaligus » 24 Sep 2009, 12:45

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
pankajnagarkoti86
Posts: 2
Joined: 12 Oct 2009, 21:49
Contact:

Postby pankajnagarkoti86 » 12 Oct 2009, 21:50

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.

Return to “.Net / Unity3D API”

Who is online

Users browsing this forum: No registered users and 2 guests