本文整理汇总了C++中CDevice::SetInNegotiation方法的典型用法代码示例。如果您正苦于以下问题:C++ CDevice::SetInNegotiation方法的具体用法?C++ CDevice::SetInNegotiation怎么用?C++ CDevice::SetInNegotiation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDevice
的用法示例。
在下文中一共展示了CDevice::SetInNegotiation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnClientDisconnect
virtual void OnClientDisconnect() {
CDevice *pDevice = DeviceForClient(*m_pClient);
if (pDevice) {
pDevice->SetInNegotiation(false);
pDevice->RemoveClient(*m_pClient);
}
}
示例2: HandleUserRaw
virtual EModRet HandleUserRaw(CClient* pClient, CString& sLine) {
if (sLine.Token(0).Equals(kPLVCommand)) {
CString sCommand = sLine.Token(1);
if (sCommand.Equals("BACKGROUND")) {
m_pClient->SetAway(true);
} else if (sCommand.Equals("FOREGROUND")) {
m_pClient->SetAway(false);
} else if (sCommand.Equals("IDENTIFY")) {
CDevice *pDevice = DeviceForClient(*pClient);
if (pDevice) {
pDevice->RemoveClient(*pClient);
}
CString sToken = sLine.Token(2);
CString sVersion = sLine.Token(3);
CDevice& device = DeviceWithToken(sToken);
if (device.InNegotiation() == false && device.GetVersion().Equals(sVersion) == false) {
pClient->PutClient("PALAVER REQ *");
device.SetInNegotiation(true);
}
device.AddClient(*pClient);
if (m_pNetwork) {
device.AddNetwork(*m_pNetwork);
}
} else if (sCommand.Equals("BEGIN")) {
CString sToken = sLine.Token(2);
CString sVersion = sLine.Token(3);
CDevice& device = DeviceWithToken(sToken);
device.ResetDevice();
device.SetInNegotiation(true);
device.SetVersion(sVersion);
device.AddClient(*pClient);
} else if (sCommand.Equals("END")) {
CDevice *pDevice = DeviceForClient(*pClient);
if (pDevice) {
pDevice->SetInNegotiation(false);
}
} else if (sCommand.Equals("SET")) {
CString sKey = sLine.Token(2);
CString sValue = sLine.Token(3, true);
CDevice *pDevice = DeviceForClient(*pClient);
if (pDevice) {
if (sKey.Equals("VERSION")) {
pDevice->SetVersion(sValue);
} else if (sKey.Equals(kPLVPushEndpointKey)) {
pDevice->SetPushEndpoint(sValue);
}
}
} else if (sCommand.Equals("ADD")) {
CString sKey = sLine.Token(2);
CString sValue = sLine.Token(3, true);
CDevice *pDevice = DeviceForClient(*pClient);
if (pDevice) {
if (sKey.Equals(kPLVIgnoreKeywordKey)) {
pDevice->AddIgnoreKeyword(sValue);
} else if (sKey.Equals(kPLVIgnoreChannelKey)) {
pDevice->AddIgnoreChannel(sValue);
} else if (sKey.Equals(kPLVIgnoreNickKey)) {
pDevice->AddIgnoreNick(sValue);
} else if (sKey.Equals(kPLVMentionKeywordKey)) {
pDevice->AddMentionKeyword(sValue);
} else if (sKey.Equals(kPLVMentionChannelKey)) {
pDevice->AddMentionChannel(sValue);
} else if (sKey.Equals(kPLVMentionNickKey)) {
pDevice->AddMentionNick(sValue);
}
}
}
return HALT;
}
return CONTINUE;
}