servercachehandler.java

来自「是一款国外的网络游戏平台的源码*不是类似浩方那种虚拟局域网技术」· Java 代码 · 共 58 行

JAVA
58
字号
/*
 * Created on May 28, 2005
 *
 * Deals with all hashable data that can and will be needed
 */
package org.GTADS.server;

import java.util.*;
import java.net.*;


/**
 * @author Administrator
 *
 * Cache naming conventions for hashtable is:
 * keyValueCache to denote key -> value
 * or
 * objectNameCache to denote string key -> objectName
 */

public class ServerCacheHandler {
	public static Hashtable socketStreamCache = new Hashtable();
	public static Hashtable userSocketCache = new Hashtable();
	public static Hashtable socketUserCache = new Hashtable();
	public static Hashtable userPasswordCache = new Hashtable();
	public static Hashtable chatroomUsersCache = new Hashtable();
	public static Hashtable chatroomNameCache = new Hashtable();
	public static Hashtable userChatroomCache = new Hashtable();
	public static Hashtable userAdminCache = new Hashtable();
	public static Hashtable friendsListCache = new Hashtable();
	public static Hashtable userUptimeCache = new Hashtable();
	public static Hashtable userLimitCache = new Hashtable();
	public static Hashtable gameroomNameCache = new Hashtable();
	public static Hashtable userGameroomCache = new Hashtable();
	public static Hashtable userBannedIntervalCache = new Hashtable();
	public static Hashtable ipBannedIntervalCache = new Hashtable();
	public static Hashtable userPingTimeCache = new Hashtable();
	public static Hashtable userProxyPortState = new Hashtable();
	
	public static void setUserSocketCache(String user, Socket userSocket){
		userSocketCache.put(user, userSocket);
		socketUserCache.put(userSocket, user);
	}
	
	public static void removeUserSocketCache(String user, Socket userSocket){
		if (user == null || userSocket == null)
			return;
		if (userSocketCache.containsKey(user) && socketUserCache.containsKey(userSocket)) {
			userSocketCache.remove(user);
			socketUserCache.remove(userSocket);
		}
	}
	
	public static void removeUserFromChatroomCache(String username){
		Vector searchableChatrooms;
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?