草庐IT

GameAction

全部标签

c# - SignalR OnConnected - 向连接的客户端发送消息

很简单的问题。为什么刚刚连接的客户端没有收到任何消息,而其他所有客户端都收到了广播?发送连接消息的客户端的正确方法是什么?protectedoverridevoidOnConnected(HttpContextBasecontext,stringclientId){GameActionmessage=newGameAction();message.text="Playerconnected";Connection.Broadcast(serializer.Serialize(message));GameActiongamestate=newGameAction();gamestate.