Skip to content

Commit 0219130

Browse files
committed
Renamed ChangeAdminPassword to ChangeUserDetails and updated ChangeUserDetails Functionality
1 parent 7dbbbf2 commit 0219130

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

TemplateMod/Commands.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,19 +266,21 @@ public static bool HackComputer(Hacknet.OS os, string[] args)
266266

267267
return false;
268268
}
269-
public static bool ChangeAdminPassword(Hacknet.OS os, string[] args)
269+
public static bool ChangeUserDetails(Hacknet.OS os, string[] args)
270270
{
271271
Computer computer = os.connectedComp;
272-
string newPass = args[1];
272+
string oldUser = args[1];
273+
string newUser = args[2];
274+
string newPass = args[3];
273275
if (args.Length < 0)
274276
{
275277
os.write("Usage: changeAdminPassword (NewPassword)");
276278
return false;
277279
}
278280
for (int index = 0; index < computer.users.Count; ++index)
279281
{
280-
if (computer.users[index].name.ToLower().Equals("admin"))
281-
computer.users[index] = new UserDetail("admin", newPass, (byte)0);
282+
if (computer.users[index].name.ToLower().Equals(oldUser))
283+
computer.users[index] = new UserDetail(newUser, newPass, (byte)0);
282284
}
283285
return false;
284286
}

0 commit comments

Comments
 (0)