diff --git a/SCHALE.Common/Database/Models/Game/Account.cs b/SCHALE.Common/Database/Models/Game/Account.cs index ad2d3bc..16ba73a 100644 --- a/SCHALE.Common/Database/Models/Game/Account.cs +++ b/SCHALE.Common/Database/Models/Game/Account.cs @@ -11,7 +11,7 @@ namespace SCHALE.Common.Database.Models.Game { [Key] [Column("_id")] - public uint ServerId { get; set; } + public required uint ServerId { get; set; } public AccountDB AccountDB { get; set; } diff --git a/SCHALE.Common/Database/Models/Game/Player.cs b/SCHALE.Common/Database/Models/Game/Player.cs new file mode 100644 index 0000000..865f82f --- /dev/null +++ b/SCHALE.Common/Database/Models/Game/Player.cs @@ -0,0 +1,14 @@ +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; + +namespace SCHALE.Common.Database.Models.Game +{ + public class Player + { + [Key] + [Column("_id")] + public required uint ServerId { get; set; } + + public List MissionProgressDBs { get; set; } + } +} diff --git a/SCHALE.Common/Database/SCHALEContext.cs b/SCHALE.Common/Database/SCHALEContext.cs index 1d55e4b..1f2dac6 100644 --- a/SCHALE.Common/Database/SCHALEContext.cs +++ b/SCHALE.Common/Database/SCHALEContext.cs @@ -12,6 +12,9 @@ namespace SCHALE.Common.Database public DbSet GuestAccounts { get; set; } public DbSet Accounts { get; set; } public DbSet Counters { get; set; } + public DbSet Players { get; set; } + + public Player CurrentPlayer { get { return Players.FirstOrDefault();} } // temp public SCHALEContext(DbContextOptions options) : base(options) { @@ -25,6 +28,10 @@ namespace SCHALE.Common.Database modelBuilder.Entity().ToCollection("guest_accounts"); modelBuilder.Entity().ToCollection("accounts"); + modelBuilder.Entity().ToCollection("players"); + + // attempt to fix MissionProgressDB.Dictionary ProgressParameters serialization + modelBuilder.Entity().Property(e => e.MissionProgressDBs).HasJsonConversion>(); modelBuilder.Entity().ToCollection("counters"); } diff --git a/SCHALE.Common/Database/ServicesExtesions.cs b/SCHALE.Common/Database/ServicesExtesions.cs index 8ec6137..c126540 100644 --- a/SCHALE.Common/Database/ServicesExtesions.cs +++ b/SCHALE.Common/Database/ServicesExtesions.cs @@ -1,5 +1,9 @@ using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata.Builders; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Microsoft.Extensions.DependencyInjection; +using Newtonsoft.Json; namespace SCHALE.Common.Database { @@ -13,4 +17,29 @@ namespace SCHALE.Common.Database }); } } + + public static class ValueConversionExtensions + { + public static PropertyBuilder HasJsonConversion(this PropertyBuilder propertyBuilder) where T : class, new() + { + ValueConverter converter = new ValueConverter + ( + v => JsonConvert.SerializeObject(v), + v => JsonConvert.DeserializeObject(v) ?? new T() + ); + + ValueComparer comparer = new ValueComparer + ( + (l, r) => JsonConvert.SerializeObject(l) == JsonConvert.SerializeObject(r), + v => v == null ? 0 : JsonConvert.SerializeObject(v).GetHashCode(), + v => JsonConvert.DeserializeObject(JsonConvert.SerializeObject(v)) + ); + + propertyBuilder.HasConversion(converter); + propertyBuilder.Metadata.SetValueConverter(converter); + propertyBuilder.Metadata.SetValueComparer(comparer); + + return propertyBuilder; + } + } } diff --git a/SCHALE.Common/Database/dbs.cs b/SCHALE.Common/Database/dbs.cs index 2105c0b..380e379 100644 --- a/SCHALE.Common/Database/dbs.cs +++ b/SCHALE.Common/Database/dbs.cs @@ -1,6 +1,9 @@ +using MongoDB.Bson.Serialization.Attributes; +using MongoDB.Bson.Serialization.Options; using SCHALE.Common.FlatData; using SCHALE.Common.NetworkProtocol; using SCHALE.Common.Parcel; +using System.ComponentModel.DataAnnotations.Schema; using System.Text.Json.Serialization; namespace SCHALE.Common.Database @@ -1528,9 +1531,12 @@ namespace SCHALE.Common.Database [JsonIgnore] public long AccountServerId { get; set; } + public long MissionUniqueId { get; set; } public bool Complete { get; set; } public DateTime StartTime { get; set; } + + [BsonDictionaryOptions(DictionaryRepresentation.ArrayOfArrays)] public Dictionary ProgressParameters { get; set; } } diff --git a/SCHALE.Common/NetworkProtocol/Packet.cs b/SCHALE.Common/NetworkProtocol/Packet.cs index f6cff6a..36d95cd 100644 --- a/SCHALE.Common/NetworkProtocol/Packet.cs +++ b/SCHALE.Common/NetworkProtocol/Packet.cs @@ -1,4 +1,5 @@ using SCHALE.Common.Database; +using SCHALE.Common.FlatData; using System.Text.Json.Serialization; namespace SCHALE.Common.NetworkProtocol @@ -39,7 +40,7 @@ namespace SCHALE.Common.NetworkProtocol public ServerNotificationFlag ServerNotification { get; set; } public List MissionProgressDBs { get; set; } public Dictionary> EventMissionProgressDBDict { get; set; } - // public Dictionary StaticOpenConditions { get; set; } + public Dictionary StaticOpenConditions { get; set; } } [Flags] diff --git a/SCHALE.Common/SCHALE.Common.csproj b/SCHALE.Common/SCHALE.Common.csproj index 0e1793f..68dc9d7 100644 --- a/SCHALE.Common/SCHALE.Common.csproj +++ b/SCHALE.Common/SCHALE.Common.csproj @@ -11,6 +11,7 @@ + diff --git a/SCHALE.GameServer/Controllers/Api/GatewayController.cs b/SCHALE.GameServer/Controllers/Api/GatewayController.cs index ba2f1ba..4a7deaa 100644 --- a/SCHALE.GameServer/Controllers/Api/GatewayController.cs +++ b/SCHALE.GameServer/Controllers/Api/GatewayController.cs @@ -6,6 +6,7 @@ using System.IO.Compression; using System.Text; using System.Text.Json; using System.Text.Json.Nodes; +using Serilog; namespace SCHALE.GameServer.Controllers.Api { @@ -45,6 +46,9 @@ namespace SCHALE.GameServer.Controllers.Api var jsonNode = JsonSerializer.Deserialize(payloadStr); var protocol = (Protocol?)jsonNode?["Protocol"]?.GetValue() ?? Protocol.None; + logger.LogDebug("Protocol: {Protocol}", protocol.ToString()); + logger.LogDebug("Protocol: {Protocol}", (int)protocol); + if (protocol == Protocol.None) { logger.LogWarning("Failed to read protocol from JsonNode, {Payload:j}", payloadStr); @@ -58,6 +62,9 @@ namespace SCHALE.GameServer.Controllers.Api goto protocolErrorRet; } + logger.LogDebug(Encoding.ASCII.GetString(payloadMs.ToArray())); + + var payload = (JsonSerializer.Deserialize(payloadStr, requestType) as RequestPacket)!; var rsp = protocolHandlerFactory.Invoke(protocol, payload); @@ -77,14 +84,13 @@ namespace SCHALE.GameServer.Controllers.Api protocol = ((BasePacket)rsp).Protocol.ToString() }); -protocolErrorRet: + protocolErrorRet: return Results.Json(new { packet = JsonSerializer.Serialize(new ErrorPacket() { Reason = "Protocol not implemented (Server Error)", ErrorCode = WebAPIErrorCode.InternalServerError }), protocol = Protocol.Error.ToString() }); - } - catch (Exception) + } catch (Exception) { throw; } diff --git a/SCHALE.GameServer/Controllers/Api/ProtocolHandlers/Academy.cs b/SCHALE.GameServer/Controllers/Api/ProtocolHandlers/Academy.cs index 5170cce..b21dcb9 100644 --- a/SCHALE.GameServer/Controllers/Api/ProtocolHandlers/Academy.cs +++ b/SCHALE.GameServer/Controllers/Api/ProtocolHandlers/Academy.cs @@ -1,4 +1,5 @@ -using SCHALE.Common.NetworkProtocol; +using SCHALE.Common.Database; +using SCHALE.Common.NetworkProtocol; namespace SCHALE.GameServer.Controllers.Api.ProtocolHandlers { @@ -9,13 +10,28 @@ namespace SCHALE.GameServer.Controllers.Api.ProtocolHandlers [ProtocolHandler(Protocol.Academy_GetInfo)] public ResponsePacket GetInfoHandler(AcademyGetInfoRequest req) { + //Context.CurrentPlayer.MissionProgressDBs + var MissionProgressDBs = new List { + new MissionProgressDB() { + MissionUniqueId = 1700, + Complete = false, + StartTime = DateTime.UtcNow, + ProgressParameters = new Dictionary + { + { 0, 2 } + } + } + }; + return new AcademyGetInfoResponse() { AcademyDB = new() { - AccountId = 1 + AccountId = Context.CurrentPlayer.ServerId, }, AcademyLocationDBs = [], + MissionProgressDBs = MissionProgressDBs, + //MissionProgressDBs = Context.CurrentPlayer.MissionProgressDBs, }; } } diff --git a/SCHALE.GameServer/Controllers/Api/ProtocolHandlers/Account.cs b/SCHALE.GameServer/Controllers/Api/ProtocolHandlers/Account.cs index 47a69e1..d997113 100644 --- a/SCHALE.GameServer/Controllers/Api/ProtocolHandlers/Account.cs +++ b/SCHALE.GameServer/Controllers/Api/ProtocolHandlers/Account.cs @@ -2,10 +2,11 @@ using SCHALE.Common.FlatData; using SCHALE.Common.NetworkProtocol; using SCHALE.Common.Parcel; +using SCHALE.Common.Database.Models.Game; using Serilog; namespace SCHALE.GameServer.Controllers.Api.ProtocolHandlers -{ +{ public class Account : ProtocolHandlerBase { public Account(IServiceScopeFactory scopeFactory, IProtocolHandlerFactory protocolHandlerFactory) : base(scopeFactory, protocolHandlerFactory) { } @@ -17,7 +18,7 @@ namespace SCHALE.GameServer.Controllers.Api.ProtocolHandlers string[] uid_token = req.EnterTicket.Split(':'); var account = Context.GuestAccounts.SingleOrDefault(x => x.Uid == uint.Parse(uid_token[0]) && x.Token == uid_token[1]); - + if (account is null) { return new AccountCheckYostarResponse() @@ -49,8 +50,7 @@ namespace SCHALE.GameServer.Controllers.Api.ProtocolHandlers { ErrorCode = WebAPIErrorCode.AccountAuthNotCreated }; - } - else + } else { return new AccountAuthResponse() { @@ -61,8 +61,111 @@ namespace SCHALE.GameServer.Controllers.Api.ProtocolHandlers { AccountServerId = account.ServerId, MxToken = req.SessionKey.MxToken, + }, + + MissionProgressDBs = new List + { + new MissionProgressDB + { + MissionUniqueId = 1501, + Complete = true, + StartTime = DateTime.Parse("2024-04-26T20:46:44") }, + new MissionProgressDB + { + MissionUniqueId = 1700, + StartTime = DateTime.Parse("2024-04-26T20:46:44"), + ProgressParameters = new Dictionary { { 0, 1 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1500, + Complete = true, + StartTime = DateTime.Parse("2024-04-26T20:46:44") }, + new MissionProgressDB + { + MissionUniqueId = 2200, + StartTime = DateTime.Parse("2024-04-26T20:46:44"), + ProgressParameters = new Dictionary { { 0, 1 }, { 1, 5 } } + }, + new MissionProgressDB + { + MissionUniqueId = 300000, + StartTime = DateTime.Parse("2024-04-26T20:46:44"), + ProgressParameters = new Dictionary { { 0, 1 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1000210, + Complete = true, + StartTime = DateTime.Parse("2024-04-26T20:46:44"), + ProgressParameters = new Dictionary { { 0, 1 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1000220, + Complete = true, + StartTime = DateTime.Parse("2024-04-26T20:46:44"), + ProgressParameters = new Dictionary { { 0, 1 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1000230, + Complete = true, + StartTime = DateTime.Parse("2024-04-26T20:46:44"), + ProgressParameters = new Dictionary { { 0, 1 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1000240, + Complete = true, + StartTime = DateTime.Parse("2024-04-26T20:46:44"), + ProgressParameters = new Dictionary { { 0, 1 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1000250, + Complete = true, + StartTime = DateTime.Parse("2024-04-26T20:46:44"), + ProgressParameters = new Dictionary { { 0, 1 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1000260, + Complete = true, + StartTime = DateTime.Parse("2024-04-26T20:46:44"), + ProgressParameters = new Dictionary { { 0, 1 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1000270, + Complete = true, + StartTime = DateTime.Parse("2024-04-26T20:46:44"), + ProgressParameters = new Dictionary { { 0, 1 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1001327, + Complete = true, + StartTime = DateTime.Parse("2024-04-26T20:46:44"), + ProgressParameters = new Dictionary { { 0, 1 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1001357, + Complete = true, + StartTime = DateTime.Parse("2024-04-26T20:46:44"), + ProgressParameters = new Dictionary { { 0, 1 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1001377, + Complete = true, + StartTime = DateTime.Parse("2024-04-26T20:46:44"), + ProgressParameters = new Dictionary { { 0, 1 } } + }, } }; + } } @@ -72,6 +175,9 @@ namespace SCHALE.GameServer.Controllers.Api.ProtocolHandlers var account = Common.Database.Models.Game.Account.Create((uint)req.AccountId); Context.Accounts.Add(account); + + Context.Players.Add(new Player() { ServerId = (uint)req.AccountId }); + Context.SaveChanges(); Log.Information("Account Created " + Context.Accounts.Count()); @@ -90,7 +196,7 @@ namespace SCHALE.GameServer.Controllers.Api.ProtocolHandlers public ResponsePacket NicknameHandler(AccountNicknameRequest req) { var account = Context.Accounts.SingleOrDefault(x => x.ServerId == req.AccountId); - + account.AccountDB.Nickname = req.Nickname; Context.SaveChanges(); @@ -169,7 +275,7 @@ namespace SCHALE.GameServer.Controllers.Api.ProtocolHandlers { return new ShopBeforehandGachaGetResponse() { - SessionKey = new () + SessionKey = new() { MxToken = req.SessionKey.MxToken, AccountServerId = req.SessionKey.AccountServerId, @@ -186,6 +292,16 @@ namespace SCHALE.GameServer.Controllers.Api.ProtocolHandlers }; } + + [ProtocolHandler(Protocol.EventContent_CollectionList)] + public ResponsePacket EventContent_CollectionListHandler(EventContentCollectionListRequest req) + { + + return new EventContentCollectionListResponse() + { + + }; + } } - + } diff --git a/SCHALE.GameServer/Controllers/Api/ProtocolHandlers/Mission.cs b/SCHALE.GameServer/Controllers/Api/ProtocolHandlers/Mission.cs index b748079..2e058b4 100644 --- a/SCHALE.GameServer/Controllers/Api/ProtocolHandlers/Mission.cs +++ b/SCHALE.GameServer/Controllers/Api/ProtocolHandlers/Mission.cs @@ -1,4 +1,6 @@ -using SCHALE.Common.NetworkProtocol; +using SCHALE.Common.Database; +using SCHALE.Common.NetworkProtocol; +using Serilog; namespace SCHALE.GameServer.Controllers.Api.ProtocolHandlers { @@ -9,9 +11,338 @@ namespace SCHALE.GameServer.Controllers.Api.ProtocolHandlers [ProtocolHandler(Protocol.Mission_List)] public ResponsePacket ListHandler(MissionListRequest req) { - return new MissionListResponse() - { + var player = Context.Players.SingleOrDefault(x => x.ServerId == req.AccountId); + Log.Information($"MissionListRequest EventContentId: {req.EventContentId}"); + + Context.CurrentPlayer.MissionProgressDBs = new List + { + new MissionProgressDB + { + MissionUniqueId = 1501, + Complete = true, + StartTime = DateTime.Now }, + new MissionProgressDB + { + MissionUniqueId = 1700, + StartTime = DateTime.Now, + ProgressParameters = new Dictionary { { 0, 2 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1500, + Complete = true, + StartTime = DateTime.Now }, + new MissionProgressDB + { + MissionUniqueId = 2200, + StartTime = DateTime.Now, + ProgressParameters = new Dictionary { { 0, 1 }, { 1, 5 } } + }, + new MissionProgressDB + { + MissionUniqueId = 300000, + StartTime = DateTime.Now, + ProgressParameters = new Dictionary { { 0, 1 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1000210, + Complete = true, + StartTime = DateTime.Now, + ProgressParameters = new Dictionary { { 0, 1 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1000220, + Complete = true, + StartTime = DateTime.Now, + ProgressParameters = new Dictionary { { 0, 1 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1000230, + Complete = true, + StartTime = DateTime.Now, + ProgressParameters = new Dictionary { { 0, 1 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1000240, + Complete = true, + StartTime = DateTime.Now, + ProgressParameters = new Dictionary { { 0, 1 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1000250, + Complete = true, + StartTime = DateTime.Now, + ProgressParameters = new Dictionary { { 0, 1 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1000260, + Complete = true, + StartTime = DateTime.Now, + ProgressParameters = new Dictionary { { 0, 1 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1000270, + Complete = true, + StartTime = DateTime.Now, + ProgressParameters = new Dictionary { { 0, 1 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1001327, + Complete = true, + StartTime = DateTime.Now, + ProgressParameters = new Dictionary { { 0, 1 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1001357, + Complete = true, + StartTime = DateTime.Now, + ProgressParameters = new Dictionary { { 0, 1 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1001377, + Complete = true, + StartTime = DateTime.Now, + ProgressParameters = new Dictionary { { 0, 1 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1001011, + StartTime = DateTime.Now, + ProgressParameters = new Dictionary { { 0, 1 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1001014, + StartTime = DateTime.Now, + ProgressParameters = new Dictionary { { 0, 0 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1001015, + StartTime = DateTime.Now, + ProgressParameters = new Dictionary { { 13003, 1 }, { 13010, 1 }, { 16003, 1 }, { 26000, 1 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1001016, + StartTime = DateTime.Now, + ProgressParameters = new Dictionary { { 0, 0 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1001019, + StartTime = DateTime.Now, + ProgressParameters = new Dictionary { { 0, 4 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1001020, + Complete = true, + StartTime = DateTime.Now, + ProgressParameters = new Dictionary { { 0, 1 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1001021, + StartTime = DateTime.Now, + ProgressParameters = new Dictionary { { 0, 1 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1001025, + StartTime = DateTime.Now, + ProgressParameters = new Dictionary { { 13003, 1 }, { 13010, 1 }, { 16003, 1 }, { 26000, 1 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1001026, + StartTime = DateTime.Now, + ProgressParameters = new Dictionary { { 0, 0 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1001028, + StartTime = DateTime.Now, + ProgressParameters = new Dictionary { { 0, 0 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1001030, + StartTime = DateTime.Now, + ProgressParameters = new Dictionary { { 1, 0 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1001031, + StartTime = DateTime.Now, + ProgressParameters = new Dictionary { { 0, 1 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1001036, + StartTime = DateTime.Now, + ProgressParameters = new Dictionary { { 13003, 1 }, { 13010, 1 }, { 16003, 1 }, { 26000, 1 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1001037, + StartTime = DateTime.Now, + ProgressParameters = new Dictionary { { 0, 0 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1001039, + StartTime = DateTime.Now, + ProgressParameters = new Dictionary { { 0, 1 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1001041, + StartTime = DateTime.Now, + ProgressParameters = new Dictionary { { 0, 1 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1001046, + StartTime = DateTime.Now, + ProgressParameters = new Dictionary { { 13003, 1 }, { 13010, 1 }, { 16003, 1 }, { 26000, 1 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1001050, + StartTime = DateTime.Now, + ProgressParameters = new Dictionary { { 0, 0 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1001051, + StartTime = DateTime.Now, + ProgressParameters = new Dictionary { { 0, 1 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1001055, + StartTime = DateTime.Now, + ProgressParameters = new Dictionary { { 1, 0 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1001056, + StartTime = DateTime.Now, + ProgressParameters = new Dictionary { { 13003, 1 }, { 13010, 1 }, { 16003, 1 }, { 26000, 1 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1001057, + StartTime = DateTime.Now, + ProgressParameters = new Dictionary { { 0, 0 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1001059, + StartTime = DateTime.Now, + ProgressParameters = new Dictionary { { 0, 0 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1001060, + StartTime = DateTime.Now, + ProgressParameters = new Dictionary { { 0, 0 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1001061, + StartTime = DateTime.Now, + ProgressParameters = new Dictionary { { 0, 1 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1001065, + StartTime = DateTime.Now, + ProgressParameters = new Dictionary { { 13003, 1 }, { 13010, 1 }, { 16003, 1 }, { 26000, 1 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1001067, + StartTime = DateTime.Now, + ProgressParameters = new Dictionary { { 0, 0 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1001069, + StartTime = DateTime.Now, + ProgressParameters = new Dictionary { { 0, 0 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1001070, + StartTime = DateTime.Now, + ProgressParameters = new Dictionary { { 0, 0 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1001071, + StartTime = DateTime.Now, + ProgressParameters = new Dictionary { { 0, 1 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1001075, + StartTime = DateTime.Now, + ProgressParameters = new Dictionary { { 13003, 1 }, { 13010, 1 }, { 16003, 1 }, { 26000, 1 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1001079, + StartTime = DateTime.Now, + ProgressParameters = new Dictionary { { 7, 0 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1001080, + StartTime = DateTime.Now, + ProgressParameters = new Dictionary { { 0, 0 } } + }, + new MissionProgressDB + { + MissionUniqueId = 1001013, + StartTime = DateTime.Now }, + new MissionProgressDB + { + MissionUniqueId = 1001023, + StartTime = DateTime.Now }, + new MissionProgressDB + { + MissionUniqueId = 1001034, + StartTime = DateTime.Now }, + new MissionProgressDB + { + MissionUniqueId = 1001044, + StartTime = DateTime.Now }, + new MissionProgressDB + { + MissionUniqueId = 1001054, + StartTime = DateTime.Now }, + }; + + //Context.CurrentPlayer.MissionProgressDBs = []; + Context.SaveChanges(); + + return new MissionListResponse + { + //ProgressDBs = Context.CurrentPlayer.MissionProgressDBs + ProgressDBs = Context.CurrentPlayer.MissionProgressDBs }; } diff --git a/SCHALE.GameServer/Controllers/Api/ProtocolHandlers/Scenario.cs b/SCHALE.GameServer/Controllers/Api/ProtocolHandlers/Scenario.cs index 2fc7921..ce4d2cc 100644 --- a/SCHALE.GameServer/Controllers/Api/ProtocolHandlers/Scenario.cs +++ b/SCHALE.GameServer/Controllers/Api/ProtocolHandlers/Scenario.cs @@ -1,4 +1,5 @@ using SCHALE.Common.NetworkProtocol; +using Serilog; namespace SCHALE.GameServer.Controllers.Api.ProtocolHandlers { @@ -9,6 +10,9 @@ namespace SCHALE.GameServer.Controllers.Api.ProtocolHandlers [ProtocolHandler(Protocol.Scenario_Skip)] public ResponsePacket SkipHandler(ScenarioSkipRequest req) { + Log.Information($"ScenarioSkipRequest ScriptGroupId:" + req.ScriptGroupId); + Log.Information($"ScenarioSkipRequest SkipPointScriptCount: " + req.SkipPointScriptCount); + // skip story doesn't work yet, probably need to implement missiondb return new ScenarioSkipResponse() {