· 9 years ago · May 12, 2017, 04:50 PM
1/*
2Navicat MySQL Data Transfer
3
4Source Server : localhost
5Source Server Version : 50139
6Source Host : localhost:3306
7Source Database : wonderking
8
9Target Server Type : MYSQL
10Target Server Version : 50139
11File Encoding : 65001
12
13Date: 2010-03-01 22:30:05
14*/
15
16SET FOREIGN_KEY_CHECKS=0;
17-- ----------------------------
18-- Table structure for `accounts`
19-- ----------------------------
20DROP TABLE IF EXISTS `accounts`;
21CREATE TABLE `accounts` (
22 `ID` int(11) NOT NULL DEFAULT '0',
23 `Username` char(32) DEFAULT NULL,
24 `Password` char(20) DEFAULT NULL,
25 PRIMARY KEY (`ID`)
26) ENGINE=InnoDB DEFAULT CHARSET=latin1;
27
28-- ----------------------------
29-- Records of accounts
30-- ----------------------------
31INSERT INTO `accounts` VALUES ('1', 'admin', '123123');
32
33-- ----------------------------
34-- Table structure for `items`
35-- ----------------------------
36DROP TABLE IF EXISTS `items`;
37CREATE TABLE `items` (
38 `PlayerID` smallint(2) NOT NULL DEFAULT '0',
39 `ItemID` smallint(2) DEFAULT NULL,
40 `Count` smallint(2) DEFAULT NULL,
41 `Position` tinyint(1) unsigned DEFAULT NULL,
42 `HasAttributes` tinyint(1) unsigned DEFAULT NULL,
43 `IsEquipment` tinyint(1) unsigned DEFAULT NULL,
44 `Level` tinyint(1) unsigned DEFAULT NULL,
45 `RareType` tinyint(1) unsigned DEFAULT NULL,
46 `AddOption` tinyint(1) unsigned DEFAULT NULL,
47 `AddOption2` tinyint(1) unsigned DEFAULT NULL,
48 `AddOption3` tinyint(1) unsigned DEFAULT NULL,
49 `Option` smallint(2) DEFAULT NULL,
50 `Option2` smallint(2) DEFAULT NULL,
51 `Option3` smallint(2) DEFAULT NULL
52) ENGINE=InnoDB DEFAULT CHARSET=latin1;
53
54-- ----------------------------
55-- Records of items
56-- ----------------------------
57INSERT INTO `items` VALUES ('1', '393', '55', '0', '0', '0', null, null, null, null, null, null, null, null);
58INSERT INTO `items` VALUES ('1', '3222', '1', '0', '1', '0', '11', '3', '1', '6', '4', '152', '24', '36');
59
60-- ----------------------------
61-- Table structure for `players`
62-- ----------------------------
63DROP TABLE IF EXISTS `players`;
64CREATE TABLE `players` (
65 `ID` smallint(6) NOT NULL,
66 `UserID` int(11) NOT NULL,
67 `Name` char(20) NOT NULL,
68 `Level` tinyint(4) unsigned NOT NULL DEFAULT '0',
69 `Money` bigint(20) DEFAULT NULL,
70 `HP` smallint(6) NOT NULL DEFAULT '0',
71 `MP` smallint(6) NOT NULL DEFAULT '0',
72 `MaxHP` smallint(6) NOT NULL DEFAULT '0',
73 `MaxMP` smallint(6) NOT NULL DEFAULT '0',
74 `Map` smallint(6) NOT NULL DEFAULT '0',
75 `Str` smallint(6) NOT NULL DEFAULT '0',
76 `Dex` smallint(6) NOT NULL DEFAULT '0',
77 `Int` smallint(6) NOT NULL DEFAULT '0',
78 `Luck` smallint(6) NOT NULL DEFAULT '0',
79 `Vit` smallint(6) NOT NULL DEFAULT '0',
80 `Wis` smallint(6) NOT NULL DEFAULT '0',
81 `Job1` tinyint(4) unsigned NOT NULL DEFAULT '0',
82 `Job2` tinyint(4) unsigned NOT NULL DEFAULT '0',
83 `Job3` tinyint(4) unsigned NOT NULL DEFAULT '0',
84 `Job4` tinyint(4) unsigned NOT NULL DEFAULT '0',
85 `X` smallint(6) NOT NULL DEFAULT '0',
86 `Y` smallint(6) NOT NULL DEFAULT '0',
87 `Hair` smallint(6) NOT NULL,
88 `Eyes` smallint(6) NOT NULL,
89 `SP` smallint(6) NOT NULL DEFAULT '0',
90 `AP` smallint(6) NOT NULL DEFAULT '0',
91 PRIMARY KEY (`ID`)
92) ENGINE=InnoDB DEFAULT CHARSET=latin1;
93
94-- ----------------------------
95-- Records of players
96-- ----------------------------
97INSERT INTO `players` VALUES ('1', '1', 'Admin', '200', '1000000', '900', '100', '900', '100', '300', '999', '999', '999', '999', '999', '999', '3', '9', '17', '0', '400', '536', '15', '37', '999', '999');
98
99-- ----------------------------
100-- Procedure structure for `ChangePassword`
101-- ----------------------------
102DROP PROCEDURE IF EXISTS `ChangePassword`;
103DELIMITER ;;
104CREATE DEFINER=`root`@`localhost` PROCEDURE `ChangePassword`(IN `User` char(32),IN `Pass` varchar(20))
105BEGIN
106 UPDATE Accounts SET Password = Pass WHERE Username = User;
107END
108;;
109DELIMITER ;
110
111-- ----------------------------
112-- Procedure structure for `FullLogin`
113-- ----------------------------
114DROP PROCEDURE IF EXISTS `FullLogin`;
115DELIMITER ;;
116CREATE DEFINER=`root`@`localhost` PROCEDURE `FullLogin`(IN `User` char(32),IN `Pass` char(20))
117BEGIN
118 select ID from Accounts where Username = User and Password = Pass;
119END
120;;
121DELIMITER ;
122
123-- ----------------------------
124-- Procedure structure for `GetItems`
125-- ----------------------------
126DROP PROCEDURE IF EXISTS `GetItems`;
127DELIMITER ;;
128CREATE DEFINER=`root`@`localhost` PROCEDURE `GetItems`(IN `pID` smallint, IN `bool` tinyint)
129BEGIN
130 select * from Items where PlayerID = pID and IsEquipment = bool;
131END
132;;
133DELIMITER ;
134
135-- ----------------------------
136-- Procedure structure for `GetPlayer`
137-- ----------------------------
138DROP PROCEDURE IF EXISTS `GetPlayer`;
139DELIMITER ;;
140CREATE DEFINER=`root`@`localhost` PROCEDURE `GetPlayer`(IN `uID` int, IN `pName` char(20))
141BEGIN
142 select * from Players where UserID = uID and Name = pName;
143END
144;;
145DELIMITER ;
146
147-- ----------------------------
148-- Procedure structure for `GetPlayers`
149-- ----------------------------
150DROP PROCEDURE IF EXISTS `GetPlayers`;
151DELIMITER ;;
152CREATE DEFINER=`root`@`localhost` PROCEDURE `GetPlayers`(IN `uID` int)
153BEGIN
154 select * from Players where UserID = uID;
155END
156;;
157DELIMITER ;
158
159-- ----------------------------
160-- Procedure structure for `Login`
161-- ----------------------------
162DROP PROCEDURE IF EXISTS `Login`;
163DELIMITER ;;
164CREATE DEFINER=`root`@`localhost` PROCEDURE `Login`(IN User char(32))
165BEGIN
166 select ID,Password from Accounts where Username = User;
167END
168;;
169DELIMITER ;