GameUtils.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. /**
  3. * GameUtils.php UTF-8
  4. * 游戏面板
  5. *
  6. * @date : 2018/4/27 21:32
  7. *
  8. * @license 这不是一个自由软件,未经授权不许任何使用和传播。
  9. * @author : wuyonghong <wyh@huosdk.com>
  10. * @version : HUOSDK 8.0
  11. */
  12. namespace huolib\utils;
  13. use huolib\constant\GameConst;
  14. use huolib\status\DeviceStatus;
  15. use huolib\status\GameStatus;
  16. class GameUtils {
  17. /**
  18. * 校验SDK订单
  19. *
  20. * @param array $game_data
  21. *
  22. * @return int
  23. */
  24. public static function checkGame($game_data = []) {
  25. if (empty($game_data)) {
  26. return DeviceStatus::INVALID_PARAMS;
  27. }
  28. return DeviceStatus::NO_ERROR;
  29. }
  30. /**
  31. * 校验支付方式
  32. *
  33. * @param int $server_type
  34. *
  35. * @return int
  36. */
  37. public static function checkServerType($server_type = 0) {
  38. if (empty($server_type)) {
  39. return GameStatus::NO_ERROR;
  40. }
  41. $_rs = GameConst::getServerMsg($server_type);
  42. if (false == $_rs) {
  43. return GameStatus::SERVER_TYPE_ERROR;
  44. }
  45. return GameStatus::NO_ERROR;
  46. }
  47. }