Changeset 4c202e0 in network-game
- Timestamp:
- Dec 25, 2012, 6:59:58 PM (12 years ago)
- Branches:
- master
- Children:
- 3b8adee
- Parents:
- edfd1d0
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
client/Client/Client.vcxproj
redfd1d0 r4c202e0 64 64 </ItemDefinitionGroup> 65 65 <ItemGroup> 66 <ClCompile Include="..\..\common\Common.cpp" /> 66 67 <ClCompile Include="..\..\common\Message.cpp" /> 68 <ClCompile Include="..\..\common\Player.cpp" /> 67 69 <ClCompile Include="chat.cpp" /> 68 70 <ClCompile Include="Button.cpp" /> … … 76 78 <ClInclude Include="..\..\common\Compiler.h" /> 77 79 <ClInclude Include="..\..\common\Message.h" /> 80 <ClInclude Include="..\..\common\Player.h" /> 78 81 <ClInclude Include="chat.h" /> 79 82 <ClInclude Include="Button.h" /> -
client/Client/Client.vcxproj.filters
redfd1d0 r4c202e0 49 49 <Filter>Source Files\gui</Filter> 50 50 </ClCompile> 51 <ClCompile Include="..\..\common\Common.cpp"> 52 <Filter>Source Files\common</Filter> 53 </ClCompile> 54 <ClCompile Include="..\..\common\Player.cpp"> 55 <Filter>Source Files\common</Filter> 56 </ClCompile> 51 57 </ItemGroup> 52 58 <ItemGroup> … … 75 81 <Filter>Header Files\gui</Filter> 76 82 </ClInclude> 83 <ClInclude Include="..\..\common\Player.h"> 84 <Filter>Header Files\common</Filter> 85 </ClInclude> 77 86 </ItemGroup> 78 87 <ItemGroup> -
client/Client/chat.cpp
redfd1d0 r4c202e0 18 18 void chat::draw(ALLEGRO_FONT *font, ALLEGRO_COLOR color) 19 19 { 20 for( int x=0; x<vctChat.size(); x++)20 for(unsigned int x=0; x<vctChat.size(); x++) 21 21 al_draw_text(font, color, 10, 140+x*15, ALLEGRO_ALIGN_LEFT, vctChat[x].c_str()); 22 22 -
client/Client/main.cpp
redfd1d0 r4c202e0 1 #include "../../common/Compiler.h" 2 1 3 #if defined WINDOWS 2 4 #include <winsock2.h> … … 21 23 #include <allegro5/allegro_ttf.h> 22 24 23 #include "../../common/Compiler.h"24 25 #include "../../common/Message.h" 25 26 #include "../../common/Common.h" 27 #include "../../common/Player.h" 26 28 27 29 #include "Window.h" … … 433 435 break; 434 436 } 437 case MSG_TYPE_PLAYER: 438 { 439 Player p = *(Player*)(&(msg.buffer)); 440 441 cout << "p.name: " << p.name; 442 cout << "p.pos.x: " << p.pos.x; 443 cout << "p.pos.y: " << p.pos.y; 444 445 break; 446 } 435 447 } 436 448 -
common/Common.cpp
redfd1d0 r4c202e0 3 3 void set_nonblock(int sock) 4 4 { 5 #if def WIN325 #if defined WINDOWS 6 6 unsigned long mode = 1; 7 7 ioctlsocket(sock, FIONBIO, &mode); 8 #el se8 #elif defined LINUX 9 9 int flags; 10 10 flags = fcntl(sock, F_GETFL,0); -
common/Common.h
redfd1d0 r4c202e0 2 2 #define _COMMON_H 3 3 4 #include <fcntl.h> 5 #include <assert.h> 4 #include "Compiler.h" 5 6 #if defined WINDOWS 7 #include <winsock2.h> 8 #include <WS2tcpip.h> 9 #elif defined LINUX 10 #include <fcntl.h> 11 #include <assert.h> 12 #endif 6 13 7 14 void set_nonblock(int sock); -
common/Player.cpp
redfd1d0 r4c202e0 2 2 3 3 #include <iostream> 4 #include <arpa/inet.h>5 4 6 5 using namespace std; -
common/Player.h
redfd1d0 r4c202e0 2 2 #define _PLAYER_H 3 3 4 #include <netinet/in.h> 4 #include "Compiler.h" 5 6 #if defined WINDOWS 7 #include <winsock2.h> 8 #include <WS2tcpip.h> 9 #elif defined LINUX 10 #include <netinet/in.h> 11 #endif 12 5 13 #include <string> 6 14
Note:
See TracChangeset
for help on using the changeset viewer.