Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 29, 2009, 4:05:35 PM (16 years ago)
Author:
scheusso
Message:

commit for testing reasons

  • added possibility to transfer function calls over network
  • made MultiType serialisable
  • put serialise functions from synchronisable to util
  • … (can't remember )
Location:
code/branches/netp2/src
Files:
6 added
1 deleted
11 edited

Legend:

Unmodified
Added
Removed
  • code/branches/netp2/src/network/CMakeLists.txt

    r2748 r2937  
    2525  ClientConnectionListener.cc
    2626  ConnectionManager.cc
     27  FunctionCallManager.cc
    2728  GamestateManager.cc
    2829  GamestateClient.cc
    2930  GamestateHandler.cc
     31  NetworkFunction.cc
     32  Host.cc
    3033  PacketBuffer.cc
    3134  Server.cc
    3235  TrafficControl.cc
    33   Host.cc
    3436)
    3537ADD_SUBDIRECTORY(packet)
  • code/branches/netp2/src/network/NetworkPrereqs.h

    r2773 r2937  
    9090  class ClientInformation;
    9191  class ConnectionManager;
     92  class FunctionCallManager;
    9293  class GamestateClient;
    9394  class GamestateManager;
     
    9697  template <class T> class NetworkCallback;
    9798  class NetworkCallbackManager;
     99  class NetworkFunctionBase;
     100  class NetworkFunctionStatic;
     101  class NetworkMemberFunctionBase;
     102  template <class T> class NetworkMemeberFunction;
     103  struct NetworkFunctionPointer;
    98104  class PacketBuffer;
    99105  class Server;
     
    112118  namespace packet
    113119  {
     120    class Acknowledgement;
     121    class Chat;
     122    class ClassID;
     123    class FunctionCalls;
     124    class FunctionIDs;
    114125    class Gamestate;
     126    class NetworkIDs;
    115127    class Packet;
    116     class Acknowledgement;
    117     class ClassID;
    118128    class Welcome;
    119     class Chat;
    120129  }
    121130}
  • code/branches/netp2/src/network/packet/CMakeLists.txt

    r2710 r2937  
    11ADD_SOURCE_FILES(NETWORK_SRC_FILES
    22  Packet.cc
     3  Acknowledgement.cc
    34  Chat.cc
    45  ClassID.cc
    5   Acknowledgement.cc
     6  DeleteObjects.cc
     7  FunctionIDs.cc
     8  FunctionCalls.cc
    69  Gamestate.cc
    710  Welcome.cc
    8   DeleteObjects.cc
    911)
  • code/branches/netp2/src/network/packet/ClassID.cc

    r2773 r2937  
    9393  }
    9494 
    95   COUT(0) << "classid packetSize is " << packetSize << endl;
     95  COUT(5) << "classid packetSize is " << packetSize << endl;
    9696 
    9797}
  • code/branches/netp2/src/network/packet/Packet.cc

    r2773 r2937  
    153153    case ENUM::Welcome:
    154154    case ENUM::DeleteObjects:
     155    case ENUM::FunctionIDs:
     156    case ENUM::FunctionCalls:
    155157      break;
    156158    default:
  • code/branches/netp2/src/network/packet/Packet.h

    r2836 r2937  
    4545  enum Type{
    4646    Acknowledgement,
     47    Chat,
     48    ClassID,
     49    DeleteObjects,
     50    FunctionIDs,
     51    FunctionCalls,
    4752    Gamestate,
    48     ClassID,
    49     Chat,
    50     Welcome,
    51     DeleteObjects
     53    Welcome
    5254  };
    5355}
     
    7880    Packet(uint8_t *data, unsigned int clientID);
    7981//    Packet(ENetPacket *packet, ENetPeer *peer);
     82    inline bool isDataENetAllocated() const
     83      { return bDataENetAllocated_; }
     84
    8085    uint32_t flags_;
    8186    unsigned int clientID_;
  • code/branches/netp2/src/network/synchronisable/Synchronisable.h

    r2836 r2937  
    122122  public:
    123123    friend class packet::Gamestate;
    124 //     friend class Server;
    125124    virtual ~Synchronisable();
    126125
  • code/branches/netp2/src/orxonox/OrxonoxPrereqs.h

    r2826 r2937  
    159159    class SpawnPoint;
    160160    class TeamSpawnPoint;
     161    class Test;
    161162
    162163    class Spectator;
  • code/branches/netp2/src/orxonox/objects/Test.cc

    r2662 r2937  
    3131#include "core/ConfigValueIncludes.h"
    3232#include "core/ConsoleCommand.h"
     33#include "network/NetworkFunction.h"
    3334#include "Test.h"
    3435
     
    4142  SetConsoleCommand(Test, printV3, true).accessLevel(AccessLevel::User);
    4243  SetConsoleCommand(Test, printV4, true).accessLevel(AccessLevel::User);
     44  SetConsoleCommand(Test, call, true).accessLevel(AccessLevel::User);
     45 
     46 
     47  //void=* aaaaa = copyPtr<sizeof(&Test::printV1)>( &NETWORK_FUNCTION_POINTER, &Test::printV1 );
     48  //void* NETWORK_FUNCTION_TEST_B = memcpy(&NETWORK_FUNCTION_POINTER, &a, sizeof(a));
     49//   NetworkFunctionBase* NETWORK_FUNCTION_TEST_C = new NetworkFunctionStatic( createFunctor(&Test::printV1), "bla", NETWORK_FUNCTION_POINTER );
     50 
     51  registerStaticNetworkFunction( &Test::printV1, "printV1" );
    4352 
    4453  Test* Test::instance_ = 0;
     
    8594    registerVariable ( s4, variableDirection::clientMaster, new NetworkCallback<Test> ( this, &Test::checkS4 ), true );
    8695        }
    87 
     96 
     97  void Test::call(unsigned int clientID)
     98  {
     99    callStaticNetworkFunction( &Test::printV1, clientID );
     100  }
     101 
    88102  void Test::checkU1(){ COUT(1) << "U1 changed: " << u1 << std::endl; }
    89103  void Test::checkU2(){ COUT(1) << "U2 changed: " << u2 << std::endl; }
  • code/branches/netp2/src/orxonox/objects/Test.h

    r2662 r2937  
    4949      void setConfigValues();
    5050      void registerVariables();
     51     
     52      void call(unsigned int clientID);
    5153
    5254
  • code/branches/netp2/src/util/MultiType.h

    r2861 r2937  
    330330            inline void                       exportData(uint8_t*& mem) { assert(sizeof(MT_Type)<=8); this->setType(*(uint8_t*)mem); mem+=sizeof(uint8_t); this->value_->exportData(mem); }
    331331            /** @brief Saves the value of the MT to a bytestream and increases pointer to bytestream by size of MT */
    332             inline uint8_t*& operator << (uint8_t*& mem) { importData(mem); return mem; }
     332            inline uint8_t*&                  operator << (uint8_t*& mem) { importData(mem); return mem; }
    333333            /** @brief Loads the value of the MT to a bytestream and increases pointer to bytestream by size of MT */
    334             inline void operator >> (uint8_t*& mem) { exportData(mem); }
     334            inline void                       operator >> (uint8_t*& mem) { exportData(mem); }
     335            inline uint32_t                   getNetworkSize() { assert(this->value_); return this->value_->getSize() + sizeof(uint8_t); }
    335336
    336337            /** @brief Checks whether the value is a default one. */
Note: See TracChangeset for help on using the changeset viewer.