//--------------------------------------------------------------------- Task IGrainChatCache.RecvChatFromGrainPlayer(ChatInfoSend chatInfoSend) { ChatInfoRecv chat_info_recv = new ChatInfoRecv() { et_player_send = chatInfoSend.et_player_send, et_player_recv = chatInfoSend.et_player_recv, content = chatInfoSend.content }; // 保存Db // 广播给聊天双方 var grainPlayer1 = this.GrainFactory.GetGrain<IGrainPlayer>(GrainPlayerKey1); grainPlayer1.RecvChatFromGrainCacheChat(chat_info_recv); var grainPlayer2 = this.GrainFactory.GetGrain<IGrainPlayer>(GrainPlayerKey2); grainPlayer2.RecvChatFromGrainCacheChat(chat_info_recv); return TaskDone.Done; }
//--------------------------------------------------------------------- // 收到好友聊天消息(2人广播) public override void onRecvChat2Friend(ChatInfoRecv chatinfo_recv) { }
//--------------------------------------------------------------------- // 收到GrainCacheChat的聊天广播消息 Task IGrainPlayer.RecvChatFromGrainCacheChat(ChatInfoRecv chatInfoRecv) { if (!GrainClientKey.Equals(Guid.Empty)) { PlayerNotify player_notify; player_notify.id = PlayerNotifyId.RecvChat2Friend; player_notify.data = EbTool.protobufSerialize<ChatInfoRecv>(MemoryStream, chatInfoRecv); ((IGrainPlayer)this).ClientNotify(player_notify); } return TaskDone.Done; }
//--------------------------------------------------------------------- // 收到好友聊天消息(2人广播) public abstract void onRecvChat2Friend(ChatInfoRecv chatinfo_recv);