From c7de963dd6bbaff309d72de11d0857f2aec61b83 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 7 Sep 2023 10:24:30 +0800 Subject: [PATCH] 1 --- server/hallserver/player.go | 24 ++++++++++++------------ server/hallserver/roommgr.go | 2 ++ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/server/hallserver/player.go b/server/hallserver/player.go index 96368382..b7cbd77f 100644 --- a/server/hallserver/player.go +++ b/server/hallserver/player.go @@ -8,20 +8,20 @@ import ( type Player struct { cs.MsgHandlerImpl - socket f5.WspCliConn - accountId string - sessionId string - chatChannel int - privateTargetAccountId string // 私聊对象 accountId - worldChannelLastId uint64 // 世界聊天 last id - guildChannelLastId uint64 // 公会聊天 last id - privateChatLastId uint64 // 私聊 last id + socket f5.WspCliConn + accountId string + sessionId string + room *Room } -func (p *Player) GetAccountId() string { - return p.accountId +func (this *Player) GetAccountId() string { + return this.accountId } -func (p *Player) SendMsg(rspMsg proto.Message) { - wspListener.sendProxyMsg(p.socket.Conn, p.socket.SocketHandle, rspMsg) +func (this *Player) SendMsg(rspMsg proto.Message) { + wspListener.sendProxyMsg(this.socket.Conn, this.socket.SocketHandle, rspMsg) +} + +func (this *Player) GetRoom() *Room { + return this.room } diff --git a/server/hallserver/roommgr.go b/server/hallserver/roommgr.go index aa56c65c..8c79da91 100644 --- a/server/hallserver/roommgr.go +++ b/server/hallserver/roommgr.go @@ -6,11 +6,13 @@ import ( type RoomMgr struct { cs.MsgHandlerImpl + currRoomId int32 idHash map[int32]*Room } func (this *RoomMgr) init() { this.idHash = make(map[int32]*Room) + this.currRoomId = 10000 } func (this *RoomMgr) unInit() {