Commit 587705ca87efaf68f108003906e6b315e1d25101
1 parent
7d17d311
Exists in
master
and in
4 other branches
提交serverkey
Showing
2 changed files
with
27 additions
and
5 deletions
Show diff stats
src/HttpServer/logic/constdef.go
| ... | ... | @@ -43,7 +43,8 @@ const ( |
| 43 | 43 | |
| 44 | 44 | const ( |
| 45 | 45 | //XIAOXINGXING_SERVERKEYTEST = "e2cd22102143cdcd9c181f962d031685" |
| 46 | - XIAOXINGXING_SERVERKEYTEST = "33e0c3238c108a36d87025544c6a2d2f" | |
| 46 | + XIAOXINGXING_SERVERKEYTEST = "33e0c3238c108a36d87025544c6a2d2f" | |
| 47 | + XIAOXINGXING_SERVERKEYTEST_1015 = "a81eb66afd923d24e65a4b542592bc41" | |
| 47 | 48 | //XIAOXINGXING_SDKURLOFFICAL = "https://testapi-gamesdk.d3games.com/" |
| 48 | 49 | XIAOXINGXING_SDKURLOFFICAL = "https://api.gamesdk.hmjoy.cn/" |
| 49 | 50 | ) | ... | ... |
src/HttpServer/logic/function.go
| ... | ... | @@ -914,6 +914,12 @@ func DoHttpPost(bys []byte, apistr string) (string, error) { |
| 914 | 914 | } |
| 915 | 915 | |
| 916 | 916 | func GetCoinFromSdk(uuid int, gameid string, channel string) (int, error) { |
| 917 | + | |
| 918 | + SERVERKEY := XIAOXINGXING_SERVERKEYTEST | |
| 919 | + if gameid == "1015" { | |
| 920 | + SERVERKEY = XIAOXINGXING_SERVERKEYTEST_1015 | |
| 921 | + } | |
| 922 | + | |
| 917 | 923 | var paramlist []string |
| 918 | 924 | var params GetCoinDesc |
| 919 | 925 | params.Sign_type = "md5" |
| ... | ... | @@ -934,7 +940,7 @@ func GetCoinFromSdk(uuid int, gameid string, channel string) (int, error) { |
| 934 | 940 | |
| 935 | 941 | sumparam := GettotalParam(paramlist) |
| 936 | 942 | //加serverkey |
| 937 | - signsum := sumparam + XIAOXINGXING_SERVERKEYTEST | |
| 943 | + signsum := sumparam + SERVERKEY | |
| 938 | 944 | |
| 939 | 945 | //进行hash |
| 940 | 946 | sign := GetHashValue(signsum) |
| ... | ... | @@ -970,6 +976,10 @@ func GetCoinFromSdk(uuid int, gameid string, channel string) (int, error) { |
| 970 | 976 | } |
| 971 | 977 | |
| 972 | 978 | func AddCoinToSdk(uuid int, goldnum int, gameid string, channel string, atype int) (int, error) { |
| 979 | + SERVERKEY := XIAOXINGXING_SERVERKEYTEST | |
| 980 | + if gameid == "1015" { | |
| 981 | + SERVERKEY = XIAOXINGXING_SERVERKEYTEST_1015 | |
| 982 | + } | |
| 973 | 983 | var paramlist []string |
| 974 | 984 | sign_type := "sign_type=md5" |
| 975 | 985 | paramlist = append(paramlist, sign_type) |
| ... | ... | @@ -988,7 +998,7 @@ func AddCoinToSdk(uuid int, goldnum int, gameid string, channel string, atype in |
| 988 | 998 | |
| 989 | 999 | sumparam := GettotalParam(paramlist) |
| 990 | 1000 | //加serverkey |
| 991 | - signsum := sumparam + XIAOXINGXING_SERVERKEYTEST | |
| 1001 | + signsum := sumparam + SERVERKEY | |
| 992 | 1002 | logger.Info("AddCoinToSdk sumparam=%v", signsum) |
| 993 | 1003 | |
| 994 | 1004 | //进行hash |
| ... | ... | @@ -1032,6 +1042,12 @@ func AddCoinToSdk(uuid int, goldnum int, gameid string, channel string, atype in |
| 1032 | 1042 | } |
| 1033 | 1043 | |
| 1034 | 1044 | func GetCashFromSDK(uuid int, goldnum int, gameid, channel, openid, nickname, headurl, ver string, checkcoin int) (int, error) { |
| 1045 | + | |
| 1046 | + SERVERKEY := XIAOXINGXING_SERVERKEYTEST | |
| 1047 | + if gameid == "1015" { | |
| 1048 | + SERVERKEY = XIAOXINGXING_SERVERKEYTEST_1015 | |
| 1049 | + } | |
| 1050 | + | |
| 1035 | 1051 | if goldnum == 0 || uuid == 0 || gameid == "" || channel == "" || openid == "" || ver == "" { |
| 1036 | 1052 | logger.Error("GetCashFromSDK param empty") |
| 1037 | 1053 | return 0, errors.New("param empty") |
| ... | ... | @@ -1084,7 +1100,7 @@ func GetCashFromSDK(uuid int, goldnum int, gameid, channel, openid, nickname, he |
| 1084 | 1100 | |
| 1085 | 1101 | sumparam := GettotalParam(paramlist) |
| 1086 | 1102 | //加serverkey |
| 1087 | - signsum := sumparam + XIAOXINGXING_SERVERKEYTEST | |
| 1103 | + signsum := sumparam + SERVERKEY | |
| 1088 | 1104 | |
| 1089 | 1105 | //进行hash |
| 1090 | 1106 | sign := GetHashValue(signsum) |
| ... | ... | @@ -1127,6 +1143,11 @@ func GetCashFromSDK(uuid int, goldnum int, gameid, channel, openid, nickname, he |
| 1127 | 1143 | } |
| 1128 | 1144 | |
| 1129 | 1145 | func GetCashList(uuid int, gameid string, channel string, start int, number int) (*[]WithDrawRecord, error) { |
| 1146 | + SERVERKEY := XIAOXINGXING_SERVERKEYTEST | |
| 1147 | + if gameid == "1015" { | |
| 1148 | + SERVERKEY = XIAOXINGXING_SERVERKEYTEST_1015 | |
| 1149 | + } | |
| 1150 | + | |
| 1130 | 1151 | var paramlist []string |
| 1131 | 1152 | var params GetCashListDesc |
| 1132 | 1153 | params.Sign_type = "md5" |
| ... | ... | @@ -1156,7 +1177,7 @@ func GetCashList(uuid int, gameid string, channel string, start int, number int) |
| 1156 | 1177 | |
| 1157 | 1178 | sumparam := GettotalParam(paramlist) |
| 1158 | 1179 | //加serverkey |
| 1159 | - signsum := sumparam + XIAOXINGXING_SERVERKEYTEST | |
| 1180 | + signsum := sumparam + SERVERKEY | |
| 1160 | 1181 | logger.Info("GetCashList sumparam=%v", signsum) |
| 1161 | 1182 | |
| 1162 | 1183 | //进行hash | ... | ... |