2024-12-16 15:50:22 +08:00
|
|
|
|
using System.Collections.Generic;
|
2024-12-17 14:36:37 +08:00
|
|
|
|
using Gameplay.Net;
|
|
|
|
|
|
using NLDPB;
|
2024-12-16 15:50:22 +08:00
|
|
|
|
|
|
|
|
|
|
public partial class LegionManager
|
|
|
|
|
|
{
|
2024-12-18 14:11:00 +08:00
|
|
|
|
/// <summary>
|
2024-12-19 14:46:02 +08:00
|
|
|
|
/// 缓存的服务器下发军团列表信息数据 LegionInfoData
|
2024-12-18 14:11:00 +08:00
|
|
|
|
/// </summary>
|
2024-12-19 14:46:02 +08:00
|
|
|
|
public List<MSG_LegionData> NetLegionInfoDataList;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 缓存服务器下发军团Base数据
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public Lg_Clt_LegionBase NetLegionBaseData;
|
|
|
|
|
|
|
|
|
|
|
|
public readonly List<MSG_LegionActorData> NetLegionApplyDataList = new List<MSG_LegionActorData>();
|
|
|
|
|
|
|
|
|
|
|
|
public readonly List<Lg_Clt_LegionMember> NetLegionMemberList = new();
|
|
|
|
|
|
|
2024-12-17 14:36:37 +08:00
|
|
|
|
public void _RegisterNetAck()
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void _UnregisterNetAck()
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
2024-12-18 14:11:00 +08:00
|
|
|
|
|
2024-12-16 15:50:22 +08:00
|
|
|
|
/// <summary>
|
2024-12-18 14:11:00 +08:00
|
|
|
|
/// 解析服务器下发LegionData数据
|
2024-12-16 15:50:22 +08:00
|
|
|
|
/// </summary>
|
2024-12-17 14:36:37 +08:00
|
|
|
|
private Legion _ParseLegionData(MSG_LegionData legionData)
|
2024-12-16 15:50:22 +08:00
|
|
|
|
{
|
2024-12-17 14:36:37 +08:00
|
|
|
|
var legion = new Legion(legionData);
|
|
|
|
|
|
return legion;
|
2024-12-16 15:50:22 +08:00
|
|
|
|
}
|
2024-12-19 14:46:02 +08:00
|
|
|
|
|
|
|
|
|
|
private Legion _ParseLegionData(Lg_Clt_LegionBase legionData)
|
|
|
|
|
|
{
|
|
|
|
|
|
var legion = new Legion(legionData);
|
|
|
|
|
|
return legion;
|
|
|
|
|
|
}
|
2024-12-16 15:50:22 +08:00
|
|
|
|
|
|
|
|
|
|
#region API
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2024-12-17 14:36:37 +08:00
|
|
|
|
/// 请求军团详细信息
|
2024-12-16 15:50:22 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public void ReqLegionInfo(uint id)
|
|
|
|
|
|
{
|
2024-12-18 14:11:00 +08:00
|
|
|
|
if (id > 0)
|
|
|
|
|
|
{
|
2024-12-19 14:46:02 +08:00
|
|
|
|
//NetHelper.ReqLegionInfo(id);
|
2024-12-18 14:11:00 +08:00
|
|
|
|
}
|
2024-12-16 15:50:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 请求创建军团
|
|
|
|
|
|
/// </summary>
|
2024-12-18 14:11:00 +08:00
|
|
|
|
public void ReqCreateLegion(Legion legion)
|
2024-12-16 15:50:22 +08:00
|
|
|
|
{
|
2024-12-18 14:11:00 +08:00
|
|
|
|
var legionData = _TranslateLegion(legion);
|
|
|
|
|
|
if (legionData.Id != 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError($"创建军团数据有误,ID:{legionData.Id}");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
NetHelper.ReqCreateLegion(legionData);
|
2024-12-16 15:50:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2024-12-17 14:36:37 +08:00
|
|
|
|
/// 请求存储军团信息,编辑军团信息
|
2024-12-16 15:50:22 +08:00
|
|
|
|
/// </summary>
|
2024-12-17 14:36:37 +08:00
|
|
|
|
public void ReqSaveLegionInfo(Legion legion)
|
2024-12-16 15:50:22 +08:00
|
|
|
|
{
|
2024-12-17 14:36:37 +08:00
|
|
|
|
if (legion.ID == 0)
|
|
|
|
|
|
{
|
2024-12-18 14:11:00 +08:00
|
|
|
|
DebugUtil.LogError($"编辑军团数据有误,ID:{legion.ID}");
|
2024-12-17 14:36:37 +08:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
2024-12-18 14:11:00 +08:00
|
|
|
|
|
|
|
|
|
|
var legionData = _TranslateLegion(legion);
|
|
|
|
|
|
NetHelper.ReqSaveEditLegion(legionData);
|
2024-12-16 15:50:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-12-17 14:36:37 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 根据页数请求军团列表信息
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="page"></param>
|
|
|
|
|
|
public void ReqLegionListByPage(int page)
|
|
|
|
|
|
{
|
|
|
|
|
|
NetHelper.ReqLegionListByPage((uint)page);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 根据key搜索军团列表信息
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="key"></param>
|
|
|
|
|
|
public void ReqLegionListByKey(string key)
|
|
|
|
|
|
{
|
|
|
|
|
|
NetHelper.ReqLegionListByKey(key);
|
|
|
|
|
|
}
|
2024-12-18 14:11:00 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取军团战绩
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="id"></param>
|
|
|
|
|
|
public void ReqLegionRecord(uint id)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 请求加入军团
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="id"></param>
|
|
|
|
|
|
public void ReqJoinLegion(uint id)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (id > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
NetHelper.ReqJoinLegion(id);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 请求退出军团
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="id"></param>
|
|
|
|
|
|
public void ReqLeaveLegion()
|
|
|
|
|
|
{
|
|
|
|
|
|
NetHelper.ReqLeaveLegion();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-12-19 14:46:02 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 请求编辑加入申请
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="id"></param>
|
|
|
|
|
|
/// <param name="status"></param>
|
|
|
|
|
|
public void ReqExamineApply(uint id, LegionExamineStatus status)
|
2024-12-18 14:11:00 +08:00
|
|
|
|
{
|
2024-12-19 14:46:02 +08:00
|
|
|
|
NetHelper.ReqExamineApply(id, (uint)status);
|
2024-12-18 14:11:00 +08:00
|
|
|
|
}
|
2024-12-19 14:46:02 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 团长请求申请加入玩家列表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public void ReqApplyList()
|
|
|
|
|
|
{
|
|
|
|
|
|
NetHelper.ReqApplyList();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-12-18 14:11:00 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 请求编辑成员
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public void ReqEditMember()
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
2024-12-16 15:50:22 +08:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
}
|