找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 45|回复: 0

剑零账号注册php

[复制链接]
发表于 2024-10-13 16:01:47 | 显示全部楼层 |阅读模式
剑零账号注册php
  1. <?php
  2. public function register_account()
  3.     {
  4.         $result = CURL("http;//127.0.0.1:6605/apps-state",null,'get');
  5.         $resultapp = $this->cut_str("<AppName>AuthSrv2</AppName>","</App>",$result);
  6.         $resultapp = $this->cut_str("<Epoch>","</Epoch>",$resultapp);
  7.         

  8.         $post = input('param.');
  9.         $account = $post['account'];
  10.         $password = $post['password'];
  11.         if($account == '' || $password == ''){
  12.             echo '{"code":500,"msg":"账号和密码不能为空"}';
  13.             return;
  14.         }
  15.         $sign = $this->getTradeSign($post,$account.'e7938f087738953de75fb77d03de11e4');
  16.         if($post['sign']!=$sign){
  17.             echo '{"code":500,"msg":"签名错误"}';
  18.             return;
  19.         }

  20.         $param=[
  21.             'loginName' => $account.'@ncsoft.com',
  22.             'userName' => $account,
  23.             'password' => $password,
  24.             'effectiveUntil' => '',
  25.             'loginNameValidated'=>1,
  26.             'userCenter' => 17,
  27.         ];
  28.                 $addr = "http://127.0.0.1:6605/spawned/AuthSrv.1.".$resultapp."/test/create_account";
  29.         $result = CURL($addr,$param,'get');
  30.         
  31.         if(strpos($result,'<Reply>') !== false){
  32.             echo '{"code":10000,"msg":"注册成功"}';
  33.             return;
  34.         }
  35.         $result_xml = xml_decode($result);
  36.                 $addr = "11";
  37.         $msg = '注册失败'.$addr;
  38.         if($result_xml['@attributes']['code']=='3043'){
  39.             $msg = "已经有此账号";
  40.         }
  41.         if($result_xml['@attributes']['code']=='10'){
  42.             $msg = "参数错误";
  43.         }
  44.         echo '{"code":500,"msg":'.$msg.$result.'}';
  45.         return;
  46.     }
复制代码

游客,如果您要查看本帖隐藏内容请回复

Archiver|手机版|小黑屋|网单游戏

GMT+8, 2026-11-6 16:39 , Processed in 0.041805 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表