📄 game.jsp.svn-base
字号:
<!--------------------------------------------------------------------------------------------------------------
*@霸烙皋牢
*@Author : 林妨唱(2008-05-23)
--------------------------------------------------------------------------------------------------------------->
<%@ page import='java.io.*,java.text.*,java.util.Date,java.util.Vector, java.sql.*, com.entaz.lib.db.*, com.entaz.relay.net.*' contentType='text/html;charset=euc-kr'%>
<%@ include file="../imgpath.jsp"%>
<%!
public static String isNull(String str)
{
if (str == null)
return "";
else
return str;
}
%>
<%
/***********************************************************************
@ Page Description
霸烙 皋牢 其捞瘤
@ Parameter
***********************************************************************/
/*------------------------------------------------------------------------------------------------------
+ 扁夯 颇扼固磐
-------------------------------------------------------------------------------------------------------*/
String vmtype = request.getParameter("vmtype") == null ? "":request.getParameter("vmtype").substring(0,1);
String vGameTableName = null;
if(vmtype.equals("b")){ vGameTableName = "GT_game_brew"; }else{ vGameTableName = "GT_game_wipi"; }
String mphone= request.getParameter("mphone");
//if(mphone == null){
// mphone= "01088295564";
//}
String gphone= request.getParameter("gphone");
if(null == gphone){
gphone = mphone;
}
String linkFlag= null;
if(!isNull(request.getParameter("linkFlag")).equals("")){ linkFlag = request.getParameter("linkFlag"); }else{ linkFlag="0"; }
int nlinkFlag = Integer.parseInt(linkFlag);
/*------------------------------------------------------------------------------------------------------
+ 傈开 函荐
-------------------------------------------------------------------------------------------------------*/
int loop = 0;
int loop2 = 0;
int linkFlagCnt = 0;
int game_idx = 0;
int searchRange = 0;
int own_field = 0;
String game_title = "";
String game_text = "";
String game_img = "";
int game_diff = 0;
int game_genre = 0;
String game_type = "";
int bCnt = 0;
String bGameTitle[] = new String[3];
String bGameText[] = new String[3];
String bGameImgPath[] = new String[3];
int bGameHit[] = new int[3];
int bGameIdx[] = new int[3];
String challengeGame_title = "";
String challengeGame_text = "";
String challengeGame_img_path = "";
int coupleGame_idx = 0;
String coupleGame_title = "";
String coupleGame_text = "";
String coupleGame_img = "";
int coupleGame_diff = 0;
int couple_idx = 0;
int eCnt = 0;
String nickname[] = new String[3];
int point[] = new int[3];
int point_old[] = new int[3];
int raking_old[] = new int[3];
String topPhone[] = new String[3];
String nickname_frist = "";
int point_frist = 0;
int point_old_frist = 0;
int raking_old_frist = 0;
String topPhone_frist = "";
String nickname_second = "";
int point_second = 0;
int point_old_second = 0;
int raking_old_second = 0;
String topPhone_second = "";
String nickname_third = "";
int point_third = 0;
int point_old_third = 0;
int raking_old_third = 0;
String topPhone_third = "";
String num_frist = "";
String num_second = "";
String num_third = "";
int up_num_frist = 0;
int up_num_second = 0;
int up_num_third = 0;
int friendGame_idx = 0;
String friendGame_title = "";
String friendGame_img = "";
int friendGame_diff = 0;
int populCnt = 0;
int populGameIdx[] = new int[5];
String populGameTitle[] = new String[5];
int rookieCnt = 0;
String rookiePonenum[] = new String[3];
String rookieNickname[] = new String[3];
int rookieSex[] = new int[2];
int rookieUp_grade[] = new int[2];
int starCnt = 0;
int halfStarFlag = 0;
int [] play_game = new int[6];
int myGameCnt = 0;
String [] myGame_title = new String[6];
String [] myGame_img_path = new String[6];
int [] challenge_game = new int[6];
/*------------------------------------------------------------------------------------------------------
+ DB 包访 函荐
-------------------------------------------------------------------------------------------------------*/
PreparedStatement pstmt = null;
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
String query1 = null;
String ssql = null;
/*------------------------------------------------------------------------------------------------------
+ 朝楼 包访
-------------------------------------------------------------------------------------------------------*/
Timestamp di_date=null;
Date today = new Date();
SimpleDateFormat timeform;
timeform = new SimpleDateFormat("MM/dd HH:mm");
try
{
/*------------------------------------------------------------------------------------------------
* DB 目池记
-------------------------------------------------------------------------------------------------*/
%><%@ include file="../getConnection.jsp"%><%
/*------------------------------------------------------------------------------------------------
* 坷疵 迄乔规巩荐
-------------------------------------------------------------------------------------------------*/
/**************************************
my 霸烙
***************************************/
stmt = con.createStatement();
query1 = "select play_idx, play_first, play_second, play_third,play_4,play_5,play_6 from GT_gameplay_info where phonenum='"+mphone+"'";
rs=stmt.executeQuery(query1);
if(rs.next())
{
play_game[0]=rs.getInt("play_first");
play_game[1]=rs.getInt("play_second");
play_game[2]=rs.getInt("play_third");
play_game[3]=rs.getInt("play_4");
play_game[4]=rs.getInt("play_5");
play_game[5]=rs.getInt("play_6");
for(int i=0;i<6;i++)
{
//System.out.println("play_game["+i+"]="+play_game[i]);
if(play_game[i] > 0)
myGameCnt++;
}
}
if(rs != null) rs.close();
for(int i=0;i<myGameCnt;i++)
{
query1 = "select game_title,qcif_img from GT_game where game_idx = "+play_game[i];
rs=stmt.executeQuery(query1);
if(rs.next())
{
myGame_title[i] = rs.getString("game_title");
//System.out.println("myGame_title["+i+"]="+myGame_title[i]);
myGame_img_path[i] = rs.getString("qcif_img");
//System.out.println("myGame_img_path["+i+"]="+img_path+myGame_img_path[i]);
}
if(rs != null) rs.close();
}
/**************************************
牢扁 厘福
***************************************/
query1="select top 1 game_genre from GT_game order by newId()";
rs=stmt.executeQuery(query1);
if(rs.next())
{
game_genre=rs.getInt("game_genre");
if (game_genre==0)
game_type = "酒纳捞靛" ;
else if(game_genre==1)
game_type = "酱泼/咀记";
else if(game_genre==2)
game_type = "焊靛/欺榴";
else
game_type = "";
}
if(rs != null) rs.close();
/**************************************
牢扁 厘福 唱赣瘤 3俺
***************************************/
query1="select top 3 game_title ,qcif_img,game_text,game_hit,game_idx from GT_game where game_genre = "+game_genre+" order by game_hit desc";
rs=stmt.executeQuery(query1);
while(rs.next())
{
bGameTitle[bCnt] = rs.getString("game_title");
bGameText[bCnt] = rs.getString("game_text");
bGameImgPath[bCnt]=rs.getString("qcif_img");
bGameHit[bCnt] = rs.getInt("game_hit");
bGameIdx[bCnt] = rs.getInt("game_idx");
bCnt++;
}
if(rs != null) rs.close();
/**************************************
couple 霸烙 //概老 目敲霸烙 急沥 胶纳领傅 鞘夸
***************************************/
query1="SELECT game_Idx,game_title,game_text,qcif_img,game_diff FROM "+vGameTableName+" WHERE game_couple = 1";
rs=stmt.executeQuery(query1);
if(rs.next())
{
coupleGame_idx=rs.getInt("game_Idx");
coupleGame_title=rs.getString("game_title");
coupleGame_text=rs.getString("game_text");
coupleGame_img=rs.getString("qcif_img");
coupleGame_diff = rs.getInt("game_diff");
}
//out.print(coupleGame_idx);
if(rs != null) rs.close();
ssql ="select idx from gt_gamecouplelog where phonenum = "+mphone;
rs=stmt.executeQuery(ssql);
if(rs.next())
{
couple_idx=rs.getInt("idx");
}
if(rs != null) rs.close();
/**************************************
档傈 霸烙
***************************************/
stmt = con.createStatement();
query1 = "select play_first, play_second, play_third,play_4,play_5,play_6 from GT_gameplay_info where phonenum='"+mphone+"'";
rs=stmt.executeQuery(query1);
int randominti = 0;
int serch1 = 0;
int serch2 = 0;
int serch3 = 0;
int serch4 = 0;
int serch5 = 0;
int serch6 = 0;
if(rs.next()){
serch1 = rs.getInt("play_first");
serch2 = rs.getInt("play_second");
serch3 = rs.getInt("play_third");
serch4 = rs.getInt("play_4");
serch5 = rs.getInt("play_5");
serch6 = rs.getInt("play_6");
}
if(serch1 != 0){
randominti = randominti+1;
}
if(serch2 != 0){
randominti = randominti+1;
}
if(serch3 != 0){
randominti = randominti+1;
}
if(serch4 != 0){
randominti = randominti+1;
}
if(serch5 != 0){
randominti = randominti+1;
}
if(serch6 != 0){
randominti = randominti+1;
}
int p =(int)(1+Math.random()*randominti);
int challenge_random = 0;
if(rs.next())
{
challenge_random=rs.getInt(p);
}
if(rs != null) rs.close();
query1 = "select game_title,game_text,qcif_img from GT_game where game_idx = "+p;
rs=stmt.executeQuery(query1);
if(rs.next())
{
challengeGame_title = rs.getString("game_title");
challengeGame_text = rs.getString("game_text");
challengeGame_img_path = rs.getString("qcif_img");
}
/**************************************
辆钦 珐欧 - 老老 珐欧
***************************************/
query1="select top 3 nickname,point,point_old,raking_old,phonenum from GT_GameRanking order by point desc";
rs=stmt.executeQuery(query1);
while(rs.next())
{
nickname[eCnt] = rs.getString("nickname");
point[eCnt] = rs.getInt("point");
point_old[eCnt]=rs.getInt("point_old");
raking_old[eCnt] = rs.getInt("raking_old");
topPhone[eCnt] = rs.getString("phonenum");
eCnt++;
}
if(rs != null) rs.close();
nickname_frist = nickname[0];
point_frist = point[0];
point_old_frist = point_old[0];
raking_old_frist = raking_old[0];
topPhone_frist = topPhone[0];
nickname_second = nickname[1];
point_second = point[1];
point_old_second = point_old[1];
raking_old_second = raking_old[1];
topPhone_second = topPhone[1];
nickname_third = nickname[2];
point_third = point[2];
point_old_third = point_old[2];
raking_old_third = raking_old[2];
topPhone_third = topPhone[2];
up_num_frist = raking_old[0]-1;
up_num_second = raking_old[1]-2;
up_num_third = raking_old[2]-3;
if (raking_old_frist!=0)
if (up_num_frist==0)
num_frist = "<font color='#616667'>(-)"+ up_num_frist+"</font>";
else if(up_num_frist<0)
num_frist = "<font color='#314cff'>(″)"+ Math.abs(up_num_frist)+"</font>";
else if(up_num_frist>0)
num_frist = "<font color='#ff2431'>(°)"+ up_num_frist+"</font>";
else
num_frist = "";
else
num_frist = "";
if(raking_old_second!=0)
if (up_num_second==0)
num_second = "<font color='#616667'>(-)"+ up_num_second+"</font>";
else if(up_num_second<0)
num_second = "<font color='#314cff'>(″)"+ Math.abs(up_num_second)+"</font>";
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -