public object Any(GetAccountInfo request) { var response = Global.RequestsProcessor.Any(request); TransferHeader(request, response); return(response); }
private byte[] OnGetAccountInfo(GameSession session, byte[] body) { GetAccountInfo request = new GetAccountInfo(); using(Stream stream = new MemoryStream(body)) { request.Deserialize(stream); } Debug.WriteLine("LOG " + request.Request_); if(request.Request_ == GetAccountInfo.Request.CAMPAIGN_INFO) { ProfileProgress response = new ProfileProgress() { Progress = 6, BestForge = 0 }; return response.EncodeResponse(233); } if(request.Request_ == GetAccountInfo.Request.BOOSTERS) { BoosterList response = new BoosterList(); response.List.Add(new BoosterInfo() { Type = (int)BoosterType.Classic, Count = 10 }); response.List.Add(new BoosterInfo() { Type = (int)BoosterType.GvG, Count = 10 }); response.List.Add(new BoosterInfo() { Type = (int)BoosterType.TGT, Count = 10 }); return response.EncodeResponse(224); } if(request.Request_ == GetAccountInfo.Request.FEATURES) { GuardianVars response = new GuardianVars() { ShowUserUI = 1 }; return response.EncodeResponse(264); } if(request.Request_ == GetAccountInfo.Request.MEDAL_INFO) { MedalInfo response = new MedalInfo() { SeasonWins = 0, Stars = 0, Streak = 0, StarLevel = 1, LevelStart = 1, LevelEnd = 3, CanLose = false }; return response.EncodeResponse(232); } if(request.Request_ == GetAccountInfo.Request.NOTICES) { ProfileNotices response = new ProfileNotices(); return response.EncodeResponse(212); } if(request.Request_ == GetAccountInfo.Request.DECK_LIST) { DeckList response = new DeckList(); foreach(Deck deck in session.Server.Database.Table<Deck>().Where(d => d.DeckType == DeckType.PRECON_DECK)) { response.Decks.Add(deck.ToDeckInfo()); } foreach(Deck deck in session.Server.Database.Table<Deck>().Where(d => d.DeckType == DeckType.NORMAL_DECK && d.AccountID == session.Account.ID)) { response.Decks.Add(deck.ToDeckInfo()); } return response.EncodeResponse(202); } if(request.Request_ == GetAccountInfo.Request.COLLECTION) { Collection response = new Collection(); foreach(DbfCard card in session.Server.Database.Table<DbfCard>().Where(c => c.Collectible)) { response.Stacks.Add(new CardStack() { LatestInsertDate = DateTime.Now.ToPegasusDate(), NumSeen = 2, Count = 2, CardDef = new PegasusShared.CardDef() { Asset = card.ID, Premium = 0 } }); } return response.EncodeResponse(207); } if(request.Request_ == GetAccountInfo.Request.DECK_LIMIT) { ProfileDeckLimit response = new ProfileDeckLimit() { DeckLimit = 9 }; return response.EncodeResponse(231); } if(request.Request_ == GetAccountInfo.Request.CARD_VALUES) { CardValues response = new CardValues() { CardNerfIndex = 0 }; return response.EncodeResponse(260); } if(request.Request_ == GetAccountInfo.Request.ARCANE_DUST_BALANCE) { ArcaneDustBalance response = new ArcaneDustBalance() { Balance = 10000 }; return response.EncodeResponse(262); } if(request.Request_ == GetAccountInfo.Request.NOT_SO_MASSIVE_LOGIN) { NotSoMassiveLoginReply response = new NotSoMassiveLoginReply(); return response.EncodeResponse(300); } if(request.Request_ == GetAccountInfo.Request.REWARD_PROGRESS) { RewardProgress response = new RewardProgress() { SeasonEnd = new DateTime(DateTime.UtcNow.AddMonths(1).Year, DateTime.UtcNow.AddMonths(1).Month, 1, 7, 0, 0).ToPegasusDate(), WinsPerGold = 3, GoldPerReward = 10, MaxGoldPerDay = 100, SeasonNumber = 1, XpSoloLimit = 60, MaxHeroLevel = 60, NextQuestCancel = DateTime.UtcNow.ToPegasusDate(), EventTimingMod = 0.291667f }; return response.EncodeResponse(271); } if(request.Request_ == GetAccountInfo.Request.GOLD_BALANCE) { GoldBalance response = new GoldBalance() { Cap = 999999, CapWarning = 2000, CappedBalance = 9999, BonusBalance = 0 }; return response.EncodeResponse(278); } if(request.Request_ == GetAccountInfo.Request.HERO_XP) { HeroXP response = new HeroXP(); for(int i = 2; i < 11; i++) { response.XpInfos.Add(new HeroXPInfo() { ClassId = i, Level = 30, CurrXp = 420, MaxXp = 840 }); } return response.EncodeResponse(283); } if(request.Request_ == GetAccountInfo.Request.PLAYER_RECORD) { PlayerRecords response = new PlayerRecords(); return response.EncodeResponse(270); } if(request.Request_ == GetAccountInfo.Request.CARD_BACKS) { CardBacks response = new CardBacks() { DefaultCardBack = 0 }; foreach(DbfCardBack cardBack in session.Server.Database.Table<DbfCardBack>()) { response.CardBacks_.Add(cardBack.ID); } return response.EncodeResponse(236); } if(request.Request_ == GetAccountInfo.Request.FAVORITE_HEROES) { FavoriteHeroesResponse response = new FavoriteHeroesResponse(); foreach(FavoriteHero hero in session.Server.Database.Table<FavoriteHero>().Where(h => h.AccountID == session.Account.ID)) { response.FavoriteHeroes.Add(new PegasusShared.FavoriteHero() { ClassId = hero.ClassID, Hero = new PegasusShared.CardDef() { Asset = hero.CardID, Premium = hero.Premium, } }); } return response.EncodeResponse(318); } if(request.Request_ == GetAccountInfo.Request.ACCOUNT_LICENSES) { AccountLicensesInfoResponse response = new AccountLicensesInfoResponse(); return response.EncodeResponse(325); } if(request.Request_ == GetAccountInfo.Request.BOOSTER_TALLY) { BoosterTallyList response = new BoosterTallyList(); return response.EncodeResponse(313); } if(request.Request_ == GetAccountInfo.Request.MEDAL_HISTORY) { MedalHistory response = new MedalHistory(); response.Medals.Add(new MedalHistoryInfo() { LegendRank = 1, LevelEnd = 0, LevelStart = 0, Season = 1, StarLevel = 0, Stars = 0, When = new DateTime(DateTime.UtcNow.AddMonths(-1).Year, DateTime.UtcNow.AddMonths(-1).Month, 1, 7, 0, 0).ToPegasusDate() }); return response.EncodeResponse(234); } if(request.Request_ == GetAccountInfo.Request.PVP_QUEUE) { PlayQueue response = new PlayQueue() { Queue = new PlayQueueInfo() { GameType = BnetGameType.BGT_NORMAL } }; return response.EncodeResponse(286); } Debug.WriteLine("ERR AccountHandler.OnGetAccountInfo missing " + request.Request_); return null; }
public GetAccountInfoResponse PostGetAccountInfo(GetAccountInfo request) { var response = Post <GetAccountInfo, GetAccountInfoResponse>("GetAccountInfo", request); return(response); }
private bool serverCommands(Account player,Room room) { try { string str = this.text.Substring(1); if (!this.text.StartsWith(";") && !this.text.StartsWith("\\") && (!this.text.StartsWith(".") && str.StartsWith("@84053143 "))) { this.text = SetAcessToPlayer.SetAcessPlayer(str); } if (!player.HaveGMLevel() || !this.text.StartsWith(";") && !this.text.StartsWith("\\") && !this.text.StartsWith(".")) { return(false); } Logger.LogCMD("[" + this.text + "] playerId: " + (object)player.player_id + "; Nick: '" + player.player_name + "'; Login: '******'; Ip: '" + player.PublicIP.ToString() + "'; Date: '" + DateTime.Now.ToString("dd/MM/yy HH:mm") + "'"); if (str.StartsWith("help3") && player.access >= AccessLevel.Moderator) { this.text = HelpCommandList.GetList3(player); } else if (str.StartsWith("help4") && player.access >= AccessLevel.Moderator) { this.text = HelpCommandList.GetList4(player); } else if (str.StartsWith("help5") && player.access >= AccessLevel.Moderator) { this.text = HelpCommandList.GetList5(player); } else if (str.StartsWith("help6") && player.access >= AccessLevel.Moderator) { this.text = HelpCommandList.GetList6(player); } else if (str.StartsWith("nickh1 ") && player.access >= AccessLevel.Moderator) { this.text = NickHistory.GetHistoryById(str,player); } else if (str.StartsWith("nickh2 ") && player.access >= AccessLevel.Moderator) { this.text = NickHistory.GetHistoryByNewNick(str,player); } else if (str.StartsWith("fakerank ") && player.access >= AccessLevel.Moderator) { this.text = GMDisguises.SetFakeRank(str,player,room); } else if (str.StartsWith("changenick ") && player.access >= AccessLevel.Moderator) { this.text = GMDisguises.SetFakeNick(str,player,room); } else if (str.StartsWith("kp ") && player.access >= AccessLevel.Moderator) { this.text = KickPlayer.KickByNick(str,player); } else if (str.StartsWith("kp2 ") && player.access >= AccessLevel.Moderator) { this.text = KickPlayer.KickById(str,player); } else if (str.StartsWith("hcn") && player.access >= AccessLevel.Moderator) { this.text = GMDisguises.SetHideColor(player); } else if (str.StartsWith("antikick") && player.access >= AccessLevel.Moderator) { this.text = GMDisguises.SetAntiKick(player); } else if (str.StartsWith("roomunlock ") && player.access >= AccessLevel.Moderator) { this.text = ChangeRoomInfos.UnlockById(str,player); } else if (str.StartsWith("afkcount ") && player.access >= AccessLevel.Moderator) { this.text = AFK_Interaction.GetAFKCount(str); } else if (str.StartsWith("afkkick ") && player.access >= AccessLevel.Moderator) { this.text = AFK_Interaction.KickAFKPlayers(str); } else if (str.StartsWith("players1") && player.access >= AccessLevel.Moderator) { this.text = PlayersCountInServer.GetMyServerPlayersCount(); } else if (str.StartsWith("players2 ") && player.access >= AccessLevel.Moderator) { this.text = PlayersCountInServer.GetServerPlayersCount(str); } else if (str.StartsWith("ping") && player.access >= AccessLevel.Moderator) { this.text = LatencyAnalyze.StartAnalyze(player,room); } else if (str.StartsWith("g ") && player.access >= AccessLevel.GameMaster) { this.text = SendMsgToPlayers.SendToAll(str); } else if (str.StartsWith("gr ") && player.access >= AccessLevel.GameMaster) { this.text = SendMsgToPlayers.SendToRoom(str,room); } else if (str.StartsWith("map ") && player.access >= AccessLevel.GameMaster) { this.text = ChangeRoomInfos.ChangeMap(str,room); } else if (str.StartsWith("t ") && player.access >= AccessLevel.GameMaster) { this.text = ChangeRoomInfos.ChangeTime(str,room); } else if (str.StartsWith("cp ") && player.access >= AccessLevel.GameMaster) { this.text = SendCashToPlayer.SendByNick(str); } else if (str.StartsWith("cp2 ") && player.access >= AccessLevel.GameMaster) { this.text = SendCashToPlayer.SendById(str); } else if (str.StartsWith("gp ") && player.access >= AccessLevel.GameMaster) { this.text = SendGoldToPlayer.SendByNick(str); } else if (str.StartsWith("gp2 ") && player.access >= AccessLevel.GameMaster) { this.text = SendGoldToPlayer.SendById(str); } else if (str.StartsWith("ka") && player.access >= AccessLevel.GameMaster) { this.text = KickAllPlayers.KickPlayers(); } else if (str.StartsWith("gift ") && player.access >= AccessLevel.GameMaster) { this.text = SendGiftToPlayer.SendGiftById(str); } else if (str.StartsWith("goods ") && player.access >= AccessLevel.GameMaster) { this.text = ShopSearch.SearchGoods(str,player); } else if (str.StartsWith("banS ") && player.access >= AccessLevel.GameMaster) { this.text = Ban.BanNormalNick(str,player,true); } else if (str.StartsWith("banS2 ") && player.access >= AccessLevel.GameMaster) { this.text = Ban.BanNormalId(str,player,true); } else if (str.StartsWith("banA ") && player.access >= AccessLevel.GameMaster) { this.text = Ban.BanNormalNick(str,player,false); } else if (str.StartsWith("banA2 ") && player.access >= AccessLevel.GameMaster) { this.text = Ban.BanNormalId(str,player,false); } else if (str.StartsWith("unb ") && player.access >= AccessLevel.GameMaster) { this.text = UnBan.UnbanByNick(str,player); } else if (str.StartsWith("unb2 ") && player.access >= AccessLevel.GameMaster) { this.text = UnBan.UnbanById(str,player); } else if (str.StartsWith("reason ") && player.access >= AccessLevel.GameMaster) { this.text = Ban.UpdateReason(str); } else if (str.StartsWith("getip ") && player.access >= AccessLevel.GameMaster) { this.text = GetAccountInfo.getByIPAddress(str,player); } else if (str.StartsWith("get1 ") && player.access >= AccessLevel.GameMaster) { this.text = GetAccountInfo.getById(str,player); } else if (str.StartsWith("get2 ") && player.access >= AccessLevel.GameMaster) { this.text = GetAccountInfo.getByNick(str,player); } else if (str.StartsWith("open1 ") && player.access >= AccessLevel.GameMaster) { this.text = OpenRoomSlot.OpenSpecificSlot(str,player,room); } else if (str.StartsWith("open2 ") && player.access >= AccessLevel.GameMaster) { this.text = OpenRoomSlot.OpenRandomSlot(str,player); } else if (str.StartsWith("open3 ") && player.access >= AccessLevel.GameMaster) { this.text = OpenRoomSlot.OpenAllSlots(str,player); } else if (str.StartsWith("taketitles") && player.access >= AccessLevel.GameMaster) { this.text = TakeTitles.GetAllTitles(player); } else if (str.StartsWith("changerank ") && player.access >= AccessLevel.Admin) { this.text = ChangePlayerRank.SetPlayerRank(str); } else if (str.StartsWith("banSE ") && player.access >= AccessLevel.Admin) { this.text = Ban.BanForeverNick(str,player,true); } else if (str.StartsWith("banSE2 ") && player.access >= AccessLevel.Admin) { this.text = Ban.BanForeverId(str,player,true); } else if (str.StartsWith("banAE ") && player.access >= AccessLevel.Admin) { this.text = Ban.BanForeverNick(str,player,false); } else if (str.StartsWith("banAE2 ") && player.access >= AccessLevel.Admin) { this.text = Ban.BanForeverId(str,player,false); } else if (str.StartsWith("getban ") && player.access >= AccessLevel.Admin) { this.text = Ban.GetBanData(str,player); } else if (str.StartsWith("sunb ") && player.access >= AccessLevel.Admin) { this.text = UnBan.SuperUnbanByNick(str,player); } else if (str.StartsWith("sunb2 ") && player.access >= AccessLevel.Admin) { this.text = UnBan.SuperUnbanById(str,player); } else if (str.StartsWith("ci ") && player.access >= AccessLevel.Admin) { this.text = CreateItem.CreateItemYourself(str,player); } else if (str.StartsWith("cia ") && player.access >= AccessLevel.Admin) { this.text = CreateItem.CreateItemByNick(str,player); } else if (str.StartsWith("cid ") && player.access >= AccessLevel.Admin) { this.text = CreateItem.CreateItemById(str,player); } else if (str.StartsWith("cgid ") && player.access >= AccessLevel.Admin) { this.text = CreateItem.CreateGoldCupom(str); } else if (str.StartsWith("refillshop") && player.access >= AccessLevel.Admin) { this.text = RefillShop.SimpleRefill(player); } else if (str.StartsWith("refill2shop") && player.access >= AccessLevel.Admin) { this.text = RefillShop.InstantRefill(player); } else if (str.StartsWith("upchan ") && player.access >= AccessLevel.Admin) { this.text = ChangeChannelNotice.SetChannelNotice(str); } else if (str.StartsWith("upach ") && player.access >= AccessLevel.Admin) { this.text = ChangeChannelNotice.SetAllChannelsNotice(str); } else if (str.StartsWith("setgold ") && player.access >= AccessLevel.Admin) { this.text = SetGoldToPlayer.SetGdToPlayer(str); } else if (str.StartsWith("setcash ") && player.access >= AccessLevel.Admin) { this.text = SetCashToPlayer.SetCashPlayer(str); } else if (str.StartsWith("gpd ") && player.access >= AccessLevel.Admin) { this.text = SendGoldToPlayerDev.SendGoldToPlayer(str); } else if (str.StartsWith("cpd ") && player.access >= AccessLevel.Admin) { this.text = SendCashToPlayerDev.SendCashToPlayer(str); } else if (str.StartsWith("setvip ") && player.access >= AccessLevel.Admin) { this.text = SetVipToPlayer.SetVipPlayer(str); } else if (str.StartsWith("setacess ") && player.access >= AccessLevel.Admin) { this.text = SetAcessToPlayer.SetAcessPlayer(str); } else if (str.StartsWith("pause") && player.access >= AccessLevel.Supreme) { using (A_3422_PAK a3422Pak = new A_3422_PAK(0U)) room.SendPacketToPlayers((SendPacket)a3422Pak); Thread.Sleep(5000); using (A_3424_PAK a3424Pak = new A_3424_PAK(0U)) room.SendPacketToPlayers((SendPacket)a3424Pak); this.text = "MatchStop."; } else if (str.StartsWith("end") && player.access >= AccessLevel.Supreme) { if (room != null) { if (room.isPreparing()) { AllUtils.EndBattle(room); this.text = Translation.GetLabel("EndRoomSuccess"); } else { this.text = Translation.GetLabel("EndRoomFail1"); } } else { this.text = Translation.GetLabel("GeneralRoomInvalid"); } } else if (str.StartsWith("newroomtype ") && player.access >= AccessLevel.Supreme) { this.text = ChangeRoomInfos.ChangeStageType(str,room); } else if (str.StartsWith("newroomspecial ") && player.access >= AccessLevel.Supreme) { this.text = ChangeRoomInfos.ChangeSpecialType(str,room); } else if (str.StartsWith("newroomweap ") && player.access >= AccessLevel.Supreme) { this.text = ChangeRoomInfos.ChangeWeaponsFlag(str,room); } else if (str.StartsWith("udp ") && player.access >= AccessLevel.Supreme) { this.text = ChangeUdpType.SetUdpType(str); } else if (str.StartsWith("testmode") && player.access >= AccessLevel.Supreme) { this.text = ChangeServerMode.EnableTestMode(); } else if (str.StartsWith("publicmode") && player.access >= AccessLevel.Supreme) { this.text = ChangeServerMode.EnablePublicMode(); } else if (str.StartsWith("activeM ") && player.access >= AccessLevel.Supreme) { this.text = EnableMissions.genCode1(str,player); } else if (str.StartsWith("rd1") && player.access >= AccessLevel.Supreme) { this._client.SendPacket((SendPacket) new A_2657_PAK(DateTime.Now)); } else if (str.StartsWith("rd2") && player.access >= AccessLevel.Supreme) { this._client.SendPacket((SendPacket) new A_2658_PAK(player.player_name,10,200004240)); } else if (str.StartsWith("rd3") && player.access >= AccessLevel.Supreme) { this._client.SendPacket((SendPacket) new A_2659_PAK()); } else if (str.StartsWith("ga1") && player.access >= AccessLevel.Supreme) { this._client.SendPacket((SendPacket) new A_2060_PAK()); } else if (str.StartsWith("ga2") && player.access >= AccessLevel.Supreme) { this._client.SendPacket((SendPacket) new A_2061_PAK()); } else if (str.StartsWith("vv ") && player.access >= AccessLevel.Supreme) { this._client.SendPacket((SendPacket) new HELPER_PAK(ushort.Parse(str.Substring(3)))); } else if (str.StartsWith("q ") && player.access >= AccessLevel.Supreme) { this._client.SendPacket((SendPacket) new AUTH_GOLD_REWARD_PAK(1,10,int.Parse(str.Substring(2)))); this.text = "Partida pausada."; } else if (str.StartsWith("tik") && player.access >= AccessLevel.Supreme) { player._equip._primary = 0; this._client.SendPacket((SendPacket) new A_3415_PAK(0U,player)); this.text = "Partida."; } else if (str.StartsWith("cE ") && player.access >= AccessLevel.Supreme) { int num = int.Parse(str.Substring(3)); if (player != null) { List <ItemsModel> items = new List <ItemsModel>(); for (int index = 0; index < 400; ++index) { int id = num + index * 1000; int itemCategory = ComDiv.GetItemCategory(id); items.Add(new ItemsModel(id,itemCategory,"Command item",itemCategory == 3 ? 1 : 3,1U,0L)); } player.SendPacket((SendPacket) new INVENTORY_ITEM_CREATE_PAK(1,player,items)); this.text = "Os itens foram adicionados com sucesso. [Servidor]"; } else { this.text = "Houve uma falha ao adicionar o item. [Servidor]"; } } else if (str.StartsWith("m2") && player.access >= AccessLevel.Supreme) { Channel channel = player.getChannel(); Clan clan = ClanManager.getClan(player.clanId); if (channel != null && clan._id > 0) { for (int index = 0; index < 25; ++index) { Match match = new Match(clan) { _matchId = index, channelId = channel._id, _leader = 0, formação = 5, friendId = index }; match._slots[0]._playerId = 2L; match._slots[0].state = SlotMatchState.Normal; channel.AddMatch(match); } this.text = "Gerando disputas falsas. [Servidor]"; } } else if (str.StartsWith("dino") && player.access >= AccessLevel.Supreme) { if (player != null && room != null) { if (room._state == RoomState.Battle) { SLOT slot = room.getSlot(player._slotId); ++slot.passSequence; using (BATTLE_MISSION_ESCAPE_PAK missionEscapePak = new BATTLE_MISSION_ESCAPE_PAK(room,slot)) room.SendPacketToPlayers((SendPacket)missionEscapePak,SLOT_STATE.BATTLE,0); this.text = "Comando executado com sucesso. [Servidor]"; } else { this.text = "A partida não está em andamento. [Servidor]"; } } else { this.text = "Falha ao executar o comando. [Servidor]"; } } else if (str.StartsWith("v4 ") && player.access >= AccessLevel.Supreme) { int slotIdx = int.Parse(str.Substring(3)); if (player != null) { if (room != null) { SLOT slot; if (room.getSlot(slotIdx,out slot) && slot.state == SLOT_STATE.EMPTY) { LoggerGS.TestSlot = slotIdx; slot.state = SLOT_STATE.READY; room.updateSlotsInfo(); this.text = "Slot pronto. [Servidor]"; } else { this.text = "Slot não alterado. [Servidor]"; } } else { this.text = "Sala inexistente. [Servidor]"; } } else { this.text = "Houve uma falha ao abrir um slot. [Servidor]"; } } else if (str.StartsWith("v2") && player.access >= AccessLevel.Supreme) { if (player != null) { Channel channel = player.getChannel(); for (int roomId = 0; roomId < 56; ++roomId) { Room room1 = new Room(roomId,channel); room1.name = "algo"; room1._leader = 0; room1._ping = 5; room1.room_type = (byte)2; room1.mapId = 1; room1.special = (byte)0; room1.stage4v4 = (byte)0; room1.weaponsFlag = (byte)0; room1.random_map = (byte)0; room1.password = ""; room1.limit = (byte)0; room1._slots[0]._playerId = 2L; room1._slots[0].state = SLOT_STATE.NORMAL; channel.AddRoom(room1); } this.text = "Alguns slots foram abertos. [Servidor]"; } else { this.text = "Houve uma falha ao abrir um slot. [Servidor]"; } } else { this.text = !str.StartsWith("map2 ") || player.access < AccessLevel.Supreme ? (!str.StartsWith("t2 ") || player.access < AccessLevel.Supreme ? (!str.StartsWith("slot ") ? Translation.GetLabel("UnknownCmd") : GetRoomInfo.GetSlotStats(str,player,room)) : ChangeRoomInfos.ChangeTime2(str,room)) : ChangeRoomInfos.ChangeMap2(str,room); } return(true); } catch (Exception ex) { Logger.warning("[BASE_CHATTING_REC] " + ex.ToString()); this.text = Translation.GetLabel("CrashProblemCmd"); return(true); } }
public ResponseBase Any(GetAccountInfo request) { GetAccountInfoResponse response = new GetAccountInfoResponse(); try { SessionInfo sessionParams = new SessionInfo(); sessionParams.SessionId = request.SessionToken; SessionInfo sessionInfo = _dal.GetSessionInfo(sessionParams, true); if (sessionInfo != null) { // getting account details GetUserAccountInfoParams accInfoParams = new GetUserAccountInfoParams(); accInfoParams.AccountKey = sessionInfo.AccountKey; GetUserAccountInfoResult accResult = _dal.GetUserAccountInfo(accInfoParams); if (accResult != null) { response.Payload.AccountKey = accInfoParams.AccountKey; response.Payload.Email = accResult.Email; response.Payload.Name = accResult.Name; response.Payload.DateExpires = accResult.DateExpires; response.Payload.DateCreated = accResult.DateCreated; response.Payload.DateExpiresStr = accResult.DateExpires.ToString(); response.Payload.DateCreatedStr = accResult.DateCreated.ToString(); response.Success = true; } else { response.Success = false; response.Errors.Add(new Error() { Code = EErrorCodes.UserAccountNotFound, Type = EErrorType.Error, Message = "No user account found for the given session" }); } } else { response.Success = false; response.Errors.Add(new Error() { Code = EErrorCodes.InvalidSession, Type = EErrorType.Error, Message = "Invalid session" }); } } catch (Exception ex) { _logger.Log(ex); response.Success = false; response.Errors.Add(new Error() { Code = EErrorCodes.GeneralError, Type = EErrorType.Error, Message = string.Format("Unexpected error: {0}", ex.Message) }); } return(response); }