Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 28, 2010, 4:46:42 PM (14 years ago)
Author:
scheusso
Message:

again some structural changes in network to increase modularity/encapsulation
precondition for fixing client-disconnect bug

Location:
code/branches/network6/src/orxonox
Files:
12 edited

Legend:

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

    r7284 r7823  
    8282#ifndef CHATTEST
    8383    /* get sender ID and prepend it to the message */
    84     if (senderID != CLIENTID_UNKNOWN)
     84    if (senderID != NETWORK_PEER_ID_UNKNOWN)
    8585    {
    8686      /* if we can't find anything, use "unknown" as default */
  • code/branches/network6/src/orxonox/ChatInputHandler.cc

    r7284 r7823  
    207207
    208208    /* setup player name info */
    209     if (senderID != CLIENTID_UNKNOWN)
     209    if (senderID != NETWORK_PEER_ID_UNKNOWN)
    210210    {
    211211       PlayerInfo* player = PlayerManager::getInstance().getClient(senderID);
  • code/branches/network6/src/orxonox/PlayerManager.cc

    r7474 r7823  
    4545        RegisterRootObject(PlayerManager);
    4646
    47         this->getConnectedClients();
     47//         this->getConnectedClients();
    4848    }
    4949
  • code/branches/network6/src/orxonox/gamestates/GSRoot.cc

    r7284 r7823  
    160160    {
    161161        if (!GameMode::isStandalone())
    162             callStaticNetworkFunction(&TimeFactorListener::setTimeFactor, CLIENTID_UNKNOWN, factor_new);
     162            callStaticNetworkFunction(&TimeFactorListener::setTimeFactor, NETWORK_PEER_ID_BROADCAST, factor_new);
    163163    }
    164164}
  • code/branches/network6/src/orxonox/gametypes/Dynamicmatch.cc

    r7284 r7823  
    452452                    if (!it->first)//in order to catch nullpointer
    453453                        continue;
    454                     if (it->first->getClientID() == CLIENTID_UNKNOWN)
     454                    if (it->first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
    455455                        continue;
    456456                    this->gtinfo_->sendStaticMessage("Selection phase: Shoot at everything that moves.",it->first->getClientID(),ColourValue(1.0f, 1.0f, 0.5f));
     
    467467                       if (!it->first)//in order to catch nullpointer
    468468                           continue;
    469                        if (it->first->getClientID() == CLIENTID_UNKNOWN)
     469                       if (it->first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
    470470                           continue;
    471471                       else if (it->second==chaser)
     
    501501                    if (!it->first)//in order to catch nullpointer
    502502                        continue;
    503                     if (it->first->getClientID() == CLIENTID_UNKNOWN)
     503                    if (it->first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
    504504                        continue;
    505505                    this->gtinfo_->sendStaticMessage("Selection phase: Shoot at everything that moves.",it->first->getClientID(),ColourValue(1.0f, 1.0f, 0.5f));
     
    516516                       if (!it->first)
    517517                           continue;
    518                        if (it->first->getClientID() == CLIENTID_UNKNOWN)
     518                       if (it->first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
    519519                           continue;
    520520                       else if (it->second==chaser)
     
    551551                    if (!it->first)//in order to catch nullpointer
    552552                        continue;
    553                     if (it->first->getClientID() == CLIENTID_UNKNOWN)
     553                    if (it->first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
    554554                        continue;
    555555                    this->gtinfo_->sendStaticMessage("Selection phase: Shoot at everything that moves.",it->first->getClientID(),ColourValue(1.0f, 1.0f, 0.5f));
     
    566566                       if (!it->first)
    567567                           continue;
    568                        if (it->first->getClientID() == CLIENTID_UNKNOWN)
     568                       if (it->first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
    569569                           continue;
    570570                       else if (it->second==chaser)
     
    632632            for (std::map<PlayerInfo*, int>::iterator it = this->playerParty_.begin(); it != this->playerParty_.end(); ++it)
    633633            {
    634                 if (it->first->getClientID() == CLIENTID_UNKNOWN)
     634                if (it->first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
    635635                    continue;
    636636                this->gtinfo_->sendStaticMessage("Selection phase: Shoot at everything that moves.",it->first->getClientID(),ColourValue(1.0f, 1.0f, 0.5f));
  • code/branches/network6/src/orxonox/gametypes/Gametype.cc

    r7801 r7823  
    262262                        it->second.frags_++;
    263263
    264                         if (killer->getPlayer()->getClientID() != CLIENTID_UNKNOWN)
     264                        if (killer->getPlayer()->getClientID() != NETWORK_PEER_ID_UNKNOWN)
    265265                            this->gtinfo_->sendKillMessage("You killed " + victim->getPlayer()->getName(), killer->getPlayer()->getClientID());
    266                         if (victim->getPlayer()->getClientID() != CLIENTID_UNKNOWN)
     266                        if (victim->getPlayer()->getClientID() != NETWORK_PEER_ID_UNKNOWN)
    267267                            this->gtinfo_->sendDeathMessage("You were killed by " + killer->getPlayer()->getName(), victim->getPlayer()->getClientID());
    268268                    }
  • code/branches/network6/src/orxonox/gametypes/LastManStanding.cc

    r7655 r7823  
    8686            if (it != this->players_.end())
    8787            {
    88                 if (it->first->getClientID()== CLIENTID_UNKNOWN)
     88                if (it->first->getClientID()== NETWORK_PEER_ID_UNKNOWN)
    8989                    return true;
    9090                const std::string& message = ""; // resets Camper-Warning-message
     
    131131        for (std::map<PlayerInfo*, int>::iterator it = this->playerLives_.begin(); it != this->playerLives_.end(); ++it)
    132132        {
    133             if (it->first->getClientID() == CLIENTID_UNKNOWN)
     133            if (it->first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
    134134                continue;
    135135
     
    194194        if (it != this->players_.end())
    195195        {
    196             if (it->first->getClientID()== CLIENTID_UNKNOWN)
     196            if (it->first->getClientID()== NETWORK_PEER_ID_UNKNOWN)
    197197                return;
    198198            const std::string& message = ""; // resets Camper-Warning-message
     
    249249                    this->inGame_[it->first]=true;
    250250
    251                     if (it->first->getClientID()== CLIENTID_UNKNOWN)
     251                    if (it->first->getClientID()== NETWORK_PEER_ID_UNKNOWN)
    252252                        continue;
    253253                    int output=1+playerDelayTime_[it->first];
     
    261261                    {
    262262                        this->punishPlayer(it->first);
    263                         if (it->first->getClientID()== CLIENTID_UNKNOWN)
     263                        if (it->first->getClientID()== NETWORK_PEER_ID_UNKNOWN)
    264264                            return;
    265265                        const std::string& message = ""; // resets Camper-Warning-message
     
    269269                else if (it->second<timeRemaining/5)//Warning message
    270270                {
    271                     if (it->first->getClientID()== CLIENTID_UNKNOWN)
     271                    if (it->first->getClientID()== NETWORK_PEER_ID_UNKNOWN)
    272272                        continue;
    273273                    const std::string& message = "Camper Warning! Don't forget to shoot.";
  • code/branches/network6/src/orxonox/gametypes/TeamBaseMatch.cc

    r7284 r7823  
    190190            for (std::map<PlayerInfo*, int>::iterator it = this->teamnumbers_.begin(); it != this->teamnumbers_.end(); ++it)
    191191            {
    192                 if (it->first->getClientID() == CLIENTID_UNKNOWN)
     192                if (it->first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
    193193                    continue;
    194194
  • code/branches/network6/src/orxonox/gametypes/UnderAttack.cc

    r6417 r7823  
    7676        for (std::map<PlayerInfo*, int>::iterator it = this->teamnumbers_.begin(); it != this->teamnumbers_.end(); ++it)
    7777        {
    78             if (it->first->getClientID() == CLIENTID_UNKNOWN)
     78            if (it->first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
    7979                continue;
    8080
     
    158158                for (std::map<PlayerInfo*, int>::iterator it = this->teamnumbers_.begin(); it != this->teamnumbers_.end(); ++it)
    159159                {
    160                     if (it->first->getClientID() == CLIENTID_UNKNOWN)
     160                    if (it->first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
    161161                        continue;
    162162
  • code/branches/network6/src/orxonox/infos/GametypeInfo.cc

    r7163 r7823  
    7474        if (GameMode::isMaster())
    7575        {
    76             callMemberNetworkFunction(GametypeInfo, dispatchAnnounceMessage, this->getObjectID(), CLIENTID_UNKNOWN, message);
     76            callMemberNetworkFunction(GametypeInfo, dispatchAnnounceMessage, this->getObjectID(), NETWORK_PEER_ID_BROADCAST, message);
    7777            this->dispatchAnnounceMessage(message);
    7878        }
  • code/branches/network6/src/orxonox/infos/HumanPlayer.cc

    r6417 r7823  
    3232#include "core/ConfigValueIncludes.h"
    3333#include "core/GameMode.h"
    34 #include "network/ClientInformation.h"
     34// #include "network/ClientInformation.h"
    3535#include "network/Host.h"
    3636#include "controllers/HumanController.h"
     
    144144    float HumanPlayer::getPing() const
    145145    {
    146         return static_cast<float>(ClientInformation::findClient(this->getClientID())->getRTT());
     146//         return static_cast<float>(ClientInformation::findClient(this->getClientID())->getRTT());
     147        return 0.; //TODO: reimplement this
    147148    }
    148149
    149150    float HumanPlayer::getPacketLossRatio() const
    150151    {
    151         return static_cast<float>(ClientInformation::findClient(this->getClientID())->getPacketLoss());
     152      //         return static_cast<float>(ClientInformation::findClient(this->getClientID())->getPacketLoss());
     153        return 0.; //TODO: reimplement this
    152154    }
    153155
  • code/branches/network6/src/orxonox/infos/PlayerInfo.cc

    r7163 r7823  
    3232
    3333#include "core/CoreIncludes.h"
    34 #include "network/ClientInformation.h"
     34// #include "network/ClientInformation.h"
    3535#include "gametypes/Gametype.h"
    3636#include "worldentities/ControllableEntity.h"
     
    4343        RegisterObject(PlayerInfo);
    4444
    45         this->clientID_ = CLIENTID_UNKNOWN;
     45        this->clientID_ = NETWORK_PEER_ID_UNKNOWN;
    4646        this->bHumanPlayer_ = false;
    4747        this->bLocalPlayer_ = false;
Note: See TracChangeset for help on using the changeset viewer.