feat sc改名ss
This commit is contained in:
@@ -2,7 +2,7 @@ package ws
|
||||
|
||||
import (
|
||||
"git.hlsq.asia/mmorpg/service-common/log"
|
||||
"git.hlsq.asia/mmorpg/service-common/proto/sc/sc_pb"
|
||||
"git.hlsq.asia/mmorpg/service-common/proto/ss/ss_pb"
|
||||
"google.golang.org/protobuf/proto"
|
||||
"math"
|
||||
"math/rand"
|
||||
@@ -14,14 +14,14 @@ type LoginSuccess struct {
|
||||
}
|
||||
|
||||
func (_ *LoginSuccess) Handle(data []byte, client *Client) {
|
||||
msg := &sc_pb.S2C_LoginSuccess{}
|
||||
msg := &ss_pb.S2C_LoginSuccess{}
|
||||
if err := proto.Unmarshal(data, msg); err != nil {
|
||||
log.Errorf("handle msg error")
|
||||
client.Stop()
|
||||
return
|
||||
}
|
||||
|
||||
_ = client.WriteMessage(sc_pb.MessageID_MESSAGE_ID_ENTER_INSTANCE, &sc_pb.C2S_EnterInstance{
|
||||
_ = client.WriteMessage(ss_pb.MessageID_MESSAGE_ID_ENTER_INSTANCE, &ss_pb.C2S_EnterInstance{
|
||||
InstanceID: msg.InstanceID,
|
||||
})
|
||||
}
|
||||
@@ -30,7 +30,7 @@ type QueueUp struct {
|
||||
}
|
||||
|
||||
func (_ *QueueUp) Handle(data []byte, client *Client) {
|
||||
msg := &sc_pb.S2C_QueueUp{}
|
||||
msg := &ss_pb.S2C_QueueUp{}
|
||||
if err := proto.Unmarshal(data, msg); err != nil {
|
||||
log.Errorf("handle msg error")
|
||||
client.Stop()
|
||||
@@ -42,7 +42,7 @@ type EnterInstance struct {
|
||||
}
|
||||
|
||||
func (_ *EnterInstance) Handle(data []byte, client *Client) {
|
||||
msg := &sc_pb.S2C_EnterInstance{}
|
||||
msg := &ss_pb.S2C_EnterInstance{}
|
||||
if err := proto.Unmarshal(data, msg); err != nil {
|
||||
log.Errorf("handle msg error")
|
||||
client.Stop()
|
||||
@@ -65,10 +65,10 @@ func (_ *EnterInstance) Handle(data []byte, client *Client) {
|
||||
go func() {
|
||||
for {
|
||||
x, y := randDir()
|
||||
_ = client.WriteMessage(sc_pb.MessageID_MESSAGE_ID_ACTION, &sc_pb.C2S_Action{
|
||||
_ = client.WriteMessage(ss_pb.MessageID_MESSAGE_ID_ACTION, &ss_pb.C2S_Action{
|
||||
Sequence: 0,
|
||||
Timestamp: 0,
|
||||
Action: sc_pb.ActionID_ACTION_ID_MOVE,
|
||||
Action: ss_pb.ActionID_ACTION_ID_MOVE,
|
||||
DirX: int32(x * 100),
|
||||
DirY: int32(y * 100),
|
||||
SkillID: 0,
|
||||
@@ -80,7 +80,7 @@ func (_ *EnterInstance) Handle(data []byte, client *Client) {
|
||||
|
||||
var s2cPositionPool = sync.Pool{
|
||||
New: func() interface{} {
|
||||
return &sc_pb.Message{}
|
||||
return &ss_pb.Message{}
|
||||
},
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ type Position struct {
|
||||
}
|
||||
|
||||
func (_ *Position) Handle(data []byte, client *Client) {
|
||||
//msg := s2cPositionPool.Get().(*sc_pb.Message)
|
||||
//msg := s2cPositionPool.Get().(*ss_pb.Message)
|
||||
//if err := proto.Unmarshal(data, msg); err != nil {
|
||||
// log.Errorf("handle msg error")
|
||||
// client.Stop()
|
||||
|
||||
Reference in New Issue
Block a user