~ubuntu-branches/ubuntu/trusty/manaplus/trusty-proposed

« back to all changes in this revision

Viewing changes to src/net/tmwa/charserverhandler.cpp

  • Committer: Package Import Robot
  • Author(s): Patrick Matthäi
  • Date: 2013-07-11 10:09:41 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20130711100941-f0rwuvcwgl8ulqo8
Tags: 1.3.7.7.1-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
157
157
    data.mAttributes[PlayerInfo::MP] = msg.readInt16();
158
158
    data.mAttributes[PlayerInfo::MAX_MP] = msg.readInt16();
159
159
 
160
 
    msg.readInt16();                          // speed
161
 
    tempPlayer->setSubtype(msg.readInt16());  // class (used for race)
 
160
    msg.readInt16();                           // speed
 
161
    const int race = msg.readInt16();          // class (used for race)
162
162
    const int hairStyle = msg.readInt8();
163
 
    msg.readInt8();  // free
164
 
    const uint16_t weapon = msg.readInt16();   // unused on server. need use?
 
163
    const int look = msg.readInt8();
 
164
    tempPlayer->setSubtype(race, look);
 
165
    const uint16_t weapon = msg.readInt16();  // unused on server. need use?
165
166
    tempPlayer->setSprite(SPRITE_WEAPON, weapon, "", 1, true);
166
167
 
167
168
    data.mAttributes[PlayerInfo::LEVEL] = msg.readInt16();
247
248
                                     const int hairstyle,
248
249
                                     const int hairColor,
249
250
                                     const unsigned char race,
 
251
                                     const unsigned char look,
250
252
                                     const std::vector<int> &stats) const
251
253
{
252
254
    MessageOut outMsg(CMSG_CHAR_CREATE);
258
260
    outMsg.writeInt8(static_cast<int8_t>(hairColor));
259
261
    outMsg.writeInt8(0);  // unused
260
262
    outMsg.writeInt8(static_cast<int8_t>(hairstyle));
261
 
    outMsg.writeInt8(0);  // unused
 
263
    if (serverVersion >= 9)
 
264
        outMsg.writeInt8(look);
 
265
    else
 
266
        outMsg.writeInt8(0);
262
267
    if (serverVersion >= 2)
263
268
        outMsg.writeInt8(race);
264
269
}
310
315
 
311
316
void CharServerHandler::processCharLogin(Net::MessageIn &msg)
312
317
{
 
318
    BLOCK_START("CharServerHandler::processCharLogin")
 
319
 
313
320
    msg.skip(2);  // Length word
314
321
    const int slots = msg.readInt16();
315
322
    if (slots > 0 && slots < 30)
341
348
    }
342
349
 
343
350
    Client::setState(STATE_CHAR_SELECT);
 
351
    BLOCK_END("CharServerHandler::processCharLogin")
344
352
}
345
353
 
346
354
}  // namespace TmwAthena