brenton
New Member
Posts: 3
Posts: 3
|
Post by brenton on Jan 28, 2022 22:58:42 GMT
Just downloaded and Installed MA MP earlier and on adding the MAM_MIRROR package the following errors are present:
ERROR in MasterAudioMultiplayerAdapter.cs @ line 2374 (it looks like the parameter should be actor not _actorTrans
/// <summary> /// This calls AudioListener.pause = true, for all connected player. /// </summary> /// <param name="_actorTrans"></param>
public static void AudioListenerUnpause(Transform _actorTrans) { FireAudioOnOriginatorAndSendRPC(actor, "AudioListenerUnpause", delegate { // ReSharper disable once ConvertClosureToMethodGroup AudioListener.pause = false; }, delegate { Instance.CmdUnpauseAudioListener(); }); }
WARNING: Assets\Plugins\DarkTonic\MasterAudioMultiplayer\MasterAudioMultiplayerAdapter.cs(2633,30): warning CS0618: 'NetworkIdentity.spawned' is obsolete: 'NetworkIdentity.spawned is now NetworkServer.spawned on server, NetworkClient.spawned on client.
|
|
|
Post by DarkTonic Dev on Jan 29, 2022 0:16:08 GMT
Thanks for the message. I do not have the error you show on like 2374 (mine looks different and compiles fine). I would make sure you have the latest version and install the Mirror integration package again.
The warning, I am not sure how to solve. Do you know how to tell on Mirror if we are the server or client?
Thanks, -Brian
|
|
brenton
New Member
Posts: 3
Posts: 3
|
Post by brenton on Jan 29, 2022 1:08:34 GMT
Yea, I just downloaded everything like an hour before I posted, so I would think I have the latest versions..But I will will double check (in the mean time, I just changed the parameter to actor so I could start using this tool without the compile error)
I think you have that script as a NetworkBehavior, so isServer and isClient should be available to check against if I am not mistaken
|
|
brenton
New Member
Posts: 3
Posts: 3
|
Post by brenton on Jan 29, 2022 1:16:33 GMT
This may not be correct, since I just started using MA and am not to a point to test yet  But, maybe something along the lines of: NetworkIdentity clientView;
if (Instance.isServer) {
clientView = NetworkServer.spawned[sourceViewId];
} else {
clientView = NetworkClient.spawned[sourceViewId];
}
|
|
|
Post by DarkTonic Dev on Jan 29, 2022 2:08:30 GMT
I'm not sure either. I posted a question on the Mirror thread. Let's see what they come back with unless you can confirm.
|
|
|
Post by DarkTonic Dev on Jan 29, 2022 7:58:30 GMT
They replied on Mirror thread. I've change the code there to the following:
private static Transform FindTransformForReplicatedAudio(uint sourceViewId, string transformPath, string functionName) { var networkId = Utils.GetSpawnedInServerOrClient(sourceViewId); var isClient = networkId.isClient;
var clientView = isClient ? NetworkClient.spawned[sourceViewId] : NetworkServer.spawned[sourceViewId];
Please make the change to eliminate the warning. Thanks!
|
|