Implemented turning off shopToken and kaToken, default token_data.json to both tokens turned off
This commit is contained in:
parent
fadbed54ae
commit
c7c380fa0a
@ -24,7 +24,7 @@ public class GetShopFolderController : BaseController<GetShopFolderController>
|
||||
var response = new GetShopFolderResponse
|
||||
{
|
||||
Result = 1,
|
||||
TokenId = shopTokenId,
|
||||
TokenId = shopTokenId > 0 ? (uint)shopTokenId : 1,
|
||||
VerupNo = 2
|
||||
};
|
||||
|
||||
|
@ -42,31 +42,36 @@ public class GetTokenCountController : BaseController<GetTokenCountController>
|
||||
|
||||
tokenCountDict.ThrowIfNull("TokenCountDict should never be null");
|
||||
|
||||
if (tokenCountDict.Count == 0) tokenCountDict.Add(shopTokenId, 0);
|
||||
|
||||
tokenCountDict.TryAdd(shopTokenId, 0);
|
||||
|
||||
tokenCountDict.TryAdd(kaTokenId, 0);
|
||||
|
||||
user.TokenCountDict = JsonSerializer.Serialize(tokenCountDict);
|
||||
await userDatumService.UpdateUserDatum(user);
|
||||
|
||||
var response = new GetTokenCountResponse
|
||||
{
|
||||
Result = 1
|
||||
};
|
||||
|
||||
response.AryTokenCountDatas.Add(new GetTokenCountResponse.TokenCountData
|
||||
if (tokenCountDict.Count == 0) tokenCountDict.Add(1, 0);
|
||||
if (shopTokenId > 0)
|
||||
{
|
||||
TokenCount = tokenCountDict[shopTokenId],
|
||||
TokenId = shopTokenId
|
||||
});
|
||||
var castedShopTokenId = (uint)shopTokenId;
|
||||
tokenCountDict.TryAdd(castedShopTokenId, 0);
|
||||
response.AryTokenCountDatas.Add(new GetTokenCountResponse.TokenCountData
|
||||
{
|
||||
TokenCount = tokenCountDict[castedShopTokenId],
|
||||
TokenId = castedShopTokenId
|
||||
});
|
||||
}
|
||||
|
||||
response.AryTokenCountDatas.Add(new GetTokenCountResponse.TokenCountData
|
||||
if (kaTokenId > 0)
|
||||
{
|
||||
TokenCount = tokenCountDict[kaTokenId],
|
||||
TokenId = kaTokenId
|
||||
});
|
||||
var castedKaTokenId = (uint)kaTokenId;
|
||||
tokenCountDict.TryAdd(castedKaTokenId, 0);
|
||||
response.AryTokenCountDatas.Add(new GetTokenCountResponse.TokenCountData
|
||||
{
|
||||
TokenCount = tokenCountDict[castedKaTokenId],
|
||||
TokenId = castedKaTokenId
|
||||
});
|
||||
}
|
||||
|
||||
user.TokenCountDict = JsonSerializer.Serialize(tokenCountDict);
|
||||
await userDatumService.UpdateUserDatum(user);
|
||||
|
||||
return Ok(response);
|
||||
}
|
||||
|
@ -125,8 +125,7 @@ public class UserDataController : BaseController<UserDataController>
|
||||
IsVoiceOn = userData.IsVoiceOn,
|
||||
IsSkipOn = userData.IsSkipOn,
|
||||
IsChallengecompe = false,
|
||||
SongRecentCnt = (uint)recentSongs.Length,
|
||||
TotalCreditCnt = 0
|
||||
SongRecentCnt = (uint)recentSongs.Length
|
||||
};
|
||||
|
||||
return Ok(response);
|
||||
|
@ -39,7 +39,7 @@ public class GameDataService : IGameDataService
|
||||
|
||||
private List<uint> lockedSongsList = new();
|
||||
|
||||
private Dictionary<string, uint> tokenDataDictionary = new();
|
||||
private Dictionary<string, int> tokenDataDictionary = new();
|
||||
|
||||
private readonly DataSettings settings;
|
||||
|
||||
@ -93,7 +93,7 @@ public class GameDataService : IGameDataService
|
||||
return shopFolderDictionary;
|
||||
}
|
||||
|
||||
public Dictionary<string, uint> GetTokenDataDictionary()
|
||||
public Dictionary<string, int> GetTokenDataDictionary()
|
||||
{
|
||||
return tokenDataDictionary;
|
||||
}
|
||||
@ -143,7 +143,7 @@ public class GameDataService : IGameDataService
|
||||
var movieData = await JsonSerializer.DeserializeAsync<List<MovieData>>(movieDataFile);
|
||||
var eventFolderData = await JsonSerializer.DeserializeAsync<List<EventFolderData>>(eventFolderDataFile);
|
||||
var shopFolderData = await JsonSerializer.DeserializeAsync<List<ShopFolderData>>(shopFolderDataFile);
|
||||
var tokenData = await JsonSerializer.DeserializeAsync<Dictionary<string, uint>>(tokenDataFile);
|
||||
var tokenData = await JsonSerializer.DeserializeAsync<Dictionary<string, int>>(tokenDataFile);
|
||||
var lockedSongsData = await JsonSerializer.DeserializeAsync<Dictionary<string, uint[]>>(lockedSongsDataFile);
|
||||
|
||||
InitializeMusicInfoes(infoesData);
|
||||
@ -242,7 +242,7 @@ public class GameDataService : IGameDataService
|
||||
shopFolderDictionary = shopFolderData.ToImmutableDictionary(data => data.SongNo, ToResponseShopFolderData);
|
||||
}
|
||||
|
||||
private void InitializeTokenData(Dictionary<string, uint>? tokenData)
|
||||
private void InitializeTokenData(Dictionary<string, int>? tokenData)
|
||||
{
|
||||
tokenData.ThrowIfNull("Shouldn't happen!");
|
||||
tokenDataDictionary = tokenData;
|
||||
|
@ -24,7 +24,7 @@ public interface IGameDataService
|
||||
|
||||
public ImmutableDictionary<uint, GetShopFolderResponse.ShopFolderData> GetShopFolderDictionary();
|
||||
|
||||
public Dictionary<string, uint> GetTokenDataDictionary();
|
||||
public Dictionary<string, int> GetTokenDataDictionary();
|
||||
|
||||
public List<uint> GetLockedSongsList();
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{
|
||||
"shopTokenId": 4,
|
||||
"kaTokenId": 1000
|
||||
"shopTokenId": -1,
|
||||
"kaTokenId": -1
|
||||
}
|
Loading…
Reference in New Issue
Block a user