Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filled maps (non-persistent, not rendered from terrain) #478

Draft
wants to merge 60 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
179eac8
Filled map
Endermanbugzjfc Apr 23, 2022
6ae813e
Register filled map
Endermanbugzjfc Apr 23, 2022
7f40354
Removed IsInit
Endermanbugzjfc Apr 23, 2022
01cc34b
Fixed doc for is scaling
Endermanbugzjfc Apr 23, 2022
bc67095
Revert "Removed IsInit"
Endermanbugzjfc Apr 23, 2022
cb9feca
Map interface
Endermanbugzjfc Apr 23, 2022
c6ea0c8
Added getters
Endermanbugzjfc Apr 23, 2022
3b37890
Added other types of filled map
Endermanbugzjfc Apr 23, 2022
ab45192
Extracted baseMap from FilledMap
Endermanbugzjfc Apr 23, 2022
7e38be5
Added map interface
Endermanbugzjfc Apr 23, 2022
19434a1
Added MapInfoRequestHandler (Not yet implemented)
Endermanbugzjfc Apr 23, 2022
4a43519
Error if player does not have corresponding map item
Endermanbugzjfc May 1, 2022
b1b723d
Rewrote map registration and update API
Endermanbugzjfc May 1, 2022
012840d
Specify the data type of ID
Endermanbugzjfc May 1, 2022
4c8f682
Forget to complete doc comment
Endermanbugzjfc May 1, 2022
34e6d55
Doc the update map function
Endermanbugzjfc May 1, 2022
4de8462
Fixed grammar (broadcast => broadcasts)
Endermanbugzjfc May 1, 2022
84d3f57
Added a map ID argument
Endermanbugzjfc May 1, 2022
6173cde
Merge remote-tracking branch 'upstream/master' into map-item
Endermanbugzjfc Jul 21, 2022
5d8f189
Moved viewer / data related API to item package
Endermanbugzjfc Jul 21, 2022
be68fde
Update doc comment and adding missing methods
Endermanbugzjfc Jul 21, 2022
62fe937
Delete viewer method
Endermanbugzjfc Jul 21, 2022
f7370aa
Added get data method
Endermanbugzjfc Jul 21, 2022
66c8c0b
Viewers mutex
Endermanbugzjfc Jul 21, 2022
811ef42
Write client bound map item data packet of initialisation
Endermanbugzjfc Jul 21, 2022
e1acf10
Forgot to stage map.go
Endermanbugzjfc Jul 21, 2022
b3aa6e3
Tracked objects
Endermanbugzjfc Jul 21, 2022
4a2225b
session.sendMapDataUpdate()
Endermanbugzjfc Jul 21, 2022
d57c6ae
X and Y offset
Endermanbugzjfc Jul 21, 2022
e8b2c65
Locked status in map data
Endermanbugzjfc Jul 22, 2022
f9f6d33
GetData() method
Endermanbugzjfc Jul 22, 2022
66ffb52
Not to allow changing scale or locked status of existed map data
Endermanbugzjfc Jul 22, 2022
b596d7d
Not to expose map ID to the API
Endermanbugzjfc Jul 22, 2022
9e77068
Nbtconv not allowed in item package :(
Endermanbugzjfc Jul 22, 2022
eef7e94
Merge branch 'df-mc:master' into map-item
Endermanbugzjfc Jul 22, 2022
fcb224c
Merge branch 'map-item' of https://github.com/crnw-dev/dragonfly into…
Endermanbugzjfc Jul 22, 2022
ed59a46
Fixed world package importing itself
Endermanbugzjfc Jul 22, 2022
b976bd3
Map pixels chunk struct
Endermanbugzjfc Jul 22, 2022
8b265cc
Map data creation and loading
Endermanbugzjfc Jul 22, 2022
5db4802
Allocate maps on viewable map data pointer creation
Endermanbugzjfc Jul 22, 2022
05268ce
Fixed usage of LoadMapData() result
Endermanbugzjfc Jul 22, 2022
b20a8ab
Fixed map info request handler
Endermanbugzjfc Jul 22, 2022
8c86240
Remove viewer who no longer has access to map data
Endermanbugzjfc Jul 22, 2022
31d9071
Fixed doc comment
Endermanbugzjfc Jul 22, 2022
c280ba4
Merge branch 'master' into map-item
Endermanbugzjfc Jul 23, 2022
ec77694
Added Bearing()
Endermanbugzjfc Jul 23, 2022
2254b3c
Revert "Added Bearing()"
Endermanbugzjfc Jul 26, 2022
ab96ac0
Track entities and blocks now hold their decoration offsets
Endermanbugzjfc Jul 26, 2022
d372715
Send decorations
Endermanbugzjfc Jul 26, 2022
80c3bbd
Merge branch 'master' into map-item
Endermanbugzjfc Jul 26, 2022
02df08e
Fixed doc comment
Endermanbugzjfc Jul 26, 2022
ad4d7a3
Allow changing tracked objects without sending
Endermanbugzjfc Jul 26, 2022
21801fb
Doc comment for MapPixelsChunk
Endermanbugzjfc Jul 26, 2022
c39cb14
Removed comment
Endermanbugzjfc Jul 28, 2022
52390d7
Merge branch 'master' into map-item
Endermanbugzjfc Jul 28, 2022
7b21511
Map ID equals always false if data is nil
Endermanbugzjfc Jul 30, 2022
bbed433
Do not use map ID 0
Endermanbugzjfc Jul 30, 2022
61222d6
Locked map
Endermanbugzjfc Jul 31, 2022
228f42c
Returns pointer instead of value copy
Endermanbugzjfc Jul 31, 2022
e54056d
Function name conflicts with type
Endermanbugzjfc Jul 31, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added MapInfoRequestHandler (Not yet implemented)
Endermanbugzjfc committed Apr 23, 2022

Unverified

This user has not yet uploaded their public signing key.
commit 19434a1f87764642fbcab824e141c0a20b414b04
18 changes: 18 additions & 0 deletions server/session/handler_map_info_request.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package session

import (
"sync"

"github.com/sandertv/gophertunnel/minecraft/protocol/packet"
)

// MapInfoRequestHandler handles the MapInfoRequest packet.
type MapInfoRequestHandler struct {
mu sync.Mutex
}

// Handle ...
func (h *MapInfoRequestHandler) Handle(p packet.Packet, s *Session) error {
// pk := p.(*packet.MapInfoRequest)
return nil
}
10 changes: 6 additions & 4 deletions server/session/session.go
Original file line number Diff line number Diff line change
@@ -5,6 +5,11 @@ import (
"context"
"errors"
"fmt"
"io"
"net"
"sync"
"time"

"github.com/df-mc/atomic"
"github.com/df-mc/dragonfly/server/block/cube"
"github.com/df-mc/dragonfly/server/internal"
@@ -20,10 +25,6 @@ import (
"github.com/sandertv/gophertunnel/minecraft/protocol/login"
"github.com/sandertv/gophertunnel/minecraft/protocol/packet"
"github.com/sandertv/gophertunnel/minecraft/text"
"io"
"net"
"sync"
"time"
)

// Session handles incoming packets from connections and sends outgoing packets by providing a thin layer
@@ -404,6 +405,7 @@ func (s *Session) registerHandlers() {
packet.IDInventoryTransaction: &InventoryTransactionHandler{},
packet.IDItemStackRequest: &ItemStackRequestHandler{changes: make(map[byte]map[byte]changeInfo), responseChanges: map[int32]map[byte]map[byte]responseChange{}},
packet.IDLevelSoundEvent: &LevelSoundEventHandler{},
packet.IDMapInfoRequest: &MapInfoRequestHandler{},
packet.IDMobEquipment: &MobEquipmentHandler{},
packet.IDModalFormResponse: &ModalFormResponseHandler{forms: make(map[uint32]form.Form)},
packet.IDMovePlayer: nil,