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) {
6161 switch v .(interface {}).(type ) {
6262 case * NetDataConn :
6363 { // 发送数据操作
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 ,
6872 }
73+ // 发送数据
6974 v .(interface {}).(* NetDataConn ).PlayerSendMessage (data )
7075 }
7176 }
7277 }
7378 }
7479 }
7580 // -------------------------------------------------------------------------
76- return
7781}
Original file line number Diff line number Diff line change @@ -58,8 +58,10 @@ func (this *NetDataConn) EntryGameSnake(ProtocolData map[string]interface{}) {
5858 // 发送数据给客户端了
5959 this .PlayerSendMessage (data )
6060 // 保存同一个玩家的数据信息
61+ // 数据管理 --- data
6162 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 )
6365 }
6466 return
6567}
@@ -93,6 +95,7 @@ func (this *NetDataConn) LoginGameSnake(ProtocolData map[string]interface{}) {
9395 return
9496 }
9597 StrLogin_Name := ProtocolData ["Login_Name" ].(string )
98+ _ = StrLogin_Name
9699 // StrLogin_PW := ProtocolData["Login_PW"].(string)
97100 // 数据库验证
98101 // 1 获取到UID 信息
You can’t perform that action at this time.
0 commit comments