forked from PGR/ascnet
1
0
Fork 0

use the premade json for TaskData

This commit is contained in:
Master 2023-10-11 22:44:58 +02:00
parent 1930b527db
commit c09b6daadc
2 changed files with 12 additions and 16 deletions

View File

@ -199,11 +199,11 @@ namespace AscNet.GameServer.Handlers
};
session.SendPush(notifySocialData);
// NotifyTaskData notifyTaskData = JsonConvert.DeserializeObject<NotifyTaskData>(File.ReadAllText("Data/NotifyTaskData.json"))!;
NotifyTaskData notifyTaskData = new()
{
TaskData = { }
};
NotifyTaskData notifyTaskData = JsonConvert.DeserializeObject<NotifyTaskData>(File.ReadAllText("Data/NotifyTaskData.json"))!;
//NotifyTaskData notifyTaskData = new()
//{
// TaskData = { }
//};
session.SendPush(notifyTaskData);
NotifyActivenessStatus notifyActivenessStatus = new()

View File

@ -1,10 +1,6 @@
using AscNet.Common.MsgPack;
using System.Text.Json;
using Newtonsoft.Json;
using System.Reflection;
using AscNet.GameServer;
using MessagePack;
using static AscNet.GameServer.Packet;
namespace AscNet.Test
{
@ -12,14 +8,14 @@ namespace AscNet.Test
{
static void Main(string[] args)
{
string lines = File.ReadAllText("Data/NotifyLogin.json");
NotifyLogin notifyLogin = System.Text.Json.JsonSerializer.Deserialize<NotifyLogin>(lines)!;
NotifyLogin notifyLoginNew = JsonConvert.DeserializeObject<NotifyLogin>(lines)!;
foreach (PropertyCompareResult resultItem in Compare(notifyLogin, notifyLoginNew))
try
{
Console.WriteLine(" Property name: {0} -- old: {1}, new: {2}",
resultItem.Name, resultItem.OldValue ?? "<null>", resultItem.NewValue ?? "<null>");
NotifyLogin notifyLoginNew = JsonConvert.DeserializeObject<NotifyLogin>(File.ReadAllText("Data/NotifyLogin.json"))!;
NotifyTaskData notifyTaskData = JsonConvert.DeserializeObject<NotifyTaskData>(File.ReadAllText("Data/NotifyTaskData.json"))!;
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
}