Files
hjha-server/ObjectModel/Game/PlayerReportModel.cs
xiaoou e9616125ce feat: initial commit - HJHA game server full source
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
2026-07-07 12:02:15 +08:00

60 lines
1.7 KiB
C#

using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ObjectModel.Game
{
/// <summary>
/// 玩家投诉计数信息
/// </summary>
public class PlayerReportModel
{
/// <summary>
/// 玩家Id
/// </summary>
public int UserId;
/// <summary>
/// 投诉次数
/// </summary>
public int TushuCount;
/// <summary>
/// 处理次数
/// </summary>
public int ChuliCount;
/// <summary>
/// 名字-保存不管。取数据的时候left join 用户表。不一定有值
/// </summary>
public string Name;
public PlayerReportModel() { }
public static PlayerReportModel GetInstance(DataRow row) {
return new PlayerReportModel()
{
UserId = (int)row["userId"],
ChuliCount = (int)row["chuliCount"],
TushuCount = (int)row["tushuCount"],
Name = row["NickName"].ToString()
};
}
public string GetInsertSql() {
return $"INSERT INTO [PlayerReport]([userId], [tushuCount], [chuliCount]) VALUES ({UserId},{TushuCount},{ChuliCount})";
}
public string GetUpdateSql() {
return $"update PlayerReport set tushuCount=tushuCount+{TushuCount},chuliCount=chuliCount+{ChuliCount} where userId={UserId}";
}
public string SaveModeSql() {
return $"if exists(select userid from PlayerReport where userId={UserId}) begin {GetUpdateSql()} end else begin {GetInsertSql()} end;";
}
}
}