DNF90 服务端与启动器完整源码(含 GM 工具功能增强)

服务端(Go):
- GM 塞背包/带属性装备发放:在线角色推送 op14 增量物品行,背包实时刷新,无需回角色选择界面
- GM 改金币/改等级:去掉在线拒绝,落库后推送 op14 钱包/op37 等级状态,在线实时刷新
- 等级端点统一切换到新版 GMSetCharacterLevel(自带在线刷新)
- 无限/锁死疲劳模式 + 燃烧疲劳:每房间消耗 2 点、打怪与通关经验双倍
- 燃烧疲劳开关时给所有在线角色推送系统提示(op12 mode 0)
- 深渊史诗掉率:GM 全局倍率 + 城镇增益药剂窗口倍率,真实接入掉落结算

启动器(Python/JS):
- 标题栏自绘、窗口 1204x717、禁止拖拽改大小、仅最小化/关闭
- GM 工具:疲劳与燃烧、深渊史诗掉率、拍卖行上架(单一定价对齐)
- 拍卖行上架前端对齐服务端单一价格语义,修复 400 报错
This commit is contained in:
hanfuit committed 2026-11-04 14:31:55 +08:00
commit 645b64fe21
4388 files changed
+1405457

No files matched your search

@@ -0,0 +1,162 @@
package sqlite
import (
"context"
"longheng.io/server/internal/modules/dnf/repository"
)
type unitOfWork struct{ component *Component }
func (u *unitOfWork) WithinCharacterCreation(ctx context.Context, characterID string, _ repository.Group, apply func(repository.Group) error) error {
return u.component.mutateSync(ctx, func(group repository.Group) error {
return group.CharacterCreate.WithinCharacterCreation(ctx, characterID, group, apply)
})
}
func (u *unitOfWork) WithinRaidEntryCost(ctx context.Context, characterIDs []string, apply func(repository.InventoryRepository) error) error {
return u.component.mutateSync(ctx, func(group repository.Group) error {
return group.RaidEntryCost.WithinRaidEntryCost(ctx, characterIDs, apply)
})
}
func (u *unitOfWork) WithinRaidRewards(ctx context.Context, characterIDs []string, receipt string, apply func(repository.InventoryRepository, repository.SettingsRepository) error) error {
return u.component.mutateSync(ctx, func(group repository.Group) error {
return group.RaidRewards.WithinRaidRewards(ctx, characterIDs, receipt, apply)
})
}
func (u *unitOfWork) WithinCharacterItems(ctx context.Context, characterID string, apply func(repository.InventoryRepository, repository.EquipmentRepository) error) error {
return u.component.mutateSync(ctx, func(group repository.Group) error {
return group.CharacterItems.WithinCharacterItems(ctx, characterID, apply)
})
}
func (u *unitOfWork) WithinCharacterItemsScoped(ctx context.Context, characterID string, apply func(repository.InventoryRepository, repository.EquipmentRepository) error) error {
return u.component.mutateCharacterItemsScopedSync(ctx, characterID, apply)
}
func (u *unitOfWork) WithinCharacterTrade(ctx context.Context, firstID, secondID string, apply func(repository.CharacterRepository, repository.InventoryRepository) error) error {
return u.component.mutateSync(ctx, func(group repository.Group) error {
return group.CharacterTrade.WithinCharacterTrade(ctx, firstID, secondID, apply)
})
}
func (u *unitOfWork) WithinAccountCharacterTrade(ctx context.Context, accountID, firstID, secondID string, apply func(repository.AccountInventoryRepository, repository.CharacterRepository, repository.InventoryRepository, repository.EpicBookRepository, repository.PetRepository) error) error {
return u.component.mutateSync(ctx, func(group repository.Group) error {
return group.AccountCharacterTrade.WithinAccountCharacterTrade(ctx, accountID, firstID, secondID, apply)
})
}
func (u *unitOfWork) WithinAccountPairCharacterTrade(ctx context.Context, firstAccountID, secondAccountID, firstID, secondID string, apply func(repository.AccountInventoryRepository, repository.CharacterRepository, repository.InventoryRepository) error) error {
return u.component.mutateSync(ctx, func(group repository.Group) error {
if group.AccountPairTrade == nil {
return repository.ErrAccountCharacterTradeTransactionUnavailable
}
return group.AccountPairTrade.WithinAccountPairCharacterTrade(ctx, firstAccountID, secondAccountID, firstID, secondID, apply)
})
}
func (u *unitOfWork) WithinCharacterPets(ctx context.Context, characterID string, apply func(repository.InventoryRepository, repository.EquipmentRepository, repository.PetRepository) error) error {
return u.component.mutateSync(ctx, func(group repository.Group) error {
return group.CharacterPets.WithinCharacterPets(ctx, characterID, apply)
})
}
func (u *unitOfWork) WithinCharacterPetsScoped(ctx context.Context, characterID string, apply func(repository.InventoryRepository, repository.EquipmentRepository, repository.PetRepository) error) error {
return u.component.mutateCharacterPetsScopedSync(ctx, characterID, apply)
}
func (u *unitOfWork) WithinAccountCharacterItems(ctx context.Context, accountID, characterID string, apply func(repository.AccountInventoryRepository, repository.InventoryRepository) error) error {
return u.component.mutateSync(ctx, func(group repository.Group) error {
return group.AccountItems.WithinAccountCharacterItems(ctx, accountID, characterID, apply)
})
}
func (u *unitOfWork) WithinCharacterAssets(ctx context.Context, characterID string, apply func(repository.CharacterRepository, repository.InventoryRepository, repository.EquipmentRepository) error) error {
return u.component.mutateSync(ctx, func(group repository.Group) error {
return group.CharacterAssets.WithinCharacterAssets(ctx, characterID, apply)
})
}
func (u *unitOfWork) WithinCharacterAssetsScoped(ctx context.Context, characterID string, apply func(repository.CharacterRepository, repository.InventoryRepository, repository.EquipmentRepository) error) error {
return u.component.mutateCharacterAssetsSync(ctx, characterID, apply)
}
func (u *unitOfWork) WithinMailboxAssets(ctx context.Context, characterID, mailboxID string, apply func(repository.AccountRepository, repository.AccountInventoryRepository, repository.CharacterRepository, repository.InventoryRepository, repository.MailboxRepository) error) error {
return u.component.mutateSync(ctx, func(group repository.Group) error {
return group.MailboxAssets.WithinMailboxAssets(ctx, characterID, mailboxID, apply)
})
}
func (u *unitOfWork) WithinMailboxClaimAssets(ctx context.Context, characterID, mailboxID string, apply func(repository.AccountRepository, repository.AccountInventoryRepository, repository.CharacterRepository, repository.InventoryRepository, repository.MailboxRepository, repository.EpicBookRepository) error) error {
return u.component.mutateSync(ctx, func(group repository.Group) error {
claimAssets, ok := group.MailboxAssets.(repository.MailboxClaimAssetUnitOfWork)
if !ok {
return repository.ErrMailboxAssetTransactionUnavailable
}
return claimAssets.WithinMailboxClaimAssets(ctx, characterID, mailboxID, apply)
})
}
func (u *unitOfWork) WithinAccountCharacterAssets(ctx context.Context, accountID, characterID string, apply func(repository.AccountInventoryRepository, repository.CharacterRepository, repository.InventoryRepository, repository.EquipmentRepository) error) error {
return u.component.mutateSync(ctx, func(group repository.Group) error {
return group.AccountAssets.WithinAccountCharacterAssets(ctx, accountID, characterID, apply)
})
}
func (u *unitOfWork) WithinShopPurchaseAssets(ctx context.Context, accountID, characterID string, apply func(repository.AccountRepository, repository.AccountInventoryRepository, repository.CharacterRepository, repository.InventoryRepository) error) error {
return u.component.mutateSync(ctx, func(group repository.Group) error {
shop, ok := group.AccountAssets.(repository.ShopPurchaseAssetUnitOfWork)
if !ok {
return repository.ErrShopPurchaseAssetTransactionUnavailable
}
return shop.WithinShopPurchaseAssets(ctx, accountID, characterID, apply)
})
}
func (u *unitOfWork) WithinBoosterAssets(ctx context.Context, accountID, characterID string, apply func(repository.AccountRepository, repository.AccountInventoryRepository, repository.CharacterRepository, repository.InventoryRepository, repository.EquipmentRepository, repository.EpicBookRepository) error) error {
return u.component.mutateSync(ctx, func(group repository.Group) error {
return group.BoosterAssets.WithinBoosterAssets(ctx, accountID, characterID, apply)
})
}
func (u *unitOfWork) WithinRentalAssets(ctx context.Context, accountID, characterID string, apply func(repository.AccountRepository, repository.CharacterRepository, repository.InventoryRepository, repository.EquipmentRepository) error) error {
return u.component.mutateSync(ctx, func(group repository.Group) error {
return group.RentalAssets.WithinRentalAssets(ctx, accountID, characterID, apply)
})
}
func (u *unitOfWork) WithinRentalAssetsScoped(ctx context.Context, accountID, characterID string, apply func(repository.AccountRepository, repository.CharacterRepository, repository.InventoryRepository, repository.EquipmentRepository) error) error {
return u.component.mutateRentalAssetsScopedSync(ctx, accountID, characterID, apply)
}
func (u *unitOfWork) WithinCeraShopAssets(ctx context.Context, accountID, characterID, settingsScope string, apply func(repository.AccountRepository, repository.AccountInventoryRepository, repository.CharacterRepository, repository.InventoryRepository, repository.EquipmentRepository, repository.SettingsRepository) error) error {
return u.component.mutateSync(ctx, func(group repository.Group) error {
return group.CeraShopAssets.WithinCeraShopAssets(ctx, accountID, characterID, settingsScope, apply)
})
}
func (u *unitOfWork) WithinCharacterSkill(ctx context.Context, characterID string, apply func(repository.SkillRepository) error) error {
return u.component.mutateSync(ctx, func(group repository.Group) error {
return group.CharacterSkills.WithinCharacterSkill(ctx, characterID, apply)
})
}
func (u *unitOfWork) WithinCharacterProgression(ctx context.Context, characterID string, apply func(repository.CharacterRepository, repository.SkillRepository) error) error {
return u.component.mutateSync(ctx, func(group repository.Group) error {
return group.CharacterProgression.WithinCharacterProgression(ctx, characterID, apply)
})
}
func (u *unitOfWork) WithinCharacterSettlement(ctx context.Context, characterID string, apply func(repository.Group) error) error {
return u.component.mutateSync(ctx, func(group repository.Group) error {
return group.CharacterSettlement.WithinCharacterSettlement(ctx, characterID, apply)
})
}
func (u *unitOfWork) WithinEpicBookCraft(ctx context.Context, accountID, characterID string, apply func(repository.EpicBookRepository, repository.AccountInventoryRepository, repository.InventoryRepository, repository.EquipmentRepository) error) error {
return u.component.mutateSync(ctx, func(group repository.Group) error {
return group.EpicBookCraft.WithinEpicBookCraft(ctx, accountID, characterID, apply)
})
}