Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9305 in orxonox.OLD for branches/proxy/src/lib


Ignore:
Timestamp:
Jul 17, 2006, 1:54:36 PM (18 years ago)
Author:
bensch
Message:

compiles again

Location:
branches/proxy/src/lib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/proxy/src/lib/coord/p_node.h

    r9304 r9305  
    7373
    7474//! Patent Node is a Engine to calculate the position of an Object in respect to the position of its parent.
    75 class PNode : virtual public BaseObject, public Synchronizeable {
     75class PNode : virtual public BaseObject, virtual public Synchronizeable {
    7676 public:
    7777  PNode (PNode* parent = PNode::getNullParent(), long nodeFlags = PNODE_PARENT_MODE_DEFAULT);
  • branches/proxy/src/lib/util/ip.cc

    r9304 r9305  
    77
    88#include "ip.h"
     9#include "multi_type.h"
    910
    1011IP::IP()
     
    2324
    2425
     26
     27
    2528int IP::stringToIP(const std::string& ip)
    2629{
    2730
    28 
    2931}
    3032
    31 const std::string& IP::ipToString(int ip)
     33std::string IP::ipToString(const IPaddress& ipaddr)
    3234{
    33   std::string ipaddr;
    34 
    35   number = SDLNet_Read32 (&addr.host);
    36   printf ("Host-Reihenfolge:     %d.%d.%d.%d\n",
    37           (number & 0xFF000000)>>24, (number & 0x00FF0000)>>16,
    38           (number & 0x0000FF00)>>8, (number & 0x000000FF));
     35  int ip = SDLNet_Read32 (ipaddr.host);
     36  return ipToString(ip);
    3937}
    4038
     39
     40std::string IP::ipToString(int ip)
     41{
     42  MultiType part0( (ip & 0xFF000000) >> 24);
     43  MultiType part1( (ip & 0x00FF0000) >> 16);
     44  MultiType part2( (ip & 0x0000FF00) >>  8);
     45  MultiType part3( (ip & 0x000000FF) );
     46
     47
     48  return part0.getString() + "." + part1.getString() + "." +
     49           part2.getString() + "." + part3.getString();
     50}
     51
  • branches/proxy/src/lib/util/ip.h

    r9304 r9305  
    2424
    2525
    26     float ip() const;
    27     float ip(unsigned int part) const;
     26    int ip() const { return this->_ip; };
     27    short port() const { return this->_port; };
    2828
     29    int ip(unsigned int part) const;
    2930    std::string& ipString() const;
    3031
     
    3334  public:
    3435    static int stringToIP(const std::string& ip);
    35     static const std::string& ipToString(int ip);
     36    static std::string ipToString(const IPaddress& ipaddr);
     37    static std::string ipToString(int ip);
    3638
    3739  private:
    3840    int           _ip;  //!< the IP in int form.
    39 
     41    short         _port;
    4042
    4143};
Note: See TracChangeset for help on using the changeset viewer.