Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
ziqian zhang
Grasscutter
Commits
09c8ed34
Commit
09c8ed34
authored
Apr 21, 2022
by
Magix
Committed by
GitHub
Apr 21, 2022
Browse files
Changes for Morphia 2.x upgrade
Morphia call fixes; add `@Entity` to more classes
parents
0a96012f
06101f1b
Changes
8
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/database/DatabaseHelper.java
View file @
09c8ed34
...
...
@@ -139,7 +139,7 @@ public final class DatabaseHelper {
}
public
static
List
<
GenshinAvatar
>
getAvatars
(
GenshinPlayer
player
)
{
return
DatabaseManager
.
getDatastore
().
find
(
GenshinAvatar
.
class
).
filter
(
Filters
.
eq
(
"
play
erId"
,
player
.
getUid
())).
stream
().
toList
();
return
DatabaseManager
.
getDatastore
().
find
(
GenshinAvatar
.
class
).
filter
(
Filters
.
eq
(
"
own
erId"
,
player
.
getUid
())).
stream
().
toList
();
}
public
static
void
saveItem
(
GenshinItem
item
)
{
...
...
@@ -155,7 +155,7 @@ public final class DatabaseHelper {
return
DatabaseManager
.
getDatastore
().
find
(
GenshinItem
.
class
).
filter
(
Filters
.
eq
(
"ownerId"
,
player
.
getUid
())).
stream
().
toList
();
}
public
static
List
<
Friendship
>
getFriends
(
GenshinPlayer
player
)
{
return
DatabaseManager
.
getDatastore
().
find
(
Friendship
.
class
).
filter
(
Filters
.
eq
(
"
play
erId"
,
player
.
getUid
())).
stream
().
toList
();
return
DatabaseManager
.
getDatastore
().
find
(
Friendship
.
class
).
filter
(
Filters
.
eq
(
"
own
erId"
,
player
.
getUid
())).
stream
().
toList
();
}
public
static
List
<
Friendship
>
getReverseFriends
(
GenshinPlayer
player
)
{
...
...
src/main/java/emu/grasscutter/game/TeamInfo.java
View file @
09c8ed34
...
...
@@ -3,10 +3,12 @@ package emu.grasscutter.game;
import
java.util.ArrayList
;
import
java.util.List
;
import
dev.morphia.annotations.Entity
;
import
emu.grasscutter.GenshinConstants
;
import
emu.grasscutter.Grasscutter
;
import
emu.grasscutter.game.avatar.GenshinAvatar
;
@Entity
public
class
TeamInfo
{
private
String
name
;
private
List
<
Integer
>
avatars
;
...
...
src/main/java/emu/grasscutter/game/TeamManager.java
View file @
09c8ed34
...
...
@@ -8,6 +8,7 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Set
;
import
dev.morphia.annotations.Entity
;
import
dev.morphia.annotations.Transient
;
import
emu.grasscutter.GenshinConstants
;
import
emu.grasscutter.Grasscutter
;
...
...
@@ -41,6 +42,7 @@ import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
import
it.unimi.dsi.fastutil.ints.IntOpenHashSet
;
import
it.unimi.dsi.fastutil.ints.IntSet
;
@Entity
public
class
TeamManager
{
@Transient
private
GenshinPlayer
player
;
...
...
src/main/java/emu/grasscutter/game/avatar/AvatarProfileData.java
View file @
09c8ed34
package
emu.grasscutter.game.avatar
;
import
dev.morphia.annotations.Entity
;
@Entity
public
class
AvatarProfileData
{
private
int
avatarId
;
private
int
level
;
...
...
src/main/java/emu/grasscutter/game/friends/PlayerProfile.java
View file @
09c8ed34
...
...
@@ -4,6 +4,7 @@ import dev.morphia.annotations.*;
import
emu.grasscutter.game.GenshinPlayer
;
import
emu.grasscutter.utils.Utils
;
@Entity
public
class
PlayerProfile
{
@Transient
private
GenshinPlayer
player
;
...
...
src/main/java/emu/grasscutter/game/gacha/PlayerGachaBannerInfo.java
View file @
09c8ed34
package
emu.grasscutter.game.gacha
;
import
dev.morphia.annotations.Entity
;
@Entity
public
class
PlayerGachaBannerInfo
{
private
int
pity5
=
0
;
private
int
pity4
=
0
;
...
...
src/main/java/emu/grasscutter/game/gacha/PlayerGachaInfo.java
View file @
09c8ed34
package
emu.grasscutter.game.gacha
;
import
dev.morphia.annotations.Entity
;
@Entity
public
class
PlayerGachaInfo
{
private
PlayerGachaBannerInfo
standardBanner
;
private
PlayerGachaBannerInfo
eventCharacterBanner
;
...
...
src/main/java/emu/grasscutter/utils/Position.java
View file @
09c8ed34
...
...
@@ -2,8 +2,10 @@ package emu.grasscutter.utils;
import
java.io.Serializable
;
import
dev.morphia.annotations.Entity
;
import
emu.grasscutter.net.proto.VectorOuterClass.Vector
;
@Entity
public
class
Position
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
2001232313615923575L
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment