Disable "'UnityEngine.RPC' is obsolete" spam

In a project, I get hundred warnings about obsolete networking functionality. I know there is a new system and I use it in other projects, but I don’t want to use it in this case, so my console is permanently full with these warnings since 5.1:

'UnityEngine.RPC' is obsolete: `NetworkView RPC functions are deprecated. Refer to the new Multiplayer Networking system.'

Is there a way to disable this warning globally? Is there a compiler directive like:

#define USE_LEGACY_NETWORKING

which would disable the legacy networking [obsolete] attributes, or something like that?

It currently just makes it impossible to find the “real” warnings, in the console (and in some cases even error messages).

Add this to the top of your scripts

#pragma warning disable 618

1 Like

Thanks, that works perfectly!

Didn’t work for me. I simply removed the following lines in PhotonEditor.cs , UpdateRPCList method:

if (countOldRpcs > 0)
  {
    bool convertRPCs = EditorUtility.DisplayDialog(CurrentLang.RpcFoundDialogTitle, CurrentLang.RpcFoundMessage, CurrentLang.RpcReplaceButton, CurrentLang.RpcSkipReplace);
   if (convertRPCs)
   {
    PhotonConverter.ConvertRpcAttribute("");
   }
  }

This works for me

Double click on the problem, it should bring you to PhotonEditor.cs

change this line:
if (method.IsDefined(typeof (RPC), false))

to this line:
if (method.IsDefined(typeof (PunRPC), false))

Cheers.

This fixed my problem.

3 Likes