function requestProcessor($request) { echo "received request" . PHP_EOL; var_dump($request); if (!isset($request['type'])) { return "ERROR: unsupported message type"; } switch ($request['type']) { /* case "login": //return doLogin($request['username'],$request['password']); $auth=doLogin($request['username'],$request['password']); if($auth==true){ return array('hello'=>'world'); } */ //case "validate_session": //return doValidate($request['sessionId']); //in case friends this will return a list of friends from //the the steam user, and send it in an array to the client. case "showFriends": //echo "hello"; //echo $request['steamid']; //print_r("yo"); return showFriends($request['steamid']); break; case "showFriends2": //echo "hello"; //echo $request['steamid']; //print_r("yo"); return showFriends($request['steamid']); break; case "fofLoad": return compareGames("76561198011789036", "76561197978534933"); break; //return array("returnCode" => '0', 'message'=>"Server received request and processed"); } //return array("returnCode" => '0', 'message'=>"Server received request and processed"); }
//$count=$count+1; $count = $db->getFriendsNumber($info['content']); echo "<td>" . $count . "</td>"; echo "</tr>"; } echo "</table>"; } function showArticles() { $db = new DBUtil(); $result = $db->getArticles("39"); echo "<table border=1>"; echo "<tr><td>ID</td><td>标题</td><td>文章</td></tr>"; while ($info = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>姚明</td>"; echo "<td>" . $info['title'] . "</td>"; echo "<td>" . $info['content'] . "</td>"; echo "</tr>"; } echo "</table>"; } echo "好友列表:"; showFriends(); echo "<p>"; echo "文章:"; showArticles(); ?> </center> </body> </html>
include XOOPS_ROOT_PATH . '/modules/galleries/include/cp_bookmarks.php'; if (isset($add)) { addBookMarks(); } showBookMarks(1); break; case 'delbookmarks': include XOOPS_ROOT_PATH . '/modules/galleries/include/cp_bookmarks.php'; deleteBookMarks(); break; case 'friends': include XOOPS_ROOT_PATH . '/modules/galleries/include/cp_friends.php'; if (isset($add)) { addFriends(); } showFriends(1); break; case 'add': include XOOPS_ROOT_PATH . '/modules/galleries/include/cp_friends.php'; addFriends(); break; case 'deletefriend': include XOOPS_ROOT_PATH . '/modules/galleries/include/cp_friends.php'; deleteFriends(); break; case 'images': default: include XOOPS_ROOT_PATH . '/modules/galleries/include/cp_images.php'; showImages(); break; }
break; case 19: //修改昵称 var_dump(editNickname("zhangsan", "小A")); break; case 20: //添加好友---- var_dump(addFriend("zhangsan", "lisi")); break; case 21: //删除好友 var_dump(deleteFriend("zhangsan", "lisi")); break; case 22: //查看好友 var_dump(showFriends("zhangsan")); break; case 23: //查看黑名单 var_dump(getBlacklist("zhangsan")); break; case 24: //往黑名单中加人 $usernames = array("usernames" => array("zhangsan", "lisi")); var_dump(addUserForBlacklist("wangwu", $usernames)); break; case 25: //从黑名单中减人 var_dump(deleteUserFromBlacklist("zhangsan", "lisi")); break; case 26:
function requestProcessor($request) { echo "received request" . PHP_EOL; var_dump($request); if (!isset($request['type'])) { return "ERROR: unsupported message type"; } switch ($request['type']) { case "login": //return doLogin($request['username'],$request['password']); $auth = doLogin($request['username'], $request['password']); if ($auth == true) { return array('hello' => 'world'); } case "validate_session": return doValidate($request['sessionId']); //in case friends this will return a list of friends from //the the steam user, and send it in an array to the client. //in case friends this will return a list of friends from //the the steam user, and send it in an array to the client. case "showFriends": return showFriends($request['steamid']); case "popFri": addFriendsToUsers($request['steamid']); case "add": retrieveUserInfo($request['steamid']); //return array("returnCode" => '0', 'message'=>"Server received request and processed"); } //return array("returnCode" => '0', 'message'=>"Server received request and processed"); }