43 lines
1.7 KiB
C#
43 lines
1.7 KiB
C#
using ServerCommon;
|
|
using ServerCore; using ServerBase;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace GameServer
|
|
{
|
|
public static class SeasonPassNotifyHelper
|
|
{
|
|
public static bool send_S2C_NTF_SEASON_PASS_INFOS(this Player player)
|
|
{
|
|
var noti_packet = new ClientToGame();
|
|
noti_packet.Message = new();
|
|
noti_packet.Message.NtfSeasonPassInfo = new();
|
|
|
|
var server_logic = GameServerApp.getServerLogic();
|
|
var season_pass_manager = server_logic.getSeasonPassManager();
|
|
|
|
if (season_pass_manager.currentSeasonPass != 0)
|
|
{
|
|
var season_pass_attribute = player.getEntityAttribute<SeasonPassAttribute>();
|
|
NullReferenceCheckHelper.throwIfNull(season_pass_attribute, () => $"season_pass_attribute is null !!! - {player.toBasicString()}");
|
|
|
|
noti_packet.Message.NtfSeasonPassInfo.MetaId = season_pass_attribute.SeasonPassMetaId;
|
|
noti_packet.Message.NtfSeasonPassInfo.Exp = season_pass_attribute.Exp;
|
|
noti_packet.Message.NtfSeasonPassInfo.Grade = season_pass_attribute.Grade;
|
|
noti_packet.Message.NtfSeasonPassInfo.IsChargedPass = season_pass_attribute.IsChargedPass == true ? BoolType.True : BoolType.False;
|
|
noti_packet.Message.NtfSeasonPassInfo.TakenRewards.AddRange(season_pass_attribute.takenRewards);
|
|
}
|
|
|
|
if (false == GameServerApp.getServerLogic().onSendPacket(player, noti_packet))
|
|
{
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
}
|
|
}
|