コード例 #1
0
        //---------------------------------------------------------------------
        public Task SetPlayerInfo(PlayerInfo playerInfo)
        {
            PlayerInfo = playerInfo;

            IMContext.Instance.Mongo.UpsertAsync<PlayerInfo>(
                e => e.Id == playerInfo.Id, DbCollectPlayerInfo, playerInfo);

            return TaskDone.Done;
        }
コード例 #2
0
 //---------------------------------------------------------------------
 // 通知添加好友请求(通知)
 public override void onAddFriendRequestNotify(PlayerInfo request_player)
 {
 }
コード例 #3
0
        //---------------------------------------------------------------------
        // App->Cell
        Task IGrainIMTestAppPlayer.UpdateInfo(PlayerInfo info)
        {
            Logger.Info("UpdateInfo() GrainId={0}", GrainKey);

            return TaskDone.Done;
        }
コード例 #4
0
 //---------------------------------------------------------------------
 Task IGrainAppProxyService.UpdatePlayerInfo(PlayerInfo playerInfo)
 {
     string grain_key = string.Format("{0}_{1}", AppId, playerInfo.Id);
     var grain_playerapp = GrainFactory.GetGrain<IGrainPlayer>(grain_key);
     return grain_playerapp.UpdateInfo(playerInfo);
 }
コード例 #5
0
        //---------------------------------------------------------------------
        // App->Cell
        Task IGrainPlayer.UpdateInfo(PlayerInfo info)
        {
            Logger.Info("UpdateInfo() GrainId={0}", GrainKey);

            // 更新缓存
            PlayerCache.SetPlayerInfo(info);

            // 向好友广播本人资料更新
            var grainPlayerBroadcast = GrainFactory.GetGrain<IGrainPlayerBroadcast>(GrainKey);
            grainPlayerBroadcast.BroadcastPlayerInfoUpdate(info);

            // 通知Client
            if (!GrainClientKey.Equals(Guid.Empty))
            {
                var data = EbTool.protobufSerialize<PlayerInfo>(MemoryStream, info);

                // 推送给Client
                PlayerNotify player_notify;
                player_notify.id = PlayerNotifyId.UpdatePlayerInfoNotify;
                player_notify.data = data;
                ((IGrainPlayer)this).ClientNotify(player_notify);
            }

            return TaskDone.Done;
        }
コード例 #6
0
 //---------------------------------------------------------------------
 // 好友信息更新,GrainPlayerBroadcast->GrainPlayer
 Task IGrainPlayer.UpdateFriendInfo(PlayerInfo info)
 {
     return TaskDone.Done;
 }
コード例 #7
0
ファイル: IMListener.cs プロジェクト: CragonGame/GameCloud.IM
 //---------------------------------------------------------------------
 // 通知添加好友请求(通知)
 public abstract void onAddFriendRequestNotify(PlayerInfo request_player);
コード例 #8
0
 //---------------------------------------------------------------------
 // 本人信息更新广播到好友列表
 Task IGrainPlayerBroadcast.BroadcastPlayerInfoUpdate(PlayerInfo playerInfo)
 {
     var data = EbTool.protobufSerialize<PlayerInfo>(MemoryStream, playerInfo);
     return Broadcast(StreamId.PlayerInfoUpdate, data);
 }