Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 601 for code/branches/FICN


Ignore:
Timestamp:
Dec 17, 2007, 10:31:38 PM (17 years ago)
Author:
dumenim
Message:

blub

Location:
code/branches/FICN/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FICN/src/network/Client.cc

    r565 r601  
    181181    ENetPacket *packet;
    182182    // stop if the packet queue is empty
    183     while(!client_connection.queueEmpty()){
     183    while(!(client_connection.queueEmpty())){
    184184      packet = client_connection.getPacket();
    185185      elaborate(packet, 0); // ================= i guess we got to change this .... (client_ID is always same = server)
  • code/branches/FICN/src/network/NetworkFrameListener.h

    r463 r601  
    1717#include "Server.h"
    1818#include "Client.h"
     19//#include <iostream>
    1920// #include "orxonox/orxonox.cc"
    2021network::Server *server_g;
     
    3536private:
    3637  bool frameStarted(const Ogre::FrameEvent &evt){
     38    std::cout << "framelistener" << std::endl;
    3739    client_g->tick(evt.timeSinceLastFrame);
    3840    return FrameListener::frameStarted(evt);
  • code/branches/FICN/src/network/Server.cc

    r479 r601  
    8686  bool Server::sendMSG(const char *msg){
    8787    ENetPacket *packet = packet_gen.chatMessage(msg);
    88     //std::cout <<"adding packets" << std::endl;
     88    std::cout <<"adding PPPPPackets" << std::endl;
    8989    connection->addPacketAll(packet);
    9090    //std::cout <<"added packets" << std::endl;
    91     return connection->sendPackets();
     91    if (connection->sendPackets()){
     92        std::cout << "SSSSSucessfully" << std::endl;
     93        return true;
     94    }
     95    return false;
    9296  }
    9397 
  • code/branches/FICN/src/network/dummyclient3.cc

    r536 r601  
    3434          std::getline( std::cin, str );
    3535          client.sendChat( str );
    36           std::cout << "send message" << std::endl;
     36          std::cout << "sent message" << std::endl;
    3737  }
    3838
     
    4242
    4343void listener(){
    44 
     44       
    4545  const int PORT = 55556;
    4646  std::cout << "Enter address of the server xxx.xxx.xxx.xxx (enter for localhost)" << std::endl;
  • code/branches/FICN/src/orxonox/orxonox.cc

    r599 r601  
    8787  {
    8888    public:
    89       OrxListener(OIS::Keyboard *keyboard, OIS::Mouse *mouse, audio::AudioManager*  auMan, SpaceshipSteering* steering)
     89      OrxListener(OIS::Keyboard *keyboard, OIS::Mouse *mouse, audio::AudioManager*  auMan, SpaceshipSteering* steering, gameMode mode)
    9090      : mKeyboard(keyboard), mMouse(mouse)
    9191      {
    9292
    9393
    94 
     94        mode_=mode;
    9595        speed = 250;
    9696        loop = 100;
     
    162162        //if(mKeyboard->isKeyDown(OIS::KC_ESCAPE))
    163163          //cout << "maximal MouseX: " << maxMouseX << "\tminMouseX: " << minMouseX << endl;
     164        if(mode_==SERVER)
     165          server_g->tick(evt.timeSinceLastFrame);
    164166        usleep(10);
    165167        return !mKeyboard->isKeyDown(OIS::KC_ESCAPE);
     
    181183
    182184    private:
     185      gameMode mode_;
    183186      float speed;
    184187      float rotate;
     
    276279    switch(mode_){
    277280    case PRESENTATION:
     281      //ogre_->getRoot()->addFrameListener(new network::ServerFrameListener());
     282      //std::cout << "could not add framelistener" << std::endl;
    278283      server_g->open();
    279284      break;
     
    369374    if(!ogre_->load()) die(/* unable to load */);
    370375    // add network framelistener
    371     ogre_->getRoot()->addFrameListener(new network::ServerFrameListener());
    372376  }
    373377
     
    536540
    537541    //if(mode_!=CLIENT) // just a hack ------- remove this in future
    538       frameListener_ = new OrxListener(keyboard_, mouse_, auMan_, steering_);
     542      frameListener_ = new OrxListener(keyboard_, mouse_, auMan_, steering_, mode_);
    539543    ogre_->getRoot()->addFrameListener(frameListener_);
    540544  }
Note: See TracChangeset for help on using the changeset viewer.