/// <summary> /// 更新玩家账户 /// </summary> /// <param name="player">玩家对象</param> /// <returns>更新是否成功</returns> public static bool UpdatePlayerAmount(Player player) { bool isSuccess = false; try { // 创建Agent数据访问对象 PlayerService playerService = new PlayerService(); isSuccess = playerService.UpdatePlayerAmount(player); } catch (Exception e) { throw; } return isSuccess; }
/// <summary> /// 根据PlayerName得到Player /// </summary> /// <param name="ghostName">player名称</param> /// <returns>ghost对象</returns> private static Player GetPlayerByPlayerName(string playerName) { PlayerService playerService = new PlayerService(); // 根据ghostName查询ghost DataTable dt = playerService.AddNewPlayer_checkLoginName(playerName); int id = 0; if (dt != null && dt.Rows.Count > 0) { id = System.Convert.ToInt32(dt.Rows[0]["id"]); playerName = dt.Rows[0]["loginName"].ToString(); } Player player = new Player(id); player.LoginName = playerName; return player; }
/// <summary> /// 记录Player登录信息 /// </summary> /// <param name="agent"></param> /// <returns></returns> public static bool SavePlayerLoginMessage(Player player) { bool isSuccess = false; try { // 创建Agent数据访问对象 PlayerService playerService = new PlayerService(); isSuccess = playerService.UpdatePlayerLoginStatus(player); } catch (Exception e) { throw; } return isSuccess; }