Changeset 49da01a in network-game
- Timestamp:
- Jul 22, 2013, 11:52:39 PM (11 years ago)
- Branches:
- master
- Children:
- dee75cc
- Parents:
- 365e156
- Files:
-
- 2 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
client/Client/Client.vcxproj
r365e156 r49da01a 71 71 <ClCompile Include="..\..\common\Projectile.cpp" /> 72 72 <ClCompile Include="..\..\common\WorldMap.cpp" /> 73 <ClCompile Include="..\..\common\Message.cpp" />74 73 <ClCompile Include="..\..\common\Player.cpp" /> 75 74 <ClCompile Include="chat.cpp" /> … … 88 87 <ClInclude Include="..\..\common\Projectile.h" /> 89 88 <ClInclude Include="..\..\common\WorldMap.h" /> 90 <ClInclude Include="..\..\common\Message.h" />91 89 <ClInclude Include="..\..\common\Player.h" /> 92 90 <ClInclude Include="chat.h" /> -
client/Client/Client.vcxproj.filters
r365e156 r49da01a 43 43 <Filter>Source Files\gui</Filter> 44 44 </ClCompile> 45 <ClCompile Include="..\..\common\Message.cpp">46 <Filter>Source Files\common</Filter>47 </ClCompile>48 45 <ClCompile Include="Window.cpp"> 49 46 <Filter>Source Files\gui</Filter> … … 87 84 <Filter>Header Files\common</Filter> 88 85 </ClInclude> 89 <ClInclude Include="..\..\common\Message.h">90 <Filter>Header Files\common</Filter>91 </ClInclude>92 86 <ClInclude Include="..\..\common\Common.h"> 93 87 <Filter>Header Files\common</Filter> -
client/Client/RadioButtonList.cpp
r365e156 r49da01a 65 65 return this->selectedButton; 66 66 } 67 68 void RadioButtonList::setSelectedButton(int b) { 69 this->selectedButton = b; 70 } -
client/Client/RadioButtonList.h
r365e156 r49da01a 26 26 void addRadioButton(string s); 27 27 int getSelectedButton(); 28 void setSelectedButton(int b); 28 29 }; 29 30 -
client/Client/main.cpp
r365e156 r49da01a 232 232 cout << "Created main screen" << endl; 233 233 234 wndCurrent = wndLogin;234 goToLoginScreen(); 235 235 236 236 event_queue = al_create_event_queue(); … … 398 398 chatConsole.draw(font, al_map_rgb(255,255,255)); 399 399 400 // There should be label gui components that show these or each textbox should have a label 401 if(wndCurrent == wndLogin || wndCurrent == wndRegister) { 402 //al_draw_text(font, al_map_rgb(0, 255, 0), 416, 43, ALLEGRO_ALIGN_LEFT, "Username:"); 403 //al_draw_text(font, al_map_rgb(0, 255, 0), 413, 73, ALLEGRO_ALIGN_LEFT, "Password:"); 404 } 405 else if(wndCurrent == wndMain) { 400 if(wndCurrent == wndMain) { 406 401 al_draw_text(font, al_map_rgb(0, 255, 0), 4, 43, ALLEGRO_ALIGN_LEFT, "Message:"); 407 402 … … 645 640 cout << "Logged out" << endl; 646 641 state = STATE_START; 647 wndCurrent = wndLogin;642 goToLoginScreen(); 648 643 } 649 644 … … 914 909 void goToRegisterScreen() 915 910 { 916 wndCurrent = wndRegister;917 918 911 txtUsernameRegister->clear(); 919 912 txtPasswordRegister->clear(); 913 lblRegisterStatus->setText(""); 914 rblClasses->setSelectedButton(-1); 915 916 wndCurrent = wndRegister; 920 917 } 921 918 922 919 void goToLoginScreen() 923 920 { 924 wndCurrent = wndLogin;925 926 921 txtUsername->clear(); 927 922 txtPassword->clear(); 923 lblLoginStatus->setText(""); 924 925 wndCurrent = wndLogin; 928 926 } 929 927 -
common/MessageProcessor.h
r365e156 r49da01a 15 15 #endif 16 16 17 /* 18 #define MSG_TYPE_REGISTER 119 #define MSG_TYPE_LOGIN 220 #define MSG_TYPE_LOGOUT 321 #define MSG_TYPE_CHAT 422 #define MSG_TYPE_PLAYER 5// server sends this to update player positions23 #define MSG_TYPE_PLAYER_MOVE 6// client sends this when a player wants to move24 #define MSG_TYPE_OBJECT 725 #define MSG_TYPE_REMOVE_OBJECT 826 #define MSG_TYPE_PICKUP_FLAG 927 #define MSG_TYPE_DROP_FLAG 1 028 #define MSG_TYPE_SCORE 1 129 #define MSG_TYPE_START_ATTACK 1 230 #define MSG_TYPE_ATTACK 1 331 #define MSG_TYPE_PROJECTILE 1 432 #define MSG_TYPE_REMOVE_PROJECTILE 1 517 #define MSG_TYPE_ACK 1 18 #define MSG_TYPE_REGISTER 2 19 #define MSG_TYPE_LOGIN 3 20 #define MSG_TYPE_LOGOUT 4 21 #define MSG_TYPE_CHAT 5 22 #define MSG_TYPE_PLAYER 6 // server sends this to update player positions 23 #define MSG_TYPE_PLAYER_MOVE 7 // client sends this when a player wants to move 24 #define MSG_TYPE_OBJECT 8 25 #define MSG_TYPE_REMOVE_OBJECT 9 26 #define MSG_TYPE_PICKUP_FLAG 10 27 #define MSG_TYPE_DROP_FLAG 11 28 #define MSG_TYPE_SCORE 12 29 #define MSG_TYPE_START_ATTACK 13 30 #define MSG_TYPE_ATTACK 14 31 #define MSG_TYPE_PROJECTILE 15 32 #define MSG_TYPE_REMOVE_PROJECTILE 16 33 33 34 34 typedef struct 35 35 { 36 short type; 36 unsigned int id; 37 unsigned short type; 37 38 char buffer[256]; 38 39 } NETWORK_MSG; 39 */40 40 41 41 using namespace std;
Note:
See TracChangeset
for help on using the changeset viewer.