mirror of
https://github.com/EpinelPS/EpinelPS.git
synced 2025-12-14 07:55:01 +01:00
fix loading screen hang, only allow gacha tutorial once
This commit is contained in:
@@ -25,6 +25,8 @@ namespace nksrv.IntlServer
|
||||
if (item.Username == ep.account && item.Password == ep.password)
|
||||
{
|
||||
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 + "\"}");
|
||||
|
||||
return;
|
||||
|
||||
@@ -19,19 +19,24 @@ namespace nksrv.LobbyServer.Msgs.Gacha
|
||||
var response = new ResExecuteGacha();
|
||||
|
||||
// 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();
|
||||
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();
|
||||
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace nksrv.LobbyServer.Msgs.Outpost
|
||||
var response = new ResGetOutpostData
|
||||
{
|
||||
OutpostBattleLevel = new NetOutpostBattleLevel() { Level = 1 },
|
||||
CommanderBgm = new NetUserJukeboxDataV2(),
|
||||
CommanderBgm = new NetUserJukeboxDataV2() { CommandBgm = new() { Type = NetJukeboxBgmType.JukeboxTableId, JukeboxTableId = 3012 } },
|
||||
BattleTime = 864000000000, Jukebox = new(), MaxBattleTime = 864000000000
|
||||
};
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ namespace nksrv.LobbyServer.Msgs.User
|
||||
}
|
||||
response.MaxGachaCount = 10;
|
||||
// todo tutorial playcount of gacha
|
||||
response.TutorialGachaPlayCount = user.GachaTutorialPlayCount;
|
||||
|
||||
WriteData(response);
|
||||
}
|
||||
|
||||
@@ -87,6 +87,7 @@ namespace nksrv.Utils
|
||||
public DateTime BattleTime = DateTime.UtcNow;
|
||||
|
||||
public NetOutpostBattleLevel OutpostBattleLevel = new() { Level = 1 };
|
||||
public int GachaTutorialPlayCount = 0;
|
||||
|
||||
public void SetQuest(int tid, bool recieved)
|
||||
{
|
||||
@@ -107,14 +108,13 @@ namespace nksrv.Utils
|
||||
|
||||
public List<AccessToken> LauncherAccessTokens = [];
|
||||
|
||||
|
||||
public Dictionary<string, GameClientInfo> GameClientTokens = [];
|
||||
}
|
||||
internal class JsonDb
|
||||
{
|
||||
public static CoreInfo Instance { get; internal set; }
|
||||
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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user