mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-24 16:43:37 +01:00
refactor(gacha): extract gacha logic into GachaService
Move payment processing, reward selection, stepup state management, and box gacha tracking from handlers into a dedicated service layer. Handlers now delegate to GachaService methods and only handle protocol serialization.
This commit is contained in:
@@ -66,6 +66,11 @@ func ensureAchievementService(s *Server) {
|
||||
s.achievementService = NewAchievementService(s.achievementRepo, s.logger)
|
||||
}
|
||||
|
||||
// ensureGachaService wires the GachaService from the server's current repos.
|
||||
func ensureGachaService(s *Server) {
|
||||
s.gachaService = NewGachaService(s.gachaRepo, s.userRepo, s.charRepo, s.logger, 100000)
|
||||
}
|
||||
|
||||
// createMockSession creates a minimal Session for testing.
|
||||
// Imported from v9.2.x-stable and adapted for main.
|
||||
func createMockSession(charID uint32, server *Server) *Session {
|
||||
|
||||
Reference in New Issue
Block a user