/// <summary> /// NodeDataEventArgs Constructor /// </summary> /// <param name="parsed">a simple MessageParse</param> internal NodeDataEventArgs(dynamic parsed) { #if DEBUG FCP2Protocol.ArgsDebug(this, parsed); #endif lastGoodVersion = parsed.lastGoodVersion; sig = parsed.sig; opennet = parsed.opennet; identity = parsed.identity; version = parsed.version; physical = new PhysicalType(parsed.physical); ark = new ArkType(parsed.ark); dsaPubKey = new DsaPubKeyType(parsed.dsaPubKey); dsaPrivKey = new DsaPrivKeyType(parsed.dsaPrivKey); dsaGroup = new DsaGroupType(parsed.dsaGroup); auth = new AuthType(parsed.auth); clientNonce = parsed.clientNonce; location = parsed.location; if (!parsed.location.LastConversionSucessfull) { location = -1.0; } if ([email protected]()) { @volatile = new VolatileType(parsed.@volatile); } #if DEBUG parsed.PrintAccessCount(); #endif }
/// <summary> /// PeerEventArgs Constructor /// </summary> /// <param name="parsed">a simple MessageParse</param> internal PeerEventArgs(dynamic parsed) { #if DEBUG FCP2Protocol.ArgsDebug(this, parsed); #endif lastGoodVersion = parsed.lastGoodVersion; opennet = parsed.opennet; myName = parsed.myName; identity = parsed.identity; location = parsed.location; testnet = parsed.testnet; version = parsed.version; physical = new PhysicalType(parsed); ark = new ArkType(parsed); dsaPubKey = new DsaPubKeyType(parsed); dsaGroup = new DsaGroupType(parsed); auth = new AuthType(parsed); @volatile = new VolatileType(parsed); metadata = new MetadataType(parsed); #if DEBUG parsed.PrintAccessCount(); #endif }
/// <summary> /// PeerEventArgs Constructor /// </summary> /// <param name="parsed">a simple MessageParse</param> internal PeerEventArgs(dynamic parsed) { #if DEBUG FCP2Protocol.ArgsDebug(this, parsed); #endif LastGoodVersion = parsed.lastGoodVersion; Opennet = parsed.opennet; MyName = parsed.myName; Identity = parsed.identity; Location = parsed.location; Testnet = parsed.testnet; Version = parsed.version; Physical = new PhysicalType(parsed); Ark = new ArkType(parsed); DsaPubKey = new DsaPubKeyType(parsed); DsaGroup = new DsaGroupType(parsed); Auth = new AuthType(parsed); Volatile = new VolatileType(parsed); Metadata = new MetadataType(parsed); #if DEBUG parsed.PrintAccessCount(); #endif }
/// <summary> /// NodeDataEventArgs Constructor /// </summary> /// <param name="parsed">a simple MessageParse</param> internal NodeDataEventArgs(dynamic parsed) { #if DEBUG FCP2Protocol.ArgsDebug(this, parsed); #endif LastGoodVersion = parsed.lastGoodVersion; Sig = parsed.sig; Opennet = parsed.opennet; Identity = parsed.identity; Version = parsed.version; Physical = new PhysicalType(parsed.physical); Ark = new ArkType(parsed.ark); DsaPubKey = new DsaPubKeyType(parsed.dsaPubKey); DsaPrivKey = new DsaPrivKeyType(parsed.dsaPrivKey); DsaGroup = new DsaGroupType(parsed.dsaGroup); Auth = new AuthType(parsed.auth); ClientNonce = parsed.clientNonce; Location = parsed.location; if (!parsed.location.LastConversionSucessfull) { Location = -1.0; } if ([email protected]()) { Volatile = new VolatileType(parsed.@volatile); } #if DEBUG parsed.PrintAccessCount(); #endif }
public bool VolatileContains(VolatileType type) { for (int i = 0; i < mVolatileAcquisitions.Count; i++) { if (mVolatileAcquisitions[i].type == type) { return(true); } } return(false); }
public void VolatileOpenModal(VolatileType volatileType) { if (modalVolatiles == null) { return; } int ind = (int)volatileType; if (ind >= 0 && ind < modalVolatiles.Length && !string.IsNullOrEmpty(modalVolatiles[ind])) { M8.ModalManager.main.Open(modalVolatiles[ind]); } }
public void VolatileAcquire(VolatileType volatileType) { if (!VolatileContains(volatileType)) { //generate score int score = 0; int orderInd = -1; for (int i = 0; i < volatileOrder.Length; i++) { if (volatileOrder[i].Contains(volatileType)) { orderInd = i; break; } } if (orderInd != -1) { //get difference and determine score with penalty int ind = Mathf.Clamp(mVolatileAcquisitions.Count, 0, volatileOrder.Length - 1); int diff = Mathf.Abs(orderInd - ind); score = volatileScoreValue - (diff * volatileScorePenaltyValue); if (score < 0) { score = 0; } } //add mVolatileAcquisitions.Add(new VolatileItem { type = volatileType, score = score }); } }
public string GetVolatileTypeText(VolatileType volatileType) { return(M8.Localize.Get("volatile_data_" + volatileType.ToString())); }
public bool Contains(VolatileType v) { return(System.Array.IndexOf(volatiles, v) != -1); }