Changeset cbc595d in network-game for server


Ignore:
Timestamp:
Dec 3, 2012, 12:33:35 AM (12 years ago)
Author:
dportnoy <dmp1488@…>
Branches:
master
Children:
b53c6b3
Parents:
41ad8ed
Message:

Changed a few minor things on the server

File:
1 edited

Legend:

Unmodified
Added
Removed
  • server/server.cpp

    r41ad8ed rcbc595d  
    4040   vector<Player>::iterator it;
    4141
    42    cout << "Entered findPlayerByName" << endl;
    43 
    4442   for (it = vec.begin(); it != vec.end(); it++)
    4543   {
    46       cout << "Comparing name" << endl;
    4744      if ( it->name.compare(name) == 0 )
    4845         return &(*it);
    4946   }
    5047
    51    cout << "About to return" << endl;
    5248   return NULL;
    5349}
     
    7975   int sock, length, n;
    8076   struct sockaddr_in server;
    81    struct sockaddr_in from; // holds the info on the connected client
     77   struct sockaddr_in from; // holds the info about the connected client
    8278   NETWORK_MSG clientMsg, serverMsg;
    8379   vector<Player> vctPlayers;
    8480
    8581   srand(time(NULL));
    86    int num = 500;
    87    //int num = (rand() % 0) + 1;
     82   int num = (rand() % 1000) + 1;
    8883
    8984   cout << "num: " << num << endl;
     
    172167         if (p == NULL || p->password != password)
    173168         {
    174             if (p != NULL)
    175             {
    176                cout << "p->password: " << p->password << endl;
    177                cout << "password: " << password << endl;
    178             }
    179169            strcpy(serverMsg.buffer, "Incorrect username or password");
    180170         }
Note: See TracChangeset for help on using the changeset viewer.