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
|
|
|
|
|
|
{
|
|
|
|
|
|
// 发送服务器消息,请求角色养成
|
|
|
|
|
|
public static void CharacterUpgrade(uint nCharacterID, UpgradeType type, uint nTargetLevel)
|
|
|
|
|
|
{
|
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;
|
|
|
|
|
|
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-01-08 19:14:33 +08:00
|
|
|
|
public static void LevelGroupReward(uint nGroupID, uint nIndex)
|
2023-10-19 15:00:19 +08:00
|
|
|
|
{
|
2024-01-08 19:14:33 +08:00
|
|
|
|
MSG_Clt_G_GroupReward msg =
|
|
|
|
|
|
NetManager.Instance.GetMessage(NLDMID.MSGID.CltGGroupReward) as MSG_Clt_G_GroupReward;
|
|
|
|
|
|
msg.mPB.GroupId = nGroupID;
|
2023-10-19 15:00:19 +08:00
|
|
|
|
msg.mPB.Index = nIndex;
|
|
|
|
|
|
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-03-11 13:31:24 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 创建队伍
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="nIndex"></param>
|
|
|
|
|
|
/// <param name="name"></param>
|
|
|
|
|
|
/// <param name="nIcon"></param>
|
|
|
|
|
|
/// <param name="characterIDs"></param>
|
|
|
|
|
|
/// <param name="playerSkillIds"></param>
|
|
|
|
|
|
/// <param name="nVehicleID"></param>
|
2024-03-06 17:36:51 +08:00
|
|
|
|
public static void CreateTeam(uint nIndex, string name, uint nIcon, uint[] characterIDs, uint[] playerSkillIds, uint nVehicleID)
|
2023-10-19 15:00:19 +08:00
|
|
|
|
{
|
2024-01-03 14:56:46 +08:00
|
|
|
|
MSG_Clt_G_CreateTeam msg =
|
|
|
|
|
|
NetManager.Instance.GetMessage(NLDMID.MSGID.CltGCreateTeam) as MSG_Clt_G_CreateTeam;
|
2023-10-19 15:00:19 +08:00
|
|
|
|
msg.mPB.Name = name;
|
|
|
|
|
|
msg.mPB.Icon = nIcon;
|
|
|
|
|
|
msg.mPB.Index = nIndex;
|
|
|
|
|
|
|
|
|
|
|
|
msg.mPB.CharacterId.Clear();
|
2024-03-06 17:36:51 +08:00
|
|
|
|
for (int i = 0; i < characterIDs.Length; ++i)
|
2023-10-19 15:00:19 +08:00
|
|
|
|
msg.mPB.CharacterId.Add(characterIDs[i]);
|
2024-01-03 14:56:46 +08:00
|
|
|
|
|
2024-03-06 17:36:51 +08:00
|
|
|
|
msg.mPB.PlayerSkills.Clear();
|
|
|
|
|
|
for (int i = 0; i < playerSkillIds.Length; ++i)
|
|
|
|
|
|
msg.mPB.PlayerSkills.Add(playerSkillIds[i]);
|
|
|
|
|
|
|
2023-10-19 15:00:19 +08:00
|
|
|
|
msg.mPB.VehicleId = nVehicleID;
|
|
|
|
|
|
|
|
|
|
|
|
NetManager.Instance.mClient.SendMessage(msg);
|
|
|
|
|
|
}
|
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,则领取所有
|
|
|
|
|
|
public static void CliamMail(ulong id)
|
|
|
|
|
|
{
|
2024-04-15 19:34:15 +08:00
|
|
|
|
MSG_Clt_Ml_ClaimMailItems msg = NetManager.Instance.GetMessage(MSGID.CltMlClaimMailItems) as MSG_Clt_Ml_ClaimMailItems;
|
2023-12-06 15:00:26 +08:00
|
|
|
|
msg.mPB.MailId = id;
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
public static void SetDefenceTeamForPvp(uint[] characterIDs, uint vehicleID, byte[] teamData)
|
|
|
|
|
|
{
|
|
|
|
|
|
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);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
msg.mPB.VehicleId = vehicleID;
|
|
|
|
|
|
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-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);
|
|
|
|
|
|
}
|
2023-08-22 19:08:45 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|