📄 server.java
字号:
import java.util.*;
import java.io.*;
import java.net.*;
/**
* @author yeeku.H.lee kongyeeku@163.com
* @version 1.0
* <br>Copyright (C), 2005-2008, yeeku.H.Lee
* <br>This program is protected by copyright laws.
* <br>Program Name:
* <br>Date:
*/
public class Server
{
private final int SERVER_PORT = 49000;
public static MyMap<String , Socket> clients = new MyMap<String , Socket>();
//存放游戏里面玩家进入桌子里的信息
public static Map<String , Hashtable> table = new Hashtable<String , Hashtable>();
//存放游戏里面玩家的信息
public static Map<String , Hashtable> playerLogin = new Hashtable<String , Hashtable>();
//存放游戏里面玩家的准备状态的信息
public static Map<String , Hashtable> playerReady = new Hashtable<String , Hashtable>();
public void init()throws Exception
{
ServerSocket ss = new ServerSocket(SERVER_PORT);
Socket socket = null;
while (true)
{
socket = ss.accept();
new ServerThread(socket).start();
}
}
public static void main(String[] args) throws Exception
{
Server server = new Server();
server.init();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -