Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 7, 2011, 3:11:16 PM (13 years ago)
Author:
landauf
Message:

enhanced chat system. chat related code is now separated into network-side code (located in Host, Client, Server) and client-side code (located in ChatManager).
note that there are now two chat related listeners: NetworkChatListener, which is used to send chat from the network to ChatManager, and ChatListener, which is used to send online and offline chat from ChatManager to the actual chat interfaces (ChatOverlay, ChatInputHandler, …).
the "chat" console command now supports a second argument which is the clientID of the receiver. this allows private messages (or gameplay messages directed to only one specific player).

File:
1 edited

Legend:

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

    r8828 r8829  
    7474
    7575  /* react to incoming chat */
    76   void ChatHistory::incomingChat(const std::string& message,
    77     unsigned int senderID)
     76  void ChatHistory::incomingChat(const std::string& message, const std::string& /*name*/)
    7877  {
    79     /* --> a) look up the actual name of the sender */
    80     std::string text = message;
    81 
    82 #ifndef CHATTEST
    83     /* get sender ID and prepend it to the message */
    84     if (senderID != NETWORK_PEER_ID_UNKNOWN)
    85     {
    86       PlayerInfo* player = PlayerManager::getInstance().getClient(senderID);
    87       if (player)
    88         text = player->getName() + ": " + message;
    89     }
    90 #endif
    91 
    9278    /* add the line to the history */
    93     this->chat_hist_addline( text );
     79    this->chat_hist_addline( message );
    9480
    9581    /* add the line to the log */
    96     this->chat_hist_logline( text );
     82    this->chat_hist_logline( message );
    9783  }
    9884
Note: See TracChangeset for help on using the changeset viewer.