mirror of
https://github.com/EpinelPS/EpinelPS.git
synced 2025-12-13 07:24:52 +01:00
fix loading screen hang, only allow gacha tutorial once
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -455,4 +455,5 @@ $RECYCLE.BIN/
|
|||||||
|
|
||||||
# Allow pregenerated ssl cert
|
# Allow pregenerated ssl cert
|
||||||
!nksrv/site.pfx
|
!nksrv/site.pfx
|
||||||
!ServerSelector/myCA.pfx
|
!ServerSelector/myCA.pfx
|
||||||
|
!ServerSelector/sodium.dll
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
# nikke-server
|
# nikke-server
|
||||||
Private/local server for Nikke. NOTE: This project is in a very early state.
|
Private/local server for Nikke. NOTE: This project is in a very early state so many features in the game do not work.
|
||||||
|
|
||||||
## Usage
|
## 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.
|
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.
|
||||||
@@ -10,7 +10,7 @@ You should be able to register an new account in the launcher (you can enter any
|
|||||||
|
|
||||||
If the game does not get past the title screen, open an issue and send %appdata%\..\LocalLow\com.proximabeta\NIKKE\player.log file.
|
If the game does not get past the title screen, open an issue and send %appdata%\..\LocalLow\com.proximabeta\NIKKE\player.log file.
|
||||||
|
|
||||||
|
Note that this was tested with the latest version (122.8.20c)
|
||||||
|
|
||||||
## Progress
|
## Progress
|
||||||
Stage, character, and story information is saved and works, as well as player nickname.
|
Stage, character, and story information is saved and works, as well as player nickname.
|
||||||
|
|||||||
@@ -25,6 +25,8 @@ namespace nksrv.IntlServer
|
|||||||
if (item.Username == ep.account && item.Password == ep.password)
|
if (item.Username == ep.account && item.Password == ep.password)
|
||||||
{
|
{
|
||||||
var tok = IntlHandler.CreateLauncherTokenForUser(item);
|
var tok = IntlHandler.CreateLauncherTokenForUser(item);
|
||||||
|
item.LastLogin = DateTime.UtcNow;
|
||||||
|
JsonDb.Save();
|
||||||
WriteJsonString("{\"expire\":" + tok.ExpirationTime + ",\"is_login\":true,\"msg\":\"Success\",\"register_time\":" + item.RegisterTime + ",\"ret\":0,\"seq\":\"" + Seq + "\",\"token\":\"" + tok.Token + "\",\"uid\":\"" + item.ID + "\"}");
|
WriteJsonString("{\"expire\":" + tok.ExpirationTime + ",\"is_login\":true,\"msg\":\"Success\",\"register_time\":" + item.RegisterTime + ",\"ret\":0,\"seq\":\"" + Seq + "\",\"token\":\"" + tok.Token + "\",\"uid\":\"" + item.ID + "\"}");
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -19,19 +19,24 @@ namespace nksrv.LobbyServer.Msgs.Gacha
|
|||||||
var response = new ResExecuteGacha();
|
var response = new ResExecuteGacha();
|
||||||
|
|
||||||
// TODO: Pick random character that player does not have unless it supports limit break.
|
// TODO: Pick random character that player does not have unless it supports limit break.
|
||||||
// TODO: Write character to user info.
|
|
||||||
|
|
||||||
// TODO implement
|
// TODO implement reward
|
||||||
response.Reward = new NetRewardData();
|
response.Reward = new NetRewardData();
|
||||||
foreach (var c in StaticDataParser.Instance.GetAllCharacterTids())
|
|
||||||
|
if (user.GachaTutorialPlayCount == 0)
|
||||||
{
|
{
|
||||||
response.Gacha.Add(new NetGachaEntityData() { Corporation = 0, PieceCount = 1, CurrencyValue = 5, Sn = 130201, Tid = c, Type = 1 });
|
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 });
|
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.Characters.Add(new NetUserCharacterDefaultData() { Lv = 1, Skill1Lv = 1, Grade = 0, Csn = 1, Tid = 130201 });
|
||||||
|
|
||||||
|
}
|
||||||
|
user.GachaTutorialPlayCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
JsonDb.Save();
|
JsonDb.Save();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace nksrv.LobbyServer.Msgs.Outpost
|
|||||||
var response = new ResGetOutpostData
|
var response = new ResGetOutpostData
|
||||||
{
|
{
|
||||||
OutpostBattleLevel = new NetOutpostBattleLevel() { Level = 1 },
|
OutpostBattleLevel = new NetOutpostBattleLevel() { Level = 1 },
|
||||||
CommanderBgm = new NetUserJukeboxDataV2(),
|
CommanderBgm = new NetUserJukeboxDataV2() { CommandBgm = new() { Type = NetJukeboxBgmType.JukeboxTableId, JukeboxTableId = 3012 } },
|
||||||
BattleTime = 864000000000, Jukebox = new(), MaxBattleTime = 864000000000
|
BattleTime = 864000000000, Jukebox = new(), MaxBattleTime = 864000000000
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ namespace nksrv.LobbyServer.Msgs.User
|
|||||||
}
|
}
|
||||||
response.MaxGachaCount = 10;
|
response.MaxGachaCount = 10;
|
||||||
// todo tutorial playcount of gacha
|
// todo tutorial playcount of gacha
|
||||||
|
response.TutorialGachaPlayCount = user.GachaTutorialPlayCount;
|
||||||
|
|
||||||
WriteData(response);
|
WriteData(response);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ namespace nksrv.Utils
|
|||||||
public DateTime BattleTime = DateTime.UtcNow;
|
public DateTime BattleTime = DateTime.UtcNow;
|
||||||
|
|
||||||
public NetOutpostBattleLevel OutpostBattleLevel = new() { Level = 1 };
|
public NetOutpostBattleLevel OutpostBattleLevel = new() { Level = 1 };
|
||||||
|
public int GachaTutorialPlayCount = 0;
|
||||||
|
|
||||||
public void SetQuest(int tid, bool recieved)
|
public void SetQuest(int tid, bool recieved)
|
||||||
{
|
{
|
||||||
@@ -107,14 +108,13 @@ namespace nksrv.Utils
|
|||||||
|
|
||||||
public List<AccessToken> LauncherAccessTokens = [];
|
public List<AccessToken> LauncherAccessTokens = [];
|
||||||
|
|
||||||
|
|
||||||
public Dictionary<string, GameClientInfo> GameClientTokens = [];
|
public Dictionary<string, GameClientInfo> GameClientTokens = [];
|
||||||
}
|
}
|
||||||
internal class JsonDb
|
internal class JsonDb
|
||||||
{
|
{
|
||||||
public static CoreInfo Instance { get; internal set; }
|
public static CoreInfo Instance { get; internal set; }
|
||||||
public static byte[] ServerPrivateKey = Convert.FromBase64String("FSUY8Ohd942n5LWAfxn6slK3YGwc8OqmyJoJup9nNos=");
|
public static byte[] ServerPrivateKey = Convert.FromBase64String("FSUY8Ohd942n5LWAfxn6slK3YGwc8OqmyJoJup9nNos=");
|
||||||
public static byte[] ServerPublicKey = Convert.FromBase64String("04hFDd1e/BOEF2h4b0MdkX2h6W5REeqyW+0r9+eSeh0=");
|
public static byte[] ServerPublicKey = Convert.FromBase64String("04hFDd1e/BOEF2h4b0MdkX2h6W5REeqyW+0r9+eSeh0="); // Note: change this in sodium
|
||||||
|
|
||||||
static JsonDb()
|
static JsonDb()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user