DNF90 服务端与启动器完整源码(含 GM 工具功能增强)
服务端(Go): - GM 塞背包/带属性装备发放:在线角色推送 op14 增量物品行,背包实时刷新,无需回角色选择界面 - GM 改金币/改等级:去掉在线拒绝,落库后推送 op14 钱包/op37 等级状态,在线实时刷新 - 等级端点统一切换到新版 GMSetCharacterLevel(自带在线刷新) - 无限/锁死疲劳模式 + 燃烧疲劳:每房间消耗 2 点、打怪与通关经验双倍 - 燃烧疲劳开关时给所有在线角色推送系统提示(op12 mode 0) - 深渊史诗掉率:GM 全局倍率 + 城镇增益药剂窗口倍率,真实接入掉落结算 启动器(Python/JS): - 标题栏自绘、窗口 1204x717、禁止拖拽改大小、仅最小化/关闭 - GM 工具:疲劳与燃烧、深渊史诗掉率、拍卖行上架(单一定价对齐) - 拍卖行上架前端对齐服务端单一价格语义,修复 400 报错
This commit is contained in:
commit
645b64fe21
4388 files changed
+1405457
No files matched your search
@@ -0,0 +1,77 @@
|
||||
package dnfbridge
|
||||
|
||||
import (
|
||||
"longheng.io/server/internal/modules/dnf/alignedcmd"
|
||||
)
|
||||
|
||||
// leaveRuntimePartyOnAbandonedDungeonExit removes the character from its party
|
||||
// when it abandons a dungeon run, per the operator's rule: a member who force
|
||||
// quits while the party still has other members leaves the party; the last
|
||||
// remaining member stays. A one-member party is left untouched because leaving
|
||||
// it is indistinguishable from staying and would only churn the client window.
|
||||
//
|
||||
// Only an abandoned run reaches this. A completed clear returns to town through
|
||||
// its own settlement route and must keep the party together for the next run.
|
||||
//
|
||||
// This is the non-party-dungeon half of the rule. A run that was admitted as a
|
||||
// shared party dungeon owns a runtimePartyDungeonOwner, and
|
||||
// detachRuntimePartyDungeonMemberForTownReturn already removes the returning
|
||||
// member from both the central party and that shared roster under the owner's
|
||||
// world lock. A member that entered alone while its town party stayed behind
|
||||
// has no owner at all, so nothing removed it and the abandoned run left the
|
||||
// quitter still rostered - which is what this closes. The two are mutually
|
||||
// exclusive at the single abandon boundary in sendCurrentActiveDungeonReturnToTown.
|
||||
func (s *Service) leaveRuntimePartyOnAbandonedDungeonExit(
|
||||
session *gameSession,
|
||||
previousState alignedcmd.PartyState,
|
||||
source string,
|
||||
) error {
|
||||
if s == nil || session == nil {
|
||||
return nil
|
||||
}
|
||||
sourceID := selectedCharacterID(session)
|
||||
if sourceID == 0 {
|
||||
return nil
|
||||
}
|
||||
if previousState.PartyID <= 0 {
|
||||
previousState = runtimePartyStateSnapshot(session)
|
||||
}
|
||||
members := runtimePartyMembers(previousState)
|
||||
if previousState.PartyID <= 0 || len(members) < 2 {
|
||||
return nil
|
||||
}
|
||||
identity, bound := s.boundGameSessionCharacterSnapshot(session)
|
||||
if !bound {
|
||||
return nil
|
||||
}
|
||||
nextState, result, removed := s.leaveManagedRuntimeParty(identity)
|
||||
if !removed {
|
||||
// The manager no longer holds this member, but its client cache still
|
||||
// shows the room. Clearing the projection and publishing the empty
|
||||
// window is idempotent and restores solo dungeon permission, exactly as
|
||||
// the native op13 leave handler does for the same state.
|
||||
s.clearRuntimePartyProjection(identity.character, identity.generation)
|
||||
s.logGameEvent(session, "game-party-forced-dungeon-exit-leave-skipped",
|
||||
"char_id", sourceID,
|
||||
"party_id", previousState.PartyID,
|
||||
"source", source,
|
||||
"reason", result.Reason)
|
||||
return s.sendRuntimePartyMemberRemoved(session, uint16(previousState.PartyID), alignedcmd.PartyState{})
|
||||
}
|
||||
s.logGameEvent(session, "game-party-forced-dungeon-exit-left",
|
||||
"char_id", sourceID,
|
||||
"party_id", previousState.PartyID,
|
||||
"member_count", len(members),
|
||||
"remaining_party_id", nextState.PartyID,
|
||||
"source", source,
|
||||
"reason", "abandoned_dungeon_run_leaves_a_party_that_still_has_other_members")
|
||||
if err := s.sendRuntimePartyMemberRemoved(session, uint16(previousState.PartyID), nextState); err != nil {
|
||||
return err
|
||||
}
|
||||
if nextState.PartyID > 0 {
|
||||
s.syncRuntimePartyUDPRelay(nextState)
|
||||
} else {
|
||||
s.closeRuntimePartyUDPRelay(previousState.PartyID)
|
||||
}
|
||||
return s.broadcastRuntimePartyMemberRemoved(session, previousState, nextState, sourceID, session)
|
||||
}
|
||||
Reference in new issue
Block a user