Changeset 208 for code/branches
- Timestamp:
- Nov 14, 2007, 3:35:18 PM (17 years ago)
- Location:
- code/branches/network/src/network
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network/src/network/Makefile
r205 r208 6 6 7 7 # Link command: 8 server: cleanPacketBuffer.o ConnectionManager.o dummyserver.o PacketDecoder.o PacketGenerator.o9 g++PacketDecoder.o PacketGenerator.o ConnectionManager.o dummyserver.o PacketBuffer.o -o server -lenet -lboost_thread -g8 server: 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 10 10 11 dummyserver.o: 12 g++-c dummyserver.cc -o dummyserver.o -g ${INC}11 dummyserver.o: dummyserver.cc 12 ${CC} -c dummyserver.cc -o dummyserver.o -g ${INC} 13 13 # Compilation commands: 14 ConnectionManager.o: 15 g++-c ConnectionManager.cc -o ConnectionManager.o -g ${INC}14 ConnectionManager.o: ConnectionManager.cc 15 ${CC} -c ConnectionManager.cc -o ConnectionManager.o -g ${INC} 16 16 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}17 PacketBuffer.o: PacketBuffer.cc 18 ${CC} -c PacketBuffer.cc -o PacketBuffer.o -g ${INC} 19 PacketGenerator.o: PacketGenerator.cc 20 ${CC} -c PacketGenerator.cc -o PacketGenerator.o -g ${INC} 21 PacketDecoder.o: PacketDecoder.cc 22 ${CC} -c PacketDecoder.cc -o PacketDecoder.o -g ${INC} 23 23 24 24 … … 26 26 rm -rf *.o 27 27 28 client: PacketGenerator.o 29 g++dummyclient.cc PacketGenerator.o -o client -lenet -g ${INC}28 client: PacketGenerator.o dummyclient.cc 29 ${CC} dummyclient.cc PacketGenerator.o -o client -lenet -g ${INC} -
code/branches/network/src/network/dummyclient.cc
r204 r208 5 5 6 6 #include <iostream> 7 #include <string> 7 8 #include <enet/enet.h> 8 9 #include "network/PacketManager.h" … … 20 21 atexit(enet_deinitialize); 21 22 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()); 23 31 address.port = 5555; 24 32 … … 38 46 // wait 5 seconds for the connection attempt to succeed 39 47 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."); 41 50 }else{ 42 51 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."); 44 54 } 45 55
Note: See TracChangeset
for help on using the changeset viewer.