implements web chat rooms

This commit is contained in:
2019-05-11 02:50:19 +01:00
parent 7a84e2965b
commit cb8a6aec60
6 changed files with 55 additions and 49 deletions

View File

@ -19,19 +19,17 @@
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
using Microsoft.AspNet.SignalR;
using Microsoft.AspNet.SignalR.Hosting;
using System.Threading.Tasks;
using System.Collections.Generic;
using System.Linq;
using System;
using System.Collections.Concurrent;
using Microsoft.Data.Entity;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
namespace Yavsc
{
using System;
using System.Collections.Concurrent;
using Microsoft.AspNet.WebUtilities;
using Microsoft.Data.Entity;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Models;
using Models.Chat;
@ -113,7 +111,12 @@ namespace Yavsc
return Context.User.Identity.Name;
}
anonymousSequence++;
var aname = $"{Constants.AnonymousUserNamePrefix}{anonymousSequence}";
var reqKeys = Context.Request.QueryString.Select(pv => pv.Key);
_logger.LogInformation(string.Join(" ", reqKeys));
var queryUname = Context.Request.QueryString[Constants.KeyParamChatUserName] ;
var aname = $"{Constants.AnonymousUserNamePrefix}{queryUname}{anonymousSequence}";
ChatUserNames[Context.ConnectionId]=aname;
_logger.LogInformation($"Anonymous chat user name set to : {aname}");
return aname;