Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 4, 2011, 12:45:06 AM (13 years ago)
Author:
landauf
Message:

Chat works again
Removed console output for almost all gameplay messages (use chat/notifications instead)
Deathmatch level now actually uses Deathmatch gametype

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/output/src/libraries/network/Host.cc

    r8408 r8822  
    9191  void Host::Chat(const std::string& message)
    9292  {
    93     if(instances_s.size()==0)
     93    for (ObjectList<ChatListener>::iterator it = ObjectList<ChatListener>::begin(); it != ObjectList<ChatListener>::end(); ++it)
     94      it->incomingChat(message, 0);
     95
     96    bool result = true;
     97    for( std::vector<Host*>::iterator it = instances_s.begin(); it!=instances_s.end(); ++it )
    9498    {
    95       for (ObjectList<ChatListener>::iterator it = ObjectList<ChatListener>::begin(); it != ObjectList<ChatListener>::end(); ++it)
    96         it->incomingChat(message, 0);
    97 //      return true;
     99      if( (*it)->isActive() )
     100      {
     101        if( !(*it)->chat(message) )
     102          result = false;
     103      }
    98104    }
    99     else
    100     {
    101       bool result = true;
    102       for( std::vector<Host*>::iterator it = instances_s.begin(); it!=instances_s.end(); ++it )
    103       {
    104         if( (*it)->isActive() )
    105         {
    106           if( !(*it)->chat(message) )
    107             result = false;
    108         }
    109       }
    110 //      return result;
    111     }
     105//    return result;
    112106  }
    113107
    114108  bool Host::Broadcast(const std::string& message)
    115109  {
    116     if(instances_s.size()==0)
     110    for (ObjectList<ChatListener>::iterator it = ObjectList<ChatListener>::begin(); it != ObjectList<ChatListener>::end(); ++it)
     111      it->incomingChat(message, NETWORK_PEER_ID_BROADCAST);
     112
     113    bool result = true;
     114    for( std::vector<Host*>::iterator it = instances_s.begin(); it!=instances_s.end(); ++it )
    117115    {
    118       for (ObjectList<ChatListener>::iterator it = ObjectList<ChatListener>::begin(); it != ObjectList<ChatListener>::end(); ++it)
    119         it->incomingChat(message, NETWORK_PEER_ID_BROADCAST);
    120       return true;
     116      if( (*it)->isActive() )
     117      {
     118        if( !(*it)->broadcast(message) )
     119          result = false;
     120      }
    121121    }
    122     else
    123     {
    124       bool result = true;
    125       for( std::vector<Host*>::iterator it = instances_s.begin(); it!=instances_s.end(); ++it )
    126       {
    127         if( (*it)->isActive() )
    128         {
    129           if( !(*it)->broadcast(message) )
    130             result = false;
    131         }
    132       }
    133       return result;
    134     }
     122    return result;
    135123  }
    136124
     
    161149    return false;
    162150  }
    163  
     151
    164152  Host* Host::getActiveInstance()
    165153  {
Note: See TracChangeset for help on using the changeset viewer.