2023-08-22 19:08:45 +08:00
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
//
|
|
|
|
|
|
// 文件:Assets/Code/Scripts/Gameplay/Net/Client/NetHelper.cs
|
|
|
|
|
|
// 作者:Xoen Xie
|
|
|
|
|
|
// 时间:2023/07/19
|
|
|
|
|
|
// 描述:网络相关接口
|
|
|
|
|
|
// 说明:
|
|
|
|
|
|
//
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
2024-01-03 14:56:46 +08:00
|
|
|
|
|
2024-01-30 15:10:12 +08:00
|
|
|
|
using System.Collections.Generic;
|
2024-06-20 15:15:40 +08:00
|
|
|
|
using System.Linq;
|
2024-01-02 16:19:15 +08:00
|
|
|
|
using Google.Protobuf.Collections;
|
2024-01-03 14:56:46 +08:00
|
|
|
|
using Google.Protobuf;
|
|
|
|
|
|
using NLDMID;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
using NLDPB;
|
2024-01-15 13:36:39 +08:00
|
|
|
|
using UnityEngine.Rendering;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
|
|
|
|
|
|
namespace Gameplay.Net
|
|
|
|
|
|
{
|
|
|
|
|
|
public static class NetHelper
|
|
|
|
|
|
{
|
|
|
|
|
|
// 发送服务器消息,请求角色养成
|
2024-07-25 19:44:20 +08:00
|
|
|
|
public static void CharacterUpgrade(uint nCharacterID, UpgradeType type, uint nTargetLevel, bool addAllExp = false)
|
2023-08-22 19:08:45 +08:00
|
|
|
|
{
|
2024-01-03 14:56:46 +08:00
|
|
|
|
MSG_Clt_G_CharacterUpgrade msg =
|
|
|
|
|
|
NetManager.Instance.GetMessage(NLDMID.MSGID.CltGCharacterUpgrade) as MSG_Clt_G_CharacterUpgrade;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
msg.mPB.CharacterId = nCharacterID;
|
|
|
|
|
|
msg.mPB.UpgradeType = (uint)type;
|
|
|
|
|
|
msg.mPB.TargetLevel = nTargetLevel;
|
2024-07-25 19:44:20 +08:00
|
|
|
|
msg.mPB.AddAllExp = addAllExp;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
NetManager.Instance.mClient.SendMessage(msg);
|
|
|
|
|
|
}
|
2023-10-19 15:00:19 +08:00
|
|
|
|
|
|
|
|
|
|
// 进入关卡
|
|
|
|
|
|
public static void EnterLevel(uint nLevelID, uint nTeamIndex)
|
|
|
|
|
|
{
|
2024-01-03 14:56:46 +08:00
|
|
|
|
MSG_Clt_G_EnterLevel msg =
|
|
|
|
|
|
NetManager.Instance.GetMessage(NLDMID.MSGID.CltGEnterLevel) as MSG_Clt_G_EnterLevel;
|
2023-10-19 15:00:19 +08:00
|
|
|
|
msg.mPB.LevelId = nLevelID;
|
|
|
|
|
|
msg.mPB.TeamIndex = nTeamIndex;
|
|
|
|
|
|
NetManager.Instance.mClient.SendMessage(msg);
|
2024-01-08 19:14:33 +08:00
|
|
|
|
DebugUtil.Log($"C->S send message EnterLevel,levelID:{nLevelID} nTeamIndex:{nTeamIndex}");
|
2023-10-19 15:00:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 退出关卡,关卡结算
|
2024-01-30 15:10:12 +08:00
|
|
|
|
public static void ExitLevel(bool isSuccess, List<uint> nStar)
|
2023-10-19 15:00:19 +08:00
|
|
|
|
{
|
|
|
|
|
|
MSG_Clt_G_ExitLevel msg = NetManager.Instance.GetMessage(NLDMID.MSGID.CltGExitLevel) as MSG_Clt_G_ExitLevel;
|
|
|
|
|
|
msg.mPB.IsSuccess = isSuccess;
|
2024-01-30 15:29:17 +08:00
|
|
|
|
msg.mPB.StarIndex.Clear();
|
2024-01-30 15:10:12 +08:00
|
|
|
|
msg.mPB.StarIndex.AddRange(nStar);
|
2023-10-19 15:00:19 +08:00
|
|
|
|
NetManager.Instance.mClient.SendMessage(msg);
|
2024-01-30 15:29:17 +08:00
|
|
|
|
DebugUtil.Log($"ExitLevel PB:{msg.mPB}");
|
|
|
|
|
|
DebugUtil.Log($"C->S TryExitLevel isSuccess:{isSuccess} StarResult:{string.Join(",",nStar)}");
|
2023-10-19 15:00:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-09-04 16:40:19 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 领取章节宝箱
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="nGroupID"></param>
|
|
|
|
|
|
/// <param name="nIndex"></param>
|
2024-09-05 18:43:40 +08:00
|
|
|
|
public static void LevelGroupReward(uint nGroupID)
|
2023-10-19 15:00:19 +08:00
|
|
|
|
{
|
2024-09-05 18:43:40 +08:00
|
|
|
|
MSG_Clt_G_GroupReward msg = NetManager.Instance.GetMessage(NLDMID.MSGID.CltGGroupReward) as MSG_Clt_G_GroupReward;
|
2024-01-08 19:14:33 +08:00
|
|
|
|
msg.mPB.GroupId = nGroupID;
|
2024-09-05 18:43:40 +08:00
|
|
|
|
|
2023-10-19 15:00:19 +08:00
|
|
|
|
NetManager.Instance.mClient.SendMessage(msg);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 载具升级
|
2023-11-15 15:23:27 +08:00
|
|
|
|
public static void VehicleUpgrade(uint nVehicleID, uint[] upgrade_type, uint[] upgrade_count)
|
2023-10-19 15:00:19 +08:00
|
|
|
|
{
|
2024-01-03 14:56:46 +08:00
|
|
|
|
MSG_Clt_G_VehicleUpgrade msg =
|
|
|
|
|
|
NetManager.Instance.GetMessage(NLDMID.MSGID.CltGVehicleUpgrade) as MSG_Clt_G_VehicleUpgrade;
|
2023-10-19 15:00:19 +08:00
|
|
|
|
msg.mPB.VehicleId = nVehicleID;
|
2023-11-15 15:23:27 +08:00
|
|
|
|
msg.mPB.UpgradeType.Clear();
|
|
|
|
|
|
msg.mPB.UpgradeType.AddRange(upgrade_type);
|
|
|
|
|
|
msg.mPB.UpgradeCount.Clear();
|
|
|
|
|
|
msg.mPB.UpgradeCount.AddRange(upgrade_count);
|
2023-10-19 15:00:19 +08:00
|
|
|
|
NetManager.Instance.mClient.SendMessage(msg);
|
|
|
|
|
|
}
|
2024-10-08 18:55:13 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 新协议 创建队伍
|
|
|
|
|
|
/// </summary>
|
2024-10-16 19:40:37 +08:00
|
|
|
|
public static void CreateTeam(uint nIndex, string name, uint nIcon, uint conductor, List<uint> characterIDs, uint[] playerSkillIds)
|
2024-10-08 18:55:13 +08:00
|
|
|
|
{
|
|
|
|
|
|
// TODO 更新服务器协议
|
2024-10-11 15:22:03 +08:00
|
|
|
|
MSG_Clt_G_CreateTeam msg =
|
2024-10-08 18:55:13 +08:00
|
|
|
|
NetManager.Instance.GetMessage(NLDMID.MSGID.CltGCreateTeam) as MSG_Clt_G_CreateTeam;
|
|
|
|
|
|
msg.mPB.Name = name;
|
|
|
|
|
|
msg.mPB.Icon = nIcon;
|
|
|
|
|
|
msg.mPB.Index = nIndex;
|
2024-10-11 15:22:03 +08:00
|
|
|
|
msg.mPB.Commander = conductor;
|
2024-10-08 18:55:13 +08:00
|
|
|
|
|
2024-10-11 15:22:03 +08:00
|
|
|
|
msg.mPB.UnitIds.Clear();
|
|
|
|
|
|
msg.mPB.UnitIds.AddRange(characterIDs);
|
2024-10-08 18:55:13 +08:00
|
|
|
|
|
|
|
|
|
|
msg.mPB.PlayerSkills.Clear();
|
|
|
|
|
|
for (int i = 0; i < playerSkillIds.Length; ++i)
|
|
|
|
|
|
msg.mPB.PlayerSkills.Add(playerSkillIds[i]);
|
|
|
|
|
|
|
2024-10-11 15:22:03 +08:00
|
|
|
|
NetManager.Instance.mClient.SendMessage(msg);
|
2024-10-08 18:55:13 +08:00
|
|
|
|
}
|
2024-01-03 14:56:46 +08:00
|
|
|
|
|
2024-07-15 13:44:42 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 抽卡
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="id"></param>
|
|
|
|
|
|
/// <param name="raffleType"></param>
|
|
|
|
|
|
/// <param name="isFree"></param>
|
|
|
|
|
|
/// <param name="useTicketCounr"></param>
|
2024-01-03 14:56:46 +08:00
|
|
|
|
public static void Raffle(uint id, uint raffleType, bool isFree, uint useTicketCounr)
|
2023-10-19 15:00:19 +08:00
|
|
|
|
{
|
|
|
|
|
|
MSG_Clt_G_Raffle msg = NetManager.Instance.GetMessage(NLDMID.MSGID.CltGRaffle) as MSG_Clt_G_Raffle;
|
|
|
|
|
|
msg.mPB.Id = id;
|
2023-12-27 16:28:40 +08:00
|
|
|
|
msg.mPB.Type = raffleType;
|
|
|
|
|
|
msg.mPB.IsFree = isFree;
|
|
|
|
|
|
msg.mPB.TicketCount = useTicketCounr;
|
2023-10-19 15:00:19 +08:00
|
|
|
|
NetManager.Instance.mClient.SendMessage(msg);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 机器人初始化
|
|
|
|
|
|
public static void RobotTestInit()
|
|
|
|
|
|
{
|
|
|
|
|
|
MSG_Clt_G_TestInit msg = NetManager.Instance.GetMessage(NLDMID.MSGID.CltGTestInit) as MSG_Clt_G_TestInit;
|
|
|
|
|
|
NetManager.Instance.mClient.SendMessage(msg);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static void GiftCode(string code)
|
|
|
|
|
|
{
|
|
|
|
|
|
MSG_Clt_G_GiftCode msg = NetManager.Instance.GetMessage(NLDMID.MSGID.CltGGiftCode) as MSG_Clt_G_GiftCode;
|
|
|
|
|
|
msg.mPB.Code = code;
|
|
|
|
|
|
NetManager.Instance.mClient.SendMessage(msg);
|
|
|
|
|
|
}
|
2023-11-14 15:54:36 +08:00
|
|
|
|
|
|
|
|
|
|
public static void Relogin()
|
|
|
|
|
|
{
|
|
|
|
|
|
MSG_Clt_G_Relogin msg = NetManager.Instance.GetMessage(NLDMID.MSGID.CltGRelogin) as MSG_Clt_G_Relogin;
|
|
|
|
|
|
msg.mPB.ActorId = Actor.Instance.Base.GetProp(ActorProp.ActorId);
|
|
|
|
|
|
msg.mPB.LoginKey = Actor.Instance.Login.LoginKey;
|
|
|
|
|
|
NetManager.Instance.mClient.SendMessage(msg, Actor.Instance.Login.ServerID);
|
|
|
|
|
|
}
|
2023-12-06 15:00:26 +08:00
|
|
|
|
|
|
|
|
|
|
// 请求邮件列表
|
|
|
|
|
|
public static void RequestMailList(bool NeedAll)
|
|
|
|
|
|
{
|
2024-04-15 19:34:15 +08:00
|
|
|
|
MSG_Clt_Ml_MailRequest msg = NetManager.Instance.GetMessage(MSGID.CltMlMailRequest) as MSG_Clt_Ml_MailRequest;
|
2023-12-06 15:00:26 +08:00
|
|
|
|
msg.mPB.NeedAll = NeedAll;
|
|
|
|
|
|
NetManager.Instance.mClient.SendMessage(msg);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 打开一封邮件
|
|
|
|
|
|
public static void OpenMail(ulong id)
|
|
|
|
|
|
{
|
|
|
|
|
|
MSG_Clt_Ml_OpenMail msg = NetManager.Instance.GetMessage(NLDMID.MSGID.CltMlOpenMail) as MSG_Clt_Ml_OpenMail;
|
|
|
|
|
|
msg.mPB.Id = id;
|
|
|
|
|
|
NetManager.Instance.mClient.SendMessage(msg);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 领取邮件附件,如果id为0,则领取所有
|
2024-09-25 14:24:15 +08:00
|
|
|
|
public static void CliamMail(params ulong[] ids)
|
2023-12-06 15:00:26 +08:00
|
|
|
|
{
|
2024-04-15 19:34:15 +08:00
|
|
|
|
MSG_Clt_Ml_ClaimMailItems msg = NetManager.Instance.GetMessage(MSGID.CltMlClaimMailItems) as MSG_Clt_Ml_ClaimMailItems;
|
2024-09-25 14:24:15 +08:00
|
|
|
|
msg.mPB.MailId.Clear();
|
|
|
|
|
|
for (int i = 0; i < ids.Length; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
msg.mPB.MailId.Add(ids[i]);
|
|
|
|
|
|
}
|
2023-12-06 15:00:26 +08:00
|
|
|
|
NetManager.Instance.mClient.SendMessage(msg);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static void DeleteMail(ulong id)
|
|
|
|
|
|
{
|
2024-01-03 14:56:46 +08:00
|
|
|
|
MSG_Clt_Ml_DeleteMail msg =
|
|
|
|
|
|
NetManager.Instance.GetMessage(NLDMID.MSGID.CltMlDeleteMail) as MSG_Clt_Ml_DeleteMail;
|
2023-12-06 15:00:26 +08:00
|
|
|
|
msg.mPB.MailId = id;
|
|
|
|
|
|
NetManager.Instance.mClient.SendMessage(msg);
|
|
|
|
|
|
}
|
2023-12-19 12:32:03 +08:00
|
|
|
|
|
2024-03-08 12:59:24 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 升级指挥官技能
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="nSkillID"></param>
|
2024-03-21 15:29:38 +08:00
|
|
|
|
public static void PlayerSkillUpgrade(uint nSkillID, uint toLevel)
|
2023-12-19 12:32:03 +08:00
|
|
|
|
{
|
2024-01-03 14:56:46 +08:00
|
|
|
|
MSG_Clt_G_PlayerSkillUpgrade msg =
|
2024-03-08 12:59:24 +08:00
|
|
|
|
NetManager.Instance.GetMessage(MSGID.CltGPlayerSkillUpgrade) as MSG_Clt_G_PlayerSkillUpgrade;
|
2023-12-19 12:32:03 +08:00
|
|
|
|
msg.mPB.SkillId = nSkillID;
|
2024-03-21 15:29:38 +08:00
|
|
|
|
msg.mPB.Level = toLevel;
|
2023-12-19 12:32:03 +08:00
|
|
|
|
NetManager.Instance.mClient.SendMessage(msg);
|
|
|
|
|
|
}
|
2024-01-03 14:56:46 +08:00
|
|
|
|
|
|
|
|
|
|
//领取任务奖励
|
2024-01-02 16:19:15 +08:00
|
|
|
|
public static void ClaimTaskReward(uint[] taskIds)
|
2023-12-21 14:19:44 +08:00
|
|
|
|
{
|
|
|
|
|
|
MSG_Clt_G_TaskClaim msg = NetManager.Instance.GetMessage(NLDMID.MSGID.CltGTaskClaim) as MSG_Clt_G_TaskClaim;
|
2024-01-03 14:51:03 +08:00
|
|
|
|
msg.mPB.TaskId.Clear();
|
2024-01-02 16:19:15 +08:00
|
|
|
|
for (int i = 0; i < taskIds.Length; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
msg.mPB.TaskId.Add(taskIds[i]);
|
|
|
|
|
|
}
|
2024-01-03 14:56:46 +08:00
|
|
|
|
|
2023-12-21 14:19:44 +08:00
|
|
|
|
NetManager.Instance.mClient.SendMessage(msg);
|
|
|
|
|
|
}
|
2023-12-21 15:59:18 +08:00
|
|
|
|
|
|
|
|
|
|
public static void GetShopData(uint nShopId)
|
|
|
|
|
|
{
|
2024-01-03 14:56:46 +08:00
|
|
|
|
MSG_Clt_G_GetShopContent msg =
|
|
|
|
|
|
NetManager.Instance.GetMessage(NLDMID.MSGID.CltGGetShopContent) as MSG_Clt_G_GetShopContent;
|
2023-12-21 15:59:18 +08:00
|
|
|
|
msg.mPB.ShopId = nShopId;
|
|
|
|
|
|
NetManager.Instance.mClient.SendMessage(msg);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-01-03 14:56:46 +08:00
|
|
|
|
public static void ShopBuySth(uint nShopId, int index, int count)
|
2023-12-21 15:59:18 +08:00
|
|
|
|
{
|
2024-01-03 14:56:46 +08:00
|
|
|
|
MSG_Clt_G_ShopPurchase msg =
|
|
|
|
|
|
NetManager.Instance.GetMessage(NLDMID.MSGID.CltGShopPurchase) as MSG_Clt_G_ShopPurchase;
|
2023-12-21 15:59:18 +08:00
|
|
|
|
msg.mPB.ShopId = nShopId;
|
|
|
|
|
|
msg.mPB.Index = (uint)index;
|
|
|
|
|
|
msg.mPB.Count = (uint)count;
|
|
|
|
|
|
NetManager.Instance.mClient.SendMessage(msg);
|
|
|
|
|
|
}
|
2024-01-03 14:56:46 +08:00
|
|
|
|
|
2024-10-11 16:19:21 +08:00
|
|
|
|
public static void SetDefenceTeamForPvp(uint[] characterIDs, uint[] vehicleIDs, uint[] buildingIDs, byte[] teamData)
|
2024-01-03 14:56:46 +08:00
|
|
|
|
{
|
|
|
|
|
|
MSG_Clt_G_SetDefenceTeamForPvp msg =
|
|
|
|
|
|
NetManager.Instance.GetMessage(NLDMID.MSGID.CltGSetDefenceTeamForPvp) as MSG_Clt_G_SetDefenceTeamForPvp;
|
2024-06-20 15:15:40 +08:00
|
|
|
|
msg.mPB.CharacterId.Clear();
|
2024-01-03 14:56:46 +08:00
|
|
|
|
foreach (var characterID in characterIDs)
|
|
|
|
|
|
{
|
|
|
|
|
|
msg.mPB.CharacterId.Add(characterID);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-11 16:19:21 +08:00
|
|
|
|
msg.mPB.VehicleId.Clear();
|
2024-10-11 15:22:03 +08:00
|
|
|
|
foreach (var vehicleID in vehicleIDs)
|
|
|
|
|
|
{
|
|
|
|
|
|
msg.mPB.VehicleId.Add(vehicleID);
|
|
|
|
|
|
}
|
2024-10-11 16:19:21 +08:00
|
|
|
|
|
|
|
|
|
|
msg.mPB.BuildingId.Clear();
|
|
|
|
|
|
foreach (var bulidingID in buildingIDs)
|
|
|
|
|
|
{
|
|
|
|
|
|
msg.mPB.BuildingId.Add(bulidingID);
|
|
|
|
|
|
}
|
2024-01-03 14:56:46 +08:00
|
|
|
|
msg.mPB.TeamData = ByteString.CopyFrom(teamData);
|
|
|
|
|
|
NetManager.Instance.mClient.SendMessage(msg);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static void StartPVPFight(uint actorID)
|
|
|
|
|
|
{
|
|
|
|
|
|
MSG_Clt_G_PvpStart msg = NetManager.Instance.GetMessage(NLDMID.MSGID.CltGPvpStart) as MSG_Clt_G_PvpStart;
|
|
|
|
|
|
msg.mPB.ActorId = actorID;
|
|
|
|
|
|
NetManager.Instance.mClient.SendMessage(msg);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static void GetPVPInformation()
|
|
|
|
|
|
{
|
|
|
|
|
|
MSG_Clt_Mg_PvpInformation msg =
|
|
|
|
|
|
NetManager.Instance.GetMessage(MSGID.CltMgPvpInformation) as MSG_Clt_Mg_PvpInformation;
|
|
|
|
|
|
NetManager.Instance.SendMessage(msg);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-01-04 13:51:08 +08:00
|
|
|
|
public static void FinishPVPFight(bool isWin,uint key)
|
2024-01-03 14:56:46 +08:00
|
|
|
|
{
|
|
|
|
|
|
MSG_Clt_G_PvpResult msg = NetManager.Instance.GetMessage(NLDMID.MSGID.CltGPvpResult) as MSG_Clt_G_PvpResult;
|
|
|
|
|
|
msg.mPB.IsWin = isWin;
|
2024-01-04 13:51:08 +08:00
|
|
|
|
msg.mPB.Key = key;
|
|
|
|
|
|
|
2024-01-03 14:56:46 +08:00
|
|
|
|
NetManager.Instance.SendMessage(msg);
|
|
|
|
|
|
}
|
2024-01-09 19:30:53 +08:00
|
|
|
|
|
|
|
|
|
|
public static void GetPvpOrderList(uint page)
|
|
|
|
|
|
{
|
|
|
|
|
|
MSG_Clt_Mg_PvpOrderList msg =
|
|
|
|
|
|
NetManager.Instance.GetMessage(MSGID.CltMgPvpOrderList) as MSG_Clt_Mg_PvpOrderList;
|
|
|
|
|
|
msg.mPB.Page = page;
|
|
|
|
|
|
|
|
|
|
|
|
NetManager.Instance.SendMessage(msg);
|
|
|
|
|
|
}
|
2024-01-15 13:36:39 +08:00
|
|
|
|
public static void PatioExchange(uint gachaId,uint index)
|
|
|
|
|
|
{
|
|
|
|
|
|
MSG_Clt_G_PatioExchange msg = NetManager.Instance.GetMessage(MSGID.CltGPatioExchange) as MSG_Clt_G_PatioExchange;
|
|
|
|
|
|
msg.mPB.GachaId = gachaId;
|
|
|
|
|
|
msg.mPB.Index = index;
|
|
|
|
|
|
NetManager.Instance.SendMessage(msg);
|
|
|
|
|
|
}
|
2024-05-23 13:43:35 +08:00
|
|
|
|
|
|
|
|
|
|
public static void InAppPurchase(string transaction_id,string product_id)
|
2024-01-31 19:16:16 +08:00
|
|
|
|
{
|
|
|
|
|
|
MSG_Clt_G_InAppPurchase msg = NetManager.Instance.GetMessage(MSGID.CltGInAppPurchase) as MSG_Clt_G_InAppPurchase;
|
2024-02-22 19:45:00 +08:00
|
|
|
|
msg.mPB.Platform = (int)PurchasePlatform.Ios;
|
2024-01-31 19:16:16 +08:00
|
|
|
|
msg.mPB.IsSandbox = true;
|
|
|
|
|
|
msg.mPB.TransactionId = transaction_id;
|
2024-05-23 13:43:35 +08:00
|
|
|
|
msg.mPB.ProductId = product_id;
|
2024-01-31 19:16:16 +08:00
|
|
|
|
NetManager.Instance.SendMessage(msg);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
2024-05-13 15:55:47 +08:00
|
|
|
|
/// <summary>
|
2024-05-14 20:10:28 +08:00
|
|
|
|
/// 物品转化(如使用物品,打开宝箱等
|
2024-05-13 15:55:47 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="consumeID">使用物品id</param>
|
|
|
|
|
|
/// <param name="consumeAmount">使用份数</param>
|
|
|
|
|
|
/// <param name="receivedID">获得物品id</param>
|
|
|
|
|
|
public static void ConvertResources(uint consumeID, uint consumeAmount, uint receivedID)
|
|
|
|
|
|
{
|
|
|
|
|
|
MSG_Clt_G_ExchangeItem msg = NetManager.Instance.GetMessage(MSGID.CltGExchangeItem) as MSG_Clt_G_ExchangeItem;
|
|
|
|
|
|
msg.mPB.Id = consumeID;
|
|
|
|
|
|
msg.mPB.Count = consumeAmount;
|
|
|
|
|
|
msg.mPB.TargetId = receivedID;
|
|
|
|
|
|
NetManager.Instance.mClient.SendMessage(msg);
|
|
|
|
|
|
}
|
2024-05-24 13:37:59 +08:00
|
|
|
|
|
|
|
|
|
|
public static void UseItem(uint consumeID, uint consumeAmount, uint receivedID = default)
|
|
|
|
|
|
{
|
|
|
|
|
|
MSG_Clt_G_UseItem msg = NetManager.Instance.GetMessage(MSGID.CltGUseItem) as MSG_Clt_G_UseItem;
|
|
|
|
|
|
msg.mPB.Id = consumeID;
|
|
|
|
|
|
msg.mPB.Count = consumeAmount;
|
|
|
|
|
|
msg.mPB.Param = receivedID;
|
|
|
|
|
|
NetManager.Instance.mClient.SendMessage(msg);
|
|
|
|
|
|
}
|
2024-06-05 14:04:26 +08:00
|
|
|
|
|
2024-07-10 12:04:44 +08:00
|
|
|
|
public static void BuyAlbum(uint AlbumItemID)
|
|
|
|
|
|
{
|
|
|
|
|
|
MSG_Clt_G_BuyAlbum msg = NetManager.Instance.GetMessage(MSGID.CltGBuyAlbum) as MSG_Clt_G_BuyAlbum;
|
|
|
|
|
|
msg.mPB.Id = AlbumItemID;
|
|
|
|
|
|
NetManager.Instance.mClient.SendMessage(msg);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-09-20 18:33:26 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 关卡扫荡
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="levelId"></param>
|
|
|
|
|
|
/// <param name="count"></param>
|
2024-10-17 15:18:51 +08:00
|
|
|
|
public static void LevelSweep(uint teamIndex, uint levelId, uint count)
|
2024-09-20 18:33:26 +08:00
|
|
|
|
{
|
|
|
|
|
|
MSG_Clt_G_LevelSweep msg = NetManager.Instance.GetMessage(MSGID.CltGLevelSweep) as MSG_Clt_G_LevelSweep;
|
2024-10-17 15:18:51 +08:00
|
|
|
|
msg.mPB.TeamIndex = teamIndex;
|
2024-09-20 18:33:26 +08:00
|
|
|
|
msg.mPB.LevelId = levelId;
|
|
|
|
|
|
msg.mPB.Count = count;
|
|
|
|
|
|
NetManager.Instance.mClient.SendMessage(msg);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-06-05 14:04:26 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 保存已经完成的引导组id
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="guideId"></param>
|
|
|
|
|
|
public static void SaveGuideProgress(uint guideId)
|
|
|
|
|
|
{
|
|
|
|
|
|
MSG_Clt_G_NewGuideProgress msg = NetManager.Instance.GetMessage(MSGID.CltGNewGuideProgress) as MSG_Clt_G_NewGuideProgress;
|
|
|
|
|
|
msg.mPB.Id = guideId;
|
|
|
|
|
|
NetManager.Instance.mClient.SendMessage(msg);
|
|
|
|
|
|
}
|
2024-06-19 14:21:14 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 设置玩家形象
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public static void SetPlayeHead(uint id)
|
|
|
|
|
|
{
|
|
|
|
|
|
MSG_Clt_G_SetHeadicon msg = NetManager.Instance.GetMessage(MSGID.CltGSetHeadicon) as MSG_Clt_G_SetHeadicon;
|
|
|
|
|
|
msg.mPB.Id = id;
|
|
|
|
|
|
NetManager.Instance.mClient.SendMessage(msg);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 设置玩家名
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="name"></param>
|
|
|
|
|
|
public static void SetPlayerName(string name)
|
|
|
|
|
|
{
|
|
|
|
|
|
MSG_Clt_G_SetNickname msg = NetManager.Instance.GetMessage(MSGID.CltGSetNickname) as MSG_Clt_G_SetNickname;
|
|
|
|
|
|
msg.mPB.Nickname = name;
|
|
|
|
|
|
NetManager.Instance.mClient.SendMessage(msg);
|
|
|
|
|
|
}
|
2024-10-11 18:17:51 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 设置玩家简介
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="text"></param>
|
|
|
|
|
|
public static void SetPlayerIntroduction(string text)
|
|
|
|
|
|
{
|
|
|
|
|
|
MSG_Clt_G_SetActorBase msg = NetManager.Instance.GetMessage(MSGID.CltGSetActorBase) as MSG_Clt_G_SetActorBase;
|
|
|
|
|
|
msg.mPB.Desc = text;
|
2024-10-11 19:15:56 +08:00
|
|
|
|
msg.mPB.Birthday = Actor.Instance.Base.Birthday;
|
2024-10-11 18:17:51 +08:00
|
|
|
|
NetManager.Instance.mClient.SendMessage(msg);
|
|
|
|
|
|
}
|
2024-10-11 19:15:56 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 设置玩家生日
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="date"></param>
|
2024-10-11 18:17:51 +08:00
|
|
|
|
public static void SetPlayerBirthday(string date)
|
|
|
|
|
|
{
|
|
|
|
|
|
MSG_Clt_G_SetActorBase msg = NetManager.Instance.GetMessage(MSGID.CltGSetActorBase) as MSG_Clt_G_SetActorBase;
|
2024-10-11 19:15:56 +08:00
|
|
|
|
msg.mPB.Desc = Actor.Instance.Base.Description;
|
2024-10-11 18:17:51 +08:00
|
|
|
|
msg.mPB.Birthday = date;
|
|
|
|
|
|
NetManager.Instance.mClient.SendMessage(msg);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-07-24 19:24:11 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 实名认证信息
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="name"></param>
|
|
|
|
|
|
/// <param name="ID"></param>
|
|
|
|
|
|
public static void SendAdultAuth(string name,string ID)
|
|
|
|
|
|
{
|
|
|
|
|
|
MSG_Clt_G_AdultAuth msg = NetManager.Instance.GetMessage(MSGID.CltGAdultAuth) as MSG_Clt_G_AdultAuth;
|
|
|
|
|
|
msg.mPB.Name = name;
|
|
|
|
|
|
msg.mPB.Id = ID;
|
|
|
|
|
|
NetManager.Instance.mClient.SendMessage(msg);
|
|
|
|
|
|
}
|
2024-10-16 19:40:37 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 验证字符串是否包含屏蔽字库
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public static void CheckString(string text)
|
|
|
|
|
|
{
|
|
|
|
|
|
MSG_Clt_G_StringCheck msg = NetManager.Instance.GetMessage(MSGID.CltGStringCheck) as MSG_Clt_G_StringCheck;
|
|
|
|
|
|
msg.mPB.Content = text;
|
|
|
|
|
|
NetManager.Instance.mClient.SendMessage(msg);
|
|
|
|
|
|
}
|
2023-08-22 19:08:45 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|