java源代码连接jsp,java网络五子棋的源代码-JSP教程,Java技巧及代码
下面的源代码分为4个文件;
chessclient.java:客户端主程序。
chessinterface.java:客户端的界面。
chesspad.java:棋盘的绘制。
chessserver.java:服务器端。
可同时容纳50个人同时在线下棋,聊天。
没有加上详细注释,不过绝对可以运行,j2sdk1.4下通过。
/*********************************************************************************************
1.chessclient.java
**********************************************************************************************/
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.net.*;
import java.util.*;
class clientthread extends thread
{
chessclient chessclient;
clientthread(chessclient chessclient)
{
this.chessclient=chessclient;
}
public void acceptmessage(string recmessage)
{
if(recmessage.startswith("/userlist "))
{
stringtokenizer usertoken=new stringtokenizer(recmessage," ");
int usernumber=0;
chessclient.userpad.userlist.removeall();
chessclient.inputpad.userchoice.removeall();
chessclient.inputpad.userchoice.additem("所有人");
while(usertoken.hasmoretokens())
{
string user=(string)usertoken.nexttoken(" ");
if(usernumber>0 && !user.startswith("[inchess]"))
{
chessclient.userpad.userlist.add(user);
chessclient.inputpad.userchoice.additem(user);
}
usernumber++;
}
chessclient.inputpad.userchoice.select("所有人");
}
else if(recmessage.startswith("/yourname "))
{
chessclient.chessclientname=recmessage.substring(10);
chessclient.settitle("java五子棋客户端 "+"用户名:"+chessclient.chessclientname);
}
else if(recmessage.equals("/reject"))
{
try
{
chessclient.chesspad.statustext.settext("不能加入游戏");
chessclient.controlpad.cancelgamebutton.setenabled(false);
chessclient.controlpad.joingamebutton.setenabled(true);
chessclient.controlpad.creatgamebutton.setenabled(true);
}
catch(exception ef)
{
chessclient.chatpad.chatlinearea.settext("chessclient.chesspad.chesssocket.close无法关闭");
}
chessclient.controlpad.joingamebutton.setenabled(true);
}
else if(recmessage.startswith("/peer "))
{
chessclient.chesspad.chesspeername=recmessage.substring(6);
if(chessclient.isserver)
{
chessclient.chesspad.chesscolor=1;
chessclient.chesspad.ismouseenabled=true;
chessclient.chesspad.statustext.settext("请黑棋下子");
}
else if(chessclient.isclient)
{
chessclient.chesspad.chesscolor=-1;
chessclient.chesspad.statustext.settext("已加入游戏,等待对方下子…");
}
}
else if(recmessage.equals("/youwin"))
{
chessclient.isonchess=false;
chessclient.chesspad.chessvictory(chessclient.chesspad.chesscolor);
chessclient.chesspad.statustext.settext("对方退出,请点放弃游戏退出连接");
chessclient.chesspad.ismouseenabled=false;
}
else if(recmessage.equals("/ok"))
{
chessclient.chesspad.statustext.settext("创建游戏成功,等待别人加入…");
}
else if(recmessage.equals("/error"))
{
chessclient.chatpad.chatlinearea.append("传输错误:请退出程序,重新加入 \n");
}
else
{
chessclient.chatpad.chatlinearea.append(recmessage+"\n");
chessclient.chatpad.chatlinearea.setcaretposition(
chessclient.chatpad.chatlinearea.gettext().length());
}
}
public void run()
{
string message="";
try
{
while(true)
{
message=chessclient.in.readutf();
acceptmessage(message);
}
}
catch(ioexception es)
{
}
}
}
public class chessclient extends frame implements actionlistener,keylistener
{
userpad userpad=new userpad();
chatpad chatpad=new chatpad();
controlpad controlpad=new controlpad();
chesspad chesspad=new chesspad();
inputpad inputpad=new inputpad();
socket chatsocket;
datainputstream in;
dataoutputstream out;
string chessclientname=null;
string host=null;
int port=4331;
boolean isonchat=false; //在聊天?
boolean isonchess=false; //在下棋?
boolean isgameconnected=false; //下棋的客户端连接?
boolean isserver=false; //如果是下棋的主机
boolean isclient=false; //如果是下棋的客户端
panel southpanel=new panel();
panel northpanel=new panel();
panel centerpanel=new panel();
panel westpanel=new panel();
panel eastpanel=new panel();
chessclient()
{
super("java五子棋客户端");
setlayout(new borderlayout());
host=controlpad.inputip.gettext();
westpanel.setlayout(new borderlayout());
westpanel.add(userpad,borderlayout.north);
westpanel.add(chatpad,borderlayout.center);
westpanel.setbackground(color.pink);
inputpad.inputwords.addkeylistener(this);
chesspad.host=controlpad.inputip.gettext();
centerpanel.add(chesspad,borderlayout.center);
centerpanel.add(inputpad,borderlayout.south);
centerpanel.setbackground(color.pink);
controlpad.connectbutton.addactionlistener(this);
controlpad.creatgamebutton.addactionlistener(this);
controlpad.joingamebutton.addactionlistener(this);
controlpad.cancelgamebutton.addactionlistener(this);
controlpad.exitgamebutton.addactionlistener(this);
controlpad.creatgamebutton.setenabled(false);
controlpad.joingamebutton.setenabled(false);
controlpad.cancelgamebutton.setenabled(false);
southpanel.add(controlpad,borderlayout.center);
southpanel.setbackground(color.pink);
addwindowlistener(new windowadapter()
{
public void windowclosing(windowevent e)
{
if(isonchat)
{
try
{
chatsocket.close();
}
catch(exception ed)
{
}
}
if(isonchess || isgameconnected)
{
try
{
chesspad.chesssocket.close();
}
catch(exception ee)
{
}
}
system.exit(0);
}
public void windowactivated(windowevent ea)
{
}
});
add(westpanel,borderlayout.west);
add(centerpanel,borderlayout.center);
add(southpanel,borderlayout.south);
pack();
setsize(670,548);
setvisible(true);
setresizable(false);
validate();
}
public boolean connectserver(string serverip,int serverport) throws exception
{
try
{
chatsocket=new socket(serverip,serverport);
in=new datainputstream(chatsocket.getinputstream());
out=new dataoutputstream(chatsocket.getoutputstream());
clientthread clientthread=new clientthread(this);
clientthread.start();
isonchat=true;
return true;
}
catch(ioexception ex)
{
chatpad.chatlinearea.settext("chessclient:connectserver:无法连接,建议重新启动程序 \n");
}
return false;
}
public void actionperformed(actionevent e)
{
if(e.getsource()==controlpad.connectbutton)
{
host=chesspad.host=controlpad.inputip.gettext();
try
{
if(connectserver(host,port))
{
chatpad.chatlinearea.settext("");
controlpad.connectbutton.setenabled(false);
controlpad.creatgamebutton.setenabled(true);
controlpad.joingamebutton.setenabled(true);
chesspad.statustext.settext("连接成功,请创建游戏或加入游戏");
}
}
catch(exception ei)
{
chatpad.chatlinearea.settext("controlpad.connectbutton:无法连接,建议重新启动程序 \n");
}
}
if(e.getsource()==controlpad.exitgamebutton)
{
if(isonchat)
{
try
{
chatsocket.close();
}
catch(exception ed)
{
}
}
if(isonchess || isgameconnected)
{
try
{
chesspad.chesssocket.close();
}
catch(exception ee)
{
}
}
system.exit(0);
}
if(e.getsource()==controlpad.joingamebutton)
{
string selecteduser=userpad.userlist.getselecteditem();
if(selecteduser==null || selecteduser.startswith("[inchess]") ||
selecteduser.equals(chessclientname))
{
chesspad.statustext.settext("必须先选定一个有效用户");
}
else
{
try
{
if(!isgameconnected)
{
if(chesspad.connectserver(chesspad.host,chesspad.port))
{
isgameconnected=true;
isonchess=true;
isclient=true;
controlpad.creatgamebutton.setenabled(false);
controlpad.joingamebutton.setenabled(false);
controlpad.cancelgamebutton.setenabled(true);
chesspad.chessthread.sendmessage("/joingame "+userpad.userlist.getselecteditem()+" "+chessclientname);
}
}
else
{
isonchess=true;
isclient=true;
controlpad.creatgamebutton.setenabled(false);
controlpad.joingamebutton.setenabled(false);
controlpad.cancelgamebutton.setenabled(true);
chesspad.chessthread.sendmessage("/joingame "+userpad.userlist.getselecteditem()+" "+chessclientname);
}
}
catch(exception ee)
{
isgameconnected=false;
isonchess=false;
isclient=false;
controlpad.creatgamebutton.setenabled(true);
controlpad.joingamebutton.setenabled(true);
controlpad.cancelgamebutton.setenabled(false);
chatpad.chatlinearea.settext("chesspad.connectserver无法连接 \n"+ee);
}
}
}
if(e.getsource()==controlpad.creatgamebutton)
{
try
{
if(!isgameconnected)
{
if(chesspad.connectserver(chesspad.host,chesspad.port))
{
isgameconnected=true;
isonchess=true;
isserver=true;
controlpad.creatgamebutton.setenabled(false);
controlpad.joingamebutton.setenabled(false);
controlpad.cancelgamebutton.setenabled(true);
chesspad.chessthread.sendmessage("/creatgame "+"[inchess]"+chessclientname);
}
}
else
{
isonchess=true;
isserver=true;
controlpad.creatgamebutton.setenabled(false);
controlpad.joingamebutton.setenabled(false);
controlpad.cancelgamebutton.setenabled(true);
chesspad.chessthread.sendmessage("/creatgame "+"[inchess]"+chessclientname);
}
}
catch(exception ec)
{
isgameconnected=false;
isonchess=false;
isserver=false;
controlpad.creatgamebutton.setenabled(true);
controlpad.joingamebutton.setenabled(true);
controlpad.cancelgamebutton.setenabled(false);
ec.printstacktrace();
chatpad.chatlinearea.settext("chesspad.connectserver无法连接 \n"+ec);
}
}
if(e.getsource()==controlpad.cancelgamebutton)
{
if(isonchess)
{
chesspad.chessthread.sendmessage("/giveup "+chessclientname);
chesspad.chessvictory(-1*chesspad.chesscolor);
controlpad.creatgamebutton.setenabled(true);
controlpad.joingamebutton.setenabled(true);
controlpad.cancelgamebutton.setenabled(false);
chesspad.statustext.settext("请建立游戏或者加入游戏");
}
if(!isonchess)
{
controlpad.creatgamebutton.setenabled(true);
controlpad.joingamebutton.setenabled(true);
controlpad.cancelgamebutton.setenabled(false);
chesspad.statustext.settext("请建立游戏或者加入游戏");
}
isclient=isserver=false;
}
}
public void keypressed(keyevent e)
{
textfield inputwords=(textfield)e.getsource();
if(e.getkeycode()==keyevent.vk_enter)
{
if(inputpad.userchoice.getselecteditem().equals("所有人"))
{
try
{
out.writeutf(inputwords.gettext());
inputwords.settext("");
}
catch(exception ea)
{
chatpad.chatlinearea.settext("chessclient:keypressed无法连接,建议重新连接 \n");
userpad.userlist.removeall();
inputpad.userchoice.removeall();
inputwords.settext("");
controlpad.connectbutton.setenabled(true);
}
}
else
{
try
{
out.writeutf("/"+inputpad.userchoice.getselecteditem()+" "+inputwords.gettext());
inputwords.settext("");
}
catch(exception ea)
{
chatpad.chatlinearea.settext("chessclient:keypressed无法连接,建议重新连接 \n");
userpad.userlist.removeall();
inputpad.userchoice.removeall();
inputwords.settext("");
controlpad.connectbutton.setenabled(true);
}
}
}
}
public void keytyped(keyevent e)
{
}
public void keyreleased(keyevent e)
{
}
public static void main(string args[])
{
chessclient chessclient=new chessclient();
}
}
/******************************************************************************************
下面是:chessinteface.java
******************************************************************************************/
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.net.*;
class userpad extends panel
{
list userlist=new list(10);
userpad()
{
setlayout(new borderlayout());
for(int i=0;i<50;i++)
{
userlist.add(i+"."+"没有用户");
}
add(userlist,borderlayout.center);
}
}
class chatpad extends panel
{
textarea chatlinearea=new textarea("",18,30,textarea.scrollbars_vertical_only);
chatpad()
{
setlayout(new borderlayout());
add(chatlinearea,borderlayout.center);
}
}
class controlpad extends panel
{
label iplabel=new label("ip",label.left);
textfield inputip=new textfield("localhost",10);
button connectbutton=new button("连接主机");
button creatgamebutton=new button("建立游戏");
button joingamebutton=new button("加入游戏");
button cancelgamebutton=new button("放弃游戏");
button exitgamebutton=new button("关闭程序");
controlpad()
{
setlayout(new flowlayout(flowlayout.left));
setbackground(color.pink);
add(iplabel);
add(inputip);
add(connectbutton);
add(creatgamebutton);
add(joingamebutton);
add(cancelgamebutton);
add(exitgamebutton);
}
}
class inputpad extends panel
{
textfield inputwords=new textfield("",40);
choice userchoice=new choice();
inputpad()
{
setlayout(new flowlayout(flowlayout.left));
for(int i=0;i<50;i++)
{
userchoice.additem(i+"."+"没有用户");
}
userchoice.setsize(60,24);
add(userchoice);
add(inputwords);
}
}
/**********************************************************************************************
下面是:chesspad.java
**********************************************************************************************/
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.net.*;
import java.util.*;
class chessthread extends thread
{
chesspad chesspad;
chessthread(chesspad chesspad)
{
this.chesspad=chesspad;
}
public void sendmessage(string sndmessage)
{
try
{
chesspad.outdata.writeutf(sndmessage);
}
catch(exception ea)
{
system.out.println("chessthread.sendmessage:"+ea);
}
}
public void acceptmessage(string recmessage)
{
if(recmessage.startswith("/chess "))
{
stringtokenizer usertoken=new stringtokenizer(recmessage," ");
string chesstoken;
string[] chessopt={"-1","-1","0"};
int chessoptnum=0;
while(usertoken.hasmoretokens())
{
chesstoken=(string)usertoken.nexttoken(" ");
if(chessoptnum>=1 && chessoptnum<=3)
{
chessopt[chessoptnum-1]=chesstoken;
}
chessoptnum++;
}
chesspad.netchesspaint(integer.parseint(chessopt[0]),integer.parseint(chessopt[1]),integer.parseint(chessopt[2]));
}
else if(recmessage.startswith("/yourname "))
{
chesspad.chessselfname=recmessage.substring(10);
}
else if(recmessage.equals("/error"))
{
chesspad.statustext.settext("错误:没有这个用户,请退出程序,重新加入");
}
else
{
//system.out.println(recmessage);
}
}
public void run()
{
string message="";
try
{
while(true)
{
message=chesspad.indata.readutf();
acceptmessage(message);
}
}
catch(ioexception es)
{
}
}
}
class chesspad extends panel implements mouselistener,actionlistener
{
int chesspoint_x=-1,chesspoint_y=-1,chesscolor=1;
int chessblack_x[]=new int[200];
int chessblack_y[]=new int[200];
int chesswhite_x[]=new int[200];
int chesswhite_y[]=new int[200];
int chessblackcount=0,chesswhitecount=0;
int chessblackwin=0,chesswhitewin=0;
boolean ismouseenabled=false,iswin=false,isingame=false;
textfield statustext=new textfield("请先连接服务器");
socket chesssocket;
datainputstream indata;
dataoutputstream outdata;
string chessselfname=null;
string chesspeername=null;
string host=null;
int port=4331;
chessthread chessthread=new chessthread(this);
chesspad()
{
setsize(440,440);
setlayout(null);
setbackground(color.pink);
addmouselistener(this);
add(statustext);
statustext.setbounds(40,5,360,24);
statustext.seteditable(false);
}
public boolean connectserver(string serverip,int serverport) throws exception
{
try
{
chesssocket=new socket(serverip,serverport);
indata=new datainputstream(chesssocket.getinputstream());
outdata=new dataoutputstream(chesssocket.getoutputstream());
chessthread.start();
return true;
}
catch(ioexception ex)
{
statustext.settext("chesspad:connectserver:无法连接 \n");
}
return false;
}
public void chessvictory(int chesscolorwin)
{
this.removeall();
for(int i=0;i<=chessblackcount;i++)
{
chessblack_x[i]=0;
chessblack_y[i]=0;
}
for(int i=0;i<=chesswhitecount;i++)
{
chesswhite_x[i]=0;
chesswhite_y[i]=0;
}
chessblackcount=0;
chesswhitecount=0;
add(statustext);
statustext.setbounds(40,5,360,24);
if(chesscolorwin==1)
{ chessblackwin++;
statustext.settext("黑棋胜,黑:白为"+chessblackwin+":"+chesswhitewin+",重新开局,等待白棋下子…");
}
else if(chesscolorwin==-1)
{
chesswhitewin++;
statustext.settext("白棋胜,黑:白为"+chessblackwin+":"+chesswhitewin+",重新开局,等待黑棋下子…");
}
}
public void getlocation(int a,int b,int color)
{
if(color==1)
{
chessblack_x[chessblackcount]=a*20;
chessblack_y[chessblackcount]=b*20;
chessblackcount++;
}
else if(color==-1)
{
chesswhite_x[chesswhitecount]=a*20;
chesswhite_y[chesswhitecount]=b*20;
chesswhitecount++;
}
}
public boolean checkwin(int a,int b,int checkcolor)
{
int step=1,chesslink=1,chesslinktest=1,chesscompare=0;
if(checkcolor==1)
{
chesslink=1;
for(step=1;step<=4;step++)
{
for(chesscompare=0;chesscompare<=chessblackcount;chesscompare++)
{
if(((a+step)*20==chessblack_x[chesscompare]) && ((b*20)==chessblack_y[chesscompare]))
{
chesslink=chesslink+1;
if(chesslink==5)
{
return(true);
}
}
}
if(chesslink==(chesslinktest+1))
chesslinktest++;
else
break;
}
for(step=1;step<=4;step++)
{
for(chesscompare=0;chesscompare<=chessblackcount;chesscompare++)
{
if(((a-step)*20==chessblack_x[chesscompare]) && (b*20==chessblack_y[chesscompare]))
{
chesslink++;
if(chesslink==5)
{
return(true);
}
}
}
if(chesslink==(chesslinktest+1))
chesslinktest++;
else
break;
}
chesslink=1;
chesslinktest=1;
for(step=1;step<=4;step++)
{
for(chesscompare=0;chesscompare<=chessblackcount;chesscompare++)
{
if((a*20==chessblack_x[chesscompare]) && ((b+step)*20==chessblack_y[chesscompare]))
{
chesslink++;
if(chesslink==5)
{
return(true);
}
}
}
if(chesslink==(chesslinktest+1))
chesslinktest++;
else
break;
}
for(step=1;step<=4;step++)
{
for(chesscompare=0;chesscompare<=chessblackcount;chesscompare++)
{
if((a*20==chessblack_x[chesscompare]) && ((b-step)*20==chessblack_y[chesscompare]))
{
chesslink++;
if(chesslink==5)
{
return(true);
}
}
}
if(chesslink==(chesslinktest+1))
chesslinktest++;
else
break;
}
chesslink=1;
chesslinktest=1;
for(step=1;step<=4;step++)
{
for(chesscompare=0;chesscompare<=chessblackcount;chesscompare++)
{
if(((a-step)*20==chessblack_x[chesscompare]) && ((b+step)*20==chessblack_y[chesscompare]))
{
chesslink++;
if(chesslink==5)
{
return(true);
}
}
}
if(chesslink==(chesslinktest+1))
chesslinktest++;
else
break;
}
for(step=1;step<=4;step++)
{
for(chesscompare=0;chesscompare<=chessblackcount;chesscompare++)
{
if(((a+step)*20==chessblack_x[chesscompare]) && ((b-step)*20==chessblack_y[chesscompare]))
{
chesslink++;
if(chesslink==5)
{
return(true);
}
}
}
if(chesslink==(chesslinktest+1))
chesslinktest++;
else
break;
}
chesslink=1;
chesslinktest=1;
for(step=1;step<=4;step++)
{
for(chesscompare=0;chesscompare<=chessblackcount;chesscompare++)
{
if(((a+step)*20==chessblack_x[chesscompare]) && ((b+step)*20==chessblack_y[chesscompare]))
{
chesslink++;
if(chesslink==5)
{
return(true);
}
}
}
if(chesslink==(chesslinktest+1))
chesslinktest++;
else
break;
}
for(step=1;step<=4;step++)
{
for(chesscompare=0;chesscompare<=chessblackcount;chesscompare++)
{
if(((a-step)*20==chessblack_x[chesscompare]) && ((b-step)*20==chessblack_y[chesscompare]))
{
chesslink++;
if(chesslink==5)
{
return(true);
}
}
}
if(chesslink==(chesslinktest+1))
chesslinktest++;
else
break;
}
}
else if(checkcolor==-1)
{
chesslink=1;
for(step=1;step<=4;step++)
{
for(chesscompare=0;chesscompare<=chesswhitecount;chesscompare++)
{
if(((a+step)*20==chesswhite_x[chesscompare]) && (b*20==chesswhite_y[chesscompare]))
{
chesslink++;
if(chesslink==5)
{
return(true);
}
}
}
if(chesslink==(chesslinktest+1))
chesslinktest++;
else
break;
}
for(step=1;step<=4;step++)
{
for(chesscompare=0;chesscompare<=chesswhitecount;chesscompare++)
{
if(((a-step)*20==chesswhite_x[chesscompare]) && (b*20==chesswhite_y[chesscompare]))
{
chesslink++;
if(chesslink==5)
{
return(true);
}
}
}
if(chesslink==(chesslinktest+1))
chesslinktest++;
else
break;
}
chesslink=1;
chesslinktest=1;
for(step=1;step<=4;step++)
{
for(chesscompare=0;chesscompare<=chesswhitecount;chesscompare++)
{
if((a*20==chesswhite_x[chesscompare]) && ((b+step)*20==chesswhite_y[chesscompare]))
{
chesslink++;
if(chesslink==5)
{
return(true);
}
}
}
if(chesslink==(chesslinktest+1))
chesslinktest++;
else
break;
}
for(step=1;step<=4;step++)
{
for(chesscompare=0;chesscompare<=chesswhitecount;chesscompare++)
{
if((a*20==chesswhite_x[chesscompare]) && ((b-step)*20==chesswhite_y[chesscompare]))
{
chesslink++;
if(chesslink==5)
{
return(true);
}
}
}
if(chesslink==(chesslinktest+1))
chesslinktest++;
else
break;
}
chesslink=1;
chesslinktest=1;
for(step=1;step<=4;step++)
{
for(chesscompare=0;chesscompare<=chesswhitecount;chesscompare++)
{
if(((a-step)*20==chesswhite_x[chesscompare]) && ((b+step)*20==chesswhite_y[chesscompare]))
{
chesslink++;
if(chesslink==5)
{
return(true);
}
}
}
if(chesslink==(chesslinktest+1))
chesslinktest++;
else
break;
}
for(step=1;step<=4;step++)
{
for(chesscompare=0;chesscompare<=chesswhitecount;chesscompare++)
{
if(((a+step)*20==chesswhite_x[chesscompare]) && ((b-step)*20==chesswhite_y[chesscompare]))
{
chesslink++;
if(chesslink==5)
{
return(true);
}
}
}
if(chesslink==(chesslinktest+1))
chesslinktest++;
else
break;
}
chesslink=1;
chesslinktest=1;
for(step=1;step<=4;step++)
{
for(chesscompare=0;chesscompare<=chesswhitecount;chesscompare++)
{
if(((a+step)*20==chesswhite_x[chesscompare]) && ((b+step)*20==chesswhite_y[chesscompare]))
{
chesslink++;
if(chesslink==5)
{
return(true);
}
}
}
if(chesslink==(chesslinktest+1))
chesslinktest++;
else
break;
}
for(step=1;step<=4;step++)
{
for(chesscompare=0;chesscompare<=chesswhitecount;chesscompare++)
{
if(((a-step)*20==chesswhite_x[chesscompare]) && ((b-step)*20==chesswhite_y[chesscompare]))
{
chesslink++;
if(chesslink==5)
{
return(true);
}
}
}
if(chesslink==(chesslinktest+1))
chesslinktest++;
else
break;
}
}
return(false);
}
public void paint(graphics g)
{
for (int i=40;i<=380;i=i+20)
{
g.drawline(40,i,400,i);
}
g.drawline(40,400,400,400);
for(int j=40;j<=380;j=j+20)
{
g.drawline(j,40,j,400);
}
g.drawline(400,40,400,400);
g.filloval(97,97,6,6);
g.filloval(337,97,6,6);
g.filloval(97,337,6,6);
g.filloval(337,337,6,6);
g.filloval(217,217,6,6);
}
public void chesspaint(int chesspoint_a,int chesspoint_b,int color)
{
chesspoint_black chesspoint_black=new chesspoint_black(this);
chesspoint_white chesspoint_white=new chesspoint_white(this);
if(color==1 && ismouseenabled)
{
getlocation(chesspoint_a,chesspoint_b,color);
iswin=checkwin(chesspoint_a,chesspoint_b,color);
if(iswin==false)
{
chessthread.sendmessage("/"+chesspeername+" /chess "+chesspoint_a+" "+chesspoint_b+" "+color);
this.add(chesspoint_black);
chesspoint_black.setbounds(chesspoint_a*20-7,chesspoint_b*20-7,16,16);
statustext.settext("黑(第"+chessblackcount+"步)"+chesspoint_a+" "+chesspoint_b+",请白棋下子");
ismouseenabled=false;
}
else
{
chessthread.sendmessage("/"+chesspeername+" /chess "+chesspoint_a+" "+chesspoint_b+" "+color);
this.add(chesspoint_black);
chesspoint_black.setbounds(chesspoint_a*20-7,chesspoint_b*20-7,16,16);
chessvictory(1);
ismouseenabled=false;
}
}
else if(color==-1 && ismouseenabled)
{
getlocation(chesspoint_a,chesspoint_b,color);
iswin=checkwin(chesspoint_a,chesspoint_b,color);
if(iswin==false)
{
chessthread.sendmessage("/"+chesspeername+" /chess "+chesspoint_a+" "+chesspoint_b+" "+color);
this.add(chesspoint_white);
chesspoint_white.setbounds(chesspoint_a*20-7,chesspoint_b*20-7,16,16);
statustext.settext("白(第"+chesswhitecount+"步)"+chesspoint_a+" "+chesspoint_b+",请黑棋下子");
ismouseenabled=false;
}
else
{
chessthread.sendmessage("/"+chesspeername+" /chess "+chesspoint_a+" "+chesspoint_b+" "+color);
this.add(chesspoint_white);
chesspoint_white.setbounds(chesspoint_a*20-7,chesspoint_b*20-7,16,16);
chessvictory(-1);
ismouseenabled=false;
}
}
}
public void netchesspaint(int chesspoint_a,int chesspoint_b,int color)
{
chesspoint_black chesspoint_black=new chesspoint_black(this);
chesspoint_white chesspoint_white=new chesspoint_white(this);
getlocation(chesspoint_a,chesspoint_b,color);
if(color==1)
{
iswin=checkwin(chesspoint_a,chesspoint_b,color);
if(iswin==false)
{
this.add(chesspoint_black);
chesspoint_black.setbounds(chesspoint_a*20-7,chesspoint_b*20-7,16,16);
statustext.settext("黑(第"+chessblackcount+"步)"+chesspoint_a+" "+chesspoint_b+",请白棋下子");
ismouseenabled=true;
}
else
{
this.add(chesspoint_black);
chesspoint_black.setbounds(chesspoint_a*20-7,chesspoint_b*20-7,16,16);
chessvictory(1);
ismouseenabled=true;
}
}
else if(color==-1)
{
iswin=checkwin(chesspoint_a,chesspoint_b,color);
if(iswin==false)
{
this.add(chesspoint_white);
chesspoint_white.setbounds(chesspoint_a*20-7,chesspoint_b*20-7,16,16);
statustext.settext("白(第"+chesswhitecount+"步)"+chesspoint_a+" "+chesspoint_b+",请黑棋下子");
ismouseenabled=true;
}
else
{
chessthread.sendmessage("/"+chesspeername+" /victory "+color);
this.add(chesspoint_white);
chesspoint_white.setbounds(chesspoint_a*20-7,chesspoint_b*20-7,16,16);
chessvictory(-1);
ismouseenabled=true;
}
}
}
public void mousepressed(mouseevent e)
{
if (e.getmodifiers()==inputevent.button1_mask)
{
chesspoint_x=(int)e.getx();
chesspoint_y=(int)e.gety();
int a=(chesspoint_x+10)/20,b=(chesspoint_y+10)/20;
if(chesspoint_x/20<2||chesspoint_y/20<2||chesspoint_x/20>19||chesspoint_y/20>19)
{}
else
{
chesspaint(a,b,chesscolor);
}
}
}
public void mousereleased(mouseevent e){}
public void mouseentered(mouseevent e) {}
public void mouseexited(mouseevent e) {}
public void mouseclicked(mouseevent e) {}
public void actionperformed(actionevent e)
{
}
}
class chesspoint_black extends canvas implements mouselistener
{
chesspad chesspad=null;
chesspoint_black(chesspad p)
{
setsize(20,20);
chesspad=p;
addmouselistener(this);
}
public void paint(graphics g)
{
g.setcolor(color.black);
g.filloval(0,0,14,14);
}
public void mousepressed(mouseevent e)
{
// if(e.getmodifiers()==inputevent.button3_mask)
// {
// chesspad.remove(this);
// chesspad.chesscolor=1;
// chesspad.text_2.settext("");
// chesspad.text_1.settext("请黑棋下子");
// }
}
public void mousereleased(mouseevent e){}
public void mouseentered(mouseevent e) {}
public void mouseexited(mouseevent e) {}
public void mouseclicked(mouseevent e) {}
}
class chesspoint_white extends canvas implements mouselistener
{
chesspad chesspad=null;
chesspoint_white(chesspad p)
{
setsize(20,20);
addmouselistener(this);
chesspad=p;
}
public void paint(graphics g)
{
g.setcolor(color.white);
g.filloval(0,0,14,14);
}
public void mousepressed(mouseevent e)
{
// if(e.getmodifiers()==inputevent.button3_mask)
// {
// chesspad.remove(this);
// chesspad.chesscolor=-1;
// chesspad.text_2.settext("请白旗下子");
// chesspad.text_1.settext("");
// }
}
public void mousereleased(mouseevent e){}
public void mouseentered(mouseevent e) {}
public void mouseexited(mouseevent e) {}
public void mouseclicked(mouseevent e)
{
// if(e.getclickcount()>=2)
// chesspad.remove(this);
}
}
/******************************************************************************************
最后是:chessserver.java
*******************************************************************************************/
import java.io.*;
import java.net.*;
import java.awt.*;
import java.util.*;
import java.awt.event.*;
class messageserver extends panel //implements actionlistener
{
textarea messageboard=new textarea("",22,50,textarea.scrollbars_vertical_only);
label statuslabel=new label("当前连接数:",label.left);
panel boardpanel=new panel();
panel statuspanel=new panel();
messageserver()
{
setsize(350,300);
setbackground(color.pink);
setlayout(new borderlayout());
boardpanel.setlayout(new flowlayout());
boardpanel.setsize(210,210);
statuspanel.setlayout(new borderlayout());
statuspanel.setsize(210,50);
boardpanel.add(messageboard);
statuspanel.add(statuslabel,borderlayout.west);
add(boardpanel,borderlayout.center);
add(statuspanel,borderlayout.north);
}
}
class serverthread extends thread
{
socket clientsocket;
hashtable clientdatahash;
hashtable clientnamehash;
hashtable chesspeerhash;
messageserver server;
boolean isclientclosed=false;
serverthread(socket clientsocket,hashtable clientdatahash,hashtable clientnamehash,hashtable chesspeerhash,messageserver server)
{
this.clientsocket=clientsocket;
this.clientdatahash=clientdatahash;
this.clientnamehash=clientnamehash;
this.chesspeerhash=chesspeerhash;
this.server=server;
}
public void messagetransfer(string message)
{
string clientname,peername;
if(message.startswith("/"))
{
if(message.startswith("/changename "))
{
clientname=message.substring(12);
if( clientname.length()<=0 || clientname.length()>20 ||
clientname.startswith("/") || clientnamehash.containsvalue(clientname) ||
clientname.startswith("changename")|| clientname.startswith("list") ||
clientname.startswith("[inchess]") || clientname.startswith("creatgame") ||
clientname.startswith("joingame") || clientname.startswith("yourname") ||
clientname.startswith("userlist") || clientname.startswith("chess") ||
clientname.startswith("ok") || clientname.startswith("reject") ||
clientname.startswith("peer") || clientname.startswith("peername") ||
clientname.startswith("giveup") || clientname.startswith("youwin") ||
clientname.startswith("所有人"))
{
message="无效命令";
feedback(message);
}
else
{
if(clientnamehash.containsvalue(("[inchess]"+(string)clientnamehash.get(clientsocket))))
{
synchronized(clientnamehash)
{
clientnamehash.put((socket)gethashkey(clientnamehash,("[inchess]"+clientnamehash.get(clientsocket))),
("[inchess]"+clientname));
chesspeertalk(("[inchess]"+clientname),("/yourname "+("[inchess]"+clientname)));
}
}
else if(chesspeerhash.containskey(clientnamehash.get(clientsocket)))
{
//游戏客户端改名字
synchronized(clientnamehash)
{
clientnamehash.put((socket)gethashkey(clientnamehash,("[inchess]"+clientnamehash.get(clientsocket))),
("[inchess]"+clientname));
}
synchronized(chesspeerhash)
{
//chesspeerhash添加新名字映射
chesspeerhash.put(clientname,chesspeerhash.get(clientnamehash.get(clientsocket)));
//chesspeerhash删除旧映射
chesspeerhash.remove(clientnamehash.get(clientsocket));
}
//向游戏客户端发送新名字
chesspeertalk(("[inchess]"+clientname),("/yourname "+("[inchess]"+clientname)));
//向peer游戏客户端发送
chesspeertalk((string)chesspeerhash.get(clientname),("/peer "+"[inchess]"+clientname));
}
else if(chesspeerhash.containsvalue(clientnamehash.get(clientsocket)))
{
synchronized(clientnamehash)
{
//游戏客户端改名字
clientnamehash.put((socket)gethashkey(clientnamehash,("[inchess]"+clientnamehash.get(clientsocket))),
("[inchess]"+clientname));
}
synchronized(chesspeerhash)
{
//chesspeerhash重新映射
chesspeerhash.put((string)gethashkey(chesspeerhash,clientnamehash.get(clientsocket)),clientname);
//向游戏客户端发送新名字
chesspeertalk(("[inchess]"+clientname),("/yourname "+("[inchess]"+clientname)));
}
//向peer游戏客户端发送
chesspeertalk((string)gethashkey(chesspeerhash,clientname),("/peer "+"[inchess]"+clientname));
}
message=clientnamehash.get(clientsocket)+"改名为:"+clientname;
synchronized(clientnamehash)
{
clientnamehash.put(clientsocket,clientname);
}
publictalk(message);
feedback("/yourname "+(string)clientnamehash.get(clientsocket));
publictalk(getuserlist());
}
}
else if(message.equals("/list"))
{
feedback(getuserlist());
}
else if(message.startswith("/creatgame [inchess]"))
{
string chessservername=message.substring(20);
synchronized(clientnamehash)
{
clientnamehash.put(clientsocket,message.substring(11));
}
synchronized(chesspeerhash)
{
chesspeerhash.put(chessservername,"wait");
}
feedback("/yourname "+clientnamehash.get(clientsocket));
chesspeertalk(chessservername,"/ok");
publictalk(getuserlist());
}
else if(message.startswith("/joingame "))
{
stringtokenizer usertoken=new stringtokenizer(message," ");
string getusertoken,servername,selfname;
string[] chessnameopt={"0","0"};
int getoptnum=0;
while(usertoken.hasmoretokens())
{
getusertoken=(string)usertoken.nexttoken(" ");
if(getoptnum>=1 && getoptnum<=2)
{
chessnameopt[getoptnum-1]=getusertoken;
}
getoptnum++;
}
servername=chessnameopt[0];
selfname=chessnameopt[1];
if(chesspeerhash.containskey(servername) && chesspeerhash.get(servername).equals("wait"))
{
synchronized(clientnamehash)
{
clientnamehash.put(clientsocket,("[inchess]"+selfname));
}
synchronized(chesspeerhash)
{
chesspeerhash.put(servername,selfname);
}
publictalk(getuserlist());
chesspeertalk(selfname,("/peer "+"[inchess]"+servername));
chesspeertalk(servername,("/peer "+"[inchess]"+selfname));
}
else
{
chesspeertalk(selfname,"/reject");
try
{
clientclose();
}
catch(exception ez)
{
}
}
}
else if(message.startswith("/[inchess]"))
{
int firstlocation=0,lastlocation;
lastlocation=message.indexof(" ",0);
peername=message.substring((firstlocation+1),lastlocation);
message=message.substring((lastlocation+1));
if(chesspeertalk(peername,message))
{
feedback("/error");
}
}
else if(message.startswith("/giveup "))
{
string chessclientname=message.substring(8);
if(chesspeerhash.containskey(chessclientname) && !((string)chesspeerhash.get(chessclientname)).equals("wait"))
{
chesspeertalk((string)chesspeerhash.get(chessclientname),"/youwin");
synchronized(chesspeerhash)
{
chesspeerhash.remove(chessclientname);
}
}
if(chesspeerhash.containsvalue(chessclientname))
{
chesspeertalk((string)gethashkey(chesspeerhash,chessclientname),"/youwin");
synchronized(chesspeerhash)
{
chesspeerhash.remove((string)gethashkey(chesspeerhash,chessclientname));
}
}
}
else
{
int firstlocation=0,lastlocation;
lastlocation=message.indexof(" ",0);
if(lastlocation==-1)
{
feedback("无效命令");
return;
}
else
{
peername=message.substring((firstlocation+1),lastlocation);
message=message.substring((lastlocation+1));
message=(string)clientnamehash.get(clientsocket)+">"+message;
if(peertalk(peername,message))
{
feedback("没有这个用户:"+peername+"\n");
}
}
}
}
else
{
message=clientnamehash.get(clientsocket)+">"+message;
server.messageboard.append(message+"\n");
publictalk(message);
server.messageboard.setcaretposition(server.messageboard.gettext().length());
}
}
public void publictalk(string publictalkmessage)
{
synchronized(clientdatahash)
{
for(enumeration enu=clientdatahash.elements();enu.hasmoreelements();)
{
dataoutputstream outdata=(dataoutputstream)enu.nextelement();
try
{
outdata.writeutf(publictalkmessage);
}
catch(ioexception es)
{
es.printstacktrace();
}
}
}
}
public boolean peertalk(string peertalk,string talkmessage)
{
for(enumeration enu=clientdatahash.keys();enu.hasmoreelements();)
{
socket userclient=(socket)enu.nextelement();
if(peertalk.equals((string)clientnamehash.get(userclient)) && !peertalk.equals((string)clientnamehash.get(clientsocket)))
{
synchronized(clientdatahash)
{
dataoutputstream peeroutdata=(dataoutputstream)clientdatahash.get(userclient);
try
{
peeroutdata.writeutf(talkmessage);
}
catch(ioexception es)
{
es.printstacktrace();
}
}
feedback(talkmessage);
return(false);
}
else if(peertalk.equals((string)clientnamehash.get(clientsocket)))
{
feedback(talkmessage);
return(false);
}
}
return(true);
}
public boolean chesspeertalk(string chesspeertalk,string chesstalkmessage)
{
for(enumeration enu=clientdatahash.keys();enu.hasmoreelements();)
{
socket userclient=(socket)enu.nextelement();
if(chesspeertalk.equals((string)clientnamehash.get(userclient)) && !chesspeertalk.equals((string)clientnamehash.get(clientsocket)))
{
synchronized(clientdatahash)
{
dataoutputstream peeroutdata=(dataoutputstream)clientdatahash.get(userclient);
try
{
peeroutdata.writeutf(chesstalkmessage);
}
catch(ioexception es)
{
es.printstacktrace();
}
}
return(false);
}
}
return(true);
}
public void feedback(string feedbackstring)
{
synchronized(clientdatahash)
{
dataoutputstream outdata=(dataoutputstream)clientdatahash.get(clientsocket);
try
{
outdata.writeutf(feedbackstring);
}
catch(exception eb)
{
eb.printstacktrace();
}
}
}
public string getuserlist()
{
string userlist="/userlist";
for(enumeration enu=clientnamehash.elements();enu.hasmoreelements();)
{
userlist=userlist+" "+(string)enu.nextelement();
}
return(userlist);
}
public object gethashkey(hashtable targethash,object hashvalue)
{
object hashkey;
for(enumeration enu=targethash.keys();enu.hasmoreelements();)
{
hashkey=(object)enu.nextelement();
if(hashvalue.equals((object)targethash.get(hashkey)))
return(hashkey);
}
return(null);
}
public void firstcome()
{
publictalk(getuserlist());
feedback("/yourname "+(string)clientnamehash.get(clientsocket));
feedback("java五子棋聊天客户端");
feedback("/changename –更改名字");
feedback("/list –更新用户列表");
feedback("/ –私聊");
feedback("注意:用命令的时候,先把谈话的对象定为所有人");
}
public void clientclose()
{
server.messageboard.append("用户断开:"+clientsocket+"\n");
//如果是游戏客户端主机
synchronized(chesspeerhash)
{
if(chesspeerhash.containskey(clientnamehash.get(clientsocket)))
{
chesspeerhash.remove((string)clientnamehash.get(clientsocket));
}
if(chesspeerhash.containsvalue(clientnamehash.get(clientsocket)))
{
chesspeerhash.put((string)gethashkey(chesspeerhash,(string)clientnamehash.get(clientsocket)),"tobeclosed");
}
}
synchronized(clientdatahash)
{
clientdatahash.remove(clientsocket);
}
synchronized(clientnamehash)
{
clientnamehash.remove(clientsocket);
}
publictalk(getuserlist());
server.statuslabel.settext("当前连接数:"+clientdatahash.size());
try
{
clientsocket.close();
}
catch(ioexception exx)
{
}
isclientclosed=true;
}
public void run()
{
datainputstream indata;
synchronized(clientdatahash)
{
server.statuslabel.settext("当前连接数:"+clientdatahash.size());
}
try
{
indata=new datainputstream(clientsocket.getinputstream());
firstcome();
while(true)
{
string message=indata.readutf();
messagetransfer(message);
}
}
catch(ioexception esx)
{
}
finally
{
if(!isclientclosed)
{
clientclose();
}
}
}
}
public class chessserver extends frame implements actionlistener
{
button messageclearbutton=new button("清除显示");
button serverstatusbutton=new button("服务器状态");
button serveroffbutton=new button("关闭服务器");
panel buttonpanel=new panel();
messageserver server=new messageserver();
serversocket serversocket;
hashtable clientdatahash=new hashtable(50);
hashtable clientnamehash=new hashtable(50);
hashtable chesspeerhash=new hashtable(50);
chessserver()
{
super("java五子棋服务器");
setbackground(color.pink);
buttonpanel.setlayout(new flowlayout());
messageclearbutton.setsize(60,25);
buttonpanel.add(messageclearbutton);
messageclearbutton.addactionlistener(this);
serverstatusbutton.setsize(75,25);
buttonpanel.add(serverstatusbutton);
serverstatusbutton.addactionlistener(this);
serveroffbutton.setsize(75,25);
buttonpanel.add(serveroffbutton);
serveroffbutton.addactionlistener(this);
add(server,borderlayout.center);
add(buttonpanel,borderlayout.south);
addwindowlistener(new windowadapter()
{
public void windowclosing(windowevent e)
{
system.exit(0);
}
});
pack();
setvisible(true);
setsize(400,450);
setresizable(false);
validate();
try
{
makemessageserver(4331,server);
}
catch(exception e)
{
system.out.println("e");
}
}
public void makemessageserver(int port,messageserver server) throws ioexception
{
socket clientsocket;
long clientaccessnumber=1;
this.server=server;
try
{
serversocket=new serversocket(port);
server.messageboard.settext("服务器开始于:"+serversocket.getinetaddress().getlocalhost()+":"+serversocket.getlocalport()+"\n");
while(true)
{
clientsocket=serversocket.accept();
server.messageboard.append("用户连接:"+clientsocket+"\n");
dataoutputstream outdata=new dataoutputstream(clientsocket.getoutputstream());
clientdatahash.put(clientsocket,outdata);
clientnamehash.put(clientsocket,("新来客"+clientaccessnumber++));
serverthread thread=new serverthread(clientsocket,clientdatahash,clientnamehash,chesspeerhash,server);
thread.start();
}
}
catch(ioexception ex)
{
system.out.println("已经有服务器在运行. \n");
}
}
public void actionperformed(actionevent e)
{
if(e.getsource()==messageclearbutton)
{
server.messageboard.settext("");
}
if(e.getsource()==serverstatusbutton)
{
try
{
server.messageboard.append("服务器信息:"+serversocket.getinetaddress().getlocalhost()+":"+serversocket.getlocalport()+"\n");
}
catch(exception ee)
{
system.out.println("serversocket.getinetaddress().getlocalhost() error \n");
}
}
if(e.getsource()==serveroffbutton)
{
system.exit(0);
}
}
public static void main(string args[])
{
chessserver chessserver=new chessserver();
}
}
java源代码连接jsp,java网络五子棋的源代码-JSP教程,Java技巧及代码相关推荐
- python 爬虫源代码-从零开始学Python网络爬虫_源代码.rar
[实例简介] [实例截图] [核心代码] 从零开始学Python网络爬虫_源代码_1 ├── 58project │ ├── __pycache__ │ │ ├── channel_extract.c ...
- Java小程序之简易网络画板
Java小程序之简易网络画板 一.前言: Java是一门网络编程语言,强大的网络可以让数据进行传送:今天,我们就小试牛刀,看看Java是如何进行网络传输数据的: 二.项目分析: 1.功能需求: 我们前 ...
- Java jdbc连接mysql 封装类
Java jdbc连接mysql 封装类 开发工具与关键技术:java. myelipse2017.jdk1.8 作者:Amewin 撰写时间:2019年5月26日 JDBC简介: JDBC全称为ja ...
- Java教程:Java是什么?Java的特点有哪些?
本文来自CCTV5直播[www.cctv5zb.net]:原文地址 www.cctv5zb.net/Article/198130.html 转载注明来源 Java教程Java 是近 10 年来计算机软 ...
- JAVA基础入门教程——Java介绍
1. Java简介 Java是由Sun Microsystems公司于1995年5月推出的Java面向对象程序设计语言和Java平台的总称,目前由Oracle拥有. Java可运行于多个平台,如Win ...
- Android开发教程JAVA基础(汇总)
Android游戏开发视频教程(汇总) Android开发教程JAVA基础之Java 概述 Android开发教程JAVA基础之标示符.关键字1 Android开发教程JAVA基础之标示符.关键字2 ...
- STM32+ESP8266连接电脑Qt网络上位机——QT篇
本文简单介绍下手写网络调试器并连接ESP8266模块 上篇: STM32+ESP8266连接电脑Qt网络上位机--准备工作 目录 一.部分Qt代码及实现过程 二.实现过程--使用ESP8266连接上 ...
- 基于Java编写的网络五子棋
需求分析: 对于网络五子棋而言,在普通五子棋的基础上需要添加以下功能: 1.拥有服务器端和客户端,用户通过客户端登录服务器后可与其他登录的用户进行对弈 2.服务器支持多组用户同时进行对弈 3.用户可以 ...
- Java基于JSP的网络音乐KTV点歌电台网站
随着我国网民的增加,也促进了网络音乐电台的开发.随着网络技术的发展,人们在利用网络学习的同时,也在享受着网络带来的各种附带产品所产生的效应,如网络游戏,网络歌曲.网络音乐电台正是在这样的需求前提下应运 ...
最新文章
- css如何做玻璃效果_拓展训练之后的效果保持工作该如何做?
- Linux系统设置全局的默认网络代理
- java主键可以包含多列吗,SQLite主键在多列上
- LVS(11)——wrr
- MySQL限制CPU资源使用_压缩大文件时如何限制CPU使用率?----几种CPU资源限制方法的测试说明...
- 向下一代互联网迈进 声网发布全链路加速FPA为互联网增加QoS保障
- Android MediaRecorder录制视频提示start failed的解决办法
- Unity热更新学习(二) —— ToLua c#与lua的相互调用
- index.php上传到服务器找不到站点,ThinkPHP上传到服务器出现404,未找到index.php模板等问题...
- poj 2192 Zipper
- java 64bit_java9 64位 官方最新版
- Aras Innovator: 如何快速的装多份innovatorSample数据到不同的数据库
- Matlab Classification Learner
- 排列组合相关公式讲解(Anm,Cnm等)
- Win10 WiFi连接不上,如何重新配置DNS地址
- 数据库基本概念、DBMS、DBS
- 笔记本故障:输入密钥界面没有文字
- 成都女孩子报Java语言培训班怎么样_Java好就业吗?
- IntelliJ IDEA下载
- Dubbo高频面试题
热门文章
- linux 7 远程桌面xrdp,[转帖]CentOS7安装xrdp(windows远程桌面连接linux)
- android系统 修改优化,修改Android系统源代码,优化开机速度。
- 云端之战:Thomas Kurian离职,Java 11趋向收费,Ellison豪赌ERP和云数据库
- 快来一起玩转LiteOS组件:Curl
- 用简单例子带你了解联合索引查询原理及生效规则
- 鸿蒙轻内核源码分析:掌握信号量使用差异
- 【华为云技术分享】传统OCR识别综述
- 【经验分享】linux交叉编译 - openssl动态库
- 一条数据的HBase之旅,简明HBase入门教程1:开篇
- 补习系列(2)-springboot mime类型处理