Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 14, 2007, 3:35:18 PM (17 years ago)
Author:
scheusso
Message:

blabla

Location:
code/branches/network/src/network
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network/src/network/Makefile

    r205 r208  
    66
    77# Link command:
    8 server: clean PacketBuffer.o ConnectionManager.o dummyserver.o PacketDecoder.o PacketGenerator.o
    9         g++ PacketDecoder.o PacketGenerator.o ConnectionManager.o dummyserver.o PacketBuffer.o -o server -lenet -lboost_thread -g
     8server: PacketBuffer.o ConnectionManager.o dummyserver.o PacketDecoder.o PacketGenerator.o
     9        ${CC} PacketDecoder.o PacketGenerator.o ConnectionManager.o dummyserver.o PacketBuffer.o -o server -lenet -lboost_thread -g
    1010
    11 dummyserver.o:
    12         g++ -c dummyserver.cc -o dummyserver.o -g ${INC}
     11dummyserver.o: dummyserver.cc
     12        ${CC} -c dummyserver.cc -o dummyserver.o -g ${INC}
    1313# Compilation commands:
    14 ConnectionManager.o:
    15         g++ -c ConnectionManager.cc -o ConnectionManager.o -g ${INC}
     14ConnectionManager.o: ConnectionManager.cc
     15        ${CC} -c ConnectionManager.cc -o ConnectionManager.o -g ${INC}
    1616
    17 PacketBuffer.o:
    18         g++ -c PacketBuffer.cc -o PacketBuffer.o -g ${INC}
    19 PacketGenerator.o:
    20         g++ -c PacketGenerator.cc -o PacketGenerator.o -g ${INC}
    21 PacketDecoder.o:
    22         g++ -c PacketDecoder.cc -o PacketDecoder.o -g ${INC}
     17PacketBuffer.o: PacketBuffer.cc
     18        ${CC} -c PacketBuffer.cc -o PacketBuffer.o -g ${INC}
     19PacketGenerator.o: PacketGenerator.cc
     20        ${CC} -c PacketGenerator.cc -o PacketGenerator.o -g ${INC}
     21PacketDecoder.o: PacketDecoder.cc
     22        ${CC} -c PacketDecoder.cc -o PacketDecoder.o -g ${INC}
    2323
    2424
     
    2626        rm -rf *.o
    2727
    28 client: PacketGenerator.o
    29         g++ dummyclient.cc PacketGenerator.o -o client -lenet -g ${INC}
     28client: PacketGenerator.o dummyclient.cc
     29        ${CC} dummyclient.cc PacketGenerator.o -o client -lenet -g ${INC}
  • code/branches/network/src/network/dummyclient.cc

    r204 r208  
    55
    66#include <iostream>
     7#include <string>
    78#include <enet/enet.h>
    89#include "network/PacketManager.h"
     
    2021  atexit(enet_deinitialize);
    2122 
    22   enet_address_set_host(&address, "127.0.0.1");
     23  cout << "Enter address of the server xxx.xxx.xxx.xxx (enter for localhost)" << endl;
     24  string str;
     25  getline(cin, str);
     26  cout << "You entered: " << str << endl;
     27  if(str.compare("")==0)
     28    str="127.0.0.1";
     29 
     30  enet_address_set_host(&address, str.c_str());
    2331  address.port = 5555;
    2432
     
    3846        // wait 5 seconds for the connection attempt to succeed
    3947  if(enet_host_service(client, &event, 5000) > 0 && event.type == ENET_EVENT_TYPE_CONNECT){
    40     puts("Connection to localhost:5555 succeeded.");
     48    cout << "Connection to " << str << " succeeded." << endl;
     49    //puts("Connection to localhost:5555 succeeded.");
    4150  }else{
    4251    enet_peer_reset(peer);
    43     puts("Connection to localhost:5555 failed.");
     52    cout << "Connection to " << str << " failed." << endl;
     53    //puts("Connection to localhost:5555 failed.");
    4454  }
    4555
Note: See TracChangeset for help on using the changeset viewer.