上传竞技场红点代码
This commit is contained in:
parent
a50b2db9ab
commit
d308ecaaf4
@ -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
12
modules/battle/call.go
Normal 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
|
||||
}
|
Loading…
Reference in New Issue
Block a user