DragonPrime - LoGD Resource Community
Welcome Guest
  • Good morning, Guest.
    Please log in, or register.
  • July 31, 2010, 03:42:48 AM
Home Forums News Links Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
IRC Channels
Search

Pages: [1] 2   Go Down
  Print  
Author Topic: One User ID?  (Read 1695 times)
0 Members and 1 Guest are viewing this topic.
Xetox
Guest
« on: November 17, 2005, 11:37:17 AM »

Is there a way...I am using xoops...http://morbidfascinations.com.  I am wondering if there was a way that when they create a user on the website..if they would get a user account in logd?  I am wanting to make the game only availiable to registerd users and have a account made for them when they register on the website?
Thanks
Logged
Torne
SVN Users
Codemeister
*
Offline Offline

Posts: 259


Code ninja


View Profile
« Reply #1 on: November 17, 2005, 11:46:35 AM »

Not just like that - you have to create a character, which isn't exactly part of the XOOPS signup process.

What you could do, though, with a variety of exciting modifications (may or may not need core changes, haven't looked) is:
1) prevent anyone not currently logged into your XOOPS from registering on lotgd
2) don't let them type a name, but use their XOOPS login name
3) don't have them create a password
4) proceed with the rest of registration as normal
5) modify login process to authenticate them against the XOOPS auth table.

This wouldn't be *too* hard, but is certainly nontrivial. If possible as a module, it could be made to apply to almost any CMS/forum/etc by having the table/column details for the authentication configurable, etc.
Logged
Arune
Member
Mod God
*****
Offline Offline

Posts: 718


Arune Vai - khatfield


View Profile WWW
« Reply #2 on: November 17, 2005, 11:50:04 AM »

Could write a Xoops module/Modify the Xoops signup script to create the username/password in the LoGD accounts table and then when they logged into LoGD they would be prompted to fill out the rest of their character information.

Which would make it much simpler.
« Last Edit: November 17, 2005, 11:50:23 AM by Arune » Logged
Torne
SVN Users
Codemeister
*
Offline Offline

Posts: 259


Code ninja


View Profile
« Reply #3 on: November 17, 2005, 12:13:57 PM »

That would still be quite a lot of hackery to LotGD, it wouldn't just work. It'd pick defaults for all the other columns in the accounts table...
Logged
Arune
Member
Mod God
*****
Offline Offline

Posts: 718


Arune Vai - khatfield


View Profile WWW
« Reply #4 on: November 17, 2005, 12:17:13 PM »

Not necassarily..

If you just did an insert for those 2-3 (If Email is needed) fields then it will prompt you to create your character upon signing in.

Course you would have to do the password encryption, but otherwise it is pretty straight forward.
« Last Edit: November 17, 2005, 12:23:49 PM by Arune » Logged
Torne
SVN Users
Codemeister
*
Offline Offline

Posts: 259


Code ninja


View Profile
« Reply #5 on: November 17, 2005, 12:25:49 PM »

You'd have to duplicate a lot of the functionality of create.php in XOOPS to make that work, not just insert the username and password. The user will get prompted to pick a race and specialty, yes, but they will get no starting gold, they will always be male, they won't have a title, the newest player display in the village won't update, and probably other things I've not spotted. If you duplicated that functionality too, you'd need to duplicate reading the settings table (to find the correct values for these things, so that you don't have to edit the XOOPS module to change them), and so on and so on. Wink

I think it'd be easier to do it by externally authenticating, and would be less likely to be broken by future changes to the game.
Logged
Arune
Member
Mod God
*****
Offline Offline

Posts: 718


Arune Vai - khatfield


View Profile WWW
« Reply #6 on: November 17, 2005, 12:36:23 PM »

Actually you are partially correct. I missed one thing. You would have to do a sex insert.

So it would have to have:
username
password
sex

That is all. No reason why it will not work.
Logged
Arune
Member
Mod God
*****
Offline Offline

Posts: 718


Arune Vai - khatfield


View Profile WWW
« Reply #7 on: November 17, 2005, 12:40:41 PM »

Course you would have to do the password encryption, but otherwise it is pretty straight forward.

Aye
Logged
Torne
SVN Users
Codemeister
*
Offline Offline

Posts: 259


Code ninja


View Profile
« Reply #8 on: November 17, 2005, 12:52:42 PM »

I just tried it, since my suggestions based on reading the code don't seem to convince you, and you don't get properly assigned a title, you get no starting gold, you miss the processing of modules that hook process-create, create-form or check-create, you don't get marked as the newest player, and probably other stuff I didn't check for.

None of the code in create.php happens, and most of this code is not duplicated anywhere else. xdebug confirms that at no point during login does create.php get read (which should be obvious).

Processing module hooks in particular would be very hard to duplicate in an XOOPS module.
Logged
Arune
Member
Mod God
*****
Offline Offline

Posts: 718


Arune Vai - khatfield


View Profile WWW
« Reply #9 on: November 17, 2005, 01:18:39 PM »

k...

I'm not going to argue the point. I know what the code says. I'm just saying quick and dirty it can be done.

In any case you can just as well insert the superuser flag, short title, gold, login / password.

The superuser flag can be hard coded as well as the short title and the gold amount. The login and password would be the only thing dynamic.

It can be done.

Your saying it has to be done your way...IMO I would just insert the username/pass/sex and then make them login on a custom login page that automatically called create.
« Last Edit: November 17, 2005, 01:45:15 PM by Arune » Logged
Torne
SVN Users
Codemeister
*
Offline Offline

Posts: 259


Code ninja


View Profile
« Reply #10 on: November 17, 2005, 01:38:30 PM »

Reproducing large amounts of the behaviour of create.php, or hacking up bits of core to make login do some complex dance of redirection, is the bit I'd call overcomplicated.. and it makes your app very fragile, and prone to fall over if you, say, were to update logd.

I'm saying it'd be much easier to do it my way, not that it's the only way it can be done. A small change to login to auth against a different table (very small if you didn't care about it being useful to other people, and hardcoded XOOPS's behaviour into it), a small change to create to drop some fields and read the session from the other app (again, smaller if you hardcode XOOPS's behaviour), and you're done. Less work than your typical nasty portal-addon-to-forum-code, no duplicating LotGD code (might manage without duplicating XOOPS code either, if you're lucky and the php files can be included sanely), and all LotGD char-creation related stuff (settings, module hooks, etc) will Just Work(tm).
Logged
Arune
Member
Mod God
*****
Offline Offline

Posts: 718


Arune Vai - khatfield


View Profile WWW
« Reply #11 on: November 17, 2005, 01:43:03 PM »

You maybe right. I haven't looked at the Xoops code to see just how the signup process works. I'm only familiar with Mambo and I know that trying to change its process very much causes tons of headaches.

Your way does sound easier in the long run with upgrades etc.
« Last Edit: November 17, 2005, 01:43:33 PM by Arune » Logged
Torne
SVN Users
Codemeister
*
Offline Offline

Posts: 259


Code ninja


View Profile
« Reply #12 on: November 17, 2005, 01:53:26 PM »

The solution I propose doesn't require touching a single line of XOOPS code, though you might need to read some of it to understand the session format and the encryption method used for the password. LotGD is the application with the special requirements here - if it were just some forum or something, doing a dual-create would be far more reasonable, as both would require similar user information and would likely not need complex new-user processing. Thus, it seems sensible to leave XOOPS alone, as it's doing what it's good at (being a CMS, and managing users in the normal website fashion).
Logged
Dannic
Guest
« Reply #13 on: November 17, 2005, 05:08:12 PM »

if you have two seperate databases you can always write a module which will take the user info from the registration process of lotgd and insert it into the other database.  Give the user a password that they can change for the xoops side.

All it would take is a module that hooks into process-create.
Logged
kickme
Global Moderator
Mod God
*****
Online Online

Posts: 1531


Yay for elephants!


View Profile WWW
« Reply #14 on: November 17, 2005, 08:01:10 PM »

You could just post the data to "create.php?op=create" after passing it through the md5pass() function. The JS code for it is in the create character page
Logged

Waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka<br /><br />A mini city
Pages: [1] 2   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Version 1.1.2 is the current supported version and is available for download.

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Who's Online
25 Guests, 2 Users
spector, kickme
DragonPrime LoGD
Recent Topics
Home Forums News Links Downloads Login Register Advanced Search