Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
VIPAddMapHandler.java
Package: src.rar [view]
Upload User: gwt600
Upload Date: 2021-06-03
Package Size: 704k
Code Size: 2k
Category:
Games
Development Platform:
Java
- package net.sf.odinms.net.channel.handler;
- import java.sql.Connection;
- import java.sql.PreparedStatement;
- import java.sql.SQLException;
- import net.sf.odinms.client.MapleCharacter;
- import net.sf.odinms.client.MapleClient;
- import net.sf.odinms.database.DatabaseConnection;
- import net.sf.odinms.net.AbstractMaplePacketHandler;
- import net.sf.odinms.tools.MaplePacketCreator;
- import net.sf.odinms.tools.Pair;
- import net.sf.odinms.tools.data.input.SeekableLittleEndianAccessor;
- import org.slf4j.Logger;
- import org.slf4j.LoggerFactory;
- /**
- *
- * @author XoticMS
- */
- public class VIPAddMapHandler extends AbstractMaplePacketHandler {
- private static Logger log = LoggerFactory.getLogger(VIPAddMapHandler.class);
- @Override
- public void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
- c.getPlayer().resetAfkTime();
- Connection con = DatabaseConnection.getConnection();
- int operation = slea.readByte();
- int type = slea.readByte();
- MapleCharacter player = c.getPlayer();
- switch (operation) {
- case 0: // Remove map
- int mapid = slea.readInt();
- try {
- PreparedStatement ps = con.prepareStatement("DELETE FROM VIPRockMaps WHERE cid = ? AND mapid = ? AND type = ?");
- ps.setInt(1, player.getId());
- ps.setInt(2, mapid);
- ps.setInt(3, type);
- ps.executeUpdate();
- ps.close();
- } catch (SQLException lawl) {
- }
- break;
- case 1: // Add map
- try {
- PreparedStatement ps = con.prepareStatement("INSERT INTO VIPRockMaps (`cid`, `mapid`, `type`) VALUES (?, ?, ?)");
- ps.setInt(1, player.getId());
- ps.setInt(2, player.getMapId());
- ps.setInt(3, type);
- ps.executeUpdate();
- ps.close();
- } catch (SQLException lawl) {
- }
- break;
- default:
- log.info("Unhandled VIP Rock operation: " + slea.toString());
- break;
- }
- c.getSession().write(MaplePacketCreator.refreshVIPRockMapList(player.getVIPRockMaps(type), type));
- }
- }