```
refactor(socket): 移除未使用的网络相关导入和注释掉的 RST 攻击检测逻辑 移除了 `ServerEvent.go` 中未使用的 `net` 和 `strings` 包导入。同时, 将原有的 RST 攻击检测及防护逻辑代码注释掉,便于后续重新设计或彻底删除。 fix(logic): 调整 fight pool 初始化与释放策略 将 `fight/action.go` 中的 `Fightpool` 类型从 `*ants.MultiPool` 改为 `*ants.Pool`,并调整其初始化方式为 `NewPool(-1)` 以适应动态扩容。 此外,在 `main.go` 中将 `ReleaseTimeout` 参数由 100 调整为 0, 确保立即清理超时任务。 feat(fight): 优化战斗输入状态重置逻辑 在 `fight/action.go` 的 `ReadyFight` 方法中提前设置 `GetInputByPlayer(c, false).Finished = true`,避免重复赋值。 同时更新了状态睡眠效果的处理流程,并简化了输入模块的状态缓存机制, 移除了冗余的 `Initeffectcache` 函数调用及相关逻辑。 perf(fight): 动态计算玩家动作等待时间 在 `loop.go` 的 `collectPlayerActions` 方法中, 将固定超时时间替换为基于 `waittime` 的动态等待时间计算公式, 提高响应灵活性。同时修复通道关闭判断条件以增强稳定性。 refactor(fight): 更新技能效果解析和状态持续逻辑 修改 `input.go` 中 `GenSataus` 方法以正确初始化状态数组; 在 `Turn.go` 中重构 `Turn_End` 方法内的执行逻辑, 确保仅在我方后手时增加回合数,提升战斗流程准确性。 chore(service): 删除废弃文件 SocketHandler_Tomee.go 完全移除已弃用的 `SocketHandler_Tomee.go` 文件及其全部内容, 减少项目冗余代码。 ```
This commit is contained in:
@@ -100,33 +100,6 @@ func (h *TomeeHeader) Pack(data any) []byte { //组包
|
||||
|
||||
}
|
||||
|
||||
// var _ Blazingservice = (*TomeeHeader)(nil)
|
||||
|
||||
// type Blazingservice interface {
|
||||
// Ret() []byte
|
||||
// }
|
||||
|
||||
// MergeBytes 将多个字节数组合并为一个
|
||||
func MergeBytes(arrays ...[]byte) []byte {
|
||||
// 计算所有数组的总长度
|
||||
totalLen := 0
|
||||
for _, arr := range arrays {
|
||||
totalLen += len(arr)
|
||||
}
|
||||
|
||||
// 创建结果切片
|
||||
result := make([]byte, totalLen)
|
||||
|
||||
// 逐个复制数组内容
|
||||
currentIndex := 0
|
||||
for _, arr := range arrays {
|
||||
copy(result[currentIndex:], arr)
|
||||
currentIndex += len(arr)
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
// 遍历结构体方法并执行RECV_cmd
|
||||
func (h *ClientData) Recv(data TomeeHeader) {
|
||||
|
||||
Reference in New Issue
Block a user