资源简介
樱妖冒险岛079完美源码,能正常编译,079冒险岛JAVA服务端源码,需要的自己拿
代码片段和文件信息
package net.sf.cherry.client;
//import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Collection;
import java.util.Deque;
import java.util.Iterator;
import java.util.linkedHashMap;
import java.util.linkedList;
import java.util.Map;
import net.sf.cherry.database.DatabaseConnection;
import net.sf.cherry.tools.MaplePacketCreator;
//import org.apache.mina.common.IoSession;
public class BuddyList{
public static enum BuddyAddResult
{
BUDDYLIST_FULL ALREADY_ON_LIST OK;
}
public static enum BuddyOperation
{
ADDED DELETED;
}
private Map buddies = new linkedHashMap();
private int capacity;
private Deque pendingRequests = new linkedList();
public BuddyList(int capacity)
{
//super();
this.capacity = capacity;
}
public boolean contains(int characterId) {
return this.buddies.containsKey(Integer.valueOf(characterId));
}
public boolean containsVisible(int characterId) {
BuddylistEntry ble = (BuddylistEntry)this.buddies.get(Integer.valueOf(characterId));
if (ble == null)
return false;
return ble.isVisible();
}
public int getCapacity() {
return this.capacity;
}
public void setCapacity(int capacity) {
this.capacity = capacity;
}
public BuddylistEntry get(int characterId) {
return ((BuddylistEntry)this.buddies.get(Integer.valueOf(characterId)));
}
public BuddylistEntry get(String characterName) {
String lowerCaseName = characterName.toLowerCase();
for (Iterator i$ = this.buddies.values().iterator(); i$.hasNext(); ) { BuddylistEntry ble = (BuddylistEntry)i$.next();
if (ble.getName().toLowerCase().equals(lowerCaseName))
return ble;
}
return null;
}
public void put(BuddylistEntry entry) {
this.buddies.put(Integer.valueOf(entry.getCharacterId()) entry);
}
public void remove(int characterId) {
this.buddies.remove(Integer.valueOf(characterId));
}
public Collection getBuddies() {
return this.buddies.values();
}
public boolean isFull() {
return (this.buddies.size() >= this.capacity);
}
public int[] getBuddyIds() {
int[] buddyIds = new int[this.buddies.size()];
int i = 0;
for (Iterator i$ = this.buddies.values().iterator(); i$.hasNext(); ) { BuddylistEntry ble = (BuddylistEntry)i$.next();
buddyIds[(i++)] = ble.getCharacterId();
}
return buddyIds;
}
public void loadFromDb(int characterId) throws SQLException {
//PreparedStatement ps = null;
// ResultSet rs = null;
try {
PreparedStatement ps = null;
ResultSet rs = null;
ps = DatabaseConnection.getConnection().prepareStatement(“SELECT b.buddyid b.group b.pending c.name as buddyname FROM buddies as b characters as c WHERE c.id =
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1961 2010-05-02 09:29 src\net\sf\cherry\client\anticheat\CheatingOffense.java
文件 2744 2010-05-02 11:43 src\net\sf\cherry\client\anticheat\CheatingOffenseEntry.java
文件 3390 2010-05-02 19:22 src\net\sf\cherry\client\anticheat\CheatingOffensePersister.java
文件 11254 2010-05-02 19:20 src\net\sf\cherry\client\anticheat\CheatTracker.java
文件 4833 2010-05-02 16:13 src\net\sf\cherry\client\BuddyList.java
文件 2273 2010-05-02 10:45 src\net\sf\cherry\client\BuddylistEntry.java
文件 338 2010-05-02 10:45 src\net\sf\cherry\client\CharacterNameAndId.java
文件 7459 2010-05-02 20:35 src\net\sf\cherry\client\Equip.java
文件 3037 2010-04-03 02:27 src\net\sf\cherry\client\ExpTable.java
文件 1283 2010-05-02 10:51 src\net\sf\cherry\client\IEquip.java
文件 1193 2010-04-03 02:27 src\net\sf\cherry\client\IItem.java
文件 179 2010-04-03 02:27 src\net\sf\cherry\client\InventoryContainer.java
文件 363 2010-05-02 10:52 src\net\sf\cherry\client\InventoryException.java
文件 587 2010-04-03 02:27 src\net\sf\cherry\client\ISkill.java
文件 3436 2010-05-02 10:55 src\net\sf\cherry\client\Item.java
文件 1697 2010-04-03 02:27 src\net\sf\cherry\client\LoginCrypto.java
文件 5392 2010-05-02 20:37 src\net\sf\cherry\client\LoginCryptoLegacy.java
文件 2215 2010-05-02 20:41 src\net\sf\cherry\client\MapleBuffStat.java
文件 196423 2010-05-02 20:16 src\net\sf\cherry\client\MapleCharacter.java
文件 1880 2010-04-03 02:27 src\net\sf\cherry\client\MapleCharacterUtil.java
文件 41554 2010-05-02 16:45 src\net\sf\cherry\client\MapleClient.java
文件 5312 2010-05-02 20:42 src\net\sf\cherry\client\MapleCSInventory.java
文件 2098 2010-05-02 20:42 src\net\sf\cherry\client\MapleCSInventoryItem.java
文件 304 2010-04-03 02:27 src\net\sf\cherry\client\MapleDisease.java
文件 1564 2010-04-03 02:27 src\net\sf\cherry\client\MapleFamily.java
文件 1855 2010-04-03 02:27 src\net\sf\cherry\client\MapleFamilyEntry.java
文件 7527 2010-05-02 20:43 src\net\sf\cherry\client\MapleInventory.java
文件 1054 2010-05-03 16:18 src\net\sf\cherry\client\MapleInventoryType.java
文件 4455 2010-05-03 15:50 src\net\sf\cherry\client\MapleJob.java
文件 337 2010-04-03 02:27 src\net\sf\cherry\client\MapleKeyBinding.java
............此处省略468个文件信息
- 上一篇:基于C/S的在线考试系统
- 下一篇:poi 解析excel生成html
评论
共有 条评论