|
@@ -4,6 +4,7 @@ import (
|
|
"fmt"
|
|
"fmt"
|
|
"os"
|
|
"os"
|
|
"reflect"
|
|
"reflect"
|
|
|
|
+ "server/tools"
|
|
"strings"
|
|
"strings"
|
|
|
|
|
|
"github.com/name5566/leaf/log"
|
|
"github.com/name5566/leaf/log"
|
|
@@ -22,11 +23,22 @@ var msgList []MsgInfo
|
|
func init() {
|
|
func init() {
|
|
Processor.Register(&ReqLogin{})
|
|
Processor.Register(&ReqLogin{})
|
|
Processor.Register(&ResLogin{})
|
|
Processor.Register(&ResLogin{})
|
|
|
|
+ Processor.Register(&ReqRegister{})
|
|
|
|
+ Processor.Register(&ResRegister{})
|
|
Processor.Register(&EnterHall{})
|
|
Processor.Register(&EnterHall{})
|
|
|
|
+ Processor.Register(&ResEnterHall{})
|
|
Processor.Register(&LeaveHall{})
|
|
Processor.Register(&LeaveHall{})
|
|
- Processor.Register(&MatchLudo{})
|
|
|
|
Processor.Register(&ResHeartBeat{})
|
|
Processor.Register(&ResHeartBeat{})
|
|
Processor.Register(&ReqHeartBeat{})
|
|
Processor.Register(&ReqHeartBeat{})
|
|
|
|
+ Processor.Register(&SendColorSz{})
|
|
|
|
+ Processor.Register(&SendRoleMove{})
|
|
|
|
+ Processor.Register(&NotifyPlayerSzNumber{})
|
|
|
|
+ Processor.Register(&NotifyPlayerMove{})
|
|
|
|
+ Processor.Register(&NotifyPlayerOpt{})
|
|
|
|
+ Processor.Register(&NotifyPlayerStatus{})
|
|
|
|
+ Processor.Register(&NotifySettlement{})
|
|
|
|
+ Processor.Register(&MatchLudo{})
|
|
|
|
+ Processor.Register(&ResMatchLudo{})
|
|
Processor.Range(func(id uint16, t reflect.Type) {
|
|
Processor.Range(func(id uint16, t reflect.Type) {
|
|
log.Debug("消息ID: %d, 消息类型: %s\n", id, t.Elem().Name())
|
|
log.Debug("消息ID: %d, 消息类型: %s\n", id, t.Elem().Name())
|
|
msgList = append(msgList, MsgInfo{
|
|
msgList = append(msgList, MsgInfo{
|
|
@@ -49,8 +61,11 @@ func generateTSCode() {
|
|
|
|
|
|
tsCode.WriteString("}\n")
|
|
tsCode.WriteString("}\n")
|
|
|
|
|
|
- var path = "/home/zjh/teen_patti/bin/client_msg/msg.ts"
|
|
|
|
- path = "/Users/xy/Desktop/ludo_server/bin/client_msg/msg.ts"
|
|
|
|
|
|
+ var path = "/home/ludo_server/bin/client_msg/msg.ts"
|
|
|
|
+ if tools.IsDebug {
|
|
|
|
+ path = "/Users/xy/Desktop/ludo_server/bin/client_msg/msg.ts"
|
|
|
|
+ }
|
|
|
|
+
|
|
// 写入文件
|
|
// 写入文件
|
|
err := os.WriteFile(path, []byte(tsCode.String()), 0644)
|
|
err := os.WriteFile(path, []byte(tsCode.String()), 0644)
|
|
if err != nil {
|
|
if err != nil {
|