Initial Commit of CyanWorlds.com Engine Open Source Client/Plugin
@ -0,0 +1,26 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "pfAllCreatables.h"
|
@ -0,0 +1,27 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "hsWindows.h"
|
||||
#include "plAllCreatables.h"
|
@ -0,0 +1,295 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#pragma once
|
||||
#ifndef plClient_inc
|
||||
#define plClient_inc
|
||||
|
||||
|
||||
//#define NEW_CAMERA_CODE
|
||||
|
||||
#include "hsWindowHndl.h"
|
||||
#include "hsBitVector.h"
|
||||
#include "hsTemplates.h"
|
||||
#include "hsUtils.h"
|
||||
#include "hsStlUtils.h"
|
||||
#include "../pnKeyedObject/hsKeyedObject.h"
|
||||
#include "../pnKeyedObject/plUoid.h"
|
||||
#include "../plScene/plRenderRequest.h"
|
||||
|
||||
class plSceneNode;
|
||||
class plPipeline;
|
||||
class hsG3DDeviceModeRecord;
|
||||
class plInputManager;
|
||||
class plInputController;
|
||||
class plSceneObject;
|
||||
class pfConsoleEngine;
|
||||
class pfConsole;
|
||||
class plAudioSystem;
|
||||
class plVirtualCam1;
|
||||
class plKey;
|
||||
class plPageTreeMgr;
|
||||
class plTransitionMgr;
|
||||
class plLinkEffectsMgr;
|
||||
class plOperationProgress;
|
||||
class pfGameGUIMgr;
|
||||
class pfKI;
|
||||
class plAnimDebugList;
|
||||
class plFontCache;
|
||||
class plClientMsg;
|
||||
class plLocation;
|
||||
class plMovieMsg;
|
||||
class plBinkPlayer;
|
||||
class plPreloaderMsg;
|
||||
class plNetCommAuthMsg;
|
||||
class plAgeLoaded2Msg;
|
||||
|
||||
|
||||
typedef void (*plMessagePumpProc)( void );
|
||||
|
||||
class plClient : public hsKeyedObject
|
||||
{
|
||||
protected:
|
||||
|
||||
class plRoomRec
|
||||
{
|
||||
public:
|
||||
plSceneNode *fNode;
|
||||
UInt32 fFlags;
|
||||
|
||||
plRoomRec() { fNode = nil; fFlags = 0; }
|
||||
plRoomRec( plSceneNode *n, UInt32 f ) : fNode( n ), fFlags( f ) {}
|
||||
|
||||
enum Flags
|
||||
{
|
||||
kHeld = 0x00000001
|
||||
};
|
||||
};
|
||||
|
||||
hsBitVector fFlags;
|
||||
|
||||
plInputManager* fInputManager;
|
||||
|
||||
plPageTreeMgr* fPageMgr;
|
||||
hsTArray<plRoomRec> fRooms;
|
||||
plSceneNode* fCurrentNode;
|
||||
|
||||
plPipeline* fPipeline;
|
||||
hsColorRGBA fClearColor;
|
||||
plTransitionMgr *fTransitionMgr;
|
||||
plLinkEffectsMgr *fLinkEffectsMgr;
|
||||
plFontCache *fFontCache;
|
||||
|
||||
pfConsoleEngine* fConsoleEngine;
|
||||
pfConsole* fConsole;
|
||||
|
||||
pfKI *fKIGUIGlue;
|
||||
|
||||
hsBool fDone;
|
||||
hsBool fWindowActive;
|
||||
|
||||
hsWindowHndl fWindowHndl;
|
||||
|
||||
double fLastProgressUpdate;
|
||||
plOperationProgress *fProgressBar;
|
||||
|
||||
pfGameGUIMgr *fGameGUIMgr;
|
||||
|
||||
virtual hsG3DDeviceModeRecord ILoadDevMode(const char* devModeFile);
|
||||
|
||||
hsBool IUpdate();
|
||||
hsBool IDraw();
|
||||
hsBool IDrawProgress();
|
||||
|
||||
plVirtualCam1* fNewCamera;
|
||||
|
||||
static plClient* fInstance;
|
||||
char * fpAuxInitDir;
|
||||
static hsBool fDelayMS;
|
||||
|
||||
int fClampCap;
|
||||
int fQuality;
|
||||
|
||||
hsBool fQuitIntro;
|
||||
hsTArray<plBinkPlayer*> fMovies;
|
||||
|
||||
hsBool fPatchGlobalAges;
|
||||
|
||||
plMessagePumpProc fMessagePumpProc;
|
||||
|
||||
#ifndef PLASMA_EXTERNAL_RELEASE
|
||||
bool bPythonDebugConnected;
|
||||
#endif
|
||||
|
||||
hsTArray<plRenderRequest*> fPreRenderRequests;
|
||||
hsTArray<plRenderRequest*> fPostRenderRequests;
|
||||
|
||||
bool fHoldLoadRequests;
|
||||
class LoadRequest
|
||||
{
|
||||
public:
|
||||
LoadRequest(const plLocation& loc, bool hold) { this->loc = loc; this->hold = hold; }
|
||||
plLocation loc;
|
||||
bool hold;
|
||||
};
|
||||
typedef std::list<LoadRequest*> LoadList;
|
||||
LoadList fLoadRooms;
|
||||
int fNumLoadingRooms; // Number of rooms we're waiting for load callbacks on
|
||||
std::vector<plLocation> fRoomsLoading; // the locations we are currently in the middle of loading
|
||||
|
||||
int fNumPostLoadMsgs;
|
||||
float fPostLoadMsgInc;
|
||||
|
||||
void ICompleteInit ();
|
||||
void IOnAsyncInitComplete ();
|
||||
void IHandlePreloaderMsg (plPreloaderMsg * msg);
|
||||
void IHandleNetCommAuthMsg (plNetCommAuthMsg * msg);
|
||||
bool IHandleAgeLoaded2Msg (plAgeLoaded2Msg * msg);
|
||||
|
||||
hsBool IFlushRenderRequests();
|
||||
void IProcessPreRenderRequests();
|
||||
void IProcessPostRenderRequests();
|
||||
void IProcessRenderRequests(hsTArray<plRenderRequest*>& reqs);
|
||||
void IAddRenderRequest(plRenderRequest* req);
|
||||
|
||||
hsBool IPlayIntroBink(const char* movieName, hsScalar endDelay, hsScalar posX, hsScalar posY, hsScalar scaleX, hsScalar scaleY, hsScalar volume = 1.0);
|
||||
hsBool IHandleMovieMsg(plMovieMsg* mov);
|
||||
void IKillMovies();
|
||||
void IServiceMovies();
|
||||
|
||||
void IStartProgress( const char *title, hsScalar len );
|
||||
void IIncProgress( hsScalar byHowMuch, const char *text );
|
||||
void IStopProgress( void );
|
||||
|
||||
static void IDispatchMsgReceiveCallback();
|
||||
static void IReadKeyedObjCallback(plKey key);
|
||||
static void IProgressMgrCallbackProc( plOperationProgress *progress );
|
||||
|
||||
void IPatchGlobalAgeFiles( void );
|
||||
|
||||
int IFindRoomByLoc(const plLocation& loc);
|
||||
bool IIsRoomLoading(const plLocation& loc);
|
||||
void IQueueRoomLoad(const std::vector<plLocation>& locs, bool hold);
|
||||
void ILoadNextRoom();
|
||||
void IUnloadRooms(const std::vector<plLocation>& locs);
|
||||
void IRoomLoaded(plSceneNode* node, bool hold);
|
||||
void IRoomUnloaded(plSceneNode* node);
|
||||
void ISetGraphicsDefaults();
|
||||
|
||||
public:
|
||||
|
||||
plClient();
|
||||
virtual ~plClient();
|
||||
|
||||
CLASSNAME_REGISTER( plClient );
|
||||
GETINTERFACE_ANY( plClient, hsKeyedObject );
|
||||
|
||||
static plClient* GetInstance() { return fInstance; }
|
||||
static void SetInstance(plClient* v) { fInstance=v; }
|
||||
|
||||
virtual hsBool MsgReceive(plMessage* msg);
|
||||
|
||||
hsBool InitPipeline();
|
||||
|
||||
void InitInputs();
|
||||
|
||||
void InitDLLs();
|
||||
void ShutdownDLLs();
|
||||
|
||||
void InitAuxInits();
|
||||
|
||||
virtual hsBool StartInit();
|
||||
virtual hsBool Shutdown();
|
||||
virtual hsBool MainLoop();
|
||||
|
||||
plClient& SetDone(hsBool done) { fDone = done; return *this; }
|
||||
hsBool GetDone() { return fDone; }
|
||||
|
||||
// Set this to true to queue any room load requests that come in. Set it to false to process them.
|
||||
void SetHoldLoadRequests(bool hold);
|
||||
|
||||
enum
|
||||
{
|
||||
kFlagIniting,
|
||||
kFlagDBGDisableRender,
|
||||
kFlagDBGDisableRRequests,
|
||||
kFlagAsyncInitComplete,
|
||||
kFlagGlobalDataLoaded,
|
||||
};
|
||||
|
||||
hsBool HasFlag(int f) const { return fFlags.IsBitSet(f); }
|
||||
void SetFlag(int f, hsBool on=true) { fFlags.SetBit(f, on); }
|
||||
|
||||
virtual plClient& SetWindowHandle(hsWindowHndl hndl) { fWindowHndl=hndl; return *this; }
|
||||
hsWindowHndl GetWindowHandle() { return fWindowHndl; }
|
||||
|
||||
plInputManager* GetInputManager() { return fInputManager; }
|
||||
|
||||
plPipeline* GetPipeline() { return fPipeline; }
|
||||
|
||||
plSceneNode* GetCurrentScene() { return fCurrentNode; }
|
||||
|
||||
pfConsoleEngine *GetConsoleEngine() { return fConsoleEngine; }
|
||||
|
||||
void SetAuxInitDir(const char *p) { delete [] fpAuxInitDir; fpAuxInitDir = hsStrcpy(p); }
|
||||
|
||||
static void EnableClientDelay() { plClient::fDelayMS = true; }
|
||||
|
||||
// These are a hack to let the console fake a lesser capabile board and test out quality settings.
|
||||
// They should go away once we have this built into ClientSetup et.al.
|
||||
void SetClampCap(int c) { fClampCap = c; }
|
||||
int GetClampCap() const { return fClampCap; }
|
||||
void SetQuality(int q) { fQuality = q; }
|
||||
int GetQuality() const { return fQuality; }
|
||||
|
||||
hsBool GetQuitIntro() const { return fQuitIntro; }
|
||||
void SetQuitIntro(hsBool on) { fQuitIntro = on; }
|
||||
|
||||
void SetClearColor( hsColorRGBA &color );
|
||||
hsColorRGBA GetClearColor() const { return fClearColor; }
|
||||
|
||||
// The client window has focus (true) or lost it (false)
|
||||
virtual void WindowActivate(bool active);
|
||||
virtual hsBool WindowActive() const { return fWindowActive; }
|
||||
|
||||
void SetMessagePumpProc( plMessagePumpProc proc ) { fMessagePumpProc = proc; }
|
||||
void ResetDisplayDevice(int Width, int Height, int ColorDepth, hsBool Windowed, int NumAASamples, int MaxAnisotropicSamples, hsBool VSync = false, hsBool windowOnly = false);
|
||||
void IDetectAudioVideoSettings();
|
||||
void IWriteDefaultGraphicsSettings(const wchar* destFile);
|
||||
|
||||
plAnimDebugList *fAnimDebugList;
|
||||
|
||||
#if 0
|
||||
std::string fUsername;
|
||||
std::string fPasswordDigest;
|
||||
std::string fServer;
|
||||
int fPlayerID;
|
||||
bool fRecreatePlayer;
|
||||
bool fAuthPassed;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif // plClient_inc
|
@ -0,0 +1,36 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#ifndef plClientCreatable_inc
|
||||
#define plClientCreatable_inc
|
||||
|
||||
#include "../pnFactory/plCreator.h"
|
||||
|
||||
#include "plClient.h"
|
||||
|
||||
REGISTER_NONCREATABLE( plClient );
|
||||
|
||||
#endif // plClientCreatable
|
@ -0,0 +1,51 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#ifndef plClientUpdateFormat_h_inc
|
||||
#define plClientUpdateFormat_h_inc
|
||||
|
||||
namespace ClientUpdate
|
||||
{
|
||||
enum
|
||||
{
|
||||
kUpdate,
|
||||
kShutdown,
|
||||
};
|
||||
}
|
||||
|
||||
//
|
||||
// Format of the update stream
|
||||
//
|
||||
// UInt8 - type (kUpdate, kShutdown)
|
||||
//
|
||||
// If type is kUpdate:
|
||||
// UInt32 - number of deleted keys
|
||||
// plUoid - uoid of deleted key (* num)
|
||||
//
|
||||
// UInt32 - number of new creatables
|
||||
// plCreatable - new creatable (* num)
|
||||
//
|
||||
|
||||
#endif // plClientUpdateFormat_h_inc
|
@ -0,0 +1,26 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
@ -0,0 +1,28 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#pragma warning( disable : 4305 4503 4018 4786 4284)
|
||||
#include "pnAllCreatables.h"
|
||||
|
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 630 B |
After Width: | Height: | Size: 630 B |
After Width: | Height: | Size: 70 KiB |
After Width: | Height: | Size: 630 B |
After Width: | Height: | Size: 630 B |
After Width: | Height: | Size: 630 B |
After Width: | Height: | Size: 630 B |
After Width: | Height: | Size: 630 B |
After Width: | Height: | Size: 630 B |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 630 B |
After Width: | Height: | Size: 630 B |
After Width: | Height: | Size: 630 B |
After Width: | Height: | Size: 630 B |
After Width: | Height: | Size: 630 B |
After Width: | Height: | Size: 630 B |
After Width: | Height: | Size: 630 B |
After Width: | Height: | Size: 630 B |
After Width: | Height: | Size: 630 B |
After Width: | Height: | Size: 630 B |
After Width: | Height: | Size: 630 B |
After Width: | Height: | Size: 630 B |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 630 B |
After Width: | Height: | Size: 766 B |
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||
<assemblyIdentity
|
||||
version="1.0.0.0"
|
||||
processorArchitecture="x86"
|
||||
name="plClient"
|
||||
type="win32"
|
||||
/>
|
||||
<description>plClient</description>
|
||||
<dependency>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity
|
||||
type="win32"
|
||||
name="Microsoft.Windows.Common-Controls"
|
||||
version="6.0.0.0"
|
||||
processorArchitecture="X86"
|
||||
publicKeyToken="6595b64144ccf1df"
|
||||
language="*"
|
||||
/>
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
</assembly>
|
@ -0,0 +1,380 @@
|
||||
// Microsoft Visual C++ generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "afxres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#include ""afxres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
|
||||
"#define _AFX_NO_OLE_RESOURCES\r\n"
|
||||
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
|
||||
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
|
||||
"\r\n"
|
||||
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
|
||||
"#ifdef _WIN32\r\n"
|
||||
"LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US\r\n"
|
||||
"#pragma code_page(1252)\r\n"
|
||||
"#endif //_WIN32\r\n"
|
||||
"#endif\r\n"
|
||||
"\r\n"
|
||||
"CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST ""plClient.exe.manifest""\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Bitmap
|
||||
//
|
||||
|
||||
IDB_CURSOR_UP BITMAP "cursor_up.bmp"
|
||||
IDB_CURSOR_DOWN BITMAP "cursor_down.bmp"
|
||||
IDB_CURSOR_LEFT BITMAP "cursor_right.bmp"
|
||||
IDB_CURSOR_RIGHT BITMAP "cursor_left.bmp"
|
||||
IDB_CURSOR_OPEN BITMAP "cursor_open.bmp"
|
||||
IDB_CURSOR_GRAB BITMAP "cursor_grab.bmp"
|
||||
IDB_CURSOR_CLICKED BITMAP "cursor_clicked.bmp"
|
||||
IDB_CURSOR_POISED BITMAP "cursor_poised.bmp"
|
||||
IDB_CURSOR_ARROW BITMAP "cursor_u.bmp"
|
||||
IDB_CURSOR_4WAYOPEN BITMAP "bitmap1.bmp"
|
||||
IDB_CURSOR_UPDOWNCLOSED BITMAP "bmp00001.bmp"
|
||||
IDB_CURSOR_UPDOWNOPEN BITMAP "bitmap2.bmp"
|
||||
IDB_CURSOR_4WAYCLOSED BITMAP "bitmap3.bmp"
|
||||
IDB_CURSOR_LEFTRIGHTCLOSED BITMAP "bmp00003.bmp"
|
||||
IDB_CURSOR_LEFTRIGHTOPEN BITMAP "bmp00002.bmp"
|
||||
IDB_MICROPHONE BITMAP "Microphone.bmp"
|
||||
IDB_TALKING BITMAP "Speaker.bmp"
|
||||
IDB_CURSOR_BOOK_HIGHLIGHT BITMAP "book_hig.bmp"
|
||||
IDB_CURSOR_BOOK BITMAP "book.bmp"
|
||||
IDB_CURSOR_BOOK_CLICKED BITMAP "book_cli.bmp"
|
||||
IDB_CURSOR_DISABLED BITMAP "cursor_disabled.bmp"
|
||||
IDB_CURSOR_HAND BITMAP "bmp00005.bmp"
|
||||
IDB_CURSOR_UPWARD BITMAP "cursor_upward.bmp"
|
||||
IDB_BANNER BITMAP "banner.bmp"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
IDI_ICON_DIRT ICON "Dirt.ICO"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_LOADING DIALOGEX 0, 0, 161, 26
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER |
|
||||
WS_POPUP | WS_VISIBLE
|
||||
FONT 8, "MS Sans Serif", 0, 0, 0x0
|
||||
BEGIN
|
||||
LTEXT "Starting URU. Please wait...",IDC_STARTING_TEXT,32,9,
|
||||
127,8
|
||||
ICON IDI_ICON_DIRT,IDC_STATIC,5,3,20,20
|
||||
END
|
||||
|
||||
IDD_EXCEPTION DIALOGEX 0, 0, 296, 183
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Error"
|
||||
FONT 8, "MS Sans Serif", 0, 0, 0x0
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "OK",IDOK,239,7,50,14
|
||||
ICON IDI_ICON_DIRT,IDC_STATIC,7,7,20,20
|
||||
LTEXT " URU has experienced a serious error. Please report the information below.\n\nWe apologize for any inconvenience. ",
|
||||
IDC_MSG,38,7,189,37
|
||||
EDITTEXT IDC_CRASHINFO,7,45,282,131,ES_MULTILINE | ES_AUTOVSCROLL |
|
||||
ES_AUTOHSCROLL | ES_READONLY
|
||||
PUSHBUTTON "Copy",IDC_COPY,239,26,50,14
|
||||
END
|
||||
|
||||
IDD_URUTAP_LOGIN DIALOGEX 0, 0, 188, 111
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION
|
||||
CAPTION "Enter Login Info"
|
||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "Enter",IDOK,33,90,50,14
|
||||
PUSHBUTTON "Cancel",IDCANCEL,107,90,50,14
|
||||
LTEXT "Username",IDC_STATIC,7,7,38,11
|
||||
EDITTEXT IDC_URUTAP_USERNAME,52,7,129,13,ES_AUTOHSCROLL
|
||||
LTEXT "Password",IDC_STATIC,7,30,38,12
|
||||
EDITTEXT IDC_URUTAP_PASSWORD,52,28,129,12,ES_PASSWORD |
|
||||
ES_AUTOHSCROLL
|
||||
LTEXT "Server",IDC_STATIC,7,54,35,12
|
||||
EDITTEXT IDC_URUTAP_SERVER,51,51,130,13,ES_AUTOHSCROLL
|
||||
CONTROL "Destroy and recreate player",IDC_URUTAP_DESTROY,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,51,70,130,12
|
||||
END
|
||||
|
||||
IDD_URU_LOGIN DIALOGEX 0, 0, 200, 133
|
||||
STYLE DS_SETFONT | DS_3DLOOK | WS_POPUP | WS_SYSMENU
|
||||
EXSTYLE WS_EX_STATICEDGE
|
||||
FONT 12, "Hobo Std", 500, 0, 0x0
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "Submit",IDOK,139,114,50,14
|
||||
PUSHBUTTON "Quit",IDCANCEL,77,114,50,14
|
||||
EDITTEXT IDC_USERNAME,65,55,110,12,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_PASSWORD,65,71,110,12,ES_PASSWORD | ES_AUTOHSCROLL
|
||||
LTEXT "Username:",IDC_TEXT_USER,25,58,36,8
|
||||
LTEXT "Password:",IDC_TEXT_PASS,27,73,34,8
|
||||
LTEXT "Welcome to URU!",IDC_TEXT_WELCOME,72,45,57,8
|
||||
CONTROL "Remember Password:",IDC_REMEMBER_PASS,"Button",
|
||||
BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,23,87,85,10
|
||||
GROUPBOX "",IDC_BOX_01,5,30,190,79
|
||||
GROUPBOX "",IDC_BOX_02,14,38,172,64
|
||||
CONTROL 151,IDC_IMAGE_BANNER,"Static",SS_BITMAP |
|
||||
SS_REALSIZEIMAGE | WS_BORDER,4,4,192,21,WS_EX_CLIENTEDGE
|
||||
END
|
||||
|
||||
IDD_URU_EULA DIALOGEX 0, 0, 201, 158
|
||||
STYLE DS_SETFONT | WS_POPUP | WS_SYSMENU
|
||||
FONT 12, "Hobo Std", 500, 0, 0x0
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "Accept",IDOK,141,138,50,14
|
||||
PUSHBUTTON "Decline",IDCANCEL,79,138,50,14
|
||||
CONTROL 151,IDC_IMAGE_BANNER,"Static",SS_BITMAP |
|
||||
SS_REALSIZEIMAGE | WS_BORDER,4,4,192,21,WS_EX_CLIENTEDGE
|
||||
GROUPBOX "",IDC_BOX_03,5,30,190,103
|
||||
LTEXT "Terms of Use Agreement",IDC_TEXT_TERMS,59,36,83,8
|
||||
CONTROL "Custom1",IDC_DYN_EULA,"",WS_TABSTOP,13,46,174,80
|
||||
END
|
||||
|
||||
IDD_URULOGIN_MAIN DIALOGEX 0, 0, 302, 230
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_FIXEDSYS |
|
||||
DS_CENTER | WS_POPUP
|
||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "Login",IDOK,87,209,50,14
|
||||
PUSHBUTTON "Quit",IDCANCEL,163,209,50,14
|
||||
CONTROL 151,IDC_STATIC,"Static",SS_BITMAP | SS_REALSIZEIMAGE |
|
||||
WS_BORDER,7,7,289,36
|
||||
LTEXT "Account name:",IDC_STATIC,69,119,49,10
|
||||
LTEXT "Password:",IDC_STATIC,69,135,49,10
|
||||
EDITTEXT IDC_URULOGIN_USERNAME,123,119,108,12,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_URULOGIN_PASSWORD,123,135,108,12,ES_PASSWORD |
|
||||
ES_AUTOHSCROLL
|
||||
GROUPBOX "",IDC_STATIC,14,99,274,96
|
||||
CONTROL "Remember Password:",IDC_URULOGIN_REMEMBERPASS,"Button",
|
||||
BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,69,151,100,10
|
||||
GROUPBOX "",IDC_STATIC,14,54,274,43
|
||||
LTEXT "Welcome to URU",IDC_STATUS_TEXT,17,62,267,20
|
||||
RTEXT "Product String",IDC_PRODUCTSTRING,88,86,194,8
|
||||
CONTROL "",IDC_STATIC,"Static",SS_BLACKFRAME | SS_SUNKEN,7,49,
|
||||
288,152
|
||||
PUSHBUTTON "Need an account?",IDC_URULOGIN_GAMETAPLINK,95,175,110,
|
||||
14,BS_FLAT
|
||||
END
|
||||
|
||||
IDD_URULOGIN_EULA DIALOGEX 0, 0, 300, 318
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP
|
||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "Accept",IDOK,89,297,50,14
|
||||
PUSHBUTTON "Decline",IDCANCEL,160,297,50,14
|
||||
CONTROL 151,IDC_STATIC,"Static",SS_BITMAP,7,7,287,36,
|
||||
WS_EX_CLIENTEDGE
|
||||
CONTROL "",IDC_STATIC,"Static",SS_BLACKFRAME | SS_SUNKEN,9,46,
|
||||
284,242
|
||||
CTEXT "End User License Agreement",IDC_STATIC,46,55,207,10
|
||||
GROUPBOX "",IDC_STATIC,17,66,266,212
|
||||
CONTROL "",IDC_URULOGIN_EULATEXT,"RichEdit20A",ES_MULTILINE |
|
||||
ES_AUTOHSCROLL | ES_READONLY | WS_BORDER | WS_VSCROLL |
|
||||
WS_HSCROLL | WS_TABSTOP,25,75,250,197
|
||||
END
|
||||
|
||||
IDD_AUTHFAILED DIALOGEX 0, 0, 177, 89
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER |
|
||||
WS_POPUP | WS_VISIBLE
|
||||
FONT 8, "MS Sans Serif", 0, 0, 0x0
|
||||
BEGIN
|
||||
LTEXT "Authentication failed. Please try again.",
|
||||
IDC_AUTH_TEXT,38,17,127,8
|
||||
ICON IDI_ICON_DIRT,IDC_STATIC,6,11,21,20
|
||||
PUSHBUTTON "Ok",IDOK,67,73,42,14
|
||||
CTEXT "",IDC_AUTH_MESSAGE,0,37,175,32
|
||||
END
|
||||
|
||||
IDD_AUTHENTICATING DIALOGEX 0, 0, 177, 60
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER |
|
||||
WS_POPUP | WS_VISIBLE
|
||||
FONT 8, "MS Sans Serif", 0, 0, 0x0
|
||||
BEGIN
|
||||
ICON IDI_ICON_DIRT,IDC_STATIC,6,11,21,20
|
||||
LTEXT "Logging in to URU. Please wait...",IDC_AUTH_TEXT,38,17,
|
||||
137,8
|
||||
PUSHBUTTON "Cancel",IDCANCEL,64,42,49,15
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO
|
||||
BEGIN
|
||||
IDD_LOADING, DIALOG
|
||||
BEGIN
|
||||
RIGHTMARGIN, 159
|
||||
END
|
||||
|
||||
IDD_EXCEPTION, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 289
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 176
|
||||
END
|
||||
|
||||
IDD_URUTAP_LOGIN, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 181
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 104
|
||||
END
|
||||
|
||||
IDD_URU_LOGIN, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 4
|
||||
RIGHTMARGIN, 168
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 128
|
||||
END
|
||||
|
||||
IDD_URU_EULA, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 194
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 151
|
||||
END
|
||||
|
||||
IDD_URULOGIN_MAIN, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 295
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 223
|
||||
END
|
||||
|
||||
IDD_URULOGIN_EULA, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 293
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 311
|
||||
END
|
||||
|
||||
IDD_AUTHFAILED, DIALOG
|
||||
BEGIN
|
||||
RIGHTMARGIN, 175
|
||||
BOTTOMMARGIN, 87
|
||||
END
|
||||
|
||||
IDD_AUTHENTICATING, DIALOG
|
||||
BEGIN
|
||||
RIGHTMARGIN, 175
|
||||
BOTTOMMARGIN, 57
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// CNSL
|
||||
//
|
||||
|
||||
IDR_CNSL1 CNSL "cnsl1.bin"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// JPEG
|
||||
//
|
||||
|
||||
IDR_LOADING_01 JPEG "xLoading_Linking.01.jpg"
|
||||
IDR_LOADING_02 JPEG "xLoading_Linking.02.jpg"
|
||||
IDR_LOADING_03 JPEG "xLoading_Linking.03.jpg"
|
||||
IDR_LOADING_04 JPEG "xLoading_Linking.04.jpg"
|
||||
IDR_LOADING_05 JPEG "xLoading_Linking.05.jpg"
|
||||
IDR_LOADING_06 JPEG "xLoading_Linking.06.jpg"
|
||||
IDR_LOADING_07 JPEG "xLoading_Linking.07.jpg"
|
||||
IDR_LOADING_08 JPEG "xLoading_Linking.08.jpg"
|
||||
IDR_LOADING_09 JPEG "xLoading_Linking.09.jpg"
|
||||
IDR_LOADING_10 JPEG "xLoading_Linking.10.jpg"
|
||||
IDR_LOADING_11 JPEG "xLoading_Linking.11.jpg"
|
||||
IDR_LOADING_12 JPEG "xLoading_Linking.12.jpg"
|
||||
IDR_LOADING_13 JPEG "xLoading_Linking.13.jpg"
|
||||
IDR_LOADING_14 JPEG "xLoading_Linking.14.jpg"
|
||||
IDR_LOADING_15 JPEG "xLoading_Linking.15.jpg"
|
||||
IDR_LOADING_16 JPEG "xLoading_Linking.16.jpg"
|
||||
IDR_LOADING_17 JPEG "xLoading_Linking.17.jpg"
|
||||
IDR_LOADING_18 JPEG "xLoading_Linking.18.jpg"
|
||||
IDR_LOADING_LINKTEXT JPEG "xLoading_Linking_Text.jpg"
|
||||
IDR_LOADING_UPDATETEXT JPEG "xLoading_Updating_Text.jpg"
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
#define _AFX_NO_SPLITTER_RESOURCES
|
||||
#define _AFX_NO_OLE_RESOURCES
|
||||
#define _AFX_NO_TRACKER_RESOURCES
|
||||
#define _AFX_NO_PROPERTY_RESOURCES
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
#endif
|
||||
|
||||
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "plClient.exe.manifest"
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
@ -0,0 +1,103 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by plClient.rc
|
||||
//
|
||||
#define IDB_CURSOR_UP 112
|
||||
#define IDB_CURSOR_DOWN 113
|
||||
#define IDB_CURSOR_RIGHT 114
|
||||
#define IDB_CURSOR_LEFT 115
|
||||
#define IDB_CURSOR_OPEN 116
|
||||
#define IDB_CURSOR_GRAB 117
|
||||
#define IDB_CURSOR_CLICKED 118
|
||||
#define IDB_CURSOR_POISED 119
|
||||
#define IDB_MICROPHONE 121
|
||||
#define IDB_TALKING 122
|
||||
#define IDB_CURSOR_ARROW 123
|
||||
#define IDB_CURSOR_4WAYOPEN 124
|
||||
#define IDB_CURSOR_UPDOWNCLOSED 125
|
||||
#define IDB_CURSOR_UPDOWNOPEN 126
|
||||
#define IDB_CURSOR_4WAYCLOSED 127
|
||||
#define IDB_CURSOR_LEFTRIGHTCLOSED 128
|
||||
#define IDB_CURSOR_LEFTRIGHTOPEN 129
|
||||
#define IDI_ICON_DIRT 135
|
||||
#define IDD_LOADING 136
|
||||
#define IDD_EXCEPTION 138
|
||||
#define IDR_CNSL1 139
|
||||
#define IDB_CURSOR_BOOK_HIGHLIGHT 141
|
||||
#define IDB_CURSOR_BOOK 142
|
||||
#define IDB_CURSOR_BOOK_CLICKED 143
|
||||
#define IDB_CURSOR_DISABLED 144
|
||||
#define IDB_CURSOR_HAND 145
|
||||
#define IDB_CURSOR_UPWARD 147
|
||||
#define IDD_URUTAP_LOGIN 148
|
||||
#define IDD_URU_LOGIN 149
|
||||
#define IDB_BANNER 151
|
||||
#define IDD_URU_EULA 152
|
||||
#define IDD_URULOGIN_MAIN 153
|
||||
#define IDD_URULOGIN_EULA 154
|
||||
#define IDD_AUTHFAILED 155
|
||||
#define IDD_AUTHENTICATING 156
|
||||
#define IDR_LOADING_01 177
|
||||
#define IDR_LOADING_02 178
|
||||
#define IDR_LOADING_03 179
|
||||
#define IDR_LOADING_04 180
|
||||
#define IDR_LOADING_05 181
|
||||
#define IDR_LOADING_06 182
|
||||
#define IDR_LOADING_07 183
|
||||
#define IDR_LOADING_08 184
|
||||
#define IDR_LOADING_09 185
|
||||
#define IDR_LOADING_10 186
|
||||
#define IDR_LOADING_11 187
|
||||
#define IDR_LOADING_12 188
|
||||
#define IDR_LOADING_13 189
|
||||
#define IDR_LOADING_14 190
|
||||
#define IDR_LOADING_15 191
|
||||
#define IDR_LOADING_16 192
|
||||
#define IDR_LOADING_17 193
|
||||
#define IDR_LOADING_18 194
|
||||
#define IDR_LOADING_LINKTEXT 195
|
||||
#define IDR_LOADING_UPDATETEXT 196
|
||||
#define IDC_CRASHINFO 1001
|
||||
#define IDC_COPY 1002
|
||||
#define IDC_MSG 1003
|
||||
#define IDC_STARTING_TEXT 1004
|
||||
#define IDC_URUTAP_USERNAME 1005
|
||||
#define IDC_URUTAP_PASSWORD 1006
|
||||
#define IDC_URUTAP_SERVER 1008
|
||||
#define IDC_URUTAP_DESTROY 1009
|
||||
#define IDC_USERNAME 1010
|
||||
#define IDC_PASSWORD 1011
|
||||
#define IDC_REMEMBER_PASS 1012
|
||||
#define IDC_IMAGE_BANNER 1013
|
||||
#define IDC_BOX_01 1014
|
||||
#define IDC_BOX_02 1015
|
||||
#define IDC_TEXT_WELCOME 1016
|
||||
#define IDC_TEXT_USER 1017
|
||||
#define IDC_TEXT_PASS 1018
|
||||
#define IDC_CUSTOM1 1019
|
||||
#define IDC_DYN_EULA 1019
|
||||
#define IDC_BOX_03 1020
|
||||
#define IDC_TEXT_TERMS 1021
|
||||
#define IDC_URULOGIN_REMEMBERPASS 1022
|
||||
#define IDC_URULOGIN_USERNAME 1023
|
||||
#define IDC_URULOGIN_PASSWORD 1024
|
||||
#define IDC_URULOGIN_EULATEXT 1025
|
||||
#define IDC_RICHEDIT22 1028
|
||||
#define IDC_AUTH_TEXT 1029
|
||||
#define IDC_BUTTON1 1030
|
||||
#define IDC_URULOGIN_GAMETAPLINK 1030
|
||||
#define IDC_AUTH_MESSAGE 1031
|
||||
#define IDC_PRODUCTSTRING 1033
|
||||
#define IDC_STATUS_TEXT 1034
|
||||
#define IDC_HOTKEY1 1035
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 197
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1036
|
||||
#define _APS_NEXT_SYMED_VALUE 103
|
||||
#endif
|
||||
#endif
|
After Width: | Height: | Size: 6.4 KiB |
After Width: | Height: | Size: 6.3 KiB |
After Width: | Height: | Size: 6.3 KiB |
After Width: | Height: | Size: 6.4 KiB |
After Width: | Height: | Size: 6.3 KiB |
After Width: | Height: | Size: 6.4 KiB |
After Width: | Height: | Size: 6.3 KiB |
After Width: | Height: | Size: 6.4 KiB |
After Width: | Height: | Size: 6.3 KiB |
After Width: | Height: | Size: 6.3 KiB |
After Width: | Height: | Size: 6.3 KiB |
After Width: | Height: | Size: 6.4 KiB |
After Width: | Height: | Size: 6.2 KiB |
After Width: | Height: | Size: 6.4 KiB |
After Width: | Height: | Size: 6.3 KiB |
After Width: | Height: | Size: 6.3 KiB |
After Width: | Height: | Size: 6.3 KiB |
After Width: | Height: | Size: 6.4 KiB |
After Width: | Height: | Size: 29 KiB |
After Width: | Height: | Size: 29 KiB |
@ -0,0 +1,35 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include <windows.h>
|
||||
|
||||
__declspec(dllexport) const unsigned long* GetKey()
|
||||
{
|
||||
// So the crackers know who the tard is
|
||||
static const char* tauntText = "My copy protection is uncrackable! -Brice";
|
||||
|
||||
static const unsigned long kDefaultKey[4] = { 0x6c0a5452, 0x3827d0f, 0x3a170b92, 0x16db7fc2 };
|
||||
return kDefaultKey;
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "plClientKey.h"
|
||||
#include "hsWindows.h"
|
||||
|
||||
typedef const UInt32* (*GETKEY)();
|
||||
|
||||
const UInt32* plClientKey::GetKey()
|
||||
{
|
||||
HMODULE hDll = LoadLibrary("sp.dll");
|
||||
if (hDll)
|
||||
{
|
||||
GETKEY getKey = (GETKEY)GetProcAddress(hDll, "GetKey");
|
||||
if (getKey)
|
||||
{
|
||||
static UInt32 key[4];
|
||||
memcpy(key, getKey(), sizeof(key));
|
||||
FreeLibrary(hDll);
|
||||
return key;
|
||||
}
|
||||
}
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
@ -0,0 +1,5 @@
|
||||
LIBRARY
|
||||
EXPORTS
|
||||
GetKey @1
|
||||
SECTIONS
|
||||
.data READ WRITE
|
@ -0,0 +1,43 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#ifndef plClientKey_h_inc
|
||||
#define plClientKey_h_inc
|
||||
|
||||
#include "hsTypes.h"
|
||||
|
||||
//
|
||||
// For getting the "SafeDisc protected" encryption key in single player mode
|
||||
//
|
||||
// Include plClientKey.cpp/h in your project and call plClientKey::GetKey
|
||||
// It will load the Dll and get the key for you
|
||||
// Returns nil if it fails
|
||||
//
|
||||
namespace plClientKey
|
||||
{
|
||||
const UInt32* GetKey();
|
||||
}
|
||||
|
||||
#endif // plClientKey_h_inc
|
@ -0,0 +1,42 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/Apps/plClientPatcher/Intern.h
|
||||
*
|
||||
***/
|
||||
|
||||
#ifdef PLASMA20_SOURCES_PLASMA_APPS_PLCLIENTPATCHER_INTERN_H
|
||||
#error "Header $/Plasma20/Sources/Plasma/Apps/plClientPatcher/Intern.h included more than once"
|
||||
#endif
|
||||
#define PLASMA20_SOURCES_PLASMA_APPS_PLCLIENTPATCHER_INTERN_H
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* SelfPatcher.cpp
|
||||
*
|
||||
***/
|
@ -0,0 +1,58 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/Apps/plClientPatcher/Pch.h
|
||||
*
|
||||
***/
|
||||
|
||||
#ifdef PLASMA20_SOURCES_PLASMA_APPS_PLCLIENTPATCHER_PCH_H
|
||||
#error "Header $/Plasma20/Sources/Plasma/Apps/plClientPatcher/Pch.h included more than once"
|
||||
#endif
|
||||
#define PLASMA20_SOURCES_PLASMA_APPS_PLCLIENTPATCHER_PCH_H
|
||||
|
||||
#include <process.h>
|
||||
#include <time.h>
|
||||
#include "pnUtils/pnUtils.h"
|
||||
#include "pnNetBase/pnNetBase.h"
|
||||
#include "pnAsyncCore/pnAsyncCore.h"
|
||||
#include "pnProduct/pnProduct.h"
|
||||
#include "pnNetCli/pnNetCli.h"
|
||||
#include "plNetGameLib/plNetGameLib.h"
|
||||
#include "plEncryption/plChecksum.h"
|
||||
#include "plAgeDescription/plAgeManifest.h"
|
||||
#include "plAudioCore/plAudioFileReader.h"
|
||||
|
||||
#define USES_PROTOCOL_CLI2AUTH
|
||||
#include "pnNetProtocol/pnNetProtocol.h"
|
||||
|
||||
#include "UruPlayer.h"
|
||||
|
||||
#include "plCompression/plZlibStream.h"
|
||||
#include "Intern.h"
|
||||
#include "../plUruLauncher/plLauncherInfo.h"
|
||||
|
||||
|
@ -0,0 +1,51 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/Apps/plClientPatcher/UruPlayer.h
|
||||
*
|
||||
***/
|
||||
|
||||
#ifdef PLASMA20_SOURCES_PLASMA_APPS_PLCLIENTPATCHER_URUPLAYER_H
|
||||
#error "Header $/Plasma20/Sources/Plasma/Apps/plClientPatcher/UruPlayer.h included more than once"
|
||||
#endif
|
||||
#define PLASMA20_SOURCES_PLASMA_APPS_PLCLIENTPATCHER_URUPLAYER_H
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* UruPlayer.cpp
|
||||
*
|
||||
***/
|
||||
|
||||
void InitAsyncCore ();
|
||||
void ShutdownAsyncCore () ;
|
||||
void UruPrepProc (void * param);
|
||||
void UruStartProc (void * param);
|
||||
void PlayerTerminateProc (void * param);
|
||||
void PlayerStopProc (void * param);
|
||||
|
||||
extern const wchar kPatcherExeFilename[];
|
@ -0,0 +1,49 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/Apps/plUruLauncher/plLauncherCallback.h
|
||||
*
|
||||
***/
|
||||
|
||||
#ifdef PLASMA20_SOURCES_PLASMA_APPS_PLURULAUNCHER_PLLAUNCHERCALLBACK_H
|
||||
#error "Header $/Plasma20/Sources/Plasma/Apps/plUruLauncher/plLauncherCallback.h included more than once"
|
||||
#endif
|
||||
#define PLASMA20_SOURCES_PLASMA_APPS_PLURULAUNCHER_PLLAUNCHERCALLBACK_H
|
||||
|
||||
enum EStatus {
|
||||
kStatusOk,
|
||||
};
|
||||
|
||||
typedef void (*launcherCallback)(int status, void *param);
|
||||
struct plLauncherCallback {
|
||||
launcherCallback prepCallback;
|
||||
launcherCallback initCallback;
|
||||
launcherCallback startCallback;
|
||||
launcherCallback stopCallback;
|
||||
launcherCallback terminateCallback;
|
||||
|
||||
};
|
@ -0,0 +1,109 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "../plFile/hsFiles.h"
|
||||
#include "../plFile/plEncryptedStream.h"
|
||||
#include "../pnUtils/pnUtils.h"
|
||||
#include "../pnProduct/pnProduct.h"
|
||||
#include "hsUtils.h"
|
||||
|
||||
void EncryptFiles(const char* dir, const char* ext, bool encrypt);
|
||||
|
||||
void print_version(){
|
||||
wchar productString[256];
|
||||
ProductString(productString, arrsize(productString));
|
||||
printf("%S\n\n", productString);
|
||||
}
|
||||
|
||||
void print_help() {
|
||||
printf("plFileEncrypt - Encrypts and Decrypts Uru Files.\n\n");
|
||||
print_version();
|
||||
printf("Usage: plFileEncrypt \t[(encrypt|-e)|(decrypt|-d|)|(--help|-h|-?|/h)|(-v)]\n");
|
||||
printf("\tencrypt|-e\t - Encrypts All .age, .fni, .ini, .csv, and .sdl files in the current folder.\n");
|
||||
printf("\tdecrypt|-d\t - Decrypts All .age, .fni, .ini, .csv, and .sdl files in the current folder.\n");
|
||||
printf("\t--help|-h|-?|/h\t - Prints Help. This Screen.\n");
|
||||
printf("\t-v|--version\t - Prints build version information\n");
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
bool encrypt = true;
|
||||
const char* dir = ".";
|
||||
|
||||
if (argc > 1)
|
||||
{
|
||||
if (hsStrEQ(argv[1], "encrypt") || hsStrEQ(argv[1], "-e") )
|
||||
{
|
||||
if (argc > 2)
|
||||
dir = argv[2];
|
||||
encrypt = true;
|
||||
}
|
||||
else if (hsStrEQ(argv[1], "decrypt") || hsStrEQ(argv[1], "-d"))
|
||||
{
|
||||
if (argc > 2)
|
||||
dir = argv[2];
|
||||
encrypt = false;
|
||||
}
|
||||
else if(hsStrEQ(argv[1], "--help") || hsStrEQ(argv[1], "-h") || hsStrEQ(argv[1], "-?") || hsStrEQ(argv[1], "/?"))
|
||||
{
|
||||
print_help();
|
||||
return 0;
|
||||
}
|
||||
else if (hsStrEQ(argv[1], "-v") || hsStrEQ(argv[1], "--version"))
|
||||
{
|
||||
print_version();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
EncryptFiles(dir, ".age", encrypt);
|
||||
EncryptFiles(dir, ".fni", encrypt);
|
||||
EncryptFiles(dir, ".ini", encrypt);
|
||||
EncryptFiles(dir, ".sdl", encrypt);
|
||||
EncryptFiles(dir, ".csv", encrypt);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void EncryptFiles(const char* dir, const char* ext, bool encrypt)
|
||||
{
|
||||
char filePath[256];
|
||||
|
||||
hsFolderIterator folder(dir);
|
||||
while (folder.NextFileSuffix(ext))
|
||||
{
|
||||
folder.GetPathAndName(filePath);
|
||||
if (encrypt)
|
||||
{
|
||||
printf("encrypting: %s\n", folder.GetFileName());
|
||||
plEncryptedStream::FileEncrypt(filePath);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("decrypting: %s\n", folder.GetFileName());
|
||||
plEncryptedStream::FileDecrypt(filePath);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,196 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "../plFile/hsFiles.h"
|
||||
#include "../plFile/plFileUtils.h"
|
||||
#include "../plFile/plSecureStream.h"
|
||||
#include "../pnUtils/pnUtils.h"
|
||||
#include "../pnProduct/pnProduct.h"
|
||||
#include "hsUtils.h"
|
||||
|
||||
#include <time.h>
|
||||
#include <string>
|
||||
|
||||
void print_version() {
|
||||
wchar productString[256];
|
||||
ProductString(productString, arrsize(productString));
|
||||
printf("%S\n\n", productString);
|
||||
}
|
||||
|
||||
void print_help() {
|
||||
printf("plFileSecure - Secures Uru files and generates encryption.key files.\n\n");
|
||||
print_version();
|
||||
printf("Usage:\n");
|
||||
printf("\tplFileSecure (<directory> <ext>)|[/generate /default]\n");
|
||||
printf("\n");
|
||||
printf("<directory> <ext> : The directory and extension of files to secure. Cannot\n");
|
||||
printf(" be used with /generate. Uses the %s file in\n", plFileUtils::kKeyFilename);
|
||||
printf(" the current directory (or default key if no file exists)\n");
|
||||
printf("/generate : Generates a random key and writes it to a %s\n", plFileUtils::kKeyFilename);
|
||||
printf(" file in the current directory. Cannot be used with\n");
|
||||
printf(" <directory> <ext>\n");
|
||||
printf("/default : If used with /generate, creates a %s file\n", plFileUtils::kKeyFilename);
|
||||
printf(" with the default key. If used with <directory> <ext>, it\n");
|
||||
printf(" secures with the default key instead of the\n");
|
||||
printf(" %s file's key\n", plFileUtils::kKeyFilename);
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
void GenerateKey(bool useDefault)
|
||||
{
|
||||
UInt32 key[4];
|
||||
if (useDefault)
|
||||
{
|
||||
unsigned memSize = min(arrsize(key), arrsize(plSecureStream::kDefaultKey));
|
||||
memSize *= sizeof(UInt32);
|
||||
memcpy(key, plSecureStream::kDefaultKey, memSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
srand((unsigned)time(nil));
|
||||
double randNum = (double)rand() / (double)RAND_MAX; // converts to 0..1
|
||||
UInt32 keyNum = (UInt32)(randNum * (double)0xFFFFFFFF); // multiply it by the max unsigned 32-bit int
|
||||
key[0] = keyNum;
|
||||
|
||||
randNum = (double)rand() / (double)RAND_MAX;
|
||||
keyNum = (UInt32)(randNum * (double)0xFFFFFFFF);
|
||||
key[1] = keyNum;
|
||||
|
||||
randNum = (double)rand() / (double)RAND_MAX;
|
||||
keyNum = (UInt32)(randNum * (double)0xFFFFFFFF);
|
||||
key[2] = keyNum;
|
||||
|
||||
randNum = (double)rand() / (double)RAND_MAX;
|
||||
keyNum = (UInt32)(randNum * (double)0xFFFFFFFF);
|
||||
key[3] = keyNum;
|
||||
}
|
||||
|
||||
hsUNIXStream out;
|
||||
out.Open(plFileUtils::kKeyFilename, "wb");
|
||||
out.Write(sizeof(UInt32) * arrsize(key), (void*)key);
|
||||
out.Close();
|
||||
}
|
||||
|
||||
void SecureFiles(std::string dir, std::string ext, UInt32* key)
|
||||
{
|
||||
char filePath[256];
|
||||
|
||||
hsFolderIterator folder(dir.c_str());
|
||||
while (folder.NextFileSuffix(ext.c_str()))
|
||||
{
|
||||
folder.GetPathAndName(filePath);
|
||||
printf("securing: %s\n", folder.GetFileName());
|
||||
plSecureStream::FileEncrypt(filePath, key);
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
bool generatingKey = false;
|
||||
bool useDefault = false;
|
||||
std::string directory;
|
||||
std::string ext;
|
||||
|
||||
if (argc > 1)
|
||||
{
|
||||
for (int i = 1; i < argc; i++)
|
||||
{
|
||||
std::string arg = argv[i];
|
||||
if ((arg[0] == '-')||(arg[0] == '/'))
|
||||
{
|
||||
// this arg is a flag of some kind
|
||||
arg = arg.substr(1, arg.length()); // trim the dash or slash
|
||||
if ((stricmp(arg.c_str(), "g") == 0) || (stricmp(arg.c_str(), "generate") == 0))
|
||||
{
|
||||
if (!generatingKey)
|
||||
generatingKey = true;
|
||||
else
|
||||
{
|
||||
print_help();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else if ((stricmp(arg.c_str(), "d") == 0) || (stricmp(arg.c_str(), "default") == 0))
|
||||
{
|
||||
if (!useDefault)
|
||||
useDefault = true;
|
||||
else
|
||||
{
|
||||
print_help();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print_help();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// else it is a directory or extension
|
||||
if (directory == "")
|
||||
directory = argv[i];
|
||||
else if (ext == "")
|
||||
ext = argv[i];
|
||||
else
|
||||
{
|
||||
print_help();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (generatingKey && ((directory != "") || (ext != "")))
|
||||
{
|
||||
print_help();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print_help();
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (generatingKey)
|
||||
{
|
||||
GenerateKey(useDefault);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (ext[0] != '.')
|
||||
ext = "." + ext; // tack on the dot if necessary
|
||||
|
||||
if (useDefault)
|
||||
SecureFiles(directory, ext, nil);
|
||||
else
|
||||
{
|
||||
UInt32 key[4];
|
||||
plFileUtils::GetSecureEncryptionKey(plFileUtils::kKeyFilename, key, arrsize(key));
|
||||
SecureFiles(directory, ext, key);
|
||||
}
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,110 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* plLogDecrypt - Used by mantis to decrypt log files
|
||||
*
|
||||
***/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "hsTypes.h"
|
||||
#include "../plStatusLog/plEncryptLogLine.h"
|
||||
|
||||
void IProcessFile(const char *path)
|
||||
{
|
||||
char out_path[512];
|
||||
strcpy(out_path, path);
|
||||
strcat(out_path, ".decrypt");
|
||||
|
||||
FILE * fpIn = fopen(path, "rb");
|
||||
FILE * fpOut = fopen(out_path, "w");
|
||||
|
||||
if( fpIn != nil && fpOut != nil)
|
||||
{
|
||||
UInt8 line[ 2048 ];
|
||||
while( !feof( fpIn ) )
|
||||
{
|
||||
// Read next string
|
||||
long pos = ftell(fpIn);
|
||||
if( pos == -1L )
|
||||
break;
|
||||
UInt8 hint = (UInt8)pos;
|
||||
UInt16 sizeHint = (UInt16)pos;
|
||||
UInt16 size;
|
||||
|
||||
if( stricmp( path + strlen( path ) - 4, ".log" ) == 0 )
|
||||
{
|
||||
int i;
|
||||
for( i = 0; i < 511; i++ )
|
||||
{
|
||||
int c = fgetc( fpIn );
|
||||
if( c == EOF || c == hint )
|
||||
break;
|
||||
line[ i ] = (UInt8)c;
|
||||
}
|
||||
line[ i ] = 0;
|
||||
size = i;
|
||||
}
|
||||
else
|
||||
{
|
||||
// UInt16 line length is encoded first
|
||||
int c = fgetc( fpIn );
|
||||
if( c == EOF )
|
||||
break;
|
||||
size = ( c & 0xff ) | ( fgetc( fpIn ) << 8 );
|
||||
|
||||
size = size ^ sizeHint;
|
||||
|
||||
if( size > sizeof( line ) )
|
||||
{
|
||||
hsAssert( size <= sizeof( line ) - 1, "Invalid line size" );
|
||||
break;
|
||||
}
|
||||
|
||||
fread( line, 1, size, fpIn );
|
||||
line[ size ] = 0;
|
||||
}
|
||||
|
||||
plStatusEncrypt::Decrypt( line, size, hint );
|
||||
fprintf(fpOut, "%s\n", (const char *)line);
|
||||
}
|
||||
}
|
||||
|
||||
if (fpIn)
|
||||
fclose(fpIn);
|
||||
if (fpOut)
|
||||
fclose(fpOut);
|
||||
}
|
||||
|
||||
int main(int argc, const char * argv[])
|
||||
{
|
||||
if (argc == 2)
|
||||
{
|
||||
IProcessFile(argv[1]);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/Apps/plMD5/Intern.h
|
||||
*
|
||||
***/
|
||||
|
||||
#ifdef PLASMA20_SOURCES_PLASMA_APPS_PLMD5_INTERN_H
|
||||
#error "Header $/Plasma20/Sources/Plasma/Apps/plMD5/Intern.h included more than once"
|
||||
#endif
|
||||
#define PLASMA20_SOURCES_PLASMA_APPS_PLMD5_INTERN_H
|
@ -0,0 +1,58 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/Apps/plMD5/Main.cpp
|
||||
*
|
||||
***/
|
||||
|
||||
#include "Pch.h"
|
||||
#pragma hdrstop
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Exports
|
||||
*
|
||||
***/
|
||||
|
||||
//============================================================================
|
||||
int __cdecl main (int argc, char ** argv) {
|
||||
|
||||
if (argc < 2) {
|
||||
fprintf(stderr, "ERROR: Please specify filename.\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
plMD5Checksum md5(argv[1]);
|
||||
if (!md5.IsValid()) {
|
||||
fprintf(stderr, "ERROR: MD5 failed.\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
fprintf(stdout, "%s\n", md5.GetAsHexString());
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/Apps/plMD5/Pch.h
|
||||
*
|
||||
***/
|
||||
|
||||
#ifdef PLASMA20_SOURCES_PLASMA_APPS_PLMD5_PCH_H
|
||||
#error "Header $/Plasma20/Sources/Plasma/Apps/plMD5/Pch.h included more than once"
|
||||
#endif
|
||||
#define PLASMA20_SOURCES_PLASMA_APPS_PLMD5_PCH_H
|
||||
|
||||
#include "pnUtils/pnUtils.h"
|
||||
#include "pnProduct/pnProduct.h"
|
||||
#include "plEncryption/plChecksum.h"
|
||||
|
||||
#include <stdio.h>
|
@ -0,0 +1,54 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "hsTypes.h"
|
||||
|
||||
#include "../pnFactory/plCreator.h"
|
||||
|
||||
#include "plAudible.h"
|
||||
REGISTER_NONCREATABLE( plAudible );
|
||||
|
||||
#include "plDrawable.h"
|
||||
REGISTER_NONCREATABLE( plDrawable );
|
||||
|
||||
#include "plPhysical.h"
|
||||
REGISTER_NONCREATABLE( plPhysical );
|
||||
|
||||
#include "plgDispatch.h"
|
||||
REGISTER_NONCREATABLE( plDispatchBase );
|
||||
|
||||
#include "../pnDispatch/pnDispatchCreatable.h"
|
||||
#include "../pnKeyedObject/pnKeyedObjectCreatable.h"
|
||||
#include "../pnMessage/pnMessageCreatable.h"
|
||||
#include "../pnModifier/pnModifierCreatable.h"
|
||||
#include "../pnNetCommon/pnNetCommonCreatable.h"
|
||||
#include "../pnTimer/pnTimerCreatable.h"
|
||||
|
||||
#include "../plResMgr/plResMgrCreatable.h"
|
||||
|
||||
#include "../plMessage/plResMgrHelperMsg.h"
|
||||
REGISTER_CREATABLE(plResMgrHelperMsg);
|
||||
|
||||
#include "../plAudioCore/plAudioCoreCreatable.h"
|
@ -0,0 +1,254 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "hsUtils.h"
|
||||
#include "hsTimer.h"
|
||||
#include "../plFile/hsFiles.h"
|
||||
#include "../plFile/plFileUtils.h"
|
||||
#include "../plResMgr/plResManager.h"
|
||||
#include "../plResMgr/plResMgrSettings.h"
|
||||
|
||||
#include "../plAgeDescription/plAgeManifest.h"
|
||||
|
||||
#include "../plResMgr/plRegistryHelpers.h"
|
||||
#include "../plResMgr/plRegistryNode.h"
|
||||
|
||||
#include "../plAudioCore/plSoundBuffer.h"
|
||||
#include "hsStream.h"
|
||||
|
||||
#include "../pnUtils/pnUtils.h"
|
||||
#include "../pnProduct/pnProduct.h"
|
||||
|
||||
|
||||
//// Globals /////////////////////////////////////////////////////////////////
|
||||
|
||||
plResManager* gResMgr = nil;
|
||||
|
||||
bool DumpStats(const char* patchDir);
|
||||
bool DumpSounds();
|
||||
|
||||
//// PrintVersion ///////////////////////////////////////////////////////////////
|
||||
void PrintVersion()
|
||||
{
|
||||
wchar productString[256];
|
||||
ProductString(productString, arrsize(productString));
|
||||
_putws(productString);
|
||||
}
|
||||
|
||||
//// PrintHelp ///////////////////////////////////////////////////////////////
|
||||
|
||||
int PrintHelp( void )
|
||||
{
|
||||
puts("");
|
||||
PrintVersion();
|
||||
puts("");
|
||||
puts("Usage: plPageInfo [-s -i] pageFile");
|
||||
puts(" plPageInfo -v");
|
||||
puts("Where:" );
|
||||
puts(" -v print version and exit.");
|
||||
puts(" -s dump sounds in page to the console");
|
||||
puts(" -i dump object size info to .csv files");
|
||||
puts(" pageFile is the path to the .prp file");
|
||||
puts("");
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
//// main ////////////////////////////////////////////////////////////////////
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
if (argc >= 1 && hsStrEQ(argv[1], "-v"))
|
||||
{
|
||||
PrintVersion();
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (argc < 3)
|
||||
return PrintHelp();
|
||||
|
||||
bool sounds = false;
|
||||
bool stats = false;
|
||||
|
||||
int arg = 1;
|
||||
for (arg = 1; arg < argc; arg++)
|
||||
{
|
||||
if (hsStrEQ(argv[arg], "-s"))
|
||||
sounds = true;
|
||||
else if (hsStrEQ(argv[arg], "-i"))
|
||||
stats = true;
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
// Make sure we have 1 arg left after getting the options
|
||||
char* pageFile = nil;
|
||||
if (arg < argc)
|
||||
pageFile = argv[arg];
|
||||
else
|
||||
return PrintHelp();
|
||||
|
||||
// Init our special resMgr
|
||||
plResMgrSettings::Get().SetFilterNewerPageVersions(false);
|
||||
plResMgrSettings::Get().SetFilterOlderPageVersions(false);
|
||||
plResMgrSettings::Get().SetLoadPagesOnInit(false);
|
||||
gResMgr = TRACKED_NEW plResManager;
|
||||
hsgResMgr::Init(gResMgr);
|
||||
gResMgr->AddSinglePage(pageFile);
|
||||
|
||||
if (sounds)
|
||||
DumpSounds();
|
||||
if (stats)
|
||||
{
|
||||
char path[256];
|
||||
strcpy(path, pageFile);
|
||||
plFileUtils::StripFile(path);
|
||||
DumpStats(path);
|
||||
}
|
||||
|
||||
hsgResMgr::Shutdown();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//// plSoundBufferCollector //////////////////////////////////////////////////
|
||||
// Page iterator that collects all the plSoundBuffers in all of our pages
|
||||
|
||||
class plSoundBufferCollector : public plRegistryPageIterator, public plKeyCollector
|
||||
{
|
||||
public:
|
||||
plSoundBufferCollector(hsTArray<plKey>& keyArray)
|
||||
: plKeyCollector(keyArray) {}
|
||||
|
||||
hsBool EatPage(plRegistryPageNode* page)
|
||||
{
|
||||
page->LoadKeys();
|
||||
return page->IterateKeys(this, plSoundBuffer::Index());
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
bool DumpSounds()
|
||||
{
|
||||
hsTArray<plKey> soundKeys;
|
||||
|
||||
plSoundBufferCollector soundCollector(soundKeys);
|
||||
gResMgr->IterateAllPages(&soundCollector);
|
||||
|
||||
for (int i = 0; i < soundKeys.GetCount(); i++)
|
||||
{
|
||||
plSoundBuffer* buffer = plSoundBuffer::ConvertNoRef(soundKeys[i]->VerifyLoaded());
|
||||
if (buffer)
|
||||
{
|
||||
// Ref it...
|
||||
buffer->GetKey()->RefObject();
|
||||
|
||||
// Get the filename from it and add that file if necessary
|
||||
const char* filename = buffer->GetFileName();
|
||||
if (filename)
|
||||
{
|
||||
UInt32 flags = 0;
|
||||
|
||||
if (stricmp(plFileUtils::GetFileExt(filename), "wav") != 0)
|
||||
{
|
||||
if (buffer->HasFlag(plSoundBuffer::kOnlyLeftChannel) ||
|
||||
buffer->HasFlag(plSoundBuffer::kOnlyRightChannel))
|
||||
hsSetBits(flags, plManifestFile::kSndFlagCacheSplit);
|
||||
else if (buffer->HasFlag(plSoundBuffer::kStreamCompressed))
|
||||
hsSetBits(flags, plManifestFile::kSndFlagStreamCompressed);
|
||||
else
|
||||
hsSetBits(flags, plManifestFile::kSndFlagCacheStereo);
|
||||
}
|
||||
|
||||
printf("%s,%u\n", filename, flags);
|
||||
}
|
||||
|
||||
// Unref the object so it goes away
|
||||
buffer->GetKey()->UnRefObject();
|
||||
}
|
||||
}
|
||||
|
||||
soundKeys.Reset();
|
||||
plIndirectUnloadIterator iter;
|
||||
gResMgr->IterateAllPages(&iter);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "../pnKeyedObject/plKeyImp.h"
|
||||
|
||||
class plStatDumpIterator : public plRegistryPageIterator, public plRegistryKeyIterator
|
||||
{
|
||||
protected:
|
||||
const char* fOutputDir;
|
||||
hsUNIXStream fStream;
|
||||
|
||||
public:
|
||||
plStatDumpIterator(const char* outputDir) : fOutputDir(outputDir) {}
|
||||
|
||||
hsBool EatKey(const plKey& key)
|
||||
{
|
||||
plKeyImp* imp = (plKey)key;
|
||||
|
||||
fStream.WriteString(imp->GetName());
|
||||
fStream.WriteString(",");
|
||||
|
||||
fStream.WriteString(plFactory::GetNameOfClass(imp->GetUoid().GetClassType()));
|
||||
fStream.WriteString(",");
|
||||
|
||||
char buf[30];
|
||||
sprintf(buf, "%u", imp->GetDataLen());
|
||||
fStream.WriteString(buf);
|
||||
fStream.WriteString("\n");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
hsBool EatPage(plRegistryPageNode* page)
|
||||
{
|
||||
const plPageInfo& info = page->GetPageInfo();
|
||||
|
||||
char fileName[256];
|
||||
sprintf(fileName, "%s%s_%s.csv", fOutputDir, info.GetAge(), info.GetPage());
|
||||
fStream.Open(fileName, "wt");
|
||||
|
||||
page->LoadKeys();
|
||||
page->IterateKeys(this);
|
||||
|
||||
fStream.Close();
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
bool DumpStats(const char* patchDir)
|
||||
{
|
||||
plStatDumpIterator statDump(patchDir);
|
||||
gResMgr->IterateAllPages(&statDump);
|
||||
return true;
|
||||
}
|
@ -0,0 +1,105 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "../plResMgr/plResManager.h"
|
||||
#include "../pfPython/plPythonFileMod.h"
|
||||
#include "../plGImage/plFontCache.h"
|
||||
#include "../plPhysX/plSimulationMgr.h"
|
||||
#include "../plAvatar/plAvatarMgr.h"
|
||||
|
||||
#include "plPageOptimizer.h"
|
||||
#include "../plFile/plFileUtils.h"
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
if (argc != 2)
|
||||
{
|
||||
printf("plPageOptimizer: wrong number of arguments");
|
||||
return 1;
|
||||
}
|
||||
|
||||
printf("Optimizing %s...", plFileUtils::GetFileName(argv[1]));
|
||||
|
||||
plFontCache* fontCache;
|
||||
#ifndef _DEBUG
|
||||
try
|
||||
{
|
||||
#endif
|
||||
plResManager* resMgr = TRACKED_NEW plResManager;
|
||||
hsgResMgr::Init(resMgr);
|
||||
|
||||
// Setup all the crap that needs to be around to load
|
||||
plSimulationMgr::Init();
|
||||
fontCache = TRACKED_NEW plFontCache;
|
||||
plPythonFileMod::SetAtConvertTime();
|
||||
#ifndef _DEBUG
|
||||
} catch (...)
|
||||
{
|
||||
printf(" ***crashed on init");
|
||||
return 2;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef _DEBUG
|
||||
try
|
||||
#endif
|
||||
{
|
||||
plPageOptimizer optimizer(argv[1]);
|
||||
optimizer.Optimize();
|
||||
}
|
||||
#ifndef _DEBUG
|
||||
catch (...)
|
||||
{
|
||||
printf(" ***crashed on optimizing");
|
||||
return 2;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef _DEBUG
|
||||
try
|
||||
{
|
||||
#endif
|
||||
// Deinit the crap
|
||||
fontCache->UnRegisterAs(kFontCache_KEY);
|
||||
fontCache = nil;
|
||||
plSimulationMgr::Shutdown();
|
||||
|
||||
// Reading in objects may have generated dirty state which we're obviously
|
||||
// not sending out. Clear it so that we don't have leaked keys before the
|
||||
// ResMgr goes away.
|
||||
std::vector<plSynchedObject::StateDefn> carryOvers;
|
||||
plSynchedObject::ClearDirtyState(carryOvers);
|
||||
|
||||
hsgResMgr::Shutdown();
|
||||
#ifndef _DEBUG
|
||||
} catch (...)
|
||||
{
|
||||
printf(" ***crashed on shutdown");
|
||||
return 2;
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "../pfCharacter/pfCharacterCreatable.h"
|
||||
#include "../pfCamera/pfCameraCreatable.h"
|
||||
#include "../pfAnimation/pfAnimationCreatable.h"
|
||||
#include "../pfConditional/plConditionalObjectCreatable.h"
|
||||
//#include "../pfConsole/pfConsoleCreatable.h"
|
||||
#include "../pfSurface/pfSurfaceCreatable.h"
|
||||
#include "../pfMessage/pfMessageCreatable.h"
|
||||
#include "../pfAudio/pfAudioCreatable.h"
|
||||
#include "../pfPython/pfPythonCreatable.h"
|
||||
#include "../pfGameGUIMgr/pfGameGUIMgrCreatable.h"
|
||||
#include "../pfCCR/plCCRCreatable.h"
|
||||
#include "../pfJournalBook/pfJournalBookCreatable.h"
|
||||
#include "../pfGameMgr/pfGameMgrCreatables.h"
|
@ -0,0 +1,269 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "plPageOptimizer.h"
|
||||
|
||||
#include "../pnKeyedObject/plUoid.h"
|
||||
#include "../plResMgr/plResManager.h"
|
||||
#include "../plResMgr/plRegistryHelpers.h"
|
||||
#include "../plResMgr/plKeyFinder.h"
|
||||
#include "../plResMgr/plRegistryNode.h"
|
||||
|
||||
#include "../pnFactory/plFactory.h"
|
||||
#include "../pnKeyedObject/plKeyImp.h"
|
||||
|
||||
#include "../plFile/plFileUtils.h"
|
||||
#include "hsStream.h"
|
||||
|
||||
plPageOptimizer* plPageOptimizer::fInstance = nil;
|
||||
|
||||
plPageOptimizer::plPageOptimizer(const char* pagePath) :
|
||||
fOptimized(true),
|
||||
fPageNode(nil),
|
||||
fPagePath(pagePath)
|
||||
{
|
||||
fInstance = this;
|
||||
|
||||
strcpy(fTempPagePath, fPagePath);
|
||||
plFileUtils::StripExt(fTempPagePath);
|
||||
strcat(fTempPagePath, "_opt.prp");
|
||||
|
||||
fResMgr = (plResManager*)hsgResMgr::ResMgr();
|
||||
}
|
||||
|
||||
void plPageOptimizer::IFindLoc()
|
||||
{
|
||||
class plPageIt : public plRegistryPageIterator
|
||||
{
|
||||
public:
|
||||
plLocation fLoc;
|
||||
|
||||
virtual hsBool EatPage(plRegistryPageNode* keyNode)
|
||||
{
|
||||
fLoc = keyNode->GetPageInfo().GetLocation();
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
plPageIt it;
|
||||
fResMgr->IterateAllPages(&it);
|
||||
fLoc = it.fLoc;
|
||||
}
|
||||
|
||||
void plPageOptimizer::Optimize()
|
||||
{
|
||||
fResMgr->AddSinglePage(fPagePath);
|
||||
|
||||
// Get the location of the page we're optimizing
|
||||
IFindLoc();
|
||||
|
||||
hsBool loaded = true;
|
||||
|
||||
// Get the key for the scene node, we'll load it to force a load on all the objects
|
||||
plKey snKey = plKeyFinder::Instance().FindSceneNodeKey(fLoc);
|
||||
if (snKey)
|
||||
{
|
||||
// Load all the keys
|
||||
fPageNode = fResMgr->FindPage(fLoc);
|
||||
fResMgr->LoadPageKeys(fPageNode);
|
||||
|
||||
// Put all the keys in a vector, so they won't get unreffed
|
||||
class plVecKeyCollector : public plRegistryKeyIterator
|
||||
{
|
||||
public:
|
||||
KeyVec& fKeys;
|
||||
plVecKeyCollector(KeyVec& keys) : fKeys(keys) {}
|
||||
virtual hsBool EatKey(const plKey& key) { fKeys.push_back(key); return true; }
|
||||
};
|
||||
plVecKeyCollector keyIt(fAllKeys);
|
||||
fResMgr->IterateKeys(&keyIt);
|
||||
|
||||
// Set our load proc, which will track the order that objects are loaded
|
||||
fResMgr->SetProgressBarProc(KeyedObjectProc);
|
||||
|
||||
// Load the page
|
||||
snKey->VerifyLoaded();
|
||||
|
||||
// Unload everything
|
||||
snKey->RefObject();
|
||||
snKey->UnRefObject();
|
||||
snKey = nil;
|
||||
}
|
||||
else
|
||||
{
|
||||
loaded = false;
|
||||
}
|
||||
|
||||
if (loaded)
|
||||
IRewritePage();
|
||||
|
||||
UInt32 oldSize = plFileUtils::GetFileSize(fPagePath);
|
||||
UInt32 newSize = plFileUtils::GetFileSize(fTempPagePath);
|
||||
|
||||
if (!loaded)
|
||||
{
|
||||
printf("no scene node.\n");
|
||||
}
|
||||
else if (fOptimized)
|
||||
{
|
||||
plFileUtils::RemoveFile(fTempPagePath);
|
||||
printf("already optimized.\n");
|
||||
}
|
||||
else if (oldSize == newSize)
|
||||
{
|
||||
plFileUtils::RemoveFile(fPagePath, true);
|
||||
plFileUtils::FileMove(fTempPagePath, fPagePath);
|
||||
|
||||
printf("complete\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
plFileUtils::RemoveFile(fTempPagePath);
|
||||
printf("failed. File sizes different\n");
|
||||
}
|
||||
}
|
||||
|
||||
void plPageOptimizer::KeyedObjectProc(plKey key)
|
||||
{
|
||||
const char* keyName = key->GetName();
|
||||
const char* className = plFactory::GetNameOfClass(key->GetUoid().GetClassType());
|
||||
|
||||
// For now, ignore any key that isn't in the location we're looking at. That means stuff like textures.
|
||||
if (fInstance->fLoc != key->GetUoid().GetLocation())
|
||||
return;
|
||||
|
||||
KeySet& loadedKeys = fInstance->fLoadedKeys;
|
||||
KeyVec& loadOrder = fInstance->fKeyLoadOrder;
|
||||
|
||||
KeySet::iterator it = loadedKeys.lower_bound(key);
|
||||
if (it != loadedKeys.end() && *it == key)
|
||||
{
|
||||
printf("Keyed object %s(%s) loaded more than once\n", keyName, className);
|
||||
}
|
||||
else
|
||||
{
|
||||
loadedKeys.insert(it, key);
|
||||
loadOrder.push_back(key);
|
||||
}
|
||||
}
|
||||
|
||||
void plPageOptimizer::IWriteKeyData(hsStream* oldPage, hsStream* newPage, plKey key)
|
||||
{
|
||||
class plUpdateKeyImp : public plKeyImp
|
||||
{
|
||||
public:
|
||||
void SetStartPos(UInt32 startPos) { fStartPos = startPos; }
|
||||
};
|
||||
|
||||
plUpdateKeyImp* keyImp = (plUpdateKeyImp*)(plKeyImp*)key;
|
||||
UInt32 startPos = keyImp->GetStartPos();
|
||||
UInt32 len = keyImp->GetDataLen();
|
||||
|
||||
oldPage->SetPosition(startPos);
|
||||
if (len > fBuf.size())
|
||||
fBuf.resize(len);
|
||||
oldPage->Read(len, &fBuf[0]);
|
||||
|
||||
UInt32 newStartPos = newPage->GetPosition();
|
||||
|
||||
// If we move any buffers, this page wasn't optimized already
|
||||
if (newStartPos != startPos)
|
||||
fOptimized = false;
|
||||
|
||||
keyImp->SetStartPos(newStartPos);
|
||||
newPage->Write(len, &fBuf[0]);
|
||||
}
|
||||
|
||||
void plPageOptimizer::IRewritePage()
|
||||
{
|
||||
hsUNIXStream newPage;
|
||||
|
||||
if (newPage.Open(fTempPagePath, "wb"))
|
||||
{
|
||||
hsUNIXStream oldPage;
|
||||
oldPage.Open(fPagePath);
|
||||
|
||||
const plPageInfo& pageInfo = fPageNode->GetPageInfo();
|
||||
|
||||
UInt32 dataStart = pageInfo.GetDataStart();
|
||||
|
||||
fBuf.resize(dataStart);
|
||||
|
||||
oldPage.Read(dataStart, &fBuf[0]);
|
||||
newPage.Write(dataStart, &fBuf[0]);
|
||||
|
||||
int size = (int)fKeyLoadOrder.size();
|
||||
for (int i = 0; i < size; i++)
|
||||
IWriteKeyData(&oldPage, &newPage, fKeyLoadOrder[i]);
|
||||
|
||||
// If there are any objects that we didn't write (because they didn't load for
|
||||
// some reason), put them at the end
|
||||
for (int i = 0; i < fAllKeys.size(); i++)
|
||||
{
|
||||
hsBool found = (fLoadedKeys.find(fAllKeys[i]) != fLoadedKeys.end());
|
||||
if (!found)
|
||||
IWriteKeyData(&oldPage, &newPage, fAllKeys[i]);
|
||||
}
|
||||
|
||||
UInt32 newKeyStart = newPage.GetPosition();
|
||||
UInt32 oldKeyStart = pageInfo.GetIndexStart();
|
||||
oldPage.SetPosition(oldKeyStart);
|
||||
|
||||
UInt32 numTypes = oldPage.ReadSwap32();
|
||||
newPage.WriteSwap32(numTypes);
|
||||
|
||||
for (UInt32 i = 0; i < numTypes; i++)
|
||||
{
|
||||
UInt16 classType = oldPage.ReadSwap16();
|
||||
UInt32 len = oldPage.ReadSwap32();
|
||||
UInt8 flags = oldPage.ReadByte();
|
||||
UInt32 numKeys = oldPage.ReadSwap32();
|
||||
|
||||
newPage.WriteSwap16(classType);
|
||||
newPage.WriteSwap32(len);
|
||||
newPage.WriteByte(flags);
|
||||
newPage.WriteSwap32(numKeys);
|
||||
|
||||
for (UInt32 j = 0; j < numKeys; j++)
|
||||
{
|
||||
plUoid uoid;
|
||||
uoid.Read(&oldPage);
|
||||
UInt32 startPos = oldPage.ReadSwap32();
|
||||
UInt32 dataLen = oldPage.ReadSwap32();
|
||||
|
||||
// Get the new start pos
|
||||
plKeyImp* key = (plKeyImp*)fResMgr->FindKey(uoid);
|
||||
startPos = key->GetStartPos();
|
||||
|
||||
uoid.Write(&newPage);
|
||||
newPage.WriteSwap32(startPos);
|
||||
newPage.WriteSwap32(dataLen);
|
||||
}
|
||||
}
|
||||
|
||||
newPage.Close();
|
||||
oldPage.Close();
|
||||
}
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#ifndef plPageOptimizer_h_inc
|
||||
#define plPageOptimizer_h_inc
|
||||
|
||||
#include "../pnKeyedObject/plKey.h"
|
||||
#include "../pnKeyedObject/plUoid.h"
|
||||
#include <vector>
|
||||
#include <set>
|
||||
|
||||
class plRegistryPageNode;
|
||||
class plResManager;
|
||||
|
||||
class plPageOptimizer
|
||||
{
|
||||
protected:
|
||||
typedef std::vector<plKey> KeyVec;
|
||||
typedef std::set<plKey> KeySet;
|
||||
|
||||
KeyVec fKeyLoadOrder; // The order objects were loaded in
|
||||
KeySet fLoadedKeys; // Keys we've loaded objects for, for quick lookup
|
||||
KeyVec fAllKeys; // All the keys in the page
|
||||
std::vector<UInt8> fBuf;
|
||||
|
||||
bool fOptimized; // True after optimization if the page was already optimized
|
||||
|
||||
const char* fPagePath; // Path to our page
|
||||
char fTempPagePath[512]; // Path to the temp output page
|
||||
plLocation fLoc; // Location of our page
|
||||
plRegistryPageNode* fPageNode; // PageNode for our page
|
||||
|
||||
plResManager* fResMgr;
|
||||
|
||||
static plPageOptimizer* fInstance;
|
||||
static void KeyedObjectProc(plKey key);
|
||||
|
||||
void IWriteKeyData(hsStream* oldPage, hsStream* newPage, plKey key);
|
||||
void IFindLoc();
|
||||
void IRewritePage();
|
||||
|
||||
public:
|
||||
plPageOptimizer(const char* pagePath);
|
||||
|
||||
void Optimize();
|
||||
};
|
||||
|
||||
#endif // plPageOptimizer_h_inc
|
After Width: | Height: | Size: 2.5 KiB |
@ -0,0 +1,47 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "HeadSpin.h"
|
||||
#include "plPlasmaInstaller.h"
|
||||
#include "jvCoreUtil.h"
|
||||
|
||||
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
|
||||
{
|
||||
jvCoreUtil::SetHInstance(hInstance);
|
||||
plPlasmaInstaller installer;
|
||||
installer.Create();
|
||||
|
||||
MSG msg;
|
||||
while (GetMessage(&msg, NULL, 0, 0))
|
||||
{
|
||||
if (!IsDialogMessage(installer.GetHWnd(), &msg))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
}
|
||||
|
||||
return msg.wParam;
|
||||
}
|
@ -0,0 +1,97 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "HeadSpin.h"
|
||||
#include "plInstallerReg.h"
|
||||
#include <windows.h>
|
||||
|
||||
static HKEY GetInstallerKey()
|
||||
{
|
||||
HKEY hSoftKey = NULL;
|
||||
HKEY hCompanyKey = NULL;
|
||||
HKEY hAppKey = NULL;
|
||||
|
||||
if(RegOpenKeyEx(HKEY_CURRENT_USER, "software", 0, KEY_WRITE|KEY_READ,
|
||||
&hSoftKey) == ERROR_SUCCESS)
|
||||
{
|
||||
DWORD dw;
|
||||
if(RegCreateKeyEx(hSoftKey, "Cyan", 0, REG_NONE,
|
||||
REG_OPTION_NON_VOLATILE, KEY_WRITE|KEY_READ, NULL,
|
||||
&hCompanyKey, &dw) == ERROR_SUCCESS)
|
||||
{
|
||||
RegCreateKeyEx(hCompanyKey, "PlasmaInstaller", 0, REG_NONE,
|
||||
REG_OPTION_NON_VOLATILE, KEY_WRITE|KEY_READ, NULL,
|
||||
&hAppKey, &dw);
|
||||
}
|
||||
}
|
||||
|
||||
if (hSoftKey != NULL)
|
||||
RegCloseKey(hSoftKey);
|
||||
if (hCompanyKey != NULL)
|
||||
RegCloseKey(hCompanyKey);
|
||||
|
||||
return hAppKey;
|
||||
}
|
||||
|
||||
static void WriteRegString(const char* valueName, const char* value)
|
||||
{
|
||||
HKEY installKey = GetInstallerKey();
|
||||
RegSetValueEx(installKey, valueName, 0, REG_SZ, (const BYTE*)value, strlen(value)+1);
|
||||
RegCloseKey(installKey);
|
||||
}
|
||||
|
||||
static bool ReadRegString(const char* valueName, char* value, DWORD size)
|
||||
{
|
||||
HKEY installKey = GetInstallerKey();
|
||||
bool ret = (RegQueryValueEx(installKey, valueName, NULL, NULL, (LPBYTE)value, &size) == ERROR_SUCCESS);
|
||||
RegCloseKey(installKey);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void plInstallerReg::SetClientDir(const char* dir)
|
||||
{
|
||||
WriteRegString("Client", dir);
|
||||
}
|
||||
|
||||
void plInstallerReg::SetMaxDir(const char* dir)
|
||||
{
|
||||
WriteRegString("3dsmax", dir);
|
||||
}
|
||||
|
||||
const char* plInstallerReg::GetClientDir()
|
||||
{
|
||||
static char dir[MAX_PATH];
|
||||
if (!ReadRegString("Client", dir, sizeof(dir)))
|
||||
strcpy(dir, "C:\\PlasmaClient");
|
||||
return dir;
|
||||
}
|
||||
|
||||
const char* plInstallerReg::GetMaxDir()
|
||||
{
|
||||
static char dir[MAX_PATH];
|
||||
dir[0] = '\0';
|
||||
ReadRegString("3dsmax", dir, sizeof(dir));
|
||||
return dir;
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
namespace plInstallerReg
|
||||
{
|
||||
void SetClientDir(const char* dir);
|
||||
void SetMaxDir(const char* dir);
|
||||
|
||||
const char* GetClientDir();
|
||||
const char* GetMaxDir();
|
||||
}
|
@ -0,0 +1,392 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "HeadSpin.h"
|
||||
#include "plPlasmaInstaller.h"
|
||||
#include "resource.h"
|
||||
#include <windowsx.h>
|
||||
#include <commctrl.h>
|
||||
|
||||
#include "../plFile/hsFiles.h"
|
||||
#include "plUnzip.h"
|
||||
#include "plInstallerReg.h"
|
||||
#include "../plFile/plBrowseFolder.h"
|
||||
#include "plSetPlasmaPath.h"
|
||||
|
||||
plPlasmaInstaller::plPlasmaInstaller()
|
||||
{
|
||||
fDailyDir[0] = '\0';
|
||||
fDidGet = false;
|
||||
fStatusList = nil;
|
||||
|
||||
INITCOMMONCONTROLSEX icc = {0};
|
||||
icc.dwSize = sizeof(INITCOMMONCONTROLSEX);
|
||||
icc.dwICC = ICC_DATE_CLASSES;
|
||||
InitCommonControlsEx(&icc);
|
||||
}
|
||||
|
||||
void plPlasmaInstaller::Create()
|
||||
{
|
||||
ICreateDialog(IDD_INSTALLER, NULL);
|
||||
}
|
||||
|
||||
static const char* kAllClientExes = "AllClientExes.zip";
|
||||
static const char* kAllDllsRelease = "AllDllsRelease.zip";
|
||||
static const char* kScripts = "Scripts.zip";
|
||||
static const char* kTools = "AllToolsRelease.zip";
|
||||
|
||||
bool FileExists(const char* path, const char* filename)
|
||||
{
|
||||
char fullpath[MAX_PATH];
|
||||
sprintf(fullpath, "%s%s", path, filename);
|
||||
HANDLE hFile = CreateFile(fullpath, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
|
||||
if (hFile != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
CloseHandle(hFile);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool plPlasmaInstaller::IGetDailyDir()
|
||||
{
|
||||
// Get the branch
|
||||
HWND hBuild = GetDlgItem(fDlg, IDC_BUILD_COMBO);
|
||||
int idx = ComboBox_GetCurSel(hBuild);
|
||||
int buildServer = ComboBox_GetItemData(hBuild, idx);
|
||||
|
||||
HWND hTime = GetDlgItem(fDlg, IDC_TIME_COMBO);
|
||||
idx = ComboBox_GetCurSel(hTime);
|
||||
int time = ComboBox_GetItemData(hTime, idx);
|
||||
|
||||
// Get the build date
|
||||
SYSTEMTIME date;
|
||||
DateTime_GetSystemtime(GetDlgItem(fDlg, IDC_BRANCH_DATE), &date);
|
||||
char dateStr[] = "xx-xx-xxxx";
|
||||
sprintf(dateStr, "%02d-%02d-%04d", date.wMonth, date.wDay, date.wYear);
|
||||
|
||||
fDailyDir[0] = '\0';
|
||||
|
||||
IAddStatusLine("Searching for %s build...", dateStr);
|
||||
|
||||
|
||||
char buildDir[MAX_PATH];
|
||||
|
||||
static const char* kMainBuild = "\\\\Plasmabuild\\Output\\";
|
||||
static const char* kBranchBuild = "\\\\Branchbuild\\Output\\";
|
||||
static const char* kActiveBuild = "\\\\Activebuild\\Output\\";
|
||||
static const char* kInternalMain = "Main-Internal\\";
|
||||
static const char* kInternalBranch = "Branch-Internal\\";
|
||||
static const char* kInternalActive = "Active-Internal\\";
|
||||
|
||||
switch (buildServer)
|
||||
{
|
||||
case kBuildMain: strcpy(buildDir, kMainBuild); break;
|
||||
case kBuildBranch: strcpy(buildDir, kBranchBuild); break;
|
||||
case kBuildActive: strcpy(buildDir, kActiveBuild); break;
|
||||
}
|
||||
|
||||
switch (time)
|
||||
{
|
||||
case kNightly:
|
||||
strcat(buildDir, "Nightly\\");
|
||||
break;
|
||||
case kAfternoon:
|
||||
strcat(buildDir, "Afternoon\\");
|
||||
break;
|
||||
case kEvening:
|
||||
strcat(buildDir, "Evening\\");
|
||||
break;
|
||||
}
|
||||
|
||||
strcat(buildDir, dateStr);
|
||||
strcat(buildDir, "\\");
|
||||
|
||||
switch (buildServer)
|
||||
{
|
||||
case kBuildMain: strcat(buildDir, kInternalMain); break;
|
||||
case kBuildBranch: strcat(buildDir, kInternalBranch); break;
|
||||
case kBuildActive: strcat(buildDir, kInternalActive); break;
|
||||
}
|
||||
|
||||
if (FileExists(buildDir, kAllClientExes) && FileExists(buildDir, kAllDllsRelease) && FileExists(buildDir, kScripts))
|
||||
{
|
||||
strcpy(fDailyDir, buildDir);
|
||||
|
||||
const char* serverName = nil;
|
||||
switch (buildServer)
|
||||
{
|
||||
case kBuildMain: serverName = "Main"; break;
|
||||
case kBuildBranch: serverName = "Branch"; break;
|
||||
case kBuildActive: serverName = "Active"; break;
|
||||
}
|
||||
IAddStatusLine("Found %s at %s", serverName, fDailyDir);
|
||||
|
||||
EnableWindow(GetDlgItem(fDlg, IDC_GET_BUTTON), TRUE);
|
||||
return true;
|
||||
}
|
||||
|
||||
IAddStatusLine("Couldn't find build");
|
||||
EnableWindow(GetDlgItem(fDlg, IDC_GET_BUTTON), FALSE);
|
||||
return false;
|
||||
}
|
||||
|
||||
void plPlasmaInstaller::IInit()
|
||||
{
|
||||
const char* clientDir = plInstallerReg::GetClientDir();
|
||||
SetDlgItemText(fDlg, IDC_CLIENT_EDIT, clientDir);
|
||||
|
||||
const char* maxDir = plInstallerReg::GetMaxDir();
|
||||
SetDlgItemText(fDlg, IDC_3DSMAX_EDIT, maxDir);
|
||||
|
||||
fStatusList = GetDlgItem(fDlg, IDC_STATUS_LIST);
|
||||
|
||||
HWND hCombo = GetDlgItem(fDlg, IDC_BUILD_COMBO);
|
||||
int idx = ComboBox_AddString(hCombo, "Main");
|
||||
ComboBox_SetItemData(hCombo, idx, kBuildMain);
|
||||
ComboBox_SetCurSel(hCombo, idx);
|
||||
idx = ComboBox_AddString(hCombo, "Branch");
|
||||
ComboBox_SetItemData(hCombo, idx, kBuildBranch);
|
||||
idx = ComboBox_AddString(hCombo, "Active");
|
||||
ComboBox_SetItemData(hCombo, idx, kBuildActive);
|
||||
|
||||
HWND hTime = GetDlgItem(fDlg, IDC_TIME_COMBO);
|
||||
idx = ComboBox_AddString(hTime, "Nightly");
|
||||
ComboBox_SetItemData(hTime, idx, kNightly);
|
||||
ComboBox_SetCurSel(hTime, idx);
|
||||
idx = ComboBox_AddString(hTime, "Afternoon");
|
||||
ComboBox_SetItemData(hTime, idx, kAfternoon);
|
||||
idx = ComboBox_AddString(hTime, "Evening");
|
||||
ComboBox_SetItemData(hTime, idx, kEvening);
|
||||
|
||||
CheckDlgButton(fDlg, IDC_CLIENT_CHECK, BST_CHECKED);
|
||||
CheckDlgButton(fDlg, IDC_SCRIPTS_CHECK, BST_CHECKED);
|
||||
CheckDlgButton(fDlg, IDC_PLUGINS_CHECK, BST_CHECKED);
|
||||
|
||||
ShowWindow(fDlg, SW_SHOW);
|
||||
|
||||
IGetDailyDir();
|
||||
}
|
||||
|
||||
BOOL plPlasmaInstaller::IDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (msg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
IInit();
|
||||
SetFocus(GetDlgItem(fDlg, IDC_GET_BUTTON));
|
||||
return FALSE;
|
||||
|
||||
case WM_CLOSE:
|
||||
DestroyWindow(hDlg);
|
||||
return TRUE;
|
||||
|
||||
case WM_DESTROY:
|
||||
PostQuitMessage(0);
|
||||
return TRUE;
|
||||
|
||||
case WM_COMMAND:
|
||||
if (HIWORD(wParam) == BN_CLICKED)
|
||||
{
|
||||
switch (LOWORD(wParam))
|
||||
{
|
||||
case IDCANCEL:
|
||||
PostMessage(hDlg, WM_CLOSE, 0, 0);
|
||||
return TRUE;
|
||||
|
||||
case IDC_BROWSE_3DSMAX:
|
||||
case IDC_BROWSE_CLIENT:
|
||||
IGetFolder(LOWORD(wParam) == IDC_BROWSE_CLIENT);
|
||||
return TRUE;
|
||||
|
||||
case IDC_GET_BUTTON:
|
||||
if (fDidGet)
|
||||
PostMessage(hDlg, WM_CLOSE, 0, 0);
|
||||
else
|
||||
IGet();
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else if (HIWORD(wParam) == CBN_SELCHANGE && (LOWORD(wParam) == IDC_TIME_COMBO || LOWORD(wParam) == IDC_BUILD_COMBO))
|
||||
{
|
||||
IGetDailyDir();
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_NOTIFY:
|
||||
{
|
||||
NMHDR* nmhdr = (NMHDR*)lParam;
|
||||
if (nmhdr->idFrom == IDC_BRANCH_DATE && nmhdr->code == DTN_CLOSEUP/*DTN_DATETIMECHANGE*/)
|
||||
{
|
||||
IGetDailyDir();
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void plPlasmaInstaller::IExtractZip(const char* filename, const char* dest)
|
||||
{
|
||||
plUnzip unzip;
|
||||
if (unzip.Open(filename))
|
||||
{
|
||||
IAddStatusLine("Extracting %s...", filename);
|
||||
|
||||
char buf[MAX_PATH];
|
||||
while (unzip.ExtractNext(dest, buf))
|
||||
IAddStatusLine(" %s", buf);
|
||||
IAddStatusLine(" %s", buf);
|
||||
|
||||
unzip.Close();
|
||||
}
|
||||
}
|
||||
|
||||
void plPlasmaInstaller::IGet()
|
||||
{
|
||||
bool getClient = (IsDlgButtonChecked(fDlg, IDC_CLIENT_CHECK) == BST_CHECKED);
|
||||
bool getScripts = (IsDlgButtonChecked(fDlg, IDC_SCRIPTS_CHECK) == BST_CHECKED);
|
||||
bool getPlugins = (IsDlgButtonChecked(fDlg, IDC_PLUGINS_CHECK) == BST_CHECKED);
|
||||
bool getTools = (IsDlgButtonChecked(fDlg, IDC_TOOLS_CHECK) == BST_CHECKED);
|
||||
|
||||
const char* clientDir = plInstallerReg::GetClientDir();
|
||||
if (*clientDir == '\0' && (getClient || getScripts))
|
||||
{
|
||||
MessageBox(fDlg, "You need to set your client directory", "Plasma Installer", MB_OK | MB_ICONASTERISK);
|
||||
return;
|
||||
}
|
||||
const char* maxDir = plInstallerReg::GetMaxDir();
|
||||
if (*maxDir == '\0' && getPlugins)
|
||||
{
|
||||
MessageBox(fDlg, "You need to set your 3dsmax directory", "Plasma Installer", MB_OK | MB_ICONASTERISK);
|
||||
return;
|
||||
}
|
||||
|
||||
HWND hGetButton = GetDlgItem(fDlg, IDC_GET_BUTTON);
|
||||
EnableWindow(hGetButton, FALSE);
|
||||
HCURSOR hOldCursor = SetCursor(LoadCursor(NULL, IDC_WAIT));
|
||||
|
||||
char buf[MAX_PATH];
|
||||
|
||||
if (getScripts)
|
||||
{
|
||||
sprintf(buf, "%s%s", fDailyDir, kScripts);
|
||||
IExtractZip(buf, clientDir);
|
||||
}
|
||||
|
||||
if (getClient)
|
||||
{
|
||||
sprintf(buf, "%s%s", fDailyDir, kAllClientExes);
|
||||
IExtractZip(buf, clientDir);
|
||||
}
|
||||
|
||||
if (getPlugins)
|
||||
{
|
||||
sprintf(buf, "%s%s", fDailyDir, kAllDllsRelease);
|
||||
char pluginDir[MAX_PATH];
|
||||
sprintf(pluginDir, "%s\\plugins", maxDir);
|
||||
IExtractZip(buf, pluginDir);
|
||||
|
||||
IAddStatusLine("Updating PlasmaMAX2.ini...");
|
||||
sprintf(buf, "%s\\plugcfg\\PlasmaMAX2.ini", maxDir);
|
||||
WritePrivateProfileString("SceneViewer", "Directory", clientDir, buf);
|
||||
}
|
||||
|
||||
if (getTools)
|
||||
{
|
||||
sprintf(buf, "%s%s", fDailyDir, kTools);
|
||||
|
||||
char toolBuf[MAX_PATH];
|
||||
sprintf(toolBuf, "%s\\Tools", clientDir);
|
||||
IExtractZip(buf, toolBuf);
|
||||
}
|
||||
|
||||
IAddStatusLine("Updating path...");
|
||||
SetPlasmaPath(clientDir);
|
||||
|
||||
IAddStatusLine("Done");
|
||||
|
||||
SetCursor(hOldCursor);
|
||||
|
||||
fDidGet = true;
|
||||
SetWindowText(hGetButton, "Close");
|
||||
EnableWindow(hGetButton, TRUE);
|
||||
}
|
||||
|
||||
void plPlasmaInstaller::IGetFolder(bool client)
|
||||
{
|
||||
char path[MAX_PATH];
|
||||
if (client)
|
||||
strcpy(path, plInstallerReg::GetClientDir());
|
||||
else
|
||||
strcpy(path, plInstallerReg::GetMaxDir());
|
||||
|
||||
if (plBrowseFolder::GetFolder(path, path))
|
||||
{
|
||||
if (client)
|
||||
{
|
||||
SetDlgItemText(fDlg, IDC_CLIENT_EDIT, path);
|
||||
plInstallerReg::SetClientDir(path);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetDlgItemText(fDlg, IDC_3DSMAX_EDIT, path);
|
||||
plInstallerReg::SetMaxDir(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void plPlasmaInstaller::IAddStatusLine(const char* format, ...)
|
||||
{
|
||||
if (!format || *format == '\0')
|
||||
return;
|
||||
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
|
||||
char buf[2048];
|
||||
int numWritten = _vsnprintf(buf, sizeof(buf), format, args);
|
||||
hsAssert(numWritten > 0, "Buffer too small");
|
||||
|
||||
va_end(args);
|
||||
|
||||
int idx = ListBox_AddString(fStatusList, buf);
|
||||
ListBox_SetCurSel(fStatusList, idx);
|
||||
|
||||
// Pump the message queue
|
||||
MSG msg;
|
||||
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
|
||||
{
|
||||
if (!IsDialogMessage(&msg))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "jvBaseDlg.h"
|
||||
|
||||
class plPlasmaInstaller : public jvBaseDlg
|
||||
{
|
||||
protected:
|
||||
char fDailyDir[MAX_PATH];
|
||||
bool fDidGet;
|
||||
|
||||
HWND fStatusList;
|
||||
|
||||
enum { kBuildMain, kBuildBranch, kBuildActive };
|
||||
enum { kNightly, kAfternoon, kEvening };
|
||||
|
||||
virtual BOOL IDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
bool IGetDailyDir();
|
||||
void IGetFolder(bool client);
|
||||
|
||||
void IGet();
|
||||
|
||||
void IInit();
|
||||
void IExtractZip(const char* filename, const char* dest);
|
||||
|
||||
void IAddStatusLine(const char* format, ...);
|
||||
|
||||
public:
|
||||
plPlasmaInstaller();
|
||||
|
||||
void Create();
|
||||
|
||||
HWND GetHWnd() { return fDlg; }
|
||||
};
|
@ -0,0 +1,129 @@
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "afxres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_INSTALLER DIALOG DISCARDABLE 0, 0, 241, 170
|
||||
STYLE DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION |
|
||||
WS_SYSMENU
|
||||
CAPTION "Plasma Installer"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
LTEXT "Build:",IDC_STATIC,7,8,18,8
|
||||
COMBOBOX IDC_TIME_COMBO,27,6,46,167,CBS_DROPDOWNLIST | WS_VSCROLL |
|
||||
WS_TABSTOP
|
||||
LTEXT "3dsmax Directory:",IDC_STATIC,7,26,57,8
|
||||
EDITTEXT IDC_3DSMAX_EDIT,7,36,173,12,ES_AUTOHSCROLL | ES_READONLY
|
||||
PUSHBUTTON "Browse...",IDC_BROWSE_3DSMAX,183,35,50,14
|
||||
LTEXT "Client Directory:",IDC_STATIC,7,53,50,8
|
||||
EDITTEXT IDC_CLIENT_EDIT,7,63,173,12,ES_AUTOHSCROLL | ES_READONLY
|
||||
PUSHBUTTON "Browse...",IDC_BROWSE_CLIENT,183,62,50,14
|
||||
DEFPUSHBUTTON "Get",IDC_GET_BUTTON,93,146,56,16,WS_DISABLED
|
||||
LISTBOX IDC_STATUS_LIST,7,85,226,54,LBS_NOSEL | WS_VSCROLL |
|
||||
WS_TABSTOP
|
||||
CONTROL "DateTimePicker1",IDC_BRANCH_DATE,"SysDateTimePick32",
|
||||
DTS_RIGHTALIGN | WS_TABSTOP,125,6,55,12
|
||||
COMBOBOX IDC_BUILD_COMBO,76,6,46,167,CBS_DROPDOWNLIST |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
CONTROL "Client",IDC_CLIENT_CHECK,"Button",BS_AUTOCHECKBOX |
|
||||
WS_TABSTOP,159,144,33,10
|
||||
CONTROL "Scripts",IDC_SCRIPTS_CHECK,"Button",BS_AUTOCHECKBOX |
|
||||
WS_TABSTOP,159,154,37,10
|
||||
CONTROL "Plugins",IDC_PLUGINS_CHECK,"Button",BS_AUTOCHECKBOX |
|
||||
WS_TABSTOP,197,144,39,10
|
||||
CONTROL "Tools",IDC_TOOLS_CHECK,"Button",BS_AUTOCHECKBOX |
|
||||
WS_TABSTOP,197,154,33,10
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO DISCARDABLE
|
||||
BEGIN
|
||||
IDD_INSTALLER, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 234
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 163
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#include ""afxres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
IDI_ICON1 ICON DISCARDABLE "Dirt.ICO"
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
@ -0,0 +1,104 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "HeadSpin.h"
|
||||
#include <windows.h>
|
||||
|
||||
static HKEY GetEnvironKey()
|
||||
{
|
||||
HKEY hSystemKey = NULL;
|
||||
HKEY hControlSetKey = NULL;
|
||||
HKEY hControlKey = NULL;
|
||||
HKEY hSessionKey = NULL;
|
||||
HKEY hEnvironKey = NULL;
|
||||
|
||||
if ((RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SYSTEM", 0, KEY_READ, &hSystemKey) == ERROR_SUCCESS) &&
|
||||
(RegOpenKeyEx(hSystemKey, "CurrentControlSet", 0, KEY_READ, &hControlSetKey) == ERROR_SUCCESS) &&
|
||||
(RegOpenKeyEx(hControlSetKey, "Control", 0, KEY_READ, &hControlKey) == ERROR_SUCCESS) &&
|
||||
(RegOpenKeyEx(hControlKey, "Session Manager", 0, KEY_READ, &hSessionKey) == ERROR_SUCCESS))
|
||||
{
|
||||
RegOpenKeyEx(hSessionKey, "Environment", 0, KEY_READ | KEY_WRITE, &hEnvironKey);
|
||||
}
|
||||
|
||||
if (hSystemKey != NULL)
|
||||
RegCloseKey(hSystemKey);
|
||||
if (hControlSetKey != NULL)
|
||||
RegCloseKey(hControlSetKey);
|
||||
if (hControlKey != NULL)
|
||||
RegCloseKey(hControlKey);
|
||||
if (hSessionKey != NULL)
|
||||
RegCloseKey(hSessionKey);
|
||||
|
||||
return hEnvironKey;
|
||||
}
|
||||
|
||||
void SetPlasmaPath(const char* plasmaPath)
|
||||
{
|
||||
bool pathSet = false;
|
||||
|
||||
HKEY hEnvironKey = GetEnvironKey();
|
||||
if (hEnvironKey)
|
||||
{
|
||||
// Make sure the PlasmaGameDir var is in the path
|
||||
DWORD size = 0;
|
||||
if (ERROR_SUCCESS == RegQueryValueEx(hEnvironKey, "Path", NULL, NULL, NULL, &size))
|
||||
{
|
||||
char* oldPath = new char[size];
|
||||
static const char* kPlasmaVar = "%PlasmaGameDir%";
|
||||
|
||||
if (ERROR_SUCCESS == RegQueryValueEx(hEnvironKey, "Path", NULL, NULL, (BYTE*)oldPath, &size))
|
||||
{
|
||||
pathSet = (strstr(oldPath, kPlasmaVar) != NULL);
|
||||
|
||||
if (!pathSet)
|
||||
{
|
||||
char* newPath = new char[size+strlen(kPlasmaVar)+1];
|
||||
strcpy(newPath, oldPath);
|
||||
strcat(newPath, ";");
|
||||
strcat(newPath, kPlasmaVar);
|
||||
|
||||
RegSetValueEx(hEnvironKey, "Path", 0, REG_EXPAND_SZ, (BYTE*)newPath, strlen(newPath)+1);
|
||||
|
||||
delete [] newPath;
|
||||
}
|
||||
}
|
||||
|
||||
delete [] oldPath;
|
||||
}
|
||||
|
||||
// Set the PlasmaGameDir var
|
||||
RegSetValueEx(hEnvironKey, "PlasmaGameDir", 0, REG_SZ, (BYTE*)plasmaPath, strlen(plasmaPath)+1);
|
||||
|
||||
// Notify command prompts and stuff that environ changed
|
||||
DWORD ret;
|
||||
SendMessageTimeout(HWND_BROADCAST,
|
||||
WM_SETTINGCHANGE,
|
||||
0,
|
||||
(LPARAM)"Environment",
|
||||
SMTO_ABORTIFHUNG,
|
||||
5000,
|
||||
&ret);
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
void SetPlasmaPath(const char* plasmaPath);
|
@ -0,0 +1,153 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "HeadSpin.h"
|
||||
#include "plUnzip.h"
|
||||
#include "hsTypes.h"
|
||||
#include "hsWindows.h"
|
||||
#include "hsStream.h"
|
||||
|
||||
plUnzip::plUnzip() : fFile(nil)
|
||||
{
|
||||
}
|
||||
|
||||
bool plUnzip::Open(const char* filename)
|
||||
{
|
||||
fFile = unzOpen(filename);
|
||||
return (fFile != nil);
|
||||
}
|
||||
|
||||
bool plUnzip::Close()
|
||||
{
|
||||
bool ret = false;
|
||||
|
||||
if (fFile != nil)
|
||||
{
|
||||
ret = (UNZ_OK == unzClose(fFile));
|
||||
fFile = nil;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void plUnzip::IGetFullPath(const char* destDir, const char* filename, char* outFilename)
|
||||
{
|
||||
// Make sure the dest ends with a slash
|
||||
strcpy(outFilename, destDir);
|
||||
char lastChar = outFilename[strlen(outFilename)-1];
|
||||
if (lastChar != '\\' && lastChar != '/')
|
||||
strcat(outFilename, "\\");
|
||||
|
||||
// Check if the output filename has any directories in it
|
||||
const char* forward = strrchr(filename, '/');
|
||||
const char* backward = strrchr(filename, '\\');
|
||||
|
||||
if (!forward && !backward)
|
||||
{
|
||||
CreateDirectory(outFilename, NULL);
|
||||
strcat(outFilename, filename);
|
||||
}
|
||||
else
|
||||
{
|
||||
const char* fileOnly = (forward > backward) ? forward+1 : backward+1;
|
||||
strncat(outFilename, filename, fileOnly-filename);
|
||||
CreateDirectory(outFilename, NULL);
|
||||
|
||||
strcat(outFilename, fileOnly);
|
||||
}
|
||||
}
|
||||
|
||||
void plUnzip::IExtractCurrent(const char* destDir, char* fileName)
|
||||
{
|
||||
char filename[MAX_PATH];
|
||||
if (unzGetCurrentFileInfo(fFile, nil, filename, sizeof(filename), nil, 0, nil, 0) == UNZ_OK)
|
||||
{
|
||||
strcpy(fileName, filename);
|
||||
|
||||
if (unzOpenCurrentFile(fFile) == UNZ_OK)
|
||||
{
|
||||
char outFilename[MAX_PATH];
|
||||
IGetFullPath(destDir, filename, outFilename);
|
||||
|
||||
// Make sure to take off the read-only flag if the file exists, and is RO
|
||||
DWORD attrs = GetFileAttributes(outFilename);
|
||||
if (attrs != INVALID_FILE_ATTRIBUTES && (attrs & FILE_ATTRIBUTE_READONLY))
|
||||
SetFileAttributes(outFilename, attrs & ~FILE_ATTRIBUTE_READONLY);
|
||||
|
||||
hsUNIXStream outFile;
|
||||
if (outFile.Open(outFilename, "wb"))
|
||||
{
|
||||
char buf[2048];
|
||||
int numRead;
|
||||
while ((numRead = unzReadCurrentFile(fFile, buf, sizeof(buf))) > 0)
|
||||
{
|
||||
outFile.Write(numRead, buf);
|
||||
}
|
||||
|
||||
outFile.Close();
|
||||
|
||||
unz_file_info_s info;
|
||||
unzGetCurrentFileInfo(fFile, &info, NULL, 0, NULL, 0, NULL, 0);
|
||||
|
||||
SYSTEMTIME sysTime = {0};
|
||||
sysTime.wDay = info.tmu_date.tm_mday;
|
||||
sysTime.wMonth = info.tmu_date.tm_mon+1;
|
||||
sysTime.wYear = info.tmu_date.tm_year;
|
||||
sysTime.wHour = info.tmu_date.tm_hour;
|
||||
sysTime.wMinute = info.tmu_date.tm_min;
|
||||
sysTime.wSecond = info.tmu_date.tm_sec;
|
||||
|
||||
FILETIME localFileTime, utcFileTime;
|
||||
SystemTimeToFileTime(&sysTime, &localFileTime);
|
||||
|
||||
LocalFileTimeToFileTime(&localFileTime, &utcFileTime);
|
||||
|
||||
HANDLE hFile = CreateFile(outFilename, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
|
||||
SetFileTime(hFile, NULL, NULL, &utcFileTime);
|
||||
CloseHandle(hFile);
|
||||
}
|
||||
|
||||
unzCloseCurrentFile(fFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void plUnzip::ExtractAll(const char* destDir)
|
||||
{
|
||||
if (unzGoToFirstFile(fFile) != UNZ_OK)
|
||||
return;
|
||||
|
||||
do
|
||||
{
|
||||
IExtractCurrent(destDir);
|
||||
}
|
||||
while (unzGoToNextFile(fFile) == UNZ_OK);
|
||||
}
|
||||
|
||||
bool plUnzip::ExtractNext(const char* destDir, char* fileName)
|
||||
{
|
||||
IExtractCurrent(destDir, fileName);
|
||||
return (unzGoToNextFile(fFile) == UNZ_OK);
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#ifndef plUnzip_h_inc
|
||||
#define plUnzip_h_inc
|
||||
|
||||
#include "hsTypes.h"
|
||||
#include "../src/contrib/minizip/unzip.h"
|
||||
|
||||
class plUnzip
|
||||
{
|
||||
protected:
|
||||
unzFile fFile;
|
||||
|
||||
void IGetFullPath(const char* destDir, const char* filename, char* outFilename);
|
||||
void IExtractCurrent(const char* destDir, char* fileName=nil);
|
||||
|
||||
public:
|
||||
plUnzip();
|
||||
|
||||
bool Open(const char* filename);
|
||||
bool Close();
|
||||
|
||||
void ExtractAll(const char* destDir);
|
||||
bool ExtractNext(const char* destDir, char* fileName);
|
||||
};
|
||||
|
||||
#endif // plUnzip_h_inc
|
@ -0,0 +1,30 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by plPlasmaInstaller.rc
|
||||
//
|
||||
#define IDD_INSTALLER 101
|
||||
#define IDI_ICON1 102
|
||||
#define IDC_3DSMAX_EDIT 1000
|
||||
#define IDC_BROWSE_3DSMAX 1001
|
||||
#define IDC_TIME_COMBO 1002
|
||||
#define IDC_CLIENT_EDIT 1003
|
||||
#define IDC_BROWSE_CLIENT 1004
|
||||
#define IDC_GET_BUTTON 1005
|
||||
#define IDC_STATUS_LIST 1006
|
||||
#define IDC_BRANCH_DATE 1007
|
||||
#define IDC_BUILD_COMBO 1008
|
||||
#define IDC_CLIENT_CHECK 1009
|
||||
#define IDC_SCRIPTS_CHECK 1010
|
||||
#define IDC_PLUGINS_CHECK 1011
|
||||
#define IDC_TOOLS_CHECK 1012
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 103
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1013
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
After Width: | Height: | Size: 2.5 KiB |
@ -0,0 +1,52 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "HeadSpin.h"
|
||||
#include "plPlasmaUpdate.h"
|
||||
#include "jvCoreUtil.h"
|
||||
#include "hsUtils.h"
|
||||
|
||||
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
|
||||
{
|
||||
jvCoreUtil::SetHInstance(hInstance);
|
||||
plPlasmaUpdate installer;
|
||||
if (!installer.Create())
|
||||
return 0;
|
||||
|
||||
if (!stricmp(lpCmdLine, "AutoDownload"))
|
||||
installer.SetAutoDownload();
|
||||
|
||||
MSG msg;
|
||||
while (GetMessage(&msg, NULL, 0, 0))
|
||||
{
|
||||
if (!jvBaseDlg::IsDialogMessage(&msg))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,170 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "plFileGrabber.h"
|
||||
|
||||
/* Not needed currently - if we want it again we'll have to reimplement HTTP comm
|
||||
plHttpFileGrabber::plHttpFileGrabber()
|
||||
{
|
||||
fRequestMgr.SetHostname("");
|
||||
}
|
||||
|
||||
bool plHttpFileGrabber::FileToStream(const char* path, hsStream* stream)
|
||||
{
|
||||
std::string pathStr(path);
|
||||
bool retVal = fRequestMgr.GetFileToStream(path, stream);
|
||||
stream->SetPosition(0);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
void plHttpFileGrabber::SetServer(const char* server)
|
||||
{
|
||||
std::string serverPath(server);
|
||||
|
||||
fRequestMgr.SetHostname(serverPath);
|
||||
}
|
||||
|
||||
void plHttpFileGrabber::MakeProperPath(char* path)
|
||||
{
|
||||
char* slash = NULL;
|
||||
do {
|
||||
slash = strchr(path, '\\');
|
||||
if (slash)
|
||||
*slash = '/';
|
||||
} while(slash != NULL);
|
||||
}
|
||||
|
||||
void plHttpFileGrabber::SetUsernamePassword(const std::string& username, const std::string& password)
|
||||
{
|
||||
fRequestMgr.SetUsername(username);
|
||||
fRequestMgr.SetPassword(password);
|
||||
}
|
||||
|
||||
bool plHttpFileGrabber::IsServerAvailable(const char* serverName)
|
||||
{
|
||||
bool retVal = false;
|
||||
|
||||
HINTERNET hInternet = InternetOpen("Parable Patcher",INTERNET_OPEN_TYPE_PRECONFIG,NULL,NULL,0);
|
||||
if (hInternet)
|
||||
{
|
||||
HINTERNET hHttp = InternetConnect(hInternet,serverName,8080,fUserName.c_str(),fPassword.c_str(),INTERNET_SERVICE_HTTP,0,0);
|
||||
if (hHttp)
|
||||
{
|
||||
HINTERNET hRequest = HttpOpenRequest(hHttp, "GET", "/Current/Current.txt", NULL, NULL, NULL, INTERNET_FLAG_NO_CACHE_WRITE | INTERNET_FLAG_KEEP_CONNECTION, 0);
|
||||
if (hRequest)
|
||||
{
|
||||
DWORD dwCode;
|
||||
DWORD dwSize = sizeof(dwCode);
|
||||
HttpSendRequest(hRequest, NULL, 0, NULL, 0);
|
||||
HttpQueryInfo(hRequest, HTTP_QUERY_STATUS_CODE | HTTP_QUERY_FLAG_NUMBER, &dwCode, &dwSize, NULL);
|
||||
if (dwCode >= 200 && dwCode < 300)
|
||||
{
|
||||
retVal = true;
|
||||
}
|
||||
|
||||
InternetCloseHandle(hRequest);
|
||||
}
|
||||
|
||||
InternetCloseHandle(hHttp);
|
||||
}
|
||||
InternetCloseHandle(hInternet);
|
||||
}
|
||||
|
||||
return retVal;
|
||||
}
|
||||
*/
|
||||
|
||||
plNetShareFileGrabber::plNetShareFileGrabber()
|
||||
{
|
||||
}
|
||||
|
||||
#define BUFFER_SIZE 1024*1024
|
||||
bool plNetShareFileGrabber::FileToStream(const char* path, hsStream* stream)
|
||||
{
|
||||
hsUNIXStream fileStream;
|
||||
std::string filePath = fServerName + path;
|
||||
|
||||
if (fileStream.Open(filePath.c_str()))
|
||||
{
|
||||
char* buffer = new char[BUFFER_SIZE];
|
||||
UInt32 streamSize = fileStream.GetSizeLeft();
|
||||
while (streamSize > (BUFFER_SIZE))
|
||||
{
|
||||
fileStream.Read(BUFFER_SIZE, buffer);
|
||||
stream->Write(BUFFER_SIZE, buffer);
|
||||
|
||||
streamSize = fileStream.GetSizeLeft();
|
||||
}
|
||||
|
||||
if (streamSize > 0)
|
||||
{
|
||||
fileStream.Read(streamSize, buffer);
|
||||
stream->Write(streamSize, buffer);
|
||||
}
|
||||
|
||||
stream->Rewind();
|
||||
|
||||
fileStream.Close();
|
||||
delete [] buffer;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void plNetShareFileGrabber::SetServer(const char* server)
|
||||
{
|
||||
fServerName = "\\\\";
|
||||
fServerName += server;
|
||||
}
|
||||
|
||||
void plNetShareFileGrabber::MakeProperPath(char* path)
|
||||
{
|
||||
char* slash = NULL;
|
||||
do {
|
||||
slash = strchr(path, '/');
|
||||
if (slash)
|
||||
*slash = '\\';
|
||||
} while(slash != NULL);
|
||||
}
|
||||
|
||||
bool plNetShareFileGrabber::IsServerAvailable(const char* serverName, const char* currentDir)
|
||||
{
|
||||
bool retVal = false;
|
||||
|
||||
char serverPath[MAX_PATH];
|
||||
sprintf(serverPath, "\\\\%s\\%s\\Current.txt", serverName, currentDir);
|
||||
|
||||
hsUNIXStream si;
|
||||
if (si.Open(serverPath, "rb"))
|
||||
{
|
||||
retVal = true;
|
||||
si.Close();
|
||||
}
|
||||
|
||||
return retVal;
|
||||
}
|
@ -0,0 +1,73 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#ifndef plFileGrabber_h_inc
|
||||
#define plFileGrabber_h_inc
|
||||
|
||||
#include <string>
|
||||
#include "hsStream.h"
|
||||
|
||||
class plFileGrabber
|
||||
{
|
||||
public:
|
||||
virtual bool IsServerAvailable(const char* serverName, const char* currentDir) = 0;
|
||||
virtual bool FileToStream(const char* path, hsStream* stream) = 0;
|
||||
virtual void SetServer(const char* server) = 0;
|
||||
virtual void MakeProperPath(char* path) = 0;
|
||||
virtual bool NeedsAuth() { return false; }
|
||||
virtual void SetUsernamePassword(const std::string& username, const std::string& password) {}
|
||||
};
|
||||
|
||||
/* Not needed currently - if we want it again we'll have to reimplement HTTP comm
|
||||
class plHttpFileGrabber : public plFileGrabber
|
||||
{
|
||||
private:
|
||||
plHttpDiverseRequestMgr fRequestMgr;
|
||||
|
||||
public:
|
||||
plHttpFileGrabber();
|
||||
virtual bool IsServerAvailable(const char* serverName);
|
||||
virtual bool FileToStream(const char* path, hsStream* stream);
|
||||
virtual void SetServer(const char* server);
|
||||
virtual void MakeProperPath(char* path);
|
||||
virtual bool NeedsAuth() { return true; }
|
||||
virtual void SetUsernamePassword(const std::string& username, const std::string& password);
|
||||
};
|
||||
*/
|
||||
|
||||
class plNetShareFileGrabber : public plFileGrabber
|
||||
{
|
||||
private:
|
||||
std::string fServerName;
|
||||
|
||||
public:
|
||||
plNetShareFileGrabber();
|
||||
virtual bool IsServerAvailable(const char* serverName, const char* currentDir);
|
||||
virtual bool FileToStream(const char* path, hsStream* stream);
|
||||
virtual void SetServer(const char* server);
|
||||
virtual void MakeProperPath(char* path);
|
||||
};
|
||||
|
||||
#endif
|
@ -0,0 +1,346 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "HeadSpin.h"
|
||||
#include "hsUtils.h"
|
||||
#include "plManifest.h"
|
||||
|
||||
#include "../plEncryption/plChecksum.h"
|
||||
#include "../plCompression/plZlibStream.h"
|
||||
#include "../plFile/plEncryptedStream.h"
|
||||
#include "../plFile/plFileUtils.h"
|
||||
#include "../plUnifiedTime/plUnifiedTime.h"
|
||||
|
||||
class plManifestFile
|
||||
{
|
||||
public:
|
||||
char* fFilename;
|
||||
plMD5Checksum fSum;
|
||||
plMD5Checksum fLocalSum;
|
||||
UInt32 fSize;
|
||||
UInt32 fCompressedSize;
|
||||
UInt32 fFlags;
|
||||
};
|
||||
|
||||
plManifest::plManifest(LogFunc log) :
|
||||
fDownloadFiles(0),
|
||||
fDownloadBytes(0),
|
||||
fDirtySums(false),
|
||||
fLog(log)
|
||||
{
|
||||
}
|
||||
|
||||
plManifest::~plManifest()
|
||||
{
|
||||
if (fDirtySums)
|
||||
IWriteCache();
|
||||
|
||||
delete [] fManifestName;
|
||||
|
||||
for (int i = 0; i < fFiles.size(); i++)
|
||||
{
|
||||
delete [] fFiles[i]->fFilename;
|
||||
delete fFiles[i];
|
||||
}
|
||||
}
|
||||
|
||||
bool plManifest::Read(hsStream* mfsStream, const char* basePath, const char* mfsName)
|
||||
{
|
||||
fBasePath = basePath;
|
||||
fManifestName = hsStrcpy(mfsName);
|
||||
|
||||
fLog("--- Reading manifest for %s", fManifestName);
|
||||
|
||||
char buf[256];
|
||||
while (mfsStream->ReadLn(buf, sizeof(buf)))
|
||||
{
|
||||
plManifestFile* file = new plManifestFile;
|
||||
|
||||
char* tok = strtok(buf, "\t");
|
||||
file->fFilename = hsStrcpy(tok);
|
||||
|
||||
tok = strtok(nil, "\t");
|
||||
file->fSum.SetFromHexString(tok);
|
||||
|
||||
tok = strtok(nil, "\t");
|
||||
file->fSize = atoi(tok);
|
||||
|
||||
tok = strtok(nil, "\t");
|
||||
file->fCompressedSize = atoi(tok);
|
||||
|
||||
tok = strtok(nil, "\t");
|
||||
file->fFlags = atoi(tok);
|
||||
|
||||
fFiles.push_back(file);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void plManifest::ValidateFiles(ProgressFunc progress)
|
||||
{
|
||||
if (fFiles.empty())
|
||||
return;
|
||||
|
||||
fLog("--- Validating files for %s", fManifestName);
|
||||
|
||||
IReadCache(progress);
|
||||
|
||||
fDownloadFiles = 0;
|
||||
fDownloadBytes = 0;
|
||||
|
||||
for (int i = 0; i < fFiles.size(); i++)
|
||||
{
|
||||
plManifestFile* file = fFiles[i];
|
||||
|
||||
// If the local checksum is invalid, this file wasn't in our cache.
|
||||
// Get the sum, and update the progress bar.
|
||||
if (!file->fLocalSum.IsValid())
|
||||
{
|
||||
fLog(" No sum for %s, calculating", file->fFilename);
|
||||
file->fLocalSum.CalcFromFile(file->fFilename);
|
||||
fDirtySums = true;
|
||||
progress(file->fFilename, 1);
|
||||
}
|
||||
|
||||
if (file->fLocalSum != file->fSum)
|
||||
{
|
||||
fLog(" Incorrect sum for %s", file->fFilename);
|
||||
fDownloadFiles++;
|
||||
fDownloadBytes += file->fCompressedSize;
|
||||
}
|
||||
}
|
||||
|
||||
fLog("--- Need to download %d files, %.1f MB", fDownloadFiles, float(fDownloadBytes) / (1024.f*1024.f));
|
||||
}
|
||||
|
||||
void plManifest::DownloadUpdates(ProgressFunc progress, plFileGrabber* grabber)
|
||||
{
|
||||
for (int i = 0; i < fFiles.size(); i++)
|
||||
{
|
||||
plManifestFile* file = fFiles[i];
|
||||
if (file->fLocalSum != file->fSum)
|
||||
{
|
||||
char serverPath[MAX_PATH];
|
||||
|
||||
sprintf(serverPath, "%s%s.gz", fBasePath.c_str(), file->fFilename);
|
||||
grabber->MakeProperPath(serverPath);
|
||||
|
||||
hsRAMStream serverStream;
|
||||
if (grabber->FileToStream(serverPath, &serverStream))
|
||||
{
|
||||
plFileUtils::EnsureFilePathExists(file->fFilename);
|
||||
|
||||
plFileUtils::RemoveFile(file->fFilename, true);
|
||||
|
||||
plZlibStream localStream;
|
||||
if (localStream.Open(file->fFilename, "wb"))
|
||||
{
|
||||
char dataBuf[1024];
|
||||
UInt32 sizeLeft = serverStream.GetSizeLeft();
|
||||
while (UInt32 amtRead = serverStream.Read( (sizeof(dataBuf) > sizeLeft) ? sizeLeft : sizeof(dataBuf), dataBuf))
|
||||
{
|
||||
progress(file->fFilename, amtRead);
|
||||
|
||||
localStream.Write(amtRead, dataBuf);
|
||||
sizeLeft = serverStream.GetSizeLeft();
|
||||
}
|
||||
|
||||
localStream.Close();
|
||||
|
||||
// FIXME - Should we recalc this?
|
||||
file->fLocalSum = file->fSum;
|
||||
fDirtySums = true;
|
||||
|
||||
if (file->fFlags != 0)
|
||||
IDecompressSound(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
plManifestFile* plManifest::IFindFile(const char* name)
|
||||
{
|
||||
// FIXME
|
||||
for (int i = 0; i < fFiles.size(); i++)
|
||||
{
|
||||
if (hsStrEQ(fFiles[i]->fFilename, name))
|
||||
return fFiles[i];
|
||||
}
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
// KLUDGE - Put age checksums in the dat dir, for backwards compatability
|
||||
const char* plManifest::IGetCacheDir()
|
||||
{
|
||||
const char* prefix = "";
|
||||
if (strncmp(fFiles[0]->fFilename, "dat\\", strlen("dat\\")) == 0)
|
||||
return "dat\\";
|
||||
else
|
||||
return "";
|
||||
}
|
||||
|
||||
#define kCacheFileVersion 1
|
||||
|
||||
void plManifest::IWriteCache()
|
||||
{
|
||||
plEncryptedStream s;
|
||||
|
||||
bool openedFile = false;
|
||||
|
||||
UInt32 numFiles = 0;
|
||||
for (int i = 0; i < fFiles.size(); i++)
|
||||
{
|
||||
plManifestFile* file = fFiles[i];
|
||||
|
||||
plUnifiedTime modifiedTime;
|
||||
if (file->fLocalSum.IsValid() &&
|
||||
plFileUtils::GetFileTimes(file->fFilename, nil, &modifiedTime))
|
||||
{
|
||||
if (!openedFile)
|
||||
{
|
||||
openedFile = true;
|
||||
char buf[256];
|
||||
sprintf(buf, "%s%s.sum", IGetCacheDir(), fManifestName);
|
||||
s.Open(buf, "wb");
|
||||
s.WriteSwap32(0);
|
||||
s.WriteSwap32(kCacheFileVersion);
|
||||
}
|
||||
|
||||
s.WriteSafeString(file->fFilename);
|
||||
|
||||
plMD5Checksum& checksum = file->fLocalSum;
|
||||
s.Write(checksum.GetSize(), checksum.GetValue());
|
||||
|
||||
modifiedTime.Write(&s);
|
||||
|
||||
numFiles++;
|
||||
}
|
||||
}
|
||||
|
||||
if (openedFile)
|
||||
{
|
||||
s.Rewind();
|
||||
s.WriteSwap32(numFiles);
|
||||
|
||||
s.Close();
|
||||
}
|
||||
}
|
||||
|
||||
void plManifest::IReadCache(ProgressFunc progress)
|
||||
{
|
||||
//
|
||||
// Load valid cached checksums
|
||||
//
|
||||
char buf[256];
|
||||
sprintf(buf, "%s%s.sum", IGetCacheDir(), fManifestName);
|
||||
hsStream* s = plEncryptedStream::OpenEncryptedFile(buf);
|
||||
|
||||
if (s)
|
||||
{
|
||||
UInt32 numCached = s->ReadSwap32();
|
||||
UInt32 cacheFileVersion = s->ReadSwap32();
|
||||
|
||||
if (cacheFileVersion != kCacheFileVersion)
|
||||
{
|
||||
s->Close();
|
||||
delete s;
|
||||
return;
|
||||
}
|
||||
|
||||
fLog(" Reading cache...found %d cached sums", numCached);
|
||||
|
||||
for (int i = 0; i < numCached; i++)
|
||||
{
|
||||
char* name = s->ReadSafeString();
|
||||
|
||||
UInt8 checksumBuf[MD5_DIGEST_LENGTH];
|
||||
s->Read(sizeof(checksumBuf), checksumBuf);
|
||||
plMD5Checksum checksum;
|
||||
checksum.SetValue(checksumBuf);
|
||||
|
||||
plUnifiedTime modifiedTime;
|
||||
modifiedTime.Read(s);
|
||||
|
||||
plManifestFile* file = IFindFile(name);
|
||||
if (file)
|
||||
{
|
||||
plUnifiedTime curModifiedTime;
|
||||
if (plFileUtils::GetFileTimes(file->fFilename, nil, &curModifiedTime))
|
||||
{
|
||||
if (curModifiedTime == modifiedTime)
|
||||
file->fLocalSum = checksum;
|
||||
else
|
||||
fLog(" Invalid modified time for %s", name);
|
||||
}
|
||||
else
|
||||
fLog(" Couldn't get modified time for %s", name);
|
||||
|
||||
progress(file->fFilename, 1);
|
||||
}
|
||||
else
|
||||
fLog(" Couldn't find cached file '%s' in manifest, discarding", name);
|
||||
|
||||
|
||||
delete [] name;
|
||||
}
|
||||
|
||||
s->Close();
|
||||
delete s;
|
||||
}
|
||||
}
|
||||
|
||||
#include "../plAudioCore/plAudioFileReader.h"
|
||||
#include "../plAudio/plOGGCodec.h"
|
||||
#include "../plAudio/plWavFile.h"
|
||||
|
||||
|
||||
bool plManifest::IDecompressSound(plManifestFile* file)
|
||||
{
|
||||
enum
|
||||
{
|
||||
kSndFlagCacheSplit = 1<<0,
|
||||
kSndFlagCacheStereo = 1<<2,
|
||||
};
|
||||
|
||||
if (hsCheckBits(file->fFlags, kSndFlagCacheSplit) ||
|
||||
hsCheckBits(file->fFlags, kSndFlagCacheStereo))
|
||||
{
|
||||
plAudioFileReader* reader = plAudioFileReader::CreateReader(file->fFilename, plAudioCore::kAll, plAudioFileReader::kStreamNative);
|
||||
if (!reader)
|
||||
return false;
|
||||
UInt32 size = reader->GetDataSize();
|
||||
delete reader;
|
||||
|
||||
if (hsCheckBits(file->fFlags, kSndFlagCacheSplit))
|
||||
plAudioFileReader::CacheFile(file->fFilename, true);
|
||||
if (hsCheckBits(file->fFlags, kSndFlagCacheStereo))
|
||||
plAudioFileReader::CacheFile(file->fFilename, false);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#ifndef plManifest_h_inc
|
||||
#define plManifest_h_inc
|
||||
|
||||
#include "hsTypes.h"
|
||||
#include "plFileGrabber.h"
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
class plManifestFile;
|
||||
|
||||
typedef void (*ProgressFunc)(const char* name, int progDelta);
|
||||
typedef void (*LogFunc)(const char* format, ...);
|
||||
|
||||
class plManifest
|
||||
{
|
||||
protected:
|
||||
std::string fBasePath;
|
||||
char* fManifestName;
|
||||
|
||||
typedef std::vector<plManifestFile*> FileVec;
|
||||
FileVec fFiles;
|
||||
|
||||
UInt32 fDownloadFiles;
|
||||
UInt32 fDownloadBytes;
|
||||
|
||||
bool fDirtySums;
|
||||
|
||||
LogFunc fLog;
|
||||
|
||||
bool IDecompressSound(plManifestFile* file);
|
||||
|
||||
plManifestFile* IFindFile(const char* name);
|
||||
|
||||
const char* IGetCacheDir();
|
||||
void IReadCache(ProgressFunc progress);
|
||||
void IWriteCache();
|
||||
|
||||
public:
|
||||
plManifest(LogFunc log);
|
||||
~plManifest();
|
||||
|
||||
bool Read(hsStream* mfsStream, const char* basePath, const char* mfsName);
|
||||
|
||||
void ValidateFiles(ProgressFunc progress);
|
||||
void DownloadUpdates(ProgressFunc progress, plFileGrabber* grabber);
|
||||
|
||||
int NumFiles() { return fFiles.size(); }
|
||||
UInt32 NumDownloadFiles() { return fDownloadFiles; }
|
||||
UInt32 DownloadSize() { return fDownloadBytes; }
|
||||
};
|
||||
|
||||
#endif // plManifest_h_inc
|
@ -0,0 +1,79 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "plPlasmaServers.h"
|
||||
#include "hsStream.h"
|
||||
#include "hsUtils.h"
|
||||
|
||||
bool plPlasmaServers::GetServerInfo()
|
||||
{
|
||||
bool ret = true;
|
||||
|
||||
hsUNIXStream si;
|
||||
if (si.Open("\\\\dirtcake\\ServerInfo\\ServerInfo.txt", "rb"))
|
||||
{
|
||||
char line[256];
|
||||
|
||||
// Make sure we've got the latest version
|
||||
if (si.ReadLn(line, sizeof(line)))
|
||||
{
|
||||
int version = atoi(line);
|
||||
si.ReadLn(line, sizeof(line));
|
||||
if (version != 4)
|
||||
{
|
||||
char errorMsg[512];
|
||||
sprintf(errorMsg, "This installer is out of date.\nPlease get the latest version from:\n\n%s", line);
|
||||
hsMessageBox(errorMsg, "Error", hsMessageBoxNormal, hsMessageBoxIconError);
|
||||
ret = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
ret = false;
|
||||
|
||||
// Read in the servers, one per line
|
||||
while (ret && si.ReadLn(line, sizeof(line)))
|
||||
{
|
||||
ServerInfo info;
|
||||
|
||||
info.fServerAddress = strtok(line, ",");
|
||||
info.fServerName = strtok(nil, ",");
|
||||
info.fURLBase = strtok(nil, ",");
|
||||
info.fOutputDir = strtok(nil, ",");
|
||||
info.fCurrentDir = strtok(nil, ",");
|
||||
info.fCodeDir = strtok(nil, ",");
|
||||
|
||||
fServers.push_back(info);
|
||||
}
|
||||
|
||||
si.Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
hsMessageBox("Couldn't find server info", "Error", hsMessageBoxNormal, hsMessageBoxIconError);
|
||||
ret = false;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|