void
load_saved_city (char *s)
{
    char *cname = (char *) malloc (strlen (lc_save_dir) + strlen (s) + 2);
    sprintf (cname, "%s%c%s", lc_save_dir, PATH_SLASH, s);
    load_city (cname);
    free (cname);
}
/*
 * Load City and do setup for Lincity NG.
 */
bool loadCityNG( std::string filename ){
    if( file_exists( const_cast<char*>( filename.c_str()) ) ){
        load_city(const_cast<char*>(filename.c_str()));
        update_avail_modules(0);
        GameView* gv = getGameView();
        if( gv ){ gv->readOrigin(); }
        return true;
    }
    return false;
}
Esempio n. 3
0
/* Start up game with new dungeons; start with player in city */
void init_world(void)
{
  int env, i;

  City = Level = TempLevel = Dungeon = NULL;
  for (env = 0; env <= E_MAX; env++)
    level_seed[env] = RANDFUNCTION();
  load_country();
  for(i=0;i<NUMCITYSITES;i++) 
    CitySiteList[i][0] = FALSE;
  load_city(TRUE);
  Level = City;
  Current_Environment = E_CITY;
  setPlayerXY(62, 20);
  print1("You pass through the massive gates of Rampart, the city.");  
  screencheck(Player.x, Player.y);
}
Esempio n. 4
0
int
main (int argc, char *argv[])
{
    char* load_filename;

    /* Initialize some global variables */
    initialize_server ();

    /* Set up the paths to certain files and directories */
    init_path_strings ();

#ifndef CS_PROFILE
#ifdef SEED_RAND
    srand (time (0));
#endif
#endif

    init_types ();
    initialize_tax_rates ();

    reset_start_time ();

    load_filename = parse_server_args (argc, argv);
    if (load_filename && file_exists(load_filename)) {
	printf ("Server is trying to load: %s\n", load_filename);
	load_city (load_filename);
	zoom_originx = main_screen_originx;
	zoom_originy = main_screen_originy;
    } else {
	engine_new_city (&zoom_originx, &zoom_originy, 1);
    }

    printf ("Server starting main loop!\n");
    while (1) {
	sniff_packets ();
	engine_do_time_step ();
	get_real_time ();
	send_periodic_messages ();
	if (total_time % 1000 == 0) {
	    debug_print_stats ();
	}
    }

    return 0;
}