6 major server modules (PdkFriendServer/GlobalSever/ServerCore/GameModule/GameNetModule) + game logic (GameFix/GameDAL/ServerData) + network layer (NetWorkMessage) + data layer (ObjectModel) + utilities (MrWu/Core/Config/CloudAPI/dll) + adapters (zyxAdapter/base) .NET 8.0 C# solution, 16 projects, 958 source files
249 lines
9.8 KiB
C#
249 lines
9.8 KiB
C#
/*************************************************************************************
|
||
* 描 述: 游戏统计数据
|
||
*************************************************************************************/
|
||
|
||
using System;
|
||
using System.Collections.Generic;
|
||
using ObjectModel.Club;
|
||
using Server.Core;
|
||
|
||
namespace ObjectModel.Game
|
||
{
|
||
/// <summary>
|
||
/// 俱乐部对战数据统计
|
||
/// </summary>
|
||
public class ClubStatisticsSummaryData : Reference, IGameMapField
|
||
{
|
||
/// <summary>
|
||
/// 俱乐部Id
|
||
/// </summary>
|
||
public int ClubId { get; set;}
|
||
|
||
/// <summary>
|
||
/// 所属联盟Id (没有就是0)
|
||
/// </summary>
|
||
public int LeagueId { get; set; }
|
||
|
||
/// <summary>
|
||
/// 比赛Id(没有就是0)
|
||
/// </summary>
|
||
public int MatchId { get; set; }
|
||
|
||
/// <summary>
|
||
/// 有效耗卡
|
||
/// </summary>
|
||
public decimal CardScore { get; set; }
|
||
|
||
/// <summary>
|
||
/// 活跃积分-群主赚的房费
|
||
/// </summary>
|
||
public decimal DeskScore { get; set;}
|
||
|
||
/// <summary>
|
||
/// 联盟的活跃积分-联盟赚的房费
|
||
/// </summary>
|
||
public decimal LeagueScore { get; set;}
|
||
|
||
/// <summary>
|
||
/// 玩家总输赢积分
|
||
/// </summary>
|
||
public decimal UserSumScore { get; set;}
|
||
|
||
/// <summary>
|
||
/// 游玩次数 (总的开桌次数)
|
||
/// </summary>
|
||
public int PlayGameCount { get; set;}
|
||
|
||
/// <summary>
|
||
/// 游玩次数 (俱乐部中一个人参与一次游戏就算一次)
|
||
/// </summary>
|
||
public int PlayerJoinGameCount { get; set; }
|
||
|
||
/// <summary>
|
||
/// 创建时间
|
||
/// </summary>
|
||
public DateTime CreateTime { get; set; }
|
||
|
||
public static ClubStatisticsSummaryData Create(
|
||
int clubId = 0, int leagueId = 0,
|
||
int matchId = 0, decimal cardScore = 0,
|
||
decimal deskScore = 0, decimal leagueScore = 0,
|
||
decimal userSumScore = 0, int playGameCount = 0,
|
||
int playerJoinGameCount = 0, DateTime createTime = default)
|
||
{
|
||
ClubStatisticsSummaryData data = ReferencePool.Fetch<ClubStatisticsSummaryData>();
|
||
data.ClubId = clubId;
|
||
data.LeagueId = leagueId;
|
||
data.MatchId = matchId;
|
||
data.CardScore = cardScore;
|
||
data.DeskScore = deskScore;
|
||
data.LeagueScore = leagueScore;
|
||
data.UserSumScore = userSumScore;
|
||
data.PlayGameCount = playGameCount;
|
||
data.PlayerJoinGameCount = playerJoinGameCount;
|
||
data.CreateTime = createTime;
|
||
return data;
|
||
}
|
||
|
||
public override void Dispose()
|
||
{
|
||
ReferencePool.Recycle(this);
|
||
}
|
||
|
||
public List<GameMapFieldData> ToFields()
|
||
{
|
||
return new List<GameMapFieldData>
|
||
{
|
||
new GameMapFieldData { Name = "ClubId", GetInt = ()=> ClubId , SetInt = (x)=> ClubId = x},
|
||
new GameMapFieldData { Name = "LeagueId", GetInt = ()=> LeagueId , SetInt = (x)=> LeagueId = x},
|
||
new GameMapFieldData { Name = "MatchId", GetInt = ()=> MatchId , SetInt = (x)=> MatchId = x},
|
||
new GameMapFieldData { Name = "CreateTime", GetString = ()=> CreateTime.ToString("yyyy-MM-dd HH:mm:ss"), SetString = (x)=> CreateTime = DateTime.ParseExact(x, "yyyy-MM-dd HH:mm:ss", null) },
|
||
|
||
new GameMapFieldData { Name = "CardScore", GetDecimal = ()=> CardScore, SetDecimal = (x)=> CardScore = x, IsSummary = true},
|
||
new GameMapFieldData { Name = "DeskScore", GetDecimal = ()=> DeskScore , SetDecimal = (x)=> DeskScore = x, IsSummary = true},
|
||
new GameMapFieldData { Name = "LeagueScore", GetDecimal = ()=> LeagueScore , SetDecimal = (x)=> LeagueScore = x, IsSummary = true},
|
||
new GameMapFieldData { Name = "UserSumScore", GetDecimal = ()=> UserSumScore , SetDecimal = (x)=> UserSumScore = x, IsSummary = true},
|
||
new GameMapFieldData { Name = "PlayGameCount", GetInt = ()=> PlayGameCount , SetInt = (x)=> PlayGameCount = x, IsSummary = true},
|
||
new GameMapFieldData { Name = "PlayerJoinGameCount", GetInt = ()=> PlayerJoinGameCount , SetInt = (x)=> PlayerJoinGameCount = x, IsSummary = true},
|
||
};
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// 玩家对战数据统计
|
||
/// </summary>
|
||
public class PlayerPlayStatisticsSummaryData : Reference, IGameMapField
|
||
{
|
||
/// <summary>
|
||
/// 玩家Id
|
||
/// </summary>
|
||
public int UserId { get; set;}
|
||
|
||
/// <summary>
|
||
/// 所属合伙人的UserId
|
||
/// </summary>
|
||
public int PartnerId { get; set;}
|
||
|
||
/// <summary>
|
||
/// 得分
|
||
/// </summary>
|
||
public decimal Score { get; set; }
|
||
|
||
/// <summary>
|
||
/// 全场最佳(大赢家)
|
||
/// </summary>
|
||
public int BestCount { get; set; }
|
||
|
||
/// <summary>
|
||
/// 房主次数
|
||
/// </summary>
|
||
public int RoomOwnerCount { get; set; }
|
||
|
||
/// <summary>
|
||
/// 玩过的场次
|
||
/// </summary>
|
||
public int PlayGameCount { get; set; }
|
||
|
||
/// <summary>
|
||
/// 玩过的模式
|
||
/// </summary>
|
||
public PlayerStatisticsPlayGameMode PlayGameMode { get; set; }
|
||
|
||
/// <summary>
|
||
/// 创建时间
|
||
/// </summary>
|
||
public DateTime CreateTime { get; set; }
|
||
|
||
#region 俱乐部相关 (后面如果是金币场或者朋友房的统计就没有下面数据)
|
||
|
||
/// <summary>
|
||
/// 所属俱乐部Id
|
||
/// </summary>
|
||
public int ClubId { get; set;}
|
||
|
||
/// <summary>
|
||
/// 所属联盟Id (没有就是0)
|
||
/// </summary>
|
||
public int LeagueId { get; set; }
|
||
|
||
/// <summary>
|
||
/// 比赛Id(没有就是0)
|
||
/// </summary>
|
||
public int MatchId { get; set; }
|
||
|
||
/// <summary>
|
||
/// 俱乐部提供的桌费
|
||
/// </summary>
|
||
public decimal ClubDeskScore { get; set; }
|
||
|
||
/// <summary>
|
||
/// 联盟的活跃积分
|
||
/// </summary>
|
||
public decimal ClubLeagueScore { get; set; }
|
||
|
||
/// <summary>
|
||
/// 有效耗卡
|
||
/// </summary>
|
||
public decimal ClubCardScore { get; set;}
|
||
|
||
#endregion
|
||
|
||
public static PlayerPlayStatisticsSummaryData Create()
|
||
{
|
||
PlayerPlayStatisticsSummaryData data = ReferencePool.Fetch<PlayerPlayStatisticsSummaryData>();
|
||
data.UserId = 0;
|
||
data.PartnerId = 0;
|
||
data.CreateTime = default;
|
||
data.Score = 0;
|
||
data.BestCount = 0;
|
||
data.RoomOwnerCount = 0;
|
||
data.PlayGameCount = 0;
|
||
data.PlayGameMode = PlayerStatisticsPlayGameMode.Unknown;
|
||
data.ClubId = 0;
|
||
data.LeagueId = 0;
|
||
data.MatchId = 0;
|
||
data.ClubDeskScore = 0;
|
||
data.ClubLeagueScore = 0;
|
||
data.ClubCardScore = 0;
|
||
return data;
|
||
}
|
||
|
||
public override void Dispose()
|
||
{
|
||
ReferencePool.Recycle(this);
|
||
}
|
||
|
||
public List<GameMapFieldData> ToFields()
|
||
{
|
||
return new List<GameMapFieldData>
|
||
{
|
||
new GameMapFieldData { Name = "UserId", GetInt = ()=> UserId , SetInt = (x)=> UserId = x},
|
||
new GameMapFieldData { Name = "PartnerId", GetInt = ()=> PartnerId , SetInt = (x)=> PartnerId = x},
|
||
new GameMapFieldData { Name = "CreateTime", GetString = ()=> CreateTime.ToString("yyyy-MM-dd HH:mm:ss"), SetString = (x)=> CreateTime = DateTime.ParseExact(x, "yyyy-MM-dd HH:mm:ss", null) },
|
||
new GameMapFieldData { Name = "PlayGameMode", GetInt = ()=> (int)PlayGameMode , SetInt = (x)=> PlayGameMode = (PlayerStatisticsPlayGameMode)x},
|
||
new GameMapFieldData { Name = "ClubId", GetInt = ()=> ClubId , SetInt = (x)=> ClubId = x},
|
||
new GameMapFieldData { Name = "LeagueId", GetInt = ()=> LeagueId , SetInt = (x)=> LeagueId = x},
|
||
new GameMapFieldData { Name = "MatchId", GetInt = ()=> MatchId , SetInt = (x)=> MatchId = x},
|
||
|
||
new GameMapFieldData { Name = "Score", GetDecimal = ()=> Score, SetDecimal = (x)=> Score = x, IsSummary = true},
|
||
new GameMapFieldData { Name = "BestCount", GetInt = ()=> BestCount , SetInt = (x)=> BestCount = x, IsSummary = true},
|
||
new GameMapFieldData { Name = "RoomOwnerCount", GetInt = ()=> RoomOwnerCount , SetInt = (x)=> RoomOwnerCount = x, IsSummary = true},
|
||
new GameMapFieldData { Name = "PlayGameCount", GetInt = ()=> PlayGameCount , SetInt = (x)=> PlayGameCount = x, IsSummary = true},
|
||
new GameMapFieldData { Name = "ClubDeskScore", GetDecimal = ()=> ClubDeskScore , SetDecimal = (x)=> ClubDeskScore = x, IsSummary = true},
|
||
new GameMapFieldData { Name = "ClubLeagueScore", GetDecimal = ()=> ClubLeagueScore , SetDecimal = (x)=> ClubLeagueScore = x, IsSummary = true},
|
||
new GameMapFieldData { Name = "ClubCardScore", GetDecimal = ()=> ClubCardScore , SetDecimal = (x)=> ClubCardScore = x, IsSummary = true},
|
||
};
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// 游玩类型
|
||
/// </summary>
|
||
public enum PlayerStatisticsPlayGameMode
|
||
{
|
||
Unknown = 0,
|
||
GOLD = 1, // 金币场
|
||
FRIEND = 2, // 朋友房
|
||
CLUB = 3, // 俱乐部
|
||
}
|
||
} |