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
787f3fd4
Commit
787f3fd4
authored
May 04, 2022
by
Melledy
Browse files
Fix damage number not showing up if it was the killing blow
parent
57285885
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/game/player/Player.java
View file @
787f3fd4
...
@@ -29,6 +29,7 @@ import emu.grasscutter.game.world.Scene;
...
@@ -29,6 +29,7 @@ import emu.grasscutter.game.world.Scene;
import
emu.grasscutter.game.world.World
;
import
emu.grasscutter.game.world.World
;
import
emu.grasscutter.net.packet.BasePacket
;
import
emu.grasscutter.net.packet.BasePacket
;
import
emu.grasscutter.net.proto.AbilityInvokeEntryOuterClass.AbilityInvokeEntry
;
import
emu.grasscutter.net.proto.AbilityInvokeEntryOuterClass.AbilityInvokeEntry
;
import
emu.grasscutter.net.proto.AttackResultOuterClass.AttackResult
;
import
emu.grasscutter.net.proto.CombatInvokeEntryOuterClass.CombatInvokeEntry
;
import
emu.grasscutter.net.proto.CombatInvokeEntryOuterClass.CombatInvokeEntry
;
import
emu.grasscutter.net.proto.InteractTypeOuterClass.InteractType
;
import
emu.grasscutter.net.proto.InteractTypeOuterClass.InteractType
;
import
emu.grasscutter.net.proto.MpSettingTypeOuterClass.MpSettingType
;
import
emu.grasscutter.net.proto.MpSettingTypeOuterClass.MpSettingType
;
...
@@ -54,6 +55,7 @@ import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
...
@@ -54,6 +55,7 @@ import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
import
java.time.Instant
;
import
java.time.Instant
;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.LinkedBlockingQueue
;
@Entity
(
value
=
"players"
,
useDiscriminator
=
false
)
@Entity
(
value
=
"players"
,
useDiscriminator
=
false
)
public
class
Player
{
public
class
Player
{
...
@@ -113,6 +115,7 @@ public class Player {
...
@@ -113,6 +115,7 @@ public class Player {
@Transient
private
long
nextSendPlayerLocTime
=
0
;
@Transient
private
long
nextSendPlayerLocTime
=
0
;
@Transient
private
final
Int2ObjectMap
<
CoopRequest
>
coopRequests
;
@Transient
private
final
Int2ObjectMap
<
CoopRequest
>
coopRequests
;
@Transient
private
final
Queue
<
AttackResult
>
attackResults
;
@Transient
private
final
InvokeHandler
<
CombatInvokeEntry
>
combatInvokeHandler
;
@Transient
private
final
InvokeHandler
<
CombatInvokeEntry
>
combatInvokeHandler
;
@Transient
private
final
InvokeHandler
<
AbilityInvokeEntry
>
abilityInvokeHandler
;
@Transient
private
final
InvokeHandler
<
AbilityInvokeEntry
>
abilityInvokeHandler
;
@Transient
private
final
InvokeHandler
<
AbilityInvokeEntry
>
clientAbilityInitFinishHandler
;
@Transient
private
final
InvokeHandler
<
AbilityInvokeEntry
>
clientAbilityInitFinishHandler
;
...
@@ -143,6 +146,7 @@ public class Player {
...
@@ -143,6 +146,7 @@ public class Player {
this
.
setRegionId
(
1
);
this
.
setRegionId
(
1
);
this
.
sceneState
=
SceneLoadState
.
NONE
;
this
.
sceneState
=
SceneLoadState
.
NONE
;
this
.
attackResults
=
new
LinkedBlockingQueue
<>();
this
.
coopRequests
=
new
Int2ObjectOpenHashMap
<>();
this
.
coopRequests
=
new
Int2ObjectOpenHashMap
<>();
this
.
combatInvokeHandler
=
new
InvokeHandler
(
PacketCombatInvocationsNotify
.
class
);
this
.
combatInvokeHandler
=
new
InvokeHandler
(
PacketCombatInvocationsNotify
.
class
);
this
.
abilityInvokeHandler
=
new
InvokeHandler
(
PacketAbilityInvocationsNotify
.
class
);
this
.
abilityInvokeHandler
=
new
InvokeHandler
(
PacketAbilityInvocationsNotify
.
class
);
...
@@ -414,6 +418,10 @@ public class Player {
...
@@ -414,6 +418,10 @@ public class Player {
public
MpSettingType
getMpSetting
()
{
public
MpSettingType
getMpSetting
()
{
return
MpSettingType
.
MP_SETTING_ENTER_AFTER_APPLY
;
// TEMP
return
MpSettingType
.
MP_SETTING_ENTER_AFTER_APPLY
;
// TEMP
}
}
public
Queue
<
AttackResult
>
getAttackResults
()
{
return
this
.
attackResults
;
}
public
synchronized
Int2ObjectMap
<
CoopRequest
>
getCoopRequests
()
{
public
synchronized
Int2ObjectMap
<
CoopRequest
>
getCoopRequests
()
{
return
coopRequests
;
return
coopRequests
;
...
...
src/main/java/emu/grasscutter/server/packet/recv/HandlerCombatInvocationsNotify.java
View file @
787f3fd4
...
@@ -22,7 +22,7 @@ public class HandlerCombatInvocationsNotify extends PacketHandler {
...
@@ -22,7 +22,7 @@ public class HandlerCombatInvocationsNotify extends PacketHandler {
case
COMBAT_EVT_BEING_HIT:
case
COMBAT_EVT_BEING_HIT:
// Handle damage
// Handle damage
EvtBeingHitInfo
hitInfo
=
EvtBeingHitInfo
.
parseFrom
(
entry
.
getCombatData
());
EvtBeingHitInfo
hitInfo
=
EvtBeingHitInfo
.
parseFrom
(
entry
.
getCombatData
());
session
.
getPlayer
().
get
Scene
().
handleAttack
(
hitInfo
.
getAttackResult
());
session
.
getPlayer
().
get
AttackResults
().
add
(
hitInfo
.
getAttackResult
());
break
;
break
;
case
ENTITY_MOVE:
case
ENTITY_MOVE:
// Handle movement
// Handle movement
...
@@ -43,9 +43,14 @@ public class HandlerCombatInvocationsNotify extends PacketHandler {
...
@@ -43,9 +43,14 @@ public class HandlerCombatInvocationsNotify extends PacketHandler {
session
.
getPlayer
().
getCombatInvokeHandler
().
addEntry
(
entry
.
getForwardType
(),
entry
);
session
.
getPlayer
().
getCombatInvokeHandler
().
addEntry
(
entry
.
getForwardType
(),
entry
);
}
}
// Handles sending combat invokes to other players/server
if
(
notif
.
getInvokeListList
().
size
()
>
0
)
{
if
(
notif
.
getInvokeListList
().
size
()
>
0
)
{
session
.
getPlayer
().
getCombatInvokeHandler
().
update
(
session
.
getPlayer
());
session
.
getPlayer
().
getCombatInvokeHandler
().
update
(
session
.
getPlayer
());
}
}
// Handle attack results last
while
(!
session
.
getPlayer
().
getAttackResults
().
isEmpty
())
{
session
.
getPlayer
().
getScene
().
handleAttack
(
session
.
getPlayer
().
getAttackResults
().
poll
());
}
}
}
}
}
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