- 精华
- 阅读权限
- 20
- 好友
- 相册
- 分享
- 听众
- 收听
- 注册时间
- 2016-12-2
- 在线时间
- 小时
- 最后登录
- 1970-1-1
|
发表于 2018-4-4 23:24:55
|
显示全部楼层
这个游戏我改通关了,165级。可以用Navicat Premium随便修改。因为图不能上传,就不上传了。麻烦。
我这里放出一个修改的51登录版,不需要真的51账号,可以用account表里面的loginname登录,也可以 自己手动创建一条纪录登录
index.html源码修改如下
- <!DOCTYPE html>
- <html>
- <head>
- <title>卧龙吟</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
- <style>
- input[type=text], select, textarea {
- width: 100%;
- padding: 12px;
- border: 1px solid #ccc;
- border-radius: 4px;
- box-sizing: border-box;
- margin-top: 6px;
- margin-bottom: 16px;
- resize: vertical;
- }
- input[type=submit] {
- background-color: #4c75af;
- color: white;
- padding: 12px 20px;
- border: none;
- border-radius: 4px;
- cursor: pointer;
- }
- input[type=submit]:hover {
- background-color: #45a049;
- }
- .container {
- width: 22%;
- border-radius: 5px;
- background-color: #f2f2f2;
- padding: 20px;
- }
- </style>
- </head>
- <body>
- <center>
- <h1>卧龙吟</h1>
- <div class="container">
- <form action="toandaik.jsp" method="post" name="login">
- <input type="text" placeholder="450834229" name="username" value="450834229">
- <input type="submit" value="登陆" name = "login">
- </form>
- </div>
- </center>
- </body>
- </html>
复制代码
toandaik.jsp是核心的部分,里面用到了3个JS文件,jquery和md5网上能找到的。或者直接去51网站下载。
- <%@ page language="java" contentType="text/html; charset=UTF-8" import="java.util.*" pageEncoding="UTF-8"%>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <title>卧龙吟</title>
- <link rel="shortcut icon" href="favicon.ico" />
- </head>
- <body>
- <script src="jquery.js"></script>
- <script src="md5.js"></script>
- <script src="passport.js"></script>
- <script>
- $(function() {
- var username = String(<%= request.getParameter("username") %>);
- foGameClient.loginCheck("917e1feeba575bba9ae225e1352ea2c7",username, function(user) {
- location.href = "51login";
- });
- });
- </script>
- </body>
- </html>
复制代码
改成了本地的JS引用,这样不用依赖51账号。最后也是最关键的,修改JS回调
passport.js文件如下
- if (!foGameClient) {
- var foGameClient = {};
- }
- foGameClient.getCookie = function(name) {
- var val = null;
- if (document.cookie && document.cookie != "") {
- var cks = document.cookie.split(";");
- for (var i = 0; i < cks.length; i++) {
- var ck = $.trim(cks[i]);
- if (ck.substring(0, name.length + 1) == (name + "=")) {
- val = decodeURIComponent(ck.substring(name.length + 1));
- break;
- }
- }
- }
- return val;
- };
- foGameClient.setCookie = function(name, value, options) {
- options = options || {};
- if (null === value) {
- value = "";
- options.expires = -1;
- }
- var expires = "";
- if (options.expires && ("number" == typeof options.expires || options.expires.toUTCString)) {
- var date;
- if ("number" == typeof options.expires) {
- date = new Date();
- date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
- } else {
- date = options.expires;
- }
- expires = "; expires=" + date.toUTCString();
- }
- var path = options.path ? "; path=" + (options.path) : "";
- var domain = options.domain ? "; domain=" + (options.domain) : "";
- var secure = options.secure ? "; secure" : "";
- document.cookie = [name, "=", encodeURIComponent(value), expires, path, domain, secure].join("");
- };
- foGameClient.passportCallback = function(params) {
- if (!this.getCookie(params.app_key) || 1 || (parseInt(params.time) - parseInt(this.getCookie(params.app_key + "_time"))) > 3600) {
- this.setCookie(params.app_key, params.sig, {
- path: "/"
- });
- this.setCookie(params.app_key + "_user", params.user, {
- path: "/"
- });
- this.setCookie(params.app_key + "_time", params.time, {
- path: "/"
- });
- this.setCookie(params.app_key + "_session_key", params.session_key, {
- path: "/"
- });
- }
- if (foGameClient.loginCallback) {
- foGameClient.loginCallback(params.user, params.time, params.session_key, params.sig);
- }
- return true;
- };
- foGameClient.loginCheck = function(pubKey, userName, callback) {
- var try_user = urlrequest('try_user');
- var now_user = this.getCookie(pubKey+"_user");
- if (callback) {
- foGameClient.loginCallback = callback;
- }
- var nowdate= String(Math.round(new Date().getTime()/1000).toString());
- foGameClient.passportCallback({
- app_key: "917e1feeba575bba9ae225e1352ea2c7",
- user: userName,
- time: nowdate,
- session_key: hex_md5(userName),
- sig: hex_md5(nowdate)
- });
- };
- foGameClient.logout = function(pubKey) {
- this.setCookie(pubKey, null, {path:"/"});
- this.setCookie(pubKey+"_user", null, {path:"/"});
- this.setCookie(pubKey+"_time", null, {path:"/"});
- this.setCookie(pubKey+"_session_key", null, {path:"/"});
- };
- function urlrequest(argname)
- {
- var url = document.location.href;
- var arrStr = url.substring(url.indexOf("?")+1).split("&");
- //return arrStr;
- for(var i =0;i<arrStr.length;i++)
- {
- var loc = arrStr[i].indexOf(argname+"=");
- if(loc!=-1)
- {
- return arrStr[i].replace(argname+"=","").replace("?","");
- break;
- }
- }
- return "";
- }
复制代码
上面3个文件分别保存到/home/toandaik/wly_web目录下面即可,然后直接点登录游戏。 |
|