database idea

Results 1 to 21 of 21
  1. #1

    database idea

    to start off i have little php and database experience, this is just a question as to which this could give me issues in the future or will not work.

    i want to link a website with the game server, so when players register on the website they will be registered on the website and server.
    i figured i can just change the website to use the login/password
    of the game servers user/password, would that work?

    now my other question is can i change the tables for the user's to something else would the server need to be modifyed to read what ever table i make of it? for the second question i just wanna know what i would need to do, not how to do it.

    both database's are on the same sql.

    i think the easiest way if i can would be to change the game server to read the websites database tables, if its possible got an idea on what i should modify to fix it?
    Last edited by softsoldier; 10-03-11 at 05:01 PM.


  2. #2
    cats addicted Zorno is offline
    MemberRank
    Apr 2010 Join Date
    GermanyLocation
    1,465Posts

    Re: database idea

    Easiest way whould be when you simply add code to the webpages registerscript that also registers them to the server. This way you dont need to mess around with the databases.

  3. #3
    Black Magic Development das7002 is offline
    MemberRank
    Apr 2010 Join Date
    EarthLocation
    2,188Posts

    Re: database idea

    Quote Originally Posted by Zorno View Post
    Easiest way whould be when you simply add code to the webpages registerscript that also registers them to the server. This way you dont need to mess around with the databases.
    Or modify the 'website' to use the authd user tables, which should not be that hard

    Though registering both would be somewhat easier, you'd also have to update the change password scripts/functions as well.

  4. #4

    Re: database idea

    thanks i was just needing a second opinion and yeah i figured that much about the change password xD

    ---------- Post added at 05:57 PM ---------- Previous post was at 04:25 PM ----------

    wow this kinda sucks, cause the website requires a prefix, such as e107_users and no matter what it wont let me change it if i do it will cause errors xd

  5. #5
    Angelemu founder tbnanubis is offline
    MemberRank
    Mar 2011 Join Date
    Unicorn ForestLocation
    527Posts

    Re: database idea

    create a view for the users table of pw, which maps them to asdf_users
    you can also put your pw users in asdf_users, all you need to change is the table name in all stored procedures, the game uses only those to interact with the sql
    Last edited by tbnanubis; 10-03-11 at 07:00 PM.

  6. #6

    Re: database idea

    couldnt i just change something in the server files to make it read the prefix?

  7. #7

    Re: database idea

    The only draw back I can take from this, tho it is a good idea, is from my experience, players are always making alt's... so not only will you have the server registration file filled with all that information, but now you'll have your forums filled as well... Short term, probably not a big deal, but over time players come, players go, and that info piles up. Just giving a little advice. It sounds like a sane idea, less work to register, but this is rarely a sane world :P

  8. #8

    Re: database idea

    xD, well im un sure about adding this to the forums cause if people see the id of your forum name "dont think it has a nickname" then that can be a security flaw with players accounts.

  9. #9

    Re: database idea

    True, I remembered one server I played (leaves name off :P ) where your forum registration name was the same as your account name... All I was thinking is... all they need now is my pass, and how hard is that to get when your usually limited to a 10 character pass >.>

  10. #10

    Re: database idea

    heh, i promised a friend i could do this but i bet it would be much easier making my own registration page cause this "e107" service, is very nice it does everything for you but its not as flexable.

    cause modifying one thing means i have to modify over 20 other things and thats just gonna take forever and countless hours of trial and error
    Last edited by softsoldier; 10-03-11 at 08:32 PM.

  11. #11
    Black Magic Development das7002 is offline
    MemberRank
    Apr 2010 Join Date
    EarthLocation
    2,188Posts

    Re: database idea

    Thats why you do it like PWE does, login name which is used for login and then a 'forum' name

  12. #12

    Re: database idea

    well since its on the same database, could i make it like what ever they type into $Login forwards that information to another table like the website table's "e107_users" table?im not worried about changing the password since it will be pretty much the same concept.

  13. #13
    cats addicted Zorno is offline
    MemberRank
    Apr 2010 Join Date
    GermanyLocation
    1,465Posts

    Re: database idea

    Why not do it this way:

    Forums/Webpage - Login & password, extra profile tab for PW login ( not visible exept for admins )

    Whould be a secure way to do that if you check that login for webpage is not the same as for pw.

  14. #14

    Re: database idea

    i wouldnt know xD ive been overcomplicating this thing more than it should be, atm im just going to worry about modifying the already made script for registration and try to get it to save both information to the users table and the e207_users table
    would save a bunch of time when i find out how to do it xD.

  15. #15
    cats addicted Zorno is offline
    MemberRank
    Apr 2010 Join Date
    GermanyLocation
    1,465Posts

    Re: database idea

    Quote Originally Posted by softsoldier View Post
    i wouldnt know xD ive been overcomplicating this thing more than it should be, atm im just going to worry about modifying the already made script for registration and try to get it to save both information to the users table and the e207_users table
    would save a bunch of time when i find out how to do it xD.
    simply do two sql posts with the same string in it ?

  16. #16

    Re: database idea

    im trying to find where it puts the information in the user tab but im not smart enough xD

    ---------- Post added at 10:13 PM ---------- Previous post was at 09:06 PM ----------

    heres the code from the original reg script for the game server
    <? //=====Script by trash=====// //=====For MySQL Database=====// include "co - Pastebin.com
    i was wondering can someone show me which line i should add or where to add the line so i can make what ever it sends to the "Users" table to send to "e207_User" table?

  17. #17
    Angelemu founder tbnanubis is offline
    MemberRank
    Mar 2011 Join Date
    Unicorn ForestLocation
    527Posts

    Re: database idea

    change
    PHP Code:
     $Result MySQL_Query("SELECT name FROM users WHERE name='$Login'") or ("Can't execute query."); 
    to
    PHP Code:
     $Result MySQL_Query("SELECT name FROM e207_Users WHERE name='$Login'") or ("Can't execute query."); 
    after that change the stored procedures "acquireuserpasswd", "changepasswd", "changepasswd2" and "adduser" and exchange all "users" with "e207_Users"

  18. #18

    Re: database idea

    i had it working for a sec i added an "insert into" function to it, it worked once then stopped inserting into the second table.
    heres my new code
    <? //=====Script by trash=====// //=====For MySQL Database=====// include "co - Pastebin.com
    line 96 and 97
    what im trying to achieve now is, as soon as a user registers, and adds the information to the first table
    it will insert that data into the second table.
    it worked once so i figured id stick with it.
    i know i changed how i was going to do it alot but now im sure this is the right way.

  19. #19

    Re: database idea

    ok i did it, now its adding into the new table, one last question, why is it using such an odd password? is it the $Salt method? cause i have everything else working great, exept the password. after this is finished i should have a perfectly working register script for the website and game.

    cant i change the password to just use md5? cause the website uses just md5 or will that mess with the ingame server?


    ---update---
    well switching my password to md5 makes the account unusable, so i guess id have to try to make the website read the password x.x this is the last thing i need before this can be complete xd

    unless i was to add another form like, use the same "repeat password" but when they do repeat password, it actually sends the password in md5 to the second table

    ---final update---
    finished, what i did was i added, "$Repass = md5($Pass)" above salt, and when i used the insert into method, i used $Repass instead of $salt, so $salt is for the gameserver and $Repass is for the md5 encryption for the website, and they have to match or it would give an error, its a shame i spent all day for such a simple fix, thank you all <3 i learned alot about php today xD
    Last edited by softsoldier; 11-03-11 at 10:44 AM.

  20. #20
    Black Magic Development das7002 is offline
    MemberRank
    Apr 2010 Join Date
    EarthLocation
    2,188Posts

    Re: database idea

    Quote Originally Posted by softsoldier View Post
    ok i did it, now its adding into the new table, one last question, why is it using such an odd password? is it the $Salt method? cause i have everything else working great, exept the password. after this is finished i should have a perfectly working register script for the website and game.

    cant i change the password to just use md5? cause the website uses just md5 or will that mess with the ingame server?


    ---update---
    well switching my password to md5 makes the account unusable, so i guess id have to try to make the website read the password x.x this is the last thing i need before this can be complete xd

    unless i was to add another form like, use the same "repeat password" but when they do repeat password, it actually sends the password in md5 to the second table

    ---final update---
    finished, what i did was i added, "$Repass = md5($Pass)" above salt, and when i used the insert into method, i used $Repass instead of $salt, so $salt is for the gameserver and $Repass is for the md5 encryption for the website, and they have to match or it would give an error, its a shame i spent all day for such a simple fix, thank you all <3 i learned alot about php today xD
    Well you did all that for nothing... as it is in md5, just not in hex, you could've done bin2hex($passfromdb); tada same as if it was in hex in database...

  21. #21

    Re: database idea

    i know xD but it works and im happy, im not a genius im just a big fan of copy + paste and google



Advertisement