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

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Patrick Matthäi
  • Date: 2013-09-17 10:35:51 UTC
  • mfrom: (1.1.10)
  • Revision ID: package-import@ubuntu.com-20130917103551-az7p3nz9jgxwqjfn
Tags: 1.3.9.15-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
196
196
        mRegistrationEnabled = options & FLAG_REGISTRATION;
197
197
        msg.skip(2);  // 0 unused
198
198
        serverVersion = msg.readInt8();
 
199
        tmwServerVersion = 0;
199
200
        if (serverVersion >= 5)
200
201
            requestUpdateHosts();
201
202
    }
202
 
    else
203
 
    {
204
 
        const unsigned int options = msg.readInt32();
205
 
        mRegistrationEnabled = options & FLAG_REGISTRATION;
206
 
        serverVersion = 0;
207
 
    }
208
 
    logger->log("Server version: %d", serverVersion);
 
203
    else if (b1 == 255)
 
204
    {   // old TMWA
 
205
        const unsigned int options = msg.readInt32();
 
206
        mRegistrationEnabled = options & FLAG_REGISTRATION;
 
207
        serverVersion = 0;
 
208
        tmwServerVersion = 0;
 
209
    }
 
210
    else if (b1 >= 0x0d)
 
211
    {   // new TMWA
 
212
        const unsigned int options = msg.readInt32();
 
213
        mRegistrationEnabled = options & FLAG_REGISTRATION;
 
214
        serverVersion = 0;
 
215
        tmwServerVersion = (b1 << 16) | (b2 << 8) | b3;
 
216
    }
 
217
    else
 
218
    {   // eAthena
 
219
        const unsigned int options = msg.readInt32();
 
220
        mRegistrationEnabled = options & FLAG_REGISTRATION;
 
221
        serverVersion = 0;
 
222
        tmwServerVersion = 0;
 
223
    }
 
224
    if (serverVersion > 0)
 
225
        logger->log("Evol server version: %d", serverVersion);
 
226
    else if (tmwServerVersion > 0)
 
227
        logger->log("Tmw server version: x%06x", tmwServerVersion);
 
228
    else
 
229
        logger->log("Server witout version");
 
230
 
209
231
    if (serverVersion < 5)
210
232
    {
211
233
        if (client->getState() != STATE_LOGIN)