上传竞技场红点代码

This commit is contained in:
liwei1dao 2022-11-24 14:20:54 +08:00
parent a50b2db9ab
commit d308ecaaf4
2 changed files with 14 additions and 20 deletions

View File

@ -387,7 +387,6 @@ func (this *modelArena) recoverTicket(info *pb.DBArenaUser) {
func (this *modelArena) reddot(session comm.IUserSession) bool {
var (
info *pb.DBArenaUser
user *pb.DBUser
err error
)
if info, err = this.queryPlayerInfo(session.GetUserId()); err != nil {
@ -395,25 +394,8 @@ func (this *modelArena) reddot(session comm.IUserSession) bool {
}
if err == mgo.MongodbNil {
global := this.module.configure.GetGlobalConf()
if user = this.module.ModuleUser.GetUser(session.GetUserId()); user == nil {
return false
}
info = &pb.DBArenaUser{
Uid: session.GetUserId(),
Name: user.Name,
Integral: global.ArenaInitiaIntegral,
Ticket: 10,
Streak: 0,
Record: make([]*pb.DBArenaBattleRecord, 0),
Lastrtickettime: 0,
Isdef: false,
Npc: make(map[int32]*pb.DBNpc),
}
if info.Dan, err = this.module.modelArena.computedan(info.Integral); err != nil {
return false
}
if err = this.module.modelArena.Add(session.GetUserId(), info); err != nil {
return false
if global.ArenaTicketMax >= global.ArenaTicketCos {
return true
}
}
if info.Ticket > this.module.configure.GetGlobalConf().ArenaTicketCos {

12
modules/battle/call.go Normal file
View File

@ -0,0 +1,12 @@
package battle
//异步返回结构
type MessageCall struct {
Method string
Metadata map[string]string
ResMetadata map[string]string
Args interface{} //请求参数
Reply interface{} //返回参数
Error error //错误信息
Done chan *MessageCall
}