javascript - How to manage playerIds with SignalR and MVC -
in game development signalr
, mvc
, have manage player id's.
with mvc
controllers
re created each ajax
request can't store unless use database or store in cookie.
does signalr
have tools can use persisting playerids
game ease situation?
you can't connection id's signalr, can register id per user on onconnected
method. override function in hub.
there might simpler way it, 1 option pass session key js, , js can pass session key (or other unique identifier) server on every command.
for example, while user first connected: onconnected() -> gets user unique id js , saves locally map each user unique id(possibly save id group id can call send msgs user according id). after on each request sent hub can attach unique id , can use like.
i'm pretty sure can find easier way define unique identifier , maybe more suitable way save data in hub.
now think it, should check this.
Comments
Post a Comment