alpelo object system backport test commit

This commit is contained in:
wish
2025-10-05 16:18:22 +11:00
parent aad3b088b9
commit c4ec2efde5
3 changed files with 19 additions and 22 deletions

View File

@@ -183,7 +183,6 @@ func logoutPlayer(s *Session) {
delete(s.server.sessions, s.rawConn) delete(s.server.sessions, s.rawConn)
} }
s.rawConn.Close() s.rawConn.Close()
delete(s.server.objectIDs, s)
s.server.Unlock() s.server.Unlock()
for _, stage := range s.server.stages { for _, stage := range s.server.stages {

View File

@@ -8,6 +8,7 @@ import (
"erupe-ce/common/byteframe" "erupe-ce/common/byteframe"
ps "erupe-ce/common/pascalstring" ps "erupe-ce/common/pascalstring"
"erupe-ce/network/mhfpacket" "erupe-ce/network/mhfpacket"
"go.uber.org/zap" "go.uber.org/zap"
) )
@@ -64,7 +65,6 @@ func doStageTransfer(s *Session, ackHandle uint32, stageID string) {
// Confirm the stage entry. // Confirm the stage entry.
doAckSimpleSucceed(s, ackHandle, []byte{0x00, 0x00, 0x00, 0x00}) doAckSimpleSucceed(s, ackHandle, []byte{0x00, 0x00, 0x00, 0x00})
var temp mhfpacket.MHFPacket
newNotif := byteframe.NewByteFrame() newNotif := byteframe.NewByteFrame()
// Cast existing user data to new user // Cast existing user data to new user

View File

@@ -38,18 +38,17 @@ type userBinaryPartID struct {
// Server is a MHF channel server. // Server is a MHF channel server.
type Server struct { type Server struct {
sync.Mutex sync.Mutex
Channels []*Server Channels []*Server
ID uint16 ID uint16
GlobalID string GlobalID string
IP string IP string
Port uint16 Port uint16
logger *zap.Logger logger *zap.Logger
db *sqlx.DB db *sqlx.DB
erupeConfig *_config.Config erupeConfig *_config.Config
acceptConns chan net.Conn acceptConns chan net.Conn
deleteConns chan net.Conn deleteConns chan net.Conn
sessions map[net.Conn]*Session sessions map[net.Conn]*Session
//objectIDs map[*Session]uint16
listener net.Listener // Listener that is created when Server.Start is called. listener net.Listener // Listener that is created when Server.Start is called.
isShuttingDown bool isShuttingDown bool
@@ -148,14 +147,13 @@ func (s *Server) UpdateRavi(semaID uint32, index uint8, value uint32, update boo
// NewServer creates a new Server type. // NewServer creates a new Server type.
func NewServer(config *Config) *Server { func NewServer(config *Config) *Server {
s := &Server{ s := &Server{
ID: config.ID, ID: config.ID,
logger: config.Logger, logger: config.Logger,
db: config.DB, db: config.DB,
erupeConfig: config.ErupeConfig, erupeConfig: config.ErupeConfig,
acceptConns: make(chan net.Conn), acceptConns: make(chan net.Conn),
deleteConns: make(chan net.Conn), deleteConns: make(chan net.Conn),
sessions: make(map[net.Conn]*Session), sessions: make(map[net.Conn]*Session),
//objectIDs: make(map[*Session]uint16),
stages: make(map[string]*Stage), stages: make(map[string]*Stage),
userBinaryParts: make(map[userBinaryPartID][]byte), userBinaryParts: make(map[userBinaryPartID][]byte),
semaphore: make(map[string]*Semaphore), semaphore: make(map[string]*Semaphore),