Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 17, 2010, 3:22:10 PM (14 years ago)
Author:
smerkli
Message:

Added final comments, getting ready for merge

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/chat2/src/orxonox/ChatHistory.cc

    r6846 r6910  
    8080    std::string text;
    8181
    82     //COUT(0) << "Meow.\n";
    83 
    8482#ifndef CHATTEST
     83    /* get sender ID and prepend it to the message */
    8584    if (senderID != CLIENTID_UNKNOWN)
    8685    {
    87        std::string name = "unknown";
    88        PlayerInfo* player = PlayerManager::getInstance().getClient(senderID);
    89        if (player)
    90          name = player->getName();
     86      /* if we can't find anything, use "unknown" as default */
     87      std::string name = "unknown";
    9188
    92          text = name + ": " + message;
     89      PlayerInfo* player = PlayerManager::getInstance().getClient(senderID);
     90      if (player)
     91        name = player->getName();
     92
     93      text = name + ": " + message;
    9394    }
    9495    else
     
    164165  void ChatHistory::chat_hist_closelog()
    165166  {
     167    /* see if we've actually got a logfile */
    166168    if( this->hist_logfile )
    167     { this->chat_hist_logline( "--- Logfile closed ---" );
     169    {
     170      /* yes, we've got one, add a line that shows we're closing it */
     171      this->chat_hist_logline( "--- Logfile closed ---" );
     172
     173      /* actually close down the file */
    168174      this->hist_logfile.close();
    169175    }
Note: See TracChangeset for help on using the changeset viewer.