stage reward for item type
This commit is contained in:
parent
cf82daad00
commit
1f4b0b660f
|
@ -2375,7 +2375,7 @@ namespace AscNet.Common.MsgPack
|
||||||
{
|
{
|
||||||
public Int32 ChallengeCount { get; set; }
|
public Int32 ChallengeCount { get; set; }
|
||||||
public UInt32 StageId { get; set; }
|
public UInt32 StageId { get; set; }
|
||||||
public List<UInt32> CardIds { get; set; } = new();
|
public List<UInt32>? CardIds { get; set; } = new();
|
||||||
public Int32 FirstFightPos { get; set; }
|
public Int32 FirstFightPos { get; set; }
|
||||||
public Int32 CaptainPos { get; set; }
|
public Int32 CaptainPos { get; set; }
|
||||||
public Boolean IsHasAssist { get; set; }
|
public Boolean IsHasAssist { get; set; }
|
||||||
|
@ -2452,11 +2452,11 @@ namespace AscNet.Common.MsgPack
|
||||||
public class FightSettleResponseSettle
|
public class FightSettleResponseSettle
|
||||||
{
|
{
|
||||||
public Boolean IsWin { get; set; }
|
public Boolean IsWin { get; set; }
|
||||||
public UInt32 StageId { get; set; }
|
public long StageId { get; set; }
|
||||||
public Int32 StarsMark { get; set; }
|
public Int32 StarsMark { get; set; }
|
||||||
public List<dynamic> RewardGoodsList { get; set; } = new();
|
public List<RewardGoods> RewardGoodsList { get; set; } = new();
|
||||||
public Int32 LeftTime { get; set; }
|
public Int32 LeftTime { get; set; }
|
||||||
public Dictionary<dynamic, dynamic> NpcHpInfo { get; set; }
|
public dynamic? NpcHpInfo { get; set; }
|
||||||
public Int32 UrgentEnventId { get; set; }
|
public Int32 UrgentEnventId { get; set; }
|
||||||
public dynamic? ClientAssistInfo { get; set; }
|
public dynamic? ClientAssistInfo { get; set; }
|
||||||
public List<dynamic> FlopRewardList { get; set; } = new();
|
public List<dynamic> FlopRewardList { get; set; } = new();
|
||||||
|
@ -2574,26 +2574,26 @@ namespace AscNet.Common.MsgPack
|
||||||
public Int32 Count { get; set; }
|
public Int32 Count { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[global::MessagePack.MessagePackObject(true)]
|
||||||
|
public class RewardGoods
|
||||||
|
{
|
||||||
|
public Int32 RewardType { get; set; }
|
||||||
|
public Int32 TemplateId { get; set; }
|
||||||
|
public Int32 Count { get; set; }
|
||||||
|
public Int32 Level { get; set; }
|
||||||
|
public Int32 Quality { get; set; }
|
||||||
|
public Int32 Grade { get; set; }
|
||||||
|
public Int32 Breakthrough { get; set; }
|
||||||
|
public Int32 ConvertFrom { get; set; }
|
||||||
|
public Int32 Id { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
[global::MessagePack.MessagePackObject(true)]
|
[global::MessagePack.MessagePackObject(true)]
|
||||||
public class ItemUseResponse
|
public class ItemUseResponse
|
||||||
{
|
{
|
||||||
public Int32 Code { get; set; }
|
public Int32 Code { get; set; }
|
||||||
[global::MessagePack.MessagePackObject(true)]
|
|
||||||
public class ItemUseResponseRewardGoods
|
|
||||||
{
|
|
||||||
public Int32 RewardType { get; set; }
|
|
||||||
public Int32 TemplateId { get; set; }
|
|
||||||
public UInt32 Count { get; set; }
|
|
||||||
public Int32 Level { get; set; }
|
|
||||||
public Int32 Quality { get; set; }
|
|
||||||
public Int32 Grade { get; set; }
|
|
||||||
public Int32 Breakthrough { get; set; }
|
|
||||||
public Int32 ConvertFrom { get; set; }
|
|
||||||
public UInt32 Id { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<ItemUseResponseRewardGoods> RewardGoodsList { get; set; } = new();
|
public List<RewardGoods> RewardGoodsList { get; set; } = new();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -106,10 +106,12 @@ namespace AscNet.Common.Util
|
||||||
prop.PropertyType.GetMethod("Add").Invoke(prop.GetValue(obj), new object[] { value });
|
prop.PropertyType.GetMethod("Add").Invoke(prop.GetValue(obj), new object[] { value });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (prop.PropertyType == typeof(int))
|
else if (prop.PropertyType == typeof(int) || prop.PropertyType == typeof(int?))
|
||||||
{
|
{
|
||||||
// For int properties like GroupId
|
if (!string.IsNullOrEmpty(values[i]))
|
||||||
prop.SetValue(obj, int.Parse(values[i]));
|
prop.SetValue(obj, int.Parse(values[i]));
|
||||||
|
else
|
||||||
|
prop.SetValue(obj, null);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -91,8 +91,10 @@ namespace AscNet.GameServer.Handlers
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
player = Player.FromToken(request.Token);
|
player = Player.FromToken(request.Token);
|
||||||
|
session.log.Debug("Player is reconnecting into new session...");
|
||||||
if (player is not null && (session.character is null || session.stage is null || session.inventory is null))
|
if (player is not null && (session.character is null || session.stage is null || session.inventory is null))
|
||||||
{
|
{
|
||||||
|
session.log.Debug("Reassigning player props...");
|
||||||
session.character = Character.FromUid(player.PlayerData.Id);
|
session.character = Character.FromUid(player.PlayerData.Id);
|
||||||
session.stage = Stage.FromUid(player.PlayerData.Id);
|
session.stage = Stage.FromUid(player.PlayerData.Id);
|
||||||
session.inventory = Inventory.FromUid(player.PlayerData.Id);
|
session.inventory = Inventory.FromUid(player.PlayerData.Id);
|
||||||
|
@ -219,7 +221,7 @@ Sorry for the inconvenience.
|
||||||
});
|
});
|
||||||
|
|
||||||
NotifyWorldChat notifyWorldChat = new();
|
NotifyWorldChat notifyWorldChat = new();
|
||||||
notifyWorldChat.ChatMessages.Add(ChatModule.MakeLuciaMessage($"Hello {session.player.PlayerData.Name}! Welcome to AscNet, please read mails if you haven't already.\n如果您还没有阅读邮件,请阅读邮件"));
|
notifyWorldChat.ChatMessages.Add(ChatModule.MakeLuciaMessage($"Hello {session.player.PlayerData.Name}! Welcome to AscNet, please read mails if you haven't already.\n如果您还没有阅读邮件,请阅读邮件\n\nTry '/help' to get started"));
|
||||||
|
|
||||||
session.SendPush(notifyMails);
|
session.SendPush(notifyMails);
|
||||||
session.SendPush(notifyWorldChat);
|
session.SendPush(notifyWorldChat);
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,26 @@
|
||||||
|
using MessagePack;
|
||||||
|
|
||||||
|
namespace AscNet.GameServer.Handlers
|
||||||
|
{
|
||||||
|
|
||||||
|
#region MsgPackScheme
|
||||||
|
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
|
||||||
|
[MessagePackObject(true)]
|
||||||
|
public class GetVoteGroupListResponse
|
||||||
|
{
|
||||||
|
public List<dynamic> VoteGroupListCode;
|
||||||
|
}
|
||||||
|
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
internal class VoteModule
|
||||||
|
{
|
||||||
|
[RequestPacketHandler("GetVoteGroupListRequest")]
|
||||||
|
public static void GetVoteGroupListRequestHandler(Session session, Packet.Request packet)
|
||||||
|
{
|
||||||
|
GetVoteGroupListResponse response = new();
|
||||||
|
|
||||||
|
session.SendResponse(response, packet.Id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -57,12 +57,13 @@ namespace AscNet.GameServer
|
||||||
while (readbytes < len)
|
while (readbytes < len)
|
||||||
{
|
{
|
||||||
int packetLen = BinaryPrimitives.ReadInt32LittleEndian(msg.AsSpan()[readbytes..]);
|
int packetLen = BinaryPrimitives.ReadInt32LittleEndian(msg.AsSpan()[readbytes..]);
|
||||||
readbytes += 4;
|
if (len > 0)
|
||||||
|
readbytes += 4;
|
||||||
if (packetLen < 1)
|
if (packetLen < 1)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if (packetLen > len)
|
else if (packetLen > len && len > 0)
|
||||||
{
|
{
|
||||||
prevBuf += len;
|
prevBuf += len;
|
||||||
break;
|
break;
|
||||||
|
@ -132,7 +133,7 @@ namespace AscNet.GameServer
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
log.Error("Failed to invoke handler: " + ex.Message + $", Raw {packet.Type} packet: " + BitConverter.ToString(debugContent).Replace("-", ""));
|
log.Error("Failed to invoke handler: " + ex.ToString() + $", Raw {packet.Type} packet: " + BitConverter.ToString(debugContent).Replace("-", ""));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ using AscNet.GameServer.Handlers;
|
||||||
using AscNet.GameServer.Commands;
|
using AscNet.GameServer.Commands;
|
||||||
using AscNet.Logging;
|
using AscNet.Logging;
|
||||||
using AscNet.Common.Util;
|
using AscNet.Common.Util;
|
||||||
|
using AscNet.Table.V2.share.reward;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace AscNet
|
namespace AscNet
|
||||||
|
@ -18,6 +19,7 @@ namespace AscNet
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
if (Common.Common.config.VerboseLevel < Common.VerboseLevel.Debug)
|
if (Common.Common.config.VerboseLevel < Common.VerboseLevel.Debug)
|
||||||
Common.Common.config.VerboseLevel = Common.VerboseLevel.Debug;
|
Common.Common.config.VerboseLevel = Common.VerboseLevel.Debug;
|
||||||
|
// LoggerFactory.Logger.Debug(JsonConvert.SerializeObject(TableReaderV2.Parse<RewardTable>().Where(x => x.Id == null).SelectMany(x => x.SubIds)));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
PacketFactory.LoadPacketHandlers();
|
PacketFactory.LoadPacketHandlers();
|
||||||
|
|
Loading…
Reference in New Issue