Changeset 10f6fc2 in network-game
- Timestamp:
- Jul 14, 2013, 9:42:56 PM (11 years ago)
- Branches:
- master
- Children:
- 198cf2d
- Parents:
- 9b5d30b
- Location:
- client/Client
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
client/Client/Client.vcxproj
r9b5d30b r10f6fc2 68 68 <ItemGroup> 69 69 <ClCompile Include="..\..\common\Common.cpp" /> 70 <ClCompile Include="..\..\common\MessageProcessor.cpp" /> 70 71 <ClCompile Include="..\..\common\Projectile.cpp" /> 71 72 <ClCompile Include="..\..\common\WorldMap.cpp" /> … … 83 84 <ClInclude Include="..\..\common\Common.h" /> 84 85 <ClInclude Include="..\..\common\Compiler.h" /> 86 <ClInclude Include="..\..\common\MessageProcessor.h" /> 85 87 <ClInclude Include="..\..\common\Projectile.h" /> 86 88 <ClInclude Include="..\..\common\WorldMap.h" /> -
client/Client/Client.vcxproj.filters
r9b5d30b r10f6fc2 64 64 <Filter>Source Files\gui</Filter> 65 65 </ClCompile> 66 <ClCompile Include="..\..\common\MessageProcessor.cpp"> 67 <Filter>Source Files\common</Filter> 68 </ClCompile> 66 69 </ItemGroup> 67 70 <ItemGroup> … … 102 105 <Filter>Header Files\gui</Filter> 103 106 </ClInclude> 107 <ClInclude Include="..\..\common\MessageProcessor.h"> 108 <Filter>Header Files\common</Filter> 109 </ClInclude> 104 110 </ItemGroup> 105 111 <ItemGroup> -
client/Client/main.cpp
r9b5d30b r10f6fc2 27 27 #include <allegro5/allegro_primitives.h> 28 28 29 #include "../../common/Common.h" 29 30 #include "../../common/Message.h" 30 #include "../../common/ Common.h"31 #include "../../common/MessageProcessor.h" 31 32 #include "../../common/WorldMap.h" 32 33 #include "../../common/Player.h" … … 101 102 string username; 102 103 chat chatConsole; 104 105 MessageProcessor msgProcessor; 103 106 104 107 int main(int argc, char **argv) … … 279 282 msgTo.type = MSG_TYPE_PICKUP_FLAG; 280 283 memcpy(msgTo.buffer, &curPlayerId, 4); 281 sendMessage(&msgTo, sock, &server);284 msgProcessor.sendMessage(&msgTo, sock, &server); 282 285 } 283 286 break; … … 304 307 msgTo.type = MSG_TYPE_DROP_FLAG; 305 308 memcpy(msgTo.buffer, &curPlayerId, 4); 306 sendMessage(&msgTo, sock, &server);309 msgProcessor.sendMessage(&msgTo, sock, &server); 307 310 } 308 311 } … … 327 330 memcpy(msgTo.buffer+8, &pos.y, 4); 328 331 329 sendMessage(&msgTo, sock, &server);332 msgProcessor.sendMessage(&msgTo, sock, &server); 330 333 } 331 334 else … … 354 357 memcpy(msgTo.buffer+4, &target->id, 4); 355 358 356 sendMessage(&msgTo, sock, &server);359 msgProcessor.sendMessage(&msgTo, sock, &server); 357 360 } 358 361 } … … 361 364 } 362 365 363 if ( receiveMessage(&msgFrom, sock, &from) >= 0)366 if (msgProcessor.receiveMessage(&msgFrom, sock, &from) >= 0) 364 367 processMessage(msgFrom, state, chatConsole, gameMap, mapPlayers, mapProjectiles, curPlayerId, scoreBlue, scoreRed); 365 368 … … 367 370 { 368 371 redraw = false; 372 373 msgProcessor.resendUnackedMessages(sock); 369 374 370 375 wndCurrent->draw(display); … … 927 932 memcpy(msgTo.buffer+username.size()+password.size()+2, &playerClass, 4); 928 933 929 sendMessage(&msgTo, sock, &server);934 msgProcessor.sendMessage(&msgTo, sock, &server); 930 935 } 931 936 … … 944 949 strcpy(msgTo.buffer+username.size()+1, strPassword.c_str()); 945 950 946 sendMessage(&msgTo, sock, &server);951 msgProcessor.sendMessage(&msgTo, sock, &server); 947 952 } 948 953 … … 955 960 strcpy(msgTo.buffer, username.c_str()); 956 961 957 sendMessage(&msgTo, sock, &server);962 msgProcessor.sendMessage(&msgTo, sock, &server); 958 963 } 959 964 … … 973 978 strcpy(msgTo.buffer, msg.c_str()); 974 979 975 sendMessage(&msgTo, sock, &server);980 msgProcessor.sendMessage(&msgTo, sock, &server); 976 981 } 977 982
Note:
See TracChangeset
for help on using the changeset viewer.