服务端(Go): - GM 塞背包/带属性装备发放:在线角色推送 op14 增量物品行,背包实时刷新,无需回角色选择界面 - GM 改金币/改等级:去掉在线拒绝,落库后推送 op14 钱包/op37 等级状态,在线实时刷新 - 等级端点统一切换到新版 GMSetCharacterLevel(自带在线刷新) - 无限/锁死疲劳模式 + 燃烧疲劳:每房间消耗 2 点、打怪与通关经验双倍 - 燃烧疲劳开关时给所有在线角色推送系统提示(op12 mode 0) - 深渊史诗掉率:GM 全局倍率 + 城镇增益药剂窗口倍率,真实接入掉落结算 启动器(Python/JS): - 标题栏自绘、窗口 1204x717、禁止拖拽改大小、仅最小化/关闭 - GM 工具:疲劳与燃烧、深渊史诗掉率、拍卖行上架(单一定价对齐) - 拍卖行上架前端对齐服务端单一价格语义,修复 400 报错
69 lines
2.3 KiB
Go
69 lines
2.3 KiB
Go
package dnfbridge
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
|
|
"longheng.io/server/internal/modules/dnf/dnfenum"
|
|
)
|
|
|
|
// staleWriteConn stands in for a socket that a previous session generation
|
|
// already closed. Every write fails exactly the way a closed TCPConn fails:
|
|
//
|
|
// set tcp 10.1.0.16:10023: use of closed network connection
|
|
//
|
|
// which is the error recorded live at 2026-09-25 06:02:14Z for port 10023 (the
|
|
// channel-23 socket of the 05:24 raid generation, closed at 05:37:50).
|
|
type staleWriteConn struct {
|
|
bufferConn
|
|
}
|
|
|
|
func (c *staleWriteConn) Write(_ []byte) (int, error) {
|
|
return 0, fmt.Errorf("set tcp 10.1.0.16:10023: use of closed network connection")
|
|
}
|
|
|
|
// TestWalkoutPartyMemberSurvivesADeadMemberSocket pins the live incident.
|
|
//
|
|
// A leader who kicks a member whose own socket is already gone must keep his own
|
|
// connection. The party fan-out used to return the MEMBER's write error to the
|
|
// KICKER's handler; game_session_events.go treats such an error as fatal and
|
|
// calls session.conn.Close(), so the kicker was disconnected with
|
|
// 「网络连接中断」 (2026-09-25 06:02:14Z, leader 1111 / game-002957; char 9 at
|
|
// 06:02:33 and char 36 at 06:04:26 were lost the same way).
|
|
//
|
|
// This test deliberately uses only long-standing symbols so the same body can be
|
|
// compiled against the pre-fix tree to prove it is a real regression test.
|
|
func TestWalkoutPartyMemberSurvivesADeadMemberSocket(t *testing.T) {
|
|
service, leader, sessions := newForcedExitLeaveTestParty(t, 3)
|
|
victim := sessions[1]
|
|
|
|
state := runtimePartyStateSnapshot(leader)
|
|
victimSlot := byte(0)
|
|
found := false
|
|
for _, member := range state.Members {
|
|
if member.UserID == victim.selectedCharacterID {
|
|
victimSlot = member.Slot
|
|
found = true
|
|
}
|
|
}
|
|
if !found {
|
|
t.Fatalf("victim %d is not in the party roster: %+v", victim.selectedCharacterID, state.Members)
|
|
}
|
|
|
|
// The kicked member's socket is already closed before the kick is processed.
|
|
victim.conn = &staleWriteConn{}
|
|
leader.conn.(*bufferConn).write.Reset()
|
|
|
|
err := service.handleOnlineWalkoutPartyMember(
|
|
leader,
|
|
uint16(dnfenum.CmdPacketWalkoutPartyMember),
|
|
[]byte{victimSlot},
|
|
)
|
|
if err != nil {
|
|
t.Fatalf("a dead member socket became the kicker's own failure: %v", err)
|
|
}
|
|
if leader.conn.(*bufferConn).write.Len() == 0 {
|
|
t.Fatal("the kicker never received its op14 acknowledgement")
|
|
}
|
|
}
|