mirror of
https://github.com/EpinelPS/EpinelPS.git
synced 2025-12-12 15:04:36 +01:00
fix some things
This commit is contained in:
@@ -10,8 +10,8 @@ namespace ProtobufViewUtil
|
||||
{
|
||||
Console.WriteLine("Hello, World!");
|
||||
|
||||
ResGetTowerData s = new ResGetTowerData();
|
||||
var inn = File.ReadAllBytes(@"C:\Users\Misha\Downloads\gettowerdata");
|
||||
ResGetContentsOpenData s = new ResGetContentsOpenData();
|
||||
var inn = File.ReadAllBytes(@"C:\Users\Misha\Downloads\getusercontents-ch2complete");
|
||||
s.MergeFrom(inn);
|
||||
Console.WriteLine(s.ToString());
|
||||
var outt = s.ToByteArray();
|
||||
|
||||
@@ -50,6 +50,8 @@ namespace nksrv.LobbyServer.Msgs.Campaign
|
||||
return 0;
|
||||
case "fcbg_cityforest_003":
|
||||
return 1;
|
||||
case "fcbg_cityforest_001":
|
||||
return 2;
|
||||
default:
|
||||
Logger.Warn("TODO: I don't know what chapter mapid " + mapId + " is");
|
||||
return 101;
|
||||
|
||||
@@ -27,12 +27,33 @@ namespace nksrv.LobbyServer.Msgs.Stage
|
||||
|
||||
if (user.FieldInfo.Count == 0)
|
||||
{
|
||||
user.FieldInfo.Add(0, new FieldInfo() { });
|
||||
user.FieldInfo.Add(0, new FieldInfo() { });
|
||||
}
|
||||
|
||||
// TODO: figure out how stageid corresponds to chapter
|
||||
user.FieldInfo[GetChapterForStageId(req.StageId)].CompletedStages.Add(new NetFieldStageData() { StageId = req.StageId });
|
||||
JsonDb.Save();
|
||||
|
||||
if (req.StageId == 6000003)
|
||||
{
|
||||
// TODO: Is this the right place to copy over default characters?
|
||||
// TODO: What is CSN and TID? Also need to add names for these
|
||||
// Note: CSN appears to be a character ID, still not sure what TID is
|
||||
user.Characters.Add(new Utils.Character() { Csn = 47263455, Tid = 201001 });
|
||||
user.Characters.Add(new Utils.Character() { Csn = 47273456, Tid = 330501 });
|
||||
user.Characters.Add(new Utils.Character() { Csn = 47263457, Tid = 130201 });
|
||||
user.Characters.Add(new Utils.Character() { Csn = 47263458, Tid = 230101 });
|
||||
user.Characters.Add(new Utils.Character() { Csn = 47263459, Tid = 301201 });
|
||||
|
||||
user.TeamData.TeamNumber = 1;
|
||||
user.TeamData.TeamCombat = 1446; // TODO: Don't hardcode this
|
||||
user.TeamData.Slots.Clear();
|
||||
user.TeamData.Slots.Add(new NetWholeTeamSlot { Slot = 1, Csn = 47263455, Tid = 201001, Lvl = 1});
|
||||
user.TeamData.Slots.Add(new NetWholeTeamSlot { Slot = 2, Csn = 47273456, Tid = 330501, Lvl = 1 });
|
||||
user.TeamData.Slots.Add(new NetWholeTeamSlot { Slot = 3, Csn = 47263457, Tid = 130201, Lvl = 1 });
|
||||
user.TeamData.Slots.Add(new NetWholeTeamSlot { Slot = 4, Csn = 47263458, Tid = 230101, Lvl = 1 });
|
||||
user.TeamData.Slots.Add(new NetWholeTeamSlot { Slot = 5, Csn = 47263459, Tid = 301201, Lvl = 1 });
|
||||
}
|
||||
}
|
||||
|
||||
WriteData(response);
|
||||
|
||||
@@ -17,6 +17,7 @@ namespace nksrv.LobbyServer.Msgs.Team
|
||||
|
||||
// TODO: assume that team data did not change
|
||||
var resp = new ResGetTeamData();
|
||||
// resp.TypeTeams.Add(new NetUserTeamData() { })
|
||||
//resp.TypeTeams
|
||||
WriteData(resp);
|
||||
}
|
||||
|
||||
@@ -25,27 +25,63 @@ namespace nksrv.LobbyServer.Msgs.User
|
||||
response.User.LobbyJukebox = 2;
|
||||
response.ResetHour = 20;
|
||||
response.Nickname = user.Nickname;
|
||||
response.OutpostBattleTime = new NetOutpostBattleTime() { MaxBattleTime = 864000000000 ,MaxOverBattleTime = 12096000000000 };
|
||||
response.RepresentationTeam = new NetWholeUserTeamData() { TeamNumber = 1, Type = 2};
|
||||
response.RepresentationTeam.Slots.Add(new NetWholeTeamSlot() { Slot = 1 });
|
||||
response.RepresentationTeam.Slots.Add(new NetWholeTeamSlot() { Slot = 2 });
|
||||
response.RepresentationTeam.Slots.Add(new NetWholeTeamSlot() { Slot = 3 });
|
||||
response.RepresentationTeam.Slots.Add(new NetWholeTeamSlot() { Slot = 4 });
|
||||
response.RepresentationTeam.Slots.Add(new NetWholeTeamSlot() { Slot = 5 });
|
||||
response.OutpostBattleTime = new NetOutpostBattleTime() { MaxBattleTime = 864000000000, MaxOverBattleTime = 12096000000000 };
|
||||
|
||||
if (user.TeamData.Slots.Count == 0)
|
||||
{
|
||||
user.TeamData = new NetWholeUserTeamData() { TeamNumber = 1, Type = 2 };
|
||||
user.TeamData.Slots.Add(new NetWholeTeamSlot() { Slot = 1 });
|
||||
user.TeamData.Slots.Add(new NetWholeTeamSlot() { Slot = 2 });
|
||||
user.TeamData.Slots.Add(new NetWholeTeamSlot() { Slot = 3 });
|
||||
user.TeamData.Slots.Add(new NetWholeTeamSlot() { Slot = 4 });
|
||||
user.TeamData.Slots.Add(new NetWholeTeamSlot() { Slot = 5 });
|
||||
JsonDb.Save();
|
||||
}
|
||||
response.RepresentationTeam = user.TeamData;
|
||||
|
||||
foreach (var item in user.Currency)
|
||||
{
|
||||
response.Currency.Add(new NetUserCurrencyData() { Type = (int)item.Key, Value = item.Value });
|
||||
}
|
||||
|
||||
response.LastClearedNormalMainStageId = user.LastStageCleared;
|
||||
//var tTeams = new NetUserTeamData();
|
||||
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 } });
|
||||
}
|
||||
|
||||
//var tTeam = new NetTeamData() { TeamNumber = 1 };
|
||||
//tTeam.Slots.Add(new NetTeamSlot() { Slot = 1, ValueType = 1, Value = 2 });
|
||||
//tTeams.Teams.Add(tTeam);
|
||||
//response.TypeTeams.Add(tTeams);
|
||||
// response.Character.Add(new NetUserCharacterData() { Default = new NetUserCharacterDefaultData() { Tid = 1 } });
|
||||
if (user.Characters.Count > 0)
|
||||
{
|
||||
var team1 = new NetUserTeamData();
|
||||
team1.Type = 1;
|
||||
team1.LastContentsTeamNumber = 1;
|
||||
|
||||
var team1Sub = new NetTeamData();
|
||||
team1Sub.TeamNumber = 1;
|
||||
|
||||
// TODO: Save this properly. Right now return first 5 characters as a squad.
|
||||
for (int i = 1; i < 6; i++)
|
||||
{
|
||||
var character = user.Characters[i - 1];
|
||||
team1Sub.Slots.Add(new NetTeamSlot() { Slot = i, Value = character.Csn });
|
||||
}
|
||||
team1.Teams.Add(team1Sub);
|
||||
|
||||
response.TypeTeams.Add(team1);
|
||||
}
|
||||
|
||||
// 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.LastClearedNormalMainStageId = user.LastStageCleared;
|
||||
|
||||
WriteData(response);
|
||||
}
|
||||
|
||||
@@ -11,13 +11,25 @@ namespace nksrv.LobbyServer.Msgs.User
|
||||
var user = GetUser();
|
||||
|
||||
var response = new ResGetContentsOpenData();
|
||||
bool includeFirst = true;
|
||||
foreach (var field in user.FieldInfo.Values)
|
||||
{
|
||||
// only include first and last clears
|
||||
int i = 0;
|
||||
foreach (var stage in field.CompletedStages)
|
||||
{
|
||||
response.ClearStageList.Add(stage.StageId);
|
||||
if (i == 0 && includeFirst)
|
||||
{
|
||||
response.ClearStageList.Add(stage.StageId);
|
||||
includeFirst = false;
|
||||
}
|
||||
else if (i == field.CompletedStages.Count - 1)
|
||||
response.ClearStageList.Add(stage.StageId);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
response.MaxGachaCount = 10;
|
||||
// todo tutorial playcount of gacha
|
||||
|
||||
WriteData(response);
|
||||
}
|
||||
|
||||
22
nksrv/LobbyServer/Msgs/User/SetWallpaper.cs
Normal file
22
nksrv/LobbyServer/Msgs/User/SetWallpaper.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
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/SetWallpaper")]
|
||||
public class SetWallpaper : LobbyMsgHandler
|
||||
{
|
||||
protected override async Task HandleAsync()
|
||||
{
|
||||
var req = await ReadData<ReqSetWallpaper>();
|
||||
var response = new ResSetWallpaper();
|
||||
// todo
|
||||
|
||||
WriteData(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1514,4 +1514,24 @@ message ReqGetJupiterMarketingDetail {
|
||||
|
||||
message ResGetJupiterMarketingDetail {
|
||||
string marketingDetail = 1;
|
||||
}
|
||||
|
||||
|
||||
message NetProfileData {
|
||||
// TODO
|
||||
}
|
||||
|
||||
message ResGetProfileData {
|
||||
int64 targetUsn = 2;
|
||||
}
|
||||
|
||||
message ReqGetProfileData {
|
||||
NetProfileData data = 2;
|
||||
}
|
||||
|
||||
message ReqSetWallpaper {
|
||||
repeated NetWallpaperData wallpaperList = 2;
|
||||
}
|
||||
message ResSetWallpaper {
|
||||
|
||||
}
|
||||
@@ -7,6 +7,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using static Google.Rpc.Context.AttributeContext.Types;
|
||||
|
||||
namespace nksrv.Utils
|
||||
{
|
||||
@@ -16,17 +17,23 @@ namespace nksrv.Utils
|
||||
public long ExpirationTime;
|
||||
public ulong UserID;
|
||||
}
|
||||
public class NetworkPosition
|
||||
{
|
||||
public float x;
|
||||
public float y;
|
||||
public float z;
|
||||
}
|
||||
public class FieldInfo
|
||||
{
|
||||
public List<NetFieldStageData> CompletedStages = new();
|
||||
public bool BossEntered = false;
|
||||
public NetworkPosition teamPosition = new();
|
||||
}
|
||||
|
||||
public class Character
|
||||
{
|
||||
// TODO
|
||||
public int Csn = 0;
|
||||
public int Tid = 0;
|
||||
public int CostumeId = 0;
|
||||
|
||||
public int Level = 1;
|
||||
public int UltimateLevel = 1;
|
||||
public int Skill1Lvl = 1;
|
||||
public int Skill2Lvl = 1;
|
||||
public int Grade = 0;
|
||||
}
|
||||
|
||||
public class User
|
||||
@@ -46,8 +53,14 @@ namespace nksrv.Utils
|
||||
public Dictionary<int, FieldInfo> FieldInfo = new();
|
||||
public Dictionary<string, string> MapJson = new();
|
||||
public Dictionary<CurrencyType, long> Currency = new Dictionary<CurrencyType, long>() {
|
||||
{ CurrencyType.ContentStamina, 2}
|
||||
{ CurrencyType.ContentStamina, 2 },
|
||||
|
||||
{ CurrencyType.Gold, 1 },
|
||||
{ CurrencyType.CharCorporationTicket, 23422 }
|
||||
};
|
||||
|
||||
public List<Character> Characters = new();
|
||||
public NetWholeUserTeamData TeamData = new();
|
||||
}
|
||||
public class CoreInfo
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user