public RenderSubscriber(
     NineChroniclesNodeService nodeService,
     MySqlStore mySqlStore
     )
 {
     _blockRenderer      = nodeService.BlockRenderer;
     _actionRenderer     = nodeService.ActionRenderer;
     _exceptionRenderer  = nodeService.ExceptionRenderer;
     _nodeStatusRenderer = nodeService.NodeStatusRenderer;
     MySqlStore          = mySqlStore;
 }
Esempio n. 2
0
 public NineChroniclesSummaryQuery(MySqlStore store)
 {
     Store = store;
     Field <StringGraphType>(
         name: "test",
         resolve: context => "Should be done.");
     Field <ListGraphType <HackAndSlashType> >(
         name: "HackAndSlashQuery",
         arguments: new QueryArguments(
             new QueryArgument <StringGraphType> {
         Name = "agentAddress"
     },
             new QueryArgument <IntGraphType> {
         Name = "limit"
     }
             ),
         resolve: context =>
     {
         string?agentAddress = context.GetArgument <string?>("agentAddress", null);
         int?limit           = context.GetArgument <int?>("limit", null);
         return(Store.GetHackAndSlash(agentAddress, limit));
     });
     Field <ListGraphType <StageRankingType> >(
         name: "StageRanking",
         arguments: new QueryArguments(
             new QueryArgument <StringGraphType> {
         Name = "avatarAddress"
     },
             new QueryArgument <IntGraphType> {
         Name = "limit"
     },
             new QueryArgument <BooleanGraphType> {
         Name = "mimisbrunnr"
     }
             ),
         resolve: context =>
     {
         string?avatarAddress = context.GetArgument <string?>("avatarAddress", null);
         int?limit            = context.GetArgument <int?>("limit", null);
         bool isMimisbrunnr   = context.GetArgument <bool>("mimisbrunnr", false);
         return(Store.GetStageRanking(avatarAddress, limit, isMimisbrunnr));
     });
 }
 public NineChroniclesSummaryQuery(MySqlStore store)
 {
     Store = store;
     Field <StringGraphType>(
         name: "test",
         resolve: context => "Should be done.");
     Field <ListGraphType <HackAndSlashType> >(
         name: "HackAndSlash",
         arguments: new QueryArguments(
             new QueryArgument <StringGraphType> {
         Name = "agentAddress"
     },
             new QueryArgument <IntGraphType> {
         Name = "limit"
     }
             ),
         resolve: context =>
     {
         string?address       = context.GetArgument <string?>("agentAddress", null);
         Address?agentAddress = address == null
                 ? (Address?)null
                 : new Address(address.Replace("0x", string.Empty));
         int?limit = context.GetArgument <int?>("limit", null);
         return(Store.GetHackAndSlash(agentAddress, limit));
     });
     Field <ListGraphType <StageRankingType> >(
         name: "StageRanking",
         arguments: new QueryArguments(
             new QueryArgument <StringGraphType> {
         Name = "avatarAddress"
     },
             new QueryArgument <IntGraphType> {
         Name = "limit"
     },
             new QueryArgument <BooleanGraphType> {
         Name = "mimisbrunnr"
     }
             ),
         resolve: context =>
     {
         string?address        = context.GetArgument <string?>("avatarAddress", null);
         Address?avatarAddress = address == null
                 ? (Address?)null
                 : new Address(address.Replace("0x", string.Empty));
         int?limit          = context.GetArgument <int?>("limit", null);
         bool isMimisbrunnr = context.GetArgument <bool>("mimisbrunnr", false);
         return(Store.GetStageRanking(avatarAddress, limit, isMimisbrunnr));
     });
     Field <ListGraphType <CraftRankingType> >(
         name: "CraftRanking",
         arguments: new QueryArguments(
             new QueryArgument <StringGraphType> {
         Name = "avatarAddress"
     },
             new QueryArgument <IntGraphType> {
         Name = "limit"
     }
             ),
         resolve: context =>
     {
         string?address        = context.GetArgument <string?>("avatarAddress", null);
         Address?avatarAddress = address == null
                 ? (Address?)null
                 : new Address(address.Replace("0x", string.Empty));
         int?limit = context.GetArgument <int?>("limit", null);
         return(Store.GetCraftRanking(avatarAddress, limit));
     });
     Field <ListGraphType <EquipmentRankingType> >(
         name: "EquipmentRanking",
         arguments: new QueryArguments(
             new QueryArgument <StringGraphType> {
         Name = "avatarAddress"
     },
             new QueryArgument <StringGraphType> {
         Name = "itemSubType"
     },
             new QueryArgument <IntGraphType> {
         Name = "limit"
     }
             ),
         resolve: context =>
     {
         string?address        = context.GetArgument <string?>("avatarAddress", null);
         Address?avatarAddress = address == null
                 ? (Address?)null
                 : new Address(address.Replace("0x", string.Empty));
         string?itemSubType = context.GetArgument <string?>("itemSubType", null);
         int?limit          = context.GetArgument <int?>("limit", null);
         return(Store.GetEquipmentRanking(avatarAddress, itemSubType, limit));
     });
 }