Skip to content

Commit dcc3414

Browse files
authored
Merge pull request #1 from Golangltd/master
fork
2 parents 10cbc01 + 2a22860 commit dcc3414

File tree

10,044 files changed

+3477484
-20
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

10,044 files changed

+3477484
-20
lines changed
Loading
Loading
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
http://www.golang.ltd/forum.php?mod=viewthread&tid=7174&extra=
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
package main
2+
3+
import (
4+
"Proto"
5+
"Proto/Proto2"
6+
"time"
7+
8+
"code.google.com/p/go.net/websocket"
9+
)
10+
11+
// 定时发心跳
12+
func Timer(conn *websocket.Conn) {
13+
itimer := time.NewTicker(50)
14+
for {
15+
select {
16+
case <-itimer.C:
17+
18+
strOpenID := "A123456789A123456789A123456789A123456789A123456789A123456789A1234"
19+
// 执行的代码
20+
// data := &Proto2.Net_HeartBeat{
21+
// Protocol: Proto.GameNet_Proto,
22+
// Protocol2: Proto2.Net_HeartBeatProto2,
23+
// OpenID: strOpenID,
24+
// }
25+
//发送
26+
//PlayerSendToServer(conn, data)
27+
// -----------------------------------------------------------------
28+
// run的消息
29+
datapro := &Proto2.C2S_PlayerRun{
30+
Protocol: Proto.GameData_Proto,
31+
Protocol2: Proto2.C2S_PlayerRunProto2,
32+
OpenID: strOpenID,
33+
StrRunX: "22",
34+
StrRunY: "22",
35+
StrRunZ: "22",
36+
}
37+
PlayerSendToServer(conn, datapro)
38+
}
39+
}
40+
}

0 commit comments

Comments
 (0)