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

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

37 lines
1.5 KiB
C++

#pragma once
#include <stddef.h>
#include <stdint.h>
namespace dnf90_premium_clock {
constexpr size_t kNativeBodySize = 77; // success:u8, action:u16, blob74
constexpr size_t kServerHeaderSize = 16;
constexpr size_t kClockTrailerSize = 8;
constexpr size_t kPacketSize = kServerHeaderSize + kNativeBodySize + kClockTrailerSize;
inline uint32_t ReadU32(const unsigned char* bytes) {
return uint32_t(bytes[0]) | (uint32_t(bytes[1]) << 8) |
(uint32_t(bytes[2]) << 16) | (uint32_t(bytes[3]) << 24);
}
// Only our exact marked server16/class1/op903 action1 packet is eligible.
// The unchanged native prefix remains owned by the original handler.
inline bool Decode(const unsigned char* bytes, size_t available, int* serverUnix) {
if (!bytes || !serverUnix || available < kPacketSize ||
bytes[0] != 1 || bytes[1] != 0x87 || bytes[2] != 3 ||
ReadU32(bytes + 3) != kPacketSize ||
bytes[16] != 1 || bytes[17] != 1 || bytes[18] != 0) return false;
const unsigned char* trailer = bytes + kServerHeaderSize + kNativeBodySize;
if (trailer[0] != 'T' || trailer[1] != 'I' ||
trailer[2] != 'M' || trailer[3] != 'E') return false;
uint32_t timestamp = ReadU32(trailer + 4);
// The native clock uses signed time32. Refuse zero, wrapped and out-of-era
// timestamps rather than writing arbitrary values to native globals.
if (timestamp < 946684800u || timestamp > 0x7fffffffu) return false;
*serverUnix = static_cast<int>(timestamp);
return true;
}
} // namespace dnf90_premium_clock