Changeset e2a0a27 in network-game for client/Client/main.cpp


Ignore:
Timestamp:
Oct 7, 2015, 11:54:16 PM (9 years ago)
Author:
Dmitry Portnoy <dmp1488@…>
Branches:
master
Children:
033c78b, 8ed6c8a
Parents:
13a8212 (diff), 45c9d0f (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of github.com:weretaco/network-game

File:
1 edited

Legend:

Unmodified
Added
Removed
  • client/Client/main.cpp

    r13a8212 re2a0a27  
    831831   cout << "Total players in map: " << mapPlayers.size() << endl;
    832832
    833    // this is outdated since most messages now don't contain just a text string
    834    string response = string(msg.buffer);
    835 
    836833   switch(state)
    837834   {
     
    844841            case MSG_TYPE_REGISTER:
    845842            {
    846                lblRegisterStatus->setText(response);
     843               lblRegisterStatus->setText(msg.buffer);
    847844               break;
    848845            }
     
    863860            case MSG_TYPE_LOGIN:
    864861            {
    865                if (response.compare("Player has already logged in.") == 0)
     862               if (string(msg.buffer).compare("Player has already logged in.") == 0)
    866863               {
    867864                  goToLoginScreen();
    868865                  state = STATE_START;
    869866
    870                   lblLoginStatus->setText(response);
     867                  lblLoginStatus->setText(msg.buffer);
    871868               }
    872                else if (response.compare("Incorrect username or password") == 0)
     869               else if (string(msg.buffer).compare("Incorrect username or password") == 0)
    873870               {
    874871                  goToLoginScreen();
    875872                  state = STATE_START;
    876873
    877                   lblLoginStatus->setText(response);
     874                  lblLoginStatus->setText(msg.buffer);
    878875               }
    879876               else
     
    908905               // Check if it's about you or another player
    909906               memcpy(&playerId, msg.buffer, 4);
    910                response = string(msg.buffer+4);
     907               string response = string(msg.buffer+4);
    911908
    912909               if (playerId == curPlayerId)
     
    933930            case MSG_TYPE_CHAT:
    934931            {
    935                chatConsole.addLine(response);
     932               chatConsole.addLine(msg.buffer);
    936933
    937934               break;
     
    11121109               // Check if it's about you or another player
    11131110               memcpy(&playerId, msg.buffer, 4);
    1114                response = string(msg.buffer+4);
    11151111
    11161112               if (playerId == curPlayerId)
Note: See TracChangeset for help on using the changeset viewer.