Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 19, 2008, 9:50:36 PM (16 years ago)
Author:
landauf
Message:

added chat overlay

File:
1 edited

Legend:

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

    r1907 r1953  
    3232#include "core/ConsoleCommand.h"
    3333#include "packet/Packet.h"
     34#include "ChatListener.h"
    3435
    3536namespace network {
     
    3839
    3940Host *Host::instance_=0;
    40  
     41
    4142/**
    4243 * @brief Constructor: assures that only one reference will be created and sets the pointer
     
    9091 * @return playerID
    9192 */
    92 unsigned int Host::getPlayerID(){ 
     93unsigned int Host::getPlayerID(){
    9394  if(!instance_)
    9495    return 0;
     
    9697}
    9798
    98 bool Host::Chat(std::string message){
     99bool Host::Chat(const std::string& message){
    99100  if(!instance_)
    100101    return false;
     
    102103}
    103104
    104 bool Host::incomingChat(std::string message, unsigned int playerID){
     105bool Host::Broadcast(const std::string& message){
     106  if(!instance_)
     107    return false;
     108  return instance_->broadcast(message);
     109}
     110
     111bool Host::incomingChat(const std::string& message, unsigned int playerID){
     112  for (orxonox::ObjectList<ChatListener>::iterator it = orxonox::ObjectList<ChatListener>::begin(); it != orxonox::ObjectList<ChatListener>::end(); ++it)
     113    it->incomingChat(message, playerID);
     114
    105115  return instance_->processChat(message, playerID);
    106116}
Note: See TracChangeset for help on using the changeset viewer.