Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/server/cmdhandler.d
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ final class CommandHandler
output ~= "\n ";
output ~= user.username;
output ~= text(
" (client version: ", user.client_version, ")"
" (client variant: ", user.client_variant, ")"
);
}
break;
Expand Down Expand Up @@ -520,7 +520,7 @@ final class CommandHandler
User user;
const now = Clock.currTime;
auto status = "offline";
auto client_version = "none";
auto client_variant = "none";
auto ip_address = "none";
ushort listening_port;
ushort obfuscated_port;
Expand All @@ -543,7 +543,7 @@ final class CommandHandler
user = server.get_user(username);
if (user !is null) {
status = (user.status == UserStatus.away) ? "away" : "online";
client_version = user.client_version;
client_variant = user.client_variant;
ip_address = user.address.toAddrString;
listening_port = user.address.port;
obfuscated_port = user.obfuscated_port;
Expand Down Expand Up @@ -601,7 +601,7 @@ final class CommandHandler
"\n",
"\nSession info:",
"\n status: ", status,
"\n client version: ", client_version,
"\n client variant: ", client_variant,
"\n IP address: ", ip_address,
"\n port: ", listening_port,
"\n obfuscated port: ", obfuscated_port,
Expand Down Expand Up @@ -786,7 +786,7 @@ final class CommandHandler
"\n \"username\": \"", username, "\",",
"\n \"session_data\": {",
"\n \"status\": \"", status, "\",",
"\n \"client_version\": \"", user.client_version, "\",",
"\n \"client_variant\": \"", user.client_variant, "\",",
"\n \"ip_address\": \"", user.address.toAddrString ~ "\",",
"\n \"port\": ", user.address.port, ",",
"\n \"obfuscated_port\": ", user.obfuscated_port, ",",
Expand Down
14 changes: 7 additions & 7 deletions src/server/messages.d
Original file line number Diff line number Diff line change
Expand Up @@ -259,24 +259,24 @@ final class ULogin : UMessage
{
string username;
string password;
uint major_version;
uint client_type; // protocol major version
string hash; // MD5 hash of username + password
uint minor_version;
uint client_subtype; // protocol minor version

this(const(ubyte)[] in_buf) scope
{
super(in_buf);

username = read!string();
password = read!string();
major_version = read!uint();
username = read!string();
password = read!string();
client_type = read!uint();

if (!has_unread_data)
return;

// Older clients would not send these
hash = read!string();
minor_version = read!uint();
hash = read!string();
client_subtype = read!uint();
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/server/msghandler.d
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ final class MessageHandler
break;

user.username = msg.username;
user.client_version = text(
msg.major_version, ".", msg.minor_version
user.client_variant = text(
msg.client_type, ".", msg.client_subtype
);
user.authenticate(msg.username, msg.password);
break;
Expand Down
6 changes: 3 additions & 3 deletions src/server/user.d
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import std.string : replace, strip, toLower;
final class User
{
string username;
string client_version;
string client_variant;
InternetAddress address;
ObfuscationType obfuscation_type;
ushort obfuscated_port;
Expand Down Expand Up @@ -79,7 +79,7 @@ final class User
.replace("%sversion%", VERSION)
.replace("%users%", server.num_connected_users.text)
.replace("%username%", username)
.replace("%version%", client_version);
.replace("%variant%", client_variant);
}

bool login_timed_out(MonoTime current_time)
Expand Down Expand Up @@ -352,7 +352,7 @@ final class User
writeln(
server.db.admin_until(username) > Clock.currTime ?
"Admin " : "User ", blue, username, norm,
" logged in with client version ", bold, client_version, norm
" logged in using client variant ", bold, client_variant, norm
);

server.add_user(this);
Expand Down
2 changes: 1 addition & 1 deletion src/setup/setup.d
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ final class Setup
"\n\t%%sversion%% - server version (", VERSION, ")",
"\n\t%%users%% - number of connected users",
"\n\t%%username%% - name of the connecting user",
"\n\t%%version%% - version of the user's client software",
"\n\t%%variant%% - user's client type and subtype",
"\n\nNew MOTD (end with a dot on a single line):"
);

Expand Down
Loading