mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 00:24:47 -07:00
Commit to resolve requests made by @Daenyth discussed after the commit.
See https://github.com/Cockatrice/Cockatrice/pull/1340 for details.
This commit is contained in:
parent
62dc3a7ca3
commit
94942e1a92
5 changed files with 12 additions and 10 deletions
|
|
@ -35,7 +35,7 @@ message Response {
|
|||
RespActivationAccepted = 31; // Server accepted a reg user activation token
|
||||
RespActivationFailed = 32; // Server didn't accept a reg user activation token
|
||||
RespRegistrationAcceptedNeedsActivation = 33; // Server accepted cient registration, but it will need token activation
|
||||
RespClientIDRequired = 34; // Server require's client to generate and send its client id before allowing access
|
||||
RespClientIDRequired = 34; // Server requires client to generate and send its client id before allowing access
|
||||
}
|
||||
enum ResponseType {
|
||||
JOIN_ROOM = 1000;
|
||||
|
|
|
|||
|
|
@ -170,7 +170,6 @@ AuthenticationResult Server::loginUser(Server_ProtocolHandler *session, QString
|
|||
event.mutable_user_info()->CopyFrom(session->copyUserInfo(true, true, true));
|
||||
locker.unlock();
|
||||
|
||||
// check if client id exists (older client compatibility)
|
||||
if (clientid.isEmpty()){
|
||||
// client id is empty, either out dated client or client has been modified
|
||||
}
|
||||
|
|
|
|||
|
|
@ -381,12 +381,16 @@ Response::ResponseCode Server_ProtocolHandler::cmdPing(const Command_Ping & /*cm
|
|||
Response::ResponseCode Server_ProtocolHandler::cmdLogin(const Command_Login &cmd, ResponseContainer &rc)
|
||||
{
|
||||
QString userName = QString::fromStdString(cmd.user_name()).simplified();
|
||||
QString clientid = QString::fromStdString(cmd.clientid()).simplified();
|
||||
QString clientId = QString::fromStdString(cmd.clientid()).simplified();
|
||||
|
||||
if (userName.isEmpty() || (userInfo != 0))
|
||||
return Response::RespContextError;
|
||||
if (clientId.isEmpty())
|
||||
return Response::RespContextError;
|
||||
|
||||
QString reasonStr;
|
||||
int banSecondsLeft = 0;
|
||||
AuthenticationResult res = server->loginUser(this, userName, QString::fromStdString(cmd.password()), reasonStr, banSecondsLeft, clientid);
|
||||
AuthenticationResult res = server->loginUser(this, userName, QString::fromStdString(cmd.password()), reasonStr, banSecondsLeft, clientId);
|
||||
switch (res) {
|
||||
case UserIsBanned: {
|
||||
Response_Login *re = new Response_Login;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue