refactor(socket): 重构 ClientData 结构体并优化相关逻辑
- 简化 ClientData 结构体,移除不必要的方法 - 优化 Player 结构体,调整 Conn 类型 - 更新 wscodec.go 中的 Conn 结构体 - 删除未使用的 XML 相关文件和代码 - 调整 ServerEvent 和 controller 中的相关逻辑
This commit is contained in:
23
common/data/xmlres/talk.go
Normal file
23
common/data/xmlres/talk.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package xmlres
|
||||
|
||||
import (
|
||||
"github.com/ECUST-XX/xml" // 注意:需确保该xml库与示例中使用的一致
|
||||
)
|
||||
|
||||
// TalkCount 根节点,对应<talk_count>标签
|
||||
// 注意:xml.Name需指定命名空间,与XML中的xmlns保持一致
|
||||
type TalkCount struct {
|
||||
XMLName xml.Name `xml:"nieo.seer.org.talk-count talk_count"`
|
||||
Entries []TalkEntry `xml:"entry"` // 包含所有entry节点
|
||||
}
|
||||
|
||||
// Entry 单个条目配置,对应<entry>标签
|
||||
type TalkEntry struct {
|
||||
ID int `xml:"id,attr"` // 条目ID
|
||||
ItemID int `xml:"item_id,attr"` // 物品ID
|
||||
ItemMinCount int `xml:"item_min_count,attr"` // 物品最小数量
|
||||
ItemMaxCount int `xml:"item_max_count,attr"` // 物品最大数量
|
||||
Desc string `xml:"desc,attr"` // 描述信息
|
||||
Count int `xml:"count,attr"` // 计数
|
||||
Policy string `xml:"policy,attr,omitempty"` // 策略(可选,如week)
|
||||
}
|
||||
Reference in New Issue
Block a user