mirror of
https://github.com/MewoLab/AquaDX.git
synced 2026-02-14 03:58:55 +08:00
[O] Reduce bits for DIVA
This commit is contained in:
@@ -30,9 +30,11 @@ class UserRegistrar(
|
|||||||
val emailProps: EmailProperties
|
val emailProps: EmailProperties
|
||||||
) {
|
) {
|
||||||
companion object {
|
companion object {
|
||||||
// Random long with length 17 (10^18 possibilities)
|
// Random long with length 9 (10^10 possibilities)
|
||||||
const val cardExtIdStart = 1e17.toLong()
|
// This is because DIVA is using int for card ID, which is at max 10 digits (2147483647)
|
||||||
const val cardExtIdEnd = 1e18.toLong() - 1
|
// TODO: Figure out if DIVA can handle int64
|
||||||
|
const val cardExtIdStart = 1e9.toLong()
|
||||||
|
const val cardExtIdEnd = 1e10.toLong() - 1
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -54,9 +54,9 @@ class DivaRepositoryTest {
|
|||||||
var c = cardRepository.save(getCard());
|
var c = cardRepository.save(getCard());
|
||||||
playerProfileRepository.save(getProfile(c));
|
playerProfileRepository.save(getProfile(c));
|
||||||
|
|
||||||
var p = playerProfileRepository.findByPdId(c.getExtId().intValue());
|
var p = playerProfileRepository.findByPdId((int) c.getExtId());
|
||||||
|
|
||||||
assertThat(p).isPresent().hasValueSatisfying(v -> assertThat(v.getPdId()).isEqualTo(c.getExtId().intValue()));
|
assertThat(p).isPresent().hasValueSatisfying(v -> assertThat(v.getPdId()).isEqualTo(c.getExtId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -200,7 +200,7 @@ class DivaRepositoryTest {
|
|||||||
|
|
||||||
private PlayerProfile getProfile(Card c) {
|
private PlayerProfile getProfile(Card c) {
|
||||||
var p = new PlayerProfile();
|
var p = new PlayerProfile();
|
||||||
p.setPdId(c.getExtId().intValue());
|
p.setPdId((int) c.getExtId());
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user