Commit fc0d777329dd4a881472a98ca4eda1e70a8936d9

Authored by 陆恒
1 parent ed5ff401
Exists in master

提交需求迭代部分代码

serveraddr/server
@@ -3,7 +3,6 @@ Redis @@ -3,7 +3,6 @@ Redis
3 密码:yx9CqMakgau65Z8V 3 密码:yx9CqMakgau65Z8V
4 端口:6379 4 端口:6379
5 5
6 -  
7 服务器 6 服务器
8 公网IP:39.96.43.217 7 公网IP:39.96.43.217
9 内网IP:172.17.178.29 8 内网IP:172.17.178.29
@@ -13,4 +12,4 @@ Redis @@ -13,4 +12,4 @@ Redis
13 测试环境域名 12 测试环境域名
14 els-pre.d3games.com 13 els-pre.d3games.com
15 正式服域名 14 正式服域名
16 - https://elsxxx.d3games.com  
17 \ No newline at end of file 15 \ No newline at end of file
  16 + https://elsxxx.d3games.com
18 \ No newline at end of file 17 \ No newline at end of file
src/HttpServer/jsonconf/RedConfig.json 0 → 100644
@@ -0,0 +1,1202 @@ @@ -0,0 +1,1202 @@
  1 +[
  2 + {
  3 + "id": 1,
  4 + "cash": 500
  5 + },
  6 + {
  7 + "id": 2,
  8 + "cash": 113288
  9 + },
  10 + {
  11 + "id": 3,
  12 + "cash": 86032
  13 + },
  14 + {
  15 + "id": 4,
  16 + "cash": 67216
  17 + },
  18 + {
  19 + "id": 5,
  20 + "cash": 54329
  21 + },
  22 + {
  23 + "id": 6,
  24 + "cash": 64538
  25 + },
  26 + {
  27 + "id": 7,
  28 + "cash": 44198
  29 + },
  30 + {
  31 + "id": 8,
  32 + "cash": 60738
  33 + },
  34 + {
  35 + "id": 9,
  36 + "cash": 76891
  37 + },
  38 + {
  39 + "id": 10,
  40 + "cash": 41328
  41 + },
  42 + {
  43 + "id": 11,
  44 + "cash": 32807
  45 + },
  46 + {
  47 + "id": 12,
  48 + "cash": 21068
  49 + },
  50 + {
  51 + "id": 13,
  52 + "cash": 13288
  53 + },
  54 + {
  55 + "id": 14,
  56 + "cash": 9808
  57 + },
  58 + {
  59 + "id": 15,
  60 + "cash": 6798
  61 + },
  62 + {
  63 + "id": 16,
  64 + "cash": 7423
  65 + },
  66 + {
  67 + "id": 17,
  68 + "cash": 8617
  69 + },
  70 + {
  71 + "id": 18,
  72 + "cash": 6890
  73 + },
  74 + {
  75 + "id": 19,
  76 + "cash": 7127
  77 + },
  78 + {
  79 + "id": 20,
  80 + "cash": 5391
  81 + },
  82 + {
  83 + "id": 21,
  84 + "cash": 4748
  85 + },
  86 + {
  87 + "id": 22,
  88 + "cash": 3367
  89 + },
  90 + {
  91 + "id": 23,
  92 + "cash": 2576
  93 + },
  94 + {
  95 + "id": 24,
  96 + "cash": 3161
  97 + },
  98 + {
  99 + "id": 25,
  100 + "cash": 2842
  101 + },
  102 + {
  103 + "id": 26,
  104 + "cash": 2973
  105 + },
  106 + {
  107 + "id": 27,
  108 + "cash": 3104
  109 + },
  110 + {
  111 + "id": 28,
  112 + "cash": 2551
  113 + },
  114 + {
  115 + "id": 29,
  116 + "cash": 2591
  117 + },
  118 + {
  119 + "id": 30,
  120 + "cash": 2583
  121 + },
  122 + {
  123 + "id": 31,
  124 + "cash": 2140
  125 + },
  126 + {
  127 + "id": 32,
  128 + "cash": 2356
  129 + },
  130 + {
  131 + "id": 33,
  132 + "cash": 1966
  133 + },
  134 + {
  135 + "id": 34,
  136 + "cash": 2202
  137 + },
  138 + {
  139 + "id": 35,
  140 + "cash": 1807
  141 + },
  142 + {
  143 + "id": 36,
  144 + "cash": 1637
  145 + },
  146 + {
  147 + "id": 37,
  148 + "cash": 1683
  149 + },
  150 + {
  151 + "id": 38,
  152 + "cash": 1822
  153 + },
  154 + {
  155 + "id": 39,
  156 + "cash": 1667
  157 + },
  158 + {
  159 + "id": 40,
  160 + "cash": 1655
  161 + },
  162 + {
  163 + "id": 41,
  164 + "cash": 907
  165 + },
  166 + {
  167 + "id": 42,
  168 + "cash": 958
  169 + },
  170 + {
  171 + "id": 43,
  172 + "cash": 501
  173 + },
  174 + {
  175 + "id": 44,
  176 + "cash": 553
  177 + },
  178 + {
  179 + "id": 45,
  180 + "cash": 930
  181 + },
  182 + {
  183 + "id": 46,
  184 + "cash": 906
  185 + },
  186 + {
  187 + "id": 47,
  188 + "cash": 822
  189 + },
  190 + {
  191 + "id": 48,
  192 + "cash": 846
  193 + },
  194 + {
  195 + "id": 49,
  196 + "cash": 868
  197 + },
  198 + {
  199 + "id": 50,
  200 + "cash": 919
  201 + },
  202 + {
  203 + "id": 51,
  204 + "cash": 839
  205 + },
  206 + {
  207 + "id": 52,
  208 + "cash": 912
  209 + },
  210 + {
  211 + "id": 53,
  212 + "cash": 968
  213 + },
  214 + {
  215 + "id": 54,
  216 + "cash": 940
  217 + },
  218 + {
  219 + "id": 55,
  220 + "cash": 857
  221 + },
  222 + {
  223 + "id": 56,
  224 + "cash": 936
  225 + },
  226 + {
  227 + "id": 57,
  228 + "cash": 972
  229 + },
  230 + {
  231 + "id": 58,
  232 + "cash": 814
  233 + },
  234 + {
  235 + "id": 59,
  236 + "cash": 862
  237 + },
  238 + {
  239 + "id": 60,
  240 + "cash": 921
  241 + },
  242 + {
  243 + "id": 61,
  244 + "cash": 890
  245 + },
  246 + {
  247 + "id": 62,
  248 + "cash": 938
  249 + },
  250 + {
  251 + "id": 63,
  252 + "cash": 857
  253 + },
  254 + {
  255 + "id": 64,
  256 + "cash": 991
  257 + },
  258 + {
  259 + "id": 65,
  260 + "cash": 985
  261 + },
  262 + {
  263 + "id": 66,
  264 + "cash": 843
  265 + },
  266 + {
  267 + "id": 67,
  268 + "cash": 923
  269 + },
  270 + {
  271 + "id": 68,
  272 + "cash": 809
  273 + },
  274 + {
  275 + "id": 69,
  276 + "cash": 1005
  277 + },
  278 + {
  279 + "id": 70,
  280 + "cash": 858
  281 + },
  282 + {
  283 + "id": 71,
  284 + "cash": 1023
  285 + },
  286 + {
  287 + "id": 72,
  288 + "cash": 1003
  289 + },
  290 + {
  291 + "id": 73,
  292 + "cash": 937
  293 + },
  294 + {
  295 + "id": 74,
  296 + "cash": 898
  297 + },
  298 + {
  299 + "id": 75,
  300 + "cash": 985
  301 + },
  302 + {
  303 + "id": 76,
  304 + "cash": 1025
  305 + },
  306 + {
  307 + "id": 77,
  308 + "cash": 978
  309 + },
  310 + {
  311 + "id": 78,
  312 + "cash": 993
  313 + },
  314 + {
  315 + "id": 79,
  316 + "cash": 980
  317 + },
  318 + {
  319 + "id": 80,
  320 + "cash": 1034
  321 + },
  322 + {
  323 + "id": 81,
  324 + "cash": 939
  325 + },
  326 + {
  327 + "id": 82,
  328 + "cash": 972
  329 + },
  330 + {
  331 + "id": 83,
  332 + "cash": 886
  333 + },
  334 + {
  335 + "id": 84,
  336 + "cash": 856
  337 + },
  338 + {
  339 + "id": 85,
  340 + "cash": 879
  341 + },
  342 + {
  343 + "id": 86,
  344 + "cash": 999
  345 + },
  346 + {
  347 + "id": 87,
  348 + "cash": 877
  349 + },
  350 + {
  351 + "id": 88,
  352 + "cash": 1021
  353 + },
  354 + {
  355 + "id": 89,
  356 + "cash": 912
  357 + },
  358 + {
  359 + "id": 90,
  360 + "cash": 1028
  361 + },
  362 + {
  363 + "id": 91,
  364 + "cash": 878
  365 + },
  366 + {
  367 + "id": 92,
  368 + "cash": 874
  369 + },
  370 + {
  371 + "id": 93,
  372 + "cash": 1032
  373 + },
  374 + {
  375 + "id": 94,
  376 + "cash": 987
  377 + },
  378 + {
  379 + "id": 95,
  380 + "cash": 917
  381 + },
  382 + {
  383 + "id": 96,
  384 + "cash": 1008
  385 + },
  386 + {
  387 + "id": 97,
  388 + "cash": 916
  389 + },
  390 + {
  391 + "id": 98,
  392 + "cash": 837
  393 + },
  394 + {
  395 + "id": 99,
  396 + "cash": 896
  397 + },
  398 + {
  399 + "id": 100,
  400 + "cash": 840
  401 + },
  402 + {
  403 + "id": 101,
  404 + "cash": 572
  405 + },
  406 + {
  407 + "id": 102,
  408 + "cash": 595
  409 + },
  410 + {
  411 + "id": 103,
  412 + "cash": 547
  413 + },
  414 + {
  415 + "id": 104,
  416 + "cash": 520
  417 + },
  418 + {
  419 + "id": 105,
  420 + "cash": 526
  421 + },
  422 + {
  423 + "id": 106,
  424 + "cash": 602
  425 + },
  426 + {
  427 + "id": 107,
  428 + "cash": 599
  429 + },
  430 + {
  431 + "id": 108,
  432 + "cash": 577
  433 + },
  434 + {
  435 + "id": 109,
  436 + "cash": 539
  437 + },
  438 + {
  439 + "id": 110,
  440 + "cash": 569
  441 + },
  442 + {
  443 + "id": 111,
  444 + "cash": 558
  445 + },
  446 + {
  447 + "id": 112,
  448 + "cash": 535
  449 + },
  450 + {
  451 + "id": 113,
  452 + "cash": 565
  453 + },
  454 + {
  455 + "id": 114,
  456 + "cash": 566
  457 + },
  458 + {
  459 + "id": 115,
  460 + "cash": 567
  461 + },
  462 + {
  463 + "id": 116,
  464 + "cash": 543
  465 + },
  466 + {
  467 + "id": 117,
  468 + "cash": 616
  469 + },
  470 + {
  471 + "id": 118,
  472 + "cash": 576
  473 + },
  474 + {
  475 + "id": 119,
  476 + "cash": 633
  477 + },
  478 + {
  479 + "id": 120,
  480 + "cash": 573
  481 + },
  482 + {
  483 + "id": 121,
  484 + "cash": 629
  485 + },
  486 + {
  487 + "id": 122,
  488 + "cash": 628
  489 + },
  490 + {
  491 + "id": 123,
  492 + "cash": 626
  493 + },
  494 + {
  495 + "id": 124,
  496 + "cash": 528
  497 + },
  498 + {
  499 + "id": 125,
  500 + "cash": 538
  501 + },
  502 + {
  503 + "id": 126,
  504 + "cash": 616
  505 + },
  506 + {
  507 + "id": 127,
  508 + "cash": 562
  509 + },
  510 + {
  511 + "id": 128,
  512 + "cash": 521
  513 + },
  514 + {
  515 + "id": 129,
  516 + "cash": 522
  517 + },
  518 + {
  519 + "id": 130,
  520 + "cash": 633
  521 + },
  522 + {
  523 + "id": 131,
  524 + "cash": 569
  525 + },
  526 + {
  527 + "id": 132,
  528 + "cash": 527
  529 + },
  530 + {
  531 + "id": 133,
  532 + "cash": 526
  533 + },
  534 + {
  535 + "id": 134,
  536 + "cash": 607
  537 + },
  538 + {
  539 + "id": 135,
  540 + "cash": 528
  541 + },
  542 + {
  543 + "id": 136,
  544 + "cash": 547
  545 + },
  546 + {
  547 + "id": 137,
  548 + "cash": 622
  549 + },
  550 + {
  551 + "id": 138,
  552 + "cash": 527
  553 + },
  554 + {
  555 + "id": 139,
  556 + "cash": 530
  557 + },
  558 + {
  559 + "id": 140,
  560 + "cash": 553
  561 + },
  562 + {
  563 + "id": 141,
  564 + "cash": 631
  565 + },
  566 + {
  567 + "id": 142,
  568 + "cash": 605
  569 + },
  570 + {
  571 + "id": 143,
  572 + "cash": 576
  573 + },
  574 + {
  575 + "id": 144,
  576 + "cash": 524
  577 + },
  578 + {
  579 + "id": 145,
  580 + "cash": 611
  581 + },
  582 + {
  583 + "id": 146,
  584 + "cash": 581
  585 + },
  586 + {
  587 + "id": 147,
  588 + "cash": 558
  589 + },
  590 + {
  591 + "id": 148,
  592 + "cash": 537
  593 + },
  594 + {
  595 + "id": 149,
  596 + "cash": 568
  597 + },
  598 + {
  599 + "id": 150,
  600 + "cash": 625
  601 + },
  602 + {
  603 + "id": 151,
  604 + "cash": 625
  605 + },
  606 + {
  607 + "id": 152,
  608 + "cash": 581
  609 + },
  610 + {
  611 + "id": 153,
  612 + "cash": 562
  613 + },
  614 + {
  615 + "id": 154,
  616 + "cash": 541
  617 + },
  618 + {
  619 + "id": 155,
  620 + "cash": 531
  621 + },
  622 + {
  623 + "id": 156,
  624 + "cash": 576
  625 + },
  626 + {
  627 + "id": 157,
  628 + "cash": 610
  629 + },
  630 + {
  631 + "id": 158,
  632 + "cash": 539
  633 + },
  634 + {
  635 + "id": 159,
  636 + "cash": 528
  637 + },
  638 + {
  639 + "id": 160,
  640 + "cash": 530
  641 + },
  642 + {
  643 + "id": 161,
  644 + "cash": 542
  645 + },
  646 + {
  647 + "id": 162,
  648 + "cash": 525
  649 + },
  650 + {
  651 + "id": 163,
  652 + "cash": 579
  653 + },
  654 + {
  655 + "id": 164,
  656 + "cash": 533
  657 + },
  658 + {
  659 + "id": 165,
  660 + "cash": 577
  661 + },
  662 + {
  663 + "id": 166,
  664 + "cash": 573
  665 + },
  666 + {
  667 + "id": 167,
  668 + "cash": 619
  669 + },
  670 + {
  671 + "id": 168,
  672 + "cash": 535
  673 + },
  674 + {
  675 + "id": 169,
  676 + "cash": 560
  677 + },
  678 + {
  679 + "id": 170,
  680 + "cash": 626
  681 + },
  682 + {
  683 + "id": 171,
  684 + "cash": 521
  685 + },
  686 + {
  687 + "id": 172,
  688 + "cash": 583
  689 + },
  690 + {
  691 + "id": 173,
  692 + "cash": 601
  693 + },
  694 + {
  695 + "id": 174,
  696 + "cash": 549
  697 + },
  698 + {
  699 + "id": 175,
  700 + "cash": 574
  701 + },
  702 + {
  703 + "id": 176,
  704 + "cash": 632
  705 + },
  706 + {
  707 + "id": 177,
  708 + "cash": 614
  709 + },
  710 + {
  711 + "id": 178,
  712 + "cash": 598
  713 + },
  714 + {
  715 + "id": 179,
  716 + "cash": 538
  717 + },
  718 + {
  719 + "id": 180,
  720 + "cash": 529
  721 + },
  722 + {
  723 + "id": 181,
  724 + "cash": 559
  725 + },
  726 + {
  727 + "id": 182,
  728 + "cash": 626
  729 + },
  730 + {
  731 + "id": 183,
  732 + "cash": 581
  733 + },
  734 + {
  735 + "id": 184,
  736 + "cash": 522
  737 + },
  738 + {
  739 + "id": 185,
  740 + "cash": 565
  741 + },
  742 + {
  743 + "id": 186,
  744 + "cash": 535
  745 + },
  746 + {
  747 + "id": 187,
  748 + "cash": 598
  749 + },
  750 + {
  751 + "id": 188,
  752 + "cash": 628
  753 + },
  754 + {
  755 + "id": 189,
  756 + "cash": 617
  757 + },
  758 + {
  759 + "id": 190,
  760 + "cash": 615
  761 + },
  762 + {
  763 + "id": 191,
  764 + "cash": 604
  765 + },
  766 + {
  767 + "id": 192,
  768 + "cash": 537
  769 + },
  770 + {
  771 + "id": 193,
  772 + "cash": 564
  773 + },
  774 + {
  775 + "id": 194,
  776 + "cash": 582
  777 + },
  778 + {
  779 + "id": 195,
  780 + "cash": 551
  781 + },
  782 + {
  783 + "id": 196,
  784 + "cash": 618
  785 + },
  786 + {
  787 + "id": 197,
  788 + "cash": 614
  789 + },
  790 + {
  791 + "id": 198,
  792 + "cash": 594
  793 + },
  794 + {
  795 + "id": 199,
  796 + "cash": 566
  797 + },
  798 + {
  799 + "id": 200,
  800 + "cash": 527
  801 + },
  802 + {
  803 + "id": 201,
  804 + "cash": 616
  805 + },
  806 + {
  807 + "id": 202,
  808 + "cash": 588
  809 + },
  810 + {
  811 + "id": 203,
  812 + "cash": 530
  813 + },
  814 + {
  815 + "id": 204,
  816 + "cash": 628
  817 + },
  818 + {
  819 + "id": 205,
  820 + "cash": 597
  821 + },
  822 + {
  823 + "id": 206,
  824 + "cash": 587
  825 + },
  826 + {
  827 + "id": 207,
  828 + "cash": 550
  829 + },
  830 + {
  831 + "id": 208,
  832 + "cash": 627
  833 + },
  834 + {
  835 + "id": 209,
  836 + "cash": 587
  837 + },
  838 + {
  839 + "id": 210,
  840 + "cash": 622
  841 + },
  842 + {
  843 + "id": 211,
  844 + "cash": 613
  845 + },
  846 + {
  847 + "id": 212,
  848 + "cash": 587
  849 + },
  850 + {
  851 + "id": 213,
  852 + "cash": 557
  853 + },
  854 + {
  855 + "id": 214,
  856 + "cash": 538
  857 + },
  858 + {
  859 + "id": 215,
  860 + "cash": 557
  861 + },
  862 + {
  863 + "id": 216,
  864 + "cash": 623
  865 + },
  866 + {
  867 + "id": 217,
  868 + "cash": 565
  869 + },
  870 + {
  871 + "id": 218,
  872 + "cash": 528
  873 + },
  874 + {
  875 + "id": 219,
  876 + "cash": 621
  877 + },
  878 + {
  879 + "id": 220,
  880 + "cash": 545
  881 + },
  882 + {
  883 + "id": 221,
  884 + "cash": 534
  885 + },
  886 + {
  887 + "id": 222,
  888 + "cash": 546
  889 + },
  890 + {
  891 + "id": 223,
  892 + "cash": 539
  893 + },
  894 + {
  895 + "id": 224,
  896 + "cash": 526
  897 + },
  898 + {
  899 + "id": 225,
  900 + "cash": 603
  901 + },
  902 + {
  903 + "id": 226,
  904 + "cash": 527
  905 + },
  906 + {
  907 + "id": 227,
  908 + "cash": 545
  909 + },
  910 + {
  911 + "id": 228,
  912 + "cash": 583
  913 + },
  914 + {
  915 + "id": 229,
  916 + "cash": 607
  917 + },
  918 + {
  919 + "id": 230,
  920 + "cash": 569
  921 + },
  922 + {
  923 + "id": 231,
  924 + "cash": 526
  925 + },
  926 + {
  927 + "id": 232,
  928 + "cash": 620
  929 + },
  930 + {
  931 + "id": 233,
  932 + "cash": 588
  933 + },
  934 + {
  935 + "id": 234,
  936 + "cash": 586
  937 + },
  938 + {
  939 + "id": 235,
  940 + "cash": 600
  941 + },
  942 + {
  943 + "id": 236,
  944 + "cash": 632
  945 + },
  946 + {
  947 + "id": 237,
  948 + "cash": 581
  949 + },
  950 + {
  951 + "id": 238,
  952 + "cash": 550
  953 + },
  954 + {
  955 + "id": 239,
  956 + "cash": 579
  957 + },
  958 + {
  959 + "id": 240,
  960 + "cash": 559
  961 + },
  962 + {
  963 + "id": 241,
  964 + "cash": 539
  965 + },
  966 + {
  967 + "id": 242,
  968 + "cash": 608
  969 + },
  970 + {
  971 + "id": 243,
  972 + "cash": 534
  973 + },
  974 + {
  975 + "id": 244,
  976 + "cash": 570
  977 + },
  978 + {
  979 + "id": 245,
  980 + "cash": 583
  981 + },
  982 + {
  983 + "id": 246,
  984 + "cash": 600
  985 + },
  986 + {
  987 + "id": 247,
  988 + "cash": 559
  989 + },
  990 + {
  991 + "id": 248,
  992 + "cash": 625
  993 + },
  994 + {
  995 + "id": 249,
  996 + "cash": 568
  997 + },
  998 + {
  999 + "id": 250,
  1000 + "cash": 592
  1001 + },
  1002 + {
  1003 + "id": 251,
  1004 + "cash": 533
  1005 + },
  1006 + {
  1007 + "id": 252,
  1008 + "cash": 596
  1009 + },
  1010 + {
  1011 + "id": 253,
  1012 + "cash": 595
  1013 + },
  1014 + {
  1015 + "id": 254,
  1016 + "cash": 621
  1017 + },
  1018 + {
  1019 + "id": 255,
  1020 + "cash": 575
  1021 + },
  1022 + {
  1023 + "id": 256,
  1024 + "cash": 526
  1025 + },
  1026 + {
  1027 + "id": 257,
  1028 + "cash": 622
  1029 + },
  1030 + {
  1031 + "id": 258,
  1032 + "cash": 630
  1033 + },
  1034 + {
  1035 + "id": 259,
  1036 + "cash": 585
  1037 + },
  1038 + {
  1039 + "id": 260,
  1040 + "cash": 543
  1041 + },
  1042 + {
  1043 + "id": 261,
  1044 + "cash": 550
  1045 + },
  1046 + {
  1047 + "id": 262,
  1048 + "cash": 519
  1049 + },
  1050 + {
  1051 + "id": 263,
  1052 + "cash": 522
  1053 + },
  1054 + {
  1055 + "id": 264,
  1056 + "cash": 563
  1057 + },
  1058 + {
  1059 + "id": 265,
  1060 + "cash": 544
  1061 + },
  1062 + {
  1063 + "id": 266,
  1064 + "cash": 630
  1065 + },
  1066 + {
  1067 + "id": 267,
  1068 + "cash": 544
  1069 + },
  1070 + {
  1071 + "id": 268,
  1072 + "cash": 607
  1073 + },
  1074 + {
  1075 + "id": 269,
  1076 + "cash": 592
  1077 + },
  1078 + {
  1079 + "id": 270,
  1080 + "cash": 558
  1081 + },
  1082 + {
  1083 + "id": 271,
  1084 + "cash": 593
  1085 + },
  1086 + {
  1087 + "id": 272,
  1088 + "cash": 608
  1089 + },
  1090 + {
  1091 + "id": 273,
  1092 + "cash": 520
  1093 + },
  1094 + {
  1095 + "id": 274,
  1096 + "cash": 578
  1097 + },
  1098 + {
  1099 + "id": 275,
  1100 + "cash": 613
  1101 + },
  1102 + {
  1103 + "id": 276,
  1104 + "cash": 614
  1105 + },
  1106 + {
  1107 + "id": 277,
  1108 + "cash": 580
  1109 + },
  1110 + {
  1111 + "id": 278,
  1112 + "cash": 552
  1113 + },
  1114 + {
  1115 + "id": 279,
  1116 + "cash": 590
  1117 + },
  1118 + {
  1119 + "id": 280,
  1120 + "cash": 567
  1121 + },
  1122 + {
  1123 + "id": 281,
  1124 + "cash": 561
  1125 + },
  1126 + {
  1127 + "id": 282,
  1128 + "cash": 631
  1129 + },
  1130 + {
  1131 + "id": 283,
  1132 + "cash": 599
  1133 + },
  1134 + {
  1135 + "id": 284,
  1136 + "cash": 519
  1137 + },
  1138 + {
  1139 + "id": 285,
  1140 + "cash": 549
  1141 + },
  1142 + {
  1143 + "id": 286,
  1144 + "cash": 588
  1145 + },
  1146 + {
  1147 + "id": 287,
  1148 + "cash": 607
  1149 + },
  1150 + {
  1151 + "id": 288,
  1152 + "cash": 611
  1153 + },
  1154 + {
  1155 + "id": 289,
  1156 + "cash": 629
  1157 + },
  1158 + {
  1159 + "id": 290,
  1160 + "cash": 570
  1161 + },
  1162 + {
  1163 + "id": 291,
  1164 + "cash": 579
  1165 + },
  1166 + {
  1167 + "id": 292,
  1168 + "cash": 602
  1169 + },
  1170 + {
  1171 + "id": 293,
  1172 + "cash": 534
  1173 + },
  1174 + {
  1175 + "id": 294,
  1176 + "cash": 521
  1177 + },
  1178 + {
  1179 + "id": 295,
  1180 + "cash": 586
  1181 + },
  1182 + {
  1183 + "id": 296,
  1184 + "cash": 604
  1185 + },
  1186 + {
  1187 + "id": 297,
  1188 + "cash": 561
  1189 + },
  1190 + {
  1191 + "id": 298,
  1192 + "cash": 550
  1193 + },
  1194 + {
  1195 + "id": 299,
  1196 + "cash": 522
  1197 + },
  1198 + {
  1199 + "id": 300,
  1200 + "cash": 518
  1201 + }
  1202 +]
0 \ No newline at end of file 1203 \ No newline at end of file
src/HttpServer/jsonconf/jsonconf.go
@@ -64,6 +64,11 @@ type LuckyBagConfigDesc struct { @@ -64,6 +64,11 @@ type LuckyBagConfigDesc struct {
64 Rate int `json:"rate"` 64 Rate int `json:"rate"`
65 } 65 }
66 66
  67 +type RedpacketConfigDesc struct {
  68 + Id int `json:"id"`
  69 + Cash int `json:"cash"`
  70 +}
  71 +
67 type GameConfig struct { 72 type GameConfig struct {
68 AchieventConfig []AchieveDesc 73 AchieventConfig []AchieveDesc
69 TaskConfig []TaskDesc 74 TaskConfig []TaskDesc
@@ -72,6 +77,17 @@ type GameConfig struct { @@ -72,6 +77,17 @@ type GameConfig struct {
72 TrunTableConfig []TrunTableConfigDesc 77 TrunTableConfig []TrunTableConfigDesc
73 RedPackageConfig []RedPackageConfigDesc 78 RedPackageConfig []RedPackageConfigDesc
74 LuckyBagConfig []LuckyBagConfigDesc 79 LuckyBagConfig []LuckyBagConfigDesc
  80 + RedpacketConfig []RedpacketConfigDesc
  81 +}
  82 +
  83 +func GetRedpacketNum(id int) int {
  84 + for _, val := range g_jsonconf.RedpacketConfig {
  85 + if val.Id == id {
  86 + return val.Cash
  87 + }
  88 + }
  89 +
  90 + return g_jsonconf.RedpacketConfig[len(g_jsonconf.RedpacketConfig)-1].Cash
75 } 91 }
76 92
77 func GetJsonConf() *GameConfig { 93 func GetJsonConf() *GameConfig {
@@ -180,7 +196,14 @@ func LoadJsonConf() error { @@ -180,7 +196,14 @@ func LoadJsonConf() error {
180 return err 196 return err
181 } 197 }
182 198
183 - logger.Info("loadJsonConf success pconf=%+v,err=%v", *g_jsonconf, err) 199 + err = json.Unmarshal([]byte(content), &g_jsonconf.RedpacketConfig)
  200 + if err != nil {
  201 + logger.Info("loadJsonConf failed1,err=%v", err)
  202 + return err
  203 + }
  204 +
  205 + logger.Info("loadJsonConf success pconf=%v,err=%v", *g_jsonconf, err)
  206 +
184 logger.Info("loadJsonConf success turn=%+v,err=%v", g_jsonconf.TrunTableConfig, err) 207 logger.Info("loadJsonConf success turn=%+v,err=%v", g_jsonconf.TrunTableConfig, err)
185 return err 208 return err
186 } 209 }
src/HttpServer/logic/datadef.go
@@ -255,6 +255,21 @@ type QueryrankinfoResp struct { @@ -255,6 +255,21 @@ type QueryrankinfoResp struct {
255 Data QueryrankinfoData `json:"data"` 255 Data QueryrankinfoData `json:"data"`
256 } 256 }
257 257
  258 +type FetchredbagReq struct {
  259 + Gameid string `json:"gameid"`
  260 + Channel string `json:"channel"`
  261 +}
  262 +
  263 +type FetchredbagData struct {
  264 + Getgoldnum int `json:"getgoldnum"`
  265 + Walletgold int `json:"walletgold"`
  266 +}
  267 +type FetchredbagResp struct {
  268 + Code int `json:"code"`
  269 + Message string `json:"message"`
  270 + Data FetchredbagData `json:"data"`
  271 +}
  272 +
258 type QuerydrawrewardData struct { 273 type QuerydrawrewardData struct {
259 Getgold int `json:"getgold"` 274 Getgold int `json:"getgold"`
260 Walletgold int `json:"walletgold"` 275 Walletgold int `json:"walletgold"`
@@ -270,9 +285,10 @@ type QuerydrawrewardResp struct { @@ -270,9 +285,10 @@ type QuerydrawrewardResp struct {
270 } 285 }
271 286
272 type QuerygetcashinfoData struct { 287 type QuerygetcashinfoData struct {
273 - Logindaysum int `json:"logindaysum"`  
274 - Logindaycontinue int `json:"logindaycontinue"`  
275 - Cashdata []WithDrawDesc `json:"cashdata"` 288 + Logindaysum int `json:"logindaysum"`
  289 + Logindaycontinue int `json:"logindaycontinue"`
  290 + Cashdata []WithDrawDesc `json:"cashdata"`
  291 + Cdkeycashdata []CashCdKeyInfo `json:"cdkeycashdata"`
276 } 292 }
277 293
278 type QuerygetcashinfoResp struct { 294 type QuerygetcashinfoResp struct {
@@ -281,6 +297,36 @@ type QuerygetcashinfoResp struct { @@ -281,6 +297,36 @@ type QuerygetcashinfoResp struct {
281 Data QuerygetcashinfoData `json:"data"` 297 Data QuerygetcashinfoData `json:"data"`
282 } 298 }
283 299
  300 +type GetcashwechatData struct {
  301 + Cdkey string `json:"cdkey"`
  302 +}
  303 +type GetcashwechatResp struct {
  304 + Code int `json:"code"`
  305 + Message string `json:"message"`
  306 + Data GetcashwechatData `json:"data"`
  307 +}
  308 +
  309 +type GetcashwechatReq struct {
  310 + Gameid string `json:"gameid"`
  311 + Channel string `json:"channel"`
  312 + Money float32 `json:"money"`
  313 + Openid string `json:"openid"`
  314 + Nickname string `json:"nickname"`
  315 + Headurl string `json:"headurl"`
  316 + Ver string `json:"ver"`
  317 + Ctype int `json:"ctype"`
  318 +}
  319 +
  320 +type GetCashWechatData struct {
  321 + Cdkey string `json:"cdkey"`
  322 +}
  323 +
  324 +type GetCashWechatResp struct {
  325 + Code string `json:"code"`
  326 + Data GetCashWechatData `json:"data"`
  327 + Msg string `json:"msg"`
  328 +}
  329 +
284 type GetcashReq struct { 330 type GetcashReq struct {
285 Money float32 `json:"money"` 331 Money float32 `json:"money"`
286 Openid string `json:"openid"` 332 Openid string `json:"openid"`
@@ -491,6 +537,12 @@ type WithDrawDesc struct { @@ -491,6 +537,12 @@ type WithDrawDesc struct {
491 Day int `json:"day"` 537 Day int `json:"day"`
492 } 538 }
493 539
  540 +type CashCdKeyInfo struct {
  541 + Id int `json:"id"`
  542 + Money float32 `json:"money"`
  543 + Cdkey string `json:"cdkey"`
  544 +}
  545 +
494 //玩家数据 546 //玩家数据
495 type UserData struct { 547 type UserData struct {
496 Userid string //玩家w唯一id 548 Userid string //玩家w唯一id
@@ -522,7 +574,11 @@ type UserData struct { @@ -522,7 +574,11 @@ type UserData struct {
522 HighScore int64 //玩家历史最高分 574 HighScore int64 //玩家历史最高分
523 FreeTicket int //免费抽奖次数 575 FreeTicket int //免费抽奖次数
524 Ticket int //看视频抽奖次数 576 Ticket int //看视频抽奖次数
  577 + FetchRedCnt int //领取红包次数计数
  578 + IsNew int //新手状态
  579 + FetchRdBagNum int //当天已领的红包
525 WithDraw WithDrawInfo //提现记录信息 580 WithDraw WithDrawInfo //提现记录信息
  581 + Cdkeys []CashCdKeyInfo //记录提现的cdkeys
526 Task TaskInfo //玩家任务完成相关信息 582 Task TaskInfo //玩家任务完成相关信息
527 Achieve AchieveMentInfo //玩家成就完成相关数据 583 Achieve AchieveMentInfo //玩家成就完成相关数据
528 } 584 }
src/HttpServer/logic/function.go
@@ -794,11 +794,129 @@ func GetUserInfo(uniqueid string) (*UserData, error) { @@ -794,11 +794,129 @@ func GetUserInfo(uniqueid string) (*UserData, error) {
794 return &tmp, nil 794 return &tmp, nil
795 } 795 }
796 796
  797 +func GetCashWechatFromSDK(uuid int, goldnum int, gameid, channel, openid, nickname, headurl, ver string, checkcoin int) (string, error) {
  798 +
  799 + SERVERKEY := conf.GetCoinConf().Key
  800 + if gameid == "1017" {
  801 + SERVERKEY = XIAOXINGXING_SERVERKEYTEST_1017
  802 + }
  803 + if goldnum == 0 || uuid == 0 || gameid == "" || channel == "" || ver == "" {
  804 + logger.Error("GetCashFromSDK param empty")
  805 + return "error", errors.New("param empty")
  806 + }
  807 +
  808 + if openid == "" {
  809 + openid = "test"
  810 + }
  811 + var paramlist []string
  812 + var params TixianDesc
  813 + params.Sign_type = "md5"
  814 + params.Gameid = gameid
  815 + params.Channel = channel
  816 + params.Uid = uuid
  817 + params.Time_stamp = strconv.Itoa(int(time.Now().Unix()))
  818 + params.Headurl = headurl
  819 + params.Money = goldnum
  820 + params.Openid = openid
  821 + params.Nickname = nickname
  822 + params.Typ = 11
  823 + params.Ver = ver
  824 + params.Editcoin = 1
  825 + params.Checkcoin = checkcoin
  826 + signtypestr := "sign_type=" + params.Sign_type
  827 + timestampstr := "time_stamp=" + strconv.Itoa(int(time.Now().Unix()))
  828 + paramgameid := "gameid=" + gameid
  829 + pchannel := "channel=" + channel
  830 + puid := "uid=" + strconv.Itoa(uuid)
  831 + phead := "headurl=" + headurl
  832 + pnickname := "nickname=" + nickname
  833 + popenid := "openid=" + openid
  834 + pmoney := "money=" + strconv.Itoa(goldnum)
  835 + ptype := "typ=" + "11" //微信
  836 + ped := "editcoin=1"
  837 + pcheco := "checkcoin=" + strconv.Itoa(checkcoin)
  838 + //pver := "ver=" + params.Ver
  839 + paramlist = append(paramlist, signtypestr)
  840 + paramlist = append(paramlist, timestampstr)
  841 + paramlist = append(paramlist, paramgameid)
  842 + paramlist = append(paramlist, pchannel)
  843 + paramlist = append(paramlist, puid)
  844 + if headurl != "" {
  845 + paramlist = append(paramlist, phead)
  846 + }
  847 + if nickname != "" {
  848 + paramlist = append(paramlist, pnickname)
  849 + }
  850 + paramlist = append(paramlist, popenid)
  851 + paramlist = append(paramlist, pmoney)
  852 + paramlist = append(paramlist, ptype)
  853 + paramlist = append(paramlist, ped)
  854 + paramlist = append(paramlist, pcheco)
  855 + //paramlist = append(paramlist, pver)
  856 +
  857 + sumparam := GettotalParam(paramlist)
  858 + //加serverkey
  859 + signsum := sumparam + SERVERKEY
  860 +
  861 + //进行hash
  862 + sign := GetHashValue(signsum)
  863 + params.Sign = sign
  864 +
  865 + bys, err := json.Marshal(&params)
  866 + if err != nil {
  867 + logger.Error("GetCashWechatFromSDK failed=%v", err)
  868 + return "error", err
  869 + }
  870 + res, err := DoHttpPost(bys, "api/server/tixiancdkey")
  871 + logger.Info("GetCashWechatFromSDK sumparam is:%v,sign is:%v", signsum, sign)
  872 + logger.Info("GetCashWechatFromSDK sumparam param=%v", string(bys))
  873 + if err != nil {
  874 + logger.Error("GetCashWechatFromSDK failed=%v", err)
  875 + return "error", err
  876 + }
  877 +
  878 + logger.Info("GetCashWechatFromSDK res=%v", res)
  879 +
  880 + var resp GetCashWechatResp
  881 + err = json.Unmarshal([]byte(res), &resp)
  882 + if err != nil {
  883 + logger.Error("GetCashWechatFromSDK failed=%v", err)
  884 + return "error", err
  885 + }
  886 +
  887 + if resp.Code != "0" {
  888 + logger.Error("GetCashWechatFromSDK failed=%v", resp.Msg)
  889 + return "error", errors.New(resp.Msg)
  890 + }
  891 +
  892 + return resp.Data.Cdkey, nil
  893 +}
  894 +
797 func SaveUserSelfData(uniqueid, savedata string) error { 895 func SaveUserSelfData(uniqueid, savedata string) error {
798 err := redishandler.GetRedisClient().HSet(redis.USER_SELF_DATA_KEY, uniqueid, savedata) 896 err := redishandler.GetRedisClient().HSet(redis.USER_SELF_DATA_KEY, uniqueid, savedata)
799 return err 897 return err
800 } 898 }
801 899
  900 +//领取红包 按次数计算
  901 +func (uinfo *UserData) FetchRedPacket(gameid string, channel string, uuid int) int {
  902 + uinfo.FetchRedCnt++
  903 + addgold := jsonconf.GetRedpacketNum(uinfo.FetchRedCnt)
  904 + if addgold == 0 {
  905 + logger.Error("FetchRedPacket failed addgold=0")
  906 + return 0
  907 + }
  908 +
  909 + goldnum, realaddnum, err := AddCoinToSdk(uuid, addgold, gameid, channel, 102)
  910 + if err != nil {
  911 + logger.Error("RewardUser failer err=%v", err)
  912 + }
  913 + uinfo.RealGold = goldnum
  914 +
  915 + uniqueid := strconv.Itoa(uuid) + channel
  916 + SaveUserInfo(uinfo, uniqueid)
  917 + return realaddnum
  918 +}
  919 +
802 func GetUserSelfData(uniqueid string) (string, error) { 920 func GetUserSelfData(uniqueid string) (string, error) {
803 data, err := redishandler.GetRedisClient().HGet(redis.USER_SELF_DATA_KEY, uniqueid) 921 data, err := redishandler.GetRedisClient().HGet(redis.USER_SELF_DATA_KEY, uniqueid)
804 if err != nil { 922 if err != nil {
src/HttpServer/logic/httpserver.go
@@ -61,11 +61,13 @@ func startServerHttpServe() { @@ -61,11 +61,13 @@ func startServerHttpServe() {
61 http.HandleFunc("/russiaxiaoxiao/querydrawreward", Querydrawreward) //请求抽奖 61 http.HandleFunc("/russiaxiaoxiao/querydrawreward", Querydrawreward) //请求抽奖
62 http.HandleFunc("/russiaxiaoxiao/querygetcashinfo", Querdrawinfo) //请求提现档位数据 62 http.HandleFunc("/russiaxiaoxiao/querygetcashinfo", Querdrawinfo) //请求提现档位数据
63 http.HandleFunc("/russiaxiaoxiao/getcash", Getcash) //请求提现 63 http.HandleFunc("/russiaxiaoxiao/getcash", Getcash) //请求提现
  64 + http.HandleFunc("/russiaxiaoxiao/getcashwechat", Getcashwechat) //提现
64 http.HandleFunc("/russiaxiaoxiao/getcashrecord", Getcashrecord) //请求提现记录 65 http.HandleFunc("/russiaxiaoxiao/getcashrecord", Getcashrecord) //请求提现记录
65 http.HandleFunc("/russiaxiaoxiao/onlinentf", Onlinentf) //在线通知 一分钟一次 66 http.HandleFunc("/russiaxiaoxiao/onlinentf", Onlinentf) //在线通知 一分钟一次
66 http.HandleFunc("/russiaxiaoxiao/updatetaskandachieve", Updatetaskandachieve) //上报任务进度 67 http.HandleFunc("/russiaxiaoxiao/updatetaskandachieve", Updatetaskandachieve) //上报任务进度
67 http.HandleFunc("/russiaxiaoxiao/querytaskinfo", Querytaskinfo) //查询成就和任务列表 68 http.HandleFunc("/russiaxiaoxiao/querytaskinfo", Querytaskinfo) //查询成就和任务列表
68 http.HandleFunc("/russiaxiaoxiao/gettaskreward", Gettaskreward) //查询成就和任务列表 69 http.HandleFunc("/russiaxiaoxiao/gettaskreward", Gettaskreward) //查询成就和任务列表
  70 + http.HandleFunc("/russiaxiaoxiao/fetchredbag", Fetchredbag) //领取红包
69 71
70 //.......................................... 72 //..........................................
71 /*http.HandleFunc("/eliminatestar/getuserdata", Getuserdata) //获取玩家数据 73 /*http.HandleFunc("/eliminatestar/getuserdata", Getuserdata) //获取玩家数据
@@ -362,6 +364,33 @@ func Getnewlevelreward(w http.ResponseWriter, r *http.Request) { @@ -362,6 +364,33 @@ func Getnewlevelreward(w http.ResponseWriter, r *http.Request) {
362 //HandlerGetnewlevelreward(w, s, Uuid) 364 //HandlerGetnewlevelreward(w, s, Uuid)
363 } 365 }
364 366
  367 +func Fetchredbag(w http.ResponseWriter, r *http.Request) {
  368 +
  369 + gameid := ""
  370 + channel := ""
  371 + uniqueid := ""
  372 + Uuid := 0
  373 + if len(r.Header) > 0 {
  374 + Uuid, _ = strconv.Atoi(r.Header.Get("Uuid"))
  375 + gameid = r.Header.Get("Gameid")
  376 + channel = r.Header.Get("Channel")
  377 + uniqueid = r.Header.Get("Uuid") + r.Header.Get("Channel")
  378 + }
  379 +
  380 + if Uuid == 0 {
  381 + SetHeader(w)
  382 + //logger.Error("Uuid is nil!")
  383 + return
  384 + }
  385 + result, _ := ioutil.ReadAll(r.Body)
  386 + r.Body.Close()
  387 +
  388 + s := string(result)
  389 + logger.Info("Fetchredbag , body:%v,uuid=%v", s, uniqueid)
  390 +
  391 + HandlerFetchredbag(w, s, uniqueid, gameid, channel, Uuid)
  392 +}
  393 +
365 func Gettaskreward(w http.ResponseWriter, r *http.Request) { 394 func Gettaskreward(w http.ResponseWriter, r *http.Request) {
366 395
367 gameid := "" 396 gameid := ""
@@ -497,6 +526,33 @@ func Getcashrecord(w http.ResponseWriter, r *http.Request) { @@ -497,6 +526,33 @@ func Getcashrecord(w http.ResponseWriter, r *http.Request) {
497 HandlerGetcashrecord(w, s, uniqueid, gameid, channel, Uuid) 526 HandlerGetcashrecord(w, s, uniqueid, gameid, channel, Uuid)
498 } 527 }
499 528
  529 +func Getcashwechat(w http.ResponseWriter, r *http.Request) {
  530 +
  531 + gameid := ""
  532 + channel := ""
  533 + uniqueid := ""
  534 + Uuid := 0
  535 + if len(r.Header) > 0 {
  536 + Uuid, _ = strconv.Atoi(r.Header.Get("Uuid"))
  537 + gameid = r.Header.Get("Gameid")
  538 + channel = r.Header.Get("Channel")
  539 + uniqueid = r.Header.Get("Uuid") + r.Header.Get("Channel")
  540 + }
  541 +
  542 + if Uuid == 0 {
  543 + SetHeader(w)
  544 + // logger.Error("Uuid is nil!")
  545 + return
  546 + }
  547 + result, _ := ioutil.ReadAll(r.Body)
  548 + r.Body.Close()
  549 +
  550 + s := string(result)
  551 + logger.Info("Getcashwechat , body:%v,uuid=%v", s, uniqueid)
  552 +
  553 + HandlerGetcashwechat(w, s, uniqueid, gameid, channel, Uuid)
  554 +}
  555 +
500 func Getcash(w http.ResponseWriter, r *http.Request) { 556 func Getcash(w http.ResponseWriter, r *http.Request) {
501 557
502 gameid := "" 558 gameid := ""
src/HttpServer/logic/logic.go
@@ -9,9 +9,12 @@ import ( @@ -9,9 +9,12 @@ import (
9 "fmt" 9 "fmt"
10 "net/http" 10 "net/http"
11 "strconv" 11 "strconv"
  12 + "sync"
12 "time" 13 "time"
13 ) 14 )
14 15
  16 +var llock sync.Mutex
  17 +
15 func HandlerSyncuserdata(w http.ResponseWriter, data string, uniqueuuid, gameid, channel string, uuid int) { 18 func HandlerSyncuserdata(w http.ResponseWriter, data string, uniqueuuid, gameid, channel string, uuid int) {
16 SetHeader(w) 19 SetHeader(w)
17 20
@@ -120,6 +123,53 @@ func HandlerUploaduserbasicinfo(w http.ResponseWriter, data string, uniqueuuid s @@ -120,6 +123,53 @@ func HandlerUploaduserbasicinfo(w http.ResponseWriter, data string, uniqueuuid s
120 fmt.Fprint(w, string(respstr)) 123 fmt.Fprint(w, string(respstr))
121 } 124 }
122 125
  126 +func HandlerFetchredbag(w http.ResponseWriter, data string, uniqueuuid, gameid, channel string, uuid int) {
  127 + SetHeader(w)
  128 + llock.Lock()
  129 + defer llock.Unlock()
  130 + var resp FetchredbagResp
  131 + resp.Code = 0
  132 + var rdata FetchredbagReq
  133 + err := json.Unmarshal([]byte(data), &rdata)
  134 + for {
  135 + if err != nil {
  136 + logger.Info("json decode HandlerFetchredbag data failed:%v,for:%v", err, data)
  137 + resp.Message = "网络错误"
  138 + resp.Code = ERROR_JSONUNMASH_ERROR
  139 + break
  140 + }
  141 +
  142 + //需要加上渠道才是唯一的玩家id,不同渠道视为不同数据
  143 + uniqueuuid := strconv.Itoa(uuid) + rdata.Channel
  144 + uinfo, err := GetUserInfo(uniqueuuid)
  145 + if err != nil || uinfo == nil {
  146 + logger.Error("redis failed err=%v", err)
  147 + resp.Message = "服务器错误"
  148 + resp.Code = ERROR_SRV_ERROR
  149 + break
  150 + }
  151 +
  152 + readaddgold := uinfo.FetchRedPacket(rdata.Gameid, rdata.Channel, uuid)
  153 + logger.Info("HandlerFetchredbag uid=%v radladdgold=%v rdata=%v", uuid, readaddgold, rdata)
  154 +
  155 + resp.Data.Walletgold = uinfo.RealGold
  156 + resp.Data.Getgoldnum = readaddgold
  157 +
  158 + uinfo.IsNew = 0
  159 + uinfo.FetchRdBagNum++
  160 +
  161 + //保存数据
  162 + err = SaveUserInfo(uinfo, uniqueuuid)
  163 +
  164 + resp.Code = ERROR_OK
  165 + break
  166 + }
  167 +
  168 + //回包
  169 + respstr, _ := json.Marshal(&resp)
  170 + fmt.Fprint(w, string(respstr))
  171 +}
  172 +
123 func HandlerGettaskreward(w http.ResponseWriter, data string, uniqueuuid, gameid, channel string, uuid int) { 173 func HandlerGettaskreward(w http.ResponseWriter, data string, uniqueuuid, gameid, channel string, uuid int) {
124 SetHeader(w) 174 SetHeader(w)
125 var resp GettaskrewardResp 175 var resp GettaskrewardResp
@@ -360,6 +410,146 @@ func HandlerGetcashrecord(w http.ResponseWriter, data string, uniqueuuid, gameid @@ -360,6 +410,146 @@ func HandlerGetcashrecord(w http.ResponseWriter, data string, uniqueuuid, gameid
360 fmt.Fprint(w, string(respstr)) 410 fmt.Fprint(w, string(respstr))
361 } 411 }
362 412
  413 +func HandlerGetcashwechat(w http.ResponseWriter, data string, uniqueuuid, gameid, channel string, uuid int) {
  414 + SetHeader(w)
  415 +
  416 + var resp GetcashwechatResp
  417 + resp.Code = 0
  418 + var rdata GetcashwechatReq
  419 + err := json.Unmarshal([]byte(data), &rdata)
  420 + for {
  421 + if err != nil {
  422 + logger.Info("json decode HandlerDrawguangold data failed:%v,for:%v", err, data)
  423 + resp.Message = "json解析错误"
  424 + resp.Code = ERROR_JSONUNMASH_ERROR
  425 + break
  426 + }
  427 + //临时处理一下
  428 + /*if rdata.Ver == "" {
  429 + rdata.Ver = "2.0.0"
  430 + }*/
  431 +
  432 + //需要加上渠道才是唯一的玩家id,不同渠道视为不同数据
  433 + uniqueuuid := strconv.Itoa(uuid) + rdata.Channel
  434 + uinfo, err := GetUserInfo(uniqueuuid)
  435 + if err != nil || uinfo == nil {
  436 + logger.Error("redis failed err=%v", err)
  437 + resp.Message = "服务器错误"
  438 + resp.Code = ERROR_SRV_ERROR
  439 + break
  440 + }
  441 +
  442 + drawnum := int(rdata.Money * 100)
  443 + //需要判断一下金币是否足够
  444 + if drawnum*100 > uinfo.RealGold {
  445 + logger.Error("gold nor enough failed err=%v", err)
  446 + resp.Message = "提现金币不足"
  447 + resp.Code = ERROR_GETCASH_GOLDNOTENOUGH_FAILED
  448 + break
  449 + }
  450 +
  451 + //需要处理一下提现级别
  452 +
  453 + index := 0
  454 + var info *WithDrawDesc
  455 + index, info = uinfo.GetWithDrawData(rdata.Money)
  456 +
  457 + if index == -1 || info == nil {
  458 + logger.Error("AddWithDrawList failed err=%v", err)
  459 + resp.Message = "网络错误"
  460 + resp.Code = ERROR_SRV_ERROR
  461 + break
  462 + }
  463 +
  464 + if info.Isnew == 0 {
  465 + logger.Error("AddWithDrawList failed err=%v", err)
  466 + resp.Message = "新人专享只能提取一次"
  467 + resp.Code = ERROR_WITHDRAWONLYONE
  468 + break
  469 + }
  470 +
  471 + if info.Preisfind == 0 {
  472 + logger.Error("HandlerGetcash Preisfind err=%v", err)
  473 + resp.Message = "请先完成前一档提现"
  474 + resp.Code = ERROR_PRENOTFINISH
  475 + break
  476 + }
  477 +
  478 + //普通提现需要判断前置条件
  479 + if rdata.Ctype == 1 {
  480 + //判断一下前置条件的下一档
  481 + if index == len(uinfo.WithDraw.Cashdata)-1 {
  482 + //最后一档了不用处理
  483 + } else {
  484 + if index < len(uinfo.WithDraw.Cashdata)-1 {
  485 + uinfo.WithDraw.Cashdata[index+1].Preisfind = 1
  486 + }
  487 + }
  488 + }
  489 +
  490 + //如果是2.2.7版本开启提现次数限制
  491 + if rdata.Ver == "2.2.7" && uinfo.GetCashCnt > 0 {
  492 + logger.Error("HandlerGetcash GetCashCnt err=%v", err)
  493 + resp.Message = "当天已经提现过了,请明天再来"
  494 + resp.Code = ERROR_PRENOTFINISH
  495 + break
  496 + }
  497 +
  498 + if uinfo.SumLoginDay < info.Day {
  499 + logger.Error("HandlerGetcash GetCashCnt err=%v", err)
  500 + resp.Message = "累计登陆天数不足"
  501 + resp.Code = ERROR_PRENOTFINISH
  502 + break
  503 + }
  504 +
  505 + //2.2.5版本开启自动审核
  506 + checkcoin := 2
  507 + if rdata.Ver == "2.2.5" || rdata.Ver == "2.2.6" || rdata.Ver == "2.2.7" {
  508 + logger.Info("HandlerGetcash autocheckcoin")
  509 + if drawnum <= 150 {
  510 + //1.5挡位以下不需要审核
  511 + checkcoin = 1 //临时关闭u
  512 + }
  513 + }
  514 +
  515 + cdkey, err := GetCashWechatFromSDK(uuid, drawnum, rdata.Gameid, rdata.Channel, rdata.Openid, rdata.Nickname, rdata.Headurl, rdata.Ver, checkcoin)
  516 + if err != nil {
  517 + logger.Error("GetCashFromSDK failed err=%v", err)
  518 + resp.Message = "从后台提现失败了"
  519 + resp.Code = ERROR_GETCASH_FAILED
  520 + break
  521 + }
  522 + logger.Info("HandlerGetcashwechat cdkey=%v", cdkey)
  523 +
  524 + //保存cdkey
  525 + var tmp CashCdKeyInfo
  526 + tmp.Cdkey = cdkey
  527 + tmp.Money = rdata.Money
  528 + tmp.Id = info.Cid
  529 + uinfo.Cdkeys = append(uinfo.Cdkeys, tmp)
  530 +
  531 + uinfo.GetCashCnt++
  532 + //如果是前六挡
  533 + if info.Cid <= 6 && rdata.Ctype == 1 {
  534 + uinfo.WithDraw.Cashdata[index].Isnew = 0
  535 + }
  536 +
  537 + uinfo.RealGold += drawnum * 100
  538 + //uinfo.RealGold -= drawnum * 100
  539 +
  540 + resp.Data.Cdkey = cdkey
  541 + SaveUserInfo(uinfo, uniqueuuid)
  542 +
  543 + resp.Code = ERROR_OK
  544 + break
  545 + }
  546 +
  547 + //回包
  548 + logger.Info("HandlerGetcashwechat resp=%+v", resp)
  549 + respstr, _ := json.Marshal(&resp)
  550 + fmt.Fprint(w, string(respstr))
  551 +}
  552 +
363 func HandlerGetcash(w http.ResponseWriter, data string, uniqueuuid, gameid, channel string, uuid int) { 553 func HandlerGetcash(w http.ResponseWriter, data string, uniqueuuid, gameid, channel string, uuid int) {
364 SetHeader(w) 554 SetHeader(w)
365 var resp GetcashResp 555 var resp GetcashResp
@@ -478,6 +668,7 @@ func HandlerQuerdrawinfo(w http.ResponseWriter, data string, uniqueuuid, gameid, @@ -478,6 +668,7 @@ func HandlerQuerdrawinfo(w http.ResponseWriter, data string, uniqueuuid, gameid,
478 resp.Data.Logindaycontinue = uinfo.ContinueLoginDay 668 resp.Data.Logindaycontinue = uinfo.ContinueLoginDay
479 resp.Data.Logindaysum = uinfo.SumLoginDay 669 resp.Data.Logindaysum = uinfo.SumLoginDay
480 resp.Data.Cashdata = append(resp.Data.Cashdata, uinfo.WithDraw.Cashdata...) 670 resp.Data.Cashdata = append(resp.Data.Cashdata, uinfo.WithDraw.Cashdata...)
  671 + resp.Data.Cdkeycashdata = append(resp.Data.Cdkeycashdata, uinfo.Cdkeys...)
481 672
482 resp.Code = ERROR_OK 673 resp.Code = ERROR_OK
483 break 674 break