Java Network Game Programming
game
server responsibility:
Initialize
the server socke;
Wait
for a client to connect;
Accept
the client connection;
Create
a daemon thread to support the clien;
Go
back to step 2.
game daemon responsibility:
Accept
client player connection;
Pair
up players to form separate game;
Manage
the flow of the game;
Communicate
each player's move to the other player;
Notify
the players of the state of the game.
Ïà¹ØÎĵµ£º
1.Éú³ÉgifͼƬ¸ñʽµÄ
package com.cssweb.common.util;
import java.io.*;
import java.util.*;
import com.sun.image.codec.jpeg.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.awt.*;
import java.awt.image.*;
/*
* ¹¦ÄÜ£ºµ÷ÓÃAuthServlet¿ÉÒÔÉú³ÉÒ»¸öÑéÖ¤ÂëͼƬ,ͼƬµÄ¿í¶ÈºÍ¸ß¶È¿ÉÒ ......
±¾È˾ãËÄÄêÑз¢¾Ñ飨javaµÄ£©
˸øÎÒÍƼö·ÝǶÈëʽcְ룬cÓïÑÔһֱûÂäÏ£¬Ñ§µÄ»¹ÐС£¡£¡£¹¤×Ê¿ªÎÒ2k¾ÍÐУ¡
ֻΪ³É¹¦´òÈëǶÈëʽÊг¡¡£¡£¡£¸ø¸ö»ú»á°É¡£¡£
ÎÒÕæµÄÊÇÌ«ÏëºÍÄãÃÇ×öͬÐÐÀ²£¡
ÓÐÒâÏòµÄ¿ÉÒÔÁªÏµÎÒ¡£¡£ÎÒ²»Ìô´ýÓö£¬¶Ô¹¤×÷¾ÍÒ»¸öÒªÇó£¬Ç¶Èëʽ¿ª·¢¡£¡£¡£ÎÒÓеģ¬¾ÍÊÇ4ÄêµÄjavaÑз¢¾ÑéºÍc»ù´¡¡£¡£¡£ÌáÇ ......
import java.awt.Color;
import java.io.FileOutputStream;
import com.lowagie.text.Cell;
import com.lowagie.text.Chapter;
import com.lowagie.text.Document;
import com.lowagie.text.Font;
import com.lowagie.text.Image;
import com.lowagie.text.List;
import com.lowagie.text.ListItem;
import com.lo ......
ÎÒÃÇÿ¸öѧÆÚÄ©¶¼»á½øÐн«½üÒ»¸öÔµÄʵѵ£¬Õâ´ÎJavaʵѵҲ¼´½«½áÊø£¬ÎÒÑ¡µÄ¿ÎÌâÊÇ“¸öÈËÍøÉÏÒøÐÐϵͳ”£¬ÔËÓÃÁËStruts£¬HibernateºÍSpring¿ò¼Ü£¬Í¨¹ýmvcÉè¼Æģʽ¡£»ù±¾ËùÓеŦÄܶ¼ÊµÏÖÁË£¬ÔÚʵѵÖÐÕæµÄѧµ½Á˺ܶà֪ʶ£¬Ö®¼äÒ²Óöµ½Á˺ܶàÎÊÌ⣬µ«¶¼Ò»Ò»µÃµ½½â¾ö¡£ÎÒ½øÒ»²½Á˽âÁËStrutsµÄÔËÐÐÔÀí£¬ÂíÉÏÃæÁÙ ......