Exemplo n.º 1
0
        /// <summary>
        /// 查找玩家房间,并修改用户信息
        /// </summary>
        /// <param name="userToken"></param>
        /// <param name="setUserData"></param>
        private void SetUserData(UserToken userToken, SetUserData setUserData)
        {
            userToken.PlayerData = setUserData.UserData;
            var linqrooms = from linqroom in id2rooms where linqroom.Value.ContainsPlayer(userToken.PlayerData.Guid) != -1 select linqroom;

            if (linqrooms.Count() > 0)
            {
                var room = linqrooms.First().Value;

                var playerid = room.ContainsPlayer(userToken.PlayerData.Guid);

                room.UserData[playerid] = userToken.PlayerData;
            }
        }
 private void handleUserData(SetUserData data)
 {
     this.user.DisplayName = data.DisplayName;
     this.user.Status      = data.Status;
 }