mirror of
https://github.com/EpinelPS/EpinelPS.git
synced 2025-12-14 16:04:36 +01:00
add additional messages
This commit is contained in:
@@ -114,7 +114,6 @@ namespace nksrv.LobbyServer
|
|||||||
LobbyJukebox = 2,
|
LobbyJukebox = 2,
|
||||||
InfraCoreExp = user.InfraCoreExp,
|
InfraCoreExp = user.InfraCoreExp,
|
||||||
InfraCoreLv = user.InfraCoreLvl,
|
InfraCoreLv = user.InfraCoreLvl,
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -10,7 +10,7 @@ namespace nksrv.LobbyServer.Msgs.Shop
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var x = await ReadData<ReqGetJupiterProductList>(); //todo: causes crash
|
var x = await ReadData<ReqGetJupiterProductList>();
|
||||||
|
|
||||||
var response = new ResGetJupiterProductList();
|
var response = new ResGetJupiterProductList();
|
||||||
foreach (var item in x.ProductIdList)
|
foreach (var item in x.ProductIdList)
|
||||||
|
|||||||
25
nksrv/LobbyServer/Msgs/Shop/GetShop.cs
Normal file
25
nksrv/LobbyServer/Msgs/Shop/GetShop.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.Shop
|
||||||
|
{
|
||||||
|
[PacketPath("/shop/get")]
|
||||||
|
public class GetShop : LobbyMsgHandler
|
||||||
|
{
|
||||||
|
protected override async Task HandleAsync()
|
||||||
|
{
|
||||||
|
var x = await ReadData<GetShopRequest>();
|
||||||
|
|
||||||
|
var response = new GetShopResponse();
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
|
||||||
|
await WriteDataAsync(response);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
34
nksrv/Protos/liberate.proto
Normal file
34
nksrv/Protos/liberate.proto
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
option csharp_namespace = "nksrv.Net";
|
||||||
|
|
||||||
|
import "google/protobuf/timestamp.proto";
|
||||||
|
import "google/protobuf/Duration.proto";
|
||||||
|
import "Protos/allmsgs.proto";
|
||||||
|
|
||||||
|
enum LiberateDataExpiredError {
|
||||||
|
LIBERATE_DATA_EXPIRED_ERROR_SUCCESS = 0;
|
||||||
|
LIBERATE_DATA_EXPIRED_ERROR_EXPIRED = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message NetLiberateProgressData {
|
||||||
|
int32 CharacterId = 1;
|
||||||
|
int32 Step = 2;
|
||||||
|
int32 ProgressPoint = 3;
|
||||||
|
int32 RewardedCount = 4;
|
||||||
|
bool IsCompleted = 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
message GetLiberateProgressListRequest {}
|
||||||
|
message GetLiberateProgressListResponse {
|
||||||
|
repeated NetLiberateProgressData ProgressData = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message ChooseLiberateCharacterRequest {
|
||||||
|
int32 CharacterId = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message ChooseLiberateCharacterResponse {
|
||||||
|
NetLiberateData data = 1;
|
||||||
|
LiberateDataExpiredError Error = 2;
|
||||||
|
}
|
||||||
35
nksrv/Protos/shop.proto
Normal file
35
nksrv/Protos/shop.proto
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
option csharp_namespace = "nksrv.Net";
|
||||||
|
|
||||||
|
import "google/protobuf/timestamp.proto";
|
||||||
|
import "google/protobuf/Duration.proto";
|
||||||
|
|
||||||
|
message NetShopProductInfoData {
|
||||||
|
int32 Order = 1;
|
||||||
|
int32 ProductId = 2;
|
||||||
|
int32 BuyLimitCount = 3;
|
||||||
|
int32 BuyCount = 4;
|
||||||
|
int32 CorpType = 5;
|
||||||
|
int32 Discount = 6;
|
||||||
|
int64 EndAt = 7;
|
||||||
|
bool UseDateCondition = 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
message NetShopProductData {
|
||||||
|
int32 ShopTid = 1;
|
||||||
|
int32 ShopCategory = 2;
|
||||||
|
int32 RenewCount = 3;
|
||||||
|
int64 RenewAt = 4;
|
||||||
|
int64 NextRenewAt = 5;
|
||||||
|
int32 FreeRenewCount = 6;
|
||||||
|
repeated NetShopProductInfoData List = 7;
|
||||||
|
}
|
||||||
|
|
||||||
|
message GetShopRequest {
|
||||||
|
int32 ShopCategory = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message GetShopResponse {
|
||||||
|
NetShopProductData Shop = 1;
|
||||||
|
}
|
||||||
@@ -25,7 +25,6 @@ namespace nksrv.Utils
|
|||||||
|
|
||||||
public class Character
|
public class Character
|
||||||
{
|
{
|
||||||
// TODO
|
|
||||||
public int Csn = 0;
|
public int Csn = 0;
|
||||||
public int Tid = 0;
|
public int Tid = 0;
|
||||||
public int CostumeId = 0;
|
public int CostumeId = 0;
|
||||||
@@ -86,8 +85,7 @@ namespace nksrv.Utils
|
|||||||
public Dictionary<string, FieldInfoNew> FieldInfoNew = [];
|
public Dictionary<string, FieldInfoNew> FieldInfoNew = [];
|
||||||
public Dictionary<string, string> MapJson = [];
|
public Dictionary<string, string> MapJson = [];
|
||||||
public Dictionary<CurrencyType, long> Currency = new() {
|
public Dictionary<CurrencyType, long> Currency = new() {
|
||||||
{ CurrencyType.ContentStamina, 2 },
|
{ CurrencyType.ContentStamina, 2 }
|
||||||
{ CurrencyType.CharPremiumTicket, 999999 }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
public List<ItemData> Items = new();
|
public List<ItemData> Items = new();
|
||||||
@@ -206,8 +204,10 @@ namespace nksrv.Utils
|
|||||||
internal class JsonDb
|
internal class JsonDb
|
||||||
{
|
{
|
||||||
public static CoreInfo Instance { get; internal set; }
|
public static CoreInfo Instance { get; internal set; }
|
||||||
|
|
||||||
|
// Note: change this in sodium
|
||||||
public static byte[] ServerPrivateKey = Convert.FromBase64String("FSUY8Ohd942n5LWAfxn6slK3YGwc8OqmyJoJup9nNos=");
|
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()
|
static JsonDb()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -29,6 +29,11 @@
|
|||||||
<Protobuf Include="Protos\*.*" GrpcServices="Server" />
|
<Protobuf Include="Protos\*.*" GrpcServices="Server" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<None Remove="Protos\liberate.proto" />
|
||||||
|
<None Remove="Protos\shop.proto" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Update="gameconfig.json">
|
<None Update="gameconfig.json">
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
|||||||
Reference in New Issue
Block a user