|
Galactic Bloodshed
|
#include "gb/files_shl.h"#include <fcntl.h>#include <sqlite3.h>#include <sys/stat.h>#include <unistd.h>#include <cerrno>#include <cstdio>#include <cstdlib>#include <cstring>#include <iostream>#include <memory>#include <stdexcept>#include "gb/files.h"#include "gb/files_rw.h"#include "gb/power.h"#include "gb/races.h"#include "gb/ships.h"#include "gb/tweakables.h"#include "gb/vars.h"Go to the source code of this file.
Functions | |
| static void | start_bulk_insert () |
| static void | end_bulk_insert () |
| void | close_file (int fd) |
| void | initsqldata () |
| void | openstardata (int *fd) |
| void | openshdata (int *fd) |
| void | opencommoddata (int *fd) |
| void | openracedata (int *fd) |
| void | getsdata (struct stardata *S) |
| void | getrace (Race **r, int rnum) |
| void | getstar (startype **s, int star) |
| Planet | getplanet (const starnum_t star, const planetnum_t pnum) |
| Sector | getsector (const Planet &p, const int x, const int y) |
| SectorMap | getsmap (const Planet &p) |
| std::optional< Ship > | getship (const shipnum_t shipnum) |
| std::optional< Ship > | getship (Ship **s, const shipnum_t shipnum) |
| int | getcommod (commodtype **c, commodnum_t commodnum) |
| int | getdeadship () |
| int | getdeadcommod () |
| void | putsdata (struct stardata *S) |
| void | putrace (Race *r) |
| void | putstar (startype *s, starnum_t snum) |
| void | putplanet (const Planet &p, startype *star, const int pnum) |
| void | putsector (const Sector &s, const Planet &p, const int x, const int y) |
| void | putsmap (SectorMap &map, Planet &p) |
| static void | putship_aimed (const Ship &s) |
| static void | putship_mind (const Ship &s) |
| static void | putship_pod (const Ship &s) |
| static void | putship_timer (const Ship &s) |
| static void | putship_impact (const Ship &s) |
| static void | putship_trigger (const Ship &s) |
| static void | putship_terraform (const Ship &s) |
| static void | putship_transport (const Ship &s) |
| static void | putship_waste (const Ship &s) |
| void | putship (Ship *s) |
| void | putcommod (commodtype *c, int commodnum) |
| int | Numraces () |
| shipnum_t | Numships () |
| int | Numcommods () |
| int | Newslength (int type) |
| void | clr_shipfree () |
| void | clr_commodfree () |
| void | makeshipdead (int shipnum) |
| void | makecommoddead (int commodnum) |
| void | Putpower (struct power p[MAXPLAYERS]) |
| void | Getpower (struct power p[MAXPLAYERS]) |
| void | Putblock (struct block b[MAXPLAYERS]) |
| void | Getblock (struct block b[MAXPLAYERS]) |
Variables | |
| static int | commoddata |
| static int | racedata |
| static int | shdata |
| static int | stdata |
| sqlite3 * | dbconn |
| void close_file | ( | int | fd | ) |
Definition at line 40 of file files_shl.cc.
Referenced by Getblock(), getdeadcommod(), getdeadship(), Getpower(), makecommoddead(), makeshipdead(), Putblock(), Putpower(), and Db::~Db().
| void clr_commodfree | ( | ) |
Definition at line 1572 of file files_shl.cc.
Referenced by do_turn().
| void clr_shipfree | ( | ) |
Definition at line 1570 of file files_shl.cc.
Referenced by do_turn().
|
static |
Definition at line 929 of file files_shl.cc.
References dbconn.
Referenced by putplanet(), putship(), putsmap(), and putstar().
| void Getblock | ( | struct block | b[MAXPLAYERS] | ) |
Definition at line 1661 of file files_shl.cc.
References close_file().
| int getcommod | ( | commodtype ** | c, |
| commodnum_t | commodnum | ||
| ) |
Definition at line 730 of file files_shl.cc.
References commoddata.
Referenced by bid(), and do_turn().
| int getdeadcommod | ( | ) |
Definition at line 777 of file files_shl.cc.
References close_file().
Referenced by sell().
| int getdeadship | ( | ) |
Definition at line 751 of file files_shl.cc.
References close_file().
Referenced by create_ship_by_planet(), and create_ship_by_ship().
| Planet getplanet | ( | const starnum_t | star, |
| const planetnum_t | pnum | ||
| ) |
Definition at line 335 of file files_shl.cc.
References dbconn.
Referenced by arm(), bid(), bless(), bombard(), build(), capture(), anonymous_namespace{colonies.cc}::colonies_at_star(), cs(), defend(), DispShip(), dissolve(), distance(), do_analysis(), do_turn(), dump(), enroll_valid_race(), exploration(), fire(), fix(), getplace2(), give_orders(), insurgency(), land(), launch(), load(), main(), map(), mk_expl_aimed_at(), mobilize(), move_popn(), orbit(), plan_getrships(), anonymous_namespace{production.cc}::production_at_star(), proj_fuel(), repair(), route(), scrap(), sell(), start_shiplist(), survey(), tax(), anonymous_namespace{tech_status.cc}::tech_report_star(), technology(), toxicity(), transfer(), and walk().
| void Getpower | ( | struct power | p[MAXPLAYERS] | ) |
Definition at line 1637 of file files_shl.cc.
References close_file().
| void getrace | ( | Race ** | r, |
| int | rnum | ||
| ) |
Definition at line 276 of file files_shl.cc.
References racedata.
| void getsdata | ( | struct stardata * | S | ) |
Definition at line 272 of file files_shl.cc.
References stdata.
Referenced by allocateAPs(), colonies(), deductAPs(), dissolve(), do_turn(), dump(), enroll_valid_race(), exploration(), launch(), main(), production(), start_shiplist(), and tech_status().
Definition at line 480 of file files_shl.cc.
References dbconn.
Referenced by arm(), build(), capture(), defend(), do_merchant(), land(), load(), move_popn(), scrap(), and walk().
Definition at line 560 of file files_shl.cc.
Definition at line 564 of file files_shl.cc.
Definition at line 522 of file files_shl.cc.
References dbconn.
Referenced by bombard(), defend(), dissolve(), do_analysis(), do_meta_infect(), domissile(), doplanet(), enroll_valid_race(), land(), main(), Makestar(), repair(), revolt(), show_map(), and survey().
| void getstar | ( | startype ** | s, |
| int | star | ||
| ) |
Definition at line 281 of file files_shl.cc.
References dbconn, and stdata.
Referenced by allocateAPs(), bless(), anonymous_namespace{colonies.cc}::colonies_at_star(), deductAPs(), dissolve(), do_turn(), dump(), enroll_valid_race(), exploration(), main(), mk_expl_aimed_at(), name(), page(), anonymous_namespace{production.cc}::production_at_star(), send_message(), start_shiplist(), and tech_status().
| void initsqldata | ( | ) |
Definition at line 42 of file files_shl.cc.
References dbconn.
Referenced by main().
| void makecommoddead | ( | int | commodnum | ) |
Definition at line 1601 of file files_shl.cc.
References close_file().
Referenced by do_turn().
| void makeshipdead | ( | int | shipnum | ) |
Definition at line 1577 of file files_shl.cc.
References close_file().
Referenced by do_turn().
| int Newslength | ( | int | type | ) |
Definition at line 1540 of file files_shl.cc.
| int Numcommods | ( | ) |
Definition at line 1533 of file files_shl.cc.
References commoddata.
Referenced by bid(), do_turn(), and sell().
| int Numraces | ( | ) |
Definition at line 1509 of file files_shl.cc.
References racedata.
Referenced by enroll_valid_race(), and main().
| shipnum_t Numships | ( | ) |
Definition at line 1516 of file files_shl.cc.
References dbconn.
Referenced by create_ship_by_planet(), create_ship_by_ship(), dissolve(), do_trip(), do_turn(), enroll_valid_race(), main(), and rst().
| void opencommoddata | ( | int * | fd | ) |
Definition at line 256 of file files_shl.cc.
Referenced by Db::Db().
| void openracedata | ( | int * | fd | ) |
Definition at line 264 of file files_shl.cc.
Referenced by Db::Db().
| void openshdata | ( | int * | fd | ) |
Definition at line 248 of file files_shl.cc.
Referenced by Db::Db().
| void openstardata | ( | int * | fd | ) |
Definition at line 239 of file files_shl.cc.
Referenced by Db::Db().
| void Putblock | ( | struct block | b[MAXPLAYERS] | ) |
Definition at line 1649 of file files_shl.cc.
References close_file().
Referenced by do_turn(), invite(), motto(), name(), and pledge().
| void putcommod | ( | commodtype * | c, |
| int | commodnum | ||
| ) |
Definition at line 1504 of file files_shl.cc.
References commoddata.
Referenced by bid(), do_turn(), and sell().
Definition at line 934 of file files_shl.cc.
References dbconn, end_bulk_insert(), and start_bulk_insert().
Referenced by arm(), bless(), bombard(), build(), capture(), defend(), dissolve(), do_turn(), dump(), enroll_valid_race(), fix(), give_orders(), land(), launch(), load(), main(), Makestar(), mk_expl_aimed_at(), mobilize(), move_popn(), repair(), route(), scrap(), sell(), tax(), technology(), toxicity(), transfer(), and walk().
| void Putpower | ( | struct power | p[MAXPLAYERS] | ) |
Definition at line 1625 of file files_shl.cc.
References close_file().
Referenced by do_turn().
| void putrace | ( | Race * | r | ) |
Definition at line 808 of file files_shl.cc.
References racedata.
Referenced by arm(), bless(), capital(), capture(), cs(), declare(), dissolve(), enroll_valid_race(), grant(), highlight(), insurgency(), main(), move_popn(), name(), news_read(), pay(), send_message(), toggle(), unload_onto_alien_sector(), vote(), and walk().
| void putsdata | ( | struct stardata * | S | ) |
Definition at line 804 of file files_shl.cc.
References stdata.
Referenced by allocateAPs(), build(), deductAPs(), do_turn(), launch(), and main().
Definition at line 1076 of file files_shl.cc.
References dbconn.
Referenced by arm(), build(), capture(), enroll_valid_race(), land(), load(), main(), move_popn(), putsmap(), repair(), scrap(), and walk().
| void putship | ( | Ship * | s | ) |
Definition at line 1317 of file files_shl.cc.
References dbconn, end_bulk_insert(), putship_aimed(), putship_impact(), putship_mind(), putship_pod(), putship_terraform(), putship_timer(), putship_transport(), putship_trigger(), putship_waste(), shdata, and start_bulk_insert().
Referenced by bombard(), build(), capture(), defend(), do_transporter(), do_turn(), domine(), enroll_valid_race(), fire(), give_orders(), grant(), jettison(), land(), launch(), load(), main(), mech_defend(), mount(), scrap(), and walk().
|
static |
Definition at line 1121 of file files_shl.cc.
References dbconn.
Referenced by putship().
|
static |
Definition at line 1214 of file files_shl.cc.
References dbconn.
Referenced by putship().
|
static |
Definition at line 1146 of file files_shl.cc.
References dbconn.
Referenced by putship().
|
static |
Definition at line 1173 of file files_shl.cc.
References dbconn.
Referenced by putship().
|
static |
Definition at line 1256 of file files_shl.cc.
References dbconn.
Referenced by putship().
|
static |
Definition at line 1194 of file files_shl.cc.
References dbconn.
Referenced by putship().
|
static |
Definition at line 1276 of file files_shl.cc.
References dbconn.
Referenced by putship().
|
static |
Definition at line 1236 of file files_shl.cc.
References dbconn.
Referenced by putship().
|
static |
Definition at line 1296 of file files_shl.cc.
References dbconn.
Referenced by putship().
Definition at line 1108 of file files_shl.cc.
References end_bulk_insert(), putsector(), and start_bulk_insert().
Referenced by bombard(), defend(), dissolve(), do_meta_infect(), domissile(), doplanet(), land(), Makeplanet(), and revolt().
Definition at line 813 of file files_shl.cc.
References dbconn, end_bulk_insert(), start_bulk_insert(), and stdata.
Referenced by allocateAPs(), bless(), build(), deductAPs(), dissolve(), do_turn(), dump(), enroll_valid_race(), grant(), main(), mk_expl_aimed_at(), and name().
|
static |
Definition at line 924 of file files_shl.cc.
References dbconn.
Referenced by putplanet(), putship(), putsmap(), and putstar().
|
static |
Definition at line 33 of file files_shl.cc.
Referenced by Db::Db(), getcommod(), Numcommods(), putcommod(), and Db::~Db().
| sqlite3* dbconn |
Definition at line 35 of file files_shl.cc.
Referenced by end_bulk_insert(), getplanet(), getsector(), getship(), getsmap(), getstar(), initsqldata(), Numships(), putplanet(), putsector(), putship(), putship_aimed(), putship_impact(), putship_mind(), putship_pod(), putship_terraform(), putship_timer(), putship_transport(), putship_trigger(), putship_waste(), putstar(), Sql::Sql(), and start_bulk_insert().
|
static |
Definition at line 33 of file files_shl.cc.
Referenced by Db::Db(), getrace(), Numraces(), putrace(), and Db::~Db().
|
static |
|
static |
Definition at line 33 of file files_shl.cc.
Referenced by Db::Db(), getsdata(), getstar(), putsdata(), putstar(), and Db::~Db().
1.8.13