mirror of
https://github.com/CPunch/gopenfusion.git
synced 2025-11-29 09:50:05 +00:00
rename cnpeer package to cnet
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
package entity
|
||||
|
||||
import "github.com/CPunch/gopenfusion/cnpeer"
|
||||
import "github.com/CPunch/gopenfusion/cnet"
|
||||
|
||||
type EntityKind int
|
||||
|
||||
@@ -20,6 +20,6 @@ type Entity interface {
|
||||
SetPosition(x, y, z int)
|
||||
SetAngle(angle int)
|
||||
|
||||
DisappearFromViewOf(peer *cnpeer.CNPeer)
|
||||
EnterIntoViewOf(peer *cnpeer.CNPeer)
|
||||
DisappearFromViewOf(peer *cnet.CNPeer)
|
||||
EnterIntoViewOf(peer *cnet.CNPeer)
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package entity
|
||||
import (
|
||||
"sync/atomic"
|
||||
|
||||
"github.com/CPunch/gopenfusion/cnpeer"
|
||||
"github.com/CPunch/gopenfusion/cnet"
|
||||
"github.com/CPunch/gopenfusion/internal/protocol"
|
||||
)
|
||||
|
||||
@@ -63,13 +63,13 @@ func (npc *NPC) SetAngle(angle int) {
|
||||
npc.Angle = angle
|
||||
}
|
||||
|
||||
func (npc *NPC) DisappearFromViewOf(peer *cnpeer.CNPeer) {
|
||||
func (npc *NPC) DisappearFromViewOf(peer *cnet.CNPeer) {
|
||||
peer.Send(protocol.P_FE2CL_NPC_EXIT, protocol.SP_FE2CL_NPC_EXIT{
|
||||
INPC_ID: int32(npc.ID),
|
||||
})
|
||||
}
|
||||
|
||||
func (npc *NPC) EnterIntoViewOf(peer *cnpeer.CNPeer) {
|
||||
func (npc *NPC) EnterIntoViewOf(peer *cnet.CNPeer) {
|
||||
peer.Send(protocol.P_FE2CL_NPC_NEW, protocol.SP_FE2CL_NPC_NEW{
|
||||
NPCAppearanceData: npc.GetAppearanceData(),
|
||||
})
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"github.com/CPunch/gopenfusion/cnpeer"
|
||||
"github.com/CPunch/gopenfusion/cnet"
|
||||
"github.com/CPunch/gopenfusion/internal/db"
|
||||
"github.com/CPunch/gopenfusion/internal/protocol"
|
||||
)
|
||||
|
||||
type Player struct {
|
||||
db.Player
|
||||
Peer *cnpeer.CNPeer
|
||||
Peer *cnet.CNPeer
|
||||
Chunk ChunkPosition
|
||||
}
|
||||
|
||||
func NewPlayer(peer *cnpeer.CNPeer, player *db.Player) *Player {
|
||||
func NewPlayer(peer *cnet.CNPeer, player *db.Player) *Player {
|
||||
return &Player{
|
||||
Player: *player,
|
||||
Peer: peer,
|
||||
@@ -52,13 +52,13 @@ func (plr *Player) SetAngle(angle int) {
|
||||
plr.Angle = angle
|
||||
}
|
||||
|
||||
func (plr *Player) DisappearFromViewOf(peer *cnpeer.CNPeer) {
|
||||
func (plr *Player) DisappearFromViewOf(peer *cnet.CNPeer) {
|
||||
peer.Send(protocol.P_FE2CL_PC_EXIT, protocol.SP_FE2CL_PC_EXIT{
|
||||
IID: int32(plr.PlayerID),
|
||||
})
|
||||
}
|
||||
|
||||
func (plr *Player) EnterIntoViewOf(peer *cnpeer.CNPeer) {
|
||||
func (plr *Player) EnterIntoViewOf(peer *cnet.CNPeer) {
|
||||
peer.Send(protocol.P_FE2CL_PC_NEW, protocol.SP_FE2CL_PC_NEW{
|
||||
PCAppearanceData: plr.GetAppearanceData(),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user