[Under construction] Auth plugin
#1
Hello, I work on auth plugin (looklike xAuth plugin for bukkit)


Works:
/register
/changepass
Block player move

To do:
/login
Reply
Thanks given by:
#2
Read this page (just created it) http://mc-server.org/wiki/doku.php?id=ap...in:onlogin

And check out the Core plugin for an example.
Reply
Thanks given by:
#3
Could you install the md5 Library for crypt the password?

http://www.keplerproject.org/md5/index.html
Reply
Thanks given by:
#4
I already have a MD5 encryption script in MCServer, but it's not open to Lua yet... I'll try to include it in next release.
In the meanwhile I think you can test your plugin without encryption
Reply
Thanks given by:
#5
Yes, for moment I have my crypt function Smile

PHP Code:
function AuthPluginCrypt(Password)
   return 
Password
end 

Found my first bug but I dont now how to solve it

PHP Code:
self:AddCommand("/changepass"" - [Old Password] [New Password] - Change pass""auth.changepass")   -- Commande pour changer de mot de pass (commun)
self:AddCommand("/test""""auth.test")   -- Commande pour tester
self
:AddCommand("/register"" - [Password] - Login with the password""auth.register")          -- Commande pour s'enregistrer (commun)

self:BindCommand( "/changepass", "auth.changepass",    HandleChangePassCommand )      -- Associe la commande /changepass a la fonction HandleChangePassCommand
self:BindCommand( "/test", "auth.test",    HandleTestCommand )      -- Associe la commande /test a la fonction HandleTestCommand
self:BindCommand( "/register", "auth.register",    HandleRegisterCommand )           -- Associe la commande /register a la fonction HandleRegisterCommand 

Product this with /help 3


Auth
/changepass - [Old Password] [New Password] - Change pass
Auth
/test
/register - [Password] - Login with the password

An idea to fhix that?
Reply
Thanks given by:
#6
Hmm.. so you get 'Auth' twice in /help ? Sounds like a bug in the /help command of Core. Nothing you have to worry about.
Reply
Thanks given by:
#7
Could you make the doc for OnDisconnect please?

And I have send the screenshot for /help

Another problem...

PHP Code:
local PlayerName Player:GetName()
if ( 
UsersIni:ReadFile() == true then
      UsersIni
:DeleteValue(PlayerName"X"
      
UsersIni:SetValue(PlayerName"X"Player:GetPosZ())
      
UsersIni:WriteFile()
      return 
true                 
end 

Transfrome my Ini file:
Code:
[Zehir_]
Groups=Admins
Password=testtest
Into
Code:
[Zehir_]
Groups=Admins
Password=testtest
Groups=Admins
Password=testtest
X=-2730.3552566584

[Zehir_]
Reply
Thanks given by:
#8
Thanks for the screenshot.

About your ini problem, make sure you only ReadFile() ONCE:
Code:
UsersIni = cIniFile("myIni.ini")
UsersIni:ReadFile()
UsersIni:ReadFile()
UsersIni:ReadFile()
UsersIni:WriteFile()
BAD!

Code:
UsersIni = cIniFile("myIni.ini")
UsersIni:ReadFile()
UsersIni:WriteFile()
GoodTongue


Here's the page for OnDisconnect: http://www.mc-server.org/wiki/doku.php?i...disconnect
Reply
Thanks given by:
#9
What is this fuction for ini files?

Erase();
Clear();
Reset();

Edit: Solve problem with change local values
function AuthPlugin:OnPlayerMove( Player )

Can you change your function to detect the displacement of a block and not 0.00000001 bloc? Because this spam my channel of
PHP Code:
Player:SendMessagecChatColor.Red .. "You must login" 

Because I want block movement if player not login

PHP Code:
function AuthPlugin:OnPlayerMovePlayer )
   if 
IsAuth == 0 then
      
--Player:TeleportToSpawnPosxSpawnPosySpawnPosz )  
   else               
      return 
true   
   end
   Player
:SendMessagecChatColor.Red .. "You must login" )  
   return 
false   
end 
A idea for not spam this message?
Reply
Thanks given by:
#10
Oh to use this fuction? AddKeyName

I have try this but not work:

PHP Code:
local UsersIni cIniFile("users.ini")
if ( 
UsersIni:ReadFile() == true then
         UsersIni
:AddKeyName(Player:GetName())
         
UsersIni:WriteFile()
         return 
true
end 

I just want add the key if not exist

Code:
[Playername]
Reply
Thanks given by:




Users browsing this thread: 5 Guest(s)