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
This commit is contained in:
34
ObjectModel/Backend/AuthorityType.cs
Normal file
34
ObjectModel/Backend/AuthorityType.cs
Normal file
@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ObjectModel.Backend
|
||||
{
|
||||
/// <summary>
|
||||
/// 权限类型
|
||||
/// </summary>
|
||||
public enum AuthorityType
|
||||
{
|
||||
/// <summary>
|
||||
/// 系统管理员
|
||||
/// </summary>
|
||||
Administrator = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 运营
|
||||
/// </summary>
|
||||
Operate = 2,
|
||||
|
||||
/// <summary>
|
||||
/// 渠道
|
||||
/// </summary>
|
||||
Channel = 3,
|
||||
|
||||
/// <summary>
|
||||
/// 个人
|
||||
/// </summary>
|
||||
Person = 4
|
||||
}
|
||||
}
|
||||
80
ObjectModel/Backend/BMAdminModel.cs
Normal file
80
ObjectModel/Backend/BMAdminModel.cs
Normal file
@ -0,0 +1,80 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ObjectModel.Backend
|
||||
{
|
||||
/// <summary>
|
||||
/// 后台玩家信息,后台用户也是推广用户。
|
||||
/// </summary>
|
||||
public class BMAdminModel
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
public int id;
|
||||
|
||||
/// <summary>
|
||||
/// 用户名
|
||||
/// </summary>
|
||||
public string username;
|
||||
|
||||
/// <summary>
|
||||
/// 密码
|
||||
/// </summary>
|
||||
public string pwd;
|
||||
|
||||
/// <summary>
|
||||
/// 哪个渠道,也可以是个人
|
||||
/// </summary>
|
||||
public string paltTag;
|
||||
|
||||
/// <summary>
|
||||
/// 对应用户的Id --个人是对应游戏id,渠道是对应后台Id
|
||||
/// </summary>
|
||||
public int userid;
|
||||
|
||||
/// <summary>
|
||||
/// 身份:1系统管理员 2运营 3渠道 4个人
|
||||
/// <see cref="AuthorityType"/>
|
||||
/// </summary>
|
||||
public int authority;
|
||||
|
||||
/// <summary>
|
||||
/// 昵称
|
||||
/// </summary>
|
||||
public string NickName;
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
public DateTime createTime;
|
||||
|
||||
/// <summary>
|
||||
/// 权限列表
|
||||
/// 0-10 表示系统权限 1表示查询 2表示管理
|
||||
/// 10-100 表示用户权限 10 表示查询 20表示管理
|
||||
/// 100-1000 表示比赛权限 100表示查询 200表示管理
|
||||
/// 例如:111 表示 有比赛的查询权限,用户的查询权限 和系统的查询权限
|
||||
/// 212 表示:有比赛的管理权限,用户的查询权限 和系统的管理权限
|
||||
/// </summary>
|
||||
public string PermissionList;
|
||||
|
||||
public BMAdminModel() { }
|
||||
|
||||
public BMAdminModel(DataRow row) {
|
||||
this.username = row["username"].ToString();
|
||||
this.pwd = row["pwd"].ToString();
|
||||
this.paltTag = row["paltTag"].ToString();
|
||||
this.NickName = row["NickName"].ToString();
|
||||
this.userid = (int)row["userid"];
|
||||
this.id = (int)row["id"];
|
||||
this.authority = (int)row["authority"];
|
||||
this.createTime = (DateTime)row["createTime"];
|
||||
this.PermissionList = row["PermissionList"].ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
70
ObjectModel/Backend/BMLogModel.cs
Normal file
70
ObjectModel/Backend/BMLogModel.cs
Normal file
@ -0,0 +1,70 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ObjectModel.Backend
|
||||
{
|
||||
/// <summary>
|
||||
/// 日志
|
||||
/// </summary>
|
||||
public class BMLogModel
|
||||
{
|
||||
/// <summary>
|
||||
/// 操作员
|
||||
/// </summary>
|
||||
public string username;
|
||||
|
||||
/// <summary>
|
||||
/// 操作的数值备份
|
||||
/// </summary>
|
||||
public long numBak;
|
||||
|
||||
/// <summary>
|
||||
/// 操作的具体数值
|
||||
/// </summary>
|
||||
public long num;
|
||||
|
||||
/// <summary>
|
||||
/// 对谁操作
|
||||
/// </summary>
|
||||
public int toObj;
|
||||
|
||||
/// <summary>
|
||||
/// 说明
|
||||
/// </summary>
|
||||
public string memo;
|
||||
|
||||
/// <summary>
|
||||
/// 操作类型,1修改资产 2系统日志
|
||||
/// </summary>
|
||||
public int lx;
|
||||
|
||||
/// <summary>
|
||||
/// 操作时间
|
||||
/// </summary>
|
||||
public DateTime CreateTime;
|
||||
|
||||
public BMLogModel() { }
|
||||
|
||||
public BMLogModel(DataRow row) {
|
||||
this.username = row["username"].ToString();
|
||||
this.memo = row["memo"].ToString();
|
||||
this.numBak = (long)row["numBak"];
|
||||
this.num = (long)row["num"];
|
||||
this.toObj = (int)row["toObj"];
|
||||
this.lx = (int)row["lx"];
|
||||
this.CreateTime = (DateTime)row["CreateTime"];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取保存日志SQL
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string GetInsertSql() {
|
||||
return $"INSERT INTO [bm_log]( [username], [numBak], [num], [toObj], [memo], [lx]) VALUES ('{username}', {numBak}, {num}, {toObj}, '{memo}', {lx})";
|
||||
}
|
||||
}
|
||||
}
|
||||
56
ObjectModel/Backend/PlayerResInfo.cs
Normal file
56
ObjectModel/Backend/PlayerResInfo.cs
Normal file
@ -0,0 +1,56 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ObjectModel.Backend
|
||||
{
|
||||
/// <summary>
|
||||
/// 玩家资产信息
|
||||
/// </summary>
|
||||
public class PlayerResInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 玩家userid
|
||||
/// </summary>
|
||||
public int UserId;
|
||||
|
||||
/// <summary>
|
||||
/// 游戏币 -金币
|
||||
/// </summary>
|
||||
public long Money;
|
||||
|
||||
/// <summary>
|
||||
/// 金砖
|
||||
/// </summary>
|
||||
public int GoldBrick;
|
||||
|
||||
/// <summary>
|
||||
/// 保险柜的金币
|
||||
/// </summary>
|
||||
public int SafeNum;
|
||||
|
||||
/// <summary>
|
||||
/// 红包卷
|
||||
/// </summary>
|
||||
public int RedNum;
|
||||
|
||||
/// <summary>
|
||||
/// 参赛卷
|
||||
/// </summary>
|
||||
public int EntryNum;
|
||||
|
||||
/// <summary>
|
||||
/// 复活卡
|
||||
/// </summary>
|
||||
public int ReviveNum;
|
||||
|
||||
/// <summary>
|
||||
/// 礼卷
|
||||
/// </summary>
|
||||
public int Voucher;
|
||||
|
||||
public PlayerResInfo() { }
|
||||
}
|
||||
}
|
||||
35
ObjectModel/Backend/RandListMoneyInfo.cs
Normal file
35
ObjectModel/Backend/RandListMoneyInfo.cs
Normal file
@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ObjectModel.Backend
|
||||
{
|
||||
public class RandListMoneyInfo
|
||||
{
|
||||
public long rowNum;
|
||||
public int userId;
|
||||
public string userName;
|
||||
public string NickName;
|
||||
public long Money;
|
||||
public int gold;
|
||||
public int coupon;
|
||||
|
||||
public RandListMoneyInfo() { }
|
||||
|
||||
public RandListMoneyInfo(DataRow row)
|
||||
{
|
||||
rowNum = (long)row["rowNum"];
|
||||
userId = (int)row["userId"];
|
||||
userName = (string)row["userName"];
|
||||
NickName = row["NickName"] is string nick ? nick : string.Empty;
|
||||
Money = (long)row["Money"];
|
||||
gold = (int)row["hjha_Gold"];
|
||||
coupon = (int)row["coupon"];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
194
ObjectModel/Backend/RewardModel.cs
Normal file
194
ObjectModel/Backend/RewardModel.cs
Normal file
@ -0,0 +1,194 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ObjectModel.Backend
|
||||
{
|
||||
/// <summary>
|
||||
/// 推广奖励对象
|
||||
/// </summary>
|
||||
public class RewardModel
|
||||
{
|
||||
/// <summary>
|
||||
/// id编号 主键 自增
|
||||
/// </summary>
|
||||
public int id;
|
||||
|
||||
/// <summary>
|
||||
/// 玩家id或者后台Id
|
||||
/// </summary>
|
||||
public int userid;
|
||||
|
||||
/// <summary>
|
||||
/// 变化的数值,按理说只有加,没有减
|
||||
/// </summary>
|
||||
public int num;
|
||||
|
||||
/// <summary>
|
||||
/// 奖励类型 1首次游戏 2参赛 3充值
|
||||
/// </summary>
|
||||
public Byte type;
|
||||
|
||||
/// <summary>
|
||||
/// 场景ID 1娱乐官 2休闲馆 3竞赛馆 4充值
|
||||
/// </summary>
|
||||
public Byte senceId;
|
||||
|
||||
/// <summary>
|
||||
/// 是否领取0未领取 1领取过。
|
||||
/// 因为红包券是存在redis里面。充值逻辑在数据库里面。所以才会有这种设计
|
||||
/// 在查询玩家奖励列表的时候可以把为状态为0的奖励加到redis里面。并且修改状态。
|
||||
/// </summary>
|
||||
public byte lqstate;
|
||||
|
||||
/// <summary>
|
||||
/// 产生时间
|
||||
/// </summary>
|
||||
public DateTime createDate;
|
||||
|
||||
/// <summary>
|
||||
/// 产生数据的人
|
||||
/// </summary>
|
||||
public int fromUser;
|
||||
|
||||
/// <summary>
|
||||
/// 0红包 1参赛卷
|
||||
/// </summary>
|
||||
public int numlx;
|
||||
|
||||
public RewardModel() { }
|
||||
|
||||
public RewardModel(DataRow row)
|
||||
{
|
||||
this.id = (int)row["id"];
|
||||
this.userid = (int)row["userid"];
|
||||
this.fromUser = (int)row["fromUser"];
|
||||
this.num = (int)row["num"];
|
||||
this.numlx = (int)row["numlx"];
|
||||
this.type = (byte)row["type"];
|
||||
this.senceId = (byte)row["senceId"];
|
||||
this.lqstate = (byte)row["lqstate"];
|
||||
this.createDate = (DateTime)row["createDate"];
|
||||
}
|
||||
|
||||
public RewardModel(int userid, int num, byte type, byte senceId, int _fromUser,int numlx)
|
||||
{
|
||||
this.userid = userid;
|
||||
this.num = num;
|
||||
this.type = type;
|
||||
this.senceId = senceId;
|
||||
this.fromUser = _fromUser;
|
||||
this.numlx = numlx;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取插入语句SQL
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string GetInsertSql()
|
||||
{
|
||||
if (!CheckData()) throw new ArgumentOutOfRangeException($"参数异常,userid:{userid} type:{type} senceId:{senceId}");
|
||||
return $"INSERT INTO [Rewards]([userid], [num], [type], [senceId],fromUser,numlx) VALUES ({userid}, {num}, {type},{senceId} ,{fromUser},{numlx})";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 校验数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool CheckData()
|
||||
{
|
||||
return userid > 0 && type > 0 && senceId > 0 && num > 0;
|
||||
}
|
||||
}
|
||||
|
||||
public class GetMyRewardsResponse : RewardModel
|
||||
{
|
||||
/// <summary>
|
||||
/// 玩家昵称
|
||||
/// </summary>
|
||||
public string NickName;
|
||||
|
||||
/// <summary>
|
||||
/// 注册时间
|
||||
/// </summary>
|
||||
public DateTime RegTime;
|
||||
|
||||
/// <summary>
|
||||
/// 最后登录时间
|
||||
/// </summary>
|
||||
public DateTime LastLoginTime;
|
||||
|
||||
public GetMyRewardsResponse() { }
|
||||
|
||||
public GetMyRewardsResponse(DataRow row) : base(row)
|
||||
{
|
||||
this.LastLoginTime = (DateTime)row["LastLoginTime"];
|
||||
this.RegTime = (DateTime)row["RegTime"];
|
||||
this.NickName = row["NickName"].ToString();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 推广玩家信息
|
||||
/// </summary>
|
||||
public class Promoter
|
||||
{
|
||||
/// <summary>
|
||||
/// 玩家Id(编号)
|
||||
/// </summary>
|
||||
public int UserId;
|
||||
|
||||
/// <summary>
|
||||
/// 昵称
|
||||
/// </summary>
|
||||
public string NickName;
|
||||
|
||||
/// <summary>
|
||||
/// 推广人数
|
||||
/// </summary>
|
||||
public int RenCount;
|
||||
|
||||
/// <summary>
|
||||
/// 推广奖励
|
||||
/// </summary>
|
||||
public int MoneyCount;
|
||||
|
||||
public Promoter() { }
|
||||
|
||||
public Promoter(DataRow row)
|
||||
{
|
||||
this.UserId = (int)row["userid"];
|
||||
this.RenCount = DBNull.Value != row["rencount"] ? (int)row["rencount"] : 0;
|
||||
this.MoneyCount = DBNull.Value != row["moneycount"] ? (int)row["moneycount"] : 0;
|
||||
this.NickName = row["NickName"].ToString();
|
||||
}
|
||||
}
|
||||
|
||||
public class GroupByReward {
|
||||
/// <summary>
|
||||
/// 玩家userid(编号)
|
||||
/// </summary>
|
||||
public int UserId;
|
||||
|
||||
/// <summary>
|
||||
/// 玩家昵称
|
||||
/// </summary>
|
||||
public string NickName;
|
||||
|
||||
/// <summary>
|
||||
/// 产生的奖励值总和
|
||||
/// </summary>
|
||||
public int Money;
|
||||
|
||||
public GroupByReward() { }
|
||||
|
||||
public GroupByReward(DataRow row) {
|
||||
this.UserId = (int)row["UserID"];
|
||||
this.Money = (int)row["moneySum"];
|
||||
this.NickName = row["NickName"].ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
50
ObjectModel/Club/ClubBureauScore.cs
Normal file
50
ObjectModel/Club/ClubBureauScore.cs
Normal file
@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ObjectModel.Club
|
||||
{
|
||||
public class ClubBureauScore
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public ClubBureauScore() { }
|
||||
|
||||
public BureauScorePlayer[] Players;
|
||||
|
||||
public int ClubId;
|
||||
|
||||
public string weiyima;
|
||||
|
||||
public string wayId;
|
||||
|
||||
public int game_serid;
|
||||
|
||||
public int ModuleId;
|
||||
|
||||
//SendFightRecordToClub
|
||||
}
|
||||
|
||||
public class BureauScorePlayer
|
||||
{
|
||||
/// <summary>
|
||||
/// 玩家Id
|
||||
/// </summary>
|
||||
public int UserId;
|
||||
|
||||
/// <summary>
|
||||
/// 玩家到现在的总分
|
||||
/// </summary>
|
||||
public decimal Score;
|
||||
public string NickName;
|
||||
|
||||
/// <summary>
|
||||
/// 参加比赛的俱乐部ID
|
||||
/// </summary>
|
||||
public int ClubId;
|
||||
public BureauScorePlayer() { }
|
||||
}
|
||||
}
|
||||
39
ObjectModel/Club/ClubInnerData.cs
Normal file
39
ObjectModel/Club/ClubInnerData.cs
Normal file
@ -0,0 +1,39 @@
|
||||
// -----------------------------------------------------------------------
|
||||
// <summary>
|
||||
// 服务器内部传输数据
|
||||
// </summary>
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
|
||||
using System;
|
||||
|
||||
namespace GameData.Club
|
||||
{
|
||||
/// <summary>
|
||||
/// 房卡变更
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class ClubInnerRoomCardChange
|
||||
{
|
||||
/// <summary>
|
||||
/// 俱乐部ID
|
||||
/// </summary>
|
||||
public int ClubId;
|
||||
/// <summary>
|
||||
/// 房卡操作数量
|
||||
/// </summary>
|
||||
public int CardCnt;
|
||||
/// <summary>
|
||||
/// 操作用户
|
||||
/// </summary>
|
||||
public int UserId;
|
||||
/// <summary>
|
||||
/// 描述
|
||||
/// </summary>
|
||||
public string Des;
|
||||
/// <summary>
|
||||
/// 是否开启赠送折扣
|
||||
/// </summary>
|
||||
public bool IsOpenGive;
|
||||
}
|
||||
}
|
||||
271
ObjectModel/Club/ClubLeagueMatch.cs
Normal file
271
ObjectModel/Club/ClubLeagueMatch.cs
Normal file
@ -0,0 +1,271 @@
|
||||
#if !WebManagement
|
||||
using GameData.Club;
|
||||
#endif
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using GameData;
|
||||
|
||||
namespace ObjectModel.Club
|
||||
{
|
||||
/// <summary>
|
||||
/// 玩家联赛权限
|
||||
/// </summary>
|
||||
public class ClubLeaguePower
|
||||
{
|
||||
/// <summary>
|
||||
/// 自增Id 主键
|
||||
/// </summary>
|
||||
public int ClubLeaguePowerId;
|
||||
/// <summary>
|
||||
/// 俱乐部Id --索引
|
||||
/// </summary>
|
||||
public int ClubId;
|
||||
/// <summary>
|
||||
/// 是否有创建联赛权限 Ture有权限 false 没有
|
||||
/// </summary>
|
||||
public bool IsCanCreate;
|
||||
/// <summary>
|
||||
/// 是否有加入联赛权限 Ture有权限 false 没有
|
||||
/// </summary>
|
||||
public bool IsCanJoin;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 加入到联赛的俱乐部集合
|
||||
/// </summary>
|
||||
public class JoinInClubLeagueMatch
|
||||
{
|
||||
/// <summary>
|
||||
/// 比赛Id--索引
|
||||
/// </summary>
|
||||
public int ClubMatchId;
|
||||
|
||||
/// <summary>
|
||||
/// 存数据库 Json 数据
|
||||
/// </summary>
|
||||
public string JoinInLeagueMatchClubs;
|
||||
|
||||
/// <summary>
|
||||
/// 加入联赛的俱乐部Id集合,保存前到联赛内存里面拿数据。中途对该对象不做操作
|
||||
/// </summary>
|
||||
public List<int> ClubIds;
|
||||
|
||||
/// <summary>
|
||||
/// 返回存数据库的JSon 字符串,存数据库前调用
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string GetJoinInLeagueMatchClubsToString()
|
||||
{
|
||||
return JsonPack.GetJson(ClubIds);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 从Json字符串获取加入的俱乐部Id集合对象 ,从数据库取出后调用
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<int> GetClubIdsByJSON()
|
||||
{
|
||||
return string.IsNullOrWhiteSpace(JoinInLeagueMatchClubs) ? null : JsonPack.GetData<List<int>>(JoinInLeagueMatchClubs);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 联赛禁桌对象。
|
||||
/// </summary>
|
||||
public class LeagueMatchBanDesk
|
||||
{
|
||||
/// <summary>
|
||||
/// 自增Id 主键
|
||||
/// </summary>
|
||||
public int LeagueMatchBanDeskId;
|
||||
|
||||
/// <summary>
|
||||
/// 玩法ID
|
||||
/// </summary>
|
||||
public string WayId;
|
||||
|
||||
/// <summary>
|
||||
/// 存数据库 Json 数据
|
||||
/// </summary>
|
||||
public string JSONString;
|
||||
|
||||
/// <summary>
|
||||
/// 被禁桌的俱乐部集合
|
||||
/// </summary>
|
||||
public List<int> ClubIds;
|
||||
|
||||
/// <summary>
|
||||
/// 返回存数据库的JSon 字符串,存数据库前调用
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string GetClubsToString()
|
||||
{
|
||||
return JsonPack.GetJson(ClubIds);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 从Json字符串获取加入的俱乐部Id集合对象 ,从数据库取出后调用
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<int> GetClubIdsByJSON()
|
||||
{
|
||||
return string.IsNullOrWhiteSpace(JSONString) ? null : JsonPack.GetData<List<int>>(JSONString);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 联赛俱乐部积分统计
|
||||
/// </summary>
|
||||
public class LeagueMatchClubScore : ClubLeagueBaseScoreInfo,ICloneable
|
||||
{
|
||||
/// <summary>
|
||||
/// 联赛俱乐部ID
|
||||
/// </summary>
|
||||
public int LeagueClubId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 联盟比赛的Id
|
||||
/// </summary>
|
||||
public int MatchId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 自增Id 主键 (Old)
|
||||
/// </summary>
|
||||
public int LeagueMatchClubScoreId;
|
||||
|
||||
/// <summary>
|
||||
/// 数据更新时间
|
||||
/// </summary>
|
||||
public DateTime UpdateTime { get; set; }
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
return this.MemberwiseClone();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 俱乐部退赛数据
|
||||
/// </summary>
|
||||
public class LeagueMatchClubExitScore : LeagueMatchClubScore
|
||||
{
|
||||
/// <summary>
|
||||
/// 俱乐部解禁Id (时间戳 秒级)
|
||||
/// </summary>
|
||||
public long ReliefId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 颁奖Id
|
||||
/// </summary>
|
||||
public long AwardId { get; set;}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 颁奖记录
|
||||
/// </summary>
|
||||
public class AwardRecord : ClubLeagueBaseScoreInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 比赛Id--索引
|
||||
/// </summary>
|
||||
public int ClubMatchId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 自增Id 主键
|
||||
/// </summary>
|
||||
//public int AwardRecordId;
|
||||
|
||||
/// <summary>
|
||||
/// 颁奖的时间chuo
|
||||
/// </summary>
|
||||
public long RecordId { get; set;}
|
||||
|
||||
/// <summary>
|
||||
/// 序号 --排序使用
|
||||
/// </summary>
|
||||
public int Index { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 时间
|
||||
/// </summary>
|
||||
public DateTime CreateTime { get; set; }
|
||||
}
|
||||
|
||||
public class ClubLeagueBaseScoreInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 俱乐部名字
|
||||
/// </summary>
|
||||
public string ClubName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 俱乐部Id
|
||||
/// </summary>
|
||||
public int ClubId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 有效耗卡
|
||||
/// </summary>
|
||||
public decimal CardScore { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 活跃积分-群主赚的房费
|
||||
/// </summary>
|
||||
public decimal DeskScore { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 成员总积分
|
||||
/// </summary>
|
||||
public decimal ClubUserSumScore { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 参与房间数量
|
||||
/// </summary>
|
||||
public int JoinRoom { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 联盟的活跃积分
|
||||
/// </summary>
|
||||
public decimal LeagueScore { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 俱乐部生存任务
|
||||
/// </summary>
|
||||
public class LeagueClubLiveTask
|
||||
{
|
||||
/// <summary>
|
||||
/// 自增Id 主键
|
||||
/// </summary>
|
||||
public int LeagueClubLiveTaskId;
|
||||
|
||||
/// <summary>
|
||||
/// 俱乐部Id
|
||||
/// </summary>
|
||||
public int ClubId;
|
||||
|
||||
/// <summary>
|
||||
/// 任务的分值 0是不限制
|
||||
/// </summary>
|
||||
public int TaskScore;
|
||||
|
||||
/// <summary>
|
||||
/// 是否是激活状态 false没有生效
|
||||
/// </summary>
|
||||
public bool IsActive
|
||||
{
|
||||
get
|
||||
{
|
||||
return TaskScore != 0;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 默认生存积分 0是没有默认积分
|
||||
/// </summary>
|
||||
public int DefaultScore;
|
||||
}
|
||||
}
|
||||
1187
ObjectModel/Club/ClubMatch.cs
Normal file
1187
ObjectModel/Club/ClubMatch.cs
Normal file
@ -0,0 +1,1187 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Xml.Serialization;
|
||||
using GameData;
|
||||
using GameMessage;
|
||||
using MrWu.Time;
|
||||
using Server;
|
||||
using Debug = MrWu.Debug.Debug;
|
||||
using GameData.Club;
|
||||
|
||||
namespace ObjectModel.Club
|
||||
{
|
||||
/// <summary>
|
||||
/// 俱乐部比赛 表实体
|
||||
/// </summary>
|
||||
public class ClubMatch
|
||||
{
|
||||
/// <summary>
|
||||
/// 联赛的俱乐部比赛数据
|
||||
/// </summary>
|
||||
public ClubMatch LeagueClubMatch;
|
||||
|
||||
/// <summary>
|
||||
/// 开启中
|
||||
/// </summary>
|
||||
public bool IsOpening;
|
||||
|
||||
/// <summary>
|
||||
/// 自增ID 主键 0是新增 其他是修改
|
||||
/// </summary>
|
||||
public int ClubMatchId;
|
||||
|
||||
/// <summary>
|
||||
/// 俱乐部Id 索引
|
||||
/// </summary>
|
||||
public int ClubId;
|
||||
|
||||
/// <summary>
|
||||
/// 比赛名称
|
||||
/// </summary>
|
||||
public string ClubMatchName;
|
||||
|
||||
private DateTime _MatchStartTime;
|
||||
|
||||
/// <summary>
|
||||
/// 比赛开始时间
|
||||
/// </summary>
|
||||
public DateTime MatchStartTime
|
||||
{
|
||||
get
|
||||
{
|
||||
if (LeagueClubMatch != null)
|
||||
{
|
||||
return LeagueClubMatch.MatchStartTime;
|
||||
}
|
||||
return _MatchStartTime;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (LeagueClubMatch != null)
|
||||
{
|
||||
Debug.Error("MatchStartTime 当前比赛数据属于联赛,不能修改!");
|
||||
}
|
||||
|
||||
_MatchStartTime = value;
|
||||
}
|
||||
}
|
||||
|
||||
private DateTime _MatchEndTime;
|
||||
|
||||
/// <summary>
|
||||
/// 比赛结束时间
|
||||
/// </summary>
|
||||
public DateTime MatchEndTime
|
||||
{
|
||||
get
|
||||
{
|
||||
if (LeagueClubMatch != null)
|
||||
{
|
||||
return LeagueClubMatch.MatchEndTime;
|
||||
}
|
||||
|
||||
return _MatchEndTime;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (LeagueClubMatch != null)
|
||||
{
|
||||
Debug.Error("MatchEndTime 当前比赛数据属于联赛,不能修改!");
|
||||
}
|
||||
|
||||
_MatchEndTime = value;
|
||||
}
|
||||
}
|
||||
|
||||
private int _DieOutNum;
|
||||
|
||||
/// <summary>
|
||||
/// 比赛淘汰分值
|
||||
/// </summary>
|
||||
public int DieOutNum
|
||||
{
|
||||
get
|
||||
{
|
||||
if (LeagueClubMatch != null)
|
||||
{
|
||||
return LeagueClubMatch.DieOutNum;
|
||||
}
|
||||
|
||||
return _DieOutNum;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (LeagueClubMatch != null)
|
||||
{
|
||||
Debug.Error("DieOutNum 当前比赛的数据属于联赛,不能修改!");
|
||||
}
|
||||
|
||||
_DieOutNum = value;
|
||||
}
|
||||
}
|
||||
|
||||
private DateTime _CreateTime;
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
public DateTime CreateTime {
|
||||
get
|
||||
{
|
||||
if (LeagueClubMatch != null)
|
||||
{
|
||||
return LeagueClubMatch.CreateTime;
|
||||
}
|
||||
|
||||
return _CreateTime;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (LeagueClubMatch != null)
|
||||
{
|
||||
Debug.Error("CreateTime 当前比赛的数据属于联赛,不能修改!");
|
||||
}
|
||||
_CreateTime = value;
|
||||
}
|
||||
}
|
||||
|
||||
private int _StatusFlag;
|
||||
|
||||
/// <summary>
|
||||
/// 比赛状态 1比赛中 2结束
|
||||
/// </summary>
|
||||
public int StatusFlag
|
||||
{
|
||||
get
|
||||
{
|
||||
if (LeagueClubMatch != null)
|
||||
{
|
||||
return LeagueClubMatch.StatusFlag;
|
||||
}
|
||||
return _StatusFlag;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (LeagueClubMatch != null)
|
||||
{
|
||||
Debug.Error("StatusFlag 当前比赛数据属于联赛,不能修改!");
|
||||
}
|
||||
|
||||
_StatusFlag = value;
|
||||
}
|
||||
}
|
||||
|
||||
private bool _AutoOpen;
|
||||
|
||||
/// <summary>
|
||||
/// 是否自动开启下一场比赛
|
||||
/// </summary>
|
||||
public bool AutoOpen
|
||||
{
|
||||
get
|
||||
{
|
||||
if (LeagueClubMatch != null)
|
||||
{
|
||||
return LeagueClubMatch.AutoOpen;
|
||||
}
|
||||
|
||||
return _AutoOpen;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (LeagueClubMatch != null)
|
||||
{
|
||||
Debug.Error("AutoOpen 当前比赛数据属于联赛,不能修改!");
|
||||
}
|
||||
|
||||
_AutoOpen = value;
|
||||
}
|
||||
}
|
||||
|
||||
private int _HowTopUser;
|
||||
|
||||
/// <summary>
|
||||
/// --前多少名正数玩家自动进入下一轮比赛
|
||||
/// 该值表示是否是联赛,小于0是联赛,该值存储了联赛的ClubId
|
||||
/// </summary>
|
||||
public int HowTopUser
|
||||
{
|
||||
get
|
||||
{
|
||||
if (LeagueClubMatch != null)
|
||||
{
|
||||
return LeagueClubMatch.HowTopUser;
|
||||
}
|
||||
|
||||
return _HowTopUser;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (LeagueClubMatch != null)
|
||||
{
|
||||
Debug.Error("HowTopUser 当前比赛数据属于联赛,不能修改!");
|
||||
}
|
||||
|
||||
_HowTopUser = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 第几场比赛
|
||||
/// </summary>
|
||||
public int Round;
|
||||
|
||||
private int _MatchRate;
|
||||
|
||||
/// <summary>
|
||||
/// 比赛频率 单位为天
|
||||
/// </summary>
|
||||
public int MatchRate
|
||||
{
|
||||
get
|
||||
{
|
||||
if (LeagueClubMatch != null)
|
||||
{
|
||||
return LeagueClubMatch.MatchRate;
|
||||
}
|
||||
|
||||
return _MatchRate;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (LeagueClubMatch != null)
|
||||
{
|
||||
Debug.Error("MatchRate 当前比赛数据属于联赛,不能修改!");
|
||||
}
|
||||
|
||||
_MatchRate = value;
|
||||
}
|
||||
}
|
||||
|
||||
private int _VisibleDesk;
|
||||
|
||||
/// <summary>
|
||||
/// 普通成员显示的桌子数量
|
||||
/// </summary>
|
||||
public int VisibleDesk
|
||||
{
|
||||
get
|
||||
{
|
||||
if (LeagueClubMatch != null)
|
||||
{
|
||||
return LeagueClubMatch._VisibleDesk;
|
||||
}
|
||||
|
||||
return _VisibleDesk;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (LeagueClubMatch != null)
|
||||
{
|
||||
Debug.Error("VisibleDesk 当前比赛数据属于联赛,不能修改!");
|
||||
}
|
||||
|
||||
_VisibleDesk = value;
|
||||
}
|
||||
}
|
||||
|
||||
private byte _isOnlyVisibleMyClub;
|
||||
|
||||
/// <summary>
|
||||
/// 是否只显示自己俱乐部的桌子--只有联赛才会能体现出这个设置
|
||||
/// 1不是 0是显示自己俱乐部的桌子
|
||||
/// </summary>
|
||||
public byte isOnlyVisibleMyClub
|
||||
{
|
||||
get
|
||||
{
|
||||
if (LeagueClubMatch != null)
|
||||
{
|
||||
return LeagueClubMatch._isOnlyVisibleMyClub;
|
||||
}
|
||||
|
||||
return _isOnlyVisibleMyClub;
|
||||
}
|
||||
set
|
||||
{
|
||||
_isOnlyVisibleMyClub = value;
|
||||
}
|
||||
}
|
||||
|
||||
private byte _isVisibleScoreBak;
|
||||
|
||||
/// <summary>
|
||||
/// 是否显示淘汰分 1显示 0不显示(默认)
|
||||
/// </summary>
|
||||
public byte isVisibleScoreBak
|
||||
{
|
||||
get
|
||||
{
|
||||
if (LeagueClubMatch != null)
|
||||
{
|
||||
return LeagueClubMatch._isVisibleScoreBak;
|
||||
}
|
||||
return _isVisibleScoreBak;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (LeagueClubMatch != null)
|
||||
{
|
||||
Debug.Error("isVisibleScoreBak 当前比赛数据属于联赛,不能修改!");
|
||||
}
|
||||
_isVisibleScoreBak = value;
|
||||
}
|
||||
}
|
||||
|
||||
private byte _isScoreReset;
|
||||
|
||||
/// <summary>
|
||||
/// 每轮比赛开始积分是否清零 1清零 0不清零(默认)
|
||||
/// </summary>
|
||||
public byte isScoreReset
|
||||
{
|
||||
get
|
||||
{
|
||||
if (LeagueClubMatch != null)
|
||||
{
|
||||
return LeagueClubMatch._isScoreReset;
|
||||
}
|
||||
return _isScoreReset;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (LeagueClubMatch != null)
|
||||
{
|
||||
Debug.Error("isScoreReset 当前比赛数据属于联赛,不能修改!");
|
||||
}
|
||||
_isScoreReset = value;
|
||||
}
|
||||
}
|
||||
|
||||
private List<MatchPlayWay> _MatchPlayWays = new List<MatchPlayWay>();
|
||||
|
||||
/// <summary>
|
||||
/// 比赛关联的玩法 数据库这个字段用string存储 MatchPlayWayId,用逗号分隔。
|
||||
/// </summary>
|
||||
public List<MatchPlayWay> MatchPlayWays
|
||||
{
|
||||
get
|
||||
{
|
||||
if (LeagueClubMatch != null)
|
||||
{
|
||||
return LeagueClubMatch.MatchPlayWays;
|
||||
}
|
||||
return _MatchPlayWays;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (LeagueClubMatch != null)
|
||||
{
|
||||
Debug.Error("MatchPlayWays 当前比赛数据属于联赛,不能修改!");
|
||||
}
|
||||
_MatchPlayWays = value;
|
||||
}
|
||||
}
|
||||
|
||||
public List<MatchPlayWay> _BakMatchPlayWays = new List<MatchPlayWay>();
|
||||
|
||||
/// <summary>
|
||||
/// 备份的玩法,目的是用户删除玩法然后有的玩法该玩法已经开战了,用户开战玩家计算分。
|
||||
/// 不存数据库,只在内存中。
|
||||
/// </summary>
|
||||
public List<MatchPlayWay> BakMatchPlayWays
|
||||
{
|
||||
get
|
||||
{
|
||||
if (LeagueClubMatch != null)
|
||||
{
|
||||
return LeagueClubMatch._BakMatchPlayWays;
|
||||
}
|
||||
return _BakMatchPlayWays;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (LeagueClubMatch != null)
|
||||
{
|
||||
Debug.Error("BakMatchPlayWays 当前比赛数据属于联赛,不能修改!");
|
||||
}
|
||||
_BakMatchPlayWays = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 存储比赛其他设置的Json数据
|
||||
/// </summary>
|
||||
public string JsonData;
|
||||
|
||||
/// <summary>
|
||||
/// 比赛账号转换联赛账号的基数
|
||||
/// </summary>
|
||||
const int ConstNum = 10000;
|
||||
|
||||
private MatchOtherSetting _matchOtherSetting = new MatchOtherSetting();
|
||||
|
||||
/// <summary>
|
||||
/// 比赛其他设置
|
||||
/// </summary>
|
||||
public MatchOtherSetting matchOtherSetting
|
||||
{
|
||||
get
|
||||
{
|
||||
if (LeagueClubMatch != null)
|
||||
{
|
||||
return LeagueClubMatch._matchOtherSetting;
|
||||
}
|
||||
return _matchOtherSetting;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (LeagueClubMatch != null)
|
||||
{
|
||||
Debug.Error("matchOtherSetting 当前比赛数据属于联赛,不能修改!");
|
||||
}
|
||||
_matchOtherSetting = value;
|
||||
}
|
||||
}
|
||||
|
||||
public void InitOtherSetting()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(JsonData))
|
||||
{
|
||||
matchOtherSetting = JsonPack.GetData<MatchOtherSetting>(JsonData);
|
||||
}
|
||||
}
|
||||
|
||||
public MatchOtherSetting CopyMatchOtherSetting()
|
||||
{
|
||||
string jsondata = GetJsonData();
|
||||
return JsonPack.GetData<MatchOtherSetting>(jsondata);
|
||||
}
|
||||
|
||||
public string GetJsonData()
|
||||
{
|
||||
if (matchOtherSetting == null)
|
||||
{
|
||||
matchOtherSetting = new MatchOtherSetting();
|
||||
}
|
||||
return JsonPack.GetJsonNoIgnore(matchOtherSetting);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取联赛账号 5位数数字
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetLeagueUserName(int clubMatchId)
|
||||
{
|
||||
return clubMatchId + ConstNum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据联赛账号返回比赛ID
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetClubMatchId(int leagueUserNameNumber)
|
||||
{
|
||||
return leagueUserNameNumber - ConstNum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 返回对象
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static ClubMatch GetInstance(CreateClubMatchPack request, ClubMatch oldClubMatch, bool IsLeague = false)
|
||||
{
|
||||
DateTime endTime = DateTime.Now.Date.AddDays(request.MatchRate).AddHours(request.MatchStartTime.Hour).AddMinutes(request.MatchStartTime.Minute);
|
||||
return new ClubMatch()
|
||||
{
|
||||
ClubMatchId = 0,
|
||||
ClubId = request.ClubId,
|
||||
ClubMatchName = request.ClubMatchName ?? $"{(IsLeague ? "竞技联赛" : "竞技赛")}第{GetFromRound(oldClubMatch == null ? 1 : oldClubMatch.Round + 1)}轮",
|
||||
MatchStartTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, request.MatchStartTime.Hour, request.MatchStartTime.Minute, 0),
|
||||
MatchEndTime = endTime,
|
||||
DieOutNum = request.DieOutNum,
|
||||
CreateTime = DateTime.Now,
|
||||
StatusFlag = 1,
|
||||
AutoOpen = request.AutoOpen,
|
||||
HowTopUser = request.HowTopUser,
|
||||
Round = oldClubMatch == null ? 1 : oldClubMatch.Round + 1,
|
||||
MatchRate = request.MatchRate,
|
||||
MatchPlayWays = MatchPlayWay.GetInstances(request),
|
||||
VisibleDesk = request.VisibleDesk,
|
||||
isOnlyVisibleMyClub = request.isOnlyVisibleMyClub,
|
||||
isScoreReset = request.isScoreReset,
|
||||
isVisibleScoreBak = request.isVisibleScoreBak
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取界面上显示的比赛轮次
|
||||
/// </summary>
|
||||
/// <param name="round"></param>
|
||||
/// <returns></returns>
|
||||
public static int GetFromRound(int round)
|
||||
{
|
||||
return (round % 5) + 1;
|
||||
}
|
||||
|
||||
private static string GetClubMatchName(bool isLeague,int round)
|
||||
{
|
||||
return $"{(isLeague ? "竞技联赛" : "竞技赛")}第{GetFromRound(round + 1)}轮";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 返回下一轮新比赛的对象
|
||||
/// </summary>
|
||||
/// <param name="oldClubMatch"></param>
|
||||
/// <returns></returns>
|
||||
public static ClubMatch GetNexMatchObject(ClubMatch oldClubMatch, bool isLeague = false)
|
||||
{
|
||||
if (oldClubMatch == null) return null;
|
||||
DateTime endTime = DateTime.Now.Date.AddDays(oldClubMatch.MatchRate).AddHours(oldClubMatch.MatchEndTime.Hour).AddMinutes(oldClubMatch.MatchEndTime.Minute);
|
||||
var result = new ClubMatch();
|
||||
result.ClubMatchId = 0;
|
||||
result.ClubId = oldClubMatch.ClubId;
|
||||
result.ClubMatchName = GetClubMatchName(isLeague, oldClubMatch.Round);
|
||||
result.MatchStartTime = DateTime.Now;
|
||||
result.MatchEndTime = endTime;
|
||||
result.DieOutNum = oldClubMatch.DieOutNum;
|
||||
result.CreateTime = DateTime.Now;
|
||||
result.StatusFlag = 1;
|
||||
result.AutoOpen = oldClubMatch.AutoOpen;
|
||||
result.HowTopUser = oldClubMatch.HowTopUser;
|
||||
result.Round = oldClubMatch.Round + 1;
|
||||
result.MatchRate = oldClubMatch.MatchRate;
|
||||
result.MatchPlayWays = oldClubMatch.MatchPlayWays;
|
||||
result.VisibleDesk = oldClubMatch.VisibleDesk;
|
||||
result.isOnlyVisibleMyClub = oldClubMatch.isOnlyVisibleMyClub;
|
||||
result.isVisibleScoreBak = oldClubMatch.isVisibleScoreBak;
|
||||
result.isScoreReset = oldClubMatch.isScoreReset;
|
||||
result.matchOtherSetting = oldClubMatch.CopyMatchOtherSetting();
|
||||
if (result.MatchPlayWays != null)
|
||||
{
|
||||
foreach (var item in result.MatchPlayWays)
|
||||
{
|
||||
item.ClubMatchId = 0;
|
||||
item.MatchPlayWayId = 0;
|
||||
if (item.MaxWinnerScoreRanges != null)
|
||||
{
|
||||
foreach (var itemChid in item.MaxWinnerScoreRanges)
|
||||
{
|
||||
itemChid.MatchPlayWayId = 0;
|
||||
itemChid.MaxWinnerScoreRangeId = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据联赛返回 比赛对象
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static ClubMatch GetClubMatchByLeagueMatch(ClubMatch leagueMatch,ClubMatch originMatch,int clubId, int round)
|
||||
{
|
||||
if (leagueMatch == null) return null;
|
||||
var result = new ClubMatch();
|
||||
result.ClubMatchName = leagueMatch.ClubMatchName; //比赛名称不能乱改,必须与联赛一致,使用了名字做逻辑
|
||||
result.LeagueClubMatch = leagueMatch;
|
||||
result.ClubMatchId = 0;
|
||||
result.ClubId = clubId;
|
||||
result.Round = round + 1;
|
||||
return result;
|
||||
}
|
||||
|
||||
public static ClubMatchInfoResponse GetClubMatchInfoResponse(ClubMatch clubMatch)
|
||||
{
|
||||
ClubMatchInfoResponse response = new ClubMatchInfoResponse();
|
||||
|
||||
response.ClubId = clubMatch.ClubId;
|
||||
response.MatchStartTime = DateTimeHelper.DateTime2TimeStamp(clubMatch.MatchStartTime);
|
||||
response.MatchInfoName = clubMatch.ClubMatchName;
|
||||
response.MatchEndTime = DateTimeHelper.DateTime2TimeStamp(clubMatch.MatchEndTime);
|
||||
response.MatchRate = clubMatch.MatchRate;
|
||||
response.DieOutNum = clubMatch.DieOutNum;
|
||||
response.AutoOpen = clubMatch.AutoOpen;
|
||||
response.LeagueClubId = clubMatch.HowTopUser;
|
||||
response.VisibleDesk = clubMatch.VisibleDesk;
|
||||
response.IsOnlyVisibleMyClub = clubMatch.isOnlyVisibleMyClub;
|
||||
response.IsScoreReset = clubMatch.isScoreReset;
|
||||
response.IsVisibleScoreBak = clubMatch.isVisibleScoreBak;
|
||||
response.LeagueUserNameNumber = ClubMatch.GetLeagueUserName(clubMatch.ClubMatchId);
|
||||
response.MatchPlayWayInfos = MatchPlayWay.GetMatchPlayWayInfos(clubMatch.MatchPlayWays);
|
||||
return response;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 返回输出对象
|
||||
/// </summary>
|
||||
/// <param name="oldClubMatch"></param>
|
||||
/// <returns></returns>
|
||||
public static CreateClubMatchPack GetCreateClubMatchResponse(ClubMatch oldClubMatch)
|
||||
{
|
||||
return new CreateClubMatchPack
|
||||
{
|
||||
ClubId = oldClubMatch.ClubId,
|
||||
MatchStartTime = oldClubMatch.MatchStartTime,
|
||||
ClubMatchName = oldClubMatch.ClubMatchName,
|
||||
MatchEndTime = oldClubMatch.MatchEndTime,
|
||||
MatchRate = oldClubMatch.MatchRate,
|
||||
DieOutNum = oldClubMatch.DieOutNum,
|
||||
AutoOpen = oldClubMatch.AutoOpen,
|
||||
HowTopUser = oldClubMatch.HowTopUser,
|
||||
VisibleDesk = oldClubMatch.VisibleDesk,
|
||||
isOnlyVisibleMyClub = oldClubMatch.isOnlyVisibleMyClub,
|
||||
isScoreReset = oldClubMatch.isScoreReset,
|
||||
isVisibleScoreBak = oldClubMatch.isVisibleScoreBak,
|
||||
LeagueUserNameNumber = ClubMatch.GetLeagueUserName(oldClubMatch.ClubMatchId),
|
||||
MatchPlayWays = MatchPlayWay.GetMatchPlayWayPacks(oldClubMatch.MatchPlayWays)
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 返回对象
|
||||
/// </summary>
|
||||
/// <param name="obj"></param>
|
||||
/// <returns></returns>
|
||||
public static ClubMatchInfo GetMatchInfoInstance(ClubMatch obj)
|
||||
{
|
||||
return new ClubMatchInfo
|
||||
{
|
||||
ClubMatchId = obj.ClubMatchId,
|
||||
ClubMatchName = obj.ClubMatchName,
|
||||
ClubId = obj.ClubId,
|
||||
StatusFlag = obj.StatusFlag,
|
||||
MatchStartTime = obj.MatchStartTime,
|
||||
MatchEndTime = obj.MatchEndTime
|
||||
};
|
||||
}
|
||||
|
||||
public static ClubMatchData GetMatchDataInstance(ClubMatch obj)
|
||||
{
|
||||
ClubMatchData data = new ClubMatchData();
|
||||
data.ClubMatchId = obj.ClubMatchId;
|
||||
data.ClubId = obj.ClubId;
|
||||
data.ClubMatchName = obj.ClubMatchName;
|
||||
data.MatchStartTime = DateTimeHelper.DateTime2TimeStamp(obj.MatchStartTime);
|
||||
data.MatchEndTime = DateTimeHelper.DateTime2TimeStamp(obj.MatchEndTime);
|
||||
data.StatusFlag = obj.StatusFlag;
|
||||
return data;
|
||||
}
|
||||
|
||||
public void Copy2LeagueMatch()
|
||||
{
|
||||
ClubMatch leagueClubMatch = this.LeagueClubMatch;
|
||||
this.LeagueClubMatch = null;
|
||||
this._MatchStartTime = leagueClubMatch._MatchStartTime;
|
||||
this._MatchEndTime = leagueClubMatch._MatchEndTime;
|
||||
this._DieOutNum = leagueClubMatch._DieOutNum;
|
||||
this._CreateTime = leagueClubMatch._CreateTime;
|
||||
this._StatusFlag = leagueClubMatch._StatusFlag;
|
||||
this._AutoOpen = leagueClubMatch._AutoOpen;
|
||||
this._HowTopUser = leagueClubMatch._HowTopUser;
|
||||
this._MatchRate = leagueClubMatch._MatchRate;
|
||||
this._VisibleDesk = leagueClubMatch._VisibleDesk;
|
||||
this._isOnlyVisibleMyClub = leagueClubMatch._isOnlyVisibleMyClub;
|
||||
this._isVisibleScoreBak = leagueClubMatch._isVisibleScoreBak;
|
||||
this._isScoreReset = leagueClubMatch._isScoreReset;
|
||||
this._MatchPlayWays = leagueClubMatch._MatchPlayWays;
|
||||
this._BakMatchPlayWays = leagueClubMatch._BakMatchPlayWays;
|
||||
this._matchOtherSetting = leagueClubMatch._matchOtherSetting;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 比赛其他设置
|
||||
/// </summary>
|
||||
public class MatchOtherSetting
|
||||
{
|
||||
/// <summary>
|
||||
/// 重赛限制 --重赛审核中的用户无法在本联赛任何俱乐部参与比赛 false不限制 true限制 默认不限制
|
||||
/// </summary>
|
||||
public bool ReplayRestrictions;
|
||||
/// <summary>
|
||||
/// 生存任务限制 --下一轮比赛开始时生存任务调整为默认值
|
||||
/// </summary>
|
||||
public bool LiveTaskRestrictions;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 比赛玩法 表实体对象
|
||||
/// </summary>
|
||||
public class MatchPlayWay
|
||||
{
|
||||
/// <summary>
|
||||
/// 自增Id 主键
|
||||
/// </summary>
|
||||
public int MatchPlayWayId;
|
||||
|
||||
/// <summary>
|
||||
/// 所属竞技比赛 组合索引I_MatchPlayWay_ClubIdClubMatchId 1
|
||||
/// </summary>
|
||||
public int ClubId;
|
||||
|
||||
/// <summary>
|
||||
/// 比赛Id 外键 组合索引I_MatchPlayWay_ClubIdClubMatchId 2
|
||||
/// </summary>
|
||||
public int ClubMatchId;
|
||||
|
||||
/// <summary>
|
||||
/// 玩法的唯一码
|
||||
/// </summary>
|
||||
public string weiyima;
|
||||
|
||||
/// <summary>
|
||||
/// 最低分数限制,玩家低于此分不能进入桌子
|
||||
/// </summary>
|
||||
public int MinScore;
|
||||
|
||||
/// <summary>
|
||||
/// 桌费数值 AA
|
||||
/// </summary>
|
||||
public int DeskCost;
|
||||
|
||||
/// <summary>
|
||||
/// 消耗方式 1AA 2大赢家
|
||||
/// </summary>
|
||||
public int TypeMode;
|
||||
|
||||
/// <summary>
|
||||
/// 最低分值免收桌费 AA
|
||||
/// </summary>
|
||||
public int MinFreeDeskCostNum;
|
||||
|
||||
/// <summary>
|
||||
/// 是否第一局结束前解散不计房费 true是不计 false 否计算
|
||||
/// </summary>
|
||||
public bool IsFirstCalcDeskCost;
|
||||
|
||||
/// <summary>
|
||||
/// 小局低于多少分解散桌子
|
||||
/// </summary>
|
||||
public int BuresMinScore;
|
||||
|
||||
/// <summary>
|
||||
/// 是否开启小局低于多少分解散房间
|
||||
/// </summary>
|
||||
public bool IsBuresMin;
|
||||
|
||||
/// <summary>
|
||||
/// 是否开启 解散房间按实际局数计算比赛消耗
|
||||
/// </summary>
|
||||
public bool IsRealCalcScore;
|
||||
|
||||
/// <summary>
|
||||
/// 大赢家消耗规则
|
||||
/// </summary>
|
||||
public List<MaxWinnerScoreRange> MaxWinnerScoreRanges;
|
||||
|
||||
/// <summary>
|
||||
/// 每次比赛联赛活跃积分
|
||||
/// </summary>
|
||||
public decimal LeagueDeskScore;
|
||||
|
||||
/// <summary>
|
||||
/// 深复制对象
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="obj"></param>
|
||||
/// <returns></returns>
|
||||
public static T DeepCopy<T>(T obj)
|
||||
{
|
||||
object retval;
|
||||
using (MemoryStream ms = new MemoryStream())
|
||||
{
|
||||
XmlSerializer xml = new XmlSerializer(typeof(T));
|
||||
xml.Serialize(ms, obj);
|
||||
ms.Seek(0, SeekOrigin.Begin);
|
||||
retval = xml.Deserialize(ms);
|
||||
ms.Close();
|
||||
}
|
||||
return (T)retval;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
public static List<MatchPlayWay> GetInstances(CreateClubMatchPack request)
|
||||
{
|
||||
var result = new List<MatchPlayWay>();
|
||||
if (request.MatchPlayWays == null || request.MatchPlayWays.Count < 1)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
foreach (var item in request.MatchPlayWays)
|
||||
{
|
||||
result.Add(new MatchPlayWay
|
||||
{
|
||||
MatchPlayWayId = 0,
|
||||
ClubId = request.ClubId,
|
||||
ClubMatchId = 0,//新增的时候要赋值
|
||||
weiyima = item.weiyima,
|
||||
MinScore = item.MinScore,
|
||||
DeskCost = item.DeskCost,
|
||||
TypeMode = item.TypeMode,
|
||||
MinFreeDeskCostNum = item.MinFreeDeskCostNum,
|
||||
IsBuresMin = item.IsBuresMin,
|
||||
IsFirstCalcDeskCost = item.IsFirstCalcDeskCost,
|
||||
IsRealCalcScore = item.IsRealCalcScore,
|
||||
BuresMinScore = item.BuresMinScore,
|
||||
MaxWinnerScoreRanges = item.MaxWinnerScoreRanges,
|
||||
LeagueDeskScore = item.LeagueDeskScore
|
||||
});
|
||||
}
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 生成一个默认的玩法
|
||||
/// </summary>
|
||||
/// <param name="playWay"></param>
|
||||
/// <param name="clubMatch"></param>
|
||||
/// <returns></returns>
|
||||
public static MatchPlayWay GetInstanceByPlayWay(PlayWay playWay, ClubMatch clubMatch)
|
||||
{
|
||||
return new MatchPlayWay()
|
||||
{
|
||||
MatchPlayWayId = 0,
|
||||
ClubId = playWay.Clubid,
|
||||
ClubMatchId = clubMatch.ClubMatchId,
|
||||
weiyima = playWay.weiyima,
|
||||
MinScore = clubMatch.DieOutNum,
|
||||
DeskCost = 5,
|
||||
TypeMode = 2,
|
||||
MinFreeDeskCostNum = 10,
|
||||
IsBuresMin = true,
|
||||
IsFirstCalcDeskCost = true,
|
||||
IsRealCalcScore = true,
|
||||
BuresMinScore = clubMatch.DieOutNum,
|
||||
MaxWinnerScoreRanges = new List<MaxWinnerScoreRange>() {
|
||||
new MaxWinnerScoreRange{ MatchPlayWayId=0, MaxWinnerScoreRangeId=0, DeskScore=5,
|
||||
MaxWinnerMinScore=0}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取玩法
|
||||
/// </summary>
|
||||
/// <param name="matchPlayWays"></param>
|
||||
/// <returns></returns>
|
||||
public static List<MatchPlayWayInfo> GetMatchPlayWayInfos(List<MatchPlayWay> matchPlayWays)
|
||||
{
|
||||
List<MatchPlayWayInfo> result = new List<MatchPlayWayInfo>();
|
||||
if (matchPlayWays == null || matchPlayWays.Count < 1)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
foreach (var item in matchPlayWays)
|
||||
{
|
||||
result.Add(new MatchPlayWayInfo
|
||||
{
|
||||
WeiYiMa = item.weiyima,
|
||||
MinScore = item.MinScore,
|
||||
DeskCost = item.DeskCost,
|
||||
TypeMode = item.TypeMode,
|
||||
MinFreeDeskCostNum = item.MinFreeDeskCostNum,
|
||||
IsBuresMin = item.IsBuresMin,
|
||||
IsFirstCalcDeskCost = item.IsFirstCalcDeskCost,
|
||||
IsRealCalcScore = item.IsRealCalcScore,
|
||||
BuresMinScore = item.BuresMinScore,
|
||||
MaxWinnerScoreRanges = Convert2MatchMaxWinnerScoreRanges(item.MaxWinnerScoreRanges),
|
||||
LeagueDeskScore = (double)item.LeagueDeskScore
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private static List<MatchMaxWinnerScoreRange> Convert2MatchMaxWinnerScoreRanges(List<MaxWinnerScoreRange> maxWinnerScoreRanges)
|
||||
{
|
||||
List<MatchMaxWinnerScoreRange> result = new List<MatchMaxWinnerScoreRange>();
|
||||
foreach (var item in maxWinnerScoreRanges)
|
||||
{
|
||||
result.Add(MaxWinnerScoreRange2MatchMaxWinnerScoreRange(item));
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
//todo 优化使用引用池
|
||||
private static MatchMaxWinnerScoreRange MaxWinnerScoreRange2MatchMaxWinnerScoreRange(MaxWinnerScoreRange maxWinnerScoreRange)
|
||||
{
|
||||
MatchMaxWinnerScoreRange range = new MatchMaxWinnerScoreRange();
|
||||
range.DeskScore = maxWinnerScoreRange.DeskScore;
|
||||
range.MaxWinnerMinScore = maxWinnerScoreRange.MaxWinnerMinScore;
|
||||
return range;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取玩法
|
||||
/// </summary>
|
||||
/// <param name="matchPlayWays"></param>
|
||||
/// <returns></returns>
|
||||
public static List<MatchPlayWayPack> GetMatchPlayWayPacks(List<MatchPlayWay> matchPlayWays)
|
||||
{
|
||||
var result = new List<MatchPlayWayPack>();
|
||||
if (matchPlayWays == null || matchPlayWays.Count < 1)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
foreach (var item in matchPlayWays)
|
||||
{
|
||||
result.Add(new MatchPlayWayPack
|
||||
{
|
||||
weiyima = item.weiyima,
|
||||
MinScore = item.MinScore,
|
||||
DeskCost = item.DeskCost,
|
||||
TypeMode = item.TypeMode,
|
||||
MinFreeDeskCostNum = item.MinFreeDeskCostNum,
|
||||
IsBuresMin = item.IsBuresMin,
|
||||
IsFirstCalcDeskCost = item.IsFirstCalcDeskCost,
|
||||
IsRealCalcScore = item.IsRealCalcScore,
|
||||
BuresMinScore = item.BuresMinScore,
|
||||
MaxWinnerScoreRanges = item.MaxWinnerScoreRanges,
|
||||
LeagueDeskScore = item.LeagueDeskScore
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 积分记录
|
||||
/// </summary>
|
||||
public class ClubMatchScoreNotes
|
||||
{
|
||||
/// <summary>
|
||||
/// 自增Id 主键
|
||||
/// </summary>
|
||||
public int ScoreNotesId;
|
||||
/// <summary>
|
||||
/// 俱乐部ID 组合索引I_ScoreNotes_ClubIdClubMatchId 1
|
||||
/// </summary>
|
||||
public int ClubId;
|
||||
/// <summary>
|
||||
/// 比赛ID 组合索引I_ScoreNotes_ClubIdClubMatchId 2
|
||||
/// </summary>
|
||||
public int ClubMatchId;
|
||||
|
||||
/// <summary>
|
||||
/// 玩家Id 组合索引I_ScoreNotes_ClubIdClubMatchIdUserId 3
|
||||
/// </summary>
|
||||
public int UserId;
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
public DateTime CreateTime;
|
||||
/// <summary>
|
||||
/// 类型 1游戏结算 2群主调整比赛积分 3比赛重置 4比赛结束 5调整淘汰分
|
||||
/// </summary>
|
||||
public int TypeId;
|
||||
/// <summary>
|
||||
/// 操作的分值
|
||||
/// </summary>
|
||||
public double Score;
|
||||
|
||||
/// <summary>
|
||||
/// 这把玩家扣除的桌费--这个字段只有群主自己展示
|
||||
/// </summary>
|
||||
public double DeskScore;
|
||||
|
||||
/// <summary>
|
||||
/// 操作以后的分值
|
||||
/// </summary>
|
||||
public double NewScore;
|
||||
|
||||
/// <summary>
|
||||
/// 获取输出对象
|
||||
/// </summary>
|
||||
/// <param name="lists"></param>
|
||||
/// <returns></returns>
|
||||
public static List<UserScoreLog> GetUserScoreLogs(List<ClubMatchScoreNotes> lists)
|
||||
{
|
||||
var result = new List<UserScoreLog>();
|
||||
if (lists == null || lists.Count < 1)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
for (int i = lists.Count - 1; i >= 0; i--)
|
||||
{
|
||||
var item = lists[i];
|
||||
result.Add(new UserScoreLog
|
||||
{
|
||||
CreateTime = item.CreateTime,
|
||||
TypeId = item.TypeId,
|
||||
Score = item.Score,
|
||||
DeskScore = item.DeskScore,
|
||||
ScoreUI = item.TypeId == 1 ? item.Score - item.DeskScore : item.NewScore
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 俱乐部退赛对象
|
||||
/// </summary>
|
||||
public class ExitMatchObj
|
||||
{
|
||||
public int ClubId;
|
||||
|
||||
public List<ClubMatchUserScore> Datas;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 比赛玩家积分表
|
||||
/// </summary>
|
||||
public class ClubMatchUserScore
|
||||
{
|
||||
/// <summary>
|
||||
/// 自增Id 主键
|
||||
/// </summary>
|
||||
public int UserScoreId;
|
||||
/// <summary>
|
||||
/// 俱乐部ID 组合索引I_UserScore_ClubIdClubMatchId
|
||||
/// </summary>
|
||||
public int ClubId;
|
||||
/// <summary>
|
||||
/// 比赛ID 组合索引I_UserScore_ClubIdClubMatchId
|
||||
/// </summary>
|
||||
public int ClubMatchId;
|
||||
|
||||
/// <summary>
|
||||
/// 玩家Id
|
||||
/// </summary>
|
||||
public int UserId;
|
||||
|
||||
/// <summary>
|
||||
/// 比赛分
|
||||
/// </summary>
|
||||
public decimal Score;
|
||||
|
||||
/// <summary>
|
||||
/// 玩家提供的桌费 竞技赛活跃积分 房费/人数
|
||||
/// </summary>
|
||||
public decimal DeskScore;
|
||||
|
||||
/// <summary>
|
||||
/// 如果显示淘汰分那么就是淘汰分,如果不显示就是积分备注
|
||||
/// </summary>
|
||||
public decimal ScoreBak;
|
||||
|
||||
/// <summary>
|
||||
/// 数据更新时间
|
||||
/// </summary>
|
||||
public DateTime UpdateTime;
|
||||
|
||||
/// <summary>
|
||||
/// 获取玩家总积分
|
||||
/// </summary>
|
||||
/// <param name="isHaveScoreBak">是否显示淘汰分</param>
|
||||
/// <returns></returns>
|
||||
public decimal GetPlayScore(bool isHaveScoreBak)
|
||||
{
|
||||
if (isHaveScoreBak)
|
||||
{
|
||||
return this.Score + this.ScoreBak;
|
||||
}
|
||||
else
|
||||
{
|
||||
return this.Score;
|
||||
}
|
||||
}
|
||||
|
||||
public ClubMatchUserScore Clone()
|
||||
{
|
||||
return new ClubMatchUserScore
|
||||
{
|
||||
UserScoreId = this.UserScoreId,
|
||||
ClubId = this.ClubId,
|
||||
ClubMatchId = this.ClubMatchId,
|
||||
UserId = this.UserId,
|
||||
Score = this.Score,
|
||||
DeskScore = this.DeskScore,
|
||||
ScoreBak = this.ScoreBak
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 比赛记录
|
||||
/// </summary>
|
||||
public class ClubMatchNotes
|
||||
{
|
||||
/// <summary>
|
||||
/// 自增Id 主键
|
||||
/// </summary>
|
||||
public long ClubMatchNotesId;
|
||||
|
||||
/// <summary>
|
||||
/// 日志类型
|
||||
/// </summary>
|
||||
public MatchNotesEnum TypeId;
|
||||
|
||||
/// <summary>
|
||||
/// 俱乐部ID 组合索引I_ClubMatchNotes_ClubIdClubMatchId
|
||||
/// </summary>
|
||||
public int ClubId;
|
||||
/// <summary>
|
||||
/// 比赛ID 组合索引I_ClubMatchNotes_ClubIdClubMatchId
|
||||
/// </summary>
|
||||
public int ClubMatchId;
|
||||
|
||||
/// <summary>
|
||||
/// 产生时间
|
||||
/// </summary>
|
||||
public DateTime CreateTime;
|
||||
|
||||
/// <summary>
|
||||
/// 内容
|
||||
/// </summary>
|
||||
public string Content;
|
||||
|
||||
/// <summary>
|
||||
/// 获取输出对象
|
||||
/// </summary>
|
||||
/// <param name="lists"></param>
|
||||
/// <returns></returns>
|
||||
public static List<ClubMatchNotesLog> GetClubMatchNotes(List<ClubMatchNotes> lists)
|
||||
{
|
||||
var result = new List<ClubMatchNotesLog>();
|
||||
if (lists == null || lists.Count < 1)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
for (int i=lists.Count - 1; i >= 0; i--)
|
||||
{
|
||||
var item = lists[i];
|
||||
result.Add(new ClubMatchNotesLog
|
||||
{
|
||||
TypeId = item.TypeId,
|
||||
CreateTime = item.CreateTime,
|
||||
Content = item.Content
|
||||
});
|
||||
//Debug.Info($"发给客户端的日志:{item.Content}");
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
27
ObjectModel/Club/ClubPayCardDBEntity.cs
Normal file
27
ObjectModel/Club/ClubPayCardDBEntity.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using GameMessage;
|
||||
|
||||
namespace ObjectModel.Club
|
||||
{
|
||||
/// <summary>
|
||||
/// 俱乐部房卡转入记录
|
||||
/// </summary>
|
||||
public class ClubPayCardDBEntity
|
||||
{
|
||||
public int id {get; set;}
|
||||
|
||||
public int clubId {get; set;} // 俱乐部ID
|
||||
|
||||
public int userId {get; set;} // 用户ID
|
||||
|
||||
public int cardCount {get; set;} // 房卡数量
|
||||
|
||||
public string nickName {get; set;} // 用户昵称
|
||||
|
||||
public DateTime datetime {get; set;}
|
||||
|
||||
public int sex {get; set;} // 性别
|
||||
|
||||
public ClubPayCardOrigin origin {get; set;}
|
||||
}
|
||||
}
|
||||
76
ObjectModel/Club/ClubPlayerSettleDetail.cs
Normal file
76
ObjectModel/Club/ClubPlayerSettleDetail.cs
Normal file
@ -0,0 +1,76 @@
|
||||
using System.Collections.Generic;
|
||||
using Server.Core;
|
||||
|
||||
namespace ObjectModel.Club
|
||||
{
|
||||
/// <summary>
|
||||
/// 俱乐部玩家结算详情
|
||||
/// </summary>
|
||||
public class ClubPlayerSettleDetail : Reference
|
||||
{
|
||||
/// <summary>
|
||||
/// 大赢家列表
|
||||
/// </summary>
|
||||
public List<int> BigWinIndexs;
|
||||
|
||||
/// <summary>
|
||||
/// 大赢家用户列表
|
||||
/// </summary>
|
||||
public List<int> BigWinUserIds;
|
||||
|
||||
/// <summary>
|
||||
/// 牌局最大分数
|
||||
/// </summary>
|
||||
public decimal MaxScore;
|
||||
|
||||
/// <summary>
|
||||
/// 房主用户Id
|
||||
/// </summary>
|
||||
public int RoomOwnerUserId;
|
||||
|
||||
/// <summary>
|
||||
/// 房卡数量
|
||||
/// </summary>
|
||||
public int CardNum;
|
||||
|
||||
public static ClubPlayerSettleDetail Create()
|
||||
{
|
||||
var entity = ReferencePool.Fetch<ClubPlayerSettleDetail>();
|
||||
entity.BigWinIndexs = new List<int>();
|
||||
entity.BigWinUserIds = new List<int>();
|
||||
entity.MaxScore = -1;
|
||||
entity.RoomOwnerUserId = -1;
|
||||
entity.CardNum = 0;
|
||||
return entity;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 是否大赢家
|
||||
/// </summary>
|
||||
public bool IsBigWinByIndex(int index)
|
||||
{
|
||||
return BigWinIndexs.Contains(index);
|
||||
}
|
||||
|
||||
public bool IsBigWinByUserId(int userId)
|
||||
{
|
||||
return BigWinUserIds.Contains(userId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 是否房主
|
||||
/// </summary>
|
||||
public bool IsRoomOwner(int userId)
|
||||
{
|
||||
return RoomOwnerUserId == userId;
|
||||
}
|
||||
|
||||
public override void Dispose()
|
||||
{
|
||||
BigWinIndexs.Clear();
|
||||
BigWinUserIds.Clear();
|
||||
|
||||
ReferencePool.Recycle(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
10
ObjectModel/Club/ClubUserScoreLog.cs
Normal file
10
ObjectModel/Club/ClubUserScoreLog.cs
Normal file
@ -0,0 +1,10 @@
|
||||
using System;
|
||||
|
||||
namespace ObjectModel.Club
|
||||
{
|
||||
[Serializable]
|
||||
public class ClubUserScoreLog : ClubMatchUserScore
|
||||
{
|
||||
public FieldChangeLog ChangeLog;
|
||||
}
|
||||
}
|
||||
37
ObjectModel/Club/FieldChangeLog.cs
Normal file
37
ObjectModel/Club/FieldChangeLog.cs
Normal file
@ -0,0 +1,37 @@
|
||||
using System;
|
||||
|
||||
namespace ObjectModel.Club
|
||||
{
|
||||
public static class FieldChangeType
|
||||
{
|
||||
public const int None = 0; // 没有执行任何操作
|
||||
public const int AddOrSub = 1; // 更新
|
||||
public const int Set = 2; // 设置
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class FieldChangeLog
|
||||
{
|
||||
/// <summary>
|
||||
/// 变更类型
|
||||
/// </summary>
|
||||
public int ChangeType;
|
||||
|
||||
/// <summary>
|
||||
/// 字段名称
|
||||
/// </summary>
|
||||
public string FieldName;
|
||||
|
||||
/// <summary>
|
||||
/// 变更值
|
||||
/// </summary>
|
||||
public string Value;
|
||||
|
||||
public FieldChangeLog(int changeType, string fieldName, string value)
|
||||
{
|
||||
ChangeType = changeType;
|
||||
FieldName = fieldName;
|
||||
Value = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
10
ObjectModel/Club/LeagueClubScoreLog.cs
Normal file
10
ObjectModel/Club/LeagueClubScoreLog.cs
Normal file
@ -0,0 +1,10 @@
|
||||
using System;
|
||||
|
||||
namespace ObjectModel.Club
|
||||
{
|
||||
[Serializable]
|
||||
public class LeagueClubScoreLog : LeagueMatchClubScore
|
||||
{
|
||||
public FieldChangeLog ChangeLog;
|
||||
}
|
||||
}
|
||||
26
ObjectModel/Config/AddShangPingToPlayer.cs
Normal file
26
ObjectModel/Config/AddShangPingToPlayer.cs
Normal file
@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ObjectModel.Config
|
||||
{
|
||||
/// <summary>
|
||||
/// 给游戏中的充值玩家添加购买对应的货币
|
||||
/// </summary>
|
||||
public class AddShangPingToPlayer
|
||||
{
|
||||
/// <summary>
|
||||
/// 玩家Id
|
||||
/// </summary>
|
||||
public int UserId;
|
||||
|
||||
/// <summary>
|
||||
/// 充值的商品Id
|
||||
/// </summary>
|
||||
public int SpId;
|
||||
|
||||
public AddShangPingToPlayer() { }
|
||||
}
|
||||
}
|
||||
101
ObjectModel/Config/ChongZhiShangPing.cs
Normal file
101
ObjectModel/Config/ChongZhiShangPing.cs
Normal file
@ -0,0 +1,101 @@
|
||||
/* ==============================================================================
|
||||
* 功能描述:ChongZhiShangPing
|
||||
* 创 建 者:徐高庆
|
||||
* 创建日期:2023/4/24 15:06:53
|
||||
* CLR Version :4.0.30319.42000
|
||||
* ==============================================================================*/
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ObjectModel.Config
|
||||
{
|
||||
/// <summary>
|
||||
/// 商城商品
|
||||
/// </summary>
|
||||
public class ChongZhiShangPing
|
||||
{
|
||||
/// <summary>
|
||||
/// 商品Id
|
||||
/// </summary>
|
||||
public int id;
|
||||
|
||||
/// <summary>
|
||||
/// 价值-参考价值
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public int jiazhi;
|
||||
|
||||
/// <summary>
|
||||
/// 得到金币数量
|
||||
/// </summary>
|
||||
public long GetJinBi;
|
||||
|
||||
/// <summary>
|
||||
/// 得到参赛卷数量 目前只能赠送获得
|
||||
/// </summary>
|
||||
public int GetCanSaiJuan;
|
||||
|
||||
/// <summary>
|
||||
/// 得到复活卡数量
|
||||
/// </summary>
|
||||
public int GetFuHuoKa;
|
||||
|
||||
/// <summary>
|
||||
/// 得到钻石数量--(界面显示是金砖)
|
||||
/// </summary>
|
||||
public int GetZuanShi;
|
||||
|
||||
/// <summary>
|
||||
/// 得到会员天数
|
||||
/// </summary>
|
||||
public int GetHuiYuan;
|
||||
|
||||
/// <summary>
|
||||
/// 要支付的钻石数量 1
|
||||
/// </summary>
|
||||
public int PayZuanShi ;
|
||||
|
||||
/// <summary>
|
||||
/// 要支付的礼券数量 2
|
||||
/// </summary>
|
||||
public int PayLiJuan;
|
||||
|
||||
/// <summary>
|
||||
/// 要支付的人民币数量 3
|
||||
/// </summary>
|
||||
public int PayRMB;
|
||||
|
||||
/// <summary>
|
||||
/// 需要支付多少红包卷
|
||||
/// </summary>
|
||||
public int PayHongBao;
|
||||
|
||||
//注意 1/2/3 是购买这个商品要支付的数量,正常是一个值就OK了,如果是有多个值的话就说明按其中一个支付即可,但是人民币是最后一个优先级。比如买100万金币 需要支付100个砖石 或者10元人民币,那就优先用100个钻石购买,如果钻石不够,提示用户充值
|
||||
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
public string Title;
|
||||
|
||||
/// <summary>
|
||||
/// 获取会员的Redis Key
|
||||
/// </summary>
|
||||
/// <param name="userid"></param>
|
||||
/// <returns></returns>
|
||||
public static string GetHuiYuanKey(int userid) {
|
||||
return $"huiyuan:{userid}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 是否需要兑换
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool CanDuiHuan() {
|
||||
return this.GetCanSaiJuan+this.GetJinBi+this.GetFuHuoKa>0;
|
||||
}
|
||||
}
|
||||
}
|
||||
29
ObjectModel/Config/HuaWei/AccessTokenServer.cs
Normal file
29
ObjectModel/Config/HuaWei/AccessTokenServer.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ObjectModel.Config.HuaWei
|
||||
{
|
||||
/// <summary>
|
||||
/// 服务器使用的token令牌
|
||||
/// </summary>
|
||||
public class AccessTokenServer
|
||||
{
|
||||
/// <summary>
|
||||
/// 令牌
|
||||
/// </summary>
|
||||
public string access_token;
|
||||
|
||||
/// <summary>
|
||||
/// 过期时间
|
||||
/// </summary>
|
||||
public int expires_in;
|
||||
|
||||
/// <summary>
|
||||
/// 过期的时间
|
||||
/// </summary>
|
||||
public DateTime TimeOut;
|
||||
}
|
||||
}
|
||||
44
ObjectModel/Config/HuaWei/HuaWeiPayDB.cs
Normal file
44
ObjectModel/Config/HuaWei/HuaWeiPayDB.cs
Normal file
@ -0,0 +1,44 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ObjectModel.Config.HuaWei
|
||||
{
|
||||
public class HuaWeiPayDB
|
||||
{
|
||||
public int id;
|
||||
public int userid;
|
||||
/// <summary>
|
||||
/// 产品id
|
||||
/// </summary>
|
||||
public string productId;
|
||||
/// <summary>
|
||||
/// 订单号
|
||||
/// </summary>
|
||||
public string orderId;
|
||||
public DateTime createTime;
|
||||
|
||||
public HuaWeiPayDB() { }
|
||||
|
||||
public static string GetInsertSql(int userid, string productId, string orderId)
|
||||
{
|
||||
return $"INSERT INTO [HuaWeiPay]([userid], [productId], [orderId]) VALUES ( {userid}, '{productId}', '{orderId}')";
|
||||
}
|
||||
|
||||
public string GetSaveSql()
|
||||
{
|
||||
return $"INSERT INTO [tbIosPay]([userid], [productId], [orderId]) VALUES ( {userid}, '{productId}', '{orderId}')";
|
||||
}
|
||||
|
||||
public HuaWeiPayDB(DataRow row)
|
||||
{
|
||||
this.id = Convert.ToInt32(row["id"]);
|
||||
this.userid = Convert.ToInt32(row["userid"]);
|
||||
this.productId = row["productId"].ToString();
|
||||
this.orderId = row["orderId"].ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
125
ObjectModel/Config/HuaWei/InappPurchaseDetails.cs
Normal file
125
ObjectModel/Config/HuaWei/InappPurchaseDetails.cs
Normal file
@ -0,0 +1,125 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ObjectModel.Config.HuaWei
|
||||
{
|
||||
public class InappPurchaseDetails
|
||||
{
|
||||
/// <summary>
|
||||
/// 消耗型商品或者非消耗型商品:固定为false。
|
||||
/// </summary>
|
||||
public bool autoRenewing { get; set; }
|
||||
/// <summary>
|
||||
/// 订单ID,唯一标识一笔需要收费的收据
|
||||
/// </summary>
|
||||
public string orderId { get; set; }
|
||||
/// <summary>
|
||||
/// 应用安装包名。
|
||||
/// </summary>
|
||||
public string packageName { get; set; }
|
||||
/// <summary>
|
||||
/// 应用ID。
|
||||
/// </summary>
|
||||
public long applicationId { get; set; }
|
||||
/// <summary>
|
||||
/// 应用ID
|
||||
/// </summary>
|
||||
public string applicationIdString { get; set; }
|
||||
/// <summary>
|
||||
/// 商品类别,取值包括
|
||||
/// 0:消耗型商品 1:非消耗型商品 2:订阅型商品
|
||||
/// </summary>
|
||||
public int kind { get; set; }
|
||||
/// <summary>
|
||||
/// 商品ID。每种商品必须有唯一的ID
|
||||
/// </summary>
|
||||
public string productId { get; set; }
|
||||
/// <summary>
|
||||
/// 商品名称。
|
||||
/// </summary>
|
||||
public string productName { get; set; }
|
||||
/// <summary>
|
||||
/// 商品购买时间,UTC时间戳,以毫秒为单位
|
||||
/// </summary>
|
||||
public long purchaseTime { get; set; }
|
||||
/// <summary>
|
||||
/// 历史接口兼容用,同purchaseTime,新接入无需关注本字段。
|
||||
/// </summary>
|
||||
public long purchaseTimeMillis { get; set; }
|
||||
/// <summary>
|
||||
/// 订单交易状态。
|
||||
/// -1:初始化 0:已购买 1:已取消 2:已撤销或已退款 3:待处理
|
||||
/// </summary>
|
||||
public int purchaseState { get; set; }
|
||||
/// <summary>
|
||||
/// 商户侧保留信息,由您在调用支付接口时传入
|
||||
/// </summary>
|
||||
public string developerPayload { get; set; }
|
||||
/// <summary>
|
||||
/// 用于唯一标识商品和用户对应关系的购买令牌,在支付完成时由华为应用内支付服务器生成。
|
||||
/// </summary>
|
||||
public string purchaseToken { get; set; }
|
||||
/// <summary>
|
||||
/// 消耗状态,仅一次性商品存在,取值包括 0:未消耗 1:已消耗
|
||||
/// </summary>
|
||||
public int consumptionState { get; set; }
|
||||
/// <summary>
|
||||
/// 确认状态,取值包括 0 :未确认 1:已确认
|
||||
/// </summary>
|
||||
public int confirmed { get; set; }
|
||||
/// <summary>
|
||||
/// 购买类型。 0:沙盒环境
|
||||
/// </summary>
|
||||
public int purchaseType { get; set; }
|
||||
/// <summary>
|
||||
/// 定价货币的币种 CNY
|
||||
/// </summary>
|
||||
public string currency { get; set; }
|
||||
/// <summary>
|
||||
/// 商品实际价格*100以后的值
|
||||
/// </summary>
|
||||
public long price { get; set; }
|
||||
/// <summary>
|
||||
/// 国家/地区码
|
||||
/// </summary>
|
||||
public string country { get; set; }
|
||||
/// <summary>
|
||||
/// 交易单号,用户支付成功后生成
|
||||
/// </summary>
|
||||
public string payOrderId { get; set; }
|
||||
/// <summary>
|
||||
/// 支付方式,
|
||||
/// </summary>
|
||||
public string payType { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string sdkChannel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 购买的商品是否数据合格
|
||||
/// </summary>
|
||||
/// <returns>true合格,false不合格</returns>
|
||||
public bool IsOk(string id)
|
||||
{
|
||||
bool b = false;
|
||||
b = id == productId;
|
||||
if (!b) return b;
|
||||
b = purchaseState == 0;
|
||||
if (!b) return b;
|
||||
b = consumptionState == 0;
|
||||
if (!b) return b;
|
||||
b = confirmed == 0;
|
||||
if (!b) return b;
|
||||
return b;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"id:{productId},name:{productName},price:{price},orderid:{orderId}";
|
||||
}
|
||||
}
|
||||
}
|
||||
36
ObjectModel/Config/HuaWei/VerifyProductResponse.cs
Normal file
36
ObjectModel/Config/HuaWei/VerifyProductResponse.cs
Normal file
@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ObjectModel.Config.HuaWei
|
||||
{
|
||||
public class VerifyProductResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 0成功 其他失败
|
||||
/// </summary>
|
||||
public string responseCode;
|
||||
|
||||
/// <summary>
|
||||
/// 商品的JSON数据
|
||||
/// </summary>
|
||||
public string purchaseTokenData;
|
||||
|
||||
/// <summary>
|
||||
/// 加密后的字符串
|
||||
/// </summary>
|
||||
public string dataSignature;
|
||||
|
||||
/// <summary>
|
||||
/// 加密方式
|
||||
/// </summary>
|
||||
public string signatureAlgorithm;
|
||||
|
||||
/// <summary>
|
||||
/// 错误信息
|
||||
/// </summary>
|
||||
public string responseMessage;
|
||||
}
|
||||
}
|
||||
18
ObjectModel/Config/HuaWei/VerifyRequest.cs
Normal file
18
ObjectModel/Config/HuaWei/VerifyRequest.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
|
||||
namespace ObjectModel.Config.HuaWei
|
||||
{
|
||||
[Serializable]
|
||||
public class VerifyRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 待下发商品ID。商品ID来源于您在AppGallery Connect中配置商品信息时设置的商品ID。
|
||||
/// </summary>
|
||||
public string productId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 待下发商品的购买Token,发起购买和查询待消费商品信息时均会返回purchaseToken参数。
|
||||
/// </summary>
|
||||
public string purchaseToken { get; set; }
|
||||
}
|
||||
}
|
||||
57
ObjectModel/Config/IosPayDB.cs
Normal file
57
ObjectModel/Config/IosPayDB.cs
Normal file
@ -0,0 +1,57 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ObjectModel.Config
|
||||
{
|
||||
/// <summary>
|
||||
/// 苹果充值订单数据库对象
|
||||
/// </summary>
|
||||
public class IosPayDB
|
||||
{
|
||||
public int id;
|
||||
public int userid;
|
||||
/// <summary>
|
||||
/// 产品id
|
||||
/// </summary>
|
||||
public string productId;
|
||||
/// <summary>
|
||||
/// 订单号
|
||||
/// </summary>
|
||||
public string transactionId;
|
||||
public DateTime createTime;
|
||||
|
||||
public IosPayDB() { }
|
||||
|
||||
public static string GetInsertSql(int userid, string productId, string transactionId)
|
||||
{
|
||||
return $"INSERT INTO [tbIosPay]([userid], [productId], [transactionId]) VALUES ( {userid}, '{productId}', '{transactionId}')";
|
||||
}
|
||||
|
||||
public string GetSaveSql()
|
||||
{
|
||||
return $"INSERT INTO [tbIosPay]([userid], [productId], [transactionId]) VALUES ( {userid}, '{productId}', '{transactionId}')";
|
||||
}
|
||||
|
||||
public IosPayDB(DataRow row)
|
||||
{
|
||||
this.id = Convert.ToInt32(row["id"]);
|
||||
this.userid = Convert.ToInt32(row["userid"]);
|
||||
this.productId = row["productId"].ToString();
|
||||
this.transactionId = row["transactionId"].ToString();
|
||||
}
|
||||
|
||||
/* public UserWarDataModel(DataRow row)
|
||||
{
|
||||
this.UserId = (int)row["userId"];
|
||||
this.GameId = (int)row["gameId"];
|
||||
this.WinCount = (int)row["winCount"];
|
||||
this.LoseCount = (int)row["loseCount"];
|
||||
this.GameTotal = (int)row["gameTotal"];
|
||||
this.ExcepCount = 0;
|
||||
}*/
|
||||
}
|
||||
}
|
||||
35
ObjectModel/Config/NoDeskMatesAllowedInfo.cs
Normal file
35
ObjectModel/Config/NoDeskMatesAllowedInfo.cs
Normal file
@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ObjectModel.Config
|
||||
{
|
||||
public class NoDeskMatesAllowedInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 不能同桌的UserId集合。一条记录就是一个规则
|
||||
/// </summary>
|
||||
public List<NoDeskPlayerInfo> PlayerIds;
|
||||
|
||||
/// <summary>
|
||||
/// 获取数据时间,小于当前时间就重新获取。30分钟一次
|
||||
/// </summary>
|
||||
public DateTime GetTime;
|
||||
|
||||
public NoDeskMatesAllowedInfo() { }
|
||||
}
|
||||
|
||||
public class NoDeskPlayerInfo{
|
||||
/// <summary>
|
||||
/// 编号 --根据这个Id做增删改查
|
||||
/// </summary>
|
||||
public int Id;
|
||||
|
||||
/// <summary>
|
||||
/// 玩家Id,多个玩家逗号分隔(玩家个数不限制)
|
||||
/// </summary>
|
||||
public string UserIds;
|
||||
}
|
||||
}
|
||||
42
ObjectModel/Config/TurntableLotteryPack.cs
Normal file
42
ObjectModel/Config/TurntableLotteryPack.cs
Normal file
@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ObjectModel.Config
|
||||
{
|
||||
/// <summary>
|
||||
/// 抽奖包
|
||||
/// </summary>
|
||||
public class TurntableLotteryPack
|
||||
{
|
||||
#region 客户端赋值
|
||||
/// <summary>
|
||||
/// 玩家Id
|
||||
/// </summary>
|
||||
public int UserId;
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 一个月的连续抽奖签到次数
|
||||
/// </summary>
|
||||
public int Count;
|
||||
|
||||
/// <summary>
|
||||
/// 抽中的类型
|
||||
/// </summary>
|
||||
public int Type;
|
||||
|
||||
/// <summary>
|
||||
/// 1成功 2失败今天已经签到过了
|
||||
/// </summary>
|
||||
public int ResultCode;
|
||||
|
||||
/// <summary>
|
||||
/// 是否是活动
|
||||
/// </summary>
|
||||
public bool Activity;
|
||||
}
|
||||
}
|
||||
47
ObjectModel/Config/request/EditGoldRequest.cs
Normal file
47
ObjectModel/Config/request/EditGoldRequest.cs
Normal file
@ -0,0 +1,47 @@
|
||||
/* ==============================================================================
|
||||
* 功能描述:EditGoldRequest
|
||||
* 创 建 者:徐高庆
|
||||
* 创建日期:2023/6/26 16:29:51
|
||||
* CLR Version :4.0.30319.42000
|
||||
* ==============================================================================*/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ObjectModel.Config.request
|
||||
{
|
||||
/// <summary>
|
||||
/// 存取金币
|
||||
/// </summary>
|
||||
public class EditGoldRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 存取数量
|
||||
/// </summary>
|
||||
public int Gold;
|
||||
|
||||
/// <summary>
|
||||
/// 1存 2取
|
||||
/// </summary>
|
||||
public int Type ;
|
||||
|
||||
/// <summary>
|
||||
/// 处理失败返还错误信息
|
||||
/// </summary>
|
||||
public string Msg;
|
||||
|
||||
/// <summary>
|
||||
/// 1成功 其他失败,失败就把上面的msg飞字提示
|
||||
/// </summary>
|
||||
public int Result;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public EditGoldRequest()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
39
ObjectModel/Config/request/RequestCZShangPing.cs
Normal file
39
ObjectModel/Config/request/RequestCZShangPing.cs
Normal file
@ -0,0 +1,39 @@
|
||||
/* ==============================================================================
|
||||
* 功能描述:RequestCZShangPing
|
||||
* 创 建 者:徐高庆
|
||||
* 创建日期:2023/4/25 09:28:20
|
||||
* CLR Version :4.0.30319.42000
|
||||
* ==============================================================================*/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ObjectModel.Config.request
|
||||
{
|
||||
public class RequestCZShangPing
|
||||
{
|
||||
/// <summary>
|
||||
/// 请求类型 1推荐 2砖石 3金币 4道具 5红包兑换
|
||||
/// </summary>
|
||||
public int Type;
|
||||
|
||||
/// <summary>
|
||||
/// 商品列表
|
||||
/// </summary>
|
||||
public List<ChongZhiShangPing> ShangPings;
|
||||
}
|
||||
|
||||
public class DuiHuanDaoJuRequest {
|
||||
/// <summary>
|
||||
/// 商品Id
|
||||
/// </summary>
|
||||
public int Id;
|
||||
|
||||
/// <summary>
|
||||
/// 兑换结果 -1没有该商品 1成功 3失败 没有那么多货币来兑换 2其他错误
|
||||
/// </summary>
|
||||
public int ResultCode;
|
||||
}
|
||||
}
|
||||
59
ObjectModel/ConstClass.cs
Normal file
59
ObjectModel/ConstClass.cs
Normal file
@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ObjectModel
|
||||
{
|
||||
/// <summary>
|
||||
/// 常量类
|
||||
/// </summary>
|
||||
public class ConstClass
|
||||
{
|
||||
/// <summary>
|
||||
/// IPTV直播数据redis key --停用
|
||||
/// </summary>
|
||||
public const string IPtvWarDataRedisKey = "IPtvWarData";
|
||||
|
||||
/// <summary>
|
||||
/// iptv直播数据的库 --停用
|
||||
/// </summary>
|
||||
public const int IPtvWarReidsDB = 9;
|
||||
|
||||
/// <summary>
|
||||
/// 不能同桌(通过设置IP)的redisKey
|
||||
/// </summary>
|
||||
public const string NoDeskMatesAllowedKey = "NoDeskMatesAllowedByIP";
|
||||
|
||||
/// <summary>
|
||||
/// 不能同桌的redis 库下标
|
||||
/// </summary>
|
||||
public const int NoDeskMatesAllowedDBIdx = 9;
|
||||
|
||||
/// <summary>
|
||||
/// 实名认证秘钥的redis Key
|
||||
/// </summary>
|
||||
public const string SMRSSecretKey = "SMRSSecretKey";
|
||||
|
||||
/// <summary>
|
||||
/// 获取红包积分Redis Key
|
||||
/// </summary>
|
||||
/// <param name="userid"></param>
|
||||
/// <returns></returns>
|
||||
public static string GetRedMoneyKey(int userid)
|
||||
{
|
||||
return $"RedMoneyNew:{userid}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取需要平衡的用户信息
|
||||
/// </summary>
|
||||
/// <param name="modelId">服务器模块Id</param>
|
||||
/// <returns></returns>
|
||||
public static string GetBalanceKey(int modelId)
|
||||
{
|
||||
return $"ChangeCardSeat:{modelId}";
|
||||
}
|
||||
}
|
||||
}
|
||||
71
ObjectModel/DBEntity/DBEntityAttribute.cs
Normal file
71
ObjectModel/DBEntity/DBEntityAttribute.cs
Normal file
@ -0,0 +1,71 @@
|
||||
using System;
|
||||
|
||||
namespace DBEntitys
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
|
||||
public class DBFieldNameAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// 别名
|
||||
/// </summary>
|
||||
public string FieldName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
/// </summary>
|
||||
public DBFieldNameAttribute(string fieldName = "")
|
||||
{
|
||||
FieldName = fieldName;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 标记实体属性为时间区间字段
|
||||
/// 使用此注解的属性在查询时会自动使用 WhereBetween
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
|
||||
public class DateRangeFieldAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// 是否为时间区间字段
|
||||
/// </summary>
|
||||
public bool IsDateRange { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
/// </summary>
|
||||
/// <param name="isDateRange">默认为true,标记为时间区间字段</param>
|
||||
public DateRangeFieldAttribute(bool isDateRange = true)
|
||||
{
|
||||
IsDateRange = isDateRange;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 标记实体属性在查询时忽略此字段
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
|
||||
public class QueryIgnoreAttribute : Attribute
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 标记实体属性使用 LIKE 查询
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
|
||||
public class LikeFieldAttribute : Attribute
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 标记实体属性使用 IN 查询(字段值为逗号分隔的多个值)
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
|
||||
public class InFieldAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// 分隔符,默认为逗号
|
||||
/// </summary>
|
||||
public char Separator { get; set; } = ',';
|
||||
}
|
||||
}
|
||||
68
ObjectModel/DBEntity/MailTabDBEntity.cs
Normal file
68
ObjectModel/DBEntity/MailTabDBEntity.cs
Normal file
@ -0,0 +1,68 @@
|
||||
namespace DBEntitys
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class MailTabDBEntity
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.String weiyima { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Int32 send_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.String send_name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Int32 send_type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Int32 receive_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Int32 receive_type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.String title { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.String eml_content { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.String res { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.DateTime send_time { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Int32 mail_state { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.DateTime? read_time { get; set; }
|
||||
}
|
||||
}
|
||||
125
ObjectModel/DBEntity/RoomDataDBEntity.cs
Normal file
125
ObjectModel/DBEntity/RoomDataDBEntity.cs
Normal file
@ -0,0 +1,125 @@
|
||||
namespace DBEntitys
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class RoomData
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public RoomData()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.String weiyima { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.String roomnum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Int32 maxcnt { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Int32 mincnt { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Int32 warcnt { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Int32 nowcnt { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Int32 overCnt { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Int32 gameid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Int32 serverVer { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Int32 createStyle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Int32 createid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Int32 fangka { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.DateTime createTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.DateTime? closeTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Byte[] roomrule { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Int32 interceptIp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.Int32 interceptWeChat { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.String ex { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 赔率
|
||||
/// </summary>
|
||||
public System.Double? peilv { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 限进
|
||||
/// </summary>
|
||||
public System.Int32 Capping { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public System.String Remarks { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.String ruleEx { get; set; }
|
||||
}
|
||||
}
|
||||
83
ObjectModel/Game/AddZiChanPack.cs
Normal file
83
ObjectModel/Game/AddZiChanPack.cs
Normal file
@ -0,0 +1,83 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ObjectModel.Game
|
||||
{
|
||||
/// <summary>
|
||||
/// 添加用户资产信息包
|
||||
/// </summary>
|
||||
public class AddZiChanPack
|
||||
{
|
||||
public List<AddZiChanInfo> datas;
|
||||
|
||||
public AddZiChanPack()
|
||||
{
|
||||
datas = new List<AddZiChanInfo>();
|
||||
}
|
||||
}
|
||||
|
||||
public class AddZiChanInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 玩家Id
|
||||
/// </summary>
|
||||
public int UserId;
|
||||
|
||||
/// <summary>
|
||||
/// 类型 1游戏币(金币) 2保险柜(*1万) 3参赛卷 4复活卡 5门票 6礼券 7金砖 8道具
|
||||
/// </summary>
|
||||
public int lx;
|
||||
|
||||
/// <summary>
|
||||
/// 数值
|
||||
/// </summary>
|
||||
public long Num;
|
||||
|
||||
public AddZiChanInfo() { }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="userid">玩家Id</param>
|
||||
/// <param name="lx">类型 1游戏币(金币) 2保险柜(*1万) 3参赛卷 4复活卡 5门票 6礼券 7金砖 8道具</param>
|
||||
/// <param name="num">数值</param>
|
||||
public AddZiChanInfo(int userid, int lx, long num)
|
||||
{
|
||||
this.UserId = userid;
|
||||
this.lx = lx;
|
||||
this.Num = num;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"userid:{UserId} 类型:{Getlx()} num:{Num}";
|
||||
}
|
||||
|
||||
public string Getlx()
|
||||
{
|
||||
switch (lx)
|
||||
{
|
||||
case 1:
|
||||
return "游戏币";
|
||||
case 2:
|
||||
return "保险柜";
|
||||
case 3:
|
||||
return "参赛卷";
|
||||
case 4:
|
||||
return "复活卡";
|
||||
case 5:
|
||||
return "门票";
|
||||
case 6:
|
||||
return "礼券";
|
||||
case 7:
|
||||
return "金砖";
|
||||
case 8:
|
||||
return "道具";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
44
ObjectModel/Game/DataFirstModel.cs
Normal file
44
ObjectModel/Game/DataFirstModel.cs
Normal file
@ -0,0 +1,44 @@
|
||||
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 DataFirstModel
|
||||
{
|
||||
/// <summary>
|
||||
/// 玩家Id
|
||||
/// </summary>
|
||||
public int UserId;
|
||||
|
||||
/// <summary>
|
||||
/// 获得冠军时间
|
||||
/// </summary>
|
||||
public DateTime CreateTime;
|
||||
|
||||
public DataFirstModel() { }
|
||||
|
||||
public DataFirstModel(DataRow row) {
|
||||
this.UserId = (int)row["UserId"];
|
||||
this.CreateTime = (DateTime)row["CreateTime"];
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取保存日赛冠军Sql
|
||||
/// </summary>
|
||||
/// <param name="userid"></param>
|
||||
/// <returns></returns>
|
||||
public static string GetInsertSql(int userid,int moduleId,int matchId) {
|
||||
return $"INSERT INTO[DataFirst]([UserId], [moduleId], [matchId]) VALUES({userid}, {moduleId}, {matchId});";
|
||||
//return $"INSERT INTO [DataFirst]([UserId]) VALUES ({userid});";
|
||||
}
|
||||
}
|
||||
}
|
||||
31
ObjectModel/Game/FriendRoomFightFileInfo.cs
Normal file
31
ObjectModel/Game/FriendRoomFightFileInfo.cs
Normal file
@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ObjectModel.Game
|
||||
{
|
||||
/// <summary>
|
||||
/// 朋友房战斗文件信息
|
||||
/// </summary>
|
||||
public class FriendRoomFightFileInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 唯一标识
|
||||
/// </summary>
|
||||
public string weiyima;
|
||||
|
||||
/// <summary>
|
||||
/// 打了多少局,打了几局就有几个战斗文件
|
||||
/// </summary>
|
||||
public int overCnt;
|
||||
|
||||
/// <summary>
|
||||
/// 朋友房结束时间
|
||||
/// </summary>
|
||||
public DateTime endTime;
|
||||
|
||||
public FriendRoomFightFileInfo() { }
|
||||
}
|
||||
}
|
||||
249
ObjectModel/Game/GameStatisticsData.cs
Normal file
249
ObjectModel/Game/GameStatisticsData.cs
Normal file
@ -0,0 +1,249 @@
|
||||
/*************************************************************************************
|
||||
* 描 述: 游戏统计数据
|
||||
*************************************************************************************/
|
||||
|
||||
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, // 俱乐部
|
||||
}
|
||||
}
|
||||
54
ObjectModel/Game/IGameMapField.cs
Normal file
54
ObjectModel/Game/IGameMapField.cs
Normal file
@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ObjectModel.Game
|
||||
{
|
||||
/// <summary>
|
||||
/// 转换成字段列表
|
||||
/// </summary>
|
||||
public interface IGameMapField
|
||||
{
|
||||
public List<GameMapFieldData> ToFields();
|
||||
}
|
||||
|
||||
public class GameMapFieldData
|
||||
{
|
||||
public string Name; // 字段名称
|
||||
public bool IsSummary; // 需要纳入统计的字段
|
||||
|
||||
public Func<decimal> GetDecimal;
|
||||
public Action<decimal> SetDecimal;
|
||||
|
||||
public Func<int> GetInt;
|
||||
public Action<int> SetInt;
|
||||
|
||||
public Func<string> GetString;
|
||||
public Action<string> SetString;
|
||||
|
||||
public string ParseStringValue()
|
||||
{
|
||||
if (GetString != null) return GetString();
|
||||
if (GetInt != null) return GetInt().ToString();
|
||||
if (GetDecimal != null) return GetDecimal().ToString();
|
||||
return "";
|
||||
}
|
||||
|
||||
public void SetValue(object value)
|
||||
{
|
||||
if (SetDecimal != null)
|
||||
{
|
||||
decimal.TryParse(value.ToString(), out decimal v);
|
||||
SetDecimal(v);
|
||||
}
|
||||
else if (SetInt != null)
|
||||
{
|
||||
int.TryParse(value.ToString(), out int v);
|
||||
SetInt(v);
|
||||
}
|
||||
else if (SetString != null)
|
||||
{
|
||||
SetString(value.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
12
ObjectModel/Game/MallHttpEntity.cs
Normal file
12
ObjectModel/Game/MallHttpEntity.cs
Normal file
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
|
||||
namespace ObjectModel.Game
|
||||
{
|
||||
[Serializable]
|
||||
public class MallRoleInfoHttpResponse
|
||||
{
|
||||
public int RoleId { get; set; }
|
||||
|
||||
public string RoleName { get; set; }
|
||||
}
|
||||
}
|
||||
18
ObjectModel/Game/PageDBEntity.cs
Normal file
18
ObjectModel/Game/PageDBEntity.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace ObjectModel.Game
|
||||
{
|
||||
public class PageDBEntity<T>
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据总数
|
||||
/// </summary>
|
||||
public int Total { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据
|
||||
/// </summary>
|
||||
public List<T> List { get; set; }
|
||||
}
|
||||
}
|
||||
28
ObjectModel/Game/PlayerPropertyInnerRequest.cs
Normal file
28
ObjectModel/Game/PlayerPropertyInnerRequest.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using GameMessage;
|
||||
|
||||
namespace ObjectModel.Game
|
||||
{
|
||||
/// <summary>
|
||||
/// 游戏内部得资产变更包
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class PlayerPropertyInnerRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 变更得用户Id
|
||||
/// </summary>
|
||||
public int UserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 所需要变更得资产
|
||||
/// </summary>
|
||||
public List<PlayerPropertyPack> PropertyList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 变更客户端展示类型
|
||||
/// </summary>
|
||||
public PlayerPropertyNotifyUIType NotifyType { get; set; } = PlayerPropertyNotifyUIType.None;
|
||||
}
|
||||
}
|
||||
59
ObjectModel/Game/PlayerReportModel.cs
Normal file
59
ObjectModel/Game/PlayerReportModel.cs
Normal file
@ -0,0 +1,59 @@
|
||||
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;";
|
||||
}
|
||||
}
|
||||
}
|
||||
29
ObjectModel/Game/PromotersDBEntity.cs
Normal file
29
ObjectModel/Game/PromotersDBEntity.cs
Normal file
@ -0,0 +1,29 @@
|
||||
namespace ObjectModel.Game
|
||||
{
|
||||
/// <summary>
|
||||
/// 推广员表
|
||||
/// </summary>
|
||||
public class PromotersDBEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户Id
|
||||
/// </summary>
|
||||
public int UserId { get; set; }
|
||||
/// <summary>
|
||||
/// 总线下用户
|
||||
/// </summary>
|
||||
public int TotalUser { get; set; }
|
||||
/// <summary>
|
||||
/// 总钻石的消费金额
|
||||
/// </summary>
|
||||
public decimal TotalCost { get; set; }
|
||||
/// <summary>
|
||||
/// 总佣金 (红包)
|
||||
/// </summary>
|
||||
public decimal TotalCommission { get; set; }
|
||||
/// <summary>
|
||||
/// 推广等级
|
||||
/// </summary>
|
||||
public int Level { get; set; }
|
||||
}
|
||||
}
|
||||
14
ObjectModel/Game/UserAccountInfoDBEntity.cs
Normal file
14
ObjectModel/Game/UserAccountInfoDBEntity.cs
Normal file
@ -0,0 +1,14 @@
|
||||
namespace ObjectModel.Game
|
||||
{
|
||||
public class UserAccountInfoDBEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户Id
|
||||
/// </summary>
|
||||
public int UserId { get; set; }
|
||||
/// <summary>
|
||||
/// 加密得手机号
|
||||
/// </summary>
|
||||
public string PhoneId { get; set; }
|
||||
}
|
||||
}
|
||||
77
ObjectModel/Game/UserDBEntity.cs
Normal file
77
ObjectModel/Game/UserDBEntity.cs
Normal file
@ -0,0 +1,77 @@
|
||||
using System;
|
||||
|
||||
namespace ObjectModel.Game
|
||||
{
|
||||
public class UserDBEntity
|
||||
{
|
||||
public int UserID { get; set;}
|
||||
public string UserName { get; set;}
|
||||
public string avatar { get; set;}
|
||||
public string NickName { get; set;} // 旧的
|
||||
public string nickNameEm { get; set;} // 新的
|
||||
public DateTime RegTime { get; set;}
|
||||
public DateTime LastLoginTime { get; set;}
|
||||
public int Sex { get; set;}
|
||||
|
||||
// 货币
|
||||
public long money { get; set;} // 金币
|
||||
public int mmnn { get; set;} // 钻石
|
||||
}
|
||||
|
||||
public class UserGameGoldChangeStatisticsDBEntity
|
||||
{
|
||||
public long TotalChangeMoney;
|
||||
public long TotalMatchChangeMoney;
|
||||
public int TotalPlayCount;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 游戏游玩金币变更 (sh_log4 表)
|
||||
/// </summary>
|
||||
public class UserGameGoldChangeDBEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户ID
|
||||
/// </summary>
|
||||
public int userid { get; set;}
|
||||
/// <summary>
|
||||
/// 结算后金额
|
||||
/// </summary>
|
||||
public long money_bak { get; set;}
|
||||
/// <summary>
|
||||
/// 游玩输赢
|
||||
/// </summary>
|
||||
public long money_pay { get; set;}
|
||||
/// <summary>
|
||||
/// 游戏ID
|
||||
/// </summary>
|
||||
public int game_id { get; set;}
|
||||
/// <summary>
|
||||
/// 比赛输赢(含报名费)
|
||||
/// </summary>
|
||||
public int kxgc_change { get; set;}
|
||||
/// <summary>
|
||||
/// 时间
|
||||
/// </summary>
|
||||
public DateTime time_change { get; set;}
|
||||
/// <summary>
|
||||
/// 初始金额
|
||||
/// </summary>
|
||||
public long hjha_loginmoney { get; set;}
|
||||
/// <summary>
|
||||
/// 游玩局数
|
||||
/// </summary>
|
||||
public int hjha_playcount { get; set;}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 玩家游戏排名 (金币排行)(tbUserBaseInfo_OneHour 表)
|
||||
/// </summary>
|
||||
public class UserGameRankDBEntity
|
||||
{
|
||||
public int UserID { get; set;}
|
||||
public string UserName { get; set;}
|
||||
public string NickName { get; set;}
|
||||
public long hjha_Gold { get; set;}
|
||||
}
|
||||
}
|
||||
111
ObjectModel/Game/UserWarDataModel.cs
Normal file
111
ObjectModel/Game/UserWarDataModel.cs
Normal file
@ -0,0 +1,111 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Server.Core;
|
||||
|
||||
namespace ObjectModel.Game
|
||||
{
|
||||
/// <summary>
|
||||
/// 玩家对战对象
|
||||
/// </summary>
|
||||
public class UserWarDataModel : Reference
|
||||
{
|
||||
/// <summary>
|
||||
/// userid
|
||||
/// </summary>
|
||||
public int UserId;
|
||||
|
||||
/// <summary>
|
||||
/// 游戏ID
|
||||
/// </summary>
|
||||
public int GameId;
|
||||
|
||||
/// <summary>
|
||||
/// 赢的盘数
|
||||
/// </summary>
|
||||
public int WinCount;
|
||||
|
||||
/// <summary>
|
||||
/// 输的盘数
|
||||
/// </summary>
|
||||
public int LoseCount;
|
||||
|
||||
/// <summary>
|
||||
/// 对战总盘数
|
||||
/// </summary>
|
||||
public int GameTotal;
|
||||
|
||||
/// <summary>
|
||||
/// 对战改变的数量
|
||||
/// </summary>
|
||||
public int TotalChange = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 赢的变化的数量
|
||||
/// </summary>
|
||||
public int WinChange = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 输变化的数量
|
||||
/// </summary>
|
||||
public int LoseChange = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 异常托管局数,不存数据库
|
||||
/// </summary>
|
||||
public int ExcepCount = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 胜率0.12 ,没有乘以100的,不是百分之多少
|
||||
/// </summary>
|
||||
public float VictoryRate
|
||||
{
|
||||
get
|
||||
{
|
||||
if (GameTotal == 0) return 0;
|
||||
return WinCount * 1.0f / GameTotal;
|
||||
}
|
||||
}
|
||||
|
||||
public UserWarDataModel()
|
||||
{
|
||||
}
|
||||
|
||||
public static UserWarDataModel Create(int userid, int gameId)
|
||||
{
|
||||
UserWarDataModel self = ReferencePool.Fetch<UserWarDataModel>();
|
||||
|
||||
self.UserId = userid;
|
||||
self.GameId = gameId;
|
||||
self.ExcepCount = 0;
|
||||
self.LoseCount = 0;
|
||||
self.GameTotal = 0;
|
||||
self.TotalChange = 0;
|
||||
self.WinChange = 0;
|
||||
self.LoseChange = 0;
|
||||
|
||||
self.WinCount = 1;
|
||||
self.LoseCount = 1;
|
||||
self.GameTotal = 2;
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 是否有改变
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool IsChange()
|
||||
{
|
||||
return TotalChange > 0;
|
||||
}
|
||||
|
||||
public override void Dispose()
|
||||
{
|
||||
ReferencePool.Recycle(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
54
ObjectModel/ObjectModel.csproj
Normal file
54
ObjectModel/ObjectModel.csproj
Normal file
@ -0,0 +1,54 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net48</TargetFramework>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>ObjectModel</RootNamespace>
|
||||
<AssemblyName>ObjectModel</AssemblyName>
|
||||
<LangVersion>8.0</LangVersion>
|
||||
<Deterministic>true</Deterministic>
|
||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||
<Configurations>Debug;Release</Configurations>
|
||||
<Platforms>AnyCPU</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<!--<PackageReference Include="Portable.BouncyCastle" />-->
|
||||
<PackageReference Include="Newtonsoft.Json" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Core\Core.csproj" />
|
||||
<ProjectReference Include="..\ServerCore\ServerCore.csproj" />
|
||||
<ProjectReference Include="..\MrWu\MrWu.csproj" />
|
||||
<ProjectReference Include="..\NetWorkMessage\NetWorkMessage.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Match\FixedRoundMatch\" />
|
||||
<Folder Include="Pay\Apple\" />
|
||||
<Folder Include="Pay\ZG\" />
|
||||
<Folder Include="ServerMgr\" />
|
||||
<Folder Include="SQLiteEntity\" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
36
ObjectModel/Properties/AssemblyInfo.cs
Normal file
36
ObjectModel/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 有关程序集的一般信息由以下
|
||||
// 控制。更改这些特性值可修改
|
||||
// 与程序集关联的信息。
|
||||
[assembly: AssemblyTitle("ObjectModel")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Microsoft")]
|
||||
[assembly: AssemblyProduct("ObjectModel")]
|
||||
[assembly: AssemblyCopyright("Copyright © Microsoft 2020")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// 将 ComVisible 设置为 false 会使此程序集中的类型
|
||||
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
|
||||
//请将此类型的 ComVisible 特性设置为 true。
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
|
||||
[assembly: Guid("7c1db817-f5bd-43b1-82db-16e260c9c1a2")]
|
||||
|
||||
// 程序集的版本信息由下列四个值组成:
|
||||
//
|
||||
// 主版本
|
||||
// 次版本
|
||||
// 生成号
|
||||
// 修订号
|
||||
//
|
||||
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
|
||||
//通过使用 "*",如下所示:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
64
ObjectModel/Tool/PukeTool.cs
Normal file
64
ObjectModel/Tool/PukeTool.cs
Normal file
@ -0,0 +1,64 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ObjectModel.Tool
|
||||
{
|
||||
/// <summary>
|
||||
/// 扑克牌的帮助类
|
||||
/// </summary>
|
||||
public class PukeTool
|
||||
{
|
||||
/// <summary>
|
||||
/// ID转换为牌
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="flower"></param>
|
||||
/// <param name="num"></param>
|
||||
public static void ConvertCard(int id, out int flower, out int num)
|
||||
{
|
||||
int temp = 0, tempint = 0;
|
||||
num = 0;
|
||||
flower = 0;
|
||||
temp = id % 54;
|
||||
if (temp == 0 || temp == 53)
|
||||
{
|
||||
flower = 5;
|
||||
num = temp == 0 ? 54 : 53;
|
||||
}
|
||||
else
|
||||
{
|
||||
tempint = temp % 13;
|
||||
if (tempint == 0)
|
||||
{
|
||||
flower = temp / 13;
|
||||
num = 13;
|
||||
}
|
||||
else
|
||||
{
|
||||
flower = temp / 13 + 1;
|
||||
num = tempint;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 打乱数组顺序
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="array"></param>
|
||||
public static void ShuffleArray<T>(ref T[] array, Random random)
|
||||
{
|
||||
int n = array.Length;
|
||||
int total = array.Length;
|
||||
while (n > 0)
|
||||
{
|
||||
n--;
|
||||
int k = random.Next(total);
|
||||
(array[k], array[n]) = (array[n], array[k]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
127
ObjectModel/User/DaoJu.cs
Normal file
127
ObjectModel/User/DaoJu.cs
Normal file
@ -0,0 +1,127 @@
|
||||
/* ==============================================================================
|
||||
* 功能描述:DaoJu
|
||||
* 创 建 者:徐高庆
|
||||
* 创建日期:2023/4/20 15:24:28
|
||||
* CLR Version :4.0.30319.42000
|
||||
* ==============================================================================*/
|
||||
using Newtonsoft.Json;
|
||||
using System.Text;
|
||||
|
||||
namespace ObjectModel.User
|
||||
{
|
||||
/// <summary>
|
||||
/// 玩家的道具 2023
|
||||
/// </summary>
|
||||
public class DaoJu
|
||||
{
|
||||
public DaoJu() { }
|
||||
|
||||
public DaoJu(int uid) {
|
||||
this.userid=uid;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 玩家Id
|
||||
/// </summary>
|
||||
public int userid = 0;
|
||||
/// <summary>
|
||||
/// 参赛卷
|
||||
/// </summary>
|
||||
public int cansaij = 0;
|
||||
/// <summary>
|
||||
/// 门票
|
||||
/// </summary>
|
||||
public int menpiao = 0;
|
||||
/// <summary>
|
||||
/// 复活卡
|
||||
/// </summary>
|
||||
public int fuhuoka = 0;
|
||||
/// <summary>
|
||||
/// 公会令
|
||||
/// </summary>
|
||||
public int clubtoken = 0;
|
||||
/// <summary>
|
||||
/// 总公会令
|
||||
/// </summary>
|
||||
public int clubsupertoken = 0;
|
||||
/// <summary>
|
||||
/// 数据版本,暂时没有用上
|
||||
/// </summary>
|
||||
public int ver = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 变化值
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public int cansaijChange = 0;
|
||||
[JsonIgnore]
|
||||
public int menpiaoChange = 0;
|
||||
[JsonIgnore]
|
||||
public int fuhuokaChange = 0;
|
||||
[JsonIgnore]
|
||||
public int clubtokenChange = 0;
|
||||
[JsonIgnore]
|
||||
public int clubsupertokenChange = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 是否有数据需要保存
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool IsHaveSaveData()
|
||||
{
|
||||
return this.cansaijChange != 0 || this.fuhuokaChange != 0
|
||||
|| this.clubtokenChange != 0 || this.clubsupertokenChange != 0 || this.menpiaoChange != 0;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"userid:{userid} canSaiJuan:{cansaij} fuhuoka:{fuhuoka} clubtoken:{clubtoken} clubsupertoken:{clubsupertoken}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取更新SQL
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string GetUpdateSql()
|
||||
{
|
||||
if (!IsHaveSaveData()) return null;
|
||||
StringBuilder bf = new StringBuilder();
|
||||
bf.Append("update tbDaoju2023 set ");
|
||||
if (this.cansaijChange != 0)
|
||||
{
|
||||
bf.Append($" cansaij=cansaij+{this.cansaijChange},");
|
||||
}
|
||||
//todo 旧门票 下个版本弃用
|
||||
if (this.menpiaoChange != 0)
|
||||
{
|
||||
bf.Append($" menpiao=menpiao+{this.menpiaoChange},");
|
||||
}
|
||||
if (this.fuhuokaChange != 0)
|
||||
{
|
||||
bf.Append($" fuhuoka=fuhuoka+{this.fuhuokaChange},");
|
||||
}
|
||||
if (this.clubtokenChange != 0)
|
||||
{
|
||||
bf.Append($" clubtoken=clubtoken+{this.clubtokenChange},");
|
||||
}
|
||||
if (this.clubsupertokenChange != 0)
|
||||
{
|
||||
bf.Append($" clubsupertoken=clubsupertoken+{this.clubsupertokenChange},");
|
||||
}
|
||||
bf.Remove(bf.Length - 1, 1);
|
||||
bf.Append($" where userid={this.userid}");
|
||||
return bf.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取插入Sql
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string GetSaveSql()
|
||||
{
|
||||
//return $"insert into tbDaoju2023(userid,cansaij,fuhuoka,clubtoken,clubsupertoken) values({userid},{cansaijChange},{fuhuokaChange},{clubtokenChange},{clubsupertokenChange})";
|
||||
//todo 旧门票 下个版本弃用
|
||||
return $"insert into tbDaoju2023(userid,cansaij,fuhuoka,menpiao,clubtoken,clubsupertoken) values({userid},{cansaijChange},{fuhuokaChange},{menpiaoChange},{clubtokenChange},{clubsupertokenChange})";
|
||||
}
|
||||
}
|
||||
}
|
||||
18
ObjectModel/User/UserGoldLogType.cs
Normal file
18
ObjectModel/User/UserGoldLogType.cs
Normal file
@ -0,0 +1,18 @@
|
||||
namespace ObjectModel.User
|
||||
{
|
||||
public enum UserGoldLogType
|
||||
{
|
||||
Game = 1, // 游戏内明细
|
||||
|
||||
// 不对玩家展示的明细
|
||||
Private_Game = 11, // 游戏
|
||||
Pirvate_GoldBox = 12, // 保险柜
|
||||
|
||||
Private_GamePlay = 21, // 游戏游玩
|
||||
Private_GameTax = 22, // 游玩税收
|
||||
|
||||
// 比赛
|
||||
Private_MatchPlay = 31, // 比赛游玩
|
||||
Private_MatchTax = 32, // 比赛税收 (多收的税收)
|
||||
}
|
||||
}
|
||||
44
ObjectModel/User/ZiChanLogData.cs
Normal file
44
ObjectModel/User/ZiChanLogData.cs
Normal file
@ -0,0 +1,44 @@
|
||||
using GameData;
|
||||
using Server.Core;
|
||||
|
||||
namespace ObjectModel.User
|
||||
{
|
||||
public class ZiChanLogData : IReference
|
||||
{
|
||||
public int Id;
|
||||
public long ChangeValue;
|
||||
public long FinValue;
|
||||
public string Tag;
|
||||
|
||||
public UserGoldLogType GoldLogType;
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
ReferencePool.Recycle(this);
|
||||
}
|
||||
|
||||
public static ZiChanLogData CreateGold(long changeValue, long finValue, UserGoldLogType goldLogType, string tag)
|
||||
{
|
||||
ZiChanLogData data = ReferencePool.Fetch<ZiChanLogData>();
|
||||
data.Id = ResName.Gold;
|
||||
data.ChangeValue = changeValue;
|
||||
data.FinValue = finValue;
|
||||
data.GoldLogType = goldLogType;
|
||||
data.Tag = tag;
|
||||
return data;
|
||||
}
|
||||
|
||||
public static ZiChanLogData Create(int id, long changeValue, long finValue, string tag)
|
||||
{
|
||||
ZiChanLogData data = ReferencePool.Fetch<ZiChanLogData>();
|
||||
data.Id = id;
|
||||
data.ChangeValue = changeValue;
|
||||
data.FinValue = finValue;
|
||||
data.Tag = tag;
|
||||
return data;
|
||||
}
|
||||
|
||||
public bool IsFromPool { get; set; }
|
||||
public long ReferenceId { get; set; }
|
||||
}
|
||||
}
|
||||
114
ObjectModel/User/ZiChanMingXi.cs
Normal file
114
ObjectModel/User/ZiChanMingXi.cs
Normal file
@ -0,0 +1,114 @@
|
||||
/* ==============================================================================
|
||||
* 功能描述:ZiChanMingXi
|
||||
* 创 建 者:徐高庆
|
||||
* 创建日期:2023/6/8 15:42:55
|
||||
* CLR Version :4.0.30319.42000
|
||||
* ==============================================================================*/
|
||||
using System;
|
||||
using System.Data;
|
||||
|
||||
namespace ObjectModel.User
|
||||
{
|
||||
/// <summary>
|
||||
/// 资产明细
|
||||
/// </summary>
|
||||
public class ZiChanMingXi
|
||||
{
|
||||
/// <summary>
|
||||
/// 玩家Id
|
||||
/// </summary>
|
||||
public int userid;
|
||||
|
||||
/// <summary>
|
||||
/// 物品Id 1钻石 2礼券 3参赛卷 4门票 5复活卡 6金币(数量比较大,放入redis集合)7红包券
|
||||
/// </summary>
|
||||
public int wuId;
|
||||
/// <summary>
|
||||
/// 变更类型
|
||||
/// 钻石 1充值添加+*、 2活动赠送+(人工添加)、3比赛奖励+、4兑换金币-*、5兑换复活卡-*、6兑换装饰-、7兑换房卡、8道具消耗
|
||||
/// 礼券:1活动赠送+(人工添加)、2比赛奖励+*、3兑换道具-*、4兑换礼品
|
||||
/// 红包券:1比赛奖励+、 2兑换红包-
|
||||
/// 金币:1兑换添加+*、2活动赠送+(人工添加)、3比赛奖励+*、4娱乐馆服务费-*、5娱乐馆输赢-*、6竞赛馆报名费-*、7保险柜操作
|
||||
/// 参赛券:1、活动赠送+(人工添加)、2比赛奖励+、3比赛报名-、4兑换赠送*
|
||||
/// 门票:1、活动赠送+(人工添加)、2比赛奖励+、3比赛报名-
|
||||
/// 复活卡:1、兑换添加+*、2活动赠送+(人工添加)、3比赛奖励+、4竞赛馆消费-
|
||||
/// 房卡:1、充值添加 2、充值赠送 3、转入公会
|
||||
/// </summary>
|
||||
public int chType;
|
||||
/// <summary>
|
||||
/// 变更时间
|
||||
/// </summary>
|
||||
public DateTime createTime;
|
||||
/// <summary>
|
||||
/// 变更数量
|
||||
/// </summary>
|
||||
public long num;
|
||||
/// <summary>
|
||||
/// 余额
|
||||
/// </summary>
|
||||
public long yuE;
|
||||
|
||||
public ZiChanMingXi() { }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="_userid"></param>
|
||||
/// <param name="_wuid">物品Id 1钻石 2礼券 3参赛卷 4门票 5复活卡 6金币(数量比较大,放入redis集合)7红包券 8道具 9房卡</param>
|
||||
/// <param name="ct">变更类型</param>
|
||||
/// <param name="_num">变更数量</param>
|
||||
/// <param name="yue">余额</param>
|
||||
public ZiChanMingXi(int _userid, int _wuid, int ct, long _num, long yue)
|
||||
{
|
||||
this.userid = _userid;
|
||||
this.wuId = _wuid;
|
||||
this.chType = ct;
|
||||
this.num = _num;
|
||||
this.yuE = yue;
|
||||
this.createTime = DateTime.Now;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"userid:{userid} t:{chType} num:{num} yue:{yuE} time:{createTime.ToString("yyyy-dd-MM HH:mm:sss")}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取插入Sql
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string GetSaveSql()
|
||||
{
|
||||
return $"insert into zichanMX(userid,wuId,chType,num,yuE) values({userid},{wuId},{chType},{num},{yuE})";
|
||||
}
|
||||
|
||||
public static string GetInsertSql(int userid, int wupid, int ct, long num, long yue)
|
||||
{
|
||||
return $"insert into zichanMX(userid,wuId,chType,num,yuE) values({userid},{wupid},{ct},{num},{yue})";
|
||||
}
|
||||
|
||||
public static string GetInsertSql(int userid, int wupid, int ct, long num, long yue,DateTime time)
|
||||
{
|
||||
return $"insert into zichanMX(userid,wuId,chType,num,yuE, createTime) values({userid},{wupid},{ct},{num},{yue},'{time}')";
|
||||
}
|
||||
|
||||
public static ZiChanMingXi GetInstance(DataRow row)
|
||||
{
|
||||
return new ZiChanMingXi()
|
||||
{
|
||||
userid = (int)row["userid"],
|
||||
wuId = (int)row["wuId"],
|
||||
chType = (int)row["chType"],
|
||||
num = (long)row["num"],
|
||||
yuE = (long)row["yuE"],
|
||||
createTime = (DateTime)row["createTime"]
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public class ZiChanMingXiDto : ZiChanMingXi
|
||||
{
|
||||
public int TotalCount { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user