Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

merged output branch back to trunk.

Changes:

  • you have to include util/Output.h instead of util/Debug.h
  • COUT(x) is now called orxout(level)
  • output levels are now defined by an enum instead of numbers. see util/Output.h for the definition
  • it's possible to use output contexts with orxout(level, context). see util/Output.h for some common contexts. you can define more contexts
  • you must use 'endl' at the end of an output message, '\n' does not flush the message

Output levels:

  • instead of COUT(0) use orxout()
  • instead of COUT(1) use orxout(user_error) or orxout(internal_error)
  • instead of COUT(2) use orxout(user_warning) or orxout(internal_warning)
  • instead of COUT(3) use orxout(user_status/user_info) or orxout(internal_status/internal_info)
  • instead of COUT(4) use orxout(verbose)
  • instead of COUT(5) use orxout(verbose_more)
  • instead of COUT(6) use orxout(verbose_ultra)

Guidelines:

  • user_* levels are for the user, visible in the console and the log-file
  • internal_* levels are for developers, visible in the log-file
  • verbose_* levels are for debugging, only visible if the context of the output is activated

Usage in C++:

  • orxout() << "message" << endl;
  • orxout(level) << "message" << endl;
  • orxout(level, context) << "message" << endl;

Usage in Lua:

  • orxout("message")
  • orxout(orxonox.level.levelname, "message")
  • orxout(orxonox.level.levelname, "context", "message")

Usage in Tcl (and in the in-game-console):

  • orxout levelname message
  • orxout_context levelname context message
  • shortcuts: log message, error message, warning message, status message, info message, debug message
Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/gametypes/Dynamicmatch.cc

    r8729 r8858  
    4949#include "core/CoreIncludes.h"
    5050#include "core/command/Executor.h"
    51 #include "network/Host.h"
     51#include "chat/ChatManager.h"
    5252#include "infos/PlayerInfo.h"
    5353#include "worldentities/pawns/Pawn.h"
     
    342342        numberOf[chaser]++;
    343343        Gametype::playerEntered(player);
    344         const std::string& message6 = player->getName() + " entered the game";
    345         COUT(0) << message6 << std::endl;
    346         Host::Broadcast(message6);
     344        const std::string& message = player->getName() + " entered the game";
     345        ChatManager::message(message);
    347346    }
    348347
     
    359358            }
    360359            const std::string& message = player->getName() + " left the game";
    361             COUT(0) << message << std::endl;
    362             Host::Broadcast(message);
     360            ChatManager::message(message);
    363361            //remove player from map
    364362            playerParty_.erase (player);
     
    617615        {
    618616            const std::string& message = player->getOldName() + " changed name to " + player->getName();
    619             COUT(0) << message << std::endl;
    620             Host::Broadcast(message);
     617            ChatManager::message(message);
    621618        }
    622619
     
    630627        {
    631628            std::string message("Dynamicmatch started!");
    632             COUT(0) << message << std::endl;
    633             Host::Broadcast(message);
     629            ChatManager::message(message);
    634630        }
    635631        else if(tutorial) // Announce selectionphase
     
    647643    {
    648644        std::string message("Earn points:\n\n\n\tIf you're red: Chase the blue player!\n\n\tIf you're blue shoot at a red player or hide.\n\n\tIf you're green: You've got the licence to kill red players!");
    649         COUT(0) << message << std::endl;
    650         Host::Broadcast(message);
     645        ChatManager::message(message);
    651646        callInstructions_.setTimer(10, false, createExecutor(createFunctor(&Dynamicmatch::furtherInstructions, this)));
    652647    }
     
    655650    {
    656651        std::string message("After 3 Minutes the game is over.");
    657         COUT(0) << message << std::endl;
    658         Host::Broadcast(message);
     652        ChatManager::message(message);
    659653    }*/
    660654    void Dynamicmatch::end()
     
    663657
    664658        std::string message("Time out. Press F2 to see the points you scored.");
    665         COUT(0) << message << std::endl;
    666         Host::Broadcast(message);
     659        ChatManager::message(message);
    667660    }
    668661    SpawnPoint* Dynamicmatch::getBestSpawnPoint(PlayerInfo* player) const
Note: See TracChangeset for help on using the changeset viewer.