Changeset c4c2a3c in network-game
- Timestamp:
- Jul 27, 2013, 1:43:27 PM (11 years ago)
- Branches:
- master
- Children:
- bc70282
- Parents:
- 934ab53
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
server/server.cpp
r934ab53 rc4c2a3c 564 564 565 565 memcpy(&playerClass, clientMsg.buffer+username.length()+password.length()+2, 4); 566 serverMsg.type = MSG_TYPE_REGISTER; 567 566 568 567 569 cout << "username: " << username << endl; … … 572 574 else if (playerClass == Player::CLASS_RANGER) 573 575 cout << "class: RANGER" << endl; 576 else { 577 cout << "Unknown player class detected" << endl; 578 strcpy(serverMsg.buffer, "You didn't select a class"); 579 break; 580 } 581 582 int error = da.insertPlayer(username, password, playerClass); 583 584 if (error) 585 strcpy(serverMsg.buffer, "Registration failed. Please try again."); 574 586 else 575 cout << "Unknown player class detected" << endl;576 577 int error = da.insertPlayer(username, password, playerClass);578 579 if (!error)580 587 strcpy(serverMsg.buffer, "Registration successful."); 581 else582 strcpy(serverMsg.buffer, "Registration failed. Please try again.");583 584 serverMsg.type = MSG_TYPE_REGISTER;585 588 586 589 break;
Note:
See TracChangeset
for help on using the changeset viewer.