Esempio n. 1
0
 /**
 * @param $userid
 * @param $pid
 * @return mixed
 * data={
     userid  = 平台用户唯一id,
     gameid  = 游戏id,
     pid = 消耗物品列表序号,
     num = 购买数量,
     time    = 10位时间戳 超时1分钟自动失效,
     sign(32位小写) = MD5(signKey+userid+gameid+pid+num+time)
     }
 */
 public static function sendMsg($userid, $pid, $num, $time)
 {
     $sign = md5(Store::$signKey . $userid . Store::$gameId . $pid . $num, $time);
     $msg = array();
     $msg['userid'] = $userid;
     $msg['gameid'] = Store::$gameId;
     $msg['pid'] = $pid;
     $msg['num'] = $num;
     $msg['time'] = $time;
     $msg['sign'] = $sign;
     list($return_code, $return_content) = HttpUtil::http_post_data(Consume::$url, json_encode($msg));
     return $return_content;
 }
Esempio n. 2
0
 public static function sendMsg($userid, $roomId)
 {
     $nowTime = time();
     $sign = md5(Store::$signKey . $nowTime . $userid . Store::$gameId . '1' . $roomId);
     $msg = array();
     $msg['userid'] = $userid;
     $msg['gameid'] = Store::$gameId;
     $msg['roomId'] = $roomId;
     $msg['gameLevel'] = 1;
     $msg['time'] = $nowTime;
     $msg['sign'] = $sign;
     list($return_code, $return_content) = HttpUtil::http_post_data(LeaveGame::$url, json_encode($msg));
     return $return_content;
 }
Esempio n. 3
0
 public static function sendMsg($code, $codeMsg, $roomId, $userInfos)
 {
     $nowTime = time();
     $sign = md5(Store::$signKey . $nowTime . $roomId . Store::$gameId);
     $msg = array();
     $msg['code'] = $code;
     $msg['time'] = $nowTime;
     $msg['codeMsg'] = $codeMsg;
     $msg['roomId'] = $roomId;
     $msg['gameId'] = Store::$gameId;
     $msg['gameType'] = 1;
     $msg['userInfo'] = $userInfos;
     $msg['sign'] = $sign;
     list($return_code, $return_content) = HttpUtil::http_post_data(EndGame::$url, json_encode($msg));
     return $return_content;
 }