Forum

> > CS2D > Scripts > Authentication, Auth
Forums overviewCS2D overview Scripts overviewLog in to reply

English Authentication, Auth

5 replies
To the start Previous 1 Next To the start

old Authentication, Auth

dizziness
User Off Offline

Quote
Hello, everyone if you know devtools-r0.1 there is Auth lua script right? I need that lua script but Lee dosen't reply my comments and my private message to accept it or not, So can you help me make Auth lua script?

I requesting this lua script because there is alot of nickname get stolen by stealer so they can use another nickname to make some player name become bad

1
2
3
4
5
6
Commands:

Syntax: /register <password>
Syntax: (/login|/l) <password>
Syntax: (/changepw|/changepass|/cpw|/changepassword) <old password> <new password>
Syntax: /logout
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
Message:

join:
    register: '{RED}You are not registered.{NEWLINE}{RED}Please register using /register <password>.'
    login: '{RED}Please log in using /login <password>.'
    error:
        banned: 'You have are banned for exceeding the incorrect password threshold.'
        online: 'You are already online!'
        name: 'Your name contains one or more illegal characters.'

register:
    usage: '{RED}Correct Usage: /register <password> 
    success: '{BRIGHTGREEN}You have successfully registered!'
    error:
        disabled: '{RED}Registrations are currently disabled!'
        registered: '{RED}You are already registered!'
        multiple: '{RED}You may only register one account!'
        password: '{RED}Your password must be at least {PWMINLENGTH} characters long!'

login:
    usage: '{RED}Correct Usage: /login <password>'
    success: '{BRIGHTGREEN}You are now logged in!'
    error:
        registered: '{RED}You are not registered!'
        logged: '{RED}You are already logged in!'
        password: '{RED}Incorrect password!'
        activate: '{RED}Your account is not activated!'

logout:
    success: '{BRIGHTGREEN}You have been logged out!'
    error:
        logged: '{RED}You are not logged in!'

changepw:
    usage: '{RED}Correct Usage: /changepw <old password> <new password>'
    success: '{BRIGHTGREEN}Password changed!'
    error:
        disabled: '{RED}Password changes are currently disabled!'
        logged: '{RED}You are not logged in!'
        incorrect: '{RED}Incorrect old password!'
        invalid: '{RED}Your new password must be at least {PWMINLENGTH} characters long!'

admin:
    unknown: 'Unknown subcommand, try /xauth for more information'
    permission: 'You do not have permission to use this command!'
    register:
        usage: '{RED}Correct Usage: /xauth register <player> <password> [email]'
        registered: '{RED}This player is already registered!'
        success: '{BRIGHTGREEN}Account successfully created for: {WHITE}{TARGET}'
    changepw:
        usage: '{RED}Correct Usage: /xauth changepw <player> <new password>'
        registered: '{RED}This player is not registered!'
        success: '{TARGET}''s {BRIGHTGREEN}password has been changed!'
    logout:
        usage: '{RED}Correct Usage: /xauth logout <player>'
        logged: '{TARGET} {RED}is not logged in!'
        success: '{TARGET} {BRIGHTGREEN}has been logged out!'
    unregister:
        usage: '{RED}Correct Usage: /xauth unregister <player>'
        registered: '{RED}This player is not registered!'
        success:
            target: '{RED}You have been unregistered and logged out!'
            player: '{TARGET} {BRIGHTGREEN}has been unregistered!'
    location:
        usage: '{RED}Correct Usage: /xauth location set|remove'
        set:
            success: '{YELLOW}{PLUGIN} {BRIGHTGREEN}Teleport location for this world set to your location!'
        remove:
            no: '{YELLOW}{PLUGIN} {BRIGHTGREEN}This world does not have a teleport location!'
            success: '{YELLOW}{PLUGIN} {BRIGHTGREEN}Teleport location for this world has been removed!'
    config:
        usage: '{RED}Correct Usage: /xauth config <setting> [new value]'
        no: '{YELLOW}{PLUGIN} {RED}No such setting!'
        desc: 'Setting: {SETTING}{NEWLINE}Type: {TYPE}{NEWLINE}Value: {VALUE}'
        invalid: '{RED}Invalid value type!'
        success: '{YELLOW}{PLUGIN} {BRIGHTGREEN}Setting changed!'
    reload:
        sucess: '{YELLOW}{PLUGIN} {BRIGHTGREEN}Reload complete!'      

misc:
    illegal: '{GRAY}You must be logged in to do that!'
    reloaded: '{RED}Server reloaded, please log in.'
    kick:
        timeout: 'You have taken too long to log in!'
        strike: 'You have entered too many invalid passwords!'

# INTERNAL USE ONLY! DO NOT TOUCH!
version: 1

Important: If someone are not logged in, they cannot do anything like chat (except say /register or /login), And other (Example: they can't see anything or the cs2d screen is black) If they do that like moving, some message will appear ('You must be logged in to do that!') and their message will not appear or maybe they are moving the message will appear too ('You must be logged in to do that!') and their position will go back to last position
edited 1×, last 24.07.11 01:41:02 am

old Re: Authentication, Auth

Apache uwu
User Off Offline

Quote
Why did you pick '/'...

You do know / is just a shortcut for the console right? (ex. /quit, /retry, /unbindall)

Where did you get the code from there doesn't seem to be any lua in it.

I don't recommend allowing people to use !register because they can spam it and make lots of useless dats on your server.

old Re: Authentication, Auth

dizziness
User Off Offline

Quote
user Apache uwu has written
Why did you pick '/'...

You do know / is just a shortcut for the console right? (ex. /quit, /retry, /unbindall)

Where did you get the code from there doesn't seem to be any lua in it.

I don't recommend allowing people to use !register because they can spam it and make lots of useless dats on your server.


Check the message,

register:
usage: '{RED}Correct Usage: /register <password>
success: '{BRIGHTGREEN}You have successfully registered!'
error:
disabled: '{RED}Registrations are currently disabled!'
1
registered: '{RED}You are already registered!'
1
multiple: '{RED}You may only register one account!'
password: '{RED}Your password must be at least {PWMINLENGTH} characters long!'

Textual Context if you know my server database maybe you will not shocked

Size: 92.7 KB
Size on disk: 13.6 MB
Contains: 3.490 Files

old Re: Authentication, Auth

Lee
Moderator Off Offline

Quote
I don't understand what it is you want, there is a login and a register function already. If you mean that you don't want the login/register functions to have the username parameter, you need to clarify how these users are supposed to be identified.

If it's via USGN, it's a moot point already as the username is only superficial for players logged into USGN already, USGN users automatically log in to their accounts at join time...

If you really need something like this:

Via USGN:

in auth.lua, replace the mentioned functions with

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
function act.login(id, password)
	__help__ =
	[[
		-Description:
		 Login to the user system
		-Usage:
		 !login <password>
		-Example:
		 !login 123456
	]]
	local user = User.login(tostring(player(id, "usgn")), id, password)
	if user then msg2(id, "Successfully logged in);events.invoke("login", id, tostring(player(id, "usgn"))) end
end

function act.register(id, password)
	__help__ =
	[[
		-Description:
		 Register your information into the user system
		-Usage:
		 !register <password>
		-Example:
		 !register 123456
	]]
	local username = tostring(player(id, "usgn"))
	local user = User.register(username, password, player(id, "usgn"))
	if user then
		msg2(id, "Successfully registered as '%s'"%username)
		User.login(id, password)
		events.invoke("register", id, username)
	else
		msg2(id, "The username '%s' is already taken."%username)
	end
end

Not tested.

Out of my own personal preferences, I do not support storing the same schema of information in different files. All data are encoded and stored as pure Lua files.

If you also need to have custom messages, then it's trivial to just hard code them into the system.

old Re: Authentication, Auth

Apache uwu
User Off Offline

Quote
Now that looks correct. I have no idea what he posted before. Not even correct because of the lack of commas.

What type of language is that? So simple {red}...etc..

1
sucess: '{YELLOW}{PLUGIN} {BRIGHTGREEN}Reload complete!'

Success

old Re: Authentication, Auth

dizziness
User Off Offline

Quote
user Apache uwu has written
Now that looks correct. I have no idea what he posted before. Not even correct because of the lack of commas.

What type of language is that? So simple {red}...etc..

1
sucess: '{YELLOW}{PLUGIN} {BRIGHTGREEN}Reload complete!'

Success


That information, i get that from some minecraft plugin and little edit it like /register password email, So can you make that lua for me? Please
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview