[SOLVED] Mmo sdk OperationSetProperties issue

edited November 2010 in Photon Server
Hello. I found one strange thing when worked with Item.Text on client side.
When i connect to photon in mmo sdk, function requires name of the avatar in constructor of Game class. Due to structure of my code, i put default name for avatar in constructor, aiming to change it later. But i ran into problem: name isn't changing.

I.e. considering following situation: player enters the game (with default name), changes his name to proper one, next player enters the game and.. get wrong name of first player.

To be sure, i made small test:
Operations.SetProperties(engine, engine.Avatar.Id, (byte)ItemType.Avatar, new System.Collections.Hashtable { { Item.PropertyKeyText, connectionParams.Login } }, null, true);

			Operations.GetProperties(engine, engine.Avatar.Id, (byte)Photon.MmoDemo.Common.ItemType.Avatar, null);

and as i said, GetProperties returned OLD value!

I continued to server side and found OperationSetProperties in server project. But then i was surprised that function only forwards values and NOT changing anything on server side! Now i'm confused, is this default behaviour and i'm missing something important or i found a bug?

Thanks in advance.


  • dreamora
    the Set and Get Property on the server will relay it around a few steps until it ends on the actual class which implements it (MMOItem I think) but its sets them, at least did prior this SDK version

    But get properties there will definitely not work. you can take it for granted that at the time you request the information the server has not even heard that it was set yet so you get the old one ...

    You need to leave Set the time to be processed at very very least, normally a bit more as the handling on the server goes through fibers which allows parallelity but also means "no immediate processing".

    put these two calls in a coroutine and put in a yield wait second, in case we talk about unity or just some scheduling in whatever else you might be using
  • Boris
    it sounds a lot like this issue: viewtopic.php?f=6&t=144&p=918
    I believe it's already fixed with the current download, but if you aren't comparing old and new side-by-side it's easy to miss.
  • seems like the fix in that topic is what i need! cant wait for tomorrow to check it out! :mrgreen:


    that solved the problem