Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into meixiongfeng
This commit is contained in:
commit
30c78af0bc
@ -64,6 +64,7 @@ const (
|
|||||||
ModuleLibrary core.M_Modules = "library" //藏书馆
|
ModuleLibrary core.M_Modules = "library" //藏书馆
|
||||||
ModuleArena core.M_Modules = "arena" //竞技场
|
ModuleArena core.M_Modules = "arena" //竞技场
|
||||||
ModuleTroll core.M_Modules = "troll" //巨怪商队
|
ModuleTroll core.M_Modules = "troll" //巨怪商队
|
||||||
|
ModuleConstellation core.M_Modules = "constellation" //星座图
|
||||||
//ModuleFetter core.M_Modules = "herofetter" //好友模块
|
//ModuleFetter core.M_Modules = "herofetter" //好友模块
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -63,6 +63,9 @@ func (this *apiComp) PlotReward(session comm.IUserSession, req *pb.ArenaPlotRewa
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.module.DispenseRes(session, npc.NpcReward, true)
|
this.module.DispenseRes(session, npc.NpcReward, true)
|
||||||
session.SendMsg(string(this.module.GetType()), "plotreward", &pb.ArenaPlotRewardResp{Issucc: true})
|
session.SendMsg(string(this.module.GetType()), "plotreward", &pb.ArenaPlotRewardResp{
|
||||||
|
Issucc: true,
|
||||||
|
Npc: info.Npc,
|
||||||
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
30
modules/constellation/api.go
Normal file
30
modules/constellation/api.go
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
package constellation
|
||||||
|
|
||||||
|
import (
|
||||||
|
"go_dreamfactory/modules"
|
||||||
|
|
||||||
|
"go_dreamfactory/lego/base"
|
||||||
|
"go_dreamfactory/lego/core"
|
||||||
|
)
|
||||||
|
|
||||||
|
/*
|
||||||
|
API
|
||||||
|
*/
|
||||||
|
type apiComp struct {
|
||||||
|
modules.MCompGate
|
||||||
|
service base.IRPCXService
|
||||||
|
module *Constellation
|
||||||
|
}
|
||||||
|
|
||||||
|
//组件初始化接口
|
||||||
|
func (this *apiComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
||||||
|
this.MCompGate.Init(service, module, comp, options)
|
||||||
|
this.module = module.(*Constellation)
|
||||||
|
this.service = service.(base.IRPCXService)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *apiComp) Start() (err error) {
|
||||||
|
err = this.MCompGate.Start()
|
||||||
|
return
|
||||||
|
}
|
29
modules/constellation/module.go
Normal file
29
modules/constellation/module.go
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
package constellation
|
||||||
|
|
||||||
|
import (
|
||||||
|
"go_dreamfactory/comm"
|
||||||
|
"go_dreamfactory/lego/base"
|
||||||
|
"go_dreamfactory/lego/core"
|
||||||
|
"go_dreamfactory/modules"
|
||||||
|
)
|
||||||
|
|
||||||
|
/*
|
||||||
|
模块名:星座图
|
||||||
|
描述:全局属性增幅器
|
||||||
|
开发:李伟
|
||||||
|
*/
|
||||||
|
func NewModule() core.IModule {
|
||||||
|
m := new(Constellation)
|
||||||
|
return m
|
||||||
|
}
|
||||||
|
|
||||||
|
type Constellation struct {
|
||||||
|
modules.ModuleBase
|
||||||
|
service base.IRPCXService //rpc服务对象 通过这个对象可以发布服务和调用其他服务的接口
|
||||||
|
options *Options
|
||||||
|
}
|
||||||
|
|
||||||
|
//模块名
|
||||||
|
func (this *Constellation) GetType() core.M_Modules {
|
||||||
|
return comm.ModuleChat
|
||||||
|
}
|
40
modules/constellation/options.go
Normal file
40
modules/constellation/options.go
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
package constellation
|
||||||
|
|
||||||
|
import (
|
||||||
|
"errors"
|
||||||
|
"go_dreamfactory/lego/sys/log"
|
||||||
|
"go_dreamfactory/lego/utils/mapstructure"
|
||||||
|
"go_dreamfactory/modules"
|
||||||
|
)
|
||||||
|
|
||||||
|
type (
|
||||||
|
IOptions interface {
|
||||||
|
modules.IOptions
|
||||||
|
}
|
||||||
|
Options struct {
|
||||||
|
modules.Options
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
func (this *Options) GetDebug() bool {
|
||||||
|
return this.Debug
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *Options) GetLog() log.ILogger {
|
||||||
|
return this.Log
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *Options) LoadConfig(settings map[string]interface{}) (err error) {
|
||||||
|
if settings != nil {
|
||||||
|
if err = mapstructure.Decode(settings, &this.Options); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if err = mapstructure.Decode(settings, this); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if this.Log = log.NewTurnlog(true, log.Clone("", 4)); this.Log == nil {
|
||||||
|
err = errors.New("log is nil")
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
@ -1235,6 +1235,7 @@ type ArenaPlotRewardResp struct {
|
|||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
Issucc bool `protobuf:"varint,1,opt,name=issucc,proto3" json:"issucc"`
|
Issucc bool `protobuf:"varint,1,opt,name=issucc,proto3" json:"issucc"`
|
||||||
|
Npc map[int32]*DBNpc `protobuf:"bytes,2,rep,name=npc,proto3" json:"npc" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // npc Cd
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ArenaPlotRewardResp) Reset() {
|
func (x *ArenaPlotRewardResp) Reset() {
|
||||||
@ -1276,6 +1277,13 @@ func (x *ArenaPlotRewardResp) GetIssucc() bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *ArenaPlotRewardResp) GetNpc() map[int32]*DBNpc {
|
||||||
|
if x != nil {
|
||||||
|
return x.Npc
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
var File_arena_arena_msg_proto protoreflect.FileDescriptor
|
var File_arena_arena_msg_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
var file_arena_arena_msg_proto_rawDesc = []byte{
|
var file_arena_arena_msg_proto_rawDesc = []byte{
|
||||||
@ -1377,11 +1385,18 @@ var file_arena_arena_msg_proto_rawDesc = []byte{
|
|||||||
0x72, 0x64, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
|
0x72, 0x64, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
|
||||||
0x28, 0x05, 0x52, 0x03, 0x70, 0x69, 0x64, 0x12, 0x25, 0x0a, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72,
|
0x28, 0x05, 0x52, 0x03, 0x70, 0x69, 0x64, 0x12, 0x25, 0x0a, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72,
|
||||||
0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65,
|
0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65,
|
||||||
0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x22, 0x2d,
|
0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x22, 0x9e,
|
||||||
0x0a, 0x13, 0x41, 0x72, 0x65, 0x6e, 0x61, 0x50, 0x6c, 0x6f, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72,
|
0x01, 0x0a, 0x13, 0x41, 0x72, 0x65, 0x6e, 0x61, 0x50, 0x6c, 0x6f, 0x74, 0x52, 0x65, 0x77, 0x61,
|
||||||
0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x73, 0x75, 0x63, 0x63, 0x18,
|
0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x73, 0x75, 0x63, 0x63,
|
||||||
0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x73, 0x75, 0x63, 0x63, 0x42, 0x06, 0x5a,
|
0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x73, 0x75, 0x63, 0x63, 0x12, 0x2f,
|
||||||
0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
0x0a, 0x03, 0x6e, 0x70, 0x63, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x41, 0x72,
|
||||||
|
0x65, 0x6e, 0x61, 0x50, 0x6c, 0x6f, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73,
|
||||||
|
0x70, 0x2e, 0x4e, 0x70, 0x63, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x03, 0x6e, 0x70, 0x63, 0x1a,
|
||||||
|
0x3e, 0x0a, 0x08, 0x4e, 0x70, 0x63, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b,
|
||||||
|
0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1c, 0x0a,
|
||||||
|
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x06, 0x2e, 0x44,
|
||||||
|
0x42, 0x4e, 0x70, 0x63, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42,
|
||||||
|
0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -1396,7 +1411,7 @@ func file_arena_arena_msg_proto_rawDescGZIP() []byte {
|
|||||||
return file_arena_arena_msg_proto_rawDescData
|
return file_arena_arena_msg_proto_rawDescData
|
||||||
}
|
}
|
||||||
|
|
||||||
var file_arena_arena_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 24)
|
var file_arena_arena_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 25)
|
||||||
var file_arena_arena_msg_proto_goTypes = []interface{}{
|
var file_arena_arena_msg_proto_goTypes = []interface{}{
|
||||||
(*ArenaInfoReq)(nil), // 0: ArenaInfoReq
|
(*ArenaInfoReq)(nil), // 0: ArenaInfoReq
|
||||||
(*ArenaInfoResp)(nil), // 1: ArenaInfoResp
|
(*ArenaInfoResp)(nil), // 1: ArenaInfoResp
|
||||||
@ -1422,31 +1437,35 @@ var file_arena_arena_msg_proto_goTypes = []interface{}{
|
|||||||
(*ArenaPlotResp)(nil), // 21: ArenaPlotResp
|
(*ArenaPlotResp)(nil), // 21: ArenaPlotResp
|
||||||
(*ArenaPlotRewardReq)(nil), // 22: ArenaPlotRewardReq
|
(*ArenaPlotRewardReq)(nil), // 22: ArenaPlotRewardReq
|
||||||
(*ArenaPlotRewardResp)(nil), // 23: ArenaPlotRewardResp
|
(*ArenaPlotRewardResp)(nil), // 23: ArenaPlotRewardResp
|
||||||
(*DBArenaUser)(nil), // 24: DBArenaUser
|
nil, // 24: ArenaPlotRewardResp.NpcEntry
|
||||||
(*ArenaPlayer)(nil), // 25: ArenaPlayer
|
(*DBArenaUser)(nil), // 25: DBArenaUser
|
||||||
(*BattleFormation)(nil), // 26: BattleFormation
|
(*ArenaPlayer)(nil), // 26: ArenaPlayer
|
||||||
(ErrorCode)(0), // 27: ErrorCode
|
(*BattleFormation)(nil), // 27: BattleFormation
|
||||||
(*BattleInfo)(nil), // 28: BattleInfo
|
(ErrorCode)(0), // 28: ErrorCode
|
||||||
(*BattleReport)(nil), // 29: BattleReport
|
(*BattleInfo)(nil), // 29: BattleInfo
|
||||||
|
(*BattleReport)(nil), // 30: BattleReport
|
||||||
|
(*DBNpc)(nil), // 31: DBNpc
|
||||||
}
|
}
|
||||||
var file_arena_arena_msg_proto_depIdxs = []int32{
|
var file_arena_arena_msg_proto_depIdxs = []int32{
|
||||||
24, // 0: ArenaInfoResp.info:type_name -> DBArenaUser
|
25, // 0: ArenaInfoResp.info:type_name -> DBArenaUser
|
||||||
24, // 1: ArenaOtherInfoResp.info:type_name -> DBArenaUser
|
25, // 1: ArenaOtherInfoResp.info:type_name -> DBArenaUser
|
||||||
25, // 2: ArenaMatcheResp.players:type_name -> ArenaPlayer
|
26, // 2: ArenaMatcheResp.players:type_name -> ArenaPlayer
|
||||||
26, // 3: ArenaChallengeReq.battle:type_name -> BattleFormation
|
27, // 3: ArenaChallengeReq.battle:type_name -> BattleFormation
|
||||||
27, // 4: ArenaChallengeResp.code:type_name -> ErrorCode
|
28, // 4: ArenaChallengeResp.code:type_name -> ErrorCode
|
||||||
28, // 5: ArenaChallengeResp.info:type_name -> BattleInfo
|
29, // 5: ArenaChallengeResp.info:type_name -> BattleInfo
|
||||||
29, // 6: ArenaChallengeRewardReq.report:type_name -> BattleReport
|
30, // 6: ArenaChallengeRewardReq.report:type_name -> BattleReport
|
||||||
25, // 7: ArenaRankResp.players:type_name -> ArenaPlayer
|
26, // 7: ArenaRankResp.players:type_name -> ArenaPlayer
|
||||||
26, // 8: ArenaPlotReq.battle:type_name -> BattleFormation
|
27, // 8: ArenaPlotReq.battle:type_name -> BattleFormation
|
||||||
27, // 9: ArenaPlotResp.code:type_name -> ErrorCode
|
28, // 9: ArenaPlotResp.code:type_name -> ErrorCode
|
||||||
28, // 10: ArenaPlotResp.info:type_name -> BattleInfo
|
29, // 10: ArenaPlotResp.info:type_name -> BattleInfo
|
||||||
29, // 11: ArenaPlotRewardReq.report:type_name -> BattleReport
|
30, // 11: ArenaPlotRewardReq.report:type_name -> BattleReport
|
||||||
12, // [12:12] is the sub-list for method output_type
|
24, // 12: ArenaPlotRewardResp.npc:type_name -> ArenaPlotRewardResp.NpcEntry
|
||||||
12, // [12:12] is the sub-list for method input_type
|
31, // 13: ArenaPlotRewardResp.NpcEntry.value:type_name -> DBNpc
|
||||||
12, // [12:12] is the sub-list for extension type_name
|
14, // [14:14] is the sub-list for method output_type
|
||||||
12, // [12:12] is the sub-list for extension extendee
|
14, // [14:14] is the sub-list for method input_type
|
||||||
0, // [0:12] is the sub-list for field type_name
|
14, // [14:14] is the sub-list for extension type_name
|
||||||
|
14, // [14:14] is the sub-list for extension extendee
|
||||||
|
0, // [0:14] is the sub-list for field type_name
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { file_arena_arena_msg_proto_init() }
|
func init() { file_arena_arena_msg_proto_init() }
|
||||||
@ -1753,7 +1772,7 @@ func file_arena_arena_msg_proto_init() {
|
|||||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
RawDescriptor: file_arena_arena_msg_proto_rawDesc,
|
RawDescriptor: file_arena_arena_msg_proto_rawDesc,
|
||||||
NumEnums: 0,
|
NumEnums: 0,
|
||||||
NumMessages: 24,
|
NumMessages: 25,
|
||||||
NumExtensions: 0,
|
NumExtensions: 0,
|
||||||
NumServices: 0,
|
NumServices: 0,
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user