Skip to content

Commit

Permalink
Gameplay improvements (#3)
Browse files Browse the repository at this point in the history
* Set default max users to 2000... for reasons...

* Add player finished packet.

Seems to be sent after a player holes out for the last time.
Not really sure if it's needed, but alas.

* Implement hole and player orders mostly correctly.

Player order is still wrong because we are not tracking OB/etc.
  • Loading branch information
jchv authored Jul 4, 2023
1 parent 7dd3426 commit 8a06d6f
Show file tree
Hide file tree
Showing 4 changed files with 258 additions and 144 deletions.
18 changes: 11 additions & 7 deletions game/model/room.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ type RoomState struct {

GamePhase GamePhase
ShotSync *ShotSyncData
HoleInfo *HoleInfo
Holes []RoomHole
ActiveConnID uint32
}

Expand Down Expand Up @@ -170,10 +170,14 @@ type ShotSyncData struct {
Unknown2 [11]byte
}

type HoleInfo struct {
Par uint8
TeeX float32
TeeZ float32
PinX float32
PinZ float32
type RoomHole struct {
Course byte
HoleNum uint8
HoleID uint32
Pin uint8
Par uint8
TeeX float32
TeeZ float32
PinX float32
PinZ float32
}
13 changes: 9 additions & 4 deletions game/packet/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ var ServerMessageTable = common.NewMessageTable(map[uint16]ServerMessage{
0x016A: &Server016A{},
0x016C: &ServerLockerCombinationResponse{},
0x0170: &ServerLockerInventoryResponse{},
0x0199: &ServerRoomPlayerFinished{},
0x01F6: &Server01F6{},
0x020E: &Server020E{},
0x0210: &ServerInboxNotify{},
Expand Down Expand Up @@ -498,10 +499,10 @@ type Server004E struct {
}

type HoleInfo struct {
HoleID uint32
Pin uint8
Course uint8
Num uint8
HoleID uint32
Pin uint8
Course uint8
HoleNum uint8
}

type ServerRoomGameData struct {
Expand Down Expand Up @@ -634,6 +635,10 @@ type ServerLockerInventoryResponse struct {
Status uint32
}

type ServerRoomPlayerFinished struct {
ServerMessage_
}

// ServerRoomJoin is sent when a room is joined.
type ServerRoomJoin struct {
ServerMessage_
Expand Down
Loading

0 comments on commit 8a06d6f

Please sign in to comment.