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)
}
s.rawConn.Close()
delete(s.server.objectIDs, s)
s.server.Unlock()
for _, stage := range s.server.stages {

View File

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

View File

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