project reality header
Go Back   Project Reality Forums > Off-Topic Forums > Off-Topic Discussion
17 Aug 2019, 00:00:00 (PRT)
Register Developer Blogs Project Reality Members List Search Today's Posts Mark Forums Read
Off-Topic Discussion For all discussions not related to PR. No Spam.

Reply
 
Thread Tools Display Modes
Old 2007-12-10, 19:20   #21
Cp

Cp's Avatar
Default

awesome! Now I'll have something to do until 0.7!

Cp is offline Reply With Quote
Old 2007-12-10, 19:26   #22
[R-DEV]​Rhino
PR:BF2 Developer
Supporting Member

Rhino's Avatar
Default

Quote:
Originally Posted by [R-PUB]Viper5 View Post
Will be interesting to see how PR's population is affected. Would predictably drop a bit. And, more to the point, the .7 Tester Population :P
My prediction in the short term it will have a dramatic effect on the population of PR as every one is going to be trying it out, I know me and basically every one I know will be, but in the long run it will hardly effect PRs pop as FH2 and PR cant be compared, they offer very diffrent things and they are also diffrent genres. Its like ppl saying that DCon cos of all its hype would have every one quit PR for it cos it was going to be soo good, but turned out just like any other mod. Thou I think FH2 will be able to keep its player base much more easily than DCon cos it already has a very established community, these devs know what they are doing as they have been a established team back from 1942, and stuff like that.

Rhino is offline Reply With Quote
Old 2007-12-10, 19:50   #23
77SiCaRiO77
Retired PR Developer

77SiCaRiO77's Avatar
Default

DCon never aimed to realism

on a side note , looks like FH2 come with his own exe . here is the source code posted in his wiki , does this mean that everybody can use it ?

Code:
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <shlobj.h>
#include <shlwapi.h>
#include <assert.h>
#include <stdio.h>

#define DEFPATH(who) char who[MAX_PATH] = { '\0' }

static FILE *g_debug = NULL;

/* ----- Helpers ----- */
static void Panic(const char *what) 
{
  DEFPATH(tmpbuf); DEFPATH(errbuf);
  int err = GetLastError();
  FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, 0, err, 0, errbuf, MAX_PATH-1, 0);
  _snprintf(tmpbuf, MAX_PATH, "%s: %s", what, errbuf);
  MessageBox(0, tmpbuf, "Failed.", MB_ICONEXCLAMATION | MB_OK);
  ExitProcess(err);
}

static void Info(const char *what)
{
  MessageBox(0, what, "Info", MB_ICONINFORMATION | MB_OK);
}

/* ----- Actually useful stuff. ----- */
typedef struct {
  enum { WHERE_NONE = 0, WHERE_MY_DOCUMENTS, WHERE_BF2 } where;
  const char *suffix;
} pathspec;

typedef struct {
  enum { MOVE_NONE = 0, MOVE_DIRECTORY, MOVE_FILE } how;
#define flag_backup 0x1
#define flag_force  0x2
  int flags;
  pathspec from;
  pathspec to;
  const char *why;
} movement;

static movement targets[] = {
  { MOVE_DIRECTORY, 0,           { WHERE_MY_DOCUMENTS, "Battlefield 2/cache"},    { WHERE_MY_DOCUMENTS, "Battlefield 2/cache-vanilla" }, "move aside vanilla shader cache" },
  { MOVE_DIRECTORY, 0,           { WHERE_MY_DOCUMENTS, "Battlefield 2/cache-fh2"},{ WHERE_MY_DOCUMENTS, "Battlefield 2/cache" }, "move in fh2 cache" },
  { MOVE_DIRECTORY, 0,           { WHERE_MY_DOCUMENTS, "Battlefield 2/mods/bf2"}, { WHERE_MY_DOCUMENTS, "Battlefield 2/mods/bf2.tmp" }, "move aside mods/bf2 shader cache" },
  { MOVE_DIRECTORY, 0,           { WHERE_MY_DOCUMENTS, "Battlefield 2/mods/fh2"}, { WHERE_MY_DOCUMENTS, "Battlefield 2/mods/bf2" }, "move in mods/fh2 shader cache" },
  { MOVE_FILE,      0,           { WHERE_BF2, "mods/bf2/shaders_client.zip"},     { WHERE_BF2, "mods/bf2/shaders_client.zip-vanilla" }, "move aside vanilla shaders" },
  { MOVE_FILE,      flag_backup, { WHERE_BF2, "mods/fh2/shaders_client.zip"},     { WHERE_BF2, "mods/bf2/shaders_client.zip" }, "move in fh2 shaders" },
  { MOVE_FILE,      0,           { WHERE_BF2, "mods/fh2/movies/warning.bik"},     { WHERE_BF2, "mods/fh2/movies/warning.bik-disabled" }, "move aside warning video" },
  { MOVE_NONE, }
};

static void GetMyDocs(char *dest)
{
  if (SUCCEEDED(SHGetFolderPath(NULL, 
                CSIDL_PERSONAL|CSIDL_FLAG_CREATE, 
                NULL, 
                0, 
                dest))) {
    return;
  } else {
    Panic("SHGetFolderPath failed");
  }
}

static HANDLE g_mutex = NULL;
static BOOL IsFirstInstance(void)
{
  g_mutex = CreateMutex(NULL, FALSE, "Global\\forgotten hope 2");
  if (g_mutex != NULL && GetLastError() == ERROR_ALREADY_EXISTS)
  {
    CloseHandle(g_mutex);
    g_mutex = NULL;
    return FALSE;
  }
  return TRUE;
}

static void ExecMovement(const movement *m, BOOL reverse)
{
  int e;
  DEFPATH(p_from);
  DEFPATH(p_to);
  DEFPATH(p_from_backup);

  if (m->from.where == WHERE_MY_DOCUMENTS)
      GetMyDocs(p_from);
  PathAppend(p_from, m->from.suffix);
  
  if (m->to.where == WHERE_MY_DOCUMENTS)
      GetMyDocs(p_to);
  PathAppend(p_to, m->to.suffix);

  memcpy(p_from_backup, p_from, MAX_PATH);
  strcat(p_from_backup, ".backup");

  switch (m->how)
  {
    case MOVE_FILE:
        if (!reverse && m->flags & flag_backup)
        {
            if (g_debug) fprintf(g_debug, "Taking a backup of '%s' to '%s'... ", p_from, p_from_backup);
            e = CopyFile(p_from, p_from_backup, FALSE);
            if (g_debug) fprintf(g_debug, "%s.\n", (e) ? "Done" : "Failed");
        }
        break;

    case MOVE_DIRECTORY:
        break;

    default:
    case MOVE_NONE:
      return;
  }

  if (reverse)
  {
    if (g_debug) fprintf(g_debug, "Moving '%s' back to '%s'... ", p_to, p_from);
    e = MoveFileEx(p_to, p_from, MOVEFILE_WRITE_THROUGH);
    if (g_debug) fprintf(g_debug, "%s.\n", (e) ? "Done" : "Failed");
  } else {
    if (g_debug) fprintf(g_debug, "Moving '%s' to '%s'... ", p_from, p_to);
    e = MoveFileEx(p_from, p_to, MOVEFILE_WRITE_THROUGH);
    if (g_debug) fprintf(g_debug, "%s.\n", (e) ? "Done" : "Failed");
  }
}

static void MoveIntoPlace(void)
{
  const movement *m = targets;
  while (m->how != MOVE_NONE)
  {
    if (g_debug) fprintf(g_debug, "MoveIntoPlace: executing task '%s'\n", m->why);
    ExecMovement(m, FALSE);
    m++;
  }
}

static void ResetPlaces(void)
{
  const movement *m = targets;

  while (m->how != MOVE_NONE)
    m++;
  m--;

  while (1)
  {
    if (g_debug) fprintf(g_debug, "MoveIntoPlace: reversing task '%s'\n", m->why);
    ExecMovement(m, TRUE);
    if (m == targets)
      break;
    m--;
  }
}

int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, char *lpCmdLine, int nCmdShow)
{
  STARTUPINFO si;
  PROCESS_INFORMATION pi;
  DEFPATH(cmdline);
  DEFPATH(md_cache_bf2);
  DEFPATH(md_cache_bf2tmp);
  DEFPATH(md_cache_fh2);

  BOOL first_instance;
  
  g_debug = fopen("fh2.exe.log", "a+");
  if (g_debug) setvbuf(g_debug, NULL, _IONBF, 0);
  if (g_debug) fprintf(g_debug, "-- fh2.exe -- starting log\n");
  first_instance = IsFirstInstance();
  if (g_debug) fprintf(g_debug, "IsFirstInstance? %s\n", (first_instance)?"Yes":"No");
 
  if (first_instance)
    MoveIntoPlace();
  
  memset(&si, 0, sizeof(si));
  si.cb = sizeof(si);
  memset(&pi, 0, sizeof(pi));
  
  _snprintf(cmdline, MAX_PATH, "bf2.exe +modPath mods/fh2 %s", lpCmdLine);

  SetProcessWorkingSetSize((HANDLE) -1, -1, -1);

  if (g_debug) fprintf(g_debug, "Execing '%s'\n", cmdline);

  // Start the child process.
  if (!CreateProcess(NULL, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
    Panic("CreateProcess failed");
  
  if (g_debug) fprintf(g_debug, "Waiting...\n");

  // Wait until child process exits.
  WaitForSingleObject(pi.hProcess, INFINITE);

  if (g_debug) fprintf(g_debug, "bf2.exe finished. Clearing up...\n");

  // Close process and thread handles.
  CloseHandle(pi.hProcess);
  CloseHandle(pi.hThread);

  if (first_instance)
    ResetPlaces();

  if (g_mutex)
    CloseHandle(g_mutex);

  if (g_debug) fprintf(g_debug, "-- fh2.exe -- Exiting.\n");
  if (g_debug)
    fclose(g_debug);

  return 0;
}
link to the wiki

http://forgottenhope.bf1942files.com...FH2.exe_Source
77SiCaRiO77 is offline Reply With Quote
Old 2007-12-10, 19:54   #24
[R-DEV]​Rhino
PR:BF2 Developer
Supporting Member

Rhino's Avatar
Default

Nor dose FH2 going to anything near the realism PR dose, and "DC" which was the concept of "DCon" was the most popular BF1942 mod out.

I dout FH2 has its own engine, if it has a .exe I would exspect it loads the BF2.exe though it with a bunch of other commands is my guess.

Rhino is offline Reply With Quote
Old 2007-12-10, 20:09   #25
Petey

Petey's Avatar
Send a message via AIM to Petey Send a message via MSN to Petey
Default

wait im so confused right now lol
whats happening?!?! whens it coming out?!?!?!?!

Petey is offline Reply With Quote
Old 2007-12-10, 20:11   #26
77SiCaRiO77
Retired PR Developer

77SiCaRiO77's Avatar
Default

passworded torrent link its comming wenstday (sp?) , password is comming in friday
77SiCaRiO77 is offline Reply With Quote
Old 2007-12-10, 20:21   #27
Cheeseman
Retired PR Developer

Cheeseman's Avatar
Default

Quote:
Originally Posted by [R-DEV]Rhino View Post
Nor dose FH2 going to anything near the realism PR dose, and "DC" which was the concept of "DCon" was the most popular BF1942 mod out.

I dout FH2 has its own engine, if it has a .exe I would exspect it loads the BF2.exe though it with a bunch of other commands is my guess.
Quote:
_snprintf(cmdline, MAX_PATH, "bf2.exe +modPath mods/fh2 %s", lpCmdLine);
Straight out of FH2's source code.
Cheeseman is offline Reply With Quote
Old 2007-12-10, 20:23   #28
Brummy

Brummy's Avatar
Send a message via MSN to Brummy
Default

WOOOOOOOOOOOO

Brummy is offline Reply With Quote
Old 2007-12-10, 20:35   #29
LekyIRL

LekyIRL's Avatar
Send a message via MSN to LekyIRL
Default

w00t! Can't wait!


[R-MOD]Dunehunter-Freedom? This...is...The PR Forum! *kicks LekyIRL down the well on Basrah*
LekyIRL is offline Reply With Quote
Old 2007-12-10, 21:07   #30
Cheeseman
Retired PR Developer

Cheeseman's Avatar
Default

Quote:
Originally Posted by LekyIRL View Post
w00t! Can't wait!
OMG me neither!!



Ow wait?
Cheeseman is offline Reply With Quote
Reply


Tags
14th, america, battle, bf2, dec, enters, fh2, forgoten, forgotten, hope, hope2, mod, poxo is ghey, release, released, v22
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 23:12.