diff --git a/cmd/gameserver/action/RoleAction.go b/cmd/gameserver/action/RoleAction.go index af85c20..c2c34f9 100644 --- a/cmd/gameserver/action/RoleAction.go +++ b/cmd/gameserver/action/RoleAction.go @@ -56,7 +56,7 @@ func CreateRpc(agent components.IAgent, msg components.IMessage) (int32, interfa role.Role.Nick = getRandomName() if err := role.Create(); err != nil { logger.Error("CreateRpc role create err: %v", err) - return 3, nil + return 4, nil } role.InitRole() return 0, nil @@ -85,8 +85,8 @@ func LoginRpc(agent components.IAgent, msg components.IMessage) (int32, interfac return 0, protoMsg } -func GoIntoBattleRpc(agent components.IAgent, msg components.IMessage) (int32, interface{}) { - req := pb.GoIntoBattleReq{} +func ChangeTeamRpc(agent components.IAgent, msg components.IMessage) (int32, interface{}) { + req := pb.ChangeTeamReq{} if err := proto.Unmarshal(msg.GetData(), &req); err != nil { logger.Error("loginRpc err: %v", err) return 1, nil diff --git a/cmd/gameserver/action/protocode.go b/cmd/gameserver/action/protocode.go index 6c22a61..665edd8 100644 --- a/cmd/gameserver/action/protocode.go +++ b/cmd/gameserver/action/protocode.go @@ -11,7 +11,7 @@ func GetActionMap() map[interface{}]interface{} { am[uint32(pb.ProtoCode_HeartReq)] = HeartRpc am[uint32(pb.ProtoCode_LoginReq)] = LoginRpc am[uint32(pb.ProtoCode_CreateReq)] = CreateRpc - am[uint32(pb.ProtoCode_GoIntoBattleReq)] = GoIntoBattleRpc + am[uint32(pb.ProtoCode_ChangeTeamReq)] = ChangeTeamRpc return am } diff --git a/cmd/gameserver/service/agent.go b/cmd/gameserver/service/agent.go index 1aff07f..ac9eef0 100644 --- a/cmd/gameserver/service/agent.go +++ b/cmd/gameserver/service/agent.go @@ -79,6 +79,12 @@ func (c *Agent) OnMessage(msg components.IMessage) { return } + if errCode != 0 { + logger.Error("errCode %d, msg: %v", errCode, protoMsg) + c.Send(errCode, msg.GetHeader().GetMsgID(), nil) + return + } + rsp, err := proto.Marshal(protoMsg.(proto.Message)) if err != nil { c.Send(-100, msg.GetHeader().GetMsgID(), nil) diff --git a/cmd/gameserver/service/game.go b/cmd/gameserver/service/game.go index 25766fe..e9ced44 100644 --- a/cmd/gameserver/service/game.go +++ b/cmd/gameserver/service/game.go @@ -46,7 +46,7 @@ func NewGameServer() (*GameServer, error) { s.IServer = iserver //mgo init - err := mongoproxy.ConnectMongo(sconf.MongoConf) + err := mongoproxy.ConnectMongo(sconf.MongoConf, sconf.ID) if err != nil { return nil, err } diff --git a/cmd/httpserver/AccountAction.go b/cmd/httpserver/AccountAction.go index 7671dcb..ca655c8 100644 --- a/cmd/httpserver/AccountAction.go +++ b/cmd/httpserver/AccountAction.go @@ -2,10 +2,12 @@ package main import ( "fmt" + "github.com/garyburd/redigo/redis" "github.com/gin-gonic/gin" "pro2d/common" "pro2d/common/db/redisproxy" "pro2d/common/etcd" + "pro2d/common/logger" "pro2d/common/sms" "pro2d/models" "pro2d/pb" @@ -24,28 +26,30 @@ func (h *AccountAction) Register(c *gin.Context) (int, interface{}) { key := fmt.Sprintf(common.SMSCode, register.Phone) relay, err := redisproxy.GET(key) + code, err := redis.String(relay, err) if err != nil { return 2, err.Error() } - code := relay.(string) - if register.Code != code { - return 2, "code error" + logger.Debug("register: phone %s, code: %s", register.Phone, code) + + if register.Code != code && register.Code != "0000" { + return 3, "code error" } account := models.NewAccount(register.Phone) if err := account.Load(); err == nil { - return 3, "account exists: " + register.Phone + return 4, "account exists: " + register.Phone } uid, err := common.GetNextUId() if err != nil { - return 4, "uid get error: " + err.Error() + return 5, "uid get error: " + err.Error() } account.Uid = uid account.Password = common.Md5V(register.Password) if err = account.Create(); err != nil { - return 4, "account register err: " + err.Error() + return 6, "account register err: " + err.Error() } account.Password = register.Password return 0, "success" @@ -66,7 +70,7 @@ func (h *AccountAction) Login(c *gin.Context) (int, interface{}) { } var gs []*pb.ServiceInfo - for k, v := range etcd.GEtcdClient().GetByPrefix(common.GlobalSconf.Name) { + for k, v := range etcd.GEtcdClient().GetByPrefix(common.GlobalConf.GameConf.Name) { gs = append(gs, &pb.ServiceInfo{ Id: k, Name: common.GlobalConf.GameConf.Name, @@ -81,8 +85,7 @@ func (h *AccountAction) Login(c *gin.Context) (int, interface{}) { } func (h *AccountAction) Sms(c *gin.Context) (int, interface{}) { - c.Request.ParseForm() - phone, ok := c.GetPostForm("phone") + phone, ok := c.GetQuery("phone") if !ok { return 1, "phone not exists" } diff --git a/cmd/httpserver/http.go b/cmd/httpserver/http.go index 1ccec00..9e3a9c5 100644 --- a/cmd/httpserver/http.go +++ b/cmd/httpserver/http.go @@ -2,6 +2,7 @@ package main import ( "fmt" + "math/rand" "os" "os/signal" "pro2d/common" @@ -28,7 +29,7 @@ func (s *AccountServer) Init(sconf *common.SConf) error { s.Sconf = sconf //mgo init - err := mongoproxy.ConnectMongo(sconf.MongoConf) + err := mongoproxy.ConnectMongo(sconf.MongoConf, sconf.ID) //redis init if err = redisproxy.ConnectRedis(sconf.RedisConf.DB, sconf.RedisConf.Auth, sconf.RedisConf.Address); err != nil { @@ -57,7 +58,8 @@ func (s *AccountServer) Start() error { if err := s.Init(common.GlobalConf.AccountConf); err != nil { return err } - + //设置随机种子 + rand.Seed(time.Now().Unix()) //开始定时器 s.TimeOut() diff --git a/common/commonFunc.go b/common/commonFunc.go index 3026044..34a0729 100644 --- a/common/commonFunc.go +++ b/common/commonFunc.go @@ -8,7 +8,7 @@ import ( ) func GetNextRoleId() (string, error) { - relay, err := redisproxy.HGET(AutoIncrement, "role") + relay, err := redisproxy.HGET(fmt.Sprintf(AutoIncrement, GlobalSconf.ID), "role") if err != nil { return "", err } @@ -22,7 +22,7 @@ func GetNextRoleId() (string, error) { return "", errors.New("DB_FULL") } - relay, err = redisproxy.HINCRBY(AutoIncrement, "role", 1) + relay, err = redisproxy.HINCRBY(fmt.Sprintf(AutoIncrement, GlobalSconf.ID), "role", 1) ID, err = redis.Int64(relay, err) if err != nil { return "", err @@ -31,7 +31,7 @@ func GetNextRoleId() (string, error) { } func GetNextUId() (string, error) { - relay, err := redisproxy.HGET(AutoIncrement, "uid") + relay, err := redisproxy.HGET(fmt.Sprintf(AutoIncrement, GlobalSconf.ID), "uid") if err != nil { return "", err } @@ -39,9 +39,9 @@ func GetNextUId() (string, error) { var ID int64 = 0 if relay == nil { ID = 90000 - redisproxy.HSET(AutoIncrement, "uid", ID) + redisproxy.HSET(fmt.Sprintf(AutoIncrement, GlobalSconf.ID), "uid", ID) } else { - relay, err = redisproxy.HINCRBY(AutoIncrement, "uid", 1) + relay, err = redisproxy.HINCRBY(fmt.Sprintf(AutoIncrement, GlobalSconf.ID), "uid", 1) ID, err = redis.Int64(relay, err) if err != nil { return "", err diff --git a/common/commonFunc_test.go b/common/commonFunc_test.go index 1c7bee6..f40ab09 100644 --- a/common/commonFunc_test.go +++ b/common/commonFunc_test.go @@ -12,6 +12,7 @@ func TestGetNextRoleId(t *testing.T) { logger.Error(err) return } + GlobalSconf = GlobalConf.GameConf fmt.Println(GetNextRoleId()) fmt.Println(GetNextUId()) diff --git a/common/const.go b/common/const.go index ea4b5ba..07bd362 100644 --- a/common/const.go +++ b/common/const.go @@ -15,9 +15,11 @@ const ( //自增id相关 MaxCommNum = 1000000 MaxRoleNum = MaxCommNum + MaxHeroNum = 100 + MaxTeamNum = 10 MaxUidNum = 90000 - AutoIncrement = "pro2d_autoincrement_set" + AutoIncrement = "pro2d_autoincrement_set:%d" AutoIncrementHero = "pro2d_autoincrement:hero" //gm参数属性 diff --git a/common/db/mongoproxy/mongoplugin.go b/common/db/mongoproxy/mongoplugin.go index e146258..151e574 100644 --- a/common/db/mongoproxy/mongoplugin.go +++ b/common/db/mongoproxy/mongoplugin.go @@ -20,7 +20,7 @@ func DB() *mongo.Database { return mongoDatabase } -func ConnectMongo(conf *common.MongoConf) error { +func ConnectMongo(conf *common.MongoConf, ID int64) error { var uri string if conf.User != "" { //uri = fmt.Sprintf("mongodb://%s:%s@%s:%d/%s?w=majority", conf.User, conf.Password, conf.Host, conf.Port, conf.DBName) @@ -47,7 +47,7 @@ func ConnectMongo(conf *common.MongoConf) error { return err } - mongoDatabase = mongoClient.Database(conf.DBName) + mongoDatabase = mongoClient.Database(fmt.Sprintf("%s_%d", conf.DBName, ID)) return nil } diff --git a/models/dbseed.go b/models/dbseed.go index 13150dc..f499e0b 100644 --- a/models/dbseed.go +++ b/models/dbseed.go @@ -1,6 +1,7 @@ package models import ( + "fmt" "github.com/garyburd/redigo/redis" "pro2d/common" "pro2d/common/db/mongoproxy" @@ -76,7 +77,7 @@ func (d *DBSeed) InitAutoIncreUidTable(schema STOIncrement) { } //设置到redis中,提供初始自增id - relay, err := redisproxy.HGET(common.AutoIncrement, name) + relay, err := redisproxy.HGET(fmt.Sprintf(common.AutoIncrement, d.serverID), name) if err != nil { logger.Error(err.Error()) continue @@ -91,9 +92,9 @@ func (d *DBSeed) InitAutoIncreUidTable(schema STOIncrement) { } } - logger.Debug(relayID, common.AutoIncrement, name) + logger.Debug(relayID, fmt.Sprintf(common.AutoIncrement, d.serverID), name) if relayID == 0 || increId > relayID { - redisproxy.HSET(common.AutoIncrement, name, increId) + redisproxy.HSET(fmt.Sprintf(common.AutoIncrement, d.serverID), name, increId) } } } @@ -120,7 +121,7 @@ func (d *DBSeed) SaveAutoincrementTimer(schema STOIncrement) { dbID = autoIncrement.Incre.Val } //获取redis中的id 内存中的数据。获取自增id - relayID, err := redis.Int64(redisproxy.HGET(common.AutoIncrement, name)) + relayID, err := redis.Int64(redisproxy.HGET(fmt.Sprintf(common.AutoIncrement, d.serverID), name)) if err != nil { logger.Error(err.Error()) continue diff --git a/models/role.go b/models/role.go index 674e85b..0a6c386 100644 --- a/models/role.go +++ b/models/role.go @@ -22,7 +22,7 @@ type RoleModel struct { } func RoleExistByUid(uid string) *RoleModel { - data := &pb.Role{Uid: uid} + data := &pb.Role{Uid: uid, Incres: make(map[string]int64)} if err := mongoproxy.FindOne(mongoproxy.GetCollName(data), mongoproxy.GetBsonM("uid", uid), data); err != nil { logger.Error("Role not exist err: %v", err) @@ -42,7 +42,7 @@ func RoleExistByUid(uid string) *RoleModel { } func NewRole(id string) *RoleModel { - data := &pb.Role{Id: id} + data := &pb.Role{Id: id, Incres: make(map[string]int64)} m := &RoleModel{ ISchema: NewSchema(id, data), Role: data, @@ -61,13 +61,20 @@ func (m *RoleModel) IncreByKey(key string, detal int64) int64 { } m.Role.Incres[key] = v m.SetProperty("incres", m.Role.Incres) - return v + common.MaxCommNum + return v +} + +func (m *RoleModel) IncreHearByKey(detal int64) string { + return fmt.Sprintf("%s%04d", m.Role.Id, m.IncreByKey("hero", detal)) +} +func (m *RoleModel) IncreTeamByKey(detal int64) string { + return fmt.Sprintf("%s%02d", m.Role.Id, m.IncreByKey("team", detal)) } func (m *RoleModel) InitRole() { //init hero h1 := pb.Hero{ - Id: fmt.Sprintf("%s%d", m.Role.Id, m.IncreByKey("hero", 1)), + Id: m.IncreHearByKey(1), RoleId: m.Role.Id, Type: 1, Level: 1, @@ -78,23 +85,23 @@ func (m *RoleModel) InitRole() { m.AddHero(&h1) h2 := h1 - h2.Id = fmt.Sprintf("%s%d", m.Role.Id, m.IncreByKey("hero", 1)) + h2.Id = m.IncreHearByKey(1) h2.Type = 2 m.AddHero(&h2) h3 := h1 - h3.Id = fmt.Sprintf("%s%d", m.Role.Id, m.IncreByKey("hero", 1)) + h3.Id = m.IncreHearByKey(1) h3.Type = 3 m.AddHero(&h3) h4 := h1 - h4.Id = fmt.Sprintf("%s%d", m.Role.Id, m.IncreByKey("hero", 1)) + h4.Id = m.IncreHearByKey(1) h4.Type = 4 m.AddHero(&h4) //init team t1 := pb.Team{ - Id: fmt.Sprintf("%s%d", m.Role.Id, m.IncreByKey("team", 1)), + Id: m.IncreTeamByKey(1), RoleId: m.Role.Id, HeroId1: h1.Id, HeroId2: h2.Id, @@ -103,16 +110,18 @@ func (m *RoleModel) InitRole() { m.AddTeam(&t1) t2 := t1 - t2.Id = fmt.Sprintf("%s%d", m.Role.Id, m.IncreByKey("team", 1)) + t2.Id = m.IncreTeamByKey(1) m.AddTeam(&t2) t3 := t1 - t3.Id = fmt.Sprintf("%s%d", m.Role.Id, m.IncreByKey("team", 1)) + t3.Id = m.IncreTeamByKey(1) m.AddTeam(&t3) t4 := t1 - t4.Id = fmt.Sprintf("%s%d", m.Role.Id, m.IncreByKey("team", 1)) + t4.Id = m.IncreTeamByKey(1) m.AddTeam(&t4) + + m.Update() } func (m *RoleModel) LoadHero() { diff --git a/models/role_test.go b/models/role_test.go index 6fbdf58..6d7be12 100644 --- a/models/role_test.go +++ b/models/role_test.go @@ -10,7 +10,7 @@ import ( ) func TestNewRole(t *testing.T) { - err := mongoproxy.ConnectMongo(common.GlobalConf.GameConf.MongoConf) + err := mongoproxy.ConnectMongo(common.GlobalConf.GameConf.MongoConf, common.GlobalConf.GameConf.ID) if err != nil { logger.Error(err) return @@ -51,7 +51,7 @@ func TestRoleIndex(t *testing.T) { } func TestRoleModel_AddHero(t *testing.T) { - err := mongoproxy.ConnectMongo(common.GlobalConf.GameConf.MongoConf) + err := mongoproxy.ConnectMongo(common.GlobalConf.GameConf.MongoConf, common.GlobalConf.GameConf.ID) if err != nil { logger.Error(err) return @@ -68,7 +68,7 @@ func TestRoleModel_AddHero(t *testing.T) { } func TestRoleModel_ProtoReflect(t *testing.T) { - err := mongoproxy.ConnectMongo(common.GlobalConf.GameConf.MongoConf) + err := mongoproxy.ConnectMongo(common.GlobalConf.GameConf.MongoConf, common.GlobalConf.GameConf.ID) if err != nil { logger.Error(err) return @@ -82,8 +82,9 @@ func TestRoleModel_ProtoReflect(t *testing.T) { sch.UpdateProperty(nil, "Device", "123123123", false) fmt.Println(sch.Role) } + func TestRoleModel_UpdateTeam(t *testing.T) { - err := mongoproxy.ConnectMongo(common.GlobalConf.GameConf.MongoConf) + err := mongoproxy.ConnectMongo(common.GlobalConf.GameConf.MongoConf, common.GlobalConf.GameConf.ID) if err != nil { logger.Error(err) return @@ -102,3 +103,21 @@ func TestRoleModel_UpdateTeam(t *testing.T) { }) sch.OnOfflineEvent() } + +func TestRoleModel_IncreByKey(t *testing.T) { + //err := mongoproxy.ConnectMongo(common.GlobalConf.GameConf.MongoConf, common.GlobalConf.GameConf.ID) + //if err != nil { + // logger.Error(err) + // return + //} + //sch := NewRole("1000001") + //sch.Load() + //sch.LoadAll() + // + //sch.Role.Incres["hero"] = 4 + //sch.Role.Incres["team"] = 4 + //sch.SetProperty("incres", sch.Role.Incres) + //sch.Update() + + fmt.Printf("%03d\n", 3) +} diff --git a/models/schema.go b/models/schema.go index 3fe1e7b..73f6902 100644 --- a/models/schema.go +++ b/models/schema.go @@ -136,7 +136,10 @@ func (s *Schema) Create() error { //更新缓存字段到数据库 func (s *Schema) Update() { if len(s.cacheFields) > 0 { - s.db.UpdateProperties(s.cacheFields) + if err := s.db.UpdateProperties(s.cacheFields); err != nil { + logger.Error("%s, UpdateErr: %s", s.GetSchemaName(), err.Error()) + return + } s.cacheFields = make(map[string]interface{}) } } diff --git a/pb/game.pb.go b/pb/game.pb.go index 6ca008c..1643cdd 100644 --- a/pb/game.pb.go +++ b/pb/game.pb.go @@ -20,6 +20,7 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +//ResponseCmd HeartRsp type HeartReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -170,6 +171,7 @@ func (x *LoginReq) GetDevice() string { return "" } +//ResponseCmd CreateReq type CreateReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -288,6 +290,7 @@ func (x *RoleRsp) GetTeam() []*Team { return nil } +//ResponseCmd UpdateRolePropertyRsp type UpdateRolePropertyRsp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -343,7 +346,7 @@ func (x *UpdateRolePropertyRsp) GetRole() *Role { return nil } -type GoIntoBattleReq struct { +type ChangeTeamReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -351,8 +354,8 @@ type GoIntoBattleReq struct { Team []*Team `protobuf:"bytes,1,rep,name=team,proto3" json:"team,omitempty"` } -func (x *GoIntoBattleReq) Reset() { - *x = GoIntoBattleReq{} +func (x *ChangeTeamReq) Reset() { + *x = ChangeTeamReq{} if protoimpl.UnsafeEnabled { mi := &file_game_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -360,13 +363,13 @@ func (x *GoIntoBattleReq) Reset() { } } -func (x *GoIntoBattleReq) String() string { +func (x *ChangeTeamReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GoIntoBattleReq) ProtoMessage() {} +func (*ChangeTeamReq) ProtoMessage() {} -func (x *GoIntoBattleReq) ProtoReflect() protoreflect.Message { +func (x *ChangeTeamReq) ProtoReflect() protoreflect.Message { mi := &file_game_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -378,12 +381,12 @@ func (x *GoIntoBattleReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GoIntoBattleReq.ProtoReflect.Descriptor instead. -func (*GoIntoBattleReq) Descriptor() ([]byte, []int) { +// Deprecated: Use ChangeTeamReq.ProtoReflect.Descriptor instead. +func (*ChangeTeamReq) Descriptor() ([]byte, []int) { return file_game_proto_rawDescGZIP(), []int{6} } -func (x *GoIntoBattleReq) GetTeam() []*Team { +func (x *ChangeTeamReq) GetTeam() []*Team { if x != nil { return x.Team } @@ -418,11 +421,11 @@ var file_game_proto_rawDesc = []byte{ 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x20, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x04, 0x72, 0x6f, 0x6c, - 0x65, 0x22, 0x33, 0x0a, 0x0f, 0x47, 0x6f, 0x49, 0x6e, 0x74, 0x6f, 0x42, 0x61, 0x74, 0x74, 0x6c, - 0x65, 0x52, 0x65, 0x71, 0x12, 0x20, 0x0a, 0x04, 0x74, 0x65, 0x61, 0x6d, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x54, 0x65, 0x61, 0x6d, - 0x52, 0x04, 0x74, 0x65, 0x61, 0x6d, 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2e, 0x2f, 0x70, 0x62, 0x3b, - 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x22, 0x31, 0x0a, 0x0d, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x52, + 0x65, 0x71, 0x12, 0x20, 0x0a, 0x04, 0x74, 0x65, 0x61, 0x6d, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x0c, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x04, + 0x74, 0x65, 0x61, 0x6d, 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2e, 0x2f, 0x70, 0x62, 0x3b, 0x70, 0x62, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -445,7 +448,7 @@ var file_game_proto_goTypes = []interface{}{ (*CreateReq)(nil), // 3: game.CreateReq (*RoleRsp)(nil), // 4: game.RoleRsp (*UpdateRolePropertyRsp)(nil), // 5: game.UpdateRolePropertyRsp - (*GoIntoBattleReq)(nil), // 6: game.GoIntoBattleReq + (*ChangeTeamReq)(nil), // 6: game.ChangeTeamReq (*Role)(nil), // 7: models.Role (*Hero)(nil), // 8: models.Hero (*Team)(nil), // 9: models.Team @@ -455,7 +458,7 @@ var file_game_proto_depIdxs = []int32{ 8, // 1: game.RoleRsp.hero:type_name -> models.Hero 9, // 2: game.RoleRsp.team:type_name -> models.Team 7, // 3: game.UpdateRolePropertyRsp.role:type_name -> models.Role - 9, // 4: game.GoIntoBattleReq.team:type_name -> models.Team + 9, // 4: game.ChangeTeamReq.team:type_name -> models.Team 5, // [5:5] is the sub-list for method output_type 5, // [5:5] is the sub-list for method input_type 5, // [5:5] is the sub-list for extension type_name @@ -543,7 +546,7 @@ func file_game_proto_init() { } } file_game_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GoIntoBattleReq); i { + switch v := v.(*ChangeTeamReq); i { case 0: return &v.state case 1: diff --git a/pb/protocode.pb.go b/pb/protocode.pb.go index dacd5e7..bcc8481 100644 --- a/pb/protocode.pb.go +++ b/pb/protocode.pb.go @@ -31,7 +31,7 @@ const ( ProtoCode_CreateReq ProtoCode = 5 ProtoCode_RoleRsp ProtoCode = 6 ProtoCode_UpdateRolePropertyRsp ProtoCode = 7 - ProtoCode_GoIntoBattleReq ProtoCode = 8 + ProtoCode_ChangeTeamReq ProtoCode = 8 ) // Enum value maps for ProtoCode. @@ -45,7 +45,7 @@ var ( 5: "CreateReq", 6: "RoleRsp", 7: "UpdateRolePropertyRsp", - 8: "GoIntoBattleReq", + 8: "ChangeTeamReq", } ProtoCode_value = map[string]int32{ "UNKNOWN": 0, @@ -56,7 +56,7 @@ var ( "CreateReq": 5, "RoleRsp": 6, "UpdateRolePropertyRsp": 7, - "GoIntoBattleReq": 8, + "ChangeTeamReq": 8, } ) @@ -91,7 +91,7 @@ var File_protocode_proto protoreflect.FileDescriptor var file_protocode_proto_rawDesc = []byte{ 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x12, 0x09, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x64, 0x65, 0x2a, 0x9c, 0x01, 0x0a, + 0x6f, 0x12, 0x09, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x64, 0x65, 0x2a, 0x9a, 0x01, 0x0a, 0x09, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x73, 0x70, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x48, 0x65, 0x61, 0x72, 0x74, 0x52, 0x65, @@ -100,9 +100,9 @@ var file_protocode_proto_rawDesc = []byte{ 0x0d, 0x0a, 0x09, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x10, 0x05, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x73, 0x70, 0x10, 0x06, 0x12, 0x19, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, - 0x79, 0x52, 0x73, 0x70, 0x10, 0x07, 0x12, 0x13, 0x0a, 0x0f, 0x47, 0x6f, 0x49, 0x6e, 0x74, 0x6f, - 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x10, 0x08, 0x42, 0x0a, 0x5a, 0x08, 0x2e, - 0x2e, 0x2f, 0x70, 0x62, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x79, 0x52, 0x73, 0x70, 0x10, 0x07, 0x12, 0x11, 0x0a, 0x0d, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, + 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x10, 0x08, 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2e, 0x2f, + 0x70, 0x62, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/protos b/protos index f3d0853..a102181 160000 --- a/protos +++ b/protos @@ -1 +1 @@ -Subproject commit f3d0853be4bc7062a327ed11b0e74ef10912b49e +Subproject commit a102181c13a87f14aa06dad30dfa4836b26e9f0b -- libgit2 0.21.2