Compare commits

..

No commits in common. "1961caad122ccd4cfc25e189a26b958c1a602c17" and "4cfd64dbedffe3a295157444bc0b87862668fc6d" have entirely different histories.

2 changed files with 42 additions and 38 deletions

View File

@ -119,8 +119,8 @@ func SMDollMachinePerateHandler(session *netlib.Session, packetId int, data inte
Process(conn, f1, f2)
case 5:
//投币
fmt.Println("===========玩家投币===========", conn)
go DollMachineGrabResult(conn, msg.Snid, msg.GetId())
fmt.Println("===========玩家投币===========")
go DollMachineGrabResult(session, conn, msg.Snid, msg.GetId())
machinedoll.Coin(conn)
}
@ -162,7 +162,7 @@ func SMDollMachineGrabHandler(session *netlib.Session, packetId int, data interf
}
// 监听抓取结果返回
func DollMachineGrabResult(conn *machinedoll.Conn, snid, id int32) {
func DollMachineGrabResult(session *netlib.Session, conn *machinedoll.Conn, snid, id int32) {
num := int64(1)
for {
// 读取数据

View File

@ -10,9 +10,11 @@ import (
"syscall"
"time"
"mongo.games.com/goserver/core/basic"
"mongo.games.com/goserver/core/logger"
"mongo.games.com/goserver/core/module"
"mongo.games.com/goserver/core/netlib"
"mongo.games.com/goserver/core/task"
"mongo.games.com/goserver/srvlib"
"mongo.games.com/game/protocol/machine"
@ -88,14 +90,14 @@ func (this *MachineManager) Init() {
}
func (this *MachineManager) Update() {
/* var delConn []*Conn
var delConn []*Conn
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
for _, v := range this.ConnMap {
_, err := v.Write([]byte("heartbeat"))
if err != nil {
delConn = append(delConn, v)
v.Close()
fmt.Println("断开连接:%v", v.Addr)
logger.Logger.Tracef("断开连接:%v", v.Addr)
this.UpdateToGameServer(v, 0)
}
}
@ -114,7 +116,7 @@ func (this *MachineManager) Update() {
if err != nil {
continue
}
fmt.Println("娃娃机重连成功addr = %v", addr)
logger.Logger.Tracef("娃娃机重连成功addr = %v", addr)
delIds = append(delIds, &Conn{
Id: id,
Conn: conn,
@ -129,7 +131,7 @@ func (this *MachineManager) Update() {
this.UpdateToGameServer(v, 1)
}
})).StartByFixExecutor(this.ModuleName())
})).StartByFixExecutor(this.ModuleName())*/
})).StartByFixExecutor(this.ModuleName())
}
func (this *MachineManager) Shutdown() {
@ -202,6 +204,8 @@ func listenKeyboardEvents(conn net.Conn) {
case "j":
Grab(conn)
case "J":
SetPower(conn)
time.Sleep(200 * time.Millisecond)
Grab(conn)
case "k":