Changed: Merged code from official client

This commit is contained in:
kervala 2013-09-06 15:00:01 +02:00
parent 3c37af1bbc
commit 980b7120c8
2 changed files with 37 additions and 31 deletions

View file

@ -924,33 +924,28 @@ void CChatGroupWindow::removeAllFreeTellers()
void CChatGroupWindow::saveFreeTeller(NLMISC::IStream &f) void CChatGroupWindow::saveFreeTeller(NLMISC::IStream &f)
{ {
f.serialVersion(2); f.serialVersion(2);
uint32 nNbFreeTellerSaved = 0;
f.serial(nNbFreeTellerSaved);
// Don't save the free tellers
//// Save the free teller only if it is present in the friend list to avoid the only-growing situation
//// because free tellers are never deleted in game if we save/load all the free tellers, we just create more
//// and more container.
//uint32 i, nNbFreeTellerSaved = 0;
//for (i = 0; i < _FreeTellers.size(); ++i)
// if (PeopleInterraction.FriendList.getIndexFromName(_FreeTellers[i]->getUCTitle()) != -1)
// nNbFreeTellerSaved++;
//f.serial(nNbFreeTellerSaved);
//for (i = 0; i < _FreeTellers.size(); ++i)
//{
// CGroupContainer *pGC = _FreeTellers[i];
// if (PeopleInterraction.FriendList.getIndexFromName(pGC->getUCTitle()) != -1)
// {
// ucstring sTitle = pGC->getUCTitle();
// f.serial(sTitle);
// }
//}
// Save the free teller only if it is present in the friend list to avoid the only-growing situation
// because free tellers are never deleted in game if we save/load all the free tellers, we just create more
// and more container.
uint32 i, nNbFreeTellerSaved = 0;
for (i = 0; i < _FreeTellers.size(); ++i)
if (PeopleInterraction.FriendList.getIndexFromName(_FreeTellers[i]->getUCTitle()) != -1)
nNbFreeTellerSaved++;
f.serial(nNbFreeTellerSaved);
for (i = 0; i < _FreeTellers.size(); ++i)
{
CGroupContainer *pGC = _FreeTellers[i];
if (PeopleInterraction.FriendList.getIndexFromName(pGC->getUCTitle()) != -1)
{
ucstring sTitle = pGC->getUCTitle();
f.serial(sTitle);
}
}
} }
//================================================================================= //=================================================================================
@ -979,12 +974,11 @@ void CChatGroupWindow::loadFreeTeller(NLMISC::IStream &f)
ucstring sTitle; ucstring sTitle;
f.serial(sTitle); f.serial(sTitle);
// Don't actually create the free teller CGroupContainer *pGC = createFreeTeller(sTitle, "");
//CGroupContainer *pGC = createFreeTeller(sTitle, "");
//// With version 1 all tells are active because windows information have "title based" ids and no "sID based". // With version 1 all tells are active because windows information have "title based" ids and no "sID based".
//if ((ver == 1) && (pGC != NULL)) if ((ver == 1) && (pGC != NULL))
// pGC->setActive(false); pGC->setActive(false);
} }
} }

View file

@ -636,6 +636,18 @@ void CChatManager::chat( const TDataSetRow& sender, const ucstring& ucstr )
{ {
if (session->WriteRight) // player must have the right to speak in the channel if (session->WriteRight) // player must have the right to speak in the channel
{ {
// If universal channel check if player muted
if (session->getChan()->UniversalChannel)
{
if(_MutedUsers.find( eid ) != _MutedUsers.end())
{
nldebug("IOSCM: chat The player %s:%x is muted",
TheDataset.getEntityId(sender).toString().c_str(),
sender.getIndex());
return;
}
}
if (!session->getChan()->getDontBroadcastPlayerInputs()) if (!session->getChan()->getDontBroadcastPlayerInputs())
{ {
// add msg to the historic // add msg to the historic