Commit 19d2979a4dc4bbc5df80dfba5a2f3edd6b231fcc
1 parent
3fc1fcb9
Exists in
master
提交
Showing
1 changed file
with
10 additions
and
0 deletions
Show diff stats
src/HttpServer/logic/function.go
@@ -1228,6 +1228,16 @@ func (w *UserWareHouseData) GetWarePosById(cid int) int { | @@ -1228,6 +1228,16 @@ func (w *UserWareHouseData) GetWarePosById(cid int) int { | ||
1228 | 1228 | ||
1229 | func GetCashFromSDK(uuid int, goldnum int, gameid, channel, openid, nickname, headurl, ver string, checkcoin int) (int, error) { | 1229 | func GetCashFromSDK(uuid int, goldnum int, gameid, channel, openid, nickname, headurl, ver string, checkcoin int) (int, error) { |
1230 | 1230 | ||
1231 | + //需要校验金币是否足够 | ||
1232 | + oldnum, err := GetCoinFromSdk(uuid, gameid, channel) | ||
1233 | + if err != nil { | ||
1234 | + logger.Error("GetCashFromSDK failed=%v", err) | ||
1235 | + return 0, err | ||
1236 | + } | ||
1237 | + if oldnum < goldnum { | ||
1238 | + logger.Error("GetCashFromSDK gold not enough failed=%v", err) | ||
1239 | + return 0, errors.New("金币不足!") | ||
1240 | + } | ||
1231 | //SERVERKEY := u.GetServerKey() //conf.GetCoinConf().Key | 1241 | //SERVERKEY := u.GetServerKey() //conf.GetCoinConf().Key |
1232 | SERVERKEY := GetServerKey(gameid) | 1242 | SERVERKEY := GetServerKey(gameid) |
1233 | 1243 |