Skip to content

Commit 98ba3ce

Browse files
committed
update data
1 parent 3f6adc9 commit 98ba3ce

File tree

2 files changed

+17
-1
lines changed
  • 第一季 从零开始写游戏服务器 第二期/最新课节--课程代码

2 files changed

+17
-1
lines changed

第一季 从零开始写游戏服务器 第二期/最新课节--课程代码/class3/src/snake/send.go renamed to 第一季 从零开始写游戏服务器 第二期/最新课节--课程代码/class3/src/snake/NetSnake.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,22 @@ import (
88
"code.google.com/p/go.net/websocket"
99
)
1010

11+
// 用户登录的协议
12+
func Send_PlayerLogin(conn *websocket.Conn, strName string, strPW string) {
13+
if len(strName) == 0 || len(strPW) == 0 {
14+
panic("用户名/密码为空!!!")
15+
}
16+
17+
// 组装数据
18+
data := &Proto2.C2S_PlayerLoginS{
19+
Protocol: Proto.G_Snake_Proto, // 游戏主要协议
20+
Protocol2: Proto2.C2S_PlayerLoginSProto2,
21+
Login_Name: strName,
22+
Login_PW: strPW,
23+
}
24+
PlayerSendToServer(conn, data)
25+
}
26+
1127
// 发送坐标数据 --==--
1228
// 数据 X Y Z
1329
func Send_XYZ_Data(conn *websocket.Conn, strOpenID string, strRoomID string, OP_ULRDP string) {

第一季 从零开始写游戏服务器 第二期/最新课节--课程代码/vender/src/Proto/Proto2/Proto2Snake.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const (
1111
C2S_PlayerMoveProto2 // C2S_PlayerMoveProto2 == 5 移动操作
1212
S2S_PlayerMoveProto2 // S2S_PlayerMoveProto2 == 6
1313

14-
//S2S_PlayerMoveProto2 // S2S_PlayerMoveProto2 == 7 玩家死亡操作
14+
// S2S_PlayerMoveProto2 // S2S_PlayerMoveProto2 == 7 玩家死亡操作
1515

1616
)
1717

0 commit comments

Comments
 (0)