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
a8293102
Commit
a8293102
authored
Jun 07, 2022
by
Melledy
Committed by
GitHub
Jun 07, 2022
Browse files
Merge branch 'development' into stable
parents
304b9cb8
ecf7a81a
Changes
410
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/data/
def
/ReliquarySetData.java
→
src/main/java/emu/grasscutter/data/
excels
/ReliquarySetData.java
View file @
a8293102
package
emu.grasscutter.data.
def
;
package
emu.grasscutter.data.
excels
;
import
emu.grasscutter.data.GameResource
;
import
emu.grasscutter.data.ResourceType
;
@ResourceType
(
name
=
"ReliquarySetExcelConfigData.json"
)
public
class
ReliquarySetData
extends
GameResource
{
private
int
S
etId
;
private
int
[]
S
etNeedNum
;
private
int
s
etId
;
private
int
[]
s
etNeedNum
;
private
int
EquipAffixId
;
private
int
D
isableFilter
;
private
int
[]
C
ontainsList
;
private
int
d
isableFilter
;
private
int
[]
c
ontainsList
;
@Override
public
int
getId
()
{
return
S
etId
;
return
s
etId
;
}
public
int
[]
getSetNeedNum
()
{
return
S
etNeedNum
;
return
s
etNeedNum
;
}
public
int
getEquipAffixId
()
{
...
...
@@ -25,11 +25,11 @@ public class ReliquarySetData extends GameResource {
}
public
int
getDisableFilter
()
{
return
D
isableFilter
;
return
d
isableFilter
;
}
public
int
[]
getContainsList
()
{
return
C
ontainsList
;
return
c
ontainsList
;
}
@Override
...
...
src/main/java/emu/grasscutter/data/
def
/RewardData.java
→
src/main/java/emu/grasscutter/data/
excels
/RewardData.java
View file @
a8293102
package
emu.grasscutter.data.
def
;
import
java.util.List
;
import
emu.grasscutter.data.GameResource
;
import
emu.grasscutter.data.ResourceType
;
import
emu.grasscutter.data.common.
RewardIte
mData
;
@ResourceType
(
name
=
"RewardExcelConfigData.json"
)
public
class
RewardData
extends
GameResource
{
public
int
R
ewardId
;
public
List
<
RewardIte
mData
>
R
ewardItemList
;
@Override
public
int
getId
()
{
return
R
ewardId
;
}
public
List
<
RewardIte
mData
>
getRewardItemList
()
{
return
R
ewardItemList
;
}
@Override
public
void
onLoad
()
{
}
}
package
emu.grasscutter.data.
excels
;
import
java.util.List
;
import
emu.grasscutter.data.GameResource
;
import
emu.grasscutter.data.ResourceType
;
import
emu.grasscutter.data.common.
ItemPara
mData
;
@ResourceType
(
name
=
"RewardExcelConfigData.json"
)
public
class
RewardData
extends
GameResource
{
public
int
r
ewardId
;
public
List
<
ItemPara
mData
>
r
ewardItemList
;
@Override
public
int
getId
()
{
return
r
ewardId
;
}
public
List
<
ItemPara
mData
>
getRewardItemList
()
{
return
r
ewardItemList
;
}
@Override
public
void
onLoad
()
{
rewardItemList
=
rewardItemList
.
stream
().
filter
(
i
->
i
.
getId
()
>
0
).
toList
();
}
}
src/main/java/emu/grasscutter/data/
def
/RewardPreviewData.java
→
src/main/java/emu/grasscutter/data/
excels
/RewardPreviewData.java
View file @
a8293102
package
emu.grasscutter.data.
def
;
package
emu.grasscutter.data.
excels
;
import
java.util.Arrays
;
import
java.util.List
;
...
...
@@ -16,28 +16,28 @@ import emu.grasscutter.data.common.ItemParamStringData;
@ResourceType
(
name
=
"RewardPreviewExcelConfigData.json"
,
loadPriority
=
LoadPriority
.
HIGH
)
public
class
RewardPreviewData
extends
GameResource
{
private
int
I
d
;
private
ItemParamStringData
[]
P
reviewItems
;
private
ItemParamData
[]
P
reviewItemsArray
;
private
int
i
d
;
private
ItemParamStringData
[]
p
reviewItems
;
private
ItemParamData
[]
p
reviewItemsArray
;
@Override
public
int
getId
()
{
return
this
.
I
d
;
return
this
.
i
d
;
}
public
ItemParamData
[]
getPreviewItems
()
{
return
P
reviewItemsArray
;
return
p
reviewItemsArray
;
}
@Override
public
void
onLoad
()
{
if
(
this
.
P
reviewItems
!=
null
&&
this
.
P
reviewItems
.
length
>
0
)
{
this
.
P
reviewItemsArray
=
Arrays
.
stream
(
this
.
P
reviewItems
)
if
(
this
.
p
reviewItems
!=
null
&&
this
.
p
reviewItems
.
length
>
0
)
{
this
.
p
reviewItemsArray
=
Arrays
.
stream
(
this
.
p
reviewItems
)
.
filter
(
d
->
d
.
getId
()
>
0
&&
d
.
getCount
()
!=
null
&&
!
d
.
getCount
().
isEmpty
())
.
map
(
ItemParamStringData:
:
toItemParamData
)
.
toArray
(
size
->
new
ItemParamData
[
size
]);
}
else
{
this
.
P
reviewItemsArray
=
new
ItemParamData
[
0
];
this
.
p
reviewItemsArray
=
new
ItemParamData
[
0
];
}
}
}
src/main/java/emu/grasscutter/data/
def
/SceneData.java
→
src/main/java/emu/grasscutter/data/
excels
/SceneData.java
View file @
a8293102
package
emu.grasscutter.data.
def
;
package
emu.grasscutter.data.
excels
;
import
emu.grasscutter.data.GameData
;
import
emu.grasscutter.data.GameResource
;
...
...
@@ -8,22 +8,21 @@ import emu.grasscutter.game.props.SceneType;
@ResourceType
(
name
=
"SceneExcelConfigData.json"
)
public
class
SceneData
extends
GameResource
{
private
int
I
d
;
private
SceneType
T
ype
;
private
String
S
criptData
;
private
int
i
d
;
private
SceneType
t
ype
;
private
String
s
criptData
;
@Override
public
int
getId
()
{
return
this
.
I
d
;
return
this
.
i
d
;
}
public
SceneType
getSceneType
()
{
return
T
ype
;
return
t
ype
;
}
public
String
getScriptData
()
{
return
S
criptData
;
return
s
criptData
;
}
@Override
...
...
src/main/java/emu/grasscutter/data/
def
/ShopGoodsData.java
→
src/main/java/emu/grasscutter/data/
excels
/ShopGoodsData.java
View file @
a8293102
package
emu.grasscutter.data.
def
;
package
emu.grasscutter.data.
excels
;
import
emu.grasscutter.data.GameResource
;
import
emu.grasscutter.data.ResourceType
;
...
...
@@ -9,34 +9,34 @@ import java.util.List;
@ResourceType
(
name
=
"ShopGoodsExcelConfigData.json"
)
public
class
ShopGoodsData
extends
GameResource
{
private
int
G
oodsId
;
private
int
S
hopType
;
private
int
I
temId
;
private
int
g
oodsId
;
private
int
s
hopType
;
private
int
i
temId
;
private
int
I
temCount
;
private
int
i
temCount
;
private
int
C
ostScoin
;
private
int
C
ostHcoin
;
private
int
C
ostMcoin
;
private
int
c
ostScoin
;
private
int
c
ostHcoin
;
private
int
c
ostMcoin
;
private
List
<
ItemParamData
>
C
ostItems
;
private
int
M
inPlayerLevel
;
private
int
M
axPlayerLevel
;
private
List
<
ItemParamData
>
c
ostItems
;
private
int
m
inPlayerLevel
;
private
int
m
axPlayerLevel
;
private
int
B
uyLimit
;
private
int
S
ubTabId
;
private
int
b
uyLimit
;
private
int
s
ubTabId
;
private
String
R
efreshType
;
private
transient
ShopInfo
.
ShopRefreshType
R
efreshTypeEnum
;
private
String
r
efreshType
;
private
transient
ShopInfo
.
ShopRefreshType
r
efreshTypeEnum
;
private
int
R
efreshParam
;
private
int
r
efreshParam
;
@Override
public
void
onLoad
()
{
if
(
this
.
R
efreshType
==
null
)
this
.
R
efreshTypeEnum
=
ShopInfo
.
ShopRefreshType
.
NONE
;
if
(
this
.
r
efreshType
==
null
)
this
.
r
efreshTypeEnum
=
ShopInfo
.
ShopRefreshType
.
NONE
;
else
{
this
.
R
efreshTypeEnum
=
switch
(
this
.
R
efreshType
)
{
this
.
r
efreshTypeEnum
=
switch
(
this
.
r
efreshType
)
{
case
"SHOP_REFRESH_DAILY"
->
ShopInfo
.
ShopRefreshType
.
SHOP_REFRESH_DAILY
;
case
"SHOP_REFRESH_WEEKLY"
->
ShopInfo
.
ShopRefreshType
.
SHOP_REFRESH_WEEKLY
;
case
"SHOP_REFRESH_MONTHLY"
->
ShopInfo
.
ShopRefreshType
.
SHOP_REFRESH_MONTHLY
;
...
...
@@ -51,58 +51,58 @@ public class ShopGoodsData extends GameResource {
}
public
int
getGoodsId
()
{
return
G
oodsId
;
return
g
oodsId
;
}
public
int
getShopType
()
{
return
S
hopType
;
return
s
hopType
;
}
public
int
getItemId
()
{
return
I
temId
;
return
i
temId
;
}
public
int
getItemCount
()
{
return
I
temCount
;
return
i
temCount
;
}
public
int
getCostScoin
()
{
return
C
ostScoin
;
return
c
ostScoin
;
}
public
int
getCostHcoin
()
{
return
C
ostHcoin
;
return
c
ostHcoin
;
}
public
int
getCostMcoin
()
{
return
C
ostMcoin
;
return
c
ostMcoin
;
}
public
List
<
ItemParamData
>
getCostItems
()
{
return
C
ostItems
;
return
c
ostItems
;
}
public
int
getMinPlayerLevel
()
{
return
M
inPlayerLevel
;
return
m
inPlayerLevel
;
}
public
int
getMaxPlayerLevel
()
{
return
M
axPlayerLevel
;
return
m
axPlayerLevel
;
}
public
int
getBuyLimit
()
{
return
B
uyLimit
;
return
b
uyLimit
;
}
public
int
getSubTabId
()
{
return
S
ubTabId
;
return
s
ubTabId
;
}
public
ShopInfo
.
ShopRefreshType
getRefreshType
()
{
return
R
efreshTypeEnum
;
return
r
efreshTypeEnum
;
}
public
int
getRefreshParam
()
{
return
R
efreshParam
;
return
r
efreshParam
;
}
}
src/main/java/emu/grasscutter/data/
def
/TowerFloorData.java
→
src/main/java/emu/grasscutter/data/
excels
/TowerFloorData.java
View file @
a8293102
package
emu.grasscutter.data.
def
;
package
emu.grasscutter.data.
excels
;
import
emu.grasscutter.data.GameResource
;
import
emu.grasscutter.data.ResourceType
;
...
...
@@ -6,16 +6,16 @@ import emu.grasscutter.data.ResourceType;
@ResourceType
(
name
=
"TowerFloorExcelConfigData.json"
)
public
class
TowerFloorData
extends
GameResource
{
private
int
F
loorId
;
private
int
F
loorIndex
;
private
int
L
evelId
;
private
int
O
verrideMonsterLevel
;
private
int
T
eamNum
;
private
int
F
loorLevelConfigId
;
private
int
f
loorId
;
private
int
f
loorIndex
;
private
int
l
evel
Group
Id
;
private
int
o
verrideMonsterLevel
;
private
int
t
eamNum
;
private
int
f
loorLevelConfigId
;
@Override
public
int
getId
()
{
return
this
.
F
loorId
;
return
this
.
f
loorId
;
}
@Override
...
...
@@ -24,50 +24,26 @@ public class TowerFloorData extends GameResource {
}
public
int
getFloorId
()
{
return
FloorId
;
}
public
void
setFloorId
(
int
floorId
)
{
FloorId
=
floorId
;
return
floorId
;
}
public
int
getFloorIndex
()
{
return
FloorIndex
;
}
public
void
setFloorIndex
(
int
floorIndex
)
{
FloorIndex
=
floorIndex
;
}
public
int
getLevelId
()
{
return
LevelId
;
return
floorIndex
;
}
public
void
s
etLevel
Id
(
int
levelId
)
{
LevelId
=
levelId
;
public
int
g
etLevel
GroupId
(
)
{
return
level
Group
Id
;
}
public
int
getOverrideMonsterLevel
()
{
return
OverrideMonsterLevel
;
}
public
void
setOverrideMonsterLevel
(
int
overrideMonsterLevel
)
{
OverrideMonsterLevel
=
overrideMonsterLevel
;
return
overrideMonsterLevel
;
}
public
int
getTeamNum
()
{
return
TeamNum
;
}
public
void
setTeamNum
(
int
teamNum
)
{
TeamNum
=
teamNum
;
return
teamNum
;
}
public
int
getFloorLevelConfigId
()
{
return
FloorLevelConfigId
;
}
public
void
setFloorLevelConfigId
(
int
floorLevelConfigId
)
{
FloorLevelConfigId
=
floorLevelConfigId
;
return
floorLevelConfigId
;
}
}
src/main/java/emu/grasscutter/data/
def
/TowerLevelData.java
→
src/main/java/emu/grasscutter/data/
excels
/TowerLevelData.java
View file @
a8293102
package
emu.grasscutter.data.
def
;
package
emu.grasscutter.data.
excels
;
import
emu.grasscutter.data.GameResource
;
import
emu.grasscutter.data.ResourceType
;
@ResourceType
(
name
=
"TowerLevelExcelConfigData.json"
)
public
class
TowerLevelData
extends
GameResource
{
private
int
ID
;
private
int
L
evelI
d
;
private
int
L
evel
Index
;
private
int
D
ungeonId
;
private
int
levelId
;
private
int
l
evelI
ndex
;
private
int
l
evel
GroupId
;
private
int
d
ungeonId
;
@Override
public
int
getId
()
{
return
this
.
ID
;
}
@Override
public
void
onLoad
()
{
super
.
onLoad
();
}
public
int
getID
()
{
return
ID
;
}
public
void
setID
(
int
ID
)
{
this
.
ID
=
ID
;
return
this
.
getLevelId
();
}
public
int
getLevelId
()
{
return
L
evelId
;
return
l
evelId
;
}
public
void
s
etLevel
Id
(
int
levelId
)
{
LevelId
=
levelId
;
public
int
g
etLevel
GroupId
(
)
{
return
level
Group
Id
;
}
public
int
getLevelIndex
()
{
return
LevelIndex
;
}
public
void
setLevelIndex
(
int
levelIndex
)
{
LevelIndex
=
levelIndex
;
return
levelIndex
;
}
public
int
getDungeonId
()
{
return
DungeonId
;
}
public
void
setDungeonId
(
int
dungeonId
)
{
DungeonId
=
dungeonId
;
return
dungeonId
;
}
}
src/main/java/emu/grasscutter/data/excels/TowerScheduleData.java
0 → 100644
View file @
a8293102
package
emu.grasscutter.data.excels
;
import
emu.grasscutter.data.GameResource
;
import
emu.grasscutter.data.ResourceType
;
import
java.util.List
;
@ResourceType
(
name
=
"TowerScheduleExcelConfigData.json"
)
public
class
TowerScheduleData
extends
GameResource
{
private
int
scheduleId
;
private
List
<
Integer
>
entranceFloorId
;
private
List
<
ScheduleDetail
>
schedules
;
private
int
monthlyLevelConfigId
;
@Override
public
int
getId
()
{
return
scheduleId
;
}
@Override
public
void
onLoad
()
{
super
.
onLoad
();
this
.
schedules
=
this
.
schedules
.
stream
()
.
filter
(
item
->
item
.
getFloorList
().
size
()
>
0
)
.
toList
();
}
public
int
getScheduleId
()
{
return
scheduleId
;
}
public
List
<
Integer
>
getEntranceFloorId
()
{
return
entranceFloorId
;
}
public
List
<
ScheduleDetail
>
getSchedules
()
{
return
schedules
;
}
public
int
getMonthlyLevelConfigId
()
{
return
monthlyLevelConfigId
;
}
public
static
class
ScheduleDetail
{
private
List
<
Integer
>
floorList
;
public
List
<
Integer
>
getFloorList
()
{
return
floorList
;
}
}
}
src/main/java/emu/grasscutter/data/
def
/WeaponCurveData.java
→
src/main/java/emu/grasscutter/data/
excels
/WeaponCurveData.java
View file @
a8293102
package
emu.grasscutter.data.
def
;
package
emu.grasscutter.data.
excels
;
import
java.util.HashMap
;
import
java.util.Map
;
...
...
@@ -10,23 +10,23 @@ import emu.grasscutter.data.common.CurveInfo;
@ResourceType
(
name
=
"WeaponCurveExcelConfigData.json"
)
public
class
WeaponCurveData
extends
GameResource
{
private
int
L
evel
;
private
CurveInfo
[]
C
urveInfos
;
private
int
l
evel
;
private
CurveInfo
[]
c
urveInfos
;
private
Map
<
String
,
Float
>
curveInfos
;
private
Map
<
String
,
Float
>
curveInfos
Map
;
@Override
public
int
getId
()
{
return
L
evel
;
return
l
evel
;
}
public
float
getMultByProp
(
String
fightProp
)
{
return
curveInfos
.
getOrDefault
(
fightProp
,
1
f
);
return
curveInfos
Map
.
getOrDefault
(
fightProp
,
1
f
);
}
@Override
public
void
onLoad
()
{
this
.
curveInfos
=
new
HashMap
<>();
Stream
.
of
(
this
.
C
urveInfos
).
forEach
(
info
->
this
.
curveInfos
.
put
(
info
.
getType
(),
info
.
getValue
()));
this
.
curveInfos
Map
=
new
HashMap
<>();
Stream
.
of
(
this
.
c
urveInfos
).
forEach
(
info
->
this
.
curveInfos
Map
.
put
(
info
.
getType
(),
info
.
getValue
()));
}
}
src/main/java/emu/grasscutter/data/
def
/WeaponLevelData.java
→
src/main/java/emu/grasscutter/data/
excels
/WeaponLevelData.java
View file @
a8293102
package
emu.grasscutter.data.
def
;
package
emu.grasscutter.data.
excels
;
import
emu.grasscutter.data.GameResource
;
import
emu.grasscutter.data.ResourceType
;
@ResourceType
(
name
=
"WeaponLevelExcelConfigData.json"
)
public
class
WeaponLevelData
extends
GameResource
{
private
int
L
evel
;
private
int
[]
R
equiredExps
;
private
int
l
evel
;
private
int
[]
r
equiredExps
;
@Override
public
int
getId
()
{
return
this
.
L
evel
;
return
this
.
l
evel
;
}
public
int
getLevel
()
{
return
L
evel
;
return
l
evel
;
}
public
int
[]
getRequiredExps
()
{
return
R
equiredExps
;
return
r
equiredExps
;
}
}
src/main/java/emu/grasscutter/data/
def
/WeaponPromoteData.java
→
src/main/java/emu/grasscutter/data/
excels
/WeaponPromoteData.java
View file @
a8293102
package
emu.grasscutter.data.
def
;
package
emu.grasscutter.data.
excels
;
import
java.util.ArrayList
;
import
emu.grasscutter.data.GameResource
;
...
...
@@ -9,45 +9,45 @@ import emu.grasscutter.data.common.ItemParamData;
@ResourceType
(
name
=
"WeaponPromoteExcelConfigData.json"
)
public
class
WeaponPromoteData
extends
GameResource
{
private
int
W
eaponPromoteId
;
private
int
P
romoteLevel
;
private
ItemParamData
[]
C
ostItems
;
private
int
C
oinCost
;
private
FightPropData
[]
A
ddProps
;
private
int
U
nlockMaxLevel
;
private
int
R
equiredPlayerLevel
;
private
int
w
eaponPromoteId
;
private
int
p
romoteLevel
;
private
ItemParamData
[]
c
ostItems
;
private
int
c
oinCost
;
private
FightPropData
[]
a
ddProps
;
private
int
u
nlockMaxLevel
;
private
int
r
equiredPlayerLevel
;
@Override
public
int
getId
()
{
return
(
W
eaponPromoteId
<<
8
)
+
P
romoteLevel
;
return
(
w
eaponPromoteId
<<
8
)
+
p
romoteLevel
;
}
public
int
getWeaponPromoteId
()
{
return
W
eaponPromoteId
;
return
w
eaponPromoteId
;
}
public
int
getPromoteLevel
()
{
return
P
romoteLevel
;
return
p
romoteLevel
;
}
public
ItemParamData
[]
getCostItems
()
{
return
C
ostItems
;
return
c
ostItems
;
}
public
int
getCoinCost
()
{
return
C
oinCost
;
return
c
oinCost
;
}
public
FightPropData
[]
getAddProps
()
{
return
A
ddProps
;
return
a
ddProps
;
}
public
int
getUnlockMaxLevel
()
{
return
U
nlockMaxLevel
;
return
u
nlockMaxLevel
;
}
public
int
getRequiredPlayerLevel
()
{
return
R
equiredPlayerLevel
;
return
r
equiredPlayerLevel
;
}
@Override
...
...
@@ -60,7 +60,7 @@ public class WeaponPromoteData extends GameResource {
}
trim
.
add
(
itemParam
);
}
this
.
C
ostItems
=
trim
.
toArray
(
new
ItemParamData
[
trim
.
size
()]);
this
.
c
ostItems
=
trim
.
toArray
(
new
ItemParamData
[
trim
.
size
()]);
// Trim fight prop data
ArrayList
<
FightPropData
>
parsed
=
new
ArrayList
<>(
getAddProps
().
length
);
for
(
FightPropData
prop
:
getAddProps
())
{
...
...
@@ -69,6 +69,6 @@ public class WeaponPromoteData extends GameResource {
parsed
.
add
(
prop
);
}
}
this
.
A
ddProps
=
parsed
.
toArray
(
new
FightPropData
[
parsed
.
size
()]);
this
.
a
ddProps
=
parsed
.
toArray
(
new
FightPropData
[
parsed
.
size
()]);
}
}
src/main/java/emu/grasscutter/data/
def
/WorldLevelData.java
→
src/main/java/emu/grasscutter/data/
excels
/WorldLevelData.java
View file @
a8293102
package
emu.grasscutter.data.
def
;
package
emu.grasscutter.data.
excels
;
import
emu.grasscutter.data.GameResource
;
import
emu.grasscutter.data.ResourceType
;
@ResourceType
(
name
=
"WorldLevelExcelConfigData.json"
)
public
class
WorldLevelData
extends
GameResource
{
private
int
L
evel
;
private
int
M
onsterLevel
;
private
int
l
evel
;
private
int
m
onsterLevel
;
@Override
public
int
getId
()
{
return
this
.
L
evel
;
return
this
.
l
evel
;
}
public
int
getMonsterLevel
()
{
return
M
onsterLevel
;
return
m
onsterLevel
;
}
@Override
...
...
src/main/java/emu/grasscutter/database/DatabaseHelper.java
View file @
a8293102
...
...
@@ -3,10 +3,12 @@ package emu.grasscutter.database;
import
java.util.List
;
import
com.mongodb.client.result.DeleteResult
;
import
dev.morphia.query.FindOptions
;
import
dev.morphia.query.Sort
;
import
dev.morphia.query.experimental.filters.Filters
;
import
emu.grasscutter.GameConstants
;
import
emu.grasscutter.Grasscutter
;
import
emu.grasscutter.game.Account
;
import
emu.grasscutter.game.avatar.Avatar
;
import
emu.grasscutter.game.friends.Friendship
;
...
...
@@ -14,27 +16,34 @@ import emu.grasscutter.game.gacha.GachaRecord;
import
emu.grasscutter.game.inventory.GameItem
;
import
emu.grasscutter.game.mail.Mail
;
import
emu.grasscutter.game.player.Player
;
import
emu.grasscutter.game.quest.GameMainQuest
;
import
static
com
.
mongodb
.
client
.
model
.
Filters
.
eq
;
public
final
class
DatabaseHelper
{
public
static
Account
createAccount
(
String
username
)
{
return
createAccountWith
I
d
(
username
,
0
);
return
createAccountWith
Ui
d
(
username
,
0
);
}
public
static
Account
createAccountWith
I
d
(
String
username
,
int
reserved
I
d
)
{
public
static
Account
createAccountWith
Ui
d
(
String
username
,
int
reserved
Ui
d
)
{
// Unique names only
Account
exists
=
DatabaseHelper
.
getAccountByName
(
username
);
if
(
exists
!=
null
)
{
if
(
DatabaseHelper
.
checkIfAccountExists
(
username
))
{
return
null
;
}
// Make sure there are no id collisions
if
(
reserved
I
d
>
0
)
{
if
(
reserved
Ui
d
>
0
)
{
// Cannot make account with the same uid as the server console
if
(
reservedId
==
GameConstants
.
SERVER_CONSOLE_UID
)
{
if
(
reservedUid
==
GameConstants
.
SERVER_CONSOLE_UID
)
{
return
null
;
}
if
(
DatabaseHelper
.
checkIfAccountExists
(
reservedUid
))
{
return
null
;
}
exists
=
DatabaseHelper
.
getAccountByPlayerId
(
reservedId
);
if
(
exists
!=
null
)
{
// Make sure no existing player already has this id.
if
(
DatabaseHelper
.
checkIfPlayerExists
(
reservedUid
))
{
return
null
;
}
}
...
...
@@ -44,8 +53,8 @@ public final class DatabaseHelper {
account
.
setUsername
(
username
);
account
.
setId
(
Integer
.
toString
(
DatabaseManager
.
getNextId
(
account
)));
if
(
reserved
I
d
>
0
)
{
account
.
setPlayer
I
d
(
reserved
I
d
);
if
(
reserved
Ui
d
>
0
)
{
account
.
set
Reserved
Player
Ui
d
(
reserved
Ui
d
);
}
DatabaseHelper
.
saveAccount
(
account
);
...
...
@@ -74,118 +83,158 @@ public final class DatabaseHelper {
}
public
static
Account
getAccountByName
(
String
username
)
{
return
DatabaseManager
.
getDatastore
().
find
(
Account
.
class
).
filter
(
Filters
.
eq
(
"username"
,
username
)).
first
();
return
DatabaseManager
.
get
Game
Datastore
().
find
(
Account
.
class
).
filter
(
Filters
.
eq
(
"username"
,
username
)).
first
();
}
public
static
Account
getAccountByToken
(
String
token
)
{
if
(
token
==
null
)
return
null
;
return
DatabaseManager
.
getDatastore
().
find
(
Account
.
class
).
filter
(
Filters
.
eq
(
"token"
,
token
)).
first
();
return
DatabaseManager
.
get
Game
Datastore
().
find
(
Account
.
class
).
filter
(
Filters
.
eq
(
"token"
,
token
)).
first
();
}
public
static
Account
getAccountBySessionKey
(
String
sessionKey
)
{
if
(
sessionKey
==
null
)
return
null
;
return
DatabaseManager
.
getDatastore
().
find
(
Account
.
class
).
filter
(
Filters
.
eq
(
"sessionKey"
,
sessionKey
)).
first
();
return
DatabaseManager
.
get
Game
Datastore
().
find
(
Account
.
class
).
filter
(
Filters
.
eq
(
"sessionKey"
,
sessionKey
)).
first
();
}
public
static
Account
getAccountById
(
String
uid
)
{
return
DatabaseManager
.
getDatastore
().
find
(
Account
.
class
).
filter
(
Filters
.
eq
(
"_id"
,
uid
)).
first
();
return
DatabaseManager
.
get
Game
Datastore
().
find
(
Account
.
class
).
filter
(
Filters
.
eq
(
"_id"
,
uid
)).
first
();
}
public
static
Account
getAccountByPlayerId
(
int
playerId
)
{
return
DatabaseManager
.
getDatastore
().
find
(
Account
.
class
).
filter
(
Filters
.
eq
(
"
p
layerId"
,
playerId
)).
first
();
return
DatabaseManager
.
get
Game
Datastore
().
find
(
Account
.
class
).
filter
(
Filters
.
eq
(
"
reservedP
layerId"
,
playerId
)).
first
();
}
public
static
boolean
deleteAccount
(
String
username
)
{
return
DatabaseManager
.
getDatastore
().
find
(
Account
.
class
).
filter
(
Filters
.
eq
(
"username"
,
username
)).
delete
().
getDeletedCount
()
>
0
;
public
static
boolean
checkIfAccountExists
(
String
name
)
{
return
DatabaseManager
.
getGameDatastore
().
find
(
Account
.
class
).
filter
(
Filters
.
eq
(
"username"
,
name
)).
count
()
>
0
;
}
public
static
boolean
checkIfAccountExists
(
int
reservedUid
)
{
return
DatabaseManager
.
getGameDatastore
().
find
(
Account
.
class
).
filter
(
Filters
.
eq
(
"reservedPlayerId"
,
reservedUid
)).
count
()
>
0
;
}
public
static
void
deleteAccount
(
Account
target
)
{
// To delete an account, we need to also delete all the other documents in the database that reference the account.
// This should optimally be wrapped inside a transaction, to make sure an error thrown mid-way does not leave the
// database in an inconsistent state, but unfortunately Mongo only supports that when we have a replica set ...
Player
player
=
Grasscutter
.
getGameServer
().
getPlayerByAccountId
(
target
.
getId
());
if
(
player
!=
null
)
{
// Close session first
player
.
getSession
().
close
();
// Delete data from collections
DatabaseManager
.
getGameDatabase
().
getCollection
(
"mail"
).
deleteMany
(
eq
(
"ownerUid"
,
player
.
getUid
()));
DatabaseManager
.
getGameDatabase
().
getCollection
(
"avatars"
).
deleteMany
(
eq
(
"ownerId"
,
player
.
getUid
()));
DatabaseManager
.
getGameDatabase
().
getCollection
(
"gachas"
).
deleteMany
(
eq
(
"ownerId"
,
player
.
getUid
()));
DatabaseManager
.
getGameDatabase
().
getCollection
(
"items"
).
deleteMany
(
eq
(
"ownerId"
,
player
.
getUid
()));
DatabaseManager
.
getGameDatabase
().
getCollection
(
"quests"
).
deleteMany
(
eq
(
"ownerUid"
,
player
.
getUid
()));
// Delete friendships.
// Here, we need to make sure to not only delete the deleted account's friendships,
// but also all friendship entries for that account's friends.
DatabaseManager
.
getGameDatabase
().
getCollection
(
"friendships"
).
deleteMany
(
eq
(
"ownerId"
,
player
.
getUid
()));
DatabaseManager
.
getGameDatabase
().
getCollection
(
"friendships"
).
deleteMany
(
eq
(
"friendId"
,
player
.
getUid
()));
// Delete the player last.
DatabaseManager
.
getGameDatastore
().
find
(
Player
.
class
).
filter
(
Filters
.
eq
(
"id"
,
player
.
getUid
())).
delete
();
}
// Finally, delete the account itself.
DatabaseManager
.
getGameDatastore
().
find
(
Account
.
class
).
filter
(
Filters
.
eq
(
"id"
,
target
.
getId
())).
delete
();
}
public
static
List
<
Player
>
getAllPlayers
()
{
return
DatabaseManager
.
getDatastore
().
find
(
Player
.
class
).
stream
().
toList
();
return
DatabaseManager
.
get
Game
Datastore
().
find
(
Player
.
class
).
stream
().
toList
();
}
public
static
Player
getPlayerBy
I
d
(
int
id
)
{
return
DatabaseManager
.
getDatastore
().
find
(
Player
.
class
).
filter
(
Filters
.
eq
(
"_id"
,
id
)).
first
();
public
static
Player
getPlayerBy
Ui
d
(
int
id
)
{
return
DatabaseManager
.
get
Game
Datastore
().
find
(
Player
.
class
).
filter
(
Filters
.
eq
(
"_id"
,
id
)).
first
();
}
public
static
boolean
checkPlayerExists
(
int
id
)
{
return
DatabaseManager
.
getDatastore
().
find
(
Player
.
class
).
filter
(
Filters
.
eq
(
"_id"
,
id
)).
first
()
!=
null
;
public
static
Player
getPlayerByAccount
(
Account
account
)
{
return
DatabaseManager
.
getGameDatastore
().
find
(
Player
.
class
).
filter
(
Filters
.
eq
(
"accountId"
,
account
.
getId
())).
first
();
}
public
static
boolean
checkIfPlayerExists
(
int
uid
)
{
return
DatabaseManager
.
getGameDatastore
().
find
(
Player
.
class
).
filter
(
Filters
.
eq
(
"_id"
,
uid
)).
count
()
>
0
;
}
public
static
synchronized
Player
cre
atePlayer
(
Player
character
,
int
reservedId
)
{
public
static
synchronized
Player
gener
atePlayer
Uid
(
Player
character
,
int
reservedId
)
{
// Check if reserved id
int
id
;
if
(
reservedId
>
0
&&
!
checkPlayerExists
(
reservedId
))
{
if
(
reservedId
>
0
&&
!
check
If
PlayerExists
(
reservedId
))
{
id
=
reservedId
;
character
.
setUid
(
id
);
}
else
{
do
{
id
=
DatabaseManager
.
getNextId
(
character
);
}
while
(
checkPlayerExists
(
id
));
while
(
check
If
PlayerExists
(
id
));
character
.
setUid
(
id
);
}
// Save to database
DatabaseManager
.
getDatastore
().
save
(
character
);
DatabaseManager
.
get
Game
Datastore
().
save
(
character
);
return
character
;
}
public
static
synchronized
int
getNextPlayerId
(
int
reservedId
)
{
// Check if reserved id
int
id
;
if
(
reservedId
>
0
&&
!
checkPlayerExists
(
reservedId
))
{
if
(
reservedId
>
0
&&
!
check
If
PlayerExists
(
reservedId
))
{
id
=
reservedId
;
}
else
{
do
{
id
=
DatabaseManager
.
getNextId
(
Player
.
class
);
}
while
(
checkPlayerExists
(
id
));
while
(
check
If
PlayerExists
(
id
));
}
return
id
;
}
public
static
void
savePlayer
(
Player
character
)
{
DatabaseManager
.
getDatastore
().
save
(
character
);
DatabaseManager
.
get
Game
Datastore
().
save
(
character
);
}
public
static
void
saveAvatar
(
Avatar
avatar
)
{
DatabaseManager
.
getDatastore
().
save
(
avatar
);
DatabaseManager
.
get
Game
Datastore
().
save
(
avatar
);
}
public
static
List
<
Avatar
>
getAvatars
(
Player
player
)
{
return
DatabaseManager
.
getDatastore
().
find
(
Avatar
.
class
).
filter
(
Filters
.
eq
(
"ownerId"
,
player
.
getUid
())).
stream
().
toList
();
return
DatabaseManager
.
get
Game
Datastore
().
find
(
Avatar
.
class
).
filter
(
Filters
.
eq
(
"ownerId"
,
player
.
getUid
())).
stream
().
toList
();
}
public
static
void
saveItem
(
GameItem
item
)
{
DatabaseManager
.
getDatastore
().
save
(
item
);
DatabaseManager
.
get
Game
Datastore
().
save
(
item
);
}
public
static
boolean
deleteItem
(
GameItem
item
)
{
DeleteResult
result
=
DatabaseManager
.
getDatastore
().
delete
(
item
);
DeleteResult
result
=
DatabaseManager
.
get
Game
Datastore
().
delete
(
item
);
return
result
.
wasAcknowledged
();
}
public
static
List
<
GameItem
>
getInventoryItems
(
Player
player
)
{
return
DatabaseManager
.
getDatastore
().
find
(
GameItem
.
class
).
filter
(
Filters
.
eq
(
"ownerId"
,
player
.
getUid
())).
stream
().
toList
();
return
DatabaseManager
.
get
Game
Datastore
().
find
(
GameItem
.
class
).
filter
(
Filters
.
eq
(
"ownerId"
,
player
.
getUid
())).
stream
().
toList
();
}
public
static
List
<
Friendship
>
getFriends
(
Player
player
)
{
return
DatabaseManager
.
getDatastore
().
find
(
Friendship
.
class
).
filter
(
Filters
.
eq
(
"ownerId"
,
player
.
getUid
())).
stream
().
toList
();
return
DatabaseManager
.
get
Game
Datastore
().
find
(
Friendship
.
class
).
filter
(
Filters
.
eq
(
"ownerId"
,
player
.
getUid
())).
stream
().
toList
();
}
public
static
List
<
Friendship
>
getReverseFriends
(
Player
player
)
{
return
DatabaseManager
.
getDatastore
().
find
(
Friendship
.
class
).
filter
(
Filters
.
eq
(
"friendId"
,
player
.
getUid
())).
stream
().
toList
();
return
DatabaseManager
.
get
Game
Datastore
().
find
(
Friendship
.
class
).
filter
(
Filters
.
eq
(
"friendId"
,
player
.
getUid
())).
stream
().
toList
();
}
public
static
void
saveFriendship
(
Friendship
friendship
)
{
DatabaseManager
.
getDatastore
().
save
(
friendship
);
DatabaseManager
.
get
Game
Datastore
().
save
(
friendship
);
}
public
static
void
deleteFriendship
(
Friendship
friendship
)
{
DatabaseManager
.
getDatastore
().
delete
(
friendship
);
DatabaseManager
.
get
Game
Datastore
().
delete
(
friendship
);
}
public
static
Friendship
getReverseFriendship
(
Friendship
friendship
)
{
return
DatabaseManager
.
getDatastore
().
find
(
Friendship
.
class
).
filter
(
Filters
.
and
(
return
DatabaseManager
.
get
Game
Datastore
().
find
(
Friendship
.
class
).
filter
(
Filters
.
and
(
Filters
.
eq
(
"ownerId"
,
friendship
.
getFriendId
()),
Filters
.
eq
(
"friendId"
,
friendship
.
getOwnerId
())
)).
first
();
...
...
@@ -196,7 +245,7 @@ public final class DatabaseHelper {
}
public
static
List
<
GachaRecord
>
getGachaRecords
(
int
ownerId
,
int
page
,
int
gachaType
,
int
pageSize
){
return
DatabaseManager
.
getDatastore
().
find
(
GachaRecord
.
class
).
filter
(
return
DatabaseManager
.
get
Game
Datastore
().
find
(
GachaRecord
.
class
).
filter
(
Filters
.
eq
(
"ownerId"
,
ownerId
),
Filters
.
eq
(
"gachaType"
,
gachaType
)
).
iterator
(
new
FindOptions
()
...
...
@@ -211,7 +260,7 @@ public final class DatabaseHelper {
}
public
static
long
getGachaRecordsMaxPage
(
int
ownerId
,
int
page
,
int
gachaType
,
int
pageSize
){
long
count
=
DatabaseManager
.
getDatastore
().
find
(
GachaRecord
.
class
).
filter
(
long
count
=
DatabaseManager
.
get
Game
Datastore
().
find
(
GachaRecord
.
class
).
filter
(
Filters
.
eq
(
"ownerId"
,
ownerId
),
Filters
.
eq
(
"gachaType"
,
gachaType
)
).
count
();
...
...
@@ -219,19 +268,31 @@ public final class DatabaseHelper {
}
public
static
void
saveGachaRecord
(
GachaRecord
gachaRecord
){
DatabaseManager
.
getDatastore
().
save
(
gachaRecord
);
DatabaseManager
.
get
Game
Datastore
().
save
(
gachaRecord
);
}
public
static
List
<
Mail
>
getAllMail
(
Player
player
)
{
return
DatabaseManager
.
getDatastore
().
find
(
Mail
.
class
).
filter
(
Filters
.
eq
(
"ownerUid"
,
player
.
getUid
())).
stream
().
toList
();
return
DatabaseManager
.
get
Game
Datastore
().
find
(
Mail
.
class
).
filter
(
Filters
.
eq
(
"ownerUid"
,
player
.
getUid
())).
stream
().
toList
();
}
public
static
void
saveMail
(
Mail
mail
)
{
DatabaseManager
.
getDatastore
().
save
(
mail
);
DatabaseManager
.
get
Game
Datastore
().
save
(
mail
);
}
public
static
boolean
deleteMail
(
Mail
mail
)
{
DeleteResult
result
=
DatabaseManager
.
getDatastore
().
delete
(
mail
);
DeleteResult
result
=
DatabaseManager
.
get
Game
Datastore
().
delete
(
mail
);
return
result
.
wasAcknowledged
();
}
public
static
List
<
GameMainQuest
>
getAllQuests
(
Player
player
)
{
return
DatabaseManager
.
getGameDatastore
().
find
(
GameMainQuest
.
class
).
filter
(
Filters
.
eq
(
"ownerUid"
,
player
.
getUid
())).
stream
().
toList
();
}
public
static
void
saveQuest
(
GameMainQuest
quest
)
{
DatabaseManager
.
getGameDatastore
().
save
(
quest
);
}
public
static
boolean
deleteQuest
(
GameMainQuest
quest
)
{
return
DatabaseManager
.
getGameDatastore
().
delete
(
quest
).
wasAcknowledged
();
}
}
src/main/java/emu/grasscutter/database/DatabaseManager.java
View file @
a8293102
package
emu.grasscutter.database
;
import
com.mongodb.MongoClientURI
;
import
com.mongodb.MongoCommandException
;
import
com.mongodb.client.MongoClient
;
import
com.mongodb.client.MongoClients
;
...
...
@@ -20,69 +19,70 @@ import emu.grasscutter.game.gacha.GachaRecord;
import
emu.grasscutter.game.inventory.GameItem
;
import
emu.grasscutter.game.mail.Mail
;
import
emu.grasscutter.game.player.Player
;
import
emu.grasscutter.game.quest.GameMainQuest
;
import
emu.grasscutter.game.quest.GameQuest
;
public
final
class
DatabaseManager
{
private
static
MongoClient
mongoClient
;
private
static
MongoClient
dispatchMongoClient
;
import
static
emu
.
grasscutter
.
Configuration
.*;
private
static
Datastore
datastore
;
public
final
class
DatabaseManager
{
private
static
Datastore
gameDatastore
;
private
static
Datastore
dispatchDatastore
;
private
static
final
Class
<?>[]
mappedClasses
=
new
Class
<?>[]
{
DatabaseCounter
.
class
,
Account
.
class
,
Player
.
class
,
Avatar
.
class
,
GameItem
.
class
,
Friendship
.
class
,
GachaRecord
.
class
,
Mail
.
class
DatabaseCounter
.
class
,
Account
.
class
,
Player
.
class
,
Avatar
.
class
,
GameItem
.
class
,
Friendship
.
class
,
GachaRecord
.
class
,
Mail
.
class
,
GameMainQuest
.
class
};
public
static
Datastore
getDatastore
()
{
return
d
atastore
;
public
static
Datastore
get
Game
Datastore
()
{
return
gameD
atastore
;
}
public
static
MongoDatabase
getDatabase
()
{
return
getDatastore
().
getDatabase
();
public
static
MongoDatabase
get
Game
Database
()
{
return
get
Game
Datastore
().
getDatabase
();
}
// Yes. I very dislike this method. However, this will be good for now.
// TODO: Add dispatch routes for player account management
public
static
Datastore
getAccountDatastore
()
{
if
(
Grasscutter
.
getConfig
().
R
unMode
==
ServerRunMode
.
GAME_ONLY
)
{
if
(
SERVER
.
r
unMode
==
ServerRunMode
.
GAME_ONLY
)
{
return
dispatchDatastore
;
}
else
{
return
d
atastore
;
return
gameD
atastore
;
}
}
public
static
void
initialize
()
{
// Initialize
MongoClient
m
ongoClient
=
MongoClients
.
create
(
Grasscutter
.
getConfig
().
Database
Ur
l
);
MongoClient
gameM
ongoClient
=
MongoClients
.
create
(
DATABASE
.
game
.
connection
Ur
i
);
// Set mapper options.
MapperOptions
mapperOptions
=
MapperOptions
.
builder
()
.
storeEmpties
(
true
).
storeNulls
(
false
).
build
();
// Create data store.
d
atastore
=
Morphia
.
createDatastore
(
m
ongoClient
,
Grasscutter
.
getConfig
().
DatabaseC
ollection
,
mapperOptions
);
gameD
atastore
=
Morphia
.
createDatastore
(
gameM
ongoClient
,
DATABASE
.
game
.
c
ollection
,
mapperOptions
);
// Map classes.
d
atastore
.
getMapper
().
map
(
mappedClasses
);
gameD
atastore
.
getMapper
().
map
(
mappedClasses
);
// Ensure indexes
try
{
d
atastore
.
ensureIndexes
();
gameD
atastore
.
ensureIndexes
();
}
catch
(
MongoCommandException
exception
)
{
Grasscutter
.
getLogger
().
info
(
"Mongo index error: "
,
exception
);
// Duplicate index error
if
(
exception
.
getCode
()
==
85
)
{
// Drop all indexes and re add them
MongoIterable
<
String
>
collections
=
d
atastore
.
getDatabase
().
listCollectionNames
();
MongoIterable
<
String
>
collections
=
gameD
atastore
.
getDatabase
().
listCollectionNames
();
for
(
String
name
:
collections
)
{
d
atastore
.
getDatabase
().
getCollection
(
name
).
dropIndexes
();
gameD
atastore
.
getDatabase
().
getCollection
(
name
).
dropIndexes
();
}
// Add back indexes
d
atastore
.
ensureIndexes
();
gameD
atastore
.
ensureIndexes
();
}
}
if
(
Grasscutter
.
getConfig
().
R
unMode
==
ServerRunMode
.
GAME_ONLY
)
{
dispatchMongoClient
=
MongoClients
.
create
(
Grasscutter
.
getConfig
().
getGameServerOptions
().
DispatchServerDatabase
Ur
l
);
dispatchDatastore
=
Morphia
.
createDatastore
(
dispatchMongoClient
,
Grasscutter
.
getConfig
().
getGameServerOptions
().
DispatchServerDatabaseC
ollection
);
if
(
SERVER
.
r
unMode
==
ServerRunMode
.
GAME_ONLY
)
{
MongoClient
dispatchMongoClient
=
MongoClients
.
create
(
DATABASE
.
server
.
connection
Ur
i
);
dispatchDatastore
=
Morphia
.
createDatastore
(
dispatchMongoClient
,
DATABASE
.
server
.
c
ollection
);
// Ensure indexes for dispatch server
try
{
...
...
@@ -104,14 +104,14 @@ public final class DatabaseManager {
}
public
static
synchronized
int
getNextId
(
Class
<?>
c
)
{
DatabaseCounter
counter
=
getDatastore
().
find
(
DatabaseCounter
.
class
).
filter
(
Filters
.
eq
(
"_id"
,
c
.
getSimpleName
())).
first
();
DatabaseCounter
counter
=
get
Game
Datastore
().
find
(
DatabaseCounter
.
class
).
filter
(
Filters
.
eq
(
"_id"
,
c
.
getSimpleName
())).
first
();
if
(
counter
==
null
)
{
counter
=
new
DatabaseCounter
(
c
.
getSimpleName
());
}
try
{
return
counter
.
getNextId
();
}
finally
{
getDatastore
().
save
(
counter
);
get
Game
Datastore
().
save
(
counter
);
}
}
...
...
src/main/java/emu/grasscutter/game/Account.java
View file @
a8293102
...
...
@@ -5,12 +5,12 @@ import emu.grasscutter.database.DatabaseHelper;
import
emu.grasscutter.utils.Crypto
;
import
emu.grasscutter.utils.Utils
;
import
java.util.
ArrayList
;
import
java.util.
Li
st
;
import
java.util.
*
;
import
java.util.st
ream.Stream
;
import
org.bson.Document
;
import
com.mongodb.DBObject
;
import
static
emu
.
grasscutter
.
Configuration
.*
;
@Entity
(
value
=
"accounts"
,
useDiscriminator
=
false
)
public
class
Account
{
...
...
@@ -21,16 +21,18 @@ public class Account {
private
String
username
;
private
String
password
;
// Unused for now
@AlsoLoad
(
"playerUid"
)
private
int
p
layerId
;
private
int
reservedP
layerId
;
private
String
email
;
private
String
token
;
private
String
sessionKey
;
// Session token for dispatch server
private
List
<
String
>
permissions
;
private
Locale
locale
;
@Deprecated
public
Account
()
{
this
.
permissions
=
new
ArrayList
<>();
this
.
locale
=
LANGUAGE
;
}
public
String
getId
()
{
...
...
@@ -65,12 +67,12 @@ public class Account {
this
.
token
=
token
;
}
public
int
getPlayerUid
()
{
return
this
.
p
layerId
;
public
int
get
Reserved
PlayerUid
()
{
return
this
.
reservedP
layerId
;
}
public
void
setPlayer
I
d
(
int
playerId
)
{
this
.
p
layerId
=
playerId
;
public
void
set
Reserved
Player
Ui
d
(
int
playerId
)
{
this
.
reservedP
layerId
=
playerId
;
}
public
String
getEmail
()
{
...
...
@@ -95,6 +97,14 @@ public class Account {
return
this
.
sessionKey
;
}
public
Locale
getLocale
()
{
return
locale
;
}
public
void
setLocale
(
Locale
locale
)
{
this
.
locale
=
locale
;
}
/**
* The collection of a player's permissions.
*/
...
...
@@ -107,13 +117,49 @@ public class Account {
this
.
permissions
.
add
(
permission
);
return
true
;
}
public
static
boolean
permissionMatchesWildcard
(
String
wildcard
,
String
[]
permissionParts
)
{
String
[]
wildcardParts
=
wildcard
.
split
(
"\\."
);
if
(
permissionParts
.
length
<
wildcardParts
.
length
)
{
// A longer wildcard can never match a shorter permission
return
false
;
}
for
(
int
i
=
0
;
i
<
wildcardParts
.
length
;
i
++)
{
switch
(
wildcardParts
[
i
])
{
case
"**"
:
// Recursing match
return
true
;
case
"*"
:
// Match only one layer
if
(
i
>=
(
permissionParts
.
length
-
1
))
{
return
true
;
}
break
;
default
:
// This layer isn't a wildcard, it needs to match exactly
if
(!
wildcardParts
[
i
].
equals
(
permissionParts
[
i
]))
{
return
false
;
}
}
}
// At this point the wildcard will have matched every layer, but if it is shorter then the permission then this is not a match at this point (no **).
return
(
wildcardParts
.
length
==
permissionParts
.
length
);
}
public
boolean
hasPermission
(
String
permission
)
{
return
this
.
permissions
.
contains
(
permission
)
||
this
.
permissions
.
contains
(
"*"
)
||
(
this
.
permissions
.
contains
(
"player"
)
||
this
.
permissions
.
contains
(
"player.*"
))
&&
permission
.
startsWith
(
"player."
)
||
(
this
.
permissions
.
contains
(
"server"
)
||
this
.
permissions
.
contains
(
"server.*"
))
&&
permission
.
startsWith
(
"server."
);
if
(
this
.
permissions
.
contains
(
"*"
)
&&
this
.
permissions
.
size
()
==
1
)
return
true
;
// Add default permissions if it doesn't exist
List
<
String
>
permissions
=
Stream
.
of
(
this
.
permissions
,
Arrays
.
asList
(
ACCOUNT
.
defaultPermissions
))
.
flatMap
(
Collection:
:
stream
)
.
distinct
().
toList
();
if
(
permissions
.
contains
(
permission
))
return
true
;
String
[]
permissionParts
=
permission
.
split
(
"\\."
);
for
(
String
p
:
permissions
)
{
if
(
p
.
startsWith
(
"-"
)
&&
permissionMatchesWildcard
(
p
.
substring
(
1
),
permissionParts
))
return
false
;
if
(
permissionMatchesWildcard
(
p
,
permissionParts
))
return
true
;
}
return
permissions
.
contains
(
"*"
);
}
public
boolean
removePermission
(
String
permission
)
{
return
this
.
permissions
.
remove
(
permission
);
}
...
...
@@ -135,5 +181,10 @@ public class Account {
if
(!
document
.
containsKey
(
"permissions"
))
{
this
.
addPermission
(
"*"
);
}
// Set account default language as server default language
if
(!
document
.
containsKey
(
"locale"
))
{
this
.
locale
=
LANGUAGE
;
}
}
}
src/main/java/emu/grasscutter/game/ability/AbilityManager.java
0 → 100644
View file @
a8293102
package
emu.grasscutter.game.ability
;
import
java.util.Optional
;
import
com.google.protobuf.InvalidProtocolBufferException
;
import
emu.grasscutter.Grasscutter
;
import
emu.grasscutter.data.GameData
;
import
emu.grasscutter.data.binout.AbilityModifierEntry
;
import
emu.grasscutter.data.binout.AbilityModifier.AbilityModifierAction
;
import
emu.grasscutter.data.excels.AvatarSkillDepotData
;
import
emu.grasscutter.data.excels.ItemData
;
import
emu.grasscutter.game.avatar.Avatar
;
import
emu.grasscutter.game.entity.EntityAvatar
;
import
emu.grasscutter.game.entity.EntityClientGadget
;
import
emu.grasscutter.game.entity.EntityItem
;
import
emu.grasscutter.game.entity.GameEntity
;
import
emu.grasscutter.game.player.Player
;
import
emu.grasscutter.game.props.ElementType
;
import
emu.grasscutter.net.proto.AbilityActionGenerateElemBallOuterClass.AbilityActionGenerateElemBall
;
import
emu.grasscutter.net.proto.AbilityInvokeEntryHeadOuterClass.AbilityInvokeEntryHead
;
import
emu.grasscutter.net.proto.AbilityInvokeEntryOuterClass.AbilityInvokeEntry
;
import
emu.grasscutter.net.proto.AbilityMetaModifierChangeOuterClass.AbilityMetaModifierChange
;
import
emu.grasscutter.net.proto.AbilityMetaReInitOverrideMapOuterClass.AbilityMetaReInitOverrideMap
;
import
emu.grasscutter.net.proto.AbilityMixinCostStaminaOuterClass.AbilityMixinCostStamina
;
import
emu.grasscutter.net.proto.AbilityScalarValueEntryOuterClass.AbilityScalarValueEntry
;
import
emu.grasscutter.net.proto.ModifierActionOuterClass.ModifierAction
;
import
emu.grasscutter.utils.Position
;
import
emu.grasscutter.utils.Utils
;
public
class
AbilityManager
{
private
Player
player
;
public
AbilityManager
(
Player
player
)
{
this
.
player
=
player
;
}
public
Player
getPlayer
()
{
return
this
.
player
;
}
public
void
onAbilityInvoke
(
AbilityInvokeEntry
invoke
)
throws
Exception
{
// Grasscutter.getLogger().info(invoke.getArgumentType() + " (" + invoke.getArgumentTypeValue() + "): " + Utils.bytesToHex(invoke.toByteArray()));
switch
(
invoke
.
getArgumentType
())
{
case
ABILITY_INVOKE_ARGUMENT_META_OVERRIDE_PARAM:
handleOverrideParam
(
invoke
);
break
;
case
ABILITY_INVOKE_ARGUMENT_META_REINIT_OVERRIDEMAP:
handleReinitOverrideMap
(
invoke
);
break
;
case
ABILITY_INVOKE_ARGUMENT_META_MODIFIER_CHANGE:
handleModifierChange
(
invoke
);
break
;
case
ABILITY_INVOKE_ARGUMENT_MIXIN_COST_STAMINA:
handleMixinCostStamina
(
invoke
);
break
;
case
ABILITY_INVOKE_ARGUMENT_ACTION_GENERATE_ELEM_BALL:
handleGenerateElemBall
(
invoke
);
break
;
default
:
break
;
}
}
private
void
handleOverrideParam
(
AbilityInvokeEntry
invoke
)
throws
Exception
{
GameEntity
entity
=
player
.
getScene
().
getEntityById
(
invoke
.
getEntityId
());
if
(
entity
==
null
)
{
return
;
}
AbilityScalarValueEntry
entry
=
AbilityScalarValueEntry
.
parseFrom
(
invoke
.
getAbilityData
());
entity
.
getMetaOverrideMap
().
put
(
entry
.
getKey
().
getStr
(),
entry
.
getFloatValue
());
}
private
void
handleReinitOverrideMap
(
AbilityInvokeEntry
invoke
)
throws
Exception
{
GameEntity
entity
=
player
.
getScene
().
getEntityById
(
invoke
.
getEntityId
());
if
(
entity
==
null
)
{
return
;
}
AbilityMetaReInitOverrideMap
map
=
AbilityMetaReInitOverrideMap
.
parseFrom
(
invoke
.
getAbilityData
());
for
(
AbilityScalarValueEntry
entry
:
map
.
getOverrideMapList
())
{
entity
.
getMetaOverrideMap
().
put
(
entry
.
getKey
().
getStr
(),
entry
.
getFloatValue
());
}
}
private
void
handleModifierChange
(
AbilityInvokeEntry
invoke
)
throws
Exception
{
GameEntity
target
=
player
.
getScene
().
getEntityById
(
invoke
.
getEntityId
());
if
(
target
==
null
)
{
return
;
}
AbilityInvokeEntryHead
head
=
invoke
.
getHead
();
if
(
head
==
null
)
{
return
;
}
AbilityMetaModifierChange
data
=
AbilityMetaModifierChange
.
parseFrom
(
invoke
.
getAbilityData
());
if
(
data
==
null
)
{
return
;
}
GameEntity
sourceEntity
=
player
.
getScene
().
getEntityById
(
data
.
getApplyEntityId
());
if
(
sourceEntity
==
null
)
{
return
;
}
// This is not how it works but we will keep it for now since healing abilities dont work properly anyways
if
(
data
.
getAction
()
==
ModifierAction
.
ADDED
&&
data
.
getParentAbilityName
()
!=
null
)
{
// Handle add modifier here
String
modifierString
=
data
.
getParentAbilityName
().
getStr
();
AbilityModifierEntry
modifier
=
GameData
.
getAbilityModifiers
().
get
(
modifierString
);
if
(
modifier
!=
null
&&
modifier
.
getOnAdded
().
size
()
>
0
)
{
for
(
AbilityModifierAction
action
:
modifier
.
getOnAdded
())
{
invokeAction
(
action
,
target
,
sourceEntity
);
}
}
// Add to meta modifier list
target
.
getMetaModifiers
().
put
(
head
.
getInstancedModifierId
(),
modifierString
);
}
else
if
(
data
.
getAction
()
==
ModifierAction
.
REMOVED
)
{
String
modifierString
=
target
.
getMetaModifiers
().
get
(
head
.
getInstancedModifierId
());
if
(
modifierString
!=
null
)
{
// Get modifier and call on remove event
AbilityModifierEntry
modifier
=
GameData
.
getAbilityModifiers
().
get
(
modifierString
);
if
(
modifier
!=
null
&&
modifier
.
getOnRemoved
().
size
()
>
0
)
{
for
(
AbilityModifierAction
action
:
modifier
.
getOnRemoved
())
{
invokeAction
(
action
,
target
,
sourceEntity
);
}
}
// Remove from meta modifiers
target
.
getMetaModifiers
().
remove
(
head
.
getInstancedModifierId
());
}
}
}
private
void
handleMixinCostStamina
(
AbilityInvokeEntry
invoke
)
throws
InvalidProtocolBufferException
{
AbilityMixinCostStamina
costStamina
=
AbilityMixinCostStamina
.
parseFrom
((
invoke
.
getAbilityData
()));
getPlayer
().
getStaminaManager
().
handleMixinCostStamina
(
costStamina
.
getIsSwim
());
}
private
void
handleGenerateElemBall
(
AbilityInvokeEntry
invoke
)
throws
InvalidProtocolBufferException
{
this
.
player
.
getEnergyManager
().
handleGenerateElemBall
(
invoke
);
}
private
void
invokeAction
(
AbilityModifierAction
action
,
GameEntity
target
,
GameEntity
sourceEntity
)
{
switch
(
action
.
type
)
{
case
HealHP
->
{
if
(
action
.
amount
==
null
)
{
return
;
}
float
healAmount
=
0
;
if
(
action
.
amount
.
isDynamic
&&
action
.
amount
.
dynamicKey
!=
null
)
{
healAmount
=
sourceEntity
.
getMetaOverrideMap
().
getOrDefault
(
action
.
amount
.
dynamicKey
,
0
f
);
}
if
(
healAmount
>
0
)
{
target
.
heal
(
healAmount
);
}
}
case
LoseHP
->
{
if
(
action
.
amountByTargetCurrentHPRatio
==
null
)
{
return
;
}
float
damageAmount
=
0
;
if
(
action
.
amount
.
isDynamic
&&
action
.
amount
.
dynamicKey
!=
null
)
{
damageAmount
=
sourceEntity
.
getMetaOverrideMap
().
getOrDefault
(
action
.
amount
.
dynamicKey
,
0
f
);
}
if
(
damageAmount
>
0
)
{
target
.
damage
(
damageAmount
);
}
}
}
}
}
src/main/java/emu/grasscutter/game/avatar/Avatar.java
View file @
a8293102
...
...
@@ -17,24 +17,24 @@ import dev.morphia.annotations.PostLoad;
import
dev.morphia.annotations.PrePersist
;
import
dev.morphia.annotations.Transient
;
import
emu.grasscutter.data.GameData
;
import
emu.grasscutter.data.binout.OpenConfigEntry
;
import
emu.grasscutter.data.binout.OpenConfigEntry.SkillPointModifier
;
import
emu.grasscutter.data.common.FightPropData
;
import
emu.grasscutter.data.custom.OpenConfigEntry
;
import
emu.grasscutter.data.custom.OpenConfigEntry.SkillPointModifier
;
import
emu.grasscutter.data.def.AvatarData
;
import
emu.grasscutter.data.def.AvatarPromoteData
;
import
emu.grasscutter.data.def.AvatarSkillData
;
import
emu.grasscutter.data.def.AvatarSkillDepotData
;
import
emu.grasscutter.data.def.AvatarSkillDepotData.InherentProudSkillOpens
;
import
emu.grasscutter.data.def.AvatarTalentData
;
import
emu.grasscutter.data.def.EquipAffixData
;
import
emu.grasscutter.data.def.ItemData.WeaponProperty
;
import
emu.grasscutter.data.def.ProudSkillData
;
import
emu.grasscutter.data.def.ReliquaryAffixData
;
import
emu.grasscutter.data.def.ReliquaryLevelData
;
import
emu.grasscutter.data.def.ReliquaryMainPropData
;
import
emu.grasscutter.data.def.ReliquarySetData
;
import
emu.grasscutter.data.def.WeaponCurveData
;
import
emu.grasscutter.data.def.WeaponPromoteData
;
import
emu.grasscutter.data.excels.AvatarData
;
import
emu.grasscutter.data.excels.AvatarPromoteData
;
import
emu.grasscutter.data.excels.AvatarSkillData
;
import
emu.grasscutter.data.excels.AvatarSkillDepotData
;
import
emu.grasscutter.data.excels.AvatarTalentData
;
import
emu.grasscutter.data.excels.EquipAffixData
;
import
emu.grasscutter.data.excels.ProudSkillData
;
import
emu.grasscutter.data.excels.ReliquaryAffixData
;
import
emu.grasscutter.data.excels.ReliquaryLevelData
;
import
emu.grasscutter.data.excels.ReliquaryMainPropData
;
import
emu.grasscutter.data.excels.ReliquarySetData
;
import
emu.grasscutter.data.excels.WeaponCurveData
;
import
emu.grasscutter.data.excels.WeaponPromoteData
;
import
emu.grasscutter.data.excels.AvatarSkillDepotData.InherentProudSkillOpens
;
import
emu.grasscutter.data.excels.ItemData.WeaponProperty
;
import
emu.grasscutter.database.DatabaseHelper
;
import
emu.grasscutter.game.entity.EntityAvatar
;
import
emu.grasscutter.game.inventory.EquipType
;
...
...
@@ -62,6 +62,8 @@ import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap;
import
it.unimi.dsi.fastutil.ints.Int2ObjectMap
;
import
it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap
;
import
static
emu
.
grasscutter
.
Configuration
.
GAME_OPTIONS
;
@Entity
(
value
=
"avatars"
,
useDiscriminator
=
false
)
public
class
Avatar
{
@Id
private
ObjectId
id
;
...
...
@@ -69,6 +71,7 @@ public class Avatar {
@Transient
private
Player
owner
;
@Transient
private
AvatarData
data
;
@Transient
private
AvatarSkillDepotData
skillDepot
;
@Transient
private
long
guid
;
// Player unique id
private
int
avatarId
;
// Id of avatar
...
...
@@ -78,6 +81,7 @@ public class Avatar {
private
int
satiation
;
// ?
private
int
satiationPenalty
;
// ?
private
float
currentHp
;
private
float
currentEnergy
;
@Transient
private
final
Int2ObjectMap
<
GameItem
>
equips
;
@Transient
private
final
Int2FloatOpenHashMap
fightProp
;
...
...
@@ -103,8 +107,8 @@ public class Avatar {
private
int
nameCardRewardId
;
private
int
nameCardId
;
@Deprecated
// Do not use. Morhpia only!
public
Avatar
()
{
// Morhpia only!
this
.
equips
=
new
Int2ObjectOpenHashMap
<>();
this
.
fightProp
=
new
Int2FloatOpenHashMap
();
this
.
extraAbilityEmbryos
=
new
HashSet
<>();
...
...
@@ -140,13 +144,13 @@ public class Avatar {
}
// Skill depot
this
.
setSkillDepot
(
getAvatarData
().
getSkillDepot
());
this
.
setSkillDepot
Data
(
getAvatarData
().
getSkillDepot
());
// Set stats
this
.
recalcStats
();
this
.
currentHp
=
getFightProperty
(
FightProperty
.
FIGHT_PROP_MAX_HP
);
setFightProperty
(
FightProperty
.
FIGHT_PROP_CUR_HP
,
this
.
currentHp
);
this
.
currentEnergy
=
0
f
;
// Load handler
this
.
onLoad
();
}
...
...
@@ -164,7 +168,8 @@ public class Avatar {
}
protected
void
setAvatarData
(
AvatarData
data
)
{
this
.
data
=
data
;
if
(
this
.
data
!=
null
)
return
;
this
.
data
=
data
;
// Used while loading this from the database
}
public
int
getOwnerId
()
{
...
...
@@ -257,9 +262,19 @@ public class Avatar {
return
skillDepotId
;
}
public
void
setSkillDepot
(
AvatarSkillDepotData
skillDepot
)
{
// Set id
public
AvatarSkillDepotData
getSkillDepot
()
{
return
skillDepot
;
}
protected
void
setSkillDepot
(
AvatarSkillDepotData
skillDepot
)
{
if
(
this
.
skillDepot
!=
null
)
return
;
this
.
skillDepot
=
skillDepot
;
// Used while loading this from the database
}
public
void
setSkillDepotData
(
AvatarSkillDepotData
skillDepot
)
{
// Set id and depot
this
.
skillDepotId
=
skillDepot
.
getId
();
this
.
skillDepot
=
skillDepot
;
// Clear, then add skills
getSkillLevelMap
().
clear
();
if
(
skillDepot
.
getEnergySkill
()
>
0
)
{
...
...
@@ -344,6 +359,34 @@ public class Avatar {
this
.
currentHp
=
currentHp
;
}
public
void
setCurrentEnergy
()
{
if
(
GAME_OPTIONS
.
energyUsage
)
{
this
.
setCurrentEnergy
(
this
.
currentEnergy
);
}
}
public
void
setCurrentEnergy
(
float
currentEnergy
)
{
if
(
this
.
getSkillDepot
()
!=
null
&&
this
.
getSkillDepot
().
getEnergySkillData
()
!=
null
)
{
ElementType
element
=
this
.
getSkillDepot
().
getElementType
();
this
.
setFightProperty
(
element
.
getMaxEnergyProp
(),
this
.
getSkillDepot
().
getEnergySkillData
().
getCostElemVal
());
if
(
GAME_OPTIONS
.
energyUsage
)
{
this
.
setFightProperty
(
element
.
getCurEnergyProp
(),
currentEnergy
);
}
else
{
this
.
setFightProperty
(
element
.
getCurEnergyProp
(),
this
.
getSkillDepot
().
getEnergySkillData
().
getCostElemVal
());
}
}
}
public
void
setCurrentEnergy
(
FightProperty
curEnergyProp
,
float
currentEnergy
)
{
if
(
GAME_OPTIONS
.
energyUsage
)
{
this
.
setFightProperty
(
curEnergyProp
,
currentEnergy
);
this
.
currentEnergy
=
currentEnergy
;
this
.
save
();
}
}
public
Int2FloatOpenHashMap
getFightProperties
()
{
return
fightProp
;
}
...
...
@@ -481,6 +524,9 @@ public class Avatar {
// Get hp percent, set to 100% if none
float
hpPercent
=
this
.
getFightProperty
(
FightProperty
.
FIGHT_PROP_MAX_HP
)
<=
0
?
1
f
:
this
.
getFightProperty
(
FightProperty
.
FIGHT_PROP_CUR_HP
)
/
this
.
getFightProperty
(
FightProperty
.
FIGHT_PROP_MAX_HP
);
// Store current energy value for later
float
currentEnergy
=
(
this
.
getSkillDepot
()
!=
null
)
?
this
.
getFightProperty
(
this
.
getSkillDepot
().
getElementType
().
getCurEnergyProp
())
:
0
f
;
// Clear properties
this
.
getFightProperties
().
clear
();
...
...
@@ -499,11 +545,7 @@ public class Avatar {
}
// Set energy usage
if
(
data
.
getSkillDepot
()
!=
null
&&
data
.
getSkillDepot
().
getEnergySkillData
()
!=
null
)
{
ElementType
element
=
data
.
getSkillDepot
().
getElementType
();
this
.
setFightProperty
(
element
.
getEnergyProperty
(),
data
.
getSkillDepot
().
getEnergySkillData
().
getCostElemVal
());
this
.
setFightProperty
((
element
.
getEnergyProperty
().
getId
()
%
70
)
+
1000
,
data
.
getSkillDepot
().
getEnergySkillData
().
getCostElemVal
());
}
setCurrentEnergy
(
currentEnergy
);
// Artifacts
for
(
int
slotId
=
1
;
slotId
<=
5
;
slotId
++)
{
...
...
src/main/java/emu/grasscutter/game/avatar/AvatarStorage.java
View file @
a8293102
...
...
@@ -4,7 +4,8 @@ import java.util.Iterator;
import
java.util.List
;
import
emu.grasscutter.data.GameData
;
import
emu.grasscutter.data.def.AvatarData
;
import
emu.grasscutter.data.excels.AvatarData
;
import
emu.grasscutter.data.excels.AvatarSkillDepotData
;
import
emu.grasscutter.database.DatabaseHelper
;
import
emu.grasscutter.game.entity.EntityAvatar
;
import
emu.grasscutter.game.inventory.GameItem
;
...
...
@@ -139,12 +140,14 @@ public class AvatarStorage implements Iterable<Avatar> {
}
AvatarData
avatarData
=
GameData
.
getAvatarDataMap
().
get
(
avatar
.
getAvatarId
());
if
(
avatarData
==
null
)
{
AvatarSkillDepotData
skillDepot
=
GameData
.
getAvatarSkillDepotDataMap
().
get
(
avatar
.
getSkillDepotId
());
if
(
avatarData
==
null
||
skillDepot
==
null
)
{
continue
;
}
// Set ownerships
avatar
.
setAvatarData
(
avatarData
);
avatar
.
setSkillDepot
(
skillDepot
);
avatar
.
setOwner
(
getPlayer
());
// Force recalc of const boosted skills
...
...
src/main/java/emu/grasscutter/game/combine/CombineManger.java
View file @
a8293102
package
emu.grasscutter.game.combine
;
import
emu.grasscutter.data.GameData
;
import
emu.grasscutter.data.def.CombineData
;
import
emu.grasscutter.data.common.ItemParamData
;
import
emu.grasscutter.data.excels.CombineData
;
import
emu.grasscutter.game.inventory.ItemType
;
import
emu.grasscutter.game.player.Player
;
import
emu.grasscutter.net.proto.RetcodeOuterClass
;
...
...
@@ -71,7 +72,7 @@ public class CombineManger {
CombineResult
result
=
new
CombineResult
();
result
.
setMaterial
(
List
.
of
());
result
.
setResult
(
List
.
of
(
new
CombineData
.
CombineItemPair
(
combineData
.
getResultItemId
(),
result
.
setResult
(
List
.
of
(
new
ItemParamData
(
combineData
.
getResultItemId
(),
combineData
.
getResultItemCount
()
*
count
)));
// TODO lucky characters
result
.
setExtra
(
List
.
of
());
...
...
src/main/java/emu/grasscutter/game/combine/CombineResult.java
View file @
a8293102
package
emu.grasscutter.game.combine
;
import
emu.grasscutter.data.def.CombineData
;
import
java.util.List
;
import
emu.grasscutter.data.common.ItemParamData
;
import
emu.grasscutter.data.excels.CombineData
;
public
class
CombineResult
{
private
List
<
CombineData
.
CombineItemPair
>
material
;
private
List
<
CombineData
.
CombineItemPair
>
result
;
private
List
<
CombineData
.
CombineItemPair
>
extra
;
private
List
<
CombineData
.
CombineItemPair
>
back
;
private
List
<
ItemParamData
>
material
;
private
List
<
ItemParamData
>
result
;
private
List
<
ItemParamData
>
extra
;
private
List
<
ItemParamData
>
back
;
public
List
<
CombineData
.
CombineItemPair
>
getMaterial
()
{
public
List
<
ItemParamData
>
getMaterial
()
{
return
material
;
}
public
void
setMaterial
(
List
<
CombineData
.
CombineItemPair
>
material
)
{
public
void
setMaterial
(
List
<
ItemParamData
>
material
)
{
this
.
material
=
material
;
}
public
List
<
CombineData
.
CombineItemPair
>
getResult
()
{
public
List
<
ItemParamData
>
getResult
()
{
return
result
;
}
public
void
setResult
(
List
<
CombineData
.
CombineItemPair
>
result
)
{
public
void
setResult
(
List
<
ItemParamData
>
result
)
{
this
.
result
=
result
;
}
public
List
<
CombineData
.
CombineItemPair
>
getExtra
()
{
public
List
<
ItemParamData
>
getExtra
()
{
return
extra
;
}
public
void
setExtra
(
List
<
CombineData
.
CombineItemPair
>
extra
)
{
public
void
setExtra
(
List
<
ItemParamData
>
extra
)
{
this
.
extra
=
extra
;
}
public
List
<
CombineData
.
CombineItemPair
>
getBack
()
{
public
List
<
ItemParamData
>
getBack
()
{
return
back
;
}
public
void
setBack
(
List
<
CombineData
.
CombineItemPair
>
back
)
{
public
void
setBack
(
List
<
ItemParamData
>
back
)
{
this
.
back
=
back
;
}
...
...
Prev
1
…
3
4
5
6
7
8
9
10
11
…
21
Next
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