Object Ownership [Solved]

Options
Curtis37
edited February 2014 in Photon Server
Solved: I solved this problem by implementing a similar master client feature to the Mmo startup server. I then use the master client to be the owner of the items.

Client SDK: Unity3D(C#) not PUN
Server: Self Hosted
Startup: MMO
Target Platform: Windows Desktop, Web

Hi, I am attempting to create an item on the server using
[code2=csharp]public void BuildItem(ItemType itemType, Vector3 position, Quaternion rotation)
{
MyItem item = new MyItem(Guid.NewGuid().ToString(), (byte)itemType, this.engine.Avatar.Game, itemType.ToString());
engine.AddItem(item);
item.Spawn(GetPosition(position), GetRotation(rotation.eulerAngles), engine.Avatar.Color, false);
}[/code2]
This works fine except for the fact that when a client leaves his items are also removed. My goal is to allow users to create scene items that hold static properties. Through some research on the topic I have read this is intentional since an object must have an owner and I have stumbled upon PhotonNetwork.InstantiateSceneObjects which is part of the PUN features.

From what I have read it appears that I should be using PUN which would help since I could then run a master client to handle things like NPC's. I havn't switched to PUN yet since I am confused as to how it works or its purpose. If I use PUN can I still run my own server, I am not interested in Cloud. Also can I use an MMO style interest management server while using PUN? If not is there an alternative to PhotonNetwork.InstantiateSceneObjects that I can use with the Photon MMO server?

Edit: Okay so after trying to find more information on PUN it appears that it isn't what I want exactly since there is no PUN w/ interest management. For AI what I figure I might just do is create another client that will connect and control items that other players can attack.

Basically what I am trying to do is make something similar to http://www.pardus.at/(Pardus). Clients have the ability to create buildings/items that will over time generate or convert items. For example lets say you build a drill, over time it will fill its reservoir with dirt, stone, iron etc which players can then withdraw and place into their inventory then later place into other buildings/items. Since the server won't be processing a 'tick'/update the server will process the drills action whenever it's GetProperties are called (ex a player accesses a drill and asks the server about its properties, the server will then handle this request and modify the properties based on a delta time between when it was last accessed and now. Based on this time x amount of item generation actions will occur). Ideally if I could have a master server run and handle this that would be helpful but not necessary.

So to summarize, I would like to have clients be able to create these buildings which will reside and exist on the server. These buildings must exist after the client that generated them logs out.