.net - SignalR group reconnect -
we have game implemented using signalr, has several players , joined group. however, players may off-line, , want start robots replace left players. our current issue when let 1 player off line, game seems stuck there. there way re-join remaining players , started robot , continue game? thank you.
if understood problem correctly, have multiplayer game each user connected signalr connection. have players going offline, able know on server through ondisconnect event, , want replace players own bot players.
i assuming each player have unique id. unique id needs mapped connectionid able achieve exact replacement. uniqueid connectionid itself.
for problem's solution need to:
- find out uniqueid/connectionid went offline.
- create new connection hub server client, robot player.
- replace player's uniqueid/connectionid(the 1 went offline) active robot player's uniqueid/connectionid.
- transfer state offline player robot player.
however, player might not respond until disconnect timeout, 30seconds default. reduce disconnecttimeout in case want know if player has gone offline.
note: check performance impact of reducing timeout on application before go ahead.
Comments
Post a Comment