public static async Task Execute(ISession session, string requestID) { var playerStats = (await session.Inventory.GetPlayerStats()).FirstOrDefault(); if (playerStats == null) { return; } var tmpData = new TrainerProfileWeb(session.Profile.PlayerData, playerStats); //webSocketSession.Send(EncodingHelper.Serialize(new TrainerProfileResponce(tmpData, requestID))); }
public static async Task Execute(ISession session, WebSocketSession webSocketSession, string requestID) { //using (var blocker = new BlockableScope(session, BotActions.GetProfile)) { // if (!await blocker.WaitToRun()) return; var playerStats = (await session.Inventory.GetPlayerStats()).FirstOrDefault(); if (playerStats == null) { return; } var tmpData = new TrainerProfileWeb(session.Profile.PlayerData, playerStats); webSocketSession.Send(EncodingHelper.Serialize(new TrainerProfileResponce(tmpData, requestID))); } }