Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / allowing players to ummmm register(?)

Author
Message
Armeggadon
23
Years of Service
User Offline
Joined: 10th Apr 2003
Location: United States
Posted: 24th May 2003 17:59 Edited at: 24th May 2003 18:01
THIS IS THE CORRECT BOARD(in case you were redirected from the DB board)

in my game its only one player and not online. i want ti so that different ppl can set up different "accounts" for themselves.

ex. john and suzy want to play this game but everytime john gets on its where suzy stopped playing and vice-versa.

how would i make it so that john and suzy have different accounts and diferent passwords that THEY create(in other words i can create accounts and passwords thats easy. but i want the player to be able to create their own username and password) but not just for 2 ppl but for about 10(its going to be a game between mainly my friends for a "competition" if you want to call it that) i know how to set up an array with the usernames and passwords but i dont know how i could have it be blank at the begining and then the player adds their username and password and it fills a space in the array.

how would i go about doing this. thx in adv and if im not specific or clear enough just tell me and i'll try to reword it

[edit} also how would i make it so that when a person leaves the game and come back they dont have to start all over again(how would i store the usernames and passwrds so that evertime they come on it doesn't ask for them to create a username and password again and when they d enter their username and password it starts the game where they are at)
Sry if im asking for a lot i just need some help and their aren't really any tutorials on how to do this
thx again in adv.

OH YEAH ..... WELL .....
ummmmmmm ....
Let me think on it
hexGEAR
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Naytonia
Posted: 24th May 2003 18:26 Edited at: 24th May 2003 18:27
try that out (click ont he source link), just made it now, it's one of the many ways you could do this, this is probably kinda like how i would have done it oh yeah it's made in classic, but i think it should work in pro, don't think thier any invalid commands!

everyday of life is a new chapter that has already been fortold but is up to the soul to capture.
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 24th May 2003 18:56
hehee thats pretty good, should work fine in pro - but i wouldn't bet on it.

however on what is actually being asked, it depends how you want to go about implimenting it... the easiest way would be to probably use MRTATOADs Database plugin and use that to connect to a MySql online data base pass the information you need using that.

another way would be to create a directory on your site which would have a file ~username.user and you'd then download a Table of Contents file, if you use the prefix of say 16 letters per username - that way you can then use 16bytes per user and know exactly how long each username is... just take out the spaces when you download the file to get the names or perhaps add '#' or something to the end to fill all 16bytes. (obviously you'd be recording characters of a name using the chr$() command which exports a single character in byte form)

you make a token file that people look for to check if the file is currently being updated, so that you just display "connecting to server please wait" and wait like 500ms until trying again

eitherway its a pretty simple affair

Within the Epic battle of the fates the Shadow and the Angel will meet. With it will harbinger the very fight of good vs evil!
Armeggadon
23
Years of Service
User Offline
Joined: 10th Apr 2003
Location: United States
Posted: 24th May 2003 22:52 Edited at: 24th May 2003 22:58
@Raven --- only one problem my game is not an online game. i dont want to connect to any kind of server or anything internet(except maybe to download it if it becomes good enough).

@hexgear --- when i use your code it just comes up with a black screen. im not sure how to fix this.

if there are any other things like this for a NOT ONLINE type of game then plz tell me i really need one

the ultimate sig

a box with a little red square
hexGEAR
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Naytonia
Posted: 24th May 2003 23:13
thing is for some reason when using the input command:

input "enter name: ",a$

the text "enter name" doesn't show up on peoples computers well, i'll see if i can find a different way of conveying it to you

everyday of life is a new chapter that has already been fortold but is up to the soul to capture.
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 25th May 2003 00:42
well the same prinicpals still apply, just save the data needed into your own personal database... i mean you know there are the stack array functions for just adding at the end and such... you shoudl try opening up the manual

Within the Epic battle of the fates the Shadow and the Angel will meet. With it will harbinger the very fight of good vs evil!
the_winch
23
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 25th May 2003 01:15
First you need to work out all the information you need to recreate the game in the state it was when the user saved and a way to store this in a file called USERNAME.sav.

Then it is just a matter of saving passwords in the file as well. Then when the program starts it looks for all the .sav files and the user selects one. If they get the password right the program reads the saved data from the file and recreates the game as it was when the user saved it.

Login to post a reply

Server time is: 2026-07-11 13:58:20
Your offset time is: 2026-07-11 13:58:20