00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include <stdio.h>
00028 #include <stdlib.h>
00029 #include <string.h>
00030 #include <sqlite3.h>
00031 #include <libsqlitewrapped.h>
00032 #include <map>
00033
00034 #include <vector>
00035 #include <string>
00036
00037 #ifndef _LIBFUTURE_H
00038 #define _LIBFUTURE_H
00039
00040 #ifdef _WIN32
00041 #define strncasecmp strnicmp
00042 #define strcasecmp stricmp
00043 #endif // _WIN32
00044
00049 namespace db
00050 {
00051 class Account {
00052 public:
00053 Account(Database *);
00054 Account(Database *,const std::string& );
00055 Account(Database *,Query *,int = 0 );
00056 Account(Database&,long num);
00057 Account(Database&,const std::string& name);
00058 ~Account();
00059 Database& GetDatabase() { return *database; }
00060
00061 unsigned long long int insert();
00062 void update();
00063 void save();
00064 void erase();
00065 std::string xml();
00066 std::string xml(const std::string& ,const std::string& );
00067 size_t num_cols();
00068
00069
00070 long num;
00071 std::string name;
00072 std::string passwd;
00073 std::string display_name;
00074 char wizard;
00075 std::string email;
00076 long area;
00077 long chunk;
00078 long chunkx;
00079 long chunky;
00080 long facing;
00081 long wizview;
00082 long race;
00083
00084 private:
00085 void clear();
00086 void spawn(const std::string& );
00087 void spawn(Query *,int = 0 );
00088 void select(const std::string& );
00089 void update(long num);
00090
00091 Database *database;
00092 short new_object;
00093 };
00094
00095 }
00096
00101 namespace db
00102 {
00103 class Eventcount {
00104 public:
00105 Eventcount(Database *);
00106 Eventcount(Database *,const std::string& );
00107 Eventcount(Database *,Query *,int = 0 );
00108 Eventcount(Database&,long num);
00109 Eventcount(Database&,const std::string& event_name);
00110 ~Eventcount();
00111 Database& GetDatabase() { return *database; }
00112
00113 unsigned long long int insert();
00114 void update();
00115 void save();
00116 void erase();
00117 std::string xml();
00118 std::string xml(const std::string& ,const std::string& );
00119 size_t num_cols();
00120
00121
00122 long num;
00123 std::string event_name;
00124 long count;
00125
00126 private:
00127 void clear();
00128 void spawn(const std::string& );
00129 void spawn(Query *,int = 0 );
00130 void select(const std::string& );
00131 void update(long num);
00132
00133 Database *database;
00134 short new_object;
00135 };
00136
00137 }
00138
00143 namespace db
00144 {
00145 class Area {
00146 public:
00147 Area(Database *);
00148 Area(Database *,const std::string& );
00149 Area(Database *,Query *,int = 0 );
00150 Area(Database&,long num);
00151 Area(Database&,const std::string& name);
00152 ~Area();
00153 Database& GetDatabase() { return *database; }
00154
00155 unsigned long long int insert();
00156 void update();
00157 void save();
00158 void erase();
00159 std::string xml();
00160 std::string xml(const std::string& ,const std::string& );
00161 size_t num_cols();
00162
00163
00164 long num;
00165 std::string name;
00166 long width;
00167 long height;
00168
00169 private:
00170 void clear();
00171 void spawn(const std::string& );
00172 void spawn(Query *,int = 0 );
00173 void select(const std::string& );
00174 void update(long num);
00175
00176 Database *database;
00177 short new_object;
00178 };
00179
00180 }
00181
00186 namespace db
00187 {
00188 class Chunk {
00189 public:
00190 Chunk(Database *);
00191 Chunk(Database *,const std::string& );
00192 Chunk(Database *,Query *,int = 0 );
00193 Chunk(Database&,long num);
00194 Chunk(Database&,long area,long x,long y,long z);
00195 ~Chunk();
00196 Database& GetDatabase() { return *database; }
00197
00198 unsigned long long int insert();
00199 void update();
00200 void save();
00201 void erase();
00202 std::string xml();
00203 std::string xml(const std::string& ,const std::string& );
00204 size_t num_cols();
00205
00206
00207 long num;
00208 long area;
00209 std::string terrain;
00210 long x;
00211 long y;
00212 long z;
00213 long created_by;
00214 std::string created_date;
00215
00216 private:
00217 void clear();
00218 void spawn(const std::string& );
00219 void spawn(Query *,int = 0 );
00220 void select(const std::string& );
00221 void update(long num);
00222
00223 Database *database;
00224 short new_object;
00225 };
00226
00227 }
00228
00233 namespace db
00234 {
00235 class Chunkinfo {
00236 public:
00237 Chunkinfo(Database *);
00238 Chunkinfo(Database *,const std::string& );
00239 Chunkinfo(Database *,Query *,int = 0 );
00240 Chunkinfo(Database&,long num);
00241 Chunkinfo(Database&,long chunk,long type,long x,long y);
00242 ~Chunkinfo();
00243 Database& GetDatabase() { return *database; }
00244
00245 unsigned long long int insert();
00246 void update();
00247 void save();
00248 void erase();
00249 std::string xml();
00250 std::string xml(const std::string& ,const std::string& );
00251 size_t num_cols();
00252
00253
00254 long num;
00255 long chunk;
00256 long type;
00257 long x;
00258 long y;
00259 std::string data;
00260 long to_area;
00261 long to_chunk;
00262 long to_x;
00263 long to_y;
00264
00265 private:
00266 void clear();
00267 void spawn(const std::string& );
00268 void spawn(Query *,int = 0 );
00269 void select(const std::string& );
00270 void update(long num);
00271
00272 Database *database;
00273 short new_object;
00274 };
00275
00276 }
00277
00282 namespace db
00283 {
00284 class Terrain {
00285 public:
00286 Terrain(Database *);
00287 Terrain(Database *,const std::string& );
00288 Terrain(Database *,Query *,int = 0 );
00289 Terrain(Database&,long num);
00290 Terrain(Database&,long area,const std::string& tchar);
00291 ~Terrain();
00292 Database& GetDatabase() { return *database; }
00293
00294 unsigned long long int insert();
00295 void update();
00296 void save();
00297 void erase();
00298 std::string xml();
00299 std::string xml(const std::string& ,const std::string& );
00300 size_t num_cols();
00301
00302
00303 long num;
00304 long area;
00305 std::string name;
00306 std::string tchar;
00307 std::string tcolor;
00308 long impassable;
00309 double delay;
00310
00311 private:
00312 void clear();
00313 void spawn(const std::string& );
00314 void spawn(Query *,int = 0 );
00315 void select(const std::string& );
00316 void update(long num);
00317
00318 Database *database;
00319 short new_object;
00320 };
00321
00322 }
00323
00328 namespace db
00329 {
00330 class Steps {
00331 public:
00332 Steps(Database *);
00333 Steps(Database *,const std::string& );
00334 Steps(Database *,Query *,int = 0 );
00335 Steps(Database&,long num);
00336 Steps(Database&,long player,long area,long zcoord,long ycoord);
00337 ~Steps();
00338 Database& GetDatabase() { return *database; }
00339
00340 unsigned long long int insert();
00341 void update();
00342 void save();
00343 void erase();
00344 std::string xml();
00345 std::string xml(const std::string& ,const std::string& );
00346 size_t num_cols();
00347
00348
00349 long num;
00350 long player;
00351 long area;
00352 long zcoord;
00353 long ycoord;
00354 std::string xcoords;
00355
00356 private:
00357 void clear();
00358 void spawn(const std::string& );
00359 void spawn(Query *,int = 0 );
00360 void select(const std::string& );
00361 void update(long num);
00362
00363 Database *database;
00364 short new_object;
00365 };
00366
00367 }
00368
00373 namespace db
00374 {
00375 class Race {
00376 public:
00377 Race(Database *);
00378 Race(Database *,const std::string& );
00379 Race(Database *,Query *,int = 0 );
00380 Race(Database&,long num);
00381 Race(Database&,const std::string& name);
00382 ~Race();
00383 Database& GetDatabase() { return *database; }
00384
00385 unsigned long long int insert();
00386 void update();
00387 void save();
00388 void erase();
00389 std::string xml();
00390 std::string xml(const std::string& ,const std::string& );
00391 size_t num_cols();
00392
00393
00394 long num;
00395 std::string name;
00396 double sightrange;
00397 double hearing;
00398
00399 private:
00400 void clear();
00401 void spawn(const std::string& );
00402 void spawn(Query *,int = 0 );
00403 void select(const std::string& );
00404 void update(long num);
00405
00406 Database *database;
00407 short new_object;
00408 };
00409
00410 }
00411 #endif // _LIBFUTURE_H