Quantcast
Channel: Photon Unity Networking (PUN) — Photon Engine
Viewing all articles
Browse latest Browse all 8947

(urgent - live game) Operation failed: OperationResponse 252: ReturnCode: -2

$
0
0
Where can I find information on this error? I have been looking for the codes but not much luck.

Operation failed: OperationResponse 252: ReturnCode: -2 (CAS update failed: property='248' has value='4'). Parameters: {} Server: GameServer
UnityEngine.Debug:LogError(Object)
NetworkingPeer:OnOperationResponse(OperationResponse) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1571)
ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(Byte[])
ExitGames.Client.Photon.TPeer:DispatchIncomingCommands()
ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands()
PhotonHandler:Update() (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:157)


I can't directly see what I am doing to trigger it nor do I know how to track down the root cause. I suspected it was this last bit of code I added, am I overlooking something?

I must admit I am not the most well versed with custom types so I probably made a mistake.
PhotonPeer.RegisterType (typeof(ObscuredInt), (byte)'I', SerializeObscuredInt, DeserializeObscuredInt);
PhotonPeer.RegisterType (typeof(ObscuredFloat), (byte)'F', SerializeObscuredFloat, DeserializeObscuredFloat);

	public static readonly byte[] memInt = new byte[4];

	private static short SerializeObscuredInt (StreamBuffer outStream, object customobject)
	{
		// get value from our custom object
		int integer = (ObscuredInt)customobject;
		lock (memInt) {
			byte[] bytes = memInt;
			int tOff = 0;
			Protocol.Serialize (integer, bytes, ref tOff);
			outStream.Write (bytes, 0, 4);
			return 4;
		}
	}

	private static object DeserializeObscuredInt (StreamBuffer inStream, short length)
	{
		int integer;
		lock (memInt) {
			inStream.Read (memInt, 0, 4);
			int tOff = 0;
			Protocol.Deserialize (out integer, memInt, ref tOff);
		}
		return (ObscuredInt)integer;
	}



	public static readonly byte[] memFloat = new byte[4];

	private static short SerializeObscuredFloat (StreamBuffer outStream, object customobject)
	{
		float flt = (ObscuredFloat)customobject;
		lock (memInt) {
			byte[] bytes = memInt;
			int tOff = 0;
			Protocol.Serialize (flt, bytes, ref tOff);
			outStream.Write (bytes, 0, 4);
			return 4;
		}
	}

	private static object DeserializeObscuredFloat (StreamBuffer inStream, short length)
	{
		float flt = 0;
		lock (memFloat) {
			inStream.Read (memFloat, 0, 4);
			int tOff = 0;
			Protocol.Deserialize (out flt, memFloat, ref tOff);
		}
		return (ObscuredFloat)flt;
	}

Viewing all articles
Browse latest Browse all 8947

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>