Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Release] NPC Loading from MCDB

Skilled Illusionist
Joined
Jul 28, 2009
Messages
339
Reaction score
200
Code:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Database.Information.Loading;

import Database.DatabaseConnection;
import Database.Information.Loading.Holders.Flags.NpcFlags;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;

/**
 *
 * @author Jay Estrella
 */
public class NpcDataProvider {
    private static Map<Integer, NpcInfo> npcInfo = new HashMap<Integer, NpcInfo>();
    public static void loadData() {
        Connection con = DatabaseConnection.getMCDB();
        try {
            PreparedStatement ps = con.prepareStatement("SELECT * FROM npc_data");
            ResultSet rs = ps.executeQuery();
            while (rs.next()) {
                NpcInfo info = new NpcInfo();
                int npcId = rs.getInt("id");
                info.storageCost = rs.getInt("storage_cost");
                info.flags = new NpcFlags(rs.getString("flags"));
                npcInfo.put(npcId, info);
            }
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }

    public static class NpcInfo {
        private int storageCost;
        private NpcFlags flags;

        private NpcInfo() {
        }

        public int getStorageCost() {
            return storageCost;
        }

        public NpcFlags getFlags() {
            return flags;
        }
    }
}
Pre-release for Orion.
 
bleh....
Loyal Member
Joined
Oct 15, 2008
Messages
2,898
Reaction score
1,129
Yes, let's release something which will die out in a few days, and half the community won't know how to use!!!!

Considering that's how most of the releases are, why the hell does it matter? At least he's doing something productive.
 
Junior Spellweaver
Joined
Nov 12, 2009
Messages
163
Reaction score
7
Lol I still don't know what an MCDB is?

MCDB file is a Media Cache Database. MCDB file records the location of cache files and related media files. This media cache database is shared with Adobe Premiere Pro, Adobe Encore, and Adobe Soundbooth.
 
Skilled Illusionist
Joined
Jul 28, 2009
Messages
339
Reaction score
200
MCDB file is a Media Cache Database. MCDB file records the location of cache files and related media files. This media cache database is shared with Adobe Premiere Pro, Adobe Encore, and Adobe Soundbooth.

Maple Community Database

---------- Post added at 10:34 PM ---------- Previous post was at 10:32 PM ----------

Yes, let's release something which will die out in a few days, and half the community won't know how to use!!!!

I'm giving it out for the reason that barely any people will know how to use it. Even though it only takes 1 line to make it do everything. I know some people who want it, if it happens that some random wants it they won't have to waste their time writing out tons of lines.
 
Back
Top