jlzf.php 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <?php
  2. include 'jl.php';
  3. if ($_POST) {
  4. /*
  5. "1" => array (
  6. "user" =>"admin",
  7. "pswd" =>"admin",
  8. "zoneid"=>1,
  9. "srv_name"=>"game.dev.1",
  10. "name"=>"内网1区",
  11. "url"=>"http://127.0.0.1:39081",
  12. "hidde"=>false
  13. )
  14. */
  15. $quid = trim(poststr('qu'));
  16. $qu = $quarr[$quid];
  17. $uid = trim(poststr('username'));
  18. $url = $qu['url'];
  19. $srv_name = $qu['srv_name'];
  20. $adm_user = $qu['user'];
  21. $adm_pswd = $qu['pswd'];
  22. $cookie = loginGetCookie($url,$adm_user,$adm_pswd);
  23. $pwd = trim(poststr('pwd'));
  24. //参数处理
  25. $time = time();
  26. //参数处理
  27. if ($quid >= 1) {
  28. if ($uid != '') {
  29. if ($_POST['type']) {
  30. $type = trim($_POST['type']);
  31. switch ($type) {
  32. case 'mailjl':
  33. $jl = trim(poststr('mailid'));
  34. if ($jl == '') {
  35. exit('精灵ID错误');
  36. }
  37. $find = false;
  38. $file = fopen("jl.txt", "r");
  39. while (!feof($file)) {
  40. $line = fgets($file);
  41. $txts = explode('|', $line);
  42. if ($txts[0] == $jl) {
  43. $find = true;
  44. }
  45. }
  46. fclose($file);
  47. if ($find == false) {
  48. exit('精灵ID错误');
  49. }
  50. $chargetype = trim(poststr('mailid'));
  51. $result = sendMail($url,$uid,$cookie,$chargetype,$chargenum,$srv_name);
  52. echo json_encode(array('info'=>1,'msg'=>'发送成功!'));
  53. //exit('发送成功!');
  54. break;
  55. case 'daoju':
  56. if ($viplevel < 1) {
  57. exit('VIP权限不足');
  58. }
  59. $mailid = trim(poststr('item'));
  60. if ($mailid == '') {
  61. exit('物品ID错误');
  62. }
  63. $find = false;
  64. $file = fopen("../item.txt", "r");
  65. while (!feof($file)) {
  66. $line = fgets($file);
  67. $txts = explode('|', $line);
  68. if ($txts[0] == $mailid) {
  69. $find = true;
  70. }
  71. }
  72. fclose($file);
  73. if ($find == false) {
  74. exit('物品ID不存在');
  75. }
  76. $mailnum = trim(poststr('num'));
  77. if ($mailnum == '' || $mailnum < 0 || $mailnum > 9999) {
  78. exit('发送数量错误');
  79. }
  80. //防止f12
  81. $mailid = trim(poststr('item'));
  82. if ($mailid == '') {
  83. exit('物品ID错误');
  84. }
  85. $find = false;
  86. $file = fopen("../xmitem.txt", "r");
  87. while (!feof($file)) {
  88. $line = fgets($file);
  89. $txts = explode(';', $line);
  90. if ($txts[0] == $mailid) {
  91. $find = true;
  92. }
  93. }
  94. fclose($file);
  95. if ($find == false) {
  96. exit('物品ID不存在');
  97. }
  98. $mailnum = trim(poststr('num'));
  99. if ($mailnum == '' || $mailnum < 0 || $mailnum > 9999) {
  100. exit('发送数量太大,不允许哦,人家受不鸟啦~!');
  101. }
  102. //防止f12
  103. $item = trim($_POST['item']);
  104. $itemnum = trim($_POST['num']);
  105. $title = trim($_POST['title']);
  106. $content = trim($_POST['content']);
  107. sendMail($url,$uid,$cookie,$item,$itemnum,$srv_name,$title,$content);
  108. exit('发送成功!');
  109. break;
  110. default:
  111. exit('系统异常,请重试!');
  112. break;
  113. }
  114. } else {
  115. exit('抓尼玛呢!');
  116. }
  117. } else {
  118. exit('角色名错误');
  119. }
  120. } else {
  121. exit('区号错误');
  122. }
  123. } else {
  124. exit('非法请求!请自重');
  125. }