⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 servercachehandler.java

📁 是一款国外的网络游戏平台的源码*不是类似浩方那种虚拟局域网技术
💻 JAVA
字号:
/*
 * 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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -