Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
4
Question by siddharth3322 · Nov 05, 2016 at 12:26 PM · wwwloginemailwebserviceregistration

Email verification based registration

For my game, I want to do registration of game players. For this I was using Email address for actual player identity.

Can anybody able to give me a way how to check actual email address? so that I can ignore fake email address players. Which ever player's email address is actual reach at destination they got successful registration in game, and rest get rejection.

Please share your opinion into this. My motto is unique identity of each game players.

Comment
Add comment · Show 7
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Zitoox · Nov 05, 2016 at 02:14 PM 0
Share

Nice question! This would be amazing to know. Upvote.

avatar image iAmAwsum · Nov 05, 2016 at 02:59 PM 0
Share

You could make it so the account activates/let's the player in only after they accepted a confirmation that has been sent to said email.

avatar image siddharth3322 iAmAwsum · Nov 05, 2016 at 03:01 PM 0
Share

@iAmAwsum, can you please clarify this more? so that I can implement exactly, you want to say.

avatar image Zitoox siddharth3322 · Nov 05, 2016 at 03:22 PM 0
Share

He said like:

When the user registrate it's account using e-mail, password, etc... Another e-mail will automatically be sent to YOUR e-mail. From there you can accept the e-mails you think are real and when this happens they will be Confirmed as real players. If you make it, please let me know. I would like to know how to make something like this.

Show more comments
avatar image Zitoox · Nov 05, 2016 at 03:57 PM 0
Share

Are you using servers?

avatar image siddharth3322 Zitoox · Nov 05, 2016 at 03:58 PM 0
Share

Yes I am using servers so directly in communication with web developers.

3 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by money4honey · Nov 05, 2016 at 06:01 PM

you can send email with verification link via php, and use database to store information about verification

 <?php
     
     function sendEmail($from, $to, $subject, $message) {
         $message = "<html>
         <head><title>{$subject}</title></head>
         <body>{$message}</body>
         </html>";
         $headers = "MIME-Version: 1.0" . "\r\n";
         $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
         $headers .= "From: <{$from}>" . "\r\n";
         if (count($to) == 1) {
             mail($to, $subject, $message, $headers);
         }
         elseif (count($to) > 1) {
             foreach($to as $receiver) {
                 mail($receiver, $subject, $message, $headers);
             }
         }
     }
     
     function cleanInput($value = "") {
         $value = trim($value);
         $value = strip_tags($value);
         $value = htmlspecialchars($value);
         $value = addslashes($value);
         
         return $value;
     }
     
     function validate_email() {
         return filter_var($email, FILTER_VALIDATE_EMAIL) ? true : false);
     }
     
     function generatePassword($length = 8) {
         $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
         $count = mb_strlen($chars);
         
         for ($i = 0, $result = ''; $i < $length; $i++) {
             $index = rand(0, $count - 1);
             $result .= mb_substr($chars, $index, 1);
         }
         
         return $result;
     }
     
     if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         if ($_POST["email_verification"]) {
             $email = cleanInput($_POST["email"]);
             
             if (validate_email($email)) {
                 $key = generatePassword();
                 $link = "http://yoursite.com/handler.php?confirm_email=1&email={$email}&key={$key}";
                 
                 // here you need send email & key relationship to database
             
                 sendEmail("me@mail.com", array($email), "Confirm your email", "For email confirmation <a href=\"{$link}\">click this link</a>.")
             }
             else {
                 echo "invalid email";
             }
         }
     }
     
     if ($_SERVER['REQUEST_METHOD'] == 'GET') {
     if ($_GET["confirm_email"]) {
         $email = cleanInput($_GET["email"]);
         $key = cleanInput($_GET["key"]);
         
         if () {// if email exist in database and key is valid
             // tell to db that this email pass verification
         }
     }
     // this for checking user status from unity script
     elseif ($_GET["is_verification_complete"]) {
         // send request to db for user verification status
     }
 }
     
 ?>
Comment
Add comment · Show 9 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image siddharth3322 · Nov 06, 2016 at 09:33 AM 0
Share

@money4honey, this point I can't able to get! does fiter_var method in built provided by php ??

avatar image money4honey siddharth3322 · Nov 06, 2016 at 10:31 AM 0
Share

fiter_var is built-in php method. I think you can use it by doing post request from unity script to your server

avatar image siddharth3322 money4honey · Nov 06, 2016 at 10:35 AM 0
Share

Actually how email verification will perform into this? that I can't able to get...

Show more comments
avatar image money4honey · Nov 06, 2016 at 10:57 AM 0
Share

ok, check it now. i skip all code that relates to db requests

avatar image siddharth3322 money4honey · Nov 06, 2016 at 11:17 AM 0
Share

Now you are in right track :)

I have one question into this, as player fill up form and record is added into server and server send email for verification. If email address is fake then verification not get completed because of wrong email address. Then how to remove this fake record from server database?

avatar image money4honey siddharth3322 · Nov 06, 2016 at 11:35 AM 1
Share

i don't know how to check that email delivered successfully, but you can use cron-script for cleaning. for instance: if user registered a week ago and not pass email confirmation, you can delete this user.

 <?php
     if ($argv[1] == "clean_fake_users") {
         // send request to db, something like this
         // $$anonymous$$ETE FRO$$anonymous$$ G$$anonymous$$_users WHERE id in (SELECT id FRO$$anonymous$$ G$$anonymous$$_users WHERE timestamp < {$week_ago_timestamp} AND verification_status = 0)
     }
 ?>

you can run this script with cron, for instance:

 php /home/yoursite/public_html/php/cron_tasks.php clean_fake_users >/dev/null 2>&1

once per day: 0 0 ***

Show more comments
avatar image
1

Answer by Jip1912 · Nov 05, 2016 at 06:53 PM

You can use google play services if you are making an android game.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image siddharth3322 · Nov 06, 2016 at 09:32 AM 0
Share

I want to do custom registration because I want to get other information from game players as well.

avatar image
0

Answer by sandeepsmartest · Feb 21, 2017 at 06:07 AM

Just if in case , still if you are searching for solution, i have an alternate solution i.e., taking a mail id in which android registered may help you.As every android device will have one valid default mail id. Also , you can make use of android id aswell which is unique. Hope this may help you. Thank you. Nsks

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

66 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

WWW and cookies/login 3 Answers

yield return WWW.text not downloading??? 1 Answer

Emailing from within Unity iPhone or Android 2 Answers

Parallel web service request using WWW in Webplayer 0 Answers

Necessary Data Rewind Wasn't Possible WWWForm Error 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges