File tree Expand file tree Collapse file tree 2 files changed +13
-6
lines changed
第一季 从零开始写游戏服务器 第二期/最新课节--课程代码/class3/src/classcode Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -61,17 +61,21 @@ func PlayerSendBroadcastToRoomPlayer(iroomID int) {
61
61
switch v .(interface {}).(type ) {
62
62
case * NetDataConn :
63
63
{ // 发送数据操作
64
- data := & Proto2.Net_Kicking_Player {
65
- Protocol : Proto .GameNet_Proto ,
66
- Protocol2 : Proto2 .Net_Kicking_PlayerProto2 ,
67
- ErrorCode : 10001 ,
64
+ data := & Proto2.C2S_PlayerAddGame {
65
+ Protocol : Proto .GameNet_Proto ,
66
+ Protocol2 : Proto2 .Net_Kicking_PlayerProto2 ,
67
+ OpenID : "1212334" ,
68
+ RoomID : 1 ,
69
+ PlayerHeadURL : "11" ,
70
+ Init_X : 13 ,
71
+ Init_Y : 10 ,
68
72
}
73
+ // 发送数据
69
74
v .(interface {}).(* NetDataConn ).PlayerSendMessage (data )
70
75
}
71
76
}
72
77
}
73
78
}
74
79
}
75
80
// -------------------------------------------------------------------------
76
- return
77
81
}
Original file line number Diff line number Diff line change @@ -58,8 +58,10 @@ func (this *NetDataConn) EntryGameSnake(ProtocolData map[string]interface{}) {
58
58
// 发送数据给客户端了
59
59
this .PlayerSendMessage (data )
60
60
// 保存同一个玩家的数据信息
61
+ // 数据管理 --- data
61
62
if data .RoomID != 0 {
62
- this .MapSafe .Put (strCode + "|" + util .MD5_LollipopGO (strRoom )+ "|room" , this )
63
+ this .MapSafe .Put (strCode + "|" + util .MD5_LollipopGO ("1" )+ "|room" , this )
64
+ PlayerSendBroadcastToRoomPlayer (1 )
63
65
}
64
66
return
65
67
}
@@ -93,6 +95,7 @@ func (this *NetDataConn) LoginGameSnake(ProtocolData map[string]interface{}) {
93
95
return
94
96
}
95
97
StrLogin_Name := ProtocolData ["Login_Name" ].(string )
98
+ _ = StrLogin_Name
96
99
// StrLogin_PW := ProtocolData["Login_PW"].(string)
97
100
// 数据库验证
98
101
// 1 获取到UID 信息
You can’t perform that action at this time.
0 commit comments