Alef/nocdkey – User
nocdkey here doesn't mean you can play illegal copies with this plugin!
A fast way to setup MP missions is to run two ArmA games on the same computer. Let's call the first Editor and the second Client. Editor run the mission editor, selected clicking on Multiplayer -> New -> Edit/New. Client can now join it selecting Multiplayer -> LAN or Remote wiht IP 127.0.0.1. It will see Editor in edit mode. As Editor click on preview to run the mission, a PBO is create on the fly (__cur_mp.pbo) for Client to be available. Both now enter the usual lobby and choose the slot they want. They play the mission, and when they leave back to the lobby, they can choose to run it again or go back. Editor in this case to the mission editor, Client to the multiplayer screen or 'Wait for host'.
In order to avoid to click the menus, command line arguments are available.
For Editor
\ArmA\arma.exe -host
For Client
\ArmA\arma.exe -connect=localhost
It is suggested to add
-window -nosplash -world=empty -nopause
to speed up things and run safe from alt-tabbing.
This plugin simulate what you usually can do just dropping your connection to the internet using -host mode. You can't use kickduplicate=0 because the -config=server.cfg doesn't get read in -host mode.
OFPEC beta Xfire video This is a file called ws2_32.dll to put in the same arma.exe directory, and get enabled using -nocdkey and -host arguments on the command line. It will intercept the host name resolution for gamespy service, returning a "not found" answer. This is the same effect you can obtain disconnecting the network cable.
How to run 2 ArmAs on the same PC
Need a crafted ws2_32.dll, which returns WSAHOST_NOT_FOUND in gethostbyname() for armedass.master.gamespy.com or armedass.available.gamespy.com if -nocdkey is given on the server (-host) command line.
Editor/Server: \ArmA\arma.exe -window -nosplash -world=empty -nopause -host -nokey Client: \ArmA\arma.exe -window -nosplash -world=empty -nopause -connect=localhost
The server will get the message "No challenge value was received from the master server."
Will post on OFPEC for beta, if someone interested, and on BI forum.
How it works?
To connect to the Internet, like all the other programs on Windows, ArmA uses a DLL called ws2_32.dll, that is a file installed in C:\Windows\System32. If you put another file with the same name in the ArmA installation directory, ArmA will use that instead of the Windows one. It is like the Armalib from Kegetys (OFPWatch too?). I've modified a program, that intercept the functions ArmA does to connect other computers. One of these functions is gethostbyname, which usually is used to obtain an internet address given a name, like www.ofpec.com returns 85.17.58.182. Now, if ArmA asks for gamespy.com to check for duplicated CD keys, if the address it's found and valid, the check will happens. You can usually avoid this in server.cfg (-config) with kickduplicate=0, BUT if you run arma.exe with -host, you can't avoid the check. server.cfg only works with -server, the dedicated one. Why run arma.exe with -host? Because you will jump directly at start in the Multiplayer page "Create Game", and choose a mission to edit. There, you can edit your mission, your scripts, etc. Then, you can run another arma.exe to connect the former (on LAN, server "localhost" or "127.0.0.1") . On this you will see the multiplayer page (LAN) with your server in state "Editing". As you click "Preview" in the editor arma, the other game can join. On abort, both return the mutiplayer lobby. In this way you speed up a lot the testing of multiplayer game.
struct hostent* FAR(__stdcall h_gethostbyname)(__in const char *name) { using namespace std; static const string master("armedass.master.gamespy.com"), available("armedass.available.gamespy.com"); static const wstring mhost(L"-host"), mnocdkey(L"-nocdkey"); static bool host=false, nocdkey=false, argschecked=false; struct hostent* FAR rc = 0; if (!argschecked) { argschecked=true; LPWSTR *szArglist; int nArgs; szArglist = CommandLineToArgvW(GetCommandLineW(), &nArgs); if( NULL != szArglist ) for(int i=0; i<nArgs ; ++i) { if (!host) host=(mhost.compare(szArglist[i]) == 0); if (!nocdkey) nocdkey=(mnocdkey.compare(szArglist[i]) == 0); } LocalFree(szArglist); } if (host && nocdkey && name && (master.compare(name) == 0 || available.compare(name) == 0) ) { p_WSASetLastError(WSAHOST_NOT_FOUND); } else { rc=p_gethostbyname(name); } return rc; }
References: http://forum.koaxia.com/index.php?PHPSESSID=8c74b13cfe75e2b293e4825c7e7985e5&topic=3099.0 http://www.codeguru.com/forum/archive/index.php/t-386875.html