合并本地领先源码:旧UI、GM疲劳燃烧、白金徽章孔、宠物修复、支援兵普攻开关
This commit is contained in:
1 parent
f2debaf9bf
commit
70b3c5a6dc
57 files changed
+4256
-30
No files matched your search
@@ -5,6 +5,7 @@ import (
|
||||
"crypto/sha256"
|
||||
"encoding/binary"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"os"
|
||||
"sort"
|
||||
"strconv"
|
||||
@@ -369,6 +370,22 @@ func mustProjectionCharacterID(value string) uint64 {
|
||||
return parsed
|
||||
}
|
||||
|
||||
// buildCurrentDungeonCompanionOfflineBody is the exact present=0 projection
|
||||
// body. The client's decoder requires all identity/count fields to be zero,
|
||||
// the body length to be exactly the 72-byte header, and a non-zero revision.
|
||||
// One body clears the whole squad, so the caller sends it once per run.
|
||||
func buildCurrentDungeonCompanionOfflineBody(revision uint64) []byte {
|
||||
if revision == 0 {
|
||||
revision = 1
|
||||
}
|
||||
body := make([]byte, currentDungeonCompanionProjectionHeaderSize)
|
||||
binary.LittleEndian.PutUint32(body[0:4], currentDungeonCompanionProjectionMagic)
|
||||
body[4] = currentDungeonCompanionProjectionVersion
|
||||
body[5] = 0
|
||||
binary.LittleEndian.PutUint64(body[8:16], revision)
|
||||
return body
|
||||
}
|
||||
|
||||
func (s *Service) currentDungeonCompanionProjectionSourceID(
|
||||
ctx context.Context,
|
||||
session *gameSession,
|
||||
@@ -531,6 +548,22 @@ func (s *Service) sendCurrentDungeonCompanionProjection(
|
||||
"private_opcode", currentDungeonCompanionProjectionOpcode,
|
||||
"body_len", len(body),
|
||||
"template_mutation", false)
|
||||
return s.sendGameUpperRawClass(
|
||||
session, currentDungeonCompanionProjectionOpcode, body, 0)
|
||||
if err := s.sendGameUpperRawClass(
|
||||
session, currentDungeonCompanionProjectionOpcode, body, 0); err != nil {
|
||||
return err
|
||||
}
|
||||
// The dungeon is now loaded on the client (projection is sent after op29 and
|
||||
// player placement), so a notice here is visible instead of being swallowed
|
||||
// by the loading screen.
|
||||
if repos.Settings != nil {
|
||||
if snapshot, found := loadCompanionPanelSnapshot(ctx, repos,
|
||||
strconv.FormatUint(uint64(sourceID), 10)); found {
|
||||
_ = s.sendCurrentClientNotice(session,
|
||||
fmt.Sprintf("支援兵面板 HP=%d MP=%d 力量=%d 物攻=%d 物防=%d",
|
||||
snapshot.HPMax, snapshot.MPMax, snapshot.Strength,
|
||||
snapshot.PhysicalAttack, snapshot.PhysicalDefense),
|
||||
currentClientNoticeDefaultColor, "companion-panel-summary")
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
Reference in new issue
Block a user