//-------------------------------------------------------------------------
        public PlayerInfoFriend getFriendPlayerInfoFriend(string friend_etguid)
        {
            PlayerInfoFriend player_info_friend = null;

            MapFriendInfo.TryGetValue(friend_etguid, out player_info_friend);
            return(player_info_friend);
        }
Esempio n. 2
0
        //---------------------------------------------------------------------
        // 根据玩家Guid获取指定玩家信息
        async Task <PlayerInfoFriend> ICellPlayerService.getPlayerInfoFriend(string et_player_guid)
        {
            string query = string.Format(@"SELECT {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10} FROM Fishing
               WHERE entity_type='EtPlayer' and {11}=$1 LIMIT 1;"
                                         , "entity_guid"
                                         , "list_component[0].def_propset.ActorId"
                                         , "list_component[0].def_propset.NickName"
                                         , "list_component[0].def_propset.Level"
                                         , "list_component[0].def_propset.Experience"
                                         , "list_component[0].def_propset.Icon"
                                         , "list_component[0].def_propset.IpAddress"
                                         , "list_component[0].def_propset.IndividualSignature"
                                         , "list_component[0].def_propset.Chip"
                                         , "list_component[0].def_propset.Gold"
                                         , "list_component[0].def_propset.ProfileSkinTableId"
                                         , "entity_guid");

            var query_request = QueryRequest.Create(query)
                                .ScanConsistency(ScanConsistency.RequestPlus)
                                .AddPositionalParameter(et_player_guid);
            var result = await DbClientCouchbase.Instance.Bucket.QueryAsync <PlayerInfoFriend>(query_request);

            if (result.Success && result.Rows.Count > 0)
            {
                PlayerInfoFriend q = result.Rows[0];
                if (q != null && !string.IsNullOrEmpty(q.player_etguid))
                {
                    if (string.IsNullOrEmpty(q.nick_name))
                    {
                        q.nick_name = EbTool.jsonDeserialize <string>(q.nick_name);
                    }

                    if (string.IsNullOrEmpty(q.icon))
                    {
                        q.icon = EbTool.jsonDeserialize <string>(q.icon);
                    }

                    if (string.IsNullOrEmpty(q.ip_address))
                    {
                        q.ip_address = EbTool.jsonDeserialize <string>(q.ip_address);
                    }

                    if (string.IsNullOrEmpty(q.individual_signature))
                    {
                        q.individual_signature = EbTool.jsonDeserialize <string>(q.individual_signature);
                    }

                    return(q);
                }
            }

            PlayerInfoFriend player_info_ex = new PlayerInfoFriend();

            return(player_info_ex);
        }