예제 #1
0
 public override async Task GetEntities(EntitiesRequest request, IServerStreamWriter <Entity> responseStream, ServerCallContext context)
 {
     foreach (var e in Game.Game.Entities)
     {
         await responseStream.WriteAsync(e.entity);
     }
 }
        public IHttpActionResult Entities(EntitiesRequest entitiesRequest)
        {
            if (this.Request.Method == HttpMethod.Options)
            {
                return(new OptionsOkResult());
            }

            Entities result = this.textAnalize.Entities(entitiesRequest.Url, entitiesRequest.Text);

            return(Ok(result));
        }
예제 #3
0
        public static void SetGameState()
        {
            var input   = new EntitiesRequest();
            var channel = GrpcChannel.ForAddress($"http://{_IP}:5000");
            var client  = new GlowkiServiceClient(channel);

            client.SetState(new State()
            {
                State_ = 1
            });
        }
예제 #4
0
        static async Task Main(string[] args)
        {
            var input   = new EntitiesRequest();
            var channel = GrpcChannel.ForAddress("https://localhost:5001");
            var client  = new GlowkiService.GlowkiServiceClient(channel);

            var t = client.GetEntities(input);

            await foreach (var e in t.ResponseStream.ReadAllAsync())
            {
                Console.WriteLine($"Kind:{e.Kind}  Params:{e.Params}");
            }
        }
예제 #5
0
        static async Task <IEnumerable <GlowkiServer.Entity> > AsyncLoadEntities()
        {
            var input   = new EntitiesRequest();
            var channel = GrpcChannel.ForAddress($"http://{_IP}:5000");
            var client  = new GlowkiServiceClient(channel);
            var t       = client.GetEntities(input);

            List <GlowkiServer.Entity> l = new List <GlowkiServer.Entity>();

            await foreach (var e in t.ResponseStream.ReadAllAsync())
            {
                l.Add(e);
            }

            return(l);
        }
예제 #6
0
 public EntityCollectionResponse Get(EntitiesRequest request)
 {
     return(GetEntitiesResponse());
 }
예제 #7
0
 public AnalysisRequest()
 {
     Cleanup  = new CleanupRequest();
     Entities = new EntitiesRequest();
     Download = new DownloadRequest();
 }