public override void HandleSync(Sfs2X.Entities.Data.ISFSObject obj) { //Debug.Log ("Character Handling Sync"); if(mode == SFSNetworkManager.Mode.LOCAL) return; bool consumed = false; if(obj.ContainsKey(statusDS)){ statusRecp.ReceiveStatus(obj); consumed = true; } if (obj.ContainsKey(posDS)){ posRecp.ReceiveResultant(obj); consumed = true; } if (obj.ContainsKey(movDS)){ posRecp.ReceiveMoveDirection(obj); consumed = true; } if (obj.ContainsKey(animDS)){ Debug.Log("Received animation update"); animRecp.ReceiveState(obj); consumed = true; } if(!consumed){ Debug.LogError("Unhandled sync"); } }
public override bool FromSFSObject(Sfs2X.Entities.Data.ISFSObject data) { // We just pull the data straight out of the packet because we don't have a GetByteArray that works with encryption bool retVal = false; if (data.ContainsKey("key")) { ISFSObject publicKeyData = data.GetSFSObject("key"); var tempParams = new RSAParameters(); tempParams.Modulus = publicKeyData.GetByteArray("mod").Bytes; tempParams.Exponent = publicKeyData.GetByteArray("exp").Bytes; parameters = tempParams; } return retVal; }
public override void HandleInit(Sfs2X.Entities.Data.ISFSObject obj) { bool consumed = false; if(obj.ContainsKey(statusDS)){ statusRecp.ReceiveStatus(obj); consumed = true; } if (obj.ContainsKey(posDS)){ posRecp.ReceiveResultant(obj, true); consumed = true; } // else if (obj.ContainsKey(movDS)){ // posRecp.ReceiveMoveDirection(obj); // } // else if (obj.ContainsKey(animDS)){ // animRecp.ReceiveState(obj); // } if(!consumed){ Debug.LogError("Unhandled init"); } }