Changeset ca44f82 in network-game for common/Message.cpp


Ignore:
Timestamp:
Feb 24, 2013, 1:28:32 AM (12 years ago)
Author:
dportnoy <dmp1488@…>
Branches:
master
Children:
7b43385
Parents:
3a79253 (diff), 8f85180 (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:

Updated files to correctly compile on Windows

File:
1 edited

Legend:

Unmodified
Added
Removed
  • common/Message.cpp

    r3a79253 rca44f82  
    1111#endif
    1212
     13#include <iostream>
     14
     15using namespace std;
     16
    1317int sendMessage(NETWORK_MSG *msg, int sock, struct sockaddr_in *dest)
    1418{
    15    return sendto(sock, (char*)msg, sizeof(NETWORK_MSG), 0, (struct sockaddr *)dest, sizeof(struct sockaddr_in));
     19   int ret =  sendto(sock, (char*)msg, sizeof(NETWORK_MSG), 0, (struct sockaddr *)dest, sizeof(struct sockaddr_in));
     20
     21   cout << "Sent message of type " << msg->type << endl;
     22
     23   return ret;
    1624}
    1725
     
    2129
    2230   // assume we don't care about the value of socklen
    23    return recvfrom(sock, (char*)msg, sizeof(NETWORK_MSG), 0, (struct sockaddr *)dest, &socklen);
     31   int ret =  recvfrom(sock, (char*)msg, sizeof(NETWORK_MSG), 0, (struct sockaddr *)dest, &socklen);
     32
     33   if (ret > -1)
     34      cout << "Received message of type " << msg->type << endl;
     35
     36   return ret;
    2437}
Note: See TracChangeset for help on using the changeset viewer.