@@ -45,7 +45,7 @@ BOOL LogicSvrMgr::RegisterLogicServer(UINT32 dwConnID, UINT32 dwServerID, std::s
45
45
return TRUE ;
46
46
}
47
47
48
- BOOL LogicSvrMgr::UnregisterLogicServer (UINT32 dwConnID, UINT32 dwServerID)
48
+ BOOL LogicSvrMgr::UnregisterLogicServer (UINT32 dwServerID)
49
49
{
50
50
LogicServerNode* pNode = GetLogicServerInfo (dwServerID);
51
51
if (pNode == NULL )
@@ -58,6 +58,23 @@ BOOL LogicSvrMgr::UnregisterLogicServer(UINT32 dwConnID, UINT32 dwServerID)
58
58
return TRUE ;
59
59
}
60
60
61
+ BOOL LogicSvrMgr::OnCloseConnect (UINT32 dwConnID)
62
+ {
63
+ for (auto itor = m_mapServer.begin (); itor != m_mapServer.end (); ++itor)
64
+ {
65
+ LogicServerNode* pNode = itor->second ;
66
+ ERROR_CONTINUE_EX (pNode != NULL );
67
+
68
+ if (pNode->m_dwConnID == dwConnID)
69
+ {
70
+ pNode->m_dwConnID = 0 ;
71
+ }
72
+
73
+ }
74
+
75
+ return TRUE ;
76
+ }
77
+
61
78
UINT32 LogicSvrMgr::GetLogicConnID (UINT32 dwServerID)
62
79
{
63
80
LogicServerNode* pNode = GetLogicServerInfo (dwServerID);
@@ -85,6 +102,24 @@ BOOL LogicSvrMgr::SendMsgProtoBuf(UINT32 dwServerID, UINT32 dwMsgID, const googl
85
102
return ServiceBase::GetInstancePtr ()->SendMsgProtoBuf (GetLogicConnID (dwServerID), dwMsgID, 0 , 0 , pdata);
86
103
}
87
104
105
+ BOOL LogicSvrMgr::BroadMsgToAll (UINT32 dwMsgID, const google::protobuf::Message& pdata, UINT32 nNoConnID)
106
+ {
107
+ for (auto itor = m_mapServer.begin (); itor != m_mapServer.end (); ++itor)
108
+ {
109
+ LogicServerNode* pServerNode = itor->second ;
110
+ ERROR_CONTINUE_EX (pServerNode != NULL );
111
+
112
+ if (pServerNode->m_dwConnID == nNoConnID)
113
+ {
114
+ continue ;
115
+ }
116
+
117
+ ServiceBase::GetInstancePtr ()->SendMsgProtoBuf (pServerNode->m_dwConnID , dwMsgID, 0 , 0 , pdata);
118
+ }
119
+
120
+ return TRUE ;
121
+ }
122
+
88
123
BOOL LogicSvrMgr::SendMsgRawData (UINT32 dwServerID, UINT32 dwMsgID, const char * pdata, UINT32 dwLen)
89
124
{
90
125
return ServiceBase::GetInstancePtr ()->SendMsgRawData (GetLogicConnID (dwServerID), dwMsgID, 0 , 0 , pdata, dwLen);
0 commit comments