-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
2,903 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...c/main/kotlin/work/fking/pangya/game/packet/handler/match/MatchFinalStatsPacketHandler.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package work.fking.pangya.game.packet.handler.match | ||
|
||
import io.netty.buffer.ByteBuf | ||
import work.fking.pangya.game.GameServer | ||
import work.fking.pangya.game.net.ClientPacketHandler | ||
import work.fking.pangya.game.player.Player | ||
import work.fking.pangya.game.player.readStatistics | ||
import work.fking.pangya.game.room.match.PlayerMatchFinishEvent | ||
|
||
class MatchFinalStatsPacketHandler : ClientPacketHandler { | ||
override fun handle(server: GameServer, player: Player, packet: ByteBuf) { | ||
val room = player.currentRoom ?: throw IllegalStateException("Player ${player.nickname} finished a match but is not in a room") | ||
val roomPlayer = room.findSelf(player) | ||
val statistics = packet.readStatistics() | ||
room.handleMatchEvent(PlayerMatchFinishEvent(roomPlayer, statistics)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletion
5
.../kotlin/work/fking/pangya/game/packet/handler/match/MatchPlayerHoleFinishPacketHandler.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,18 @@ | ||
package work.fking.pangya.game.packet.handler.match | ||
|
||
import io.netty.buffer.ByteBuf | ||
import io.netty.buffer.ByteBufUtil | ||
import work.fking.pangya.game.GameServer | ||
import work.fking.pangya.game.net.ClientPacketHandler | ||
import work.fking.pangya.game.player.Player | ||
import work.fking.pangya.game.player.readStatistics | ||
import work.fking.pangya.game.room.match.PlayerHoleFinishEvent | ||
|
||
class MatchPlayerHoleFinishPacketHandler : ClientPacketHandler { | ||
override fun handle(server: GameServer, player: Player, packet: ByteBuf) { | ||
val room = player.currentRoom ?: throw IllegalStateException("Player ${player.nickname} finished a hole but is not in a room") | ||
val roomPlayer = room.findSelf(player) | ||
room.handleMatchEvent(PlayerHoleFinishEvent(roomPlayer)) | ||
val statistics = packet.readStatistics() | ||
room.handleMatchEvent(PlayerHoleFinishEvent(roomPlayer, statistics)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...lin/work/fking/pangya/game/packet/handler/match/MatchPlayerUseTimeBoosterPacketHandler.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package work.fking.pangya.game.packet.handler.match | ||
|
||
import io.netty.buffer.ByteBuf | ||
import work.fking.pangya.game.GameServer | ||
import work.fking.pangya.game.net.ClientPacketHandler | ||
import work.fking.pangya.game.packet.outbound.MatchReplies | ||
import work.fking.pangya.game.player.Player | ||
|
||
class MatchPlayerUseTimeBoosterPacketHandler : ClientPacketHandler { | ||
override fun handle(server: GameServer, player: Player, packet: ByteBuf) { | ||
val room = player.currentRoom ?: throw IllegalStateException("Player ${player.nickname} tried to use a time booster but is not in a room") | ||
val roomPlayer = room.findSelf(player) | ||
val boostValue = packet.readFloatLE() | ||
|
||
roomPlayer.writeAndFlush(MatchReplies.useTimeBoosterAck(roomPlayer, boostValue)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.