public List <GameServerOnePageResponseProto.GameServerOnePageItem> GetGameServerOnePageList(int page) { List <GameServerOnePageResponseProto.GameServerOnePageItem> retList = new List <GameServerOnePageResponseProto.GameServerOnePageItem>(); //List<GameServerEntity> gameServerOnePageList = new List<GameServerEntity>(); MFReturnValue <List <GameServerEntity> > retValue = GetPageList(isDesc: false, pageSize: 10, pageIndex: page, isAutoStatus: false); if (!retValue.HasError) { List <GameServerEntity> list = retValue.Value; for (int i = 0; i < list.Count; i++) { GameServerOnePageResponseProto.GameServerOnePageItem item = new GameServerOnePageResponseProto.GameServerOnePageItem(); item.ServerId = (int)list[i].Id; item.Status = (int)list[i].Status; item.RunState = list[i].RunStatus; item.IsCommand = list[i].IsCommand; item.IsNew = list[i].IsNew; item.Name = list[i].Name; item.Ip = list[i].Ip; item.Port = list[i].Port; retList.Add(item); } } return(retList); }
public void SetData(int index, GameServerOnePageResponseProto.GameServerOnePageItem item, Action <int> callBack) { if (m_ServerName == null) { Init(); } m_Index = index; m_ServerId = item.ServerId; m_ServerName.text = item.Name; m_State = item.Status; m_IsNew = item.IsNew; m_Ip = item.Ip; m_Port = item.Port; m_CallBack = callBack; m_New.SetActive(m_IsNew); //switc m_ServerState.color = ColorUtil.GetServerColor(item.Status); }