summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-06-26 07:29:57 -0300
committerJesusaves <cpntb1@ymail.com>2020-06-26 07:29:57 -0300
commitf4100abbf37e7c353106a0f043e40c479c0c1904 (patch)
tree0983cc322eded1664638a46ac732e465f517a671 /npc
parent791fe50c6bac7a45dbabc7944b0f096229577cbb (diff)
downloadserverdata-f4100abbf37e7c353106a0f043e40c479c0c1904.tar.gz
serverdata-f4100abbf37e7c353106a0f043e40c479c0c1904.tar.bz2
serverdata-f4100abbf37e7c353106a0f043e40c479c0c1904.tar.xz
serverdata-f4100abbf37e7c353106a0f043e40c479c0c1904.zip
Sketch to allow user accounts to set PinCodes
Diffstat (limited to 'npc')
-rw-r--r--npc/commands/ucp.txt42
1 files changed, 35 insertions, 7 deletions
diff --git a/npc/commands/ucp.txt b/npc/commands/ucp.txt
index 6fdc2bb83..aeaf805a0 100644
--- a/npc/commands/ucp.txt
+++ b/npc/commands/ucp.txt
@@ -20,6 +20,7 @@ function script UserCtrlPanel {
select
l("Rules"),
l("Game News"),
+ rif(is_admin(), l("Create PIN Number")),
l("Account Information"),
rif(getcharid(2) > 0, l("Guild Information")),
l("Change Language"),
@@ -29,9 +30,36 @@ function script UserCtrlPanel {
switch (@menu)
{
- case 1: GameRules; break;
- case 2: GameNews; break;
+ case 1: GameRules(); break;
+ case 2: GameNews(); break;
case 3:
+ // Account age check
+ if (#REG_DATE < gettimetick(2)+86400*15) {
+ mesc l("Your account is too young."), 1;
+ mesc l("The accounts need 15 days to set Pin Codes."), 1;
+ break;
+ }
+ mes l(".:: Create PIN Code ::.");
+ mes l("If you decide to continue, a random PINCODE will be");
+ mes l("sent to the email you used to register on Moubootaur Legends.");
+ mes "";
+ mes l("With a PinCode, you'll have access to restricted features,");
+ mes l("Like Discord integration and sensitive options.");
+ mes "";
+ mes l("You can change the PIN from ManaPlus char selection screen.");
+ mes l("You can also modify your email with %s.", b("@email"));
+ mes l("This will do nothing if the account already have a PIN.");
+ next;
+ mesc l("Are you sure you want to create a PIN now?"), 1;
+ if (askyesno() == ASK_NO)
+ break;
+ mes "";
+ .@msg$=json_encode("date", gettimetick(2),
+ "accid", getcharid(3),
+ "pin", rand2(1000));
+ api_send(302, .@msg$);
+ break;
+ case 4:
if (!validatepin())
break;
if (!@lgc || @query) {
@@ -72,7 +100,7 @@ function script UserCtrlPanel {
}
next;
break;
- case 4:
+ case 5:
.@gid=getcharid(2);
mesc (".:: "+getguildname(.@gid)+" ::."), 1;
mesc l("Guild Master: @@", getguildmaster(.@gid)), 3;
@@ -86,8 +114,8 @@ function script UserCtrlPanel {
mesc l("Your position on the guild: @@", getguildrole(.@gid, getcharid(3), true));
next;
break;
- case 5: asklanguage(LANG_IN_SHIP); break;
- case 6:
+ case 6: asklanguage(LANG_IN_SHIP); break;
+ case 7:
// Draw the GUI and any info on it
csysGUI_Report();
mesc l("NOTE: The effective bonus level applied is the average level of enabled options!");
@@ -137,7 +165,7 @@ function script UserCtrlPanel {
}
} while (@menu > 1);
break;
- case 7:
+ case 8:
do
{
mesc ".:: " + l("GAME SETTINGS") + " ::.", 3;
@@ -252,7 +280,7 @@ function script UserCtrlPanel {
clear;
} while (@menu != 1);
break;
- case 8: close; break;
+ default: close; break;
}
} while (1);
}