Page 3 of 5 FirstFirst 12345 LastLast
Results 21 to 30 of 42

Thread: MMDL auto map downloader released for MOHAA

  1. #21

    Default

    well form what I read in the php thing you posted
    if(!mysql_connect($db_server, $db_user, $db_password)) exit("error"); // Just return the word "error" so MMDL understands it
    if(!mysql_select_db($db_database)) exit("error");

    //
    // Get the map link
    //
    $q = mysql_query("
    I can't help I never have figured out that MySQL stuff I just use plain old html on my web site. It's not as good as php and MySQL but it sure is easier. Any changes I make to the maps are done with a script, even with stuff like adding models to the map crates, tables, guns etc. The less people have to download the better.

  2. #22

    Default

    Hi Easy Meat - please post your HTML script removing passwords and links for security - If we can get an easier solution for other users to host their own mini database I will get it add to the mod docs

  3. #23

    Default

    well what I meant was my web site is all html / css pages and I just have the links go to a folder

    <a href="http://www.ezmmwaa.com/downloads/maps/aa/AR_Berlin_V_1_Night.pk3 " ><font color="FFFFFF " font-size= "16">Berlin Night</font></a></tr>
    which doesn't work because it's looking for a MySQL data base. If you just put the link to folder I get an error message in console.
    it's not really a data base like you are using just a web page with the links on it so I don't know if that will work or not. It works in COD 4
    it has this

    // Client Download Settings. (0=off/1=on) Used for MODs and custom maps
    // See included Quick Setup Guide for instructions.
    set sv_allowdownload "1"
    seta sv_wwwDownload "1"
    seta sv_wwwBaseURL "http://www.ezmmwaa.com/downloads/maps/cod4/mp_v2"
    seta sv_wwwDlDisconnected "1"

    all I use is this for people to download the maps.
    http://www.ezmmwaa.com/maps.

  4. #24
    Purple Developer Purple Elephant1au's Avatar
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    1,269

    Default

    Hey guys

    I was just mucking around with the script for the database, and i think i got it. most of it is straight forward, what was lacking from the example was exactly that, an example instead of just xxxxxxxxxx

    From what i could see, the database had 2 tables, one called files, and the other of your choice, i made a little example of one using just the 1 table called files, with the name and filepath as fields.


    <?php

    $db_server = "localhost"; /// insert server name
    $db_user = "root"; /// insert username
    $db_password = ""; /// insert password
    $db_database = "maps"; /// insert database name

    //
    // Connect to the DB
    //
    if(!mysql_connect($db_server, $db_user, $db_password)) exit("error"); // Just return the word "error" so MMDL understands it
    if(!mysql_select_db($db_database)) exit("error");

    //
    // Get the map link
    //
    $query = mysql_query("
    SELECT `files`.`name` AS `file_id`,
    `files`.`filepath` AS `file_path`
    FROM `files`
    WHERE `files`.`name` = '".mysql_real_escape_string($_GET['map'])."'
    LIMIT 1
    ");
    if(!$query) exit("error");

    //
    // Return the link
    //
    $record = mysql_fetch_assoc($query);

    if (!$record) {
    $message = 'Invalid query: ' . mysql_error() . "\n";
    $message .= 'Whole query: ' . $query;
    die($message);
    }

    if(!$record) exit("404"); // MMDL understands "404" too
    exit("http://www.eggplant.com.au/uploads/banana/".str_replace(" ", "%20", $record['file_path'])); /// replace with url of actual files.
    ?>



    With the following little table and sample data

    CREATE TABLE IF NOT EXISTS `files` (
    `id` int(11) PRIMARY KEY NOT NULL AUTO_INCREMENT,
    `name` varchar(30) NOT NULL,
    `filepath` varchar(30) NOT NULL
    );

    INSERT INTO files (name, filepath)
    VALUES
    ('dm/mohdm1', 'dm/mohdm1.pk3'),
    ('dm/mohdm2', 'dm/mohdm2.pk3'),
    ('dm/mohdm3', 'dm/mohdm3.pk3'),
    ('dm/mohdm4', 'dm/mohdm4.pk3'),
    ('dm/mohdm5', 'dm/mohdm5.pk3'),
    ('dm/mohdm6', 'dm/mohdm6.pk3');


    you can call the script whatever you want, but guide the MMDL url to the correct script
    I was testing on localhost

    http://localhost/download/index.php?map=dm/mohdm2

    BOLD parts would be the base url , and then it adds the name it needs.

    But i do not see why it really even needs the database, for small collections anyway. I can see why it would need them in bigger databases with thousands of maps, but if you are hosting your own, you really dont need it.

    Just a basic script that will turn the map name into the filepath, ie if you call each map.pk3 the name of the map. dm/mohdm1 would be dm/mohdm1.pk3 .

    Example

    <?php
    $map = $_GET['map'];
    exit("http://www.eggplant.com.au/uploads/banana/".str_replace(" ", "%20", $map).'.pk3');
    ?>

    Would suffice.
    Last edited by Purple Elephant1au; December 17th, 2014 at 02:05 PM.

    Purple's Playground
    OBJ :
    103.29.85.127:12203
    xfire: purpleelephant1au
    email: purpleelephant1au@gmail.com
    skydrive: PurpleElephantSkydrive




  5. #25

    Default

    Thanks Purple hope this helps you guys - as said the script was written for AAAA database so it has extra code - I removed a lot of things for security reasons

  6. #26

    Default

    This is related to the last posts in this thread, but If you want to install MMDL really easily, check this out:

    http://www.x-null.net/forums/showthr...-All-in-One%29
    Browse MOHAA Servers Post GameSpy Era

    VISIT MOHREBORN.COM FOR LATEST INFORMATION



    Medal of Honor: Game Server Browser Fixer - Patches your MOHAA, MOHSH, and MOHBT game binaries to allow you to retrieve a list of game servers within the multi-player menu in-game even after GameSpy ceases operation!

    Medal of Honor: Query Launcher - Find, browse, organize, join, get your ping, and get more information regarding all Medal of Honor (AA, SH, & BT) servers from your PC at any time!
    Medal of Honor: Web Server Master List - Find and browse all Medal of Honor servers online using your browser!
    Add your Medal of Honor Server to the Master List
    YouTube Video for Medal of Honor: Query Launcher and MOHAASERVERS.TK!



    MOHAA Mods and Utilities
    OwN-3m-All's Mods
    Make Me Stock - A program that allows you to easily move-in and move-out non-stock mods and other files at the click of a button. Automates adding / removing mods without having to copy / move files manually.



    Quality Game Servers

    Rent dedicated Dallas Texas, Kansas City, Las Vegas Nevada, Chicago, Pennsylvania, and Sofia Bulgaria MOHAA and other game servers from We Be HostiN starting at $10 a month.


  7. #27

    Default

    Quote Originally Posted by Purple Elephant1au View Post
    Hey guys

    I was just mucking around with the script for the database, and i think i got it. most of it is straight forward, what was lacking from the example was exactly that, an example instead of just xxxxxxxxxx

    From what i could see, the database had 2 tables, one called files, and the other of your choice, i made a little example of one using just the 1 table called files, with the name and filepath as fields.


    <?php

    $db_server = "localhost"; /// insert server name
    $db_user = "root"; /// insert username
    $db_password = ""; /// insert password
    $db_database = "maps"; /// insert database name

    //
    // Connect to the DB
    //
    if(!mysql_connect($db_server, $db_user, $db_password)) exit("error"); // Just return the word "error" so MMDL understands it
    if(!mysql_select_db($db_database)) exit("error");

    //
    // Get the map link
    //
    $query = mysql_query("
    SELECT `files`.`name` AS `file_id`,
    `files`.`filepath` AS `file_path`
    FROM `files`
    WHERE `files`.`name` = '".mysql_real_escape_string($_GET['map'])."'
    LIMIT 1
    ");
    if(!$query) exit("error");

    //
    // Return the link
    //
    $record = mysql_fetch_assoc($query);

    if (!$record) {
    $message = 'Invalid query: ' . mysql_error() . "\n";
    $message .= 'Whole query: ' . $query;
    die($message);
    }

    if(!$record) exit("404"); // MMDL understands "404" too
    exit("http://www.eggplant.com.au/uploads/banana/".str_replace(" ", "%20", $record['file_path'])); /// replace with url of actual files.
    ?>



    With the following little table and sample data

    CREATE TABLE IF NOT EXISTS `files` (
    `id` int(11) PRIMARY KEY NOT NULL AUTO_INCREMENT,
    `name` varchar(30) NOT NULL,
    `filepath` varchar(30) NOT NULL
    );

    INSERT INTO files (name, filepath)
    VALUES
    ('dm/mohdm1', 'dm/mohdm1.pk3'),
    ('dm/mohdm2', 'dm/mohdm2.pk3'),
    ('dm/mohdm3', 'dm/mohdm3.pk3'),
    ('dm/mohdm4', 'dm/mohdm4.pk3'),
    ('dm/mohdm5', 'dm/mohdm5.pk3'),
    ('dm/mohdm6', 'dm/mohdm6.pk3');


    you can call the script whatever you want, but guide the MMDL url to the correct script
    I was testing on localhost

    http://localhost/download/index.php?map=dm/mohdm2

    BOLD parts would be the base url , and then it adds the name it needs.

    But i do not see why it really even needs the database, for small collections anyway. I can see why it would need them in bigger databases with thousands of maps, but if you are hosting your own, you really dont need it.

    Just a basic script that will turn the map name into the filepath, ie if you call each map.pk3 the name of the map. dm/mohdm1 would be dm/mohdm1.pk3 .

    Example

    <?php
    $map = $_GET['map'];
    exit("http://www.eggplant.com.au/uploads/banana/".str_replace(" ", "%20", $map).'.pk3');
    ?>

    Would suffice.

    Good afternoon,

    I have some custom maps (modified textures and changed names to maps, only file name), and I read in this forum, and I modify in the server.cfg file, I put sets mmdl_database_url "http: //XXXX/Autodownload_mapas.php map =" where web.php and database is locate on an external server where the game. But when you start the game and get a custom map, the client shows him for a moment "searching database" and then "error, check console". What's happen? I've seen the default file mmdl.dll calls mohaaaa.cc.uk but presumably by setting mmdl_database_url, creating the database with the map name and filepath, and should go find my site where I have my files of maps. What am I doing wrong? I can modify mmdl.dll and change mmdl_database_url if i don't have any original map?

  8. #28
    Über Prodigy & Developer Razo[R]apiD's Avatar
    Join Date
    May 2010
    Location
    Poland, Lublin
    Posts
    3,257

    Default

    Do you set it with sets command?

  9. #29

    Default

    Quote Originally Posted by Razo[R]apiD View Post
    Do you set it with sets command?

    Yes! If I put a orignal map, the game search in a mohaaaa.cc.uk ... :S

  10. #30
    Über Prodigy & Developer Razo[R]apiD's Avatar
    Join Date
    May 2010
    Location
    Poland, Lublin
    Posts
    3,257

    Default

    Type cvar_list in the console of your server and post results here.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •