mirror of
https://github.com/EpinelPS/EpinelPS.git
synced 2025-12-13 07:24:52 +01:00
Compare commits
27 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e185b7d87e | ||
|
|
35221356f8 | ||
|
|
766a8605b7 | ||
|
|
9d203958c3 | ||
|
|
78659f9c6e | ||
|
|
cce8179e8d | ||
|
|
8ba6d69ade | ||
|
|
9e331c487a | ||
|
|
e83dcdbfa8 | ||
|
|
8ea17003e6 | ||
|
|
643d3a5c7c | ||
|
|
49df23798f | ||
|
|
a8b13f8539 | ||
|
|
dea8d98db4 | ||
|
|
22d19cf38b | ||
|
|
1670142226 | ||
|
|
6ed393714f | ||
|
|
fcf9396b86 | ||
|
|
10f0641e77 | ||
|
|
9cf99754d6 | ||
|
|
7a1f361d25 | ||
|
|
db70b5068e | ||
|
|
005ad80095 | ||
|
|
15778751af | ||
|
|
645697f713 | ||
|
|
56c526cec1 | ||
|
|
702995bcfd |
3
.gitattributes
vendored
3
.gitattributes
vendored
@@ -1,3 +1,2 @@
|
||||
# Auto detect text files and perform LF normalization
|
||||
* text=auto
|
||||
cert.sh eol=lf
|
||||
* text=auto
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.IO.Compression;
|
||||
|
||||
namespace DataFixupUtil
|
||||
{
|
||||
@@ -9,7 +8,7 @@ namespace DataFixupUtil
|
||||
{
|
||||
Console.WriteLine("Hello, World!");
|
||||
|
||||
foreach(var arg in Directory.GetFiles("C:\\NIKKE\\NIKKE\\Game"))
|
||||
foreach (var arg in Directory.GetFiles("C:\\NIKKE\\NIKKE\\Game"))
|
||||
{
|
||||
var fileName = Path.GetFileName(arg);
|
||||
if (fileName.StartsWith("input"))
|
||||
|
||||
10
GameDownloader/GameDownloader.csproj
Normal file
10
GameDownloader/GameDownloader.csproj
Normal file
@@ -0,0 +1,10 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
50
GameDownloader/Program.cs
Normal file
50
GameDownloader/Program.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
using System.Security.Cryptography;
|
||||
|
||||
namespace GameDownloader
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
var key = "f8c65f692a6a021a688507a6e441786a";
|
||||
|
||||
|
||||
var bytes = File.ReadAllBytes(@"C:\Users\Misha\Desktop\nikke-server\nksrv\bin\Debug\net8.0\win-x64\cache\PC\prod\rid.48-r.02587\manifestv2\48_5937488248518493556_0.manifest");
|
||||
|
||||
|
||||
var x = Aes.Create();
|
||||
x.KeySize = 128;
|
||||
x.Key = StrToByteArray(key);
|
||||
x.Mode = CipherMode.CFB;
|
||||
x.Padding = PaddingMode.None;
|
||||
x.IV = new byte[16];
|
||||
var abc = x.CreateDecryptor();
|
||||
|
||||
var str = new CryptoStream(new MemoryStream(bytes), abc, CryptoStreamMode.Read);
|
||||
|
||||
var decr = new MemoryStream();
|
||||
|
||||
str.CopyTo(decr);
|
||||
|
||||
var res = decr.ToArray();
|
||||
|
||||
File.WriteAllBytes("test", res);
|
||||
|
||||
|
||||
//var b2 = x.DecryptEcb(bytes, PaddingMode.None);
|
||||
}
|
||||
public static byte[] StrToByteArray(string str)
|
||||
{
|
||||
str = str.ToUpper();
|
||||
Dictionary<string, byte> hexindex = new Dictionary<string, byte>();
|
||||
for (int i = 0; i <= 255; i++)
|
||||
hexindex.Add(i.ToString("X2"), (byte)i);
|
||||
|
||||
List<byte> hexres = new List<byte>();
|
||||
for (int i = 0; i < str.Length; i += 2)
|
||||
hexres.Add(hexindex[str.Substring(i, 2)]);
|
||||
|
||||
return hexres.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,4 @@
|
||||
using Google.Protobuf;
|
||||
using nksrv;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace ProtobufViewUtil
|
||||
namespace ProtobufViewUtil
|
||||
{
|
||||
internal class Program
|
||||
{
|
||||
@@ -15,7 +11,7 @@ namespace ProtobufViewUtil
|
||||
s.MergeFrom(inn);
|
||||
Console.WriteLine(s.ToString());
|
||||
var outt = s.ToByteArray();
|
||||
|
||||
|
||||
if (inn.SequenceEqual(outt))
|
||||
{
|
||||
Console.WriteLine("Check OK");
|
||||
|
||||
29
README.md
29
README.md
@@ -12,7 +12,11 @@
|
||||
[](https://discord.gg/Ztt6Y9vQjF)
|
||||
|
||||
</div>
|
||||
Private/local server for Nikke. NOTE: This project is in a very early state so many features in the game do not work. Discord server: https://discord.gg/Ztt6Y9vQjF
|
||||
Private/local server for Nikke. Discord server: https://discord.gg/Ztt6Y9vQjF
|
||||
|
||||
|
||||
> [!WARNING]
|
||||
> This project is in a very early state so many functions in the game do not work.
|
||||
|
||||
## Usage
|
||||
Download the latest release/GitHub actions build, and run ServerSelector.Desktop.exe as administrator (to modify DNS hosts file and install a CA cert). Make sure to close the game and launcher first. Select Local server, and then click save. After that, start nksrv.exe to start the actual server.
|
||||
@@ -29,10 +33,10 @@ To access the admin panel, go to https://127.0.0.1/admin/ and sign in. Note that
|
||||
|
||||
To skip stages, a basic command line interface is implemented.
|
||||
|
||||
## Progress
|
||||
Stage, character, outpost and story information is saved and works, as well as player nickname.
|
||||
## Screenshots
|
||||
|
||||
<img src="https://github.com/user-attachments/assets/16d72494-27ce-4af5-9551-2c25940b0704" width="480" height="270">
|
||||
|
||||
<img src="https://github.com/MishaProductions/nikke-server/assets/106913236/75330e0d-ddb5-4d29-b7dd-ab6662306494" width="480" height="270">
|
||||
<img src="https://github.com/MishaProductions/nikke-server/assets/106913236/15b5ea93-bcd1-44b7-81b9-a10d053b7af8" width="480" height="270">
|
||||
<img src="https://github.com/MishaProductions/nikke-server/assets/106913236/70ab4668-70b8-4e2c-bf1b-c84974f5e8ee" width="480" height="270">
|
||||
<img src="https://github.com/MishaProductions/nikke-server/assets/106913236/c6a89fd4-9568-48c2-b4f9-d73807d4043e" width="480" height="270">
|
||||
@@ -44,21 +48,32 @@ Stage, character, outpost and story information is saved and works, as well as p
|
||||
- [X] Profile UI
|
||||
- [X] Open Archives UI
|
||||
- [X] Inventory system
|
||||
- [X] Character level up
|
||||
- [X] Side story
|
||||
- [X] Archives
|
||||
- [ ] Skill level up
|
||||
- [ ] Outpost jukebox / relics saving
|
||||
- [ ] Field obtain object
|
||||
- [ ] Admin panel
|
||||
- [ ] Test hard stage support
|
||||
- [ ] Event system
|
||||
- [ ] Download all game assets ahead of time
|
||||
- [ ] Level up/skill level up support
|
||||
- [ ] Basic friend list support / allow using other servers except 127.0.0.1
|
||||
- [ ] Basic friend list support
|
||||
- [ ] Aegis Diver minigame, MOG minigame, etc
|
||||
- [ ] Outpost claim rewards
|
||||
- [ ] Daily, weekly missions etc
|
||||
- [ ] Lost sector
|
||||
- [ ] Custom launcher
|
||||
- [ ] Limit temporary participation
|
||||
- [ ] Archives
|
||||
|
||||
## What is not working:
|
||||
- Collecting items in campaign
|
||||
- Events
|
||||
- Skill upgrade, limit break
|
||||
- Mission reward, daily/weekly missions
|
||||
- Side quests
|
||||
- Lots of things in the outpost
|
||||
- And a lot more...
|
||||
|
||||
## Contributing
|
||||
Server code structure:
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
|
||||
using Avalonia;
|
||||
using Avalonia;
|
||||
using Avalonia.ReactiveUI;
|
||||
using System;
|
||||
|
||||
namespace ServerSelector.Desktop;
|
||||
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ServerSelector
|
||||
{
|
||||
@@ -96,6 +92,8 @@ namespace ServerSelector
|
||||
{ip} na-community.playerinfinite.com
|
||||
{ip} common-web.intlgame.com
|
||||
{ip} li-sg.intlgame.com
|
||||
255.255.221.21 na.fleetlogd.com
|
||||
{ip} www.jupiterlauncher.com
|
||||
{ip} data-aws-na.intlgame.com
|
||||
255.255.221.21 sentry.io";
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ using System;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.Principal;
|
||||
|
||||
namespace ServerSelector.Views;
|
||||
|
||||
|
||||
27
nksrv.sln
27
nksrv.sln
@@ -15,6 +15,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ServerSelector.Desktop", "S
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Client", "Client", "{4BB2E77F-84A6-4644-9FB3-38E2A7DCDEC0}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GameDownloader", "GameDownloader\GameDownloader.csproj", "{E3512D9F-CB94-4C80-B673-0EB83CA21D12}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -151,6 +153,30 @@ Global
|
||||
{01D0A73A-A881-439D-9318-54DB5B00D6F5}.ReleaseDLL|x64.Build.0 = Release|Any CPU
|
||||
{01D0A73A-A881-439D-9318-54DB5B00D6F5}.ReleaseDLL|x86.ActiveCfg = Release|Any CPU
|
||||
{01D0A73A-A881-439D-9318-54DB5B00D6F5}.ReleaseDLL|x86.Build.0 = Release|Any CPU
|
||||
{E3512D9F-CB94-4C80-B673-0EB83CA21D12}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E3512D9F-CB94-4C80-B673-0EB83CA21D12}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E3512D9F-CB94-4C80-B673-0EB83CA21D12}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{E3512D9F-CB94-4C80-B673-0EB83CA21D12}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{E3512D9F-CB94-4C80-B673-0EB83CA21D12}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{E3512D9F-CB94-4C80-B673-0EB83CA21D12}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{E3512D9F-CB94-4C80-B673-0EB83CA21D12}.DebugDLL|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E3512D9F-CB94-4C80-B673-0EB83CA21D12}.DebugDLL|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E3512D9F-CB94-4C80-B673-0EB83CA21D12}.DebugDLL|x64.ActiveCfg = Debug|Any CPU
|
||||
{E3512D9F-CB94-4C80-B673-0EB83CA21D12}.DebugDLL|x64.Build.0 = Debug|Any CPU
|
||||
{E3512D9F-CB94-4C80-B673-0EB83CA21D12}.DebugDLL|x86.ActiveCfg = Debug|Any CPU
|
||||
{E3512D9F-CB94-4C80-B673-0EB83CA21D12}.DebugDLL|x86.Build.0 = Debug|Any CPU
|
||||
{E3512D9F-CB94-4C80-B673-0EB83CA21D12}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E3512D9F-CB94-4C80-B673-0EB83CA21D12}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{E3512D9F-CB94-4C80-B673-0EB83CA21D12}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{E3512D9F-CB94-4C80-B673-0EB83CA21D12}.Release|x64.Build.0 = Release|Any CPU
|
||||
{E3512D9F-CB94-4C80-B673-0EB83CA21D12}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{E3512D9F-CB94-4C80-B673-0EB83CA21D12}.Release|x86.Build.0 = Release|Any CPU
|
||||
{E3512D9F-CB94-4C80-B673-0EB83CA21D12}.ReleaseDLL|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E3512D9F-CB94-4C80-B673-0EB83CA21D12}.ReleaseDLL|Any CPU.Build.0 = Release|Any CPU
|
||||
{E3512D9F-CB94-4C80-B673-0EB83CA21D12}.ReleaseDLL|x64.ActiveCfg = Release|Any CPU
|
||||
{E3512D9F-CB94-4C80-B673-0EB83CA21D12}.ReleaseDLL|x64.Build.0 = Release|Any CPU
|
||||
{E3512D9F-CB94-4C80-B673-0EB83CA21D12}.ReleaseDLL|x86.ActiveCfg = Release|Any CPU
|
||||
{E3512D9F-CB94-4C80-B673-0EB83CA21D12}.ReleaseDLL|x86.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@@ -158,6 +184,7 @@ Global
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{EC613C24-8A35-42E8-92C1-9A8431F74F58} = {4BB2E77F-84A6-4644-9FB3-38E2A7DCDEC0}
|
||||
{01D0A73A-A881-439D-9318-54DB5B00D6F5} = {4BB2E77F-84A6-4644-9FB3-38E2A7DCDEC0}
|
||||
{E3512D9F-CB94-4C80-B673-0EB83CA21D12} = {4BB2E77F-84A6-4644-9FB3-38E2A7DCDEC0}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {F779F2DC-B207-4091-83B8-0EA250461DCE}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
using EmbedIO;
|
||||
using EmbedIO.Routing;
|
||||
using EmbedIO.WebApi;
|
||||
using nksrv.Utils;
|
||||
using System;
|
||||
using nksrv.Database;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
|
||||
|
||||
@@ -1,17 +1,10 @@
|
||||
using ASodium;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json;
|
||||
using nksrv.LobbyServer;
|
||||
using nksrv.LobbyServer.Msgs.Stage;
|
||||
using nksrv.StaticInfo;
|
||||
using nksrv.Utils;
|
||||
using Swan.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using static Google.Rpc.Context.AttributeContext.Types;
|
||||
|
||||
namespace nksrv.Utils
|
||||
namespace nksrv.Database
|
||||
{
|
||||
public class AccessToken
|
||||
{
|
||||
@@ -25,9 +18,14 @@ namespace nksrv.Utils
|
||||
public List<NetFieldObject> CompletedObjects = [];
|
||||
}
|
||||
|
||||
public class FieldInfoNew
|
||||
{
|
||||
public List<int> CompletedStages = [];
|
||||
public List<NetFieldObject> CompletedObjects = [];
|
||||
}
|
||||
|
||||
public class Character
|
||||
{
|
||||
// TODO
|
||||
public int Csn = 0;
|
||||
public int Tid = 0;
|
||||
public int CostumeId = 0;
|
||||
@@ -81,13 +79,19 @@ namespace nksrv.Utils
|
||||
public bool ProfileIconIsPrism = false;
|
||||
public bool IsAdmin = false;
|
||||
|
||||
public bool IsBanned = false;
|
||||
public DateTime BanStart;
|
||||
public DateTime BanEnd;
|
||||
public int BanId = 0;
|
||||
|
||||
// Game data
|
||||
public List<string> CompletedScenarios = [];
|
||||
public Dictionary<string, FieldInfo> FieldInfo = [];
|
||||
public Dictionary<string, FieldInfo> FieldInfo = []; // here for backwards compatibility
|
||||
|
||||
public Dictionary<string, FieldInfoNew> FieldInfoNew = [];
|
||||
public Dictionary<string, string> MapJson = [];
|
||||
public Dictionary<CurrencyType, long> Currency = new() {
|
||||
{ CurrencyType.ContentStamina, 2 },
|
||||
{ CurrencyType.CharPremiumTicket, 999999 }
|
||||
{ CurrencyType.ContentStamina, 2 }
|
||||
};
|
||||
|
||||
public List<ItemData> Items = new();
|
||||
@@ -96,10 +100,7 @@ namespace nksrv.Utils
|
||||
public Dictionary<int, ClearedTutorialData> ClearedTutorialData = [];
|
||||
public NetWallpaperData[] WallpaperList = [];
|
||||
public Dictionary<int, NetUserTeamData> UserTeams = new Dictionary<int, NetUserTeamData>();
|
||||
public Dictionary<int, bool> MainQuestData = new()
|
||||
{
|
||||
{1, false }
|
||||
};
|
||||
public Dictionary<int, bool> MainQuestData = new();
|
||||
public int InfraCoreExp = 0;
|
||||
public int InfraCoreLvl = 1;
|
||||
public UserPointData userPointData = new();
|
||||
@@ -108,20 +109,22 @@ namespace nksrv.Utils
|
||||
|
||||
public NetOutpostBattleLevel OutpostBattleLevel = new() { Level = 1 };
|
||||
public int GachaTutorialPlayCount = 0;
|
||||
public List<int> CompletedTacticAcademyLessons = [];
|
||||
public List<int> CompletedSideStoryStages = new();
|
||||
|
||||
// Event data
|
||||
public Dictionary<int, EventData> EventInfo = new();
|
||||
|
||||
public void SetQuest(int tid, bool recieved)
|
||||
public void SetQuest(int tid, bool recievedReward)
|
||||
{
|
||||
if (MainQuestData.ContainsKey(tid))
|
||||
{
|
||||
MainQuestData[tid] = recieved;
|
||||
MainQuestData[tid] = recievedReward;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
MainQuestData.Add(tid, recieved);
|
||||
MainQuestData.Add(tid, recievedReward);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,47 +142,86 @@ namespace nksrv.Utils
|
||||
|
||||
public bool IsStageCompleted(int id, bool isNorm)
|
||||
{
|
||||
foreach (var item in FieldInfo)
|
||||
foreach (var item in FieldInfoNew)
|
||||
{
|
||||
if (item.Key.Contains("hard") && isNorm) continue;
|
||||
if (item.Key.Contains("normal") && !isNorm) continue;
|
||||
foreach (var s in item.Value.CompletedStages)
|
||||
if (item.Value.CompletedStages.Contains(id))
|
||||
{
|
||||
if (s.StageId == id)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public long GetCurrencyVal(CurrencyType type)
|
||||
{
|
||||
if (Currency.ContainsKey(type))
|
||||
return Currency[type];
|
||||
else
|
||||
{
|
||||
Currency.Add(type, 0);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
public void AddCurrency(CurrencyType type, long val)
|
||||
{
|
||||
if (Currency.ContainsKey(type)) Currency[type] += val;
|
||||
else Currency.Add(type, val);
|
||||
}
|
||||
public bool SubtractCurrency(CurrencyType type, long val)
|
||||
{
|
||||
if (Currency.ContainsKey(type)) Currency[type] -= val;
|
||||
else return false;
|
||||
|
||||
if (Currency[type] < 0)
|
||||
{
|
||||
Currency[type] += val;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public bool CanSubtractCurrency(CurrencyType type, long val)
|
||||
{
|
||||
if (Currency.ContainsKey(type))
|
||||
{
|
||||
if (Currency[type] >= val) return true;
|
||||
else return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (val == 0) return true;
|
||||
else return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
public class CoreInfo
|
||||
{
|
||||
public int DbVersion = 2;
|
||||
public int DbVersion = 3;
|
||||
public List<User> Users = [];
|
||||
|
||||
public List<AccessToken> LauncherAccessTokens = [];
|
||||
|
||||
public Dictionary<string, GameClientInfo> GameClientTokens = [];
|
||||
public string ServerName = "<color=\"green\">Private Server</color>";
|
||||
}
|
||||
internal class JsonDb
|
||||
{
|
||||
public static CoreInfo Instance { get; internal set; }
|
||||
|
||||
// Note: change this in sodium
|
||||
public static byte[] ServerPrivateKey = Convert.FromBase64String("FSUY8Ohd942n5LWAfxn6slK3YGwc8OqmyJoJup9nNos=");
|
||||
public static byte[] ServerPublicKey = Convert.FromBase64String("04hFDd1e/BOEF2h4b0MdkX2h6W5REeqyW+0r9+eSeh0="); // Note: change this in sodium
|
||||
public static byte[] ServerPublicKey = Convert.FromBase64String("04hFDd1e/BOEF2h4b0MdkX2h6W5REeqyW+0r9+eSeh0=");
|
||||
|
||||
static JsonDb()
|
||||
{
|
||||
if (!File.Exists(AppDomain.CurrentDomain.BaseDirectory + "/db.json"))
|
||||
{
|
||||
Logger.Warn("users: warning: configuration not found, writing default data");
|
||||
"users: warning: configuration not found, writing default data".Warn();
|
||||
Instance = new CoreInfo();
|
||||
Save();
|
||||
}
|
||||
Logger.Info("Loaded db");
|
||||
|
||||
|
||||
var j = JsonConvert.DeserializeObject<CoreInfo>(File.ReadAllText(AppDomain.CurrentDomain.BaseDirectory + "/db.json"));
|
||||
if (j != null)
|
||||
@@ -194,14 +236,14 @@ namespace nksrv.Utils
|
||||
|
||||
foreach (var user in Instance.Users)
|
||||
{
|
||||
foreach (var f in user.FieldInfo.ToList())
|
||||
foreach (var f in user.FieldInfoNew.ToList())
|
||||
{
|
||||
var isNumeric = int.TryParse(f.Key, out int n);
|
||||
if (isNumeric)
|
||||
{
|
||||
var val = f.Value;
|
||||
user.FieldInfo.Remove(f.Key);
|
||||
user.FieldInfo.Add(n + "_Normal", val);
|
||||
user.FieldInfoNew.Remove(f.Key);
|
||||
user.FieldInfoNew.Add(n + "_Normal", val);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -221,13 +263,53 @@ namespace nksrv.Utils
|
||||
}
|
||||
Console.WriteLine("Database update completed");
|
||||
}
|
||||
else if (Instance.DbVersion == 2)
|
||||
{
|
||||
Console.WriteLine("Starting database update...");
|
||||
// I used to use a class for FieldInfo cleared stages, but now int list is used
|
||||
Instance.DbVersion = 3;
|
||||
foreach (var user in Instance.Users)
|
||||
{
|
||||
foreach (var f in user.FieldInfo)
|
||||
{
|
||||
var newField = new FieldInfoNew();
|
||||
foreach (var stage in f.Value.CompletedStages)
|
||||
{
|
||||
newField.CompletedStages.Add(stage.StageId);
|
||||
}
|
||||
user.FieldInfoNew.Add(f.Key, newField);
|
||||
}
|
||||
user.FieldInfo.Clear();
|
||||
}
|
||||
Console.WriteLine("Database update completed");
|
||||
}
|
||||
Save();
|
||||
|
||||
ValidateDb();
|
||||
"Loaded db".Info();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception("Failed to read configuration json file");
|
||||
}
|
||||
}
|
||||
|
||||
private static void ValidateDb()
|
||||
{
|
||||
// check if character level is valid
|
||||
foreach (var item in Instance.Users)
|
||||
{
|
||||
foreach (var c in item.Characters)
|
||||
{
|
||||
if (c.Level > 1000)
|
||||
{
|
||||
$"Warning: Character level for character {c.Tid} cannot be above 1000, setting to 1000".Warn();
|
||||
c.Level = 1000;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static User? GetUser(ulong id)
|
||||
{
|
||||
return Instance.Users.Where(x => x.ID == id).FirstOrDefault();
|
||||
@@ -1,10 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace nksrv.IntlServer
|
||||
namespace nksrv.IntlServer
|
||||
{
|
||||
internal class AutoLoginEndpoint : IntlMsgHandler
|
||||
{
|
||||
|
||||
@@ -1,13 +1,4 @@
|
||||
using EmbedIO;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace nksrv.IntlServer
|
||||
namespace nksrv.IntlServer
|
||||
{
|
||||
public class CodeStatusEndpoint : IntlMsgHandler
|
||||
{
|
||||
@@ -16,7 +7,7 @@ namespace nksrv.IntlServer
|
||||
protected override async Task HandleAsync()
|
||||
{
|
||||
// pretend that any code is valid
|
||||
await WriteJsonStringAsync("{\"expire_time\":759,\"msg\":\"Success\",\"ret\":0,\"seq\":\""+Seq+"\"}");
|
||||
await WriteJsonStringAsync("{\"expire_time\":759,\"msg\":\"Success\",\"ret\":0,\"seq\":\"" + Seq + "\"}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,4 @@
|
||||
using Google.Api;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace nksrv.IntlServer
|
||||
namespace nksrv.IntlServer
|
||||
{
|
||||
public class GetNoticeContent : IntlMsgHandler
|
||||
{
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
using EmbedIO;
|
||||
using nksrv.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using nksrv.Utils;
|
||||
using System.Net;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace nksrv.IntlServer
|
||||
{
|
||||
|
||||
@@ -1,15 +1,9 @@
|
||||
using EmbedIO;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using static nksrv.IntlServer.IntlLogin2Endpoint;
|
||||
using Newtonsoft.Json;
|
||||
using static nksrv.IntlServer.IntlLogin1Endpoint;
|
||||
using nksrv.Database;
|
||||
using nksrv.Utils;
|
||||
using System.Net;
|
||||
using static nksrv.IntlServer.IntlLogin2Endpoint;
|
||||
|
||||
namespace nksrv.IntlServer
|
||||
{
|
||||
@@ -43,7 +37,7 @@ namespace nksrv.IntlServer
|
||||
}
|
||||
}
|
||||
|
||||
var user = new User() { ID = uid, Password = ep.password, RegisterTime = DateTimeOffset.UtcNow.ToUnixTimeSeconds(), Username = ep.account, PlayerName = "Player_"+Rng.RandomString(8) };
|
||||
var user = new User() { ID = uid, Password = ep.password, RegisterTime = DateTimeOffset.UtcNow.ToUnixTimeSeconds(), Username = ep.account, PlayerName = "Player_" + Rng.RandomString(8) };
|
||||
|
||||
JsonDb.Instance.Users.Add(user);
|
||||
|
||||
|
||||
@@ -1,10 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace nksrv.IntlServer
|
||||
namespace nksrv.IntlServer
|
||||
{
|
||||
internal class IntlGetAccountInfo : IntlMsgHandler
|
||||
{
|
||||
|
||||
@@ -1,10 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace nksrv.IntlServer
|
||||
namespace nksrv.IntlServer
|
||||
{
|
||||
public class IntlGetProfileInfo : IntlMsgHandler
|
||||
{
|
||||
@@ -15,7 +9,7 @@ namespace nksrv.IntlServer
|
||||
if (User == null)
|
||||
throw new Exception("no user"); // should never happen
|
||||
|
||||
await WriteJsonStringAsync("{\"bind_list\":[{\"channel_info\":{\"birthday\":\"1970-01\",\"email\":\""+User.Username+"\",\"is_receive_email\":1,\"lang_type\":\"en\",\"last_login_time\":1719075003,\"nick_name\":\"\",\"phone\":\"\",\"phone_area_code\":\"\",\"region\":\"724\",\"register_account\":\""+User.Username+"\",\"register_account_type\":1,\"register_time\":"+User.RegisterTime+",\"seq\":\"abc\",\"uid\":\""+User.ID+"\",\"user_name\":\""+User.PlayerName+"\",\"username_pass_verify\":0},\"channelid\":131,\"email\":\"" + User.Username + "\",\"picture_url\":\"\",\"user_name\":\""+User.PlayerName+"\"}],\"birthday\":\"1970-01\",\"email\":\"" + User.Username + "\",\"gender\":0,\"msg\":\"success\",\"picture_url\":\"\",\"ret\":0,\"seq\":\"" + Seq + "\",\"user_name\":\"" + User.PlayerName + "\"}");
|
||||
await WriteJsonStringAsync("{\"bind_list\":[{\"channel_info\":{\"birthday\":\"1970-01\",\"email\":\"" + User.Username + "\",\"is_receive_email\":1,\"lang_type\":\"en\",\"last_login_time\":1719075003,\"nick_name\":\"\",\"phone\":\"\",\"phone_area_code\":\"\",\"region\":\"724\",\"register_account\":\"" + User.Username + "\",\"register_account_type\":1,\"register_time\":" + User.RegisterTime + ",\"seq\":\"abc\",\"uid\":\"" + User.ID + "\",\"user_name\":\"" + User.PlayerName + "\",\"username_pass_verify\":0},\"channelid\":131,\"email\":\"" + User.Username + "\",\"picture_url\":\"\",\"user_name\":\"" + User.PlayerName + "\"}],\"birthday\":\"1970-01\",\"email\":\"" + User.Username + "\",\"gender\":0,\"msg\":\"success\",\"picture_url\":\"\",\"ret\":0,\"seq\":\"" + Seq + "\",\"user_name\":\"" + User.PlayerName + "\"}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
using EmbedIO;
|
||||
using nksrv.Database;
|
||||
using nksrv.Utils;
|
||||
using Swan.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace nksrv.IntlServer
|
||||
{
|
||||
@@ -30,7 +24,11 @@ namespace nksrv.IntlServer
|
||||
{"/gnconfig/acquire_config", new IntlReturnJsonHandler(AquireConfigResp) },
|
||||
{"/auth/auto_login", new AutoLoginEndpoint() },
|
||||
{"/reward/send", new IntlReturnJsonHandler(SetProtocolResp) }, // /v2/reward/send
|
||||
{"/notice/get_notice_content", new GetNoticeContent() } // /v2/notice/get_notice_content
|
||||
{"/notice/get_notice_content", new GetNoticeContent() }, // /v2/notice/get_notice_content
|
||||
{"/fleet.repo.game.RepoSVC/GetVersion", new JuniperLauncherGetRepoVersion() }, // /api/v1/fleet.repo.game.RepoSVC/GetVersion
|
||||
{"/fleet.repo.game.RepoMgr/GetGameLauncher", new JuniperLauncherGetGameLauncher() }, // /api/v1/fleet.repo.game.RepoMgr/
|
||||
{"/fleet.repo.game.RepoSVC/GetRegion", new JuniperLauncherGetRegion() }, // /api/v1/fleet.repo.game.RepoMgr/ // GetGameLauncher
|
||||
{"/fleet.auth.game.AuthSvr/Login", new JupiterAuthLogin() } // /api/v1/fleet.auth.game.AuthSvr/Login
|
||||
};
|
||||
public const string GetConfResp = "{\"conf_version\":\"102\",\"msg\":\"\",\"ret\":1,\"seq\":\"((SEGID))\"}";
|
||||
public const string MinorcerResp = "{\"adult_age\":15,\"adult_age_map\":{},\"adult_check_status\":1,\"adult_check_status_expiration\":\"0\",\"adult_status_map\":{},\"certificate_type\":3,\"email\":\"\",\"eu_user_agree_status\":0,\"game_grade\":0,\"game_grade_map\":{},\"is_dma\":true,\"is_eea\":false,\"is_need_li_cert\":false,\"msg\":\"success\",\"need_parent_control\":0,\"need_realname_auth\":0,\"parent_certificate_status\":0,\"parent_certificate_status_expiration\":\"0\",\"parent_control_map\":{},\"qr_code_ret\":0,\"realname_auth_status\":0,\"region\":\"300\",\"ret\":0,\"seq\":\"((SEGID))\",\"ts\":\"1719156511\"}";
|
||||
@@ -54,13 +52,15 @@ namespace nksrv.IntlServer
|
||||
}
|
||||
else
|
||||
{
|
||||
handler.Reset();
|
||||
await handler.HandleAsync(context);
|
||||
}
|
||||
}
|
||||
|
||||
public static AccessToken CreateLauncherTokenForUser(User user)
|
||||
{
|
||||
AccessToken token = new() { ExpirationTime = DateTimeOffset.UtcNow.AddDays(1).ToUnixTimeSeconds() };
|
||||
// TODO: implement access token expiration
|
||||
AccessToken token = new() { ExpirationTime = DateTimeOffset.UtcNow.AddYears(1).ToUnixTimeSeconds() };
|
||||
token.Token = Rng.RandomString(64);
|
||||
token.UserID = user.ID;
|
||||
JsonDb.Instance.LauncherAccessTokens.Add(token);
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
using EmbedIO;
|
||||
using Newtonsoft.Json;
|
||||
using nksrv.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using nksrv.Database;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using static nksrv.IntlServer.IntlLogin2Endpoint;
|
||||
|
||||
namespace nksrv.IntlServer
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using EmbedIO;
|
||||
using Newtonsoft.Json;
|
||||
using nksrv.Utils;
|
||||
using nksrv.Database;
|
||||
using System.Net;
|
||||
|
||||
namespace nksrv.IntlServer
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
using EmbedIO;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using nksrv.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using nksrv.Database;
|
||||
using Swan.Logging;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace nksrv.IntlServer
|
||||
{
|
||||
@@ -18,6 +14,15 @@ namespace nksrv.IntlServer
|
||||
protected string Seq = "";
|
||||
protected AccessToken? UsedToken;
|
||||
public abstract bool RequiresAuth { get; }
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
UsedToken = null;
|
||||
Seq = "";
|
||||
User = null;
|
||||
Content = "";
|
||||
ctx = null;
|
||||
}
|
||||
public async Task HandleAsync(IHttpContext ctx)
|
||||
{
|
||||
this.ctx = ctx;
|
||||
@@ -27,7 +32,7 @@ namespace nksrv.IntlServer
|
||||
{
|
||||
var x = JsonConvert.DeserializeObject<AuthPkt>(Content);
|
||||
string tokToCheck = "";
|
||||
if(x != null && x.channel_info != null && !string.IsNullOrEmpty(x.channel_info.account_token))
|
||||
if (x != null && x.channel_info != null && !string.IsNullOrEmpty(x.channel_info.account_token))
|
||||
{
|
||||
tokToCheck = x.channel_info.account_token;
|
||||
}
|
||||
@@ -60,12 +65,14 @@ namespace nksrv.IntlServer
|
||||
|
||||
if (User == null)
|
||||
{
|
||||
Logger.Warn("Unknown auth token");
|
||||
await WriteJsonStringAsync("{\"msg\":\"expired verify_code!\",\"ret\":2022,\"seq\":\"" + Seq + "\"}\r\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Logger.Warn("Failed to parse auth data");
|
||||
await WriteJsonStringAsync("{\"msg\":\"expired verify_code!\",\"ret\":2022,\"seq\":\"" + Seq + "\"}\r\n");
|
||||
return;
|
||||
}
|
||||
@@ -74,14 +81,22 @@ namespace nksrv.IntlServer
|
||||
await HandleAsync();
|
||||
}
|
||||
protected abstract Task HandleAsync();
|
||||
protected async Task WriteJsonStringAsync(string data)
|
||||
protected async Task WriteJsonStringAsync(string data, bool juniper = false)
|
||||
{
|
||||
if (ctx != null)
|
||||
{
|
||||
var bt = Encoding.UTF8.GetBytes(data);
|
||||
ctx.Response.ContentEncoding = null;
|
||||
ctx.Response.ContentType = "application/json";
|
||||
ctx.Response.ContentLength64 = bt.Length;
|
||||
if (juniper)
|
||||
{
|
||||
ctx.Response.ContentEncoding = Encoding.UTF8;
|
||||
ctx.Response.ContentType = "application/json";
|
||||
}
|
||||
else
|
||||
{
|
||||
ctx.Response.ContentEncoding = null;
|
||||
ctx.Response.ContentType = "application/json";
|
||||
ctx.Response.ContentLength64 = bt.Length;
|
||||
}
|
||||
await ctx.Response.OutputStream.WriteAsync(bt, ctx.CancellationToken);
|
||||
await ctx.Response.OutputStream.FlushAsync();
|
||||
}
|
||||
|
||||
@@ -1,13 +1,4 @@
|
||||
using EmbedIO;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace nksrv.IntlServer
|
||||
namespace nksrv.IntlServer
|
||||
{
|
||||
internal class IntlQueryAccountInfo : IntlMsgHandler
|
||||
{
|
||||
|
||||
@@ -1,12 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using EmbedIO;
|
||||
using Swan;
|
||||
|
||||
namespace nksrv.IntlServer
|
||||
namespace nksrv.IntlServer
|
||||
{
|
||||
public class IntlReturnJsonHandler : IntlMsgHandler
|
||||
{
|
||||
|
||||
46
nksrv/IntlServer/JuniperLauncherGetRegion.cs
Normal file
46
nksrv/IntlServer/JuniperLauncherGetRegion.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace nksrv.IntlServer
|
||||
{
|
||||
internal class JuniperLauncherGetRegion : IntlMsgHandler
|
||||
{
|
||||
public override bool RequiresAuth => false;
|
||||
|
||||
protected override async Task HandleAsync()
|
||||
{
|
||||
await WriteJsonStringAsync(@"{
|
||||
""result"": {
|
||||
""error_code"": 0,
|
||||
""error_message"": ""success""
|
||||
},
|
||||
""region_info"": [
|
||||
{
|
||||
""game_id"": ""16601"",
|
||||
""region_id"": ""10001"",
|
||||
""region_name_en_us"": ""Global"",
|
||||
""region_name_i18n"": """",
|
||||
""region_description_en_us"": ""Nikke Global Version"",
|
||||
""region_description_i18n"": """",
|
||||
""bind_branches"": """",
|
||||
""meta_data"": """",
|
||||
""sequence"": 0,
|
||||
""status"": 2,
|
||||
""branch_info"": [
|
||||
{
|
||||
""game_id"": ""16601"",
|
||||
""branch_id"": ""1"",
|
||||
""branch_name"": ""Official_release"",
|
||||
""branch_type"": 0,
|
||||
""description"": ""正式发布环境 release包""
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
18
nksrv/IntlServer/JuniperLauncherGetRepoVersion.cs
Normal file
18
nksrv/IntlServer/JuniperLauncherGetRepoVersion.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace nksrv.IntlServer
|
||||
{
|
||||
internal class JuniperLauncherGetRepoVersion : IntlMsgHandler
|
||||
{
|
||||
public override bool RequiresAuth => false;
|
||||
|
||||
protected override async Task HandleAsync()
|
||||
{
|
||||
await WriteJsonStringAsync(File.ReadAllText(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "gameversion.json")), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
33
nksrv/IntlServer/JupiterAuthLogin.cs
Normal file
33
nksrv/IntlServer/JupiterAuthLogin.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace nksrv.IntlServer
|
||||
{
|
||||
internal class JupiterAuthLogin : IntlMsgHandler
|
||||
{
|
||||
public override bool RequiresAuth => false;
|
||||
|
||||
protected override async Task HandleAsync()
|
||||
{
|
||||
await WriteJsonStringAsync(@"{
|
||||
""result"": {
|
||||
""error_code"": 0,
|
||||
""error_message"": ""COMM_SUCC""
|
||||
},
|
||||
""channel"": 0,
|
||||
""game_id"": ""0"",
|
||||
""openid"": """",
|
||||
""uid"": """",
|
||||
""biz_ticket"": """",
|
||||
""expire_interval"": 0,
|
||||
""refresh_interval"": 0,
|
||||
""login_key"": """",
|
||||
""login_ticket"": """",
|
||||
""third_uid"": """"
|
||||
}", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
35
nksrv/IntlServer/JupterGetGameLauncher.cs
Normal file
35
nksrv/IntlServer/JupterGetGameLauncher.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace nksrv.IntlServer
|
||||
{
|
||||
internal class JuniperLauncherGetGameLauncher : IntlMsgHandler
|
||||
{
|
||||
public override bool RequiresAuth => false;
|
||||
|
||||
protected override async Task HandleAsync()
|
||||
{
|
||||
await WriteJsonStringAsync(@"{
|
||||
""result"": {
|
||||
""error_code"": 0,
|
||||
""error_message"": ""COMM_SUCC""
|
||||
},
|
||||
""game_launcher_info"": [
|
||||
{
|
||||
""id"": 27,
|
||||
""execute_file"": ""NIKKE\\Game\\NIKKE.exe"",
|
||||
""param"": """",
|
||||
""description"": ""Nikke main process"",
|
||||
""os"": ""any"",
|
||||
""branch_id"": 0,
|
||||
""status"": 1,
|
||||
""param_type"": 1
|
||||
}
|
||||
]
|
||||
}", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,7 @@
|
||||
using EmbedIO;
|
||||
using Newtonsoft.Json;
|
||||
using nksrv.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using nksrv.Database;
|
||||
using System.Net;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using static nksrv.IntlServer.IntlLogin1Endpoint;
|
||||
using static nksrv.IntlServer.IntlLogin2Endpoint;
|
||||
|
||||
namespace nksrv.IntlServer
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using ASodium;
|
||||
using EmbedIO;
|
||||
using Google.Protobuf;
|
||||
using nksrv.Database;
|
||||
using nksrv.Utils;
|
||||
using Swan.Logging;
|
||||
|
||||
@@ -114,7 +115,6 @@ namespace nksrv.LobbyServer
|
||||
LobbyJukebox = 2,
|
||||
InfraCoreExp = user.InfraCoreExp,
|
||||
InfraCoreLv = user.InfraCoreLvl,
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
using EmbedIO;
|
||||
using Google.Protobuf;
|
||||
using nksrv.Database;
|
||||
using nksrv.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace nksrv.LobbyServer
|
||||
{
|
||||
|
||||
@@ -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.Antibot
|
||||
{
|
||||
|
||||
@@ -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.Antibot
|
||||
{
|
||||
|
||||
@@ -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.Archive
|
||||
{
|
||||
|
||||
@@ -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.Archive
|
||||
{
|
||||
|
||||
@@ -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.Arena
|
||||
{
|
||||
|
||||
@@ -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.Arena
|
||||
{
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using Google.Protobuf;
|
||||
using nksrv.Database;
|
||||
using nksrv.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace nksrv.LobbyServer.Msgs.Auth
|
||||
{
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using EmbedIO;
|
||||
using Google.Protobuf;
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using nksrv.Database;
|
||||
using nksrv.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using EmbedIO;
|
||||
|
||||
namespace nksrv.LobbyServer.Msgs.Auth
|
||||
{
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
using nksrv.Utils;
|
||||
using EmbedIO;
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using nksrv.Database;
|
||||
using nksrv.Utils;
|
||||
|
||||
namespace nksrv.LobbyServer.Msgs.Auth
|
||||
{
|
||||
@@ -8,10 +11,42 @@ namespace nksrv.LobbyServer.Msgs.Auth
|
||||
protected override async Task HandleAsync()
|
||||
{
|
||||
var req = await ReadData<ReqAuthIntl>();
|
||||
|
||||
var response = new AuthIntlResponse();
|
||||
//response.BanInfo = new NetBanInfo() { BanId = 123, Description = "The server admin is sad today because the hinge on his HP laptop broke which happened to be an HP Elitebook 8470p, and the RAM controller exploded and then fixed itself, please contact him", StartAt = Timestamp.FromDateTime(DateTime.UtcNow), EndAt = Timestamp.FromDateTime(DateTime.UtcNow.AddDays(256)) };
|
||||
response.AuthSuccess = new NetAuthSuccess() { AuthToken = req.Token, CentauriZoneId = "84", FirstAuth = "", PurchaseRestriction = new NetUserPurchaseRestriction() { PurchaseRestriction = PurchaseRestriction.Unknown2, UpdatedAt = 638546758794611090 } };
|
||||
|
||||
UsedAuthToken = req.Token;
|
||||
foreach (var item in JsonDb.Instance.LauncherAccessTokens)
|
||||
{
|
||||
if (item.Token == UsedAuthToken)
|
||||
{
|
||||
UserId = item.UserID;
|
||||
}
|
||||
}
|
||||
if (UserId == 0)
|
||||
{
|
||||
response.AuthError = new NetAuthError() { ErrorCode = AuthErrorCode.Error };
|
||||
}
|
||||
else
|
||||
{
|
||||
var user = GetUser();
|
||||
|
||||
if (user.IsBanned && user.BanEnd < DateTime.UtcNow)
|
||||
{
|
||||
user.IsBanned = false;
|
||||
user.BanId = 0;
|
||||
user.BanStart = DateTime.MinValue;
|
||||
user.BanEnd = DateTime.MinValue;
|
||||
JsonDb.Save();
|
||||
}
|
||||
|
||||
if (user.IsBanned)
|
||||
{
|
||||
response.BanInfo = new NetBanInfo() { BanId = user.BanId, Description = "The server admin is sad today because the hinge on his HP laptop broke which happened to be an HP Elitebook 8470p, and the RAM controller exploded and then fixed itself, please contact him", StartAt = Timestamp.FromDateTime(DateTime.SpecifyKind(user.BanStart, DateTimeKind.Utc)), EndAt = Timestamp.FromDateTime(DateTime.SpecifyKind(user.BanEnd, DateTimeKind.Utc)) };
|
||||
}
|
||||
else
|
||||
{
|
||||
response.AuthSuccess = new NetAuthSuccess() { AuthToken = req.Token, CentauriZoneId = "84", FirstAuth = "", PurchaseRestriction = new NetUserPurchaseRestriction() { PurchaseRestriction = PurchaseRestriction.Child, UpdatedAt = 638546758794611090 } };
|
||||
}
|
||||
}
|
||||
|
||||
await WriteDataAsync(response);
|
||||
}
|
||||
|
||||
@@ -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.Badge
|
||||
{
|
||||
|
||||
@@ -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.Campaign
|
||||
{
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
using nksrv.LobbyServer.Msgs.Stage;
|
||||
using nksrv.StaticInfo;
|
||||
using nksrv.Utils;
|
||||
using Swan.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace nksrv.LobbyServer.Msgs.Campaign
|
||||
{
|
||||
@@ -17,7 +11,7 @@ namespace nksrv.LobbyServer.Msgs.Campaign
|
||||
{
|
||||
var req = await ReadData<ReqGetCampaignFieldData>();
|
||||
var user = GetUser();
|
||||
|
||||
|
||||
Console.WriteLine("Map ID: " + req.MapId);
|
||||
|
||||
var response = new ResGetCampaignFieldData();
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
using nksrv.StaticInfo;
|
||||
using nksrv.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace nksrv.LobbyServer.Msgs.Campaign
|
||||
{
|
||||
@@ -21,7 +16,7 @@ namespace nksrv.LobbyServer.Msgs.Campaign
|
||||
var chapter = StaticDataParser.Instance.GetNormalChapterNumberFromFieldName(req.MapId);
|
||||
var mod = req.MapId.Contains("hard") ? "Hard" : "Normal";
|
||||
var key = chapter + "_" + mod;
|
||||
var field = user.FieldInfo[key];
|
||||
var field = user.FieldInfoNew[key];
|
||||
|
||||
// TODO
|
||||
response.Reward = new();
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace nksrv.LobbyServer.Msgs.Campaign
|
||||
}
|
||||
else
|
||||
{
|
||||
user.MapJson[req.MapId] = req.Json;
|
||||
user.MapJson[req.MapId] = req.Json;
|
||||
}
|
||||
|
||||
await WriteDataAsync(response);
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
using nksrv.StaticInfo;
|
||||
using nksrv.Database;
|
||||
using nksrv.StaticInfo;
|
||||
using nksrv.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace nksrv.LobbyServer.Msgs.Campaign
|
||||
{
|
||||
@@ -25,7 +21,7 @@ namespace nksrv.LobbyServer.Msgs.Campaign
|
||||
var chapter = StaticDataParser.Instance.GetNormalChapterNumberFromFieldName(req.MapId);
|
||||
var mod = req.MapId.Contains("hard") ? "Hard" : "Normal";
|
||||
var key = chapter + "_" + mod;
|
||||
var field = user.FieldInfo[key];
|
||||
var field = user.FieldInfoNew[key];
|
||||
|
||||
field.CompletedObjects.Add(new NetFieldObject() { PositionId = req.FieldObject.PositionID, Json = req.FieldObject.Json, Type = req.FieldObject.Type });
|
||||
JsonDb.Save();
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
using nksrv.StaticInfo;
|
||||
using nksrv.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace nksrv.LobbyServer.Msgs.Character
|
||||
{
|
||||
|
||||
@@ -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
|
||||
{
|
||||
@@ -24,18 +19,25 @@ namespace nksrv.LobbyServer.Msgs.Character
|
||||
{
|
||||
response.Synchro.StandardCharacters.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, UltiSkillLv = item.UltimateLevel } });
|
||||
}
|
||||
|
||||
|
||||
response.Synchro.Slots.Add(new NetSynchroSlot() { Slot = 1 });
|
||||
response.Synchro.Slots.Add(new NetSynchroSlot() { Slot = 2 });
|
||||
response.Synchro.Slots.Add(new NetSynchroSlot() { Slot = 3 });
|
||||
response.Synchro.Slots.Add(new NetSynchroSlot() { Slot = 4 });
|
||||
response.Synchro.Slots.Add(new NetSynchroSlot() { Slot = 5 });
|
||||
|
||||
response.Synchro.SynchroMaxLv = highestLevelCharacters.First().Level;
|
||||
response.Synchro.SynchroLv = highestLevelCharacters.Last().Level;
|
||||
if (highestLevelCharacters.Count > 0)
|
||||
{
|
||||
response.Synchro.SynchroMaxLv = highestLevelCharacters.First().Level;
|
||||
response.Synchro.SynchroLv = highestLevelCharacters.Last().Level;
|
||||
}
|
||||
else
|
||||
{
|
||||
response.Synchro.SynchroLv = 1;
|
||||
}
|
||||
|
||||
// TODO: Validate response from real server and pull info from user info
|
||||
await WriteDataAsync(response);
|
||||
await WriteDataAsync(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
using nksrv.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using nksrv.Database;
|
||||
using nksrv.StaticInfo;
|
||||
using nksrv.Utils;
|
||||
using Swan.Logging;
|
||||
|
||||
namespace nksrv.LobbyServer.Msgs.Character
|
||||
{
|
||||
@@ -15,17 +13,42 @@ namespace nksrv.LobbyServer.Msgs.Character
|
||||
var req = await ReadData<ReqCharacterLevelUp>();
|
||||
var user = GetUser();
|
||||
var response = new ResCharacterLevelUp();
|
||||
var data = StaticDataParser.Instance.GetCharacterLevelUpData();
|
||||
|
||||
foreach (var item in user.Characters.ToArray())
|
||||
{
|
||||
if (item.Csn == req.Csn)
|
||||
{
|
||||
item.Level = req.Level;
|
||||
// TODO: subtract currency
|
||||
int requiredCredit = 0;
|
||||
int requiredBattleData = 0;
|
||||
int requiredCoreDust = 0;
|
||||
for (int i = item.Level; i < req.Level; i++)
|
||||
{
|
||||
var levelUpData = data[i];
|
||||
requiredCredit += levelUpData.gold;
|
||||
requiredBattleData += levelUpData.character_exp;
|
||||
requiredCoreDust += levelUpData.character_exp2;
|
||||
}
|
||||
|
||||
if (user.CanSubtractCurrency(CurrencyType.Gold, requiredCredit) &&
|
||||
user.CanSubtractCurrency(CurrencyType.CharacterExp, requiredBattleData) &&
|
||||
user.CanSubtractCurrency(CurrencyType.CharacterExp2, requiredCoreDust))
|
||||
{
|
||||
user.SubtractCurrency(CurrencyType.Gold, requiredCredit);
|
||||
user.SubtractCurrency(CurrencyType.CharacterExp, requiredBattleData);
|
||||
user.SubtractCurrency(CurrencyType.CharacterExp2, requiredCoreDust);
|
||||
item.Level = req.Level;
|
||||
}
|
||||
else
|
||||
{
|
||||
// TOOD: log this
|
||||
Logger.Error("ERROR: Not enough currency for upgrade");
|
||||
return;
|
||||
}
|
||||
|
||||
response.Character = new() {
|
||||
CostumeId = item.CostumeId,
|
||||
response.Character = new()
|
||||
{
|
||||
CostumeId = item.CostumeId,
|
||||
Csn = item.Csn,
|
||||
Lv = item.Level,
|
||||
Skill1Lv = item.Skill1Lvl,
|
||||
@@ -43,14 +66,17 @@ namespace nksrv.LobbyServer.Msgs.Character
|
||||
response.SynchroStandardCharacters.Add(c.Tid);
|
||||
}
|
||||
|
||||
foreach (var currency in user.Currency)
|
||||
{
|
||||
response.Currencies.Add(new NetUserCurrencyData() { Type = (int)currency.Key, Value = currency.Value });
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
JsonDb.Save();
|
||||
|
||||
|
||||
|
||||
await WriteDataAsync(response);
|
||||
await WriteDataAsync(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
using nksrv.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using nksrv.Database;
|
||||
using nksrv.Utils;
|
||||
|
||||
namespace nksrv.LobbyServer.Msgs.Character
|
||||
{
|
||||
@@ -17,7 +13,7 @@ namespace nksrv.LobbyServer.Msgs.Character
|
||||
|
||||
foreach (var item in user.Characters)
|
||||
{
|
||||
if(item.Csn == req.Csn)
|
||||
if (item.Csn == req.Csn)
|
||||
{
|
||||
item.CostumeId = req.CostumeId;
|
||||
break;
|
||||
@@ -27,7 +23,7 @@ namespace nksrv.LobbyServer.Msgs.Character
|
||||
|
||||
var response = new ResSetCharacterCostume();
|
||||
|
||||
await WriteDataAsync(response);
|
||||
await WriteDataAsync(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
using nksrv.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using nksrv.Database;
|
||||
using nksrv.Utils;
|
||||
|
||||
namespace nksrv.LobbyServer.Msgs.Event
|
||||
{
|
||||
@@ -31,7 +27,7 @@ namespace nksrv.LobbyServer.Msgs.Event
|
||||
|
||||
// TODO reward
|
||||
|
||||
await WriteDataAsync(response);
|
||||
await WriteDataAsync(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.Event
|
||||
{
|
||||
@@ -18,7 +13,7 @@ namespace nksrv.LobbyServer.Msgs.Event
|
||||
|
||||
// TOOD
|
||||
|
||||
await WriteDataAsync(response);
|
||||
await WriteDataAsync(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.Event
|
||||
{
|
||||
@@ -16,7 +11,7 @@ namespace nksrv.LobbyServer.Msgs.Event
|
||||
|
||||
var response = new ResGetEventMissionClear();
|
||||
// TODO
|
||||
await WriteDataAsync(response);
|
||||
await WriteDataAsync(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
using nksrv.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using nksrv.Database;
|
||||
using nksrv.Utils;
|
||||
|
||||
namespace nksrv.LobbyServer.Msgs.Event
|
||||
{
|
||||
@@ -26,7 +22,7 @@ namespace nksrv.LobbyServer.Msgs.Event
|
||||
user.EventInfo.Add(req.EventID, new EventData());
|
||||
}
|
||||
|
||||
await WriteDataAsync(response);
|
||||
await WriteDataAsync(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.Event
|
||||
{
|
||||
@@ -69,7 +64,7 @@ namespace nksrv.LobbyServer.Msgs.Event
|
||||
JoinAt = 0
|
||||
});
|
||||
|
||||
await WriteDataAsync(response);
|
||||
await WriteDataAsync(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.Event
|
||||
{
|
||||
@@ -102,7 +97,26 @@ namespace nksrv.LobbyServer.Msgs.Event
|
||||
EventEndDate = DateTime.Now.AddDays(20).Ticks,
|
||||
EventDisableDate = DateTime.Now.AddDays(20).Ticks,
|
||||
});
|
||||
await WriteDataAsync(response);
|
||||
|
||||
response.EventList.Add(new NetEventData()
|
||||
{
|
||||
Id = 40053,
|
||||
EventSystemType = 5,
|
||||
EventVisibleDate = DateTime.UtcNow.Subtract(TimeSpan.FromDays(1)).Ticks,
|
||||
EventStartDate = DateTime.UtcNow.Subtract(TimeSpan.FromDays(1)).Ticks,
|
||||
EventEndDate = DateTime.Now.AddDays(20).Ticks,
|
||||
EventDisableDate = DateTime.Now.AddDays(20).Ticks,
|
||||
});
|
||||
//response.EventList.Add(new NetEventData()
|
||||
//{
|
||||
// Id = 40054,
|
||||
// EventSystemType = 5,
|
||||
// EventVisibleDate = DateTime.UtcNow.Subtract(TimeSpan.FromDays(1)).Ticks,
|
||||
// EventStartDate = DateTime.UtcNow.Subtract(TimeSpan.FromDays(1)).Ticks,
|
||||
// EventEndDate = DateTime.Now.AddDays(20).Ticks,
|
||||
// EventDisableDate = DateTime.Now.AddDays(20).Ticks,
|
||||
//});
|
||||
await WriteDataAsync(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
28
nksrv/LobbyServer/Msgs/Event/StoryEvent/GetStoryDungeon.cs
Normal file
28
nksrv/LobbyServer/Msgs/Event/StoryEvent/GetStoryDungeon.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using nksrv.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace nksrv.LobbyServer.Msgs.Event.StoryEvent
|
||||
{
|
||||
[PacketPath("/event/storydungeon/get")]
|
||||
public class GetStoryDungeon : LobbyMsgHandler
|
||||
{
|
||||
protected override async Task HandleAsync()
|
||||
{
|
||||
var req = await ReadData<ReqStoryDungeonEventData>();
|
||||
var user = GetUser();
|
||||
|
||||
var response = new ResStoryDungeonEventData()
|
||||
{
|
||||
TeamData = new NetUserTeamData()
|
||||
};
|
||||
|
||||
// TOOD
|
||||
|
||||
await WriteDataAsync(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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.FavoriteItem
|
||||
{
|
||||
|
||||
@@ -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.FavoriteItem
|
||||
{
|
||||
|
||||
@@ -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.FavoriteItem
|
||||
{
|
||||
|
||||
@@ -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.Friend
|
||||
{
|
||||
@@ -16,7 +11,7 @@ namespace nksrv.LobbyServer.Msgs.Friend
|
||||
var response = new ResGetFriendData();
|
||||
|
||||
|
||||
await WriteDataAsync(response);
|
||||
await WriteDataAsync(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.Gacha
|
||||
{
|
||||
@@ -20,7 +15,7 @@ namespace nksrv.LobbyServer.Msgs.Gacha
|
||||
response.FreeCount = 0;
|
||||
response.EventData = new NetEventData() { Id = 1 };
|
||||
|
||||
await WriteDataAsync(response);
|
||||
await WriteDataAsync(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
using nksrv.StaticInfo;
|
||||
using nksrv.Database;
|
||||
using nksrv.StaticInfo;
|
||||
using nksrv.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace nksrv.LobbyServer.Msgs.Gacha
|
||||
{
|
||||
@@ -27,20 +23,18 @@ namespace nksrv.LobbyServer.Msgs.Gacha
|
||||
{
|
||||
foreach (var c in StaticDataParser.Instance.GetAllCharacterTids())
|
||||
{
|
||||
response.Gacha.Add(new NetGachaEntityData() { Corporation = 0, PieceCount = 1, CurrencyValue = 5, Sn = 130201, Tid = c, Type = 1 });
|
||||
|
||||
user.Characters.Add(new Utils.Character() { CostumeId = 0, Csn = c, Grade = 0, Level = 1, Skill1Lvl = 1, Skill2Lvl = 1, Tid = c, UltimateLevel = 1 });
|
||||
|
||||
// response.Characters.Add(new NetUserCharacterDefaultData() { Lv = 1, Skill1Lv = 1, Grade = 0, Csn = 1, Tid = 130201 });
|
||||
response.Gacha.Add(new NetGachaEntityData() { Corporation = 1, PieceCount = 1, CurrencyValue = 5, Sn = c, Tid = c, Type = 1 });
|
||||
|
||||
response.Characters.Add(new NetUserCharacterDefaultData() { CostumeId = 0, Csn = c, Grade = 0, Lv = 1, Skill1Lv = 1, Skill2Lv = 1, Tid = c, UltiSkillLv = 1 });
|
||||
user.Characters.Add(new Database.Character() { CostumeId = 0, Csn = c, Grade = 0, Level = 1, Skill1Lvl = 1, Skill2Lvl = 1, Tid = c, UltimateLevel = 1 });
|
||||
}
|
||||
user.GachaTutorialPlayCount++;
|
||||
}
|
||||
|
||||
JsonDb.Save();
|
||||
|
||||
|
||||
await WriteDataAsync(response);
|
||||
|
||||
await WriteDataAsync(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace nksrv.LobbyServer.Msgs
|
||||
response.CheatShiftDuration = Duration.FromTimeSpan(TimeSpan.FromSeconds(0));
|
||||
// todo: validate response with actual server
|
||||
|
||||
await WriteDataAsync(response);
|
||||
await WriteDataAsync(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,4 @@
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using nksrv.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using nksrv.Utils;
|
||||
|
||||
namespace nksrv.LobbyServer.Msgs
|
||||
{
|
||||
@@ -19,7 +13,7 @@ namespace nksrv.LobbyServer.Msgs
|
||||
var response = new ResGetGachaData();
|
||||
if (user.GachaTutorialPlayCount > 0)
|
||||
response.Gacha.Add(new NetUserGachaData() { GachaType = 3, PlayCount = 1 });
|
||||
await WriteDataAsync(response);
|
||||
await WriteDataAsync(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
25
nksrv/LobbyServer/Msgs/Intercept/GetInterceptData.cs
Normal file
25
nksrv/LobbyServer/Msgs/Intercept/GetInterceptData.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using nksrv.Net;
|
||||
using nksrv.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace nksrv.LobbyServer.Msgs.Intercept
|
||||
{
|
||||
[PacketPath("/intercept/get")]
|
||||
public class GetInterceptData : LobbyMsgHandler
|
||||
{
|
||||
protected override async Task HandleAsync()
|
||||
{
|
||||
var req = await ReadData<ReqGetInterceptData>();
|
||||
|
||||
var response = new ResGetInterceptData();
|
||||
|
||||
// TODO implement
|
||||
|
||||
await WriteDataAsync(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,5 @@
|
||||
using nksrv.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using nksrv.Database;
|
||||
using nksrv.Utils;
|
||||
|
||||
namespace nksrv.LobbyServer.Msgs.Inventory
|
||||
{
|
||||
@@ -28,9 +24,10 @@ namespace nksrv.LobbyServer.Msgs.Inventory
|
||||
response.Items.Add(NetUtils.ToNet(item));
|
||||
}
|
||||
}
|
||||
|
||||
JsonDb.Save();
|
||||
|
||||
await WriteDataAsync(response);
|
||||
await WriteDataAsync(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
using nksrv.LobbyServer.Msgs.User;
|
||||
using nksrv.Database;
|
||||
using nksrv.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace nksrv.LobbyServer.Msgs.Inventory
|
||||
{
|
||||
@@ -26,12 +21,13 @@ namespace nksrv.LobbyServer.Msgs.Inventory
|
||||
item.Csn = 0;
|
||||
|
||||
response.Item = NetUtils.ToNet(item);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
JsonDb.Save();
|
||||
|
||||
await WriteDataAsync(response);
|
||||
await WriteDataAsync(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.Inventory
|
||||
{
|
||||
@@ -20,10 +15,9 @@ namespace nksrv.LobbyServer.Msgs.Inventory
|
||||
{
|
||||
response.Items.Add(new NetUserItemData() { Count = item.Count, Tid = item.ItemType, Csn = item.Csn, Lv = item.Level, Exp = item.Exp, Corporation = item.Corp, Isn = item.Isn, Position = item.Position });
|
||||
}
|
||||
// TODO: HarmonyCubes, RunAwakeningIsnList, UserRedeems
|
||||
|
||||
// TODO implement
|
||||
|
||||
await WriteDataAsync(response);
|
||||
await WriteDataAsync(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
using nksrv.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using nksrv.Database;
|
||||
using nksrv.Utils;
|
||||
|
||||
namespace nksrv.LobbyServer.Msgs.Inventory
|
||||
{
|
||||
@@ -17,26 +13,32 @@ namespace nksrv.LobbyServer.Msgs.Inventory
|
||||
|
||||
var response = new ResWearEquipment();
|
||||
|
||||
var pos = NetUtils.GetItemPos(user, req.Isn);
|
||||
|
||||
// unequip old item
|
||||
|
||||
foreach (var item in user.Items.ToArray())
|
||||
{
|
||||
if (item.Csn == req.Csn && item.Position == pos)
|
||||
{
|
||||
item.Csn = 0;
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var item in user.Items.ToArray())
|
||||
{
|
||||
if (item.Isn == req.Isn)
|
||||
{
|
||||
// update character id
|
||||
item.Csn = req.Csn;
|
||||
item.Position = NetUtils.GetItemPos(user, item.Isn);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
foreach (var item in user.Items.ToArray())
|
||||
{
|
||||
if (item.Csn == req.Csn)
|
||||
{
|
||||
item.Position = pos;
|
||||
response.Items.Add(NetUtils.ToNet(item));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
JsonDb.Save();
|
||||
await WriteDataAsync(response);
|
||||
await WriteDataAsync(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
using nksrv.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using nksrv.Database;
|
||||
using nksrv.Utils;
|
||||
|
||||
namespace nksrv.LobbyServer.Msgs.Inventory
|
||||
{
|
||||
@@ -17,14 +13,27 @@ namespace nksrv.LobbyServer.Msgs.Inventory
|
||||
|
||||
var response = new ResWearEquipmentList();
|
||||
|
||||
foreach (var item in user.Items.ToArray())
|
||||
// TODO optimize
|
||||
foreach (var item2 in req.IsnList)
|
||||
{
|
||||
foreach (var item2 in req.IsnList)
|
||||
var pos = NetUtils.GetItemPos(user, item2);
|
||||
|
||||
// unequip previous items
|
||||
foreach (var item in user.Items.ToArray())
|
||||
{
|
||||
if (item.Position == pos && item.Csn == req.Csn)
|
||||
{
|
||||
item.Csn = 0;
|
||||
item.Position = 0;
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var item in user.Items.ToArray())
|
||||
{
|
||||
if (item2 == item.Isn)
|
||||
{
|
||||
item.Csn = req.Csn;
|
||||
item.Position = NetUtils.GetItemPos(user, item.Isn);
|
||||
item.Position = pos;
|
||||
response.Items.Add(NetUtils.ToNet(item));
|
||||
}
|
||||
}
|
||||
|
||||
30
nksrv/LobbyServer/Msgs/Liberate/ChooseCharacter.cs
Normal file
30
nksrv/LobbyServer/Msgs/Liberate/ChooseCharacter.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using nksrv.Net;
|
||||
using nksrv.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace nksrv.LobbyServer.Msgs.Liberate
|
||||
{
|
||||
[PacketPath("/liberate/choosecharacter")]
|
||||
public class ChooseCharacter : LobbyMsgHandler
|
||||
{
|
||||
protected override async Task HandleAsync()
|
||||
{
|
||||
var req = await ReadData<ChooseLiberateCharacterRequest>();
|
||||
var user = GetUser();
|
||||
|
||||
var response = new ChooseLiberateCharacterResponse();
|
||||
|
||||
// TODO
|
||||
response.Data = new NetLiberateData() { CharacterId = req.CharacterId };
|
||||
response.Data.MissionData.Add(new NetLiberateMissionData() { MissionState = LiberateMissionState.Running, Id = 1 });
|
||||
response.Data.MissionData.Add(new NetLiberateMissionData() { MissionState = LiberateMissionState.Running, Id = 2 });
|
||||
response.Data.MissionData.Add(new NetLiberateMissionData() { MissionState = LiberateMissionState.Running, Id = 3 });
|
||||
|
||||
await WriteDataAsync(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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.Liberate
|
||||
{
|
||||
|
||||
26
nksrv/LobbyServer/Msgs/Liberate/GetProgressList.cs
Normal file
26
nksrv/LobbyServer/Msgs/Liberate/GetProgressList.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using nksrv.Net;
|
||||
using nksrv.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace nksrv.LobbyServer.Msgs.Liberate
|
||||
{
|
||||
[PacketPath("/liberate/getprogresslist")]
|
||||
public class GetProgressList : LobbyMsgHandler
|
||||
{
|
||||
protected override async Task HandleAsync()
|
||||
{
|
||||
var req = await ReadData<GetLiberateProgressListRequest>();
|
||||
var user = GetUser();
|
||||
|
||||
var response = new GetLiberateProgressListResponse();
|
||||
|
||||
// TODO
|
||||
|
||||
await WriteDataAsync(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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.Lostsector
|
||||
{
|
||||
|
||||
@@ -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.Messenger
|
||||
{
|
||||
@@ -17,7 +12,7 @@ namespace nksrv.LobbyServer.Msgs.Messenger
|
||||
// TODO: save these things
|
||||
var response = new ResPickTodayDailyMessage();
|
||||
|
||||
await WriteDataAsync(response);
|
||||
await WriteDataAsync(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.Messenger
|
||||
{
|
||||
@@ -17,7 +12,7 @@ namespace nksrv.LobbyServer.Msgs.Messenger
|
||||
// TODO: save these things
|
||||
var response = new ResGetMessages();
|
||||
|
||||
await WriteDataAsync(response);
|
||||
await WriteDataAsync(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.Messenger
|
||||
{
|
||||
@@ -17,7 +12,7 @@ namespace nksrv.LobbyServer.Msgs.Messenger
|
||||
// TODO: get proper response
|
||||
var response = new ResGetPickedMessageList();
|
||||
|
||||
await WriteDataAsync(response);
|
||||
await WriteDataAsync(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.Messenger
|
||||
{
|
||||
@@ -17,7 +12,7 @@ namespace nksrv.LobbyServer.Msgs.Messenger
|
||||
// TODO: get proper response
|
||||
var response = new ResForcePickTodayRandomMessage();
|
||||
|
||||
await WriteDataAsync(response);
|
||||
await WriteDataAsync(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace nksrv.LobbyServer.Msgs.Messenger
|
||||
// TODO: save these things
|
||||
var response = new ResProceedMessage();
|
||||
|
||||
await WriteDataAsync(response);
|
||||
await WriteDataAsync(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.Minigame.Dave
|
||||
{
|
||||
@@ -16,7 +11,7 @@ namespace nksrv.LobbyServer.Msgs.Minigame.Dave
|
||||
|
||||
var response = new ResGetAllMiniGameDaveTriggers();
|
||||
// TODO
|
||||
await WriteDataAsync(response);
|
||||
await WriteDataAsync(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.Minigame
|
||||
{
|
||||
@@ -16,7 +11,7 @@ namespace nksrv.LobbyServer.Msgs.Minigame
|
||||
|
||||
var response = new ResGetMiniGameNKSV2Data();
|
||||
// TODO
|
||||
await WriteDataAsync(response);
|
||||
await WriteDataAsync(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.Minigame.IslandAdventure
|
||||
{
|
||||
@@ -16,7 +11,7 @@ namespace nksrv.LobbyServer.Msgs.Minigame.IslandAdventure
|
||||
|
||||
var response = new ResGetIslandAdventureFishingStepUpRewardStatus();
|
||||
// TODO
|
||||
await WriteDataAsync(response);
|
||||
await WriteDataAsync(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.Minigame.IslandAdventure
|
||||
{
|
||||
@@ -16,7 +11,7 @@ namespace nksrv.LobbyServer.Msgs.Minigame.IslandAdventure
|
||||
|
||||
var response = new ResGetIslandAdventurePhotoStepUpRewardStatus();
|
||||
// TODO
|
||||
await WriteDataAsync(response);
|
||||
await WriteDataAsync(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.Minigame.IslandAdventure
|
||||
{
|
||||
@@ -16,7 +11,7 @@ namespace nksrv.LobbyServer.Msgs.Minigame.IslandAdventure
|
||||
|
||||
var response = new ResGetIslandAdventureMissionProgress();
|
||||
// TODO
|
||||
await WriteDataAsync(response);
|
||||
await WriteDataAsync(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.Minigame.PlaySoda
|
||||
{
|
||||
@@ -16,7 +11,7 @@ namespace nksrv.LobbyServer.Msgs.Minigame.PlaySoda
|
||||
|
||||
var response = new ResGetPlaySodaChallengeModeInfo();
|
||||
// TODO
|
||||
await WriteDataAsync(response);
|
||||
await WriteDataAsync(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace nksrv.LobbyServer.Msgs.Misc
|
||||
|
||||
var response = new ResEnterLobbyPing();
|
||||
|
||||
await WriteDataAsync(response);
|
||||
await WriteDataAsync(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,8 +14,8 @@ namespace nksrv.LobbyServer.Msgs.Misc
|
||||
if (user.GachaTutorialPlayCount > 0)
|
||||
response.Unavailables.Add(3);
|
||||
|
||||
// TODO: Validate response from real server and pull info from user info
|
||||
await WriteDataAsync(response);
|
||||
// TODO: Validate response from real server and pull info from user info
|
||||
await WriteDataAsync(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,4 @@
|
||||
using Google.Protobuf;
|
||||
using nksrv.StaticInfo;
|
||||
using nksrv.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using nksrv.Utils;
|
||||
|
||||
namespace nksrv.LobbyServer.Msgs.Misc
|
||||
{
|
||||
@@ -19,7 +12,7 @@ namespace nksrv.LobbyServer.Msgs.Misc
|
||||
var r = new ResGetFeatureFlag();
|
||||
r.IsOpen = true;
|
||||
|
||||
await WriteDataAsync(r);
|
||||
await WriteDataAsync(r);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
using Google.Protobuf;
|
||||
using nksrv.Net;
|
||||
using nksrv.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace nksrv.LobbyServer.Msgs.Misc
|
||||
{
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
using nksrv.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using nksrv.Net;
|
||||
using nksrv.Utils;
|
||||
|
||||
namespace nksrv.LobbyServer.Msgs.Misc
|
||||
{
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
using nksrv.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using nksrv.Net;
|
||||
using nksrv.Utils;
|
||||
|
||||
namespace nksrv.LobbyServer.Msgs.Misc
|
||||
{
|
||||
@@ -13,8 +9,9 @@ namespace nksrv.LobbyServer.Msgs.Misc
|
||||
protected override async Task HandleAsync()
|
||||
{
|
||||
var r = new SentryDataResponse();
|
||||
// TODO check proper response from real server
|
||||
await WriteDataAsync(r);
|
||||
// TODO: figure out a way to disable sentry so that Shift Up devs wouldn't be annoyed by this server
|
||||
|
||||
await WriteDataAsync(r);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using nksrv.Net;
|
||||
using nksrv.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace nksrv.LobbyServer.Msgs.Misc
|
||||
{
|
||||
@@ -13,13 +8,13 @@ namespace nksrv.LobbyServer.Msgs.Misc
|
||||
{
|
||||
protected override async Task HandleAsync()
|
||||
{
|
||||
var r = new ResGetServerInfo();
|
||||
var r = new GetServerInfoResponse();
|
||||
|
||||
// todo: reimplement this as well
|
||||
r.MatchUrl = "https://global-match.nikke-kr.com";
|
||||
r.WorldId = 84;
|
||||
|
||||
await WriteDataAsync(r);
|
||||
await WriteDataAsync(r);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Google.Protobuf;
|
||||
using nksrv.Net;
|
||||
using nksrv.StaticInfo;
|
||||
using nksrv.Utils;
|
||||
|
||||
@@ -14,7 +15,7 @@ namespace nksrv.LobbyServer.Msgs.Misc
|
||||
var r = new StaticDataPackResponse();
|
||||
r.Url = GameConfig.Root.StaticData.Url;
|
||||
r.Version = GameConfig.Root.StaticData.Version;
|
||||
r.Size = StaticDataParser.Instance.Size;
|
||||
r.FileSize = StaticDataParser.Instance.Size;
|
||||
r.Sha256Sum = ByteString.CopyFrom(StaticDataParser.Instance.Sha256Hash);
|
||||
r.Salt1 = ByteString.CopyFrom(Convert.FromBase64String(GameConfig.Root.StaticData.Salt1));
|
||||
r.Salt2 = ByteString.CopyFrom(Convert.FromBase64String(GameConfig.Root.StaticData.Salt2));
|
||||
|
||||
@@ -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.Misc
|
||||
{
|
||||
@@ -13,10 +8,11 @@ namespace nksrv.LobbyServer.Msgs.Misc
|
||||
protected override async Task HandleAsync()
|
||||
{
|
||||
var req = await ReadData<ReqUserOnlineStateLog>();
|
||||
|
||||
var user = GetUser();
|
||||
|
||||
var response = new ResUserOnlineStateLog();
|
||||
await WriteDataAsync(response);
|
||||
user.LastLogin = DateTime.UtcNow;
|
||||
await WriteDataAsync(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.Mission
|
||||
{
|
||||
@@ -17,7 +12,7 @@ namespace nksrv.LobbyServer.Msgs.Mission
|
||||
var response = new ResGetAchievementRewardedData();
|
||||
|
||||
// TODO
|
||||
await WriteDataAsync(response);
|
||||
await WriteDataAsync(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.Mission.Rewards
|
||||
{
|
||||
@@ -17,7 +12,7 @@ namespace nksrv.LobbyServer.Msgs.Mission.Rewards
|
||||
// TODO: implement
|
||||
var response = new ResGetDailyRewardedData();
|
||||
|
||||
await WriteDataAsync(response);
|
||||
await WriteDataAsync(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace nksrv.LobbyServer.Msgs.Outpost
|
||||
// TODO: save these things
|
||||
var response = new ResGetJukeboxRewardedData();
|
||||
|
||||
await WriteDataAsync(response);
|
||||
await WriteDataAsync(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user