当前位置: 首页>>代码示例>>C#>>正文


C# User.GetId方法代码示例

本文整理汇总了C#中User.GetId方法的典型用法代码示例。如果您正苦于以下问题:C# User.GetId方法的具体用法?C# User.GetId怎么用?C# User.GetId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在User的用法示例。


在下文中一共展示了User.GetId方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ForceRemotePlayerToSendTransform

 void ForceRemotePlayerToSendTransform(User user)
 {
     SmartFoxClient client = NetworkController.GetClient();
     SFSObject data = new SFSObject();
     data.Put("_cmd", "f");  //We put _cmd = "f" here to know that this object contains "force send transform" demand
     data.Put("to_uid", user.GetId()); // Who this message is for
     client.SendObject(data);
 }
开发者ID:Nivek12,项目名称:Hegira,代码行数:8,代码来源:PlayerSpawnController.cs

示例2: SpawnRemotePlayer

    private void SpawnRemotePlayer(User user)
    {
        // Just spawn remote player at a very remote point
        UnityEngine.Object remotePlayer = Instantiate(remotePlayerPrefab, new Vector3(-10000, -10000, -10000), new Quaternion(0,0,0,1));

        //Give remote player a name like "remote_<id>" to easily find him then
        remotePlayer.name = "remote_"+user.GetId();

        //Start receiving trasnform synchronization messages
        (remotePlayer as Component).SendMessage("StartReceiving");

        // Force this player to send us transform
        ForceRemotePlayerToSendTransform(user);
    }
开发者ID:Nivek12,项目名称:Hegira,代码行数:14,代码来源:PlayerSpawnController.cs

示例3: OnPublicMessage

    public void OnPublicMessage(string message, User fromUser, int roomId)
    {
        int userId = fromUser.GetId();
        if (userId!=smartFoxClient.myUserId) {  // If it's not myself
            string mes = fromUser.GetName()+": "+message;

            // Send chat message to the Chat Controller
            SendMessage("AddChatMessage", mes);

            //Find user object with such Id
            GameObject user = GameObject.Find("remote_"+userId);
            //If found - send him bubble message
            if (user) {
                user.SendMessage("ShowBubble", mes);
            }
        }
    }
开发者ID:Nivek12,项目名称:Hegira,代码行数:17,代码来源:NetworkController.cs

示例4: InsertToGroup

        public void InsertToGroup(User user, List<String> listVkIdFriends)
        {
            int i = 1;
            UserMapper userMapper = new UserMapper();
            ListFriendsMapper listFriendsMapper = new ListFriendsMapper();
            List<ListFriends> listFriends = new List<ListFriends>();
            FriendsMapper friendsMapper = new FriendsMapper();
            foreach (var vkIdFriend in listVkIdFriends)
            {
                ListFriends listFriend = new ListFriends(user.GetId(), friendsMapper.FindByVkId(vkIdFriend).GetId());
                listFriends.Add(listFriend);
            }
            foreach (var friend in listFriends)
            {
                GroupMapper groupMapper = new GroupMapper();
                Friend friendObj = friendsMapper.FindById(friend.GetIdFriend());
                String VkId = friendObj.GetVkId();

                List<String> listgroup = vkClient.GroupsList(VkId);
                List<Group> groupsFriend = new List<Group>(); ;
                List<GroupsFriends> GroupsFriendses = new List<GroupsFriends>();
                int idFriend = friendsMapper.FindByVkId(friendObj.GetVkId()).GetId();
                GroupsFriendsMapper groupsFriendsMapper = new GroupsFriendsMapper();
                Group group = null;
                foreach (var vkidGroup in listgroup)
                {
                    group = new Group(vkidGroup);
                    groupsFriend.Add(group);
                }
                groupMapper.Insert(groupsFriend);

                foreach (var vkidGroup in listgroup)
                {
                    GroupsFriends groupsFriends = new GroupsFriends(idFriend, groupMapper.FindByVkId(vkidGroup).GetId());
                    GroupsFriendses.Add(groupsFriends);
                }
                groupsFriendsMapper.Insert(GroupsFriendses);
                Console.WriteLine("--------------------Friend number {0}", i);
                i++;
                listgroup.Clear();
            }
        }
开发者ID:klusha,项目名称:VK,代码行数:42,代码来源:InternetToDataBase.cs

示例5: SendTransformToRemotePlayerObject

    private void SendTransformToRemotePlayerObject(SFSObject data, User fromUser)
    {
        int userId = fromUser.GetId();
        if (userId!=smartFoxClient.myUserId) {  // If it's not myself
            //Find user object with such Id
            GameObject user = GameObject.Find("remote_"+userId);

            //If found - send him message with transform data
            if (user) user.SendMessage("ReceiveTransform", data);
        }
    }
开发者ID:Nivek12,项目名称:Hegira,代码行数:11,代码来源:NetworkController.cs

示例6: SendAnimationMessageToRemotePlayerObject

 private void SendAnimationMessageToRemotePlayerObject(SFSObject data, User fromUser)
 {
     int userId = fromUser.GetId();
     if (userId!=smartFoxClient.myUserId) {  // If it's not myself
         //Find user object with such Id
         GameObject user = GameObject.Find("remote_"+userId);
         //If found - send him animation message
         if (user) user.SendMessage("PlayAnimation", data.GetString("mes"));
     }
 }
开发者ID:Nivek12,项目名称:Hegira,代码行数:10,代码来源:NetworkController.cs

示例7: InsertToListFriends

 public void InsertToListFriends(User user, List<String> listFriends)
 {
     UserMapper userMapper = new UserMapper();
     FriendsMapper friendsMapper = new FriendsMapper();
     ListFriendsMapper listFriendsMapper = new ListFriendsMapper();
     InsertToFriends(listFriends);
     List<ListFriends> ListFriendses = new List<ListFriends>();
     foreach (var vkidFriend in listFriends)
     {
         Friend friend = friendsMapper.FindByVkId(vkidFriend);
         ListFriendses.Add(new ListFriends(user.GetId(), friend.GetId()));
     }
     listFriendsMapper.Insert(ListFriendses);
 }
开发者ID:klusha,项目名称:VK,代码行数:14,代码来源:InternetToDataBase.cs


注:本文中的User.GetId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。