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)); }
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 }); }
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}"); } }
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); }
public EntityCollectionResponse Get(EntitiesRequest request) { return(GetEntitiesResponse()); }
public AnalysisRequest() { Cleanup = new CleanupRequest(); Entities = new EntitiesRequest(); Download = new DownloadRequest(); }