protected void UpdateHeader() { EquipSetCalculator otherEquipSetCalculator; if (MonoBehaviourSingleton <StatusManager> .I.otherEquipSetSaveIndex == -1) { MonoBehaviourSingleton <StatusManager> .I.otherEquipSetSaveIndex = 0; otherEquipSetCalculator = MonoBehaviourSingleton <StatusManager> .I.GetOtherEquipSetCalculator(0); otherEquipSetCalculator.SetEquipSet(data.equipSet, false); } else { otherEquipSetCalculator = MonoBehaviourSingleton <StatusManager> .I.GetOtherEquipSetCalculator(MonoBehaviourSingleton <StatusManager> .I.otherEquipSetSaveIndex); } SimpleStatus finalStatus = otherEquipSetCalculator.GetFinalStatus(0, data.hp, data.atk, data.def); SetActive(transRoot, UI.OBJ_LAST_LOGIN, true); SetLabelText(transRoot, UI.LBL_NAME, data.name); SetLabelText(transRoot, UI.LBL_COMMENT, data.comment); SetLabelText(transRoot, UI.LBL_LAST_LOGIN, base.sectionData.GetText("LAST_LOGIN")); SetLabelText(transRoot, UI.LBL_LAST_LOGIN_TIME, data.lastLogin); SetLabelText(transRoot, UI.LBL_ATK, finalStatus.GetAttacksSum().ToString()); SetLabelText(transRoot, UI.LBL_DEF, finalStatus.defences[0].ToString()); SetLabelText(transRoot, UI.LBL_HP, finalStatus.hp.ToString()); SetLabelText(transRoot, UI.LBL_LEVEL, data.level.ToString()); bool flag = MonoBehaviourSingleton <BlackListManager> .I.CheckBlackList(data.userId); SetActive(transRoot, UI.SPR_FOLLOW_ARROW, !flag && dataFollowing); SetActive(transRoot, UI.SPR_FOLLOWER_ARROW, !flag && dataFollower); SetActive(transRoot, UI.SPR_BLACKLIST_ICON, flag); }
protected void SetCharaInfo(FriendCharaInfo data, int i, Transform t, bool is_recycle, bool isGM) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) if (isGM) { SetRenderNPCModel(t, UI.TEX_MODEL, 0, new Vector3(0f, -1.49f, 1.87f), new Vector3(0f, 154f, 0f), 10f, null); } else { SetRenderPlayerModel(t, UI.TEX_MODEL, PlayerLoadInfo.FromCharaInfo(data, false, true, false, true), 99, new Vector3(0f, -1.536f, 1.87f), new Vector3(0f, 154f, 0f), true, null); } SetLabelText(t, UI.LBL_NAME, data.name); SetLabelText(t, UI.LBL_LEVEL, data.level.ToString()); SetLabelText(t, UI.LBL_COMMENT, data.comment); SetLabelText(t, UI.LBL_LAST_LOGIN, base.sectionData.GetText("LAST_LOGIN")); SetLabelText(t, UI.LBL_LAST_LOGIN_TIME, data.lastLogin); EquipSetCalculator otherEquipSetCalculator = MonoBehaviourSingleton <StatusManager> .I.GetOtherEquipSetCalculator(i + 4); otherEquipSetCalculator.SetEquipSet(data.equipSet, false); SimpleStatus finalStatus = otherEquipSetCalculator.GetFinalStatus(0, data.hp, data.atk, data.def); SetLabelText(t, UI.LBL_ATK, finalStatus.GetAttacksSum().ToString()); SetLabelText(t, UI.LBL_DEF, finalStatus.defences[0].ToString()); SetLabelText(t, UI.LBL_HP, finalStatus.hp.ToString()); DegreePlate component = FindCtrl(t, UI.OBJ_DEGREE_FRAME_ROOT).GetComponent <DegreePlate>(); component.Initialize(data.selectedDegrees, false, delegate { GetCtrl(UI.GRD_LIST).GetComponent <UIGrid>().Reposition(); }); }
public static async Task <RigStatus> GetRigStatus(string port, string name, string ip, bool saveToFile = true) { var request = new HttpRequestMessage(HttpMethod.Get, $"http://{ip}:{port}/api/status"); try { var response = await client.SendAsync(request); if (response.IsSuccessStatusCode) { SimpleStatus s = await response.Content.ReadAsAsync <SimpleStatus>(); RigStatus r = new RigStatus() { LastComm = DateTime.Now, Port = port, RigName = name, Status = s, IP = ip }; APIComm.Rigs[ip.ToString()] = r; if (saveToFile) { APIComm.SaveRigsToFile(); } return(r); } else { return(null); } } catch { return(null); } }
protected virtual void UpdateUIStatus() { int num; int num2; int num3; EquipSetCalculator equipSetCalculator; if (object.ReferenceEquals(baseStatus.charaListEquip, null)) { num = MonoBehaviourSingleton <UserInfoManager> .I.userStatus.hp; num2 = MonoBehaviourSingleton <UserInfoManager> .I.userStatus.atk; num3 = MonoBehaviourSingleton <UserInfoManager> .I.userStatus.def; equipSetCalculator = MonoBehaviourSingleton <StatusManager> .I.GetEquipSetCalculator(MonoBehaviourSingleton <StatusManager> .I.GetCurrentEquipSetNo()); } else { num = baseStatus.hp; num2 = baseStatus.atk; num3 = baseStatus.def; if (MonoBehaviourSingleton <StatusManager> .I.otherEquipSetSaveIndex == -1) { MonoBehaviourSingleton <StatusManager> .I.otherEquipSetSaveIndex = 0; equipSetCalculator = MonoBehaviourSingleton <StatusManager> .I.GetOtherEquipSetCalculator(0); equipSetCalculator.SetEquipSet(baseStatus.charaListEquip, false); } else { equipSetCalculator = MonoBehaviourSingleton <StatusManager> .I.GetOtherEquipSetCalculator(MonoBehaviourSingleton <StatusManager> .I.otherEquipSetSaveIndex); } } StatusFactor statusFactor = equipSetCalculator.GetStatusFactor(selectEquipIndex); SimpleStatus finalStatus = equipSetCalculator.GetFinalStatus(selectEquipIndex, num, num2, num3); SetLabelSeparateText(UI.LBL_HP, num + statusFactor.baseStatus.hp, finalStatus.hp); SetLabelText((Enum)UI.LBL_ATK, finalStatus.GetAttacksSum().ToString()); SetLabelText((Enum)UI.LBL_DEF, finalStatus.GetDefencesSum().ToString()); int i = 0; for (int num4 = uiAtkElem.Length; i < num4; i++) { if (i == 0) { SetLabelSeparateText(uiAtkElem[i], num2 + statusFactor.baseStatus.attacks[i], finalStatus.attacks[i]); SetLabelSeparateText(uiDefElem[i], num3 + statusFactor.baseStatus.defences[i], finalStatus.defences[i]); } else { SetLabelSeparateText(uiAtkElem[i], statusFactor.baseStatus.attacks[i], finalStatus.attacks[i]); SetLabelSeparateText(uiDefElem[i], statusFactor.baseStatus.tolerances[i - 1], finalStatus.tolerances[i - 1]); } } SetToggle((Enum)uiToggleStatusIndex[selectEquipIndex], true); SetToggle((Enum)uiToggleWindowIconIndex[selectEquipIndex], true); SetToggle((Enum)uiToggleButtonIndex[selectEquipIndex], true); }
protected void OnUpdateFriendDetailUI() { int num; int num2; int num3; int num4; if (!record.isSelf) { if (record.isNPC) { num = record.charaInfo.atk; num2 = record.charaInfo.def; num3 = record.charaInfo.hp; } else { EquipSetCalculator otherEquipSetCalculator; if (MonoBehaviourSingleton <StatusManager> .I.otherEquipSetSaveIndex == -1) { MonoBehaviourSingleton <StatusManager> .I.otherEquipSetSaveIndex = 0; otherEquipSetCalculator = MonoBehaviourSingleton <StatusManager> .I.GetOtherEquipSetCalculator(0); otherEquipSetCalculator.SetEquipSet(record.charaInfo.equipSet, false); } else { otherEquipSetCalculator = MonoBehaviourSingleton <StatusManager> .I.GetOtherEquipSetCalculator(MonoBehaviourSingleton <StatusManager> .I.otherEquipSetSaveIndex); } SimpleStatus finalStatus = otherEquipSetCalculator.GetFinalStatus(0, record.charaInfo.hp, record.charaInfo.atk, record.charaInfo.def); num = finalStatus.GetAttacksSum(); num2 = finalStatus.GetDefencesSum(); num3 = finalStatus.hp; } num4 = record.charaInfo.level; SetActive(transRoot, UI.OBJ_LEVEL_ROOT, !record.isNPC); } else { EquipSetCalculator equipSetCalculator = MonoBehaviourSingleton <StatusManager> .I.GetEquipSetCalculator(selfCharaEquipSetNo); SimpleStatus finalStatus2 = equipSetCalculator.GetFinalStatus(0, MonoBehaviourSingleton <UserInfoManager> .I.userStatus); num = finalStatus2.GetAttacksSum(); num2 = finalStatus2.GetDefencesSum(); num3 = finalStatus2.hp; num4 = MonoBehaviourSingleton <UserInfoManager> .I.userStatus.level; } SetLabelText(transRoot, UI.LBL_ATK, num.ToString()); SetLabelText(transRoot, UI.LBL_DEF, num2.ToString()); SetLabelText(transRoot, UI.LBL_HP, num3.ToString()); SetLabelText(transRoot, UI.LBL_LEVEL, num4.ToString()); SetupInfo(); UpdateEquipIcon(null); SetActive(transRoot, UI.BTN_MAGI, showMagiButton); CreateDegree(); }
protected void SetCharaInfo(FriendCharaInfo data, int i, Transform t, bool is_recycle, bool isGM) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) object[] event_data = new object[2] { data.userId, t }; SetEvent(t, "SELECT_FRIEND", event_data); if (isGM) { SetRenderNPCModel(t, UI.TEX_MODEL, 0, new Vector3(0f, -1.49f, 1.87f), new Vector3(0f, 154f, 0f), 10f, null); } else { SetRenderPlayerModel(t, UI.TEX_MODEL, PlayerLoadInfo.FromCharaInfo(data, false, true, false, true), 99, new Vector3(0f, -1.536f, 1.87f), new Vector3(0f, 154f, 0f), true, null); } SetLabelText(t, UI.LBL_NAME, data.name); SetLabelText(t, UI.LBL_LEVEL, data.level.ToString()); SetLabelText(t, UI.LBL_COMMENT, data.comment); SetLabelText(t, UI.LBL_LAST_LOGIN, base.sectionData.GetText("LAST_LOGIN")); SetLabelText(t, UI.LBL_LAST_LOGIN_TIME, data.lastLogin); EquipSetCalculator otherEquipSetCalculator = MonoBehaviourSingleton <StatusManager> .I.GetOtherEquipSetCalculator(i + 4); otherEquipSetCalculator.SetEquipSet(data.equipSet, false); SimpleStatus finalStatus = otherEquipSetCalculator.GetFinalStatus(0, data.hp, data.atk, data.def); SetLabelText(t, UI.LBL_ATK, finalStatus.GetAttacksSum().ToString()); SetLabelText(t, UI.LBL_DEF, finalStatus.defences[0].ToString()); SetLabelText(t, UI.LBL_HP, finalStatus.hp.ToString()); if ((int)data.level < 15) { SetActive(t, UI.OBJ_DISABLE_USER_MASK, true); SetActive(t, UI.SPR_SELECTED, false); SetActive(t, UI.STR_LIMIT_LVL, true); SetEvent(t, "_", null); } else if (mInviteFriendIDs.Contains(data.userId)) { SetActive(t, UI.OBJ_DISABLE_USER_MASK, true); SetActive(t, UI.SPR_SELECTED, true); SetActive(t, UI.STR_LIMIT_LVL, false); } else { SetActive(t, UI.OBJ_DISABLE_USER_MASK, false); SetActive(t, UI.SPR_SELECTED, false); SetActive(t, UI.STR_LIMIT_LVL, false); } }
protected void UpdateRoomUserInfo(Transform trans, int index) { SetActive(trans, UI.SPR_USER_EMPTY, false); SetActive(trans, UI.SPR_USER_BATTLE, false); SetActive(trans, UI.SPR_USER_READY, false); SetActive(trans, UI.SPR_USER_READY_WAIT, false); SetActive(trans, UI.OBJ_CHAT, false); QuestRoomUserInfo component = trans.GetComponent <QuestRoomUserInfo>(); if (!(component == null)) { userInfo = MonoBehaviourSingleton <StatusManager> .I.GetCreatePlayerInfo().charaInfo; if (userInfo == null) { component.LoadModel(index, null); } else { equipSetNo = MonoBehaviourSingleton <UserInfoManager> .I.userStatus.eSetNo; SetActive(trans, UI.SPR_WEAPON_1, false); SetActive(trans, UI.SPR_WEAPON_2, false); SetActive(trans, UI.SPR_WEAPON_3, false); int weapon_index = 0; userInfo.equipSet.ForEach(delegate(CharaInfo.EquipItem data) { if (data != null) { EquipItemTable.EquipItemData equipItemData = Singleton <EquipItemTable> .I.GetEquipItemData((uint)data.eId); if (equipItemData != null && equipItemData.IsWeapon()) { SetActive(trans, weaponIcon[weapon_index], true); int equipmentTypeIndex = UIBehaviour.GetEquipmentTypeIndex(equipItemData.type); SetSprite(trans, weaponIcon[weapon_index], ITEM_TYPE_ICON_SPRITE_NAME[equipmentTypeIndex]); weapon_index++; } } }); component.LoadModel(index, userInfo); EquipSetCalculator equipSetCalculator = MonoBehaviourSingleton <StatusManager> .I.GetEquipSetCalculator(equipSetNo); SimpleStatus finalStatus = equipSetCalculator.GetFinalStatus(0, userInfo.hp, userInfo.atk, userInfo.def); SetLabelText(trans, UI.LBL_ATK, finalStatus.GetAttacksSum().ToString()); SetLabelText(trans, UI.LBL_DEF, finalStatus.GetDefencesSum().ToString()); SetLabelText(trans, UI.LBL_HP, finalStatus.hp.ToString()); SetLabelText(trans, UI.LBL_NAME, userInfo.name); SetLabelText(trans, UI.LBL_LV, userInfo.level.ToString()); } } }
public void DrawEquipSetModel() { EquipSetCalculator equipSetCalculator = MonoBehaviourSingleton <StatusManager> .I.GetEquipSetCalculator(equipSetNo); SimpleStatus finalStatus = equipSetCalculator.GetFinalStatus(0, MonoBehaviourSingleton <UserInfoManager> .I.userStatus); SetLabelText((Enum)UI.LBL_ATK, finalStatus.GetAttacksSum().ToString()); SetLabelText((Enum)UI.LBL_DEF, finalStatus.GetDefencesSum().ToString()); SetLabelText((Enum)UI.LBL_HP, finalStatus.hp.ToString()); SetLabelText((Enum)UI.LBL_NOW, (equipSetNo + 1).ToString()); SetLabelText((Enum)UI.LBL_MAX, SET_NO_MAX.ToString()); SetLabelText((Enum)UI.LBL_SET_NAME, localEquipSet[equipSetNo].name); UpdateModel(); }
protected void SetCharaInfo(FriendCharaInfo data, int i, Transform t, bool is_recycle, bool isGM) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) SetEvent(t, "FOLLOW_INFO", i); if (isGM) { SetRenderNPCModel(t, UI.TEX_MODEL, 0, new Vector3(0f, -1.49f, 1.87f), new Vector3(0f, 154f, 0f), 10f, null); } else { ForceSetRenderPlayerModel(t, UI.TEX_MODEL, PlayerLoadInfo.FromCharaInfo(data, false, true, false, true), 99, new Vector3(0f, -1.536f, 1.87f), new Vector3(0f, 154f, 0f), true, null); } CharaInfo.ClanInfo clanInfo = data.clanInfo; if (clanInfo == null) { clanInfo = new CharaInfo.ClanInfo(); clanInfo.clanId = -1; clanInfo.tag = string.Empty; } bool isSameTeam = clanInfo.clanId > -1 && MonoBehaviourSingleton <GuildManager> .I.guildData != null && clanInfo.clanId == MonoBehaviourSingleton <GuildManager> .I.guildData.clanId; SetSupportEncoding(t, UI.LBL_NAME, true); SetLabelText(t, UI.LBL_NAME, Utility.GetNameWithColoredClanTag(clanInfo.tag, data.name, data.userId == MonoBehaviourSingleton <UserInfoManager> .I.userInfo.id, isSameTeam)); SetLabelText(t, UI.LBL_LEVEL, data.level.ToString()); SetLabelText(t, UI.LBL_COMMENT, data.comment); SetLabelText(t, UI.LBL_LAST_LOGIN, base.sectionData.GetText("LAST_LOGIN")); SetLabelText(t, UI.LBL_LAST_LOGIN_TIME, data.lastLogin); EquipSetCalculator otherEquipSetCalculator = MonoBehaviourSingleton <StatusManager> .I.GetOtherEquipSetCalculator(i + 4); otherEquipSetCalculator.SetEquipSet(data.equipSet, false); SimpleStatus finalStatus = otherEquipSetCalculator.GetFinalStatus(0, data.hp, data.atk, data.def); SetLabelText(t, UI.LBL_ATK, finalStatus.GetAttacksSum().ToString()); SetLabelText(t, UI.LBL_DEF, finalStatus.GetDefencesSum().ToString()); SetLabelText(t, UI.LBL_HP, finalStatus.hp.ToString()); DegreePlate component = FindCtrl(t, UI.OBJ_DEGREE_FRAME_ROOT).GetComponent <DegreePlate>(); component.Initialize(data.selectedDegrees, false, delegate { GetCtrl(UI.GRD_LIST).GetComponent <UIGrid>().Reposition(); }); }
public ActionResult <SimpleStatus> Get() { var lastJob = WorkerManager.lastJob.ToString("yyyy-MM-ddTHH:mm:ssK"); var conn = ConnectionManager.GetCurrConn(); if (conn == null) { return(StatusCode(404, "No Straturm Connection active.")); } var lastSHare = conn.lastShare; var totalShares = conn.totalShares; var accepted = conn.sharesAccepted; var rejected = conn.sharesRejected; var tooLate = conn.sharesTooLate; ///TODO do WorkerManagera dat SolutionsFound (kolik dohromady ze vsech karet) a /// SolutionsSubmitted (to bude az co projde pres diff) SimpleStatus status = new SimpleStatus(); status.LastShare = lastSHare.ToString("yyyy-MM-ddTHH:mm:ssK"); status.LastJob = lastJob; List <SimpleWorkerInfo> workers = new List <SimpleWorkerInfo>(); foreach (var worker in WorkerManager.GetWorkersInfo()) { SimpleWorkerInfo wi = new SimpleWorkerInfo(); wi.GPUName = worker.GPUName; wi.Platform = worker.GPUOption.PlatformID.ToString(); wi.Status = worker.GPUStatus; wi.GraphsPerSecond = worker.GraphsPerSecond; wi.ID = worker.ID; wi.TotalSols = worker.TotalSols; wi.LastSolution = worker.lastSolution.ToString("yyyy-MM-ddTHH:mm:ssK"); wi.Fidelity = (float)worker.Fidelity; workers.Add(wi); } status.Workers = workers; if (ConnectionManager.IsInFee()) { status.ConnectionAddress = $"FEE (GrinPro collects 1% as fee for the Grin Development Fund and 1% for further miner development.)"; status.ConnectionStatus = conn.IsConnected == true ? "Connected" : "Disconnectd"; } else { status.ConnectionAddress = $"{conn.ip}:{conn.port}"; status.ConnectionStatus = conn.IsConnected == true ? "Connected" : "Disconnectd"; } ShareStats ss = new ShareStats(); ss.Accepted = accepted; ss.FailedToValidate = rejected; ss.Found = (uint)workers.Sum(w => w.TotalSols); ss.Submitted = totalShares; ss.TooLate = tooLate; status.Shares = ss; return(status); }