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
79e4172c
Commit
79e4172c
authored
Jun 18, 2022
by
诗音澄鸢 镜苑芳依
Committed by
GitHub
Jun 17, 2022
Browse files
Fix daily dungeon didn't display in note(笔记) (#1296)
* Fix Daily dungeon didn't display in note(笔记) -- Buggy * 123
parent
2915b14c
Changes
4
Show whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/data/GameData.java
View file @
79e4172c
...
...
@@ -78,6 +78,8 @@ public class GameData {
private
static
final
Int2ObjectMap
<
WorldAreaData
>
worldAreaDataMap
=
new
Int2ObjectOpenHashMap
<>();
private
static
final
Int2ObjectMap
<
WorldLevelData
>
worldLevelDataMap
=
new
Int2ObjectOpenHashMap
<>();
private
static
final
Int2ObjectMap
<
DailyDungeonData
>
dailyDungeonDataMap
=
new
Int2ObjectOpenHashMap
<>();
private
static
final
Int2ObjectMap
<
DungeonEntryData
>
dungeonEntryDataMap
=
new
Int2ObjectOpenHashMap
<>();
private
static
final
Int2ObjectMap
<
DungeonData
>
dungeonDataMap
=
new
Int2ObjectOpenHashMap
<>();
private
static
final
Int2ObjectMap
<
QuestData
>
questDataMap
=
new
Int2ObjectOpenHashMap
<>();
private
static
final
Int2ObjectMap
<
ShopGoodsData
>
shopGoodsDataMap
=
new
Int2ObjectOpenHashMap
<>();
...
...
@@ -346,6 +348,10 @@ public class GameData {
return
dailyDungeonDataMap
;
}
public
static
Int2ObjectMap
<
DungeonEntryData
>
getDungeonEntryDatatMap
(){
return
dungeonEntryDataMap
;
}
public
static
Map
<
Integer
,
List
<
ShopGoodsData
>>
getShopGoodsDataEntries
()
{
if
(
shopGoods
.
isEmpty
())
{
shopGoodsDataMap
.
forEach
((
k
,
v
)
->
{
...
...
src/main/java/emu/grasscutter/data/excels/DungeonEntryData.java
0 → 100644
View file @
79e4172c
package
emu.grasscutter.data.excels
;
import
emu.grasscutter.data.GameResource
;
import
emu.grasscutter.data.ResourceType
;
import
lombok.Getter
;
import
lombok.Setter
;
@ResourceType
(
name
=
"DungeonEntryExcelConfigData.json"
)
@Getter
@Setter
public
class
DungeonEntryData
extends
GameResource
{
private
int
dungeonEntryId
;
private
int
sceneId
;
private
int
id
;
@Override
public
int
getId
()
{
return
this
.
id
;
}
@Override
public
void
onLoad
()
{
}
}
src/main/java/emu/grasscutter/server/packet/recv/HandlerGetDailyDungeonEntryInfoReq.java
0 → 100644
View file @
79e4172c
package
emu.grasscutter.server.packet.recv
;
import
emu.grasscutter.Grasscutter
;
import
emu.grasscutter.net.packet.Opcodes
;
import
emu.grasscutter.net.packet.PacketHandler
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.GetDailyDungeonEntryInfoReqOuterClass
;
import
emu.grasscutter.server.game.GameSession
;
import
emu.grasscutter.server.packet.send.PacketGetDailyDungeonEntryInfoRsp
;
@Opcodes
(
PacketOpcodes
.
GetDailyDungeonEntryInfoReq
)
public
class
HandlerGetDailyDungeonEntryInfoReq
extends
PacketHandler
{
@Override
public
void
handle
(
GameSession
session
,
byte
[]
header
,
byte
[]
payload
)
throws
Exception
{
var
req
=
GetDailyDungeonEntryInfoReqOuterClass
.
GetDailyDungeonEntryInfoReq
.
parseFrom
(
payload
);
session
.
send
(
new
PacketGetDailyDungeonEntryInfoRsp
(
req
.
getSceneId
()));
}
}
src/main/java/emu/grasscutter/server/packet/send/PacketGetDailyDungeonEntryInfoRsp.java
0 → 100644
View file @
79e4172c
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.Grasscutter
;
import
emu.grasscutter.data.GameData
;
import
emu.grasscutter.data.excels.DungeonEntryData
;
import
emu.grasscutter.net.packet.BasePacket
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.DailyDungeonEntryInfoOuterClass
;
import
emu.grasscutter.net.proto.DungeonEntryInfoOuterClass
;
import
emu.grasscutter.net.proto.GetDailyDungeonEntryInfoRspOuterClass
;
import
java.util.List
;
public
class
PacketGetDailyDungeonEntryInfoRsp
extends
BasePacket
{
public
PacketGetDailyDungeonEntryInfoRsp
(
Integer
sceneID
)
{
super
(
PacketOpcodes
.
GetDailyDungeonEntryInfoRsp
);
var
resp
=
GetDailyDungeonEntryInfoRspOuterClass
.
GetDailyDungeonEntryInfoRsp
.
newBuilder
();
for
(
var
info
:
GameData
.
getDungeonEntryDatatMap
().
values
().
parallelStream
().
filter
(
d
->
d
.
getSceneId
()
==
sceneID
).
map
(
this
::
getDungonEntryInfo
).
toList
())
resp
.
addDailyDungeonInfoList
(
info
);
this
.
setData
(
resp
.
build
());
}
private
DailyDungeonEntryInfoOuterClass
.
DailyDungeonEntryInfo
getDungonEntryInfo
(
DungeonEntryData
data
)
{
var
dungeonEntryId
=
data
.
getDungeonEntryId
();
var
id
=
data
.
getId
();
//TODO: 来个爹把这块整活了吧 咚咚咚
DungeonEntryInfoOuterClass
.
DungeonEntryInfo
dungeonEntryInfo
=
DungeonEntryInfoOuterClass
.
DungeonEntryInfo
.
newBuilder
().
setDungeonId
(
130
).
build
();
var
builder
=
DailyDungeonEntryInfoOuterClass
.
DailyDungeonEntryInfo
.
newBuilder
();
builder
.
setDungeonEntryId
(
dungeonEntryId
);
builder
.
setDungeonEntryConfigId
(
id
);
builder
.
setRecommendDungeonEntryInfo
(
dungeonEntryInfo
);
return
builder
.
build
();
}
}
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