娃娃機修改
This commit is contained in:
parent
895c673e65
commit
7889c982ea
|
|
@ -195,13 +195,13 @@ func DollMachineGrabResult(session *netlib.Session, conn *machinedoll.Conn, snid
|
||||||
//fmt.Println("Failed to read response from server:", err)
|
//fmt.Println("Failed to read response from server:", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
session.Send(int(machine.DollMachinePacketID_PACKET_MSDollMachineoPerateResult), &machine.MSDollMachineoPerateResult{
|
fmt.Println("没有抓到礼品!!!!!!!!snid = ", snid, "num = ", num)
|
||||||
|
machinedoll.SendToGameServer(int(machine.DollMachinePacketID_PACKET_MSDollMachineoPerateResult), &machine.MSDollMachineoPerateResult{
|
||||||
Snid: snid,
|
Snid: snid,
|
||||||
Id: id,
|
Id: id,
|
||||||
Result: 0,
|
Result: 0,
|
||||||
TypeId: 2,
|
TypeId: 2,
|
||||||
})
|
})
|
||||||
fmt.Println("没有抓到礼品!!!!!!!!snid = ", snid, "num = ", num)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if bytes.Contains(part, instruction1) && num != 1 {
|
if bytes.Contains(part, instruction1) && num != 1 {
|
||||||
|
|
@ -212,20 +212,20 @@ func DollMachineGrabResult(session *netlib.Session, conn *machinedoll.Conn, snid
|
||||||
fmt.Println("Failed to read response from server:", err)
|
fmt.Println("Failed to read response from server:", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
session.Send(int(machine.DollMachinePacketID_PACKET_MSDollMachineoPerateResult), &machine.MSDollMachineoPerateResult{
|
fmt.Println("抓到礼品了!!!!!!!!snid = ", snid, "num = ", num)
|
||||||
|
machinedoll.SendToGameServer(int(machine.DollMachinePacketID_PACKET_MSDollMachineoPerateResult), &machine.MSDollMachineoPerateResult{
|
||||||
Snid: snid,
|
Snid: snid,
|
||||||
Id: id,
|
Id: id,
|
||||||
Result: 1,
|
Result: 1,
|
||||||
TypeId: 2,
|
TypeId: 2,
|
||||||
})
|
})
|
||||||
fmt.Println("抓到礼品了!!!!!!!!snid = ", snid, "num = ", num)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
//上分成功
|
//上分成功
|
||||||
coinData := []byte{0xAA, 0x04, 0x02, 0x03, 0x01}
|
coinData := []byte{0xAA, 0x04, 0x02, 0x03, 0x01}
|
||||||
if bytes.Contains(part, coinData) {
|
if bytes.Contains(part, coinData) {
|
||||||
//返回消息
|
//返回消息
|
||||||
session.Send(int(machine.DollMachinePacketID_PACKET_MSDollMachineoPerateResult), &machine.MSDollMachineoPerateResult{
|
machinedoll.SendToGameServer(int(machine.DollMachinePacketID_PACKET_MSDollMachineoPerateResult), &machine.MSDollMachineoPerateResult{
|
||||||
Snid: snid,
|
Snid: snid,
|
||||||
Id: id,
|
Id: id,
|
||||||
Result: 1,
|
Result: 1,
|
||||||
|
|
@ -237,7 +237,7 @@ func DollMachineGrabResult(session *netlib.Session, conn *machinedoll.Conn, snid
|
||||||
coinData = []byte{0xAA, 0x04, 0x02, 0x03, 0x00}
|
coinData = []byte{0xAA, 0x04, 0x02, 0x03, 0x00}
|
||||||
if bytes.Contains(part, coinData) {
|
if bytes.Contains(part, coinData) {
|
||||||
//返回消息
|
//返回消息
|
||||||
session.Send(int(machine.DollMachinePacketID_PACKET_MSDollMachineoPerateResult), &machine.MSDollMachineoPerateResult{
|
machinedoll.SendToGameServer(int(machine.DollMachinePacketID_PACKET_MSDollMachineoPerateResult), &machine.MSDollMachineoPerateResult{
|
||||||
Snid: snid,
|
Snid: snid,
|
||||||
Id: id,
|
Id: id,
|
||||||
Result: 0,
|
Result: 0,
|
||||||
|
|
|
||||||
|
|
@ -152,9 +152,7 @@ func (this *MachineManager) UpdateToGameServer(conn *Conn, status int32) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func SendToGameServer(pid int, msg interface{}) {
|
func SendToGameServer(pid int, msg interface{}) {
|
||||||
if GameConn == nil {
|
GameConn = srvlib.ServerSessionMgrSington.GetSession(1, 7, 777)
|
||||||
GameConn = srvlib.ServerSessionMgrSington.GetSession(1, 7, 701)
|
|
||||||
}
|
|
||||||
if GameConn != nil {
|
if GameConn != nil {
|
||||||
GameConn.Send(pid, msg)
|
GameConn.Send(pid, msg)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue