misc fixes

This commit is contained in:
Mikhail Thompson
2024-06-28 19:44:26 +03:00
parent 28f6473bb9
commit c7250cdf24
7 changed files with 133 additions and 22 deletions

View File

@@ -1,9 +1,4 @@
using nksrv.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace nksrv.LobbyServer.Msgs.Character
{
@@ -12,11 +7,14 @@ namespace nksrv.LobbyServer.Msgs.Character
{
protected override async Task HandleAsync()
{
var req = ReadData<ReqGetCharacterData>();
var req = await ReadData<ReqGetCharacterData>();
var user = GetUser();
var response = new ResGetCharacterData();
// TODO implement
foreach (var item in user.Characters)
{
response.Character.Add(new NetUserCharacterData() { Default = new() { Csn = item.Csn, Skill1Lv = item.Skill1Lvl, Skill2Lv = item.Skill2Lvl, CostumeId = item.CostumeId, Lv = item.Level, Grade = item.Grade, Tid = item.Tid } });
}
WriteData(response);
}

View File

@@ -0,0 +1,18 @@
using nksrv.Utils;
namespace nksrv.LobbyServer.Msgs.Messenger
{
[PacketPath("/messenger/proceed")]
public class ProceedMsg : LobbyMsgHandler
{
protected override async Task HandleAsync()
{
var req = ReadData<ReqProceedMessage>();
// TODO: save these things
var response = new ResProceedMessage();
WriteData(response);
}
}
}

View File

@@ -0,0 +1,27 @@
using nksrv.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace nksrv.LobbyServer.Msgs.Team
{
[PacketPath("/team/setteam")]
public class SetTeam : LobbyMsgHandler
{
protected override async Task HandleAsync()
{
var req = await ReadData<ReqSetTeam>();
var user = GetUser();
var response = new ResSetTeam();
response.Type = req.Type;
response.Teams.AddRange(req.Teams.ToArray());
// TODO
WriteData(response);
}
}
}

View File

@@ -73,17 +73,17 @@ namespace nksrv.LobbyServer.Msgs.User
}
// TODO: Save outpost data
//response.Outposts.Add(new NetUserOutpostData() { SlotId = 1, BuildingId = 22401, IsDone = true, StartAt = 638549982076760660, CompleteAt = 638549982076760660 });
//response.Outposts.Add(new NetUserOutpostData() { SlotId = 4, BuildingId = 22701, IsDone = true, StartAt = 638549982076760660, CompleteAt = 638549982076760660 });
//response.Outposts.Add(new NetUserOutpostData() { SlotId = 5, BuildingId = 22801, IsDone = true, StartAt = 638549982076760660, CompleteAt = 638549982076760660 });
//response.Outposts.Add(new NetUserOutpostData() { SlotId = 6, BuildingId = 22901, IsDone = true, StartAt = 638549982076760660, CompleteAt = 638549982076760660 });
//response.Outposts.Add(new NetUserOutpostData() { SlotId = 7, BuildingId = 23001, IsDone = true, StartAt = 638549982076760660, CompleteAt = 638549982076760660 });
//response.Outposts.Add(new NetUserOutpostData() { SlotId = 3, BuildingId = 23101, IsDone = true, StartAt = 638549982076760660, CompleteAt = 638549982076760660 });
//response.Outposts.Add(new NetUserOutpostData() { SlotId = 2, BuildingId = 23201, IsDone = true, StartAt = 638549982076760660, CompleteAt = 638549982076760660 });
//response.Outposts.Add(new NetUserOutpostData() { SlotId = 9, BuildingId = 23301, IsDone = true, StartAt = 638549982076760660, CompleteAt = 638549982076760660 });
//response.Outposts.Add(new NetUserOutpostData() { SlotId = 8, BuildingId = 23401, IsDone = true, StartAt = 638549982076760660, CompleteAt = 638549982076760660 });
//response.Outposts.Add(new NetUserOutpostData() { SlotId = 10, BuildingId = 23501, IsDone = true, StartAt = 638549982076760660, CompleteAt = 638549982076760660 });
//response.Outposts.Add(new NetUserOutpostData() { SlotId = 38, BuildingId = 33601, IsDone = true, StartAt = 638549982076760660, CompleteAt = 638549982076760660 });
response.Outposts.Add(new NetUserOutpostData() { SlotId = 1, BuildingId = 22401, IsDone = true, StartAt = 638549982076760660, CompleteAt = 638549982076760660 });
response.Outposts.Add(new NetUserOutpostData() { SlotId = 4, BuildingId = 22701, IsDone = true, StartAt = 638549982076760660, CompleteAt = 638549982076760660 });
response.Outposts.Add(new NetUserOutpostData() { SlotId = 5, BuildingId = 22801, IsDone = true, StartAt = 638549982076760660, CompleteAt = 638549982076760660 });
response.Outposts.Add(new NetUserOutpostData() { SlotId = 6, BuildingId = 22901, IsDone = true, StartAt = 638549982076760660, CompleteAt = 638549982076760660 });
response.Outposts.Add(new NetUserOutpostData() { SlotId = 7, BuildingId = 23001, IsDone = true, StartAt = 638549982076760660, CompleteAt = 638549982076760660 });
response.Outposts.Add(new NetUserOutpostData() { SlotId = 3, BuildingId = 23101, IsDone = true, StartAt = 638549982076760660, CompleteAt = 638549982076760660 });
response.Outposts.Add(new NetUserOutpostData() { SlotId = 2, BuildingId = 23201, IsDone = true, StartAt = 638549982076760660, CompleteAt = 638549982076760660 });
response.Outposts.Add(new NetUserOutpostData() { SlotId = 9, BuildingId = 23301, IsDone = true, StartAt = 638549982076760660, CompleteAt = 638549982076760660 });
response.Outposts.Add(new NetUserOutpostData() { SlotId = 8, BuildingId = 23401, IsDone = true, StartAt = 638549982076760660, CompleteAt = 638549982076760660 });
response.Outposts.Add(new NetUserOutpostData() { SlotId = 10, BuildingId = 23501, IsDone = true, StartAt = 638549982076760660, CompleteAt = 638549982076760660 });
response.Outposts.Add(new NetUserOutpostData() { SlotId = 38, BuildingId = 33601, IsDone = true, StartAt = 638549982076760660, CompleteAt = 638549982076760660 });
response.LastClearedNormalMainStageId = user.LastStageCleared;

View File

@@ -0,0 +1,24 @@
using nksrv.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace nksrv.LobbyServer.Msgs.User
{
[PacketPath("/User/GetProfile")]
public class GetUserProfile : LobbyMsgHandler
{
protected override async Task HandleAsync()
{
var req = await ReadData<ReqGetProfileData>();
var response = new ResGetProfileData();
Console.WriteLine(req.TargetUsn);
response.Data = new NetProfileData();
WriteData(response);
}
}
}

View File

@@ -1521,14 +1521,15 @@ message NetProfileData {
// TODO
}
message ResGetProfileData {
int64 targetUsn = 2;
}
message ReqGetProfileData {
int64 targetUsn = 2;
}
message ResGetProfileData {
NetProfileData data = 2;
}
message ReqSetWallpaper {
repeated NetWallpaperData wallpaperList = 2;
}
@@ -1552,4 +1553,23 @@ message ReqListInvitation {}
message ResListInvitation {
ListInvitationError error = 1;
repeated NetInvitation invitationList = 2;
}
message ReqProceedMessage {
string messageId = 2;
}
message ResProceedMessage {
NetMessage message = 1;
NetRewardData reward = 2;
}
message ReqSetTeam {
int32 type = 2;
int32 contentsId = 3;
repeated NetTeamData teams = 4;
}
message ResSetTeam {
int32 type = 2;
repeated NetTeamData teams = 3;
}

View File

@@ -11,6 +11,7 @@ namespace nksrv.StaticInfo
// <Stage ID, Reward data>
public static readonly Dictionary<int, NetRewardData> RewardData =
new() {
// Chapter 0
{ 6000001, new NetRewardData() { Currency = {
new NetCurrencyData() { Type = (int)CurrencyType.Gold, Value = 500 },
new NetCurrencyData() { Type = (int)CurrencyType.CharacterExp , Value = 600 }
@@ -26,6 +27,29 @@ namespace nksrv.StaticInfo
new NetCurrencyData() { Type = (int)CurrencyType.CharacterExp , Value = 600 }
} }
},
// Chapter 1
{ 6001001, new NetRewardData() { Currency = {
new NetCurrencyData() { Type = (int)CurrencyType.Gold, Value = 1000 },
new NetCurrencyData() { Type = (int)CurrencyType.CharacterExp , Value = 1200 }
} }
},
{ 6001002, new NetRewardData() { Currency = {
new NetCurrencyData() { Type = (int)CurrencyType.Gold, Value = 1000 },
new NetCurrencyData() { Type = (int)CurrencyType.CharacterExp , Value = 1200 }
} }
},
{ 6001003, new NetRewardData() { Currency = {
new NetCurrencyData() { Type = (int)CurrencyType.Gold, Value = 1000 },
new NetCurrencyData() { Type = (int)CurrencyType.CharacterExp , Value = 1200 }
} }
},
{ 6001004, new NetRewardData() { Currency = {
new NetCurrencyData() { Type = (int)CurrencyType.Gold, Value = 1000 },
new NetCurrencyData() { Type = (int)CurrencyType.CharacterExp , Value = 1200 }
// todo include the other items
} }
},
};
}
}