I agree, I really can’t get my head around Unity’s networking structure so I’m going to have a network_manager object that is the only object with a NetworkView.
Hopefully I can use that fact to assign viewID(0) to it and assume it’ll be right. From then on I’ll hopefully be able to to use a custom delegate based (RPC)event based model for RPC calls so that all calls get routed through that object, including new networkViews for synchronising view IDs etc…
I should be able to do something like this:
Register interest in an RPC message from within lobby script:
NetworkManager.RegisterRPCListener("New Lobby Message", AddNewMessage);
on a remote machine call something like this:
sndRPCEvent(RPCMode.AllBuffered, "New Lobby Message", messageString);
[RPC]
sndRPCEvent(RPCMode anRPCMode, string eventName, object Obj1, object Obj2, object Obj3)
{
networkView.RPC("rcvRPCEvent",anRPCMode,viewID,eventName,Obj1,Obj2,Obj3);
}
recieve it with something like this:
[RPC]
public void rcvRPCEvent(string eventName, NetworkMessageInfo RPCMsgInfo, object Obj1, object Obj2, object Obj3)
{
RPCManager.newRPCEvent(eventName, RPCMsgInfo, Obj1, Obj2, Obj3)
}
Which should now call ‘AddNewMessage’ and pass in the parameters.
That’s where I’m at anyways, anyone tried this approach before?