Changeset bbebe9c in network-game


Ignore:
Timestamp:
Sep 26, 2013, 1:00:44 AM (11 years ago)
Author:
dportnoy <dmp1488@…>
Branches:
master
Children:
b8f789d
Parents:
929b4e0
Message:

Clients send game join and creation messages to server and new message type has been added

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • client/Client/main.cpp

    r929b4e0 rbbebe9c  
    11201120{
    11211121   string msg = txtChat->getStr();
    1122 
    11231122   txtChat->clear();
    11241123
    11251124   msgTo.type = MSG_TYPE_CHAT;
    1126 
    11271125   strcpy(msgTo.buffer, msg.c_str());
    11281126
     
    11381136{
    11391137   cout << "Joining game" << endl;
     1138
     1139   string msg = txtJoinGame->getStr();
     1140   txtJoinGame->clear();
     1141
     1142   msgTo.type = MSG_TYPE_JOIN_GAME;
     1143   strcpy(msgTo.buffer, msg.c_str());
     1144
     1145   msgProcessor.sendMessage(&msgTo, sock, &server, &outputLog);
    11401146}
    11411147
     
    11431149{
    11441150   cout << "Creating game" << endl;
    1145 }
     1151
     1152   string msg = txtCreateGame->getStr();
     1153   txtCreateGame->clear();
     1154
     1155   msgTo.type = MSG_TYPE_CREATE_GAME;
     1156   strcpy(msgTo.buffer, msg.c_str());
     1157
     1158   msgProcessor.sendMessage(&msgTo, sock, &server, &outputLog);
     1159}
  • common/MessageContainer.h

    r929b4e0 rbbebe9c  
    3434#define MSG_TYPE_JOIN_GAME         18
    3535#define MSG_TYPE_LEAVE_GAME        19
     36#define MSG_TYPE_GAME_INFO         20
    3637
    3738typedef struct
Note: See TracChangeset for help on using the changeset viewer.