From 149e093f162512e1cf3b65bb8a17c6f8f51d2615 Mon Sep 17 00:00:00 2001 From: chsakell Date: Fri, 7 Oct 2016 15:01:28 +0300 Subject: [PATCH] minor changes --- Startup.cs | 9 +-------- app/shared/interfaces.ts | 2 -- app/shared/services/feed.service.ts | 19 ++++++------------- 3 files changed, 7 insertions(+), 23 deletions(-) diff --git a/Startup.cs b/Startup.cs index 52fdc1d..167af18 100644 --- a/Startup.cs +++ b/Startup.cs @@ -67,14 +67,7 @@ namespace LiveGameFeed .AllowCredentials()) .UseStaticFiles() .UseWebSockets(); - /* - .Map("/xhrf", a => a.Run(async context => - { - var tokens = antiforgery.GetAndStoreTokens(context); - context.Response.Cookies.Append("XSRF-TOKEN", tokens.RequestToken, new CookieOptions() { HttpOnly = false }); - await context.Response.WriteAsync(tokens.RequestToken); - })); - */ + app.UseMvc(routes => { routes.MapRoute( diff --git a/app/shared/interfaces.ts b/app/shared/interfaces.ts index 1f0182d..b5ea683 100644 --- a/app/shared/interfaces.ts +++ b/app/shared/interfaces.ts @@ -10,8 +10,6 @@ export interface FeedProxy { export interface FeedClient { setConnectionId: (id: string) => void; - userDisconnected: (id: string) => void; - updateMatch: (match: Match) => void; addFeed: (feed: Feed) => void; addChatMessage: (chatMessage: ChatMessage) => void; diff --git a/app/shared/services/feed.service.ts b/app/shared/services/feed.service.ts index 580da60..b8bc775 100644 --- a/app/shared/services/feed.service.ts +++ b/app/shared/services/feed.service.ts @@ -37,27 +37,21 @@ export class FeedService { } start(debug: boolean): Observable { - // only for debug + $.connection.hub.logging = debug; - // get the signalR hub named 'broadcaster' + let connection = $.connection; + // reference signalR hub named 'broadcaster' let feedHub = connection.broadcaster; this.server = feedHub.server; - /** - * @desc callback when a new user connect to the chat - * @param User user, the connected user - */ + // setConnectionId method called by server feedHub.client.setConnectionId = id => this.onSetConnectionId(id); - /** - * @desc callback when match score is updated - */ + // updateMatch method called by server feedHub.client.updateMatch = match => this.onUpdateMatch(match); - /** - * @desc callback when a feed is added - */ + // addFeed method called by server feedHub.client.addFeed = feed => this.onAddFeed(feed); feedHub.client.addChatMessage = chatMessage => this.onAddChatMessage(chatMessage); @@ -91,7 +85,6 @@ export class FeedService { } private onAddChatMessage(chatMessage: ChatMessage) { - console.log(chatMessage); this.addChatMessageSubject.next(chatMessage); }