mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-21 23:22:34 +01:00
refactor(channelserver): extract UserBinaryStore and MinidataStore
The userBinary and minidata maps with their locks were spread across Server as raw fields with manual lock management. Cross-channel session searches also required acquiring nested locks (server lock + binary lock). Encapsulating in dedicated types eliminates the nested locking and reduces Server's field count by 4.
This commit is contained in:
@@ -583,8 +583,8 @@ func createTestServerWithDB(t *testing.T, db *sqlx.DB) *Server {
|
||||
db: db,
|
||||
sessions: make(map[net.Conn]*Session),
|
||||
stages: make(map[string]*Stage),
|
||||
userBinaryParts: make(map[userBinaryPartID][]byte),
|
||||
minidataParts: make(map[uint32][]byte),
|
||||
userBinary: NewUserBinaryStore(),
|
||||
minidata: NewMinidataStore(),
|
||||
semaphore: make(map[string]*Semaphore),
|
||||
erupeConfig: &cfg.Config{
|
||||
RealClientMode: cfg.ZZ,
|
||||
|
||||
Reference in New Issue
Block a user