예제 #1
0
	void create_multis_cfg()
	{
	  FILE *multi_idx = open_uo_file( "multi.idx" );
	  FILE *multi_mul = open_uo_file( "multi.mul" );

	  FILE* multis_cfg = fopen( "multis.cfg", "wt" );

	  create_multis_cfg( multi_idx, multi_mul, multis_cfg );

	  fclose( multis_cfg );

	  fclose( multi_idx );
	  fclose( multi_mul );
	}
예제 #2
0
FILE* open_map_file(string name, int map_id) {
	string filename;

	filename = name + tostring(map_id) + ".mul";
	if (uo_mapid == 1 && !FileExists(config.uo_datafile_root + filename)) {
		cerr << "Unable to find UO file: " << filename << ", reading "+name+"0.mul instead." << endl;
		filename = name+"0.mul";
	}
	
	return open_uo_file( filename );
}
예제 #3
0
FILE* open_map_file(std::string name, int map_id)
{
  std::string filename;

  filename = name + Clib::tostring( map_id ) + ".mul";
  if ( uo_mapid == 1 && !Clib::FileExists( Plib::systemstate.config.uo_datafile_root + filename ) )
  {
    ERROR_PRINT << "Unable to find UO file: " << filename << ", reading " + name + "0.mul instead.\n";
    filename = name + "0.mul";
  }

  return open_uo_file( filename );
}
예제 #4
0
void open_uo_data_files( void )
{
    string filename;
    // map1 uses map0 + 'dif' files, unless there is a map1.mul (newer clients)
	// same for staidx and statics
	mapfile  = open_map_file("map", uo_mapid);
	sidxfile = open_map_file("staidx", uo_mapid);
	statfile = open_map_file("statics", uo_mapid);
    
    if (FileExists( (config.uo_datafile_root + "verdata.mul").c_str() ))
    {
        verfile = open_uo_file( "verdata.mul" );
    }
    else
    {
        verfile = NULL; 
    }
    tilefile    = open_uo_file( "tiledata.mul" );

    if (uo_usedif)
    {
        filename = "stadifl" + tostring(uo_mapid) + ".mul";
        if (FileExists( config.uo_datafile_root + filename ))
        {
            stadifl_file = open_uo_file( filename );
            filename = "stadifi" + tostring(uo_mapid) + ".mul";
            stadifi_file = open_uo_file( filename );
            filename = "stadif" + tostring(uo_mapid) + ".mul";
            stadif_file = open_uo_file( filename );
        }
        filename = "mapdifl" + tostring(uo_mapid) + ".mul";
        if (FileExists( config.uo_datafile_root + filename ))
        {
            mapdifl_file = open_uo_file( filename );
            filename = "mapdif" + tostring(uo_mapid) + ".mul";
            mapdif_file = open_uo_file( filename );
        }
    }
}