Compare commits
No commits in common. "1961caad122ccd4cfc25e189a26b958c1a602c17" and "4cfd64dbedffe3a295157444bc0b87862668fc6d" have entirely different histories.
1961caad12
...
4cfd64dbed
|
@ -119,8 +119,8 @@ func SMDollMachinePerateHandler(session *netlib.Session, packetId int, data inte
|
||||||
Process(conn, f1, f2)
|
Process(conn, f1, f2)
|
||||||
case 5:
|
case 5:
|
||||||
//投币
|
//投币
|
||||||
fmt.Println("===========玩家投币===========", conn)
|
fmt.Println("===========玩家投币===========")
|
||||||
go DollMachineGrabResult(conn, msg.Snid, msg.GetId())
|
go DollMachineGrabResult(session, conn, msg.Snid, msg.GetId())
|
||||||
machinedoll.Coin(conn)
|
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)
|
num := int64(1)
|
||||||
for {
|
for {
|
||||||
// 读取数据
|
// 读取数据
|
||||||
|
|
|
@ -10,9 +10,11 @@ import (
|
||||||
"syscall"
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"mongo.games.com/goserver/core/basic"
|
||||||
"mongo.games.com/goserver/core/logger"
|
"mongo.games.com/goserver/core/logger"
|
||||||
"mongo.games.com/goserver/core/module"
|
"mongo.games.com/goserver/core/module"
|
||||||
"mongo.games.com/goserver/core/netlib"
|
"mongo.games.com/goserver/core/netlib"
|
||||||
|
"mongo.games.com/goserver/core/task"
|
||||||
"mongo.games.com/goserver/srvlib"
|
"mongo.games.com/goserver/srvlib"
|
||||||
|
|
||||||
"mongo.games.com/game/protocol/machine"
|
"mongo.games.com/game/protocol/machine"
|
||||||
|
@ -88,14 +90,14 @@ func (this *MachineManager) Init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *MachineManager) Update() {
|
func (this *MachineManager) Update() {
|
||||||
/* var delConn []*Conn
|
var delConn []*Conn
|
||||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||||
for _, v := range this.ConnMap {
|
for _, v := range this.ConnMap {
|
||||||
_, err := v.Write([]byte("heartbeat"))
|
_, err := v.Write([]byte("heartbeat"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
delConn = append(delConn, v)
|
delConn = append(delConn, v)
|
||||||
v.Close()
|
v.Close()
|
||||||
fmt.Println("断开连接:%v", v.Addr)
|
logger.Logger.Tracef("断开连接:%v", v.Addr)
|
||||||
this.UpdateToGameServer(v, 0)
|
this.UpdateToGameServer(v, 0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -114,7 +116,7 @@ func (this *MachineManager) Update() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
fmt.Println("娃娃机重连成功!addr = %v", addr)
|
logger.Logger.Tracef("娃娃机重连成功!addr = %v", addr)
|
||||||
delIds = append(delIds, &Conn{
|
delIds = append(delIds, &Conn{
|
||||||
Id: id,
|
Id: id,
|
||||||
Conn: conn,
|
Conn: conn,
|
||||||
|
@ -129,7 +131,7 @@ func (this *MachineManager) Update() {
|
||||||
this.UpdateToGameServer(v, 1)
|
this.UpdateToGameServer(v, 1)
|
||||||
}
|
}
|
||||||
})).StartByFixExecutor(this.ModuleName())
|
})).StartByFixExecutor(this.ModuleName())
|
||||||
})).StartByFixExecutor(this.ModuleName())*/
|
})).StartByFixExecutor(this.ModuleName())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *MachineManager) Shutdown() {
|
func (this *MachineManager) Shutdown() {
|
||||||
|
@ -202,6 +204,8 @@ func listenKeyboardEvents(conn net.Conn) {
|
||||||
case "j":
|
case "j":
|
||||||
Grab(conn)
|
Grab(conn)
|
||||||
case "J":
|
case "J":
|
||||||
|
SetPower(conn)
|
||||||
|
time.Sleep(200 * time.Millisecond)
|
||||||
Grab(conn)
|
Grab(conn)
|
||||||
|
|
||||||
case "k":
|
case "k":
|
||||||
|
|
Loading…
Reference in New Issue