mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-19 05:36:13 +00:00
Merge
This commit is contained in:
commit
6430f582b5
250 changed files with 8557 additions and 3567 deletions
|
@ -44,6 +44,7 @@ default_c
|
|||
*.so.*
|
||||
*_debug
|
||||
core
|
||||
*.pc
|
||||
|
||||
# Mac OS X compile
|
||||
*.dylib
|
||||
|
|
50
code/nel/CMakeModules/FindEFXUtil.cmake
Normal file
50
code/nel/CMakeModules/FindEFXUtil.cmake
Normal file
|
@ -0,0 +1,50 @@
|
|||
# - Locate EFX-Util library
|
||||
# This module defines
|
||||
# EFXUTIL_LIBRARY, the library to link against
|
||||
# EFXUTIL_FOUND, if false, do not try to link to EFX-Util
|
||||
# EFXUTIL_INCLUDE_DIR, where to find headers.
|
||||
|
||||
IF(EFXUTIL_LIBRARY AND EFXUTIL_INCLUDE_DIR)
|
||||
# in cache already
|
||||
SET(EFXUTIL_FIND_QUIETLY TRUE)
|
||||
ENDIF(EFXUTIL_LIBRARY AND EFXUTIL_INCLUDE_DIR)
|
||||
|
||||
|
||||
FIND_PATH(EFXUTIL_INCLUDE_DIR
|
||||
EFX-Util.h
|
||||
PATHS
|
||||
$ENV{EFXUTIL_DIR}/include
|
||||
/usr/local/include
|
||||
/usr/include
|
||||
/sw/include
|
||||
/opt/local/include
|
||||
/opt/csw/include
|
||||
/opt/include
|
||||
PATH_SUFFIXES AL
|
||||
)
|
||||
|
||||
FIND_LIBRARY(EFXUTIL_LIBRARY
|
||||
NAMES EFX-Util efxutil libefxutil
|
||||
PATHS
|
||||
$ENV{EFXUTIL_DIR}/lib
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
/usr/local/X11R6/lib
|
||||
/usr/X11R6/lib
|
||||
/sw/lib
|
||||
/opt/local/lib
|
||||
/opt/csw/lib
|
||||
/opt/lib
|
||||
/usr/freeware/lib64
|
||||
)
|
||||
|
||||
IF(EFXUTIL_LIBRARY AND EFXUTIL_INCLUDE_DIR)
|
||||
SET(EFXUTIL_FOUND "YES")
|
||||
IF(NOT EFXUTIL_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Found EFX-Util: ${EFXUTIL_LIBRARY}")
|
||||
ENDIF(NOT EFXUTIL_FIND_QUIETLY)
|
||||
ELSE(EFXUTIL_LIBRARY AND EFXUTIL_INCLUDE_DIR)
|
||||
IF(NOT EFXUTIL_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Warning: Unable to find EFX-Util!")
|
||||
ENDIF(NOT EFXUTIL_FIND_QUIETLY)
|
||||
ENDIF(EFXUTIL_LIBRARY AND EFXUTIL_INCLUDE_DIR)
|
51
code/nel/CMakeModules/FindSquish.cmake
Normal file
51
code/nel/CMakeModules/FindSquish.cmake
Normal file
|
@ -0,0 +1,51 @@
|
|||
#
|
||||
# Find the LibSquish includes and library
|
||||
#
|
||||
# This module defines
|
||||
# SQUISH_INCLUDE_DIR, where to find squish.h
|
||||
# SQUISH_LIBRARY, where to find the Squish library.
|
||||
# SQUISH_FOUND, If false, do not try to use Squish.
|
||||
|
||||
# also defined, but not for general use are
|
||||
IF(SQUISH_LIBRARY AND SQUISH_INCLUDE_DIR)
|
||||
# in cache already
|
||||
SET(SQUISH_FIND_QUIETLY TRUE)
|
||||
ENDIF(SQUISH_LIBRARY AND SQUISH_INCLUDE_DIR)
|
||||
|
||||
FIND_PATH(SQUISH_INCLUDE_DIR
|
||||
squish.h
|
||||
PATHS
|
||||
/usr/local/include
|
||||
/usr/include
|
||||
/sw/include
|
||||
/opt/local/include
|
||||
/opt/csw/include
|
||||
/opt/include
|
||||
PATH_SUFFIXES cppunit
|
||||
)
|
||||
|
||||
FIND_LIBRARY(SQUISH_LIBRARY
|
||||
squish
|
||||
PATHS
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
/usr/local/X11R6/lib
|
||||
/usr/X11R6/lib
|
||||
/sw/lib
|
||||
/opt/local/lib
|
||||
/opt/csw/lib
|
||||
/opt/lib
|
||||
/usr/freeware/lib64
|
||||
)
|
||||
|
||||
IF(SQUISH_LIBRARY AND SQUISH_INCLUDE_DIR)
|
||||
SET(SQUISH_FOUND "YES")
|
||||
IF(NOT SQUISH_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Found Squish: ${SQUISH_LIBRARY}")
|
||||
ENDIF(NOT SQUISH_FIND_QUIETLY)
|
||||
ELSE(SQUISH_LIBRARY AND SQUISH_INCLUDE_DIR)
|
||||
IF(NOT SQUISH_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Warning: Unable to find Squish!")
|
||||
ENDIF(NOT SQUISH_FIND_QUIETLY)
|
||||
ENDIF(SQUISH_LIBRARY AND SQUISH_INCLUDE_DIR)
|
||||
|
|
@ -11,7 +11,7 @@ ENDIF(XF86VidMode_LIBRARY AND XF86VidMode_INCLUDE_DIR)
|
|||
|
||||
|
||||
FIND_PATH(XF86VidMode_INCLUDE_DIR
|
||||
xf86vm.h
|
||||
xf86vmode.h
|
||||
PATHS
|
||||
$ENV{XF86VidMode_DIR}/include
|
||||
/usr/include/X11/
|
||||
|
|
|
@ -56,7 +56,7 @@ using NLMISC::CSmartPtr;
|
|||
using NLMISC::CRGBA;
|
||||
using NLMISC::CVector;
|
||||
using NLMISC::CMatrix;
|
||||
using NLMISC::CSynchronized;
|
||||
using NLMISC::CUnfairSynchronized;
|
||||
|
||||
|
||||
class CMaterial;
|
||||
|
@ -144,7 +144,7 @@ public:
|
|||
|
||||
protected:
|
||||
|
||||
CSynchronized<TTexDrvInfoPtrMap> _SyncTexDrvInfos;
|
||||
CUnfairSynchronized<TTexDrvInfoPtrMap> _SyncTexDrvInfos;
|
||||
|
||||
TTexDrvSharePtrList _TexDrvShares;
|
||||
TMatDrvInfoPtrList _MatDrvInfos;
|
||||
|
|
|
@ -413,6 +413,12 @@ public:
|
|||
//
|
||||
virtual NLMISC::IKeyboardDevice *enableLowLevelKeyboard(bool enable);
|
||||
virtual NLMISC::IInputDeviceManager *getLowLevelInputDeviceManager();
|
||||
|
||||
/**
|
||||
* wrapper for IEventEmitter::emulateMouseRawMode()
|
||||
*/
|
||||
virtual void emulateMouseRawMode(bool enable);
|
||||
|
||||
virtual uint getDoubleClickDelay(bool hardwareMouse);
|
||||
|
||||
/// show cursor if b is true, or hide it if b is false
|
||||
|
|
|
@ -571,6 +571,11 @@ public:
|
|||
*/
|
||||
virtual NLMISC::IInputDeviceManager *getLowLevelInputDeviceManager() = 0;
|
||||
|
||||
/**
|
||||
* wrapper for IEventEmitter::emulateMouseRawMode()
|
||||
*/
|
||||
virtual void emulateMouseRawMode(bool enable) = 0;
|
||||
|
||||
// get delay used for mouse double click
|
||||
virtual uint getDoubleClickDelay(bool hardwareMouse) = 0;
|
||||
|
||||
|
|
|
@ -50,6 +50,18 @@ public:
|
|||
*/
|
||||
virtual void submitEvents(CEventServer & server, bool allWindows) = 0;
|
||||
|
||||
/**
|
||||
* Instruct the event emitter to send CGDMouseMove instead of CEventMouseMove.
|
||||
*
|
||||
* On windows, the mouse device can be set into RawMode. Using this mode,
|
||||
* CGDMouseMove events (only containing the raw movement delta) are emitted
|
||||
* instead of the normal CEventMouseMove events (containing the mouse position).
|
||||
*
|
||||
* On Linux and Mac OS X, there is no MouseDevice implementation, all the
|
||||
* events are created by the event emitter. So the event emitter has to
|
||||
* emulate the mouse raw mode.
|
||||
*/
|
||||
virtual void emulateMouseRawMode(bool) = 0;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -99,6 +99,9 @@ public:
|
|||
* Return true if the message must be trapped, false if DefWindowProc must be called afterwards
|
||||
*/
|
||||
bool processMessage (HWND hWnd, uint32 msg, WPARAM wParam, LPARAM lParam, CEventServer *server=NULL);
|
||||
|
||||
void emulateMouseRawMode(bool enable);
|
||||
|
||||
private:
|
||||
CWinEventServer _InternalServer;
|
||||
HWND _HWnd;
|
||||
|
|
|
@ -664,6 +664,8 @@ SOURCE_GROUP(Shadows FILES
|
|||
|
||||
IF(NOT WIN32)
|
||||
ADD_LIBRARY(nel3d SHARED ${SRC})
|
||||
CONFIGURE_FILE(nel-3d.pc.in nel-3d.pc)
|
||||
INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/nel-3d.pc" DESTINATION lib/pkgconfig)
|
||||
ELSE(NOT WIN32)
|
||||
ADD_LIBRARY(nel3d STATIC ${SRC})
|
||||
ENDIF(NOT WIN32)
|
||||
|
|
|
@ -34,7 +34,7 @@ namespace NL3D
|
|||
{
|
||||
|
||||
// ***************************************************************************
|
||||
const uint32 IDriver::InterfaceVersion = 0x65; // Added nlWindow patch.
|
||||
const uint32 IDriver::InterfaceVersion = 0x66; // added IEventEmitter::emulateMouseRawMode(bool)
|
||||
|
||||
// ***************************************************************************
|
||||
IDriver::IDriver() : _SyncTexDrvInfos( "IDriver::_SyncTexDrvInfos" )
|
||||
|
@ -50,7 +50,7 @@ IDriver::~IDriver()
|
|||
// Must clean up everything before closing driver.
|
||||
// Must doing this in release(), so assert here if not done...
|
||||
{
|
||||
CSynchronized<TTexDrvInfoPtrMap>::CAccessor access(&_SyncTexDrvInfos);
|
||||
CUnfairSynchronized<TTexDrvInfoPtrMap>::CAccessor access(&_SyncTexDrvInfos);
|
||||
TTexDrvInfoPtrMap &rTexDrvInfos = access.value();
|
||||
nlassert( rTexDrvInfos.size() == 0 );
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ bool IDriver::release(void)
|
|||
|
||||
// Release refptr of TextureDrvInfos. Should be all null (because of precedent pass).
|
||||
{
|
||||
CSynchronized<TTexDrvInfoPtrMap>::CAccessor access(&_SyncTexDrvInfos);
|
||||
CUnfairSynchronized<TTexDrvInfoPtrMap>::CAccessor access(&_SyncTexDrvInfos);
|
||||
TTexDrvInfoPtrMap &rTexDrvInfos = access.value();
|
||||
|
||||
// must be empty, because precedent pass should have deleted all.
|
||||
|
@ -234,7 +234,7 @@ void IDriver::removeIBDrvInfoPtr(ItIBDrvInfoPtrList ibDrvInfoIt)
|
|||
// ***************************************************************************
|
||||
void IDriver::removeTextureDrvInfoPtr(ItTexDrvInfoPtrMap texDrvInfoIt)
|
||||
{
|
||||
CSynchronized<TTexDrvInfoPtrMap>::CAccessor access(&_SyncTexDrvInfos);
|
||||
CUnfairSynchronized<TTexDrvInfoPtrMap>::CAccessor access(&_SyncTexDrvInfos);
|
||||
TTexDrvInfoPtrMap &rTexDrvInfos = access.value();
|
||||
|
||||
rTexDrvInfos.erase(texDrvInfoIt);
|
||||
|
@ -268,7 +268,7 @@ bool IDriver::invalidateShareTexture (ITexture &texture)
|
|||
getTextureShareName (texture, name);
|
||||
|
||||
// Look for the driver info for this share name
|
||||
CSynchronized<TTexDrvInfoPtrMap>::CAccessor access(&_SyncTexDrvInfos);
|
||||
CUnfairSynchronized<TTexDrvInfoPtrMap>::CAccessor access(&_SyncTexDrvInfos);
|
||||
TTexDrvInfoPtrMap &rTexDrvInfos = access.value();
|
||||
TTexDrvInfoPtrMap::iterator iteDrvInfo = rTexDrvInfos.find (name);
|
||||
if (iteDrvInfo != rTexDrvInfos.end())
|
||||
|
|
|
@ -549,7 +549,7 @@ bool CDriverD3D::setupTextureEx (ITexture& tex, bool bUpload, bool &bAllUploaded
|
|||
|
||||
// insert or get the texture.
|
||||
{
|
||||
CSynchronized<TTexDrvInfoPtrMap>::CAccessor access(&_SyncTexDrvInfos);
|
||||
CUnfairSynchronized<TTexDrvInfoPtrMap>::CAccessor access(&_SyncTexDrvInfos);
|
||||
TTexDrvInfoPtrMap &rTexDrvInfos = access.value();
|
||||
|
||||
ItTexDrvInfoPtrMap itTex;
|
||||
|
@ -1013,7 +1013,7 @@ bool CDriverD3D::isTextureExist(const ITexture&tex)
|
|||
getTextureShareName (tex, name);
|
||||
|
||||
{
|
||||
CSynchronized<TTexDrvInfoPtrMap>::CAccessor access(&_SyncTexDrvInfos);
|
||||
CUnfairSynchronized<TTexDrvInfoPtrMap>::CAccessor access(&_SyncTexDrvInfos);
|
||||
TTexDrvInfoPtrMap &rTexDrvInfos = access.value();
|
||||
result = (rTexDrvInfos.find(name) != rTexDrvInfos.end());
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -842,6 +842,7 @@ private:
|
|||
|
||||
private:
|
||||
void switchBackToOldMode();
|
||||
bool setupDisplay();
|
||||
|
||||
// Get the proj matrix setupped in GL
|
||||
void refreshProjMatrixFromGL();
|
||||
|
|
|
@ -467,6 +467,10 @@
|
|||
RelativePath="driver_opengl_vertex_program.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\driver_opengl_window.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="stdopengl.cpp"
|
||||
>
|
||||
|
|
|
@ -620,10 +620,12 @@ static bool setupATITextureEnvCombine3(const char *glext)
|
|||
{
|
||||
H_AUTO_OGL(setupATITextureEnvCombine3);
|
||||
|
||||
#ifdef NL_OS_MAC
|
||||
// Water doesn't render on GeForce 8600M GT (on MAC OS X) if this extension is enabled
|
||||
return false;
|
||||
#endif
|
||||
// reenabled to allow bloom on mac, TODO: cleanly fix the water issue
|
||||
// i think this issue was mtp target related - is this the case in ryzom too?
|
||||
// #ifdef NL_OS_MAC
|
||||
// // Water doesn't render on GeForce 8600M GT (on MAC OS X) if this extension is enabled
|
||||
// return false;
|
||||
// #endif
|
||||
|
||||
CHECK_EXT("GL_ATI_texture_env_combine3");
|
||||
return true;
|
||||
|
@ -671,10 +673,12 @@ static bool setupNVVertexProgram(const char *glext)
|
|||
{
|
||||
H_AUTO_OGL(setupNVVertexProgram);
|
||||
|
||||
#ifdef NL_OS_MAC
|
||||
// Water doesn't render on GeForce 8600M GT (on MAC OS X) if this extension is enabled
|
||||
return false;
|
||||
#endif
|
||||
// reenabled to allow bloom on mac, TODO: cleanly fix the water issue
|
||||
// i think this issue was mtp target related - is this the case in ryzom too?
|
||||
// #ifdef NL_OS_MAC
|
||||
// // Water doesn't render on GeForce 8600M GT (on MAC OS X) if this extension is enabled
|
||||
// return false;
|
||||
// #endif
|
||||
|
||||
CHECK_EXT("GL_NV_vertex_program");
|
||||
CHECK_ADDRESS(NEL_PFNGLAREPROGRAMSRESIDENTNVPROC, glAreProgramsResidentNV);
|
||||
|
@ -882,10 +886,12 @@ static bool setupNVTextureShader(const char *glext)
|
|||
{
|
||||
H_AUTO_OGL(setupNVTextureShader);
|
||||
|
||||
#ifdef NL_OS_MAC
|
||||
// Water doesn't render on GeForce 8600M GT (on MAC OS X) if this extension is enabled
|
||||
return false;
|
||||
#endif
|
||||
// reenabled to allow bloom on mac, TODO: cleanly fix the water issue
|
||||
// i think this issue was mtp target related - is this the case in ryzom too?
|
||||
// #ifdef NL_OS_MAC
|
||||
// // Water doesn't render on GeForce 8600M GT (on MAC OS X) if this extension is enabled
|
||||
// return false;
|
||||
// #endif
|
||||
|
||||
CHECK_EXT("GL_NV_texture_shader");
|
||||
return true;
|
||||
|
|
|
@ -179,12 +179,8 @@ void CDriverGLStates::forceDefaults(uint nbStages)
|
|||
// Cull order
|
||||
_CullMode = CCW;
|
||||
glCullFace(GL_BACK);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
void CDriverGLStates::enableBlend(uint enable)
|
||||
{
|
||||
|
|
|
@ -656,7 +656,7 @@ bool CDriverGL::setupTextureEx (ITexture& tex, bool bUpload, bool &bAllUploaded,
|
|||
|
||||
// insert or get the texture.
|
||||
{
|
||||
CSynchronized<TTexDrvInfoPtrMap>::CAccessor access(&_SyncTexDrvInfos);
|
||||
CUnfairSynchronized<TTexDrvInfoPtrMap>::CAccessor access(&_SyncTexDrvInfos);
|
||||
TTexDrvInfoPtrMap &rTexDrvInfos = access.value();
|
||||
|
||||
ItTexDrvInfoPtrMap itTex;
|
||||
|
|
1691
code/nel/src/3d/driver/opengl/driver_opengl_window.cpp
Normal file
1691
code/nel/src/3d/driver/opengl/driver_opengl_window.cpp
Normal file
File diff suppressed because it is too large
Load diff
|
@ -55,6 +55,9 @@ bool init(uint windowIcon = 0, emptyProc exitFunc = 0);
|
|||
/// mac specific stuff while calling CDriverGL::setDisplay()
|
||||
bool setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool resizeable);
|
||||
|
||||
/// mac specific stuff while calling CDriverGL::setMode()
|
||||
bool setMode(const GfxMode& mode);
|
||||
|
||||
/// mac specific stuff while calling CDriverGL::getWindowSize()
|
||||
void getWindowSize(uint32 &width, uint32 &height);
|
||||
|
||||
|
@ -70,10 +73,25 @@ void setWindowTitle(const ucstring &title);
|
|||
/// mac specific stuff while calling CDriverGL::swapBuffers()
|
||||
void swapBuffers();
|
||||
|
||||
/// mac specific stuff while calling CDriverGL::setCapture()
|
||||
void setCapture(bool b);
|
||||
|
||||
/// mac specific stuff while calling CDriverGL::showCursor()
|
||||
void showCursor(bool b);
|
||||
|
||||
/// mac specific stuff while calling CDriverGL::setMousePos()
|
||||
void setMousePos(float x, float y);
|
||||
|
||||
/// mac specific stuff while calling CDriverGL::release()
|
||||
void release();
|
||||
|
||||
/// mac specific stuff while calling CCocoaEventEmitter::submitEvents()
|
||||
void submitEvents(NLMISC::CEventServer& server,
|
||||
bool allWindows, NLMISC::CCocoaEventEmitter* eventEmitter);
|
||||
|
||||
/// mac specific stuff while calling CCocoaEventEmitter::emulateMouseRawMode()
|
||||
void emulateMouseRawMode(bool enable);
|
||||
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -19,13 +19,14 @@
|
|||
#include "cocoa_adapter.h"
|
||||
|
||||
#include "nel/misc/events.h"
|
||||
#include "nel/misc/game_device_events.h"
|
||||
#include "nel/3d/driver.h"
|
||||
|
||||
#include "cocoa_event_emitter.h"
|
||||
#include "cocoa_opengl_view.h"
|
||||
#include "cocoa_window.h"
|
||||
|
||||
// virtual key codes are only defined here. we still do not need to link carbon
|
||||
// Virtual key codes are only defined here. We still do not need to link carbon.
|
||||
// see: http://lists.apple.com/archives/Cocoa-dev/2009/May/msg01180.html
|
||||
#include <Carbon/Carbon.h>
|
||||
|
||||
|
@ -33,16 +34,22 @@
|
|||
|
||||
namespace NL3D { namespace MAC {
|
||||
|
||||
static NSApplication* g_app = 0;
|
||||
static NSAutoreleasePool* g_pool = 0;
|
||||
static CocoaWindow* g_window = 0;
|
||||
static CocoaOpenGLView* g_glview = 0;
|
||||
static NSOpenGLContext* g_glctx = 0;
|
||||
static NSApplication* g_app = nil;
|
||||
static NSAutoreleasePool* g_pool = nil;
|
||||
static CocoaWindow* g_window = nil;
|
||||
static CocoaOpenGLView* g_glview = nil;
|
||||
static NSOpenGLContext* g_glctx = nil;
|
||||
static bool g_emulateRawMode = false;
|
||||
|
||||
|
||||
#define UGLY_BACKBUFFER_SIZE_WORKAROUND
|
||||
|
||||
#ifdef UGLY_BACKBUFFER_SIZE_WORKAROUND
|
||||
static int g_bufferSize[2];
|
||||
#endif
|
||||
|
||||
void ctor()
|
||||
{
|
||||
nldebug("mac cpp bridge called");
|
||||
|
||||
// create a pool, cocoa code would leak memory otherwise
|
||||
g_pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
|
@ -52,7 +59,9 @@ void ctor()
|
|||
|
||||
void dtor()
|
||||
{
|
||||
nldebug("mac cpp bridge called");
|
||||
/*
|
||||
TODO there might be some more stuff to release ;)
|
||||
*/
|
||||
|
||||
// release the pool
|
||||
[g_pool release];
|
||||
|
@ -60,32 +69,51 @@ void dtor()
|
|||
|
||||
bool init(uint windowIcon, emptyProc exitFunc)
|
||||
{
|
||||
nldebug("mac cpp bridge called with %u %u", windowIcon, exitFunc);
|
||||
/*
|
||||
TODO nothing to do here? split other stuff to match api cleanly.
|
||||
*/
|
||||
return true;
|
||||
}
|
||||
|
||||
bool setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool resizeable)
|
||||
{
|
||||
nldebug("mac cpp bridge called with %u %u %u %u", wnd, &mode, show, resizeable);
|
||||
/*
|
||||
TODO use show
|
||||
*/
|
||||
|
||||
// create a window
|
||||
/* TODO: NSBackingStoreBuffered ??? */
|
||||
g_window = [[CocoaWindow alloc] initWithContentRect:NSMakeRect(0, 0, 1024, 768)
|
||||
styleMask:NSTitledWindowMask | NSResizableWindowMask |
|
||||
NSClosableWindowMask | NSMiniaturizableWindowMask
|
||||
backing:NSBackingStoreBuffered
|
||||
defer:NO];
|
||||
/*
|
||||
TODO add menu, on quit send EventDestroyWindowId
|
||||
*/
|
||||
|
||||
unsigned int styleMask = NSTitledWindowMask | NSClosableWindowMask |
|
||||
NSMiniaturizableWindowMask;
|
||||
|
||||
if(resizeable)
|
||||
styleMask |= NSResizableWindowMask;
|
||||
|
||||
// create a cocoa window with the size provided by the mode parameter
|
||||
g_window = [[CocoaWindow alloc]
|
||||
initWithContentRect:NSMakeRect(0, 0, mode.Width, mode.Height)
|
||||
styleMask:styleMask backing:NSBackingStoreBuffered defer:NO];
|
||||
|
||||
if(!g_window)
|
||||
nlerror("cannot create window");
|
||||
|
||||
/*
|
||||
TODO use mode.Depth
|
||||
TODO NSOpenGLPFAOffScreen
|
||||
*/
|
||||
// setup opengl settings
|
||||
NSOpenGLPixelFormatAttribute att[] =
|
||||
{
|
||||
NSOpenGLPFAWindow,
|
||||
NSOpenGLPFADoubleBuffer,
|
||||
NSOpenGLPFAColorSize, 24,
|
||||
NSOpenGLPFAAlphaSize, 8,
|
||||
NSOpenGLPFADepthSize, 24,
|
||||
NSOpenGLPFAAlphaSize, 8,
|
||||
NSOpenGLPFAStencilSize, 8,
|
||||
NSOpenGLPFANoRecovery,
|
||||
NSOpenGLPFAAccelerated,
|
||||
NSOpenGLPFABackingStore,
|
||||
0
|
||||
};
|
||||
|
||||
|
@ -93,63 +121,323 @@ bool setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool resizeable)
|
|||
NSOpenGLPixelFormat* format =
|
||||
[[NSOpenGLPixelFormat alloc] initWithAttributes:att];
|
||||
|
||||
if(!format)
|
||||
nlerror("cannot create NSOpenGLPixelFormat");
|
||||
|
||||
// create a opengl view with the created format
|
||||
g_glview = [[CocoaOpenGLView alloc]
|
||||
initWithFrame:NSMakeRect(0, 0, 1024, 768) pixelFormat: format];
|
||||
initWithFrame:NSMakeRect(0, 0, 0, 0) pixelFormat: format];
|
||||
|
||||
if(!g_glview)
|
||||
nlerror("cannot create view");
|
||||
|
||||
// put the view into the window
|
||||
[g_window setContentView:g_glview];
|
||||
|
||||
// set the window to non transparent
|
||||
[g_window setOpaque:YES];
|
||||
|
||||
// enable mouse move events, NeL wants them
|
||||
[g_window setAcceptsMouseMovedEvents:YES];
|
||||
|
||||
// there are no overlapping subviews, so we can use the magical optimization!
|
||||
[g_window useOptimizedDrawing:YES];
|
||||
|
||||
// create a opengl context for the view
|
||||
g_glctx = [g_glview openGLContext];
|
||||
|
||||
// setup some stuff in the window
|
||||
[g_window setContentView:g_glview];
|
||||
[g_window makeKeyAndOrderFront:nil];
|
||||
[g_window setAcceptsMouseMovedEvents:YES];
|
||||
if(!g_glctx)
|
||||
nlerror("cannot create context");
|
||||
|
||||
// make the views opengl context the currrent one
|
||||
// make the view's opengl context the currrent one
|
||||
[g_glctx makeCurrentContext];
|
||||
|
||||
// put the window to the front and make it the key window
|
||||
[g_window makeKeyAndOrderFront:nil];
|
||||
|
||||
// this is our main window
|
||||
[g_window makeMainWindow];
|
||||
|
||||
// tell the application that we are running now
|
||||
[g_app finishLaunching];
|
||||
|
||||
// free the pixel format object
|
||||
[format release];
|
||||
|
||||
// further mode setting, like switching to fullscreen and resolution setup
|
||||
setMode(mode);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool setMode(const GfxMode& mode)
|
||||
{
|
||||
// for fullscreen mode, adjust the back buffer size to the desired resolution
|
||||
if(!mode.Windowed)
|
||||
{
|
||||
// set the back buffer manually to match the desired rendering resolution
|
||||
GLint dim[2] = { mode.Width, mode.Height };
|
||||
CGLError error = CGLSetParameter((CGLContextObj)[g_glctx CGLContextObj],
|
||||
kCGLCPSurfaceBackingSize, dim);
|
||||
|
||||
if(error != kCGLNoError)
|
||||
nlerror("cannot set kCGLCPSurfaceBackingSize parameter (%s)",
|
||||
CGLErrorString(error));
|
||||
}
|
||||
|
||||
// leave fullscreen mode, enter windowed mode
|
||||
if(mode.Windowed && [g_glview isInFullScreenMode])
|
||||
{
|
||||
// disable manual setting of back buffer size, cocoa handles this
|
||||
// automatically as soon as the view gets resized
|
||||
CGLError error = CGLDisable((CGLContextObj)[g_glctx CGLContextObj],
|
||||
kCGLCESurfaceBackingSize);
|
||||
|
||||
if(error != kCGLNoError)
|
||||
nlerror("cannot disable kCGLCESurfaceBackingSize (%s)",
|
||||
CGLErrorString(error));
|
||||
|
||||
// pull the view back from fullscreen restoring window options
|
||||
[g_glview exitFullScreenModeWithOptions:nil];
|
||||
}
|
||||
|
||||
// enter fullscreen, leave windowed mode
|
||||
else if(!mode.Windowed && ![g_glview isInFullScreenMode])
|
||||
{
|
||||
// enable manual back buffer size for mode setting in fullscreen
|
||||
CGLError error = CGLEnable((CGLContextObj)[g_glctx CGLContextObj],
|
||||
kCGLCESurfaceBackingSize);
|
||||
|
||||
if(error != kCGLNoError)
|
||||
nlerror("cannot enable kCGLCESurfaceBackingSize (%s)",
|
||||
CGLErrorString(error));
|
||||
|
||||
// put the view in fullscreen mode, hiding the dock but enabling the menubar
|
||||
// to pop up if the mouse hits the top screen border.
|
||||
// NOTE: withOptions:nil disables <CMD>+<Tab> application switching!
|
||||
[g_glview enterFullScreenMode:[NSScreen mainScreen] withOptions:
|
||||
[NSDictionary dictionaryWithObjectsAndKeys:
|
||||
[NSNumber numberWithInt:
|
||||
NSApplicationPresentationHideDock |
|
||||
NSApplicationPresentationAutoHideMenuBar],
|
||||
NSFullScreenModeApplicationPresentationOptions, nil]];
|
||||
|
||||
/*
|
||||
TODO check if simply using NSView enterFullScreenMode is a good idea.
|
||||
the context can be set to full screen as well, performance differences?
|
||||
*/
|
||||
}
|
||||
|
||||
#ifdef UGLY_BACKBUFFER_SIZE_WORKAROUND
|
||||
// due to a back buffer size reading problem, just store the size
|
||||
g_bufferSize[0] = mode.Width;
|
||||
g_bufferSize[1] = mode.Height;
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void getWindowSize(uint32 &width, uint32 &height)
|
||||
{
|
||||
NSRect rect = [g_glview bounds];
|
||||
if(!g_glctx)
|
||||
return;
|
||||
|
||||
// A cocoa fullscreen view stays at the native resolution of the display.
|
||||
// When changing the rendering resolution, the size of the back buffer gets
|
||||
// changed, but the view still stays at full resolution. So the scaling of
|
||||
// the image from the rendered resolution to the view's resolution is done
|
||||
// by cocoa automatically while flushing buffers.
|
||||
// That's why, in fullscreen mode, return the resolution of the back buffer,
|
||||
// not the one from the window.
|
||||
|
||||
#ifdef UGLY_BACKBUFFER_SIZE_WORKAROUND
|
||||
// in fullscreen mode
|
||||
if([g_glview isInFullScreenMode])
|
||||
{
|
||||
// use the size stored in setMode()
|
||||
width = g_bufferSize[0];
|
||||
height = g_bufferSize[1];
|
||||
}
|
||||
|
||||
// in windowed mode
|
||||
else
|
||||
{
|
||||
// use the size of the view
|
||||
NSRect rect = [g_glview frame];
|
||||
width = rect.size.width;
|
||||
height = rect.size.height;
|
||||
}
|
||||
#else
|
||||
/*
|
||||
TODO does not work atm, "invalid enumeration"
|
||||
*/
|
||||
// check if manual back buffer sizing is enabled (thats only in fullscreen)
|
||||
GLint surfaceBackingSizeSet = 0;
|
||||
CGLError error = CGLIsEnabled((CGLContextObj)[g_glctx CGLContextObj],
|
||||
kCGLCESurfaceBackingSize, &surfaceBackingSizeSet);
|
||||
|
||||
if(error != kCGLNoError)
|
||||
nlerror("cannot check kCGLCESurfaceBackingSize state (%s)",
|
||||
CGLErrorString(error));
|
||||
|
||||
// if in fullscreen mode (only in fullscreen back buffer sizing is used)
|
||||
if(surfaceBackingSizeSet)
|
||||
{
|
||||
/*
|
||||
TODO does not work atm, "invalid enumeration"
|
||||
*/
|
||||
// get the back buffer size
|
||||
GLint dim[2];
|
||||
CGLError error = CGLGetParameter((CGLContextObj)[g_glctx CGLContextObj],
|
||||
kCGLCPSurfaceBackingSize, dim);
|
||||
|
||||
if(error != kCGLNoError)
|
||||
nlerror("cannot get kCGLCPSurfaceBackingSize value (%s)",
|
||||
CGLErrorString(error));
|
||||
|
||||
// put size into ref params
|
||||
width = dim[0];
|
||||
height = dim[1];
|
||||
}
|
||||
|
||||
// if in windowed mode
|
||||
else
|
||||
{
|
||||
// return the views size
|
||||
NSRect rect = [g_glview frame];
|
||||
|
||||
// put size into ref params
|
||||
width = rect.size.width;
|
||||
height = rect.size.height;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void getWindowPos(uint32 &x, uint32 &y)
|
||||
{
|
||||
// get the rect (position, size) of the screen
|
||||
NSRect screenRect = [[g_window screen] frame];
|
||||
|
||||
// get the rect (position, size) of the window
|
||||
NSRect windowRect = [g_window frame];
|
||||
|
||||
// simply return x
|
||||
x = windowRect.origin.x;
|
||||
|
||||
// map y from cocoa to NeL coordinates before returning
|
||||
y = screenRect.size.height - windowRect.size.height - windowRect.origin.y;
|
||||
}
|
||||
|
||||
void setWindowPos(uint32 x, uint32 y)
|
||||
{
|
||||
// get the size of the screen
|
||||
NSRect screenRect = [[g_window screen] frame];
|
||||
|
||||
// get the size of the window
|
||||
NSRect windowRect = [g_window frame];
|
||||
|
||||
// convert y from NeL coordinates to cocoa coordinates
|
||||
y = screenRect.size.height - y;
|
||||
|
||||
// tell cocoa to move the window
|
||||
[g_window setFrameTopLeftPoint:NSMakePoint(x, y)];
|
||||
}
|
||||
|
||||
void setWindowTitle(const ucstring &title)
|
||||
{
|
||||
// well... set the title of the window
|
||||
[g_window setTitle:[NSString stringWithUTF8String:title.toUtf8().c_str()]];
|
||||
}
|
||||
|
||||
void swapBuffers()
|
||||
{
|
||||
// make cocoa draw buffer contents to the view
|
||||
[g_glctx flushBuffer];
|
||||
}
|
||||
|
||||
void setCapture(bool b)
|
||||
{
|
||||
// no need to capture
|
||||
}
|
||||
|
||||
void showCursor(bool b)
|
||||
{
|
||||
// Mac OS manages a show/hide counter for the cursor, so hiding the cursor
|
||||
// twice requires two calls to "show" to make the cursor visible again.
|
||||
// Since other platforms seem to not do this, the functionality is masked here
|
||||
// by only calling hide if the cursor is visible and only calling show if
|
||||
// the cursor was hidden.
|
||||
|
||||
CGDisplayErr error = kCGErrorSuccess;
|
||||
static bool visible = true;
|
||||
|
||||
if(b && !visible)
|
||||
{
|
||||
error = CGDisplayShowCursor(kCGDirectMainDisplay);
|
||||
visible = true;
|
||||
}
|
||||
else if(!b && visible)
|
||||
{
|
||||
error = CGDisplayHideCursor(kCGDirectMainDisplay);
|
||||
visible = false;
|
||||
}
|
||||
|
||||
if(error != kCGErrorSuccess)
|
||||
nlerror("cannot capture / un-capture cursor");
|
||||
}
|
||||
|
||||
void setMousePos(float x, float y)
|
||||
{
|
||||
/*
|
||||
TODO FIXME for windows placed on non primary monitor
|
||||
*/
|
||||
|
||||
// CG wants absolute coordinates related to screen top left
|
||||
CGFloat fromScreenLeft = 0.0;
|
||||
CGFloat fromScreenTop = 0.0;
|
||||
|
||||
// get the gl view's rect for height and width
|
||||
NSRect viewRect = [g_glview frame];
|
||||
|
||||
// if the view is not fullscreen, window top left is needed as offset
|
||||
if(![g_glview isInFullScreenMode])
|
||||
{
|
||||
// get the rect (position, size) of the screen
|
||||
NSRect screenRect = [[g_window screen] frame];
|
||||
|
||||
// get the rect (position, size) of the window
|
||||
NSRect windowRect = [g_window frame];
|
||||
|
||||
// window's x is ok
|
||||
fromScreenLeft = windowRect.origin.x;
|
||||
|
||||
// TODO this code assumes, that the view fills the window
|
||||
|
||||
// map window bottom to view top
|
||||
fromScreenTop = screenRect.size.height -
|
||||
viewRect.size.height - windowRect.origin.y;
|
||||
}
|
||||
|
||||
// position inside the view
|
||||
fromScreenLeft += (viewRect.size.width * x);
|
||||
fromScreenTop += (viewRect.size.height * (1 - y));
|
||||
|
||||
// actually set the mouse position
|
||||
CGDisplayErr error = CGDisplayMoveCursorToPoint(
|
||||
kCGDirectMainDisplay, CGPointMake(fromScreenLeft, fromScreenTop));
|
||||
|
||||
if(error != kCGErrorSuccess)
|
||||
nlerror("cannot set mouse position");
|
||||
}
|
||||
|
||||
void release()
|
||||
{
|
||||
/*
|
||||
TODO release some stuff
|
||||
*/
|
||||
nlwarning("not implemented");
|
||||
}
|
||||
|
||||
/*
|
||||
TODO: this function has to be moved to a more central place to handle key
|
||||
mapping on mac x11 as well
|
||||
|
@ -296,7 +584,7 @@ NLMISC::TKeyButton modifierFlagsToNelKeyButton(unsigned int modifierFlags)
|
|||
|
||||
bool isTextKeyEvent(NSEvent* event)
|
||||
{
|
||||
// if there are no characters provided with this event, is is not a text event
|
||||
// if there are no characters provided with this event, it is not a text event
|
||||
if([[event characters] length] == 0)
|
||||
return false;
|
||||
|
||||
|
@ -321,7 +609,7 @@ bool isTextKeyEvent(NSEvent* event)
|
|||
TODO check why iswprint(character) does not solve it.
|
||||
it always returns false, even for π, é, ...
|
||||
*/
|
||||
// > 127 but not printable
|
||||
// characters > 127 but not printable
|
||||
if( nelKey == NLMISC::KeyF1 || nelKey == NLMISC::KeyF2 ||
|
||||
nelKey == NLMISC::KeyF3 || nelKey == NLMISC::KeyF4 ||
|
||||
nelKey == NLMISC::KeyF5 || nelKey == NLMISC::KeyF6 ||
|
||||
|
@ -346,6 +634,11 @@ bool isTextKeyEvent(NSEvent* event)
|
|||
return false;
|
||||
}
|
||||
|
||||
void emulateMouseRawMode(bool enable)
|
||||
{
|
||||
g_emulateRawMode = enable;
|
||||
}
|
||||
|
||||
void submitEvents(NLMISC::CEventServer& server,
|
||||
bool allWindows, NLMISC::CCocoaEventEmitter* eventEmitter)
|
||||
{
|
||||
|
@ -354,7 +647,7 @@ void submitEvents(NLMISC::CEventServer& server,
|
|||
g_pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
// we break if there was no event to handle
|
||||
/* TODO maximum? */
|
||||
/* TODO maximum number of events processed in one update? */
|
||||
while(true)
|
||||
{
|
||||
// get the next event to handle
|
||||
|
@ -366,55 +659,133 @@ void submitEvents(NLMISC::CEventServer& server,
|
|||
if(!event)
|
||||
break;
|
||||
|
||||
// NSLog(@"%@", event);
|
||||
// get the views size
|
||||
NSRect rect = [g_glview frame];
|
||||
|
||||
uint32 width, height;
|
||||
/* TODO cache? */
|
||||
getWindowSize(width, height);
|
||||
// TODO this code assumes, that the view fills the window
|
||||
// convert the mouse position to NeL style (relative)
|
||||
float mouseX = event.locationInWindow.x / (float)rect.size.width;
|
||||
float mouseY = event.locationInWindow.y / (float)rect.size.height;
|
||||
|
||||
// get the mouse position in nel style (relative)
|
||||
float mouseX = event.locationInWindow.x / (float)width;
|
||||
float mouseY = event.locationInWindow.y / (float)height;
|
||||
// if the mouse event was placed on the window's titlebar, don't tell NeL :)
|
||||
if(mouseY > 1.0 && event.type != NSKeyDown && event.type != NSKeyUp)
|
||||
{
|
||||
[g_app sendEvent:event];
|
||||
[g_app updateWindows];
|
||||
continue;
|
||||
}
|
||||
|
||||
switch(event.type)
|
||||
{
|
||||
case NSLeftMouseDown:
|
||||
{
|
||||
/*
|
||||
TODO modifiers with mouse events
|
||||
*/
|
||||
server.postEvent(new NLMISC::CEventMouseDown(
|
||||
mouseX, mouseY, NLMISC::leftButton /* modifiers */, eventEmitter));
|
||||
}
|
||||
break;
|
||||
case NSLeftMouseUp:
|
||||
{
|
||||
/*
|
||||
TODO modifiers with mouse events
|
||||
*/
|
||||
server.postEvent(new NLMISC::CEventMouseUp(
|
||||
mouseX, mouseY, NLMISC::leftButton /* modifiers */, eventEmitter));
|
||||
break;
|
||||
}
|
||||
case NSRightMouseDown:
|
||||
{
|
||||
/*
|
||||
TODO modifiers with mouse events
|
||||
*/
|
||||
server.postEvent(new NLMISC::CEventMouseDown(
|
||||
mouseX, mouseY, NLMISC::rightButton /* modifiers */, eventEmitter));
|
||||
break;
|
||||
}
|
||||
case NSRightMouseUp:
|
||||
{
|
||||
/*
|
||||
TODO modifiers with mouse events
|
||||
*/
|
||||
server.postEvent(new NLMISC::CEventMouseUp(
|
||||
mouseX, mouseY, NLMISC::rightButton /* modifiers */, eventEmitter));
|
||||
break;
|
||||
}
|
||||
case NSMouseMoved:
|
||||
server.postEvent(new NLMISC::CEventMouseMove(
|
||||
mouseX, mouseY, (NLMISC::TMouseButton)0 /* modifiers */, eventEmitter));
|
||||
{
|
||||
/*
|
||||
TODO modifiers with mouse events
|
||||
*/
|
||||
NLMISC::CEvent* nelEvent;
|
||||
|
||||
// when emulating raw mode, send the delta in a CGDMouseMove event
|
||||
if(g_emulateRawMode)
|
||||
nelEvent = new NLMISC::CGDMouseMove(
|
||||
eventEmitter, NULL /* no mouse device */, event.deltaX, -event.deltaY);
|
||||
|
||||
// normally send position in a CEventMouseMove
|
||||
else
|
||||
nelEvent = new NLMISC::CEventMouseMove(mouseX, mouseY,
|
||||
(NLMISC::TMouseButton)0 /* modifiers */, eventEmitter);
|
||||
|
||||
|
||||
server.postEvent(nelEvent);
|
||||
break;
|
||||
}
|
||||
case NSLeftMouseDragged:
|
||||
server.postEvent(new NLMISC::CEventMouseMove(
|
||||
mouseX, mouseY, NLMISC::leftButton /* modifiers */, eventEmitter));
|
||||
{
|
||||
/*
|
||||
TODO modifiers with mouse events
|
||||
*/
|
||||
NLMISC::CEvent* nelEvent;
|
||||
|
||||
// when emulating raw mode, send the delta in a CGDMouseMove event
|
||||
if(g_emulateRawMode)
|
||||
nelEvent = new NLMISC::CGDMouseMove(
|
||||
eventEmitter, NULL /* no mouse device */, event.deltaX, -event.deltaY);
|
||||
|
||||
// normally send position in a CEventMouseMove
|
||||
else
|
||||
nelEvent = new NLMISC::CEventMouseMove(mouseX, mouseY,
|
||||
NLMISC::leftButton /* modifiers */, eventEmitter);
|
||||
|
||||
server.postEvent(nelEvent);
|
||||
break;
|
||||
case NSRightMouseDragged:break;
|
||||
server.postEvent(new NLMISC::CEventMouseMove(
|
||||
mouseX, mouseY, NLMISC::rightButton /* modifiers */, eventEmitter));
|
||||
}
|
||||
case NSRightMouseDragged:
|
||||
{
|
||||
/*
|
||||
TODO modifiers with mouse events
|
||||
*/
|
||||
NLMISC::CEvent* nelEvent;
|
||||
|
||||
// when emulating raw mode, send the delta in a CGDMouseMove event
|
||||
if(g_emulateRawMode)
|
||||
nelEvent = new NLMISC::CGDMouseMove(
|
||||
eventEmitter, NULL /* no mouse device */, event.deltaX, -event.deltaY);
|
||||
|
||||
// normally send position in a CEventMouseMove
|
||||
else
|
||||
nelEvent = new NLMISC::CEventMouseMove(mouseX, mouseY,
|
||||
NLMISC::rightButton /* modifiers */, eventEmitter);
|
||||
|
||||
server.postEvent(nelEvent);
|
||||
break;
|
||||
}
|
||||
case NSMouseEntered:break;
|
||||
case NSMouseExited:break;
|
||||
case NSKeyDown:
|
||||
// push the key press event to the new event server
|
||||
{
|
||||
// push the key press event to the event server
|
||||
server.postEvent(new NLMISC::CEventKeyDown(
|
||||
virtualKeycodeToNelKey([event keyCode]),
|
||||
modifierFlagsToNelKeyButton([event modifierFlags]),
|
||||
[event isARepeat] == NO,
|
||||
eventEmitter));
|
||||
|
||||
// if this was a text event
|
||||
if(isTextKeyEvent(event))
|
||||
{
|
||||
ucstring ucstr;
|
||||
|
@ -422,26 +793,39 @@ void submitEvents(NLMISC::CEventServer& server,
|
|||
// get the string associated with the key press event
|
||||
ucstr.fromUtf8([[event characters] UTF8String]);
|
||||
|
||||
// push to event server
|
||||
// push the text event to event server as well
|
||||
server.postEvent(new NLMISC::CEventChar(
|
||||
ucstr[0],
|
||||
NLMISC::noKeyButton,
|
||||
eventEmitter));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case NSKeyUp:
|
||||
{
|
||||
// push the key release event to the event server
|
||||
server.postEvent(new NLMISC::CEventKeyUp(
|
||||
virtualKeycodeToNelKey([event keyCode]),
|
||||
modifierFlagsToNelKeyButton([event modifierFlags]),
|
||||
eventEmitter));
|
||||
break;
|
||||
}
|
||||
case NSFlagsChanged:break;
|
||||
case NSAppKitDefined:break;
|
||||
case NSSystemDefined:break;
|
||||
case NSApplicationDefined:break;
|
||||
case NSPeriodic:break;
|
||||
case NSCursorUpdate:break;
|
||||
case NSScrollWheel:break;
|
||||
case NSScrollWheel:
|
||||
{
|
||||
/*
|
||||
TODO modifiers with mouse events
|
||||
*/
|
||||
server.postEvent(new NLMISC::CEventMouseWheel(
|
||||
mouseX, mouseY, (NLMISC::TMouseButton)0 /* modifiers */,
|
||||
(event.deltaY > 0), eventEmitter));
|
||||
break;
|
||||
}
|
||||
case NSTabletPoint:break;
|
||||
case NSTabletProximity:break;
|
||||
case NSOtherMouseDown:break;
|
||||
|
@ -454,10 +838,12 @@ void submitEvents(NLMISC::CEventServer& server,
|
|||
case NSEventTypeBeginGesture:break;
|
||||
case NSEventTypeEndGesture:break;
|
||||
default:
|
||||
{
|
||||
nlwarning("Unknown event type. dropping.");
|
||||
// NSLog(@"%@", event);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
[g_app sendEvent:event];
|
||||
[g_app updateWindows];
|
||||
|
|
|
@ -27,4 +27,10 @@ void CCocoaEventEmitter::submitEvents(CEventServer & server, bool allWindows)
|
|||
NL3D::MAC::submitEvents(server, allWindows, this);
|
||||
}
|
||||
|
||||
void CCocoaEventEmitter::emulateMouseRawMode(bool enable)
|
||||
{
|
||||
// just forwarding to our cocoa adapter
|
||||
NL3D::MAC::emulateMouseRawMode(enable);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ class CCocoaEventEmitter : public IEventEmitter
|
|||
{
|
||||
public:
|
||||
virtual void submitEvents(CEventServer & server, bool allWindows);
|
||||
virtual void emulateMouseRawMode(bool enable);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
*/
|
||||
@interface CocoaOpenGLView : NSOpenGLView<NSTextInputClient>
|
||||
{
|
||||
NSMutableAttributedString* backingStore;
|
||||
NSMutableAttributedString* characterStorage;
|
||||
NSRange markedRange;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
{
|
||||
if(self = [super initWithFrame:frame])
|
||||
{
|
||||
backingStore = [[NSMutableAttributedString alloc] initWithString:@""];
|
||||
characterStorage = [[NSMutableAttributedString alloc] initWithString:@""];
|
||||
return self;
|
||||
}
|
||||
return nil;
|
||||
|
@ -32,9 +32,10 @@
|
|||
|
||||
- (void)dealloc
|
||||
{
|
||||
[backingStore release];
|
||||
[characterStorage release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
-(BOOL)acceptsFirstResponder
|
||||
{
|
||||
return YES;
|
||||
|
@ -77,13 +78,13 @@
|
|||
|
||||
if([aString length] == 0)
|
||||
{
|
||||
[backingStore deleteCharactersInRange:replacementRange];
|
||||
[characterStorage deleteCharactersInRange:replacementRange];
|
||||
[self unmarkText];
|
||||
}
|
||||
else
|
||||
{
|
||||
markedRange = NSMakeRange(replacementRange.location, [aString length]);
|
||||
[backingStore replaceCharactersInRange:replacementRange withString:aString];
|
||||
[characterStorage replaceCharactersInRange:replacementRange withString:aString];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -102,7 +103,7 @@
|
|||
-(NSAttributedString*)attributedSubstringForProposedRange:(NSRange)aRange
|
||||
actualRange:(NSRangePointer)actualRange
|
||||
{
|
||||
return [backingStore attributedSubstringFromRange:aRange];
|
||||
return [characterStorage attributedSubstringFromRange:aRange];
|
||||
}
|
||||
|
||||
-(void)insertText:(id)aString
|
||||
|
@ -111,7 +112,7 @@
|
|||
if(replacementRange.location == NSNotFound)
|
||||
replacementRange = markedRange;
|
||||
|
||||
[backingStore replaceCharactersInRange:replacementRange withString:aString];
|
||||
[characterStorage replaceCharactersInRange:replacementRange withString:aString];
|
||||
}
|
||||
|
||||
-(NSUInteger)characterIndexForPoint:(NSPoint)aPoint
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
namespace NLMISC {
|
||||
|
||||
CUnixEventEmitter::CUnixEventEmitter ():_dpy(NULL), _win(0), _PreviousKey(KeyNOKEY)
|
||||
CUnixEventEmitter::CUnixEventEmitter ():_dpy(NULL), _win(0), _PreviousKey(KeyNOKEY), _emulateRawMode(false)
|
||||
{
|
||||
_im = 0;
|
||||
_ic = 0;
|
||||
|
@ -83,6 +83,19 @@ void CUnixEventEmitter::submitEvents(CEventServer & server, bool allWindows)
|
|||
}
|
||||
}
|
||||
|
||||
void CUnixEventEmitter::emulateMouseRawMode(bool enable)
|
||||
{
|
||||
_emulateRawMode = enable;
|
||||
|
||||
if(_emulateRawMode)
|
||||
{
|
||||
XWindowAttributes xwa;
|
||||
XGetWindowAttributes(_dpy, _win, &xwa);
|
||||
XWarpPointer(_dpy, None, _win, None, None, None, None,
|
||||
(xwa.width / 2), (xwa.height / 2));
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef AltMask
|
||||
# ifdef NL_OS_MAC
|
||||
# define AltMask (8192)
|
||||
|
@ -120,6 +133,9 @@ TKey getKeyFromKeycode (uint keycode)
|
|||
switch (keycode)
|
||||
{
|
||||
#ifdef NL_OS_MAC
|
||||
/*
|
||||
TODO use key mapping from driver/opengl/mac/cocoa_adapter.mm
|
||||
*/
|
||||
case 0x12: return Key1;
|
||||
case 0x13: return Key2;
|
||||
case 0x14: return Key3;
|
||||
|
@ -162,10 +178,37 @@ TKey getKeyFromKeycode (uint keycode)
|
|||
case 0x31: return KeyAPOSTROPHE;
|
||||
case 0x33: return KeyBACKSLASH;
|
||||
case 0x5e: return KeyOEM_102;
|
||||
case 0x3a: return KeyCOMMA;
|
||||
// case 0x3a: return KeyCOMMA;
|
||||
case 0x3b: return KeyPERIOD;
|
||||
case 0x3c: return KeySLASH;
|
||||
case 0x3d: return KeyPARAGRAPH;
|
||||
// for non-standard keyboards, maps to QWERTY keys
|
||||
case 0x18: return KeyQ;
|
||||
case 0x19: return KeyW;
|
||||
case 0x1a: return KeyE;
|
||||
case 0x1b: return KeyR;
|
||||
case 0x1c: return KeyT;
|
||||
case 0x1d: return KeyY;
|
||||
case 0x1e: return KeyU;
|
||||
case 0x1f: return KeyI;
|
||||
case 0x20: return KeyO;
|
||||
case 0x21: return KeyP;
|
||||
case 0x26: return KeyQ;
|
||||
case 0x27: return KeyS;
|
||||
case 0x28: return KeyD;
|
||||
case 0x29: return KeyF;
|
||||
case 0x2a: return KeyG;
|
||||
case 0x2b: return KeyH;
|
||||
case 0x2c: return KeyJ;
|
||||
case 0x2d: return KeyK;
|
||||
case 0x2e: return KeyL;
|
||||
case 0x34: return KeyZ;
|
||||
case 0x35: return KeyX;
|
||||
case 0x36: return KeyC;
|
||||
case 0x37: return KeyV;
|
||||
case 0x38: return KeyB;
|
||||
case 0x39: return KeyN;
|
||||
case 0x3a: return KeyM;
|
||||
#endif
|
||||
default:
|
||||
// nlwarning("missing keycode 0x%x %d '%c'", keycode, keycode, keycode);
|
||||
|
@ -316,6 +359,9 @@ TKey getKeyFromKeySym (KeySym keysym)
|
|||
|
||||
void CUnixEventEmitter::processMessage (XEvent &event, CEventServer &server)
|
||||
{
|
||||
XWindowAttributes xwa;
|
||||
XGetWindowAttributes (_dpy, _win, &xwa);
|
||||
|
||||
switch (event.type)
|
||||
{
|
||||
Case(ReparentNotify)
|
||||
|
@ -325,8 +371,6 @@ void CUnixEventEmitter::processMessage (XEvent &event, CEventServer &server)
|
|||
Case(ButtonPress)
|
||||
{
|
||||
//nlinfo("%d %d %d", event.xbutton.button, event.xbutton.x, event.xbutton.y);
|
||||
XWindowAttributes xwa;
|
||||
XGetWindowAttributes (_dpy, _win, &xwa);
|
||||
float fX = (float) event.xbutton.x / (float) xwa.width;
|
||||
float fY = 1.0f - (float) event.xbutton.y / (float) xwa.height;
|
||||
TMouseButton button=getMouseButton(event.xbutton.state);
|
||||
|
@ -353,8 +397,6 @@ void CUnixEventEmitter::processMessage (XEvent &event, CEventServer &server)
|
|||
Case(ButtonRelease)
|
||||
{
|
||||
//nlinfo("%d %d %d", event.xbutton.button, event.xbutton.x, event.xbutton.y);
|
||||
XWindowAttributes xwa;
|
||||
XGetWindowAttributes (_dpy, _win, &xwa);
|
||||
float fX = (float) event.xbutton.x / (float) xwa.width;
|
||||
float fY = 1.0f - (float) event.xbutton.y / (float) xwa.height;
|
||||
switch(event.xbutton.button)
|
||||
|
@ -373,13 +415,36 @@ void CUnixEventEmitter::processMessage (XEvent &event, CEventServer &server)
|
|||
}
|
||||
Case(MotionNotify)
|
||||
{
|
||||
XWindowAttributes xwa;
|
||||
XGetWindowAttributes (_dpy, _win, &xwa);
|
||||
TMouseButton button=getMouseButton (event.xbutton.state);
|
||||
|
||||
// if raw mode should be emulated
|
||||
if(_emulateRawMode)
|
||||
{
|
||||
// when we just wrapped back the pointer to 0.5 / 0.5, ignore event
|
||||
if(event.xbutton.x == xwa.width / 2 && event.xbutton.y == xwa.height / 2)
|
||||
break;
|
||||
|
||||
// post a CGDMouseMove with the movement delta to the event server
|
||||
server.postEvent(
|
||||
new CGDMouseMove(this, NULL /* no mouse device */,
|
||||
event.xbutton.x - (xwa.width / 2),
|
||||
(xwa.height / 2) - event.xbutton.y));
|
||||
|
||||
// move the pointer back to the center of the window
|
||||
XWarpPointer(_dpy, None, _win, None, None, None, None,
|
||||
(xwa.width / 2), (xwa.height / 2));
|
||||
}
|
||||
|
||||
// if in normal mouse mode
|
||||
else
|
||||
{
|
||||
// get the relative mouse position
|
||||
float fX = (float) event.xbutton.x / (float) xwa.width;
|
||||
float fY = 1.0f - (float) event.xbutton.y / (float) xwa.height;
|
||||
if ((fX == 0.5f) && (fY == 0.5f)) break;
|
||||
TMouseButton button=getMouseButton (event.xbutton.state);
|
||||
|
||||
// post a normal mouse move event to the event server
|
||||
server.postEvent (new CEventMouseMove (fX, fY, button, this));
|
||||
}
|
||||
break;
|
||||
}
|
||||
Case(KeyPress)
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include "nel/misc/types_nl.h"
|
||||
#include "nel/misc/event_emitter.h"
|
||||
#include "nel/misc/events.h"
|
||||
#include "nel/misc/game_device_events.h"
|
||||
|
||||
#ifdef NL_OS_UNIX
|
||||
|
||||
|
@ -54,6 +55,8 @@ public:
|
|||
*/
|
||||
virtual void submitEvents(CEventServer & server, bool allWindows);
|
||||
|
||||
virtual void emulateMouseRawMode(bool);
|
||||
|
||||
public:
|
||||
void processMessage (XEvent &event, CEventServer &server);
|
||||
|
||||
|
@ -65,6 +68,7 @@ private:
|
|||
TKey _PreviousKey;
|
||||
XIM _im;
|
||||
XIC _ic;
|
||||
bool _emulateRawMode;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#include "nel/3d/water_pool_manager.h"
|
||||
#include "nel/3d/u_camera.h"
|
||||
#include "nel/misc/hierarchical_timer.h"
|
||||
#include "nel/misc/event_emitter.h"
|
||||
|
||||
|
||||
using namespace NLMISC;
|
||||
|
@ -1594,6 +1595,11 @@ NLMISC::IKeyboardDevice *CDriverUser::enableLowLevelKeyboard(bool enable)
|
|||
return _Driver->enableLowLevelKeyboard(enable);
|
||||
}
|
||||
|
||||
void CDriverUser::emulateMouseRawMode(bool enable)
|
||||
{
|
||||
_Driver->getEventEmitter()->emulateMouseRawMode(enable);
|
||||
}
|
||||
|
||||
uint CDriverUser::getDoubleClickDelay(bool hardwareMouse)
|
||||
{
|
||||
NL3D_HAUTO_UI_DRIVER;
|
||||
|
|
|
@ -4,8 +4,8 @@ libdir=@libdir@
|
|||
includedir=@includedir@
|
||||
|
||||
Name: nel-3d
|
||||
Version: @VERSION@
|
||||
Description: NeL @VERSION@
|
||||
Version: @NL_VERSION@
|
||||
Description: NeL @NL_VERSION@
|
||||
Reqiures:
|
||||
Libs: -L${libdir}
|
||||
Libs.private: @LIBS@ @FREETYPE_LIBS@ -lc
|
||||
|
|
|
@ -6,6 +6,8 @@ SOURCE_GROUP(headers FILES ${PRIV_H} ${PUB_H})
|
|||
|
||||
IF(NOT WIN32)
|
||||
ADD_LIBRARY(nelgeorges SHARED ${SRC})
|
||||
CONFIGURE_FILE(nel-georges.pc.in nel-georges.pc)
|
||||
INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/nel-georges.pc" DESTINATION lib/pkgconfig)
|
||||
ELSE(NOT WIN32)
|
||||
ADD_LIBRARY(nelgeorges STATIC ${SRC})
|
||||
ENDIF(NOT WIN32)
|
||||
|
|
12
code/nel/src/georges/nel-georges.pc.in
Normal file
12
code/nel/src/georges/nel-georges.pc.in
Normal file
|
@ -0,0 +1,12 @@
|
|||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@
|
||||
|
||||
Name: nel-georges
|
||||
Version: @NL_VERSION@
|
||||
Description: NeL @NL_VERSION@
|
||||
Reqiures:
|
||||
Libs: -L${libdir}
|
||||
Libs.private: @LIBS@ -lc
|
||||
Cflags: -I${includedir}
|
|
@ -2,6 +2,8 @@ FILE(GLOB SRC *.cpp *.h)
|
|||
|
||||
IF(NOT WIN32)
|
||||
ADD_LIBRARY(nelligo SHARED ${SRC})
|
||||
CONFIGURE_FILE(nel-ligo.pc.in nel-ligo.pc)
|
||||
INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/nel-ligo.pc" DESTINATION lib/pkgconfig)
|
||||
ELSE(NOT WIN32)
|
||||
ADD_LIBRARY(nelligo STATIC ${SRC})
|
||||
ENDIF(NOT WIN32)
|
||||
|
|
12
code/nel/src/ligo/nel-ligo.pc.in
Normal file
12
code/nel/src/ligo/nel-ligo.pc.in
Normal file
|
@ -0,0 +1,12 @@
|
|||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@
|
||||
|
||||
Name: nel-ligo
|
||||
Version: @NL_VERSION@
|
||||
Description: NeL @NL_VERSION@
|
||||
Reqiures:
|
||||
Libs: -L${libdir}
|
||||
Libs.private: @LIBS@ -lc
|
||||
Cflags: -I${includedir}
|
|
@ -2,6 +2,8 @@ FILE(GLOB SRC *.cpp *.h config_file/*.cpp config_file/*.h)
|
|||
|
||||
IF(NOT WIN32)
|
||||
ADD_LIBRARY(nelmisc SHARED ${SRC})
|
||||
CONFIGURE_FILE(nel-misc.pc.in nel-misc.pc)
|
||||
INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/nel-misc.pc" DESTINATION lib/pkgconfig)
|
||||
ELSE(NOT WIN32)
|
||||
ADD_LIBRARY(nelmisc STATIC ${SRC})
|
||||
ENDIF(NOT WIN32)
|
||||
|
|
|
@ -230,7 +230,7 @@ void CStdDisplayer::doDisplay ( const CLog::TDisplayInfo& args, const char *mess
|
|||
printf ("%s", str.c_str());
|
||||
|
||||
if (!args.CallstackAndLog.empty())
|
||||
printf (args.CallstackAndLog.c_str());
|
||||
printf ("%s", args.CallstackAndLog.c_str());
|
||||
|
||||
fflush(stdout);
|
||||
}
|
||||
|
|
|
@ -4,8 +4,8 @@ libdir=@libdir@
|
|||
includedir=@includedir@
|
||||
|
||||
Name: nel-misc
|
||||
Version: @VERSION@
|
||||
Description: NeL @VERSION@
|
||||
Version: @NL_VERSION@
|
||||
Description: NeL @NL_VERSION@
|
||||
Reqiures:
|
||||
Libs: -L${libdir}
|
||||
Libs.private: @LIBS@ -lc -lpthread -lrt -ldl
|
||||
|
|
|
@ -52,6 +52,13 @@ void CWinEventEmitter::submitEvents(CEventServer & server, bool allWindows)
|
|||
_InternalServer.pump (allWindows);
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------*\
|
||||
emulateMouseRawMode()
|
||||
\*------------------------------------------------------------------*/
|
||||
void CWinEventEmitter::emulateMouseRawMode(bool enable)
|
||||
{
|
||||
nlerror("no raw mode emulation on windows, the CDIMouse has a real raw mode");
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------*\
|
||||
processMessage()
|
||||
|
|
|
@ -9,6 +9,8 @@ SET(NLNET_LIB ${LIBNAME})
|
|||
|
||||
IF(NOT WIN32)
|
||||
ADD_LIBRARY(nelnet SHARED ${SRC})
|
||||
CONFIGURE_FILE(nel-net.pc.in nel-net.pc)
|
||||
INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/nel-net.pc" DESTINATION lib/pkgconfig)
|
||||
ELSE(NOT WIN32)
|
||||
ADD_LIBRARY(nelnet STATIC ${SRC})
|
||||
ENDIF(NOT WIN32)
|
||||
|
|
12
code/nel/src/net/nel-net.pc.in
Normal file
12
code/nel/src/net/nel-net.pc.in
Normal file
|
@ -0,0 +1,12 @@
|
|||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@
|
||||
|
||||
Name: nel-net
|
||||
Version: @NL_VERSION@
|
||||
Description: NeL @NL_VERSION@
|
||||
Reqiures:
|
||||
Libs: -L${libdir}
|
||||
Libs.private: @LIBS@ -lc -lpthread -lrt -ldl
|
||||
Cflags: -I${includedir} -lc -lpthread -lrt -ldl
|
|
@ -2,6 +2,8 @@ FILE(GLOB SRC *.cpp *.h)
|
|||
|
||||
IF(NOT WIN32)
|
||||
ADD_LIBRARY(nelpacs SHARED ${SRC})
|
||||
CONFIGURE_FILE(nel-pacs.pc.in nel-pacs.pc)
|
||||
INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/nel-pacs.pc" DESTINATION lib/pkgconfig)
|
||||
ELSE(NOT WIN32)
|
||||
ADD_LIBRARY(nelpacs STATIC ${SRC})
|
||||
ENDIF(NOT WIN32)
|
||||
|
|
12
code/nel/src/pacs/nel-pacs.pc.in
Normal file
12
code/nel/src/pacs/nel-pacs.pc.in
Normal file
|
@ -0,0 +1,12 @@
|
|||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@
|
||||
|
||||
Name: nel-pacs
|
||||
Version: @NL_VERSION@
|
||||
Description: NeL @NL_VERSION@
|
||||
Reqiures:
|
||||
Libs: -L${libdir}
|
||||
Libs.private: @LIBS@ -lc -lpthread -lrt -ldl
|
||||
Cflags: -I${includedir} -lc -lpthread -lrt -ldl
|
|
@ -8,6 +8,8 @@ ENDIF(APPLE)
|
|||
|
||||
IF(NOT WIN32)
|
||||
ADD_LIBRARY(nelsound SHARED ${SRC})
|
||||
CONFIGURE_FILE(nel-sound.pc.in nel-sound.pc)
|
||||
INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/nel-sound.pc" DESTINATION lib/pkgconfig)
|
||||
ELSE(NOT WIN32)
|
||||
ADD_LIBRARY(nelsound STATIC ${SRC})
|
||||
ENDIF(NOT WIN32)
|
||||
|
|
|
@ -8,6 +8,11 @@ SET_TARGET_PROPERTIES(nel_drv_openal PROPERTIES VERSION ${NL_VERSION})
|
|||
ADD_DEFINITIONS(${LIBXML2_DEFINITIONS})
|
||||
|
||||
IF(WIN32)
|
||||
# Find and include EFX-Util on Windows.
|
||||
FIND_PACKAGE(EFXUtil)
|
||||
INCLUDE_DIRECTORIES(${EFXUTIL_INCLUDE_DIR})
|
||||
TARGET_LINK_LIBRARIES(nel_drv_openal ${EFXUTIL_LIBRARY})
|
||||
|
||||
SET_TARGET_PROPERTIES(nel_drv_openal PROPERTIES COMPILE_FLAGS "/Yustdopenal.h")
|
||||
SET_SOURCE_FILES_PROPERTIES(stdopenal.cpp PROPERTIES COMPILE_FLAGS "/Ycstdopenal.h")
|
||||
SET_TARGET_PROPERTIES(nel_drv_openal PROPERTIES
|
||||
|
|
12
code/nel/src/sound/nel-sound.pc.in
Normal file
12
code/nel/src/sound/nel-sound.pc.in
Normal file
|
@ -0,0 +1,12 @@
|
|||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@
|
||||
|
||||
Name: nel-sound
|
||||
Version: @NL_VERSION@
|
||||
Description: NeL @NL_VERSION@
|
||||
Reqiures:
|
||||
Libs: -L${libdir}
|
||||
Libs.private: @LIBS@ -lc -lpthread -lrt -ldl
|
||||
Cflags: -I${includedir} -lc -lpthread -lrt -ldl
|
|
@ -2,8 +2,10 @@ FILE(GLOB SRC *.cpp *.h ../s3tc_compressor_lib/*.h ../s3tc_compressor_lib/*.cpp)
|
|||
|
||||
ADD_EXECUTABLE(panoply_maker ${SRC})
|
||||
|
||||
INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${S3TC_INCLUDE_DIR})
|
||||
TARGET_LINK_LIBRARIES(panoply_maker ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} ${S3TC_LIBRARY} nelmisc nel3d)
|
||||
FIND_PACKAGE(Squish REQUIRED)
|
||||
|
||||
INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${SQUISH_INCLUDE_DIR})
|
||||
TARGET_LINK_LIBRARIES(panoply_maker ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} ${SQUISH_LIBRARY} nelmisc nel3d)
|
||||
IF(WIN32)
|
||||
SET_TARGET_PROPERTIES(panoply_maker PROPERTIES
|
||||
LINK_FLAGS "/NODEFAULTLIB:libcmt /NODEFAULTLIB:libc"
|
||||
|
|
|
@ -38,7 +38,9 @@ FIND_PATH(LIBWWW_ADDITIONAL_INCLUDE_DIR
|
|||
)
|
||||
|
||||
# combine both include directories into one variable
|
||||
IF(LIBWWW_ADDITIONAL_INCLUDE_DIR)
|
||||
SET(LIBWWW_INCLUDE_DIR ${LIBWWW_INCLUDE_DIR} ${LIBWWW_ADDITIONAL_INCLUDE_DIR})
|
||||
ENDIF(LIBWWW_ADDITIONAL_INCLUDE_DIR)
|
||||
|
||||
# helper to find all the libwww sub libraries
|
||||
MACRO(FIND_WWW_LIBRARY MYLIBRARY)
|
||||
|
@ -74,7 +76,6 @@ FIND_WWW_LIBRARY(LIBWWWINIT_LIBRARY wwwinit)
|
|||
FIND_WWW_LIBRARY(LIBWWWMIME_LIBRARY wwwmime)
|
||||
FIND_WWW_LIBRARY(LIBWWWMUX_LIBRARY wwwmux)
|
||||
FIND_WWW_LIBRARY(LIBWWWNEWS_LIBRARY wwwnews)
|
||||
FIND_WWW_LIBRARY(LIBWWWSSL_LIBRARY wwwssl)
|
||||
FIND_WWW_LIBRARY(LIBWWWSTREAM_LIBRARY wwwstream)
|
||||
FIND_WWW_LIBRARY(LIBWWWTELNET_LIBRARY wwwtelnet)
|
||||
FIND_WWW_LIBRARY(LIBWWWTRANS_LIBRARY wwwtrans)
|
||||
|
@ -88,7 +89,7 @@ SET(LIBWWW_LIBRARY
|
|||
${LIBWWWCORE_LIBRARY} ${LIBWWWDIR_LIBRARY} ${LIBWWWFILE_LIBRARY}
|
||||
${LIBWWWFTP_LIBRARY} ${LIBWWWGOPHER_LIBRARY} ${LIBWWWHTML_LIBRARY}
|
||||
${LIBWWWHTTP_LIBRARY} ${LIBWWWINIT_LIBRARY} ${LIBWWWMIME_LIBRARY}
|
||||
${LIBWWWMUX_LIBRARY} ${LIBWWWNEWS_LIBRARY} ${LIBWWWSSL_LIBRARY}
|
||||
${LIBWWWMUX_LIBRARY} ${LIBWWWNEWS_LIBRARY}
|
||||
${LIBWWWSTREAM_LIBRARY} ${LIBWWWTELNET_LIBRARY}
|
||||
${LIBWWWTRANS_LIBRARY} ${LIBWWWUTILS_LIBRARY} ${LIBWWWXML_LIBRARY}
|
||||
${LIBWWWZIP_LIBRARY}
|
||||
|
|
|
@ -44,22 +44,22 @@ if(APPLE)
|
|||
SET(MACOSX_BUNDLE_BUNDLE_VERSION "1.0")
|
||||
SET(MACOSX_BUNDLE_COPYRIGHT "Winchgate and The Ryzom Core Community")
|
||||
|
||||
ADD_EXECUTABLE(client MACOSX_BUNDLE ${SRC})
|
||||
ADD_EXECUTABLE(ryzom_client MACOSX_BUNDLE ${SRC})
|
||||
|
||||
# TODO: in release mode, cmake could copy all the dylibs into the .app
|
||||
# bundle for redistribution... should some part of cpack handle that?
|
||||
# ADD_CUSTOM_COMMAND(TARGET client POST_BUILD
|
||||
# ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD
|
||||
# # make frameworks directory in app bundle
|
||||
# COMMAND ${CMAKE_COMMAND} -E make_directory
|
||||
# ${CMAKE_CURRENT_BINARY_DIR}/client.app/Contents/Frameworks
|
||||
# ${CMAKE_CURRENT_BINARY_DIR}/ryzom_client.app/Contents/Frameworks
|
||||
# # copy framework into app bundle
|
||||
# COMMAND ${CMAKE_COMMAND} -E copy ${SOME_LIBRARY}
|
||||
# ${CMAKE_CURRENT_BINARY_DIR}/client.app/Contents/Frameworks
|
||||
# ${CMAKE_CURRENT_BINARY_DIR}/ryzom_client.app/Contents/Frameworks
|
||||
# # ...
|
||||
# # install_name_tool the lib pathes
|
||||
|
||||
ELSE(APPLE)
|
||||
ADD_EXECUTABLE(client ${SRC})
|
||||
ADD_EXECUTABLE(ryzom_client ${SRC})
|
||||
ENDIF(APPLE)
|
||||
|
||||
INCLUDE_DIRECTORIES(
|
||||
|
@ -70,10 +70,10 @@ INCLUDE_DIRECTORIES(
|
|||
${CURL_INCLUDE_DIRS}
|
||||
${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
TARGET_LINK_LIBRARIES(client ${PLATFORM_LINKFLAGS}
|
||||
TARGET_LINK_LIBRARIES(ryzom_client ${PLATFORM_LINKFLAGS}
|
||||
${LIBXML2_LIBRARIES}
|
||||
${NELMISC_LIBRARY}
|
||||
game_share
|
||||
ryzom_gameshare
|
||||
${NELNET_LIBRARY}
|
||||
${NELLIGO_LIBRARY}
|
||||
${NELGEORGES_LIBRARY}
|
||||
|
@ -82,18 +82,17 @@ TARGET_LINK_LIBRARIES(client ${PLATFORM_LINKFLAGS}
|
|||
${CURL_LIBRARIES}
|
||||
${NELSOUND_LIBRARY}
|
||||
${NELSNDDRV_LIBRARY}
|
||||
client_sheets
|
||||
ryzom_clientsheets
|
||||
${NELPACS_LIBRARY}
|
||||
${LIBWWW_LIBRARY}
|
||||
${Boost_LIBRARIES}
|
||||
seven_zip
|
||||
ryzom_sevenzip
|
||||
luabind # TODO: find luabind and expat cleanly using a find script
|
||||
expat)
|
||||
|
||||
IF(NOT WITH_COCOA)
|
||||
TARGET_LINK_LIBRARIES(client ${X11_LIBRARIES})
|
||||
TARGET_LINK_LIBRARIES(ryzom_client ${X11_LIBRARIES})
|
||||
ENDIF(NOT WITH_COCOA)
|
||||
|
||||
ADD_DEFINITIONS(${LIBXML2_DEFINITIONS})
|
||||
|
||||
INSTALL(TARGETS client RUNTIME DESTINATION bin COMPONENT client BUNDLE DESTINATION /Applications)
|
||||
INSTALL(TARGETS ryzom_client RUNTIME DESTINATION bin COMPONENT client BUNDLE DESTINATION /Applications)
|
||||
|
|
|
@ -2291,6 +2291,8 @@ void CCharacterCL::endAnimTransition()
|
|||
dir(front());
|
||||
*/
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
// Change the current mode.
|
||||
if ( _ModeWanted != MBEHAV::UNKNOWN_MODE )
|
||||
|
@ -2658,6 +2660,8 @@ KeyChosen:
|
|||
else
|
||||
nlwarning("CH::setAnim:%d: automaton '%s': state '%s': OnMoveRight '%s' is not valid.", _Slot, _CurrentAutomaton.c_str(), CAnimationState::getAnimationStateName(curAnimState.MoveState).c_str(), CAnimationState::getAnimationStateName(curAnimState.OnMoveRight).c_str());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// On Rotation/About Face
|
||||
|
@ -2684,6 +2688,8 @@ KeyChosen:
|
|||
else
|
||||
nlwarning("CH::setAnim:%d: automaton '%s': state '%s': OnRightRotation '%s' is not valid.", _Slot, _CurrentAutomaton.c_str(), CAnimationState::getAnimationStateName(curAnimState.MoveState).c_str(), CAnimationState::getAnimationStateName(curAnimState.OnRightRotation).c_str());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// Max Loop
|
||||
|
@ -2729,6 +2735,8 @@ KeyChosen:
|
|||
else
|
||||
nlwarning("CH::setAnim:%d: automaton '%s': state '%s': OnBigBendRight '%s' is not valid.", _Slot, _CurrentAutomaton.c_str(), CAnimationState::getAnimationStateName(curAnimState.MoveState).c_str(), CAnimationState::getAnimationStateName(curAnimState.OnBigBendRight).c_str());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// If the animation change according to a high speed and speed high enough or oo.
|
||||
|
@ -3084,6 +3092,7 @@ KeyChosen:
|
|||
case MAGICFX::CastLoop: afs = &_CurrentAttack->AttackLoopFX; break;
|
||||
case MAGICFX::CastEnd: afs = &_CurrentAttack->AttackEndFX; break;
|
||||
case MAGICFX::CastFail: afs = &_CurrentAttack->AttackFailFX; break;
|
||||
default: break;
|
||||
}
|
||||
playCastFX(afs, _CurrentAttackInfo.Intensity);
|
||||
}
|
||||
|
@ -3444,6 +3453,8 @@ ADD_METHOD(void CCharacterCL::updateAnimationState())
|
|||
case OnMoveRight:
|
||||
setAnim(_CurrentState->OnMoveRight);
|
||||
return;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// ON ROTATION
|
||||
|
@ -3458,6 +3469,8 @@ ADD_METHOD(void CCharacterCL::updateAnimationState())
|
|||
case OnRotRight:
|
||||
setAnim(CAnimationStateSheet::Idle);
|
||||
return;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// ON BAD HEADING
|
||||
|
@ -3475,6 +3488,8 @@ ADD_METHOD(void CCharacterCL::updateAnimationState())
|
|||
case OnBendRight:
|
||||
setAnim(_CurrentState->MoveState);
|
||||
return;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// \todo GUIGUI : changer de place cette partie je pense.
|
||||
|
@ -3640,6 +3655,8 @@ void CCharacterCL::beginCast(const MBEHAV::CBehaviour &behaviour)
|
|||
case MBEHAV::CAST_STUN:
|
||||
setAnim(CAnimationStateSheet::StunCastInit);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}// beginCast //
|
||||
|
||||
|
@ -3746,6 +3763,8 @@ void CCharacterCL::endCast(const MBEHAV::CBehaviour &behaviour, const MBEHAV::CB
|
|||
case MBEHAV::CAST_MIX_LINK:
|
||||
setAnim(CAnimationStateSheet::MixedCastLink);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -4443,9 +4462,10 @@ bool CCharacterCL::isCurrentBehaviourAttackEnd() const
|
|||
case MBEHAV::POWERFUL_ATTACK:
|
||||
case MBEHAV::AREA_ATTACK:
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
|
@ -4627,6 +4647,8 @@ void CCharacterCL::applyBehaviour(const CBehaviourContext &bc) // virtual
|
|||
case RANGE_ATTACK:
|
||||
combatAnimState= CAnimationStateSheet::Attack1;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -9151,6 +9173,8 @@ void CCharacterCL::CWornItem::startAttackFX(NL3D::USkeleton skeleton, uint inten
|
|||
else
|
||||
stickPoint = "box_arme_gauche";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (stickPoint)
|
||||
|
|
|
@ -5,26 +5,23 @@ SOURCE_GROUP(headers FILES ${PRIV_H} ${PUB_H})
|
|||
|
||||
|
||||
IF(NOT WIN32)
|
||||
ADD_LIBRARY(client_sheets SHARED ${SRC})
|
||||
ADD_LIBRARY(ryzom_clientsheets SHARED ${SRC})
|
||||
ELSE(NOT WIN32)
|
||||
ADD_LIBRARY(client_sheets STATIC ${SRC})
|
||||
ADD_LIBRARY(ryzom_clientsheets STATIC ${SRC})
|
||||
ENDIF(NOT WIN32)
|
||||
|
||||
INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${NEL_INCLUDE_DIR})
|
||||
TARGET_LINK_LIBRARIES(client_sheets game_share ${NELMISC_LIBRARY})
|
||||
SET_TARGET_PROPERTIES(client_sheets PROPERTIES VERSION ${NL_VERSION})
|
||||
INCLUDE_DIRECTORIES(${NEL_INCLUDE_DIR})
|
||||
TARGET_LINK_LIBRARIES(ryzom_clientsheets ryzom_gameshare ${NELMISC_LIBRARY})
|
||||
SET_TARGET_PROPERTIES(ryzom_clientsheets PROPERTIES VERSION ${NL_VERSION})
|
||||
|
||||
IF(WIN32)
|
||||
SET_TARGET_PROPERTIES(client_sheets PROPERTIES COMPILE_FLAGS "/Yustdpch.h")
|
||||
SET_TARGET_PROPERTIES(ryzom_clientsheets PROPERTIES COMPILE_FLAGS "/Yustdpch.h")
|
||||
SET_SOURCE_FILES_PROPERTIES(stdpch.cpp PROPERTIES COMPILE_FLAGS "/Ycstdpch.h")
|
||||
SET_TARGET_PROPERTIES(client_sheets
|
||||
SET_TARGET_PROPERTIES(ryzom_clientsheets
|
||||
PROJECT_LABEL "Library: Client Sheets"
|
||||
DEBUG_POSTFIX "_d"
|
||||
RELEASE_POSTFIX "_r"
|
||||
LINK_FLAGS_DEBUG "/NODEFAULTLIB:libc;libcmt;libcmtd;msvcrt"
|
||||
LINK_FLAGS_RELEASE "/NODEFAULTLIB:libc;libcmt;libcmtd;msvcrtd")
|
||||
LINK_FLAGS_DEBUG "/NODEFAULTLIB:msvcrt"
|
||||
ENDIF(WIN32)
|
||||
|
||||
ADD_DEFINITIONS(${LIBXML2_DEFINITIONS})
|
||||
|
||||
INSTALL(TARGETS client_sheets LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries)
|
||||
INSTALL(TARGETS ryzom_clientsheets LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries)
|
||||
|
|
|
@ -397,6 +397,7 @@ void CContinentManager::select(const CVectorD &pos, NLMISC::IProgressCallback &p
|
|||
CContinent *pCont = it->second;
|
||||
nlinfo("Looking into %s", pCont->SheetName.c_str());
|
||||
if (pCont->Zone.VPoints.size() > 0) // Patch because some continent have not been done yet
|
||||
{
|
||||
if (pCont->Zone.contains(fPos))
|
||||
{
|
||||
// load the continent selected.
|
||||
|
@ -414,6 +415,7 @@ void CContinentManager::select(const CVectorD &pos, NLMISC::IProgressCallback &p
|
|||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
it++;
|
||||
}
|
||||
|
||||
|
|
|
@ -233,7 +233,7 @@ public:
|
|||
void sheetId(const NLMISC::CSheetId &id) {_SheetId = id;}
|
||||
|
||||
/// Return the persistent NPC alias of entity (0 if N/A).
|
||||
const uint32 npcAlias() const {return _NPCAlias; }
|
||||
uint32 npcAlias() const {return _NPCAlias; }
|
||||
/// Set the persistent NPC alias of the entity.
|
||||
void npcAlias(uint32 alias) {_NPCAlias = alias; }
|
||||
|
||||
|
@ -411,7 +411,7 @@ public:
|
|||
|
||||
|
||||
/// Return the entity current behaviour.
|
||||
const MBEHAV::EBehaviour behaviour() const {return _CurrentBehaviour.Behaviour;}
|
||||
MBEHAV::EBehaviour behaviour() const {return _CurrentBehaviour.Behaviour;}
|
||||
|
||||
/**
|
||||
* Show or Hide the entity.
|
||||
|
|
|
@ -145,16 +145,11 @@ void CEventsListener::operator()(const CEvent& event)
|
|||
// Event from the Mouse (ANGLE)
|
||||
if(event == EventGDMouseMove)
|
||||
{
|
||||
#ifdef NL_OS_WINDOWS
|
||||
CGDMouseMove* mouseEvent=(CGDMouseMove*)&event;
|
||||
// Mouse acceleration
|
||||
sint dX = mouseEvent->X;
|
||||
sint dY = ClientCfg.FreeLookInverted ? -mouseEvent->Y : mouseEvent->Y;
|
||||
updateFreeLookPos((float) dX, (float) dY);
|
||||
#else
|
||||
// just to make sure that there is no game device implementation un unix
|
||||
nlerror("not expecting EventGDMouseMove on unix");
|
||||
#endif
|
||||
}
|
||||
// Event from the Mouse (MOVE)
|
||||
else if(event == EventMouseMoveId)
|
||||
|
|
|
@ -152,7 +152,7 @@ extern CContinentManager ContinentMngr;
|
|||
ucstring TipsOfTheDay;
|
||||
uint TipsOfTheDayIndex;
|
||||
|
||||
// includes pour les register class qui suivent (grrrr !!!!)
|
||||
// includes for following register classes
|
||||
#include "entities.h"
|
||||
#include "character_cl.h"
|
||||
#include "player_cl.h"
|
||||
|
@ -578,7 +578,6 @@ void checkDriverDepth ()
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void addSearchPaths(IProgressCallback &progress)
|
||||
{
|
||||
// Add search path of UI addon. Allow only a subset of files.
|
||||
|
@ -744,7 +743,6 @@ void prelogInit()
|
|||
|
||||
CLoginProgressPostThread::getInstance().init(ClientCfg.ConfigFile);
|
||||
|
||||
|
||||
// tmp for patcher debug
|
||||
extern void tmpFlagMainlandPatchCategories(NLMISC::CConfigFile &cf);
|
||||
extern void tmpFlagRemovedPatchCategories(NLMISC::CConfigFile &cf);
|
||||
|
@ -790,7 +788,6 @@ void prelogInit()
|
|||
|
||||
FPU_CHECKER_ONCE
|
||||
|
||||
|
||||
switch (getCurrentColorDepth())
|
||||
{
|
||||
case 16: CustomMouse.setColorDepth(CCustomMouse::ColorDepth16); break;
|
||||
|
@ -801,7 +798,6 @@ void prelogInit()
|
|||
break;
|
||||
}
|
||||
|
||||
|
||||
// Check driver version
|
||||
checkDriverVersion();
|
||||
|
||||
|
@ -835,8 +831,6 @@ void prelogInit()
|
|||
}
|
||||
Driver = UDriver::createDriver ((uint)LoadIcon (HInstance, MAKEINTRESOURCE(IDI_MAIN_ICON)), direct3D);
|
||||
|
||||
|
||||
|
||||
#else // NL_OS_WINDOWS
|
||||
Driver = UDriver::createDriver ();
|
||||
#endif // NL_OS_WINDOWS
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
// Misc
|
||||
#include "nel/misc/mouse_device.h"
|
||||
#include "nel/misc/mouse_smoother.h"
|
||||
#include "nel/misc/system_utils.h"
|
||||
// Game Share
|
||||
|
||||
|
||||
|
@ -66,7 +67,7 @@ bool SetMousePosFirstTime = true;
|
|||
uint DownMouseButtons = 0;
|
||||
|
||||
#ifdef NL_OS_UNIX
|
||||
// on X11, store whether the mouse was captured or not
|
||||
// on X11 and cocoa, store whether the mouse was captured or not
|
||||
bool MouseCapture = false;
|
||||
#endif
|
||||
|
||||
|
@ -198,20 +199,24 @@ void UpdateMouse ()
|
|||
// Raw mode
|
||||
if (MouseDevice)
|
||||
{
|
||||
|
||||
MouseDevice->setMessagesMode(IMouseDevice::RawMode);
|
||||
MouseDevice->setMouseAcceleration(ClientCfg.FreeLookAcceleration);
|
||||
}
|
||||
else
|
||||
{
|
||||
// no mouse device implementation on X11 and Cocoa, emulate raw mode
|
||||
Driver->emulateMouseRawMode(true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Set the mouse properties
|
||||
if (MouseDevice)
|
||||
{
|
||||
// Get the driver size
|
||||
uint32 width, height;
|
||||
Driver->getWindowSize(width, height);
|
||||
|
||||
// Set the mouse properties
|
||||
if (MouseDevice)
|
||||
{
|
||||
MouseDevice->setMessagesMode(IMouseDevice::NormalMode);
|
||||
MouseDevice->setMouseMode(IMouseDevice::XAxis, IMouseDevice::Clamped);
|
||||
MouseDevice->setMouseMode(IMouseDevice::YAxis, IMouseDevice::Clamped);
|
||||
|
@ -221,6 +226,11 @@ void UpdateMouse ()
|
|||
MouseDevice->setMouseSpeed(MouseCursorSpeed);
|
||||
MouseDevice->setMouseAcceleration(MouseCursorAcceleration);
|
||||
}
|
||||
else
|
||||
{
|
||||
// no mouse device implementation on X11 and Cocoa, emulate raw mode
|
||||
Driver->emulateMouseRawMode(false);
|
||||
}
|
||||
}
|
||||
if (!IsSystemCursorCaptured())
|
||||
{
|
||||
|
@ -249,13 +259,6 @@ void SetMouseFreeLook ()
|
|||
}
|
||||
UpdateMouse ();
|
||||
}
|
||||
|
||||
#ifdef NL_OS_UNIX
|
||||
// on X11 the mouse needs to get pulled into the middle each update, else
|
||||
// the cursor would reach the border of the window / desktop
|
||||
// and freelook would hang
|
||||
Driver->setMousePos(0.5f, 0.5f);
|
||||
#endif
|
||||
}
|
||||
|
||||
// *********************************************************************************
|
||||
|
@ -373,7 +376,7 @@ void CaptureSystemCursor()
|
|||
if (!drvWnd) return;
|
||||
SetCapture(drvWnd);
|
||||
#else
|
||||
// on X11, set driver mouse capture on and store it locally as well
|
||||
// on X11 and cocoa, set driver mouse capture on and store it locally as well
|
||||
Driver->setCapture(MouseCapture = true);
|
||||
#endif
|
||||
}
|
||||
|
@ -392,7 +395,7 @@ void ReleaseSystemCursor()
|
|||
}
|
||||
ReleaseCapture();
|
||||
#else
|
||||
// on X11, set driver mouse capture off and store it locally as well
|
||||
// on X11 and cocoa, set driver mouse capture off and store it locally as well
|
||||
Driver->setCapture(MouseCapture = false);
|
||||
#endif
|
||||
}
|
||||
|
@ -404,6 +407,9 @@ bool IsSystemCursorCaptured()
|
|||
#ifdef NL_OS_WINDOWS
|
||||
return GetCapture() == Driver->getDisplay();
|
||||
#else
|
||||
/*
|
||||
TODO there should be a way to ask the driver if capturing is on or off
|
||||
*/
|
||||
return MouseCapture;
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -2785,7 +2785,7 @@ public:
|
|||
}
|
||||
|
||||
// If no modes are available, display a message and exit
|
||||
if (nFoundMode == -1)
|
||||
if (!ClientCfg.Windowed && nFoundMode == -1)
|
||||
{
|
||||
Driver->systemMessageBox("No Video Modes available!\n"
|
||||
"Minimum Video mode to play Ryzom is 800x600.\n",
|
||||
|
|
|
@ -167,7 +167,7 @@ void CInterfaceItemEdition::CItemEditionWindow::infoReceived()
|
|||
// ********************************************************************************************
|
||||
void CInterfaceItemEdition::CItemEditionWindow::update()
|
||||
{
|
||||
if(_CurrItemSheet && (ItemSheet != _CurrItemSheet->getSheetId()))
|
||||
if(_CurrItemSheet && ((sint32)ItemSheet != _CurrItemSheet->getSheetId()))
|
||||
{
|
||||
end();
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ private:
|
|||
virtual void chatWindowRemoved(CChatWindow *cw);
|
||||
//
|
||||
// copy not supported
|
||||
CChatInputFilter(const CChatInputFilter &/* other */) { nlassert(0); }
|
||||
CChatInputFilter(const CChatInputFilter &/* other */):NLMISC::CRefCount() { nlassert(0); }
|
||||
CChatInputFilter &operator=(const CChatInputFilter &/* other */) { nlassert(0); return *this; }
|
||||
|
||||
};
|
||||
|
@ -157,7 +157,7 @@ private:
|
|||
void chatWindowRemoved(CChatWindow *cw);
|
||||
void msgEntered(const ucstring &msg, CChatWindow *chatWindow);
|
||||
// copy not supported
|
||||
CChatTargetFilter(const CChatTargetFilter &/* other */) { nlassert(0); }
|
||||
CChatTargetFilter(const CChatTargetFilter &/* other */):NLMISC::CRefCount() { nlassert(0); }
|
||||
CChatTargetFilter& operator=(const CChatTargetFilter &/* other */) { nlassert(0); return *this; }
|
||||
};
|
||||
|
||||
|
|
|
@ -230,7 +230,7 @@ void CGroupCompas::draw()
|
|||
//
|
||||
const NLMISC::CVectorD &userPosD = UserEntity->pos();
|
||||
NLMISC::CVector userPos((float) userPosD.x, (float) userPosD.y, (float) userPosD.z);
|
||||
NLMISC::CVector2f targetPos;
|
||||
NLMISC::CVector2f targetPos(0.f, 0.f);
|
||||
// if a position tracker is provided, use it
|
||||
CCompassTarget displayedTarget = _Target;
|
||||
|
||||
|
@ -807,7 +807,7 @@ void CGroupCompasMenu::setActive (bool state)
|
|||
uint nbUserLandMarks = std::min( uint(currCont->UserLandMarks.size()), CContinent::getMaxNbUserLandMarks() );
|
||||
for(k = 0; k < nbUserLandMarks; ++k)
|
||||
{
|
||||
if (currCont->UserLandMarks[k].Type >= 0 && currCont->UserLandMarks[k].Type < CUserLandMark::UserLandMarkTypeCount)
|
||||
if (currCont->UserLandMarks[k].Type < CUserLandMark::UserLandMarkTypeCount)
|
||||
{
|
||||
CCompassTarget ct;
|
||||
ct.setType(CCompassTarget::UserLandMark);
|
||||
|
|
|
@ -634,6 +634,7 @@ bool CGroupMap::parse(xmlNodePtr cur, CInterfaceGroup * parentGroup)
|
|||
case EGSPD::CPeople::Matis: loadLandmarkInfo(cur, "home_matis", _HomeLMOptions); break;
|
||||
case EGSPD::CPeople::Zorai: loadLandmarkInfo(cur, "home_zorai", _HomeLMOptions); break;
|
||||
case EGSPD::CPeople::Tryker: loadLandmarkInfo(cur, "home_tryker", _HomeLMOptions); break;
|
||||
default: break;
|
||||
}
|
||||
loadLandmarkInfo(cur, "respawn", _RespawnLMOptions);
|
||||
// animal landmark
|
||||
|
|
|
@ -354,7 +354,7 @@ private:
|
|||
|
||||
private:
|
||||
// this object isn't intended to be copied
|
||||
CLuaState(const CLuaState &/* other */) { nlassert(0); }
|
||||
CLuaState(const CLuaState &/* other */):NLMISC::CRefCount() { nlassert(0); }
|
||||
CLuaState &operator=(const CLuaState &/* other */) { nlassert(0); return *this; }
|
||||
|
||||
void executeScriptInternal(const std::string &code, const std::string &dbgSrc, int numRet = 0);
|
||||
|
|
|
@ -611,16 +611,19 @@ void CModalContainerEditCmd::activateFrom (const std::string &cmdName, const std
|
|||
// Get ith param (params are nameOfParam=argumentOfAction strings separated by |)
|
||||
// except for the last real param (which can then contains | chars) if it is the last param
|
||||
|
||||
if ((curStr.find('|') == string::npos) ||
|
||||
((noParam == nbRealParam-1) && (rP.Type != CBaseAction::CParameter::Hidden)) && (i == (pBA->Parameters.size()-1)))
|
||||
string::size_type pos = curStr.find('|');
|
||||
|
||||
if ((pos == string::npos) ||
|
||||
(((noParam == nbRealParam-1) && (rP.Type != CBaseAction::CParameter::Hidden)) && (i == (pBA->Parameters.size()-1))))
|
||||
{
|
||||
sTmp = curStr;
|
||||
curStr = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
sTmp = curStr.substr(0,curStr.find('|'));
|
||||
curStr = curStr.substr(curStr.find('|')+1,curStr.size());
|
||||
|
||||
sTmp = curStr.substr(0, pos);
|
||||
curStr = curStr.substr(pos+1, curStr.size());
|
||||
}
|
||||
|
||||
// Remove 'name='
|
||||
|
|
|
@ -289,13 +289,17 @@ void CChatStdInput::registerListeningWindow(CChatWindow *cw)
|
|||
Universe.addListeningWindow(cw);
|
||||
}
|
||||
|
||||
|
||||
//===========================================================================================================
|
||||
CPeopleInterraction::CPeopleInterraction() : SystemInfo(NULL),
|
||||
CPeopleInterraction::CPeopleInterraction() : Region(NULL),
|
||||
Universe(NULL),
|
||||
TeamChat(NULL),
|
||||
GuildChat(NULL),
|
||||
CurrPartyChatID(0),
|
||||
SystemInfo(NULL),
|
||||
TellWindow(NULL),
|
||||
DebugInfo(NULL),
|
||||
YuboChat(NULL)
|
||||
YuboChat(NULL),
|
||||
CurrPartyChatID(0)
|
||||
{
|
||||
for(uint i=0;i<CChatGroup::MaxDynChanPerPlayer;i++)
|
||||
{
|
||||
|
|
|
@ -192,7 +192,7 @@ public:
|
|||
}
|
||||
if (newStep)
|
||||
{
|
||||
if (loginStep.Step == LoginStep_Stop)
|
||||
if (loginStep.Step == (uint)LoginStep_Stop)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -56,10 +56,6 @@
|
|||
#include "nel/georges/u_form_elm.h"
|
||||
#include "nel/georges/u_form_loader.h"
|
||||
|
||||
#ifndef NL_OS_WINDOWS
|
||||
#include <X11/Xlib.h>
|
||||
#endif
|
||||
|
||||
///////////
|
||||
// USING //
|
||||
///////////
|
||||
|
|
|
@ -427,73 +427,46 @@ void CUserControls::getMouseAngleMove(float &dx, float &dy)
|
|||
dx = 0.0f;
|
||||
dy = 0.0f;
|
||||
|
||||
|
||||
// The mouse may still "StandardMove" ie through a CEventMouseMove
|
||||
// This can happens cause DirectInputDisabled, or because of the "Rotation Anti-Lag system"
|
||||
// which start to rotate before the mouse is hid and message mode passed to RawMode
|
||||
// This can happens cause DirectInputDisabled, or because of the
|
||||
// "Rotation Anti-Lag system" which start to rotate before the mouse is hid
|
||||
// and message mode passed to RawMode
|
||||
//
|
||||
// If we are not on Windows; on X11 there is always StandardMove/CEventMouseMove.
|
||||
// Currently, there is only a direct input IMouseDevice, not available on X11.
|
||||
// On X11 and Cocoa, there is no MouseDevice, do it without.
|
||||
|
||||
#ifdef NL_OS_WINDOWS
|
||||
extern IMouseDevice *MouseDevice;
|
||||
if (MouseDevice)
|
||||
{
|
||||
|
||||
// if the mouse position changed
|
||||
if( EventsListener.getMousePosX() != _LastFrameMousePosX ||
|
||||
EventsListener.getMousePosY() != _LastFrameMousePosY )
|
||||
{
|
||||
// get the mouse movement delta
|
||||
float dmpx= EventsListener.getMousePosX() - _LastFrameMousePosX;
|
||||
float dmpy= EventsListener.getMousePosY() - _LastFrameMousePosY;
|
||||
// simulate mickeys mode
|
||||
|
||||
// simulate mickeys mode if there is a mouse device
|
||||
if (MouseDevice)
|
||||
MouseDevice->convertStdMouseMoveInMickeys(dmpx, dmpy);
|
||||
if(ClientCfg.FreeLookInverted) dmpy = -dmpy;
|
||||
// update free look
|
||||
EventsListener.updateFreeLookPos(dmpx, dmpy);
|
||||
}
|
||||
}
|
||||
#else
|
||||
// On X11 and Mac, do the thing without IMouseDevice implementation
|
||||
if( EventsListener.getMousePosX() != _LastFrameMousePosX ||
|
||||
EventsListener.getMousePosY() != _LastFrameMousePosY )
|
||||
{
|
||||
float dmpx, dmpy;
|
||||
|
||||
#ifndef NL_MAC_NATIVE
|
||||
// On X11 in free look mode, the mouse is pulled back to (0.5, 0.5)
|
||||
// every update to prevent reaching a border and get stuck.
|
||||
if(IsMouseFreeLook())
|
||||
{
|
||||
/*
|
||||
TODO use setCapture to not fake it
|
||||
*/
|
||||
dmpx = EventsListener.getMousePosX() - 0.5;
|
||||
dmpy = EventsListener.getMousePosY() - 0.5;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
dmpx = EventsListener.getMousePosX() - _LastFrameMousePosX;
|
||||
dmpy = EventsListener.getMousePosY() - _LastFrameMousePosY;
|
||||
dmpx *= (float)Driver->getWindowWidth();
|
||||
dmpy *= (float)Driver->getWindowHeight();
|
||||
}
|
||||
|
||||
// TODO: read desktop mouse speed value on X11 / implement X11MouseDevice
|
||||
dmpx *= 450.0f;
|
||||
dmpy *= 450.0f;
|
||||
|
||||
// handle inverted mouse, if enabled
|
||||
if(ClientCfg.FreeLookInverted) dmpy = -dmpy;
|
||||
|
||||
// update free look
|
||||
EventsListener.updateFreeLookPos(dmpx, dmpy);
|
||||
}
|
||||
#endif
|
||||
|
||||
// If the mouse move on the axis X, with a CGDMouseMove
|
||||
if(EventsListener.isMouseAngleX())
|
||||
dx = -EventsListener.getMouseAngleX ();
|
||||
|
||||
// If the mouse move on the axis Y, with a CGDMouseMove
|
||||
if(EventsListener.isMouseAngleY())
|
||||
dy = EventsListener.getMouseAngleY ();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ private:
|
|||
class CEntityEntry
|
||||
{
|
||||
public:
|
||||
CEntityEntry() : EntryUsed(false), PosIsRelative(false), AssociationBits(0) {}
|
||||
CEntityEntry() : AssociationBits(0), EntryUsed(false), PosIsRelative(false), PosIsInterior(false) {}
|
||||
CLFECOMMON::TSheetId Sheet;
|
||||
uint16 AssociationBits;
|
||||
bool EntryUsed;
|
||||
|
|
|
@ -241,7 +241,7 @@ private:
|
|||
// For editor : Create this object from the CObjectTable it materialize in the editor
|
||||
CInstance(const CObjectTable *objectTable, CLuaState &ls);
|
||||
// copy not supported
|
||||
CInstance(const CInstance &/* other */) { nlassert(0); }
|
||||
CInstance(const CInstance &/* other */):NLMISC::CRefCount() { nlassert(0); }
|
||||
CInstance &operator = (const CInstance &/* other */) { nlassert(0); return *this; }
|
||||
//
|
||||
void executeHandler(const CLuaString &name, int numArgs);
|
||||
|
|
|
@ -245,6 +245,8 @@ void CRosacePage::update(float x, float y, TMode mode)
|
|||
case NbRosaceMode:
|
||||
nlwarning("Rosace Mode reached.");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}// update //
|
||||
|
||||
|
|
|
@ -6,21 +6,28 @@ LIST(REMOVE_ITEM LIB_SRC ${CMAKE_CURRENT_SOURCE_DIR}/7zMain.cpp)
|
|||
|
||||
ADD_EXECUTABLE(7zDec ${SRC})
|
||||
|
||||
INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${NEL_INCLUDE_DIR})
|
||||
TARGET_LINK_LIBRARIES(7zDec ${PLATFORM_LINKFLAGS} ${LIBXML2_LIBRARIES} ${NELMISC_LIBRARY})
|
||||
INCLUDE_DIRECTORIES(${NEL_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
TARGET_LINK_LIBRARIES(7zDec ${PLATFORM_LINKFLAGS} ${NELMISC_LIBRARY})
|
||||
|
||||
ADD_LIBRARY(seven_zip STATIC ${LIB_SRC})
|
||||
TARGET_LINK_LIBRARIES(seven_zip ${PLATFORM_LINKFLAGS})
|
||||
IF(NOT WIN32)
|
||||
ADD_LIBRARY(ryzom_sevenzip SHARED ${LIB_SRC})
|
||||
ELSE(NOT WIN32)
|
||||
ADD_LIBRARY(ryzom_sevenzip STATIC ${LIB_SRC})
|
||||
ENDIF(NOT WIN32)
|
||||
|
||||
TARGET_LINK_LIBRARIES(ryzom_sevenzip ${PLATFORM_LINKFLAGS})
|
||||
SET_TARGET_PROPERTIES(ryzom_sevenzip PROPERTIES VERSION ${NL_VERSION})
|
||||
|
||||
IF(WIN32)
|
||||
SET_TARGET_PROPERTIES(seven_zip
|
||||
PROJECT_LABEL "Library: Seven Zip"
|
||||
DEBUG_POSTFIX "_d"
|
||||
RELEASE_POSTFIX "_r"
|
||||
LINK_FLAGS_DEBUG "/NODEFAULTLIB:libc;libcmt;libcmtd;msvcrt"
|
||||
LINK_FLAGS_RELEASE "/NODEFAULTLIB:libc;libcmt;libcmtd;msvcrtd")
|
||||
LINK_FLAGS_DEBUG "/NODEFAULTLIB:msvcrt"
|
||||
ENDIF(WIN32)
|
||||
|
||||
ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -D_SZ_ONE_DIRECTORY)
|
||||
ADD_DEFINITIONS(-D_SZ_ONE_DIRECTORY)
|
||||
|
||||
INSTALL(TARGETS ryzom_sevenzip LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries)
|
||||
|
||||
INSTALL(TARGETS 7zDec RUNTIME DESTINATION bin COMPONENT client)
|
||||
|
|
|
@ -8,16 +8,16 @@ LIST(REMOVE_ITEM SRC ${CMAKE_CURRENT_SOURCE_DIR}/enum_template.cpp)
|
|||
LIST(REMOVE_ITEM PRIV_H ${CMAKE_CURRENT_SOURCE_DIR}/enum_template.h)
|
||||
|
||||
IF(WIN32)
|
||||
ADD_LIBRARY(game_share STATIC ${SRC})
|
||||
ADD_LIBRARY(ryzom_gameshare STATIC ${SRC})
|
||||
ELSE(WIN32)
|
||||
ADD_LIBRARY(game_share SHARED ${SRC})
|
||||
ADD_LIBRARY(ryzom_gameshare SHARED ${SRC})
|
||||
ENDIF(WIN32)
|
||||
|
||||
INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${NEL_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
TARGET_LINK_LIBRARIES(game_share
|
||||
TARGET_LINK_LIBRARIES(ryzom_gameshare
|
||||
${NELMISC_LIBRARY} ${NELNET_LIBRARY} ${NELLIGO_LIBRARY} ${NELGEORGES_LIBRARY}
|
||||
${LIBXML2_LIBRARIES} ${ZLIB_LIBRARIES})
|
||||
SET_TARGET_PROPERTIES(game_share PROPERTIES VERSION ${NL_VERSION})
|
||||
SET_TARGET_PROPERTIES(ryzom_gameshare PROPERTIES VERSION ${NL_VERSION})
|
||||
|
||||
IF(WIN32)
|
||||
# SET_TARGET_PROPERTIES(${GAME_SHARE_LIB} PROPERTIES COMPILE_FLAGS "/Yustdgeorges.h")
|
||||
|
@ -26,10 +26,10 @@ IF(WIN32)
|
|||
PROJECT_LABEL "Library: Game Share"
|
||||
DEBUG_POSTFIX "_d"
|
||||
RELEASE_POSTFIX "_r"
|
||||
LINK_FLAGS_DEBUG "/NODEFAULTLIB:libc;libcmt;libcmtd;msvcrt"
|
||||
LINK_FLAGS_RELEASE "/NODEFAULTLIB:libc;libcmt;libcmtd;msvcrtd")
|
||||
LINK_FLAGS_DEBUG "/NODEFAULTLIB:msvcrt")
|
||||
ENDIF(WIN32)
|
||||
|
||||
ADD_DEFINITIONS(${LIBXML2_DEFINITIONS})
|
||||
|
||||
INSTALL(TARGETS game_share LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries)
|
||||
INSTALL(TARGETS ryzom_gameshare LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries)
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
namespace BGDownloader
|
||||
{
|
||||
|
||||
extern const char *DownloaderMutexName = "RyzomBgDownloader";
|
||||
const char *DownloaderMutexName = "RyzomBgDownloader";
|
||||
|
||||
ucstring getWrittenSize(uint32 nSize)
|
||||
{
|
||||
|
|
|
@ -403,45 +403,45 @@ static unsigned char PC2[] = { /* permuted choice table 2 */
|
|||
|
||||
static unsigned char S[8][64] = { /* 48->32 bit substitution tables */
|
||||
/* S[1] */
|
||||
14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7,
|
||||
{14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7,
|
||||
0, 15, 7, 4, 14, 2, 13, 1, 10, 6, 12, 11, 9, 5, 3, 8,
|
||||
4, 1, 14, 8, 13, 6, 2, 11, 15, 12, 9, 7, 3, 10, 5, 0,
|
||||
15, 12, 8, 2, 4, 9, 1, 7, 5, 11, 3, 14, 10, 0, 6, 13,
|
||||
15, 12, 8, 2, 4, 9, 1, 7, 5, 11, 3, 14, 10, 0, 6, 13},
|
||||
/* S[2] */
|
||||
15, 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12, 0, 5, 10,
|
||||
{15, 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12, 0, 5, 10,
|
||||
3, 13, 4, 7, 15, 2, 8, 14, 12, 0, 1, 10, 6, 9, 11, 5,
|
||||
0, 14, 7, 11, 10, 4, 13, 1, 5, 8, 12, 6, 9, 3, 2, 15,
|
||||
13, 8, 10, 1, 3, 15, 4, 2, 11, 6, 7, 12, 0, 5, 14, 9,
|
||||
13, 8, 10, 1, 3, 15, 4, 2, 11, 6, 7, 12, 0, 5, 14, 9},
|
||||
/* S[3] */
|
||||
10, 0, 9, 14, 6, 3, 15, 5, 1, 13, 12, 7, 11, 4, 2, 8,
|
||||
{10, 0, 9, 14, 6, 3, 15, 5, 1, 13, 12, 7, 11, 4, 2, 8,
|
||||
13, 7, 0, 9, 3, 4, 6, 10, 2, 8, 5, 14, 12, 11, 15, 1,
|
||||
13, 6, 4, 9, 8, 15, 3, 0, 11, 1, 2, 12, 5, 10, 14, 7,
|
||||
1, 10, 13, 0, 6, 9, 8, 7, 4, 15, 14, 3, 11, 5, 2, 12,
|
||||
1, 10, 13, 0, 6, 9, 8, 7, 4, 15, 14, 3, 11, 5, 2, 12},
|
||||
/* S[4] */
|
||||
7, 13, 14, 3, 0, 6, 9, 10, 1, 2, 8, 5, 11, 12, 4, 15,
|
||||
{ 7, 13, 14, 3, 0, 6, 9, 10, 1, 2, 8, 5, 11, 12, 4, 15,
|
||||
13, 8, 11, 5, 6, 15, 0, 3, 4, 7, 2, 12, 1, 10, 14, 9,
|
||||
10, 6, 9, 0, 12, 11, 7, 13, 15, 1, 3, 14, 5, 2, 8, 4,
|
||||
3, 15, 0, 6, 10, 1, 13, 8, 9, 4, 5, 11, 12, 7, 2, 14,
|
||||
3, 15, 0, 6, 10, 1, 13, 8, 9, 4, 5, 11, 12, 7, 2, 14},
|
||||
/* S[5] */
|
||||
2, 12, 4, 1, 7, 10, 11, 6, 8, 5, 3, 15, 13, 0, 14, 9,
|
||||
{ 2, 12, 4, 1, 7, 10, 11, 6, 8, 5, 3, 15, 13, 0, 14, 9,
|
||||
14, 11, 2, 12, 4, 7, 13, 1, 5, 0, 15, 10, 3, 9, 8, 6,
|
||||
4, 2, 1, 11, 10, 13, 7, 8, 15, 9, 12, 5, 6, 3, 0, 14,
|
||||
11, 8, 12, 7, 1, 14, 2, 13, 6, 15, 0, 9, 10, 4, 5, 3,
|
||||
11, 8, 12, 7, 1, 14, 2, 13, 6, 15, 0, 9, 10, 4, 5, 3},
|
||||
/* S[6] */
|
||||
12, 1, 10, 15, 9, 2, 6, 8, 0, 13, 3, 4, 14, 7, 5, 11,
|
||||
{12, 1, 10, 15, 9, 2, 6, 8, 0, 13, 3, 4, 14, 7, 5, 11,
|
||||
10, 15, 4, 2, 7, 12, 9, 5, 6, 1, 13, 14, 0, 11, 3, 8,
|
||||
9, 14, 15, 5, 2, 8, 12, 3, 7, 0, 4, 10, 1, 13, 11, 6,
|
||||
4, 3, 2, 12, 9, 5, 15, 10, 11, 14, 1, 7, 6, 0, 8, 13,
|
||||
4, 3, 2, 12, 9, 5, 15, 10, 11, 14, 1, 7, 6, 0, 8, 13},
|
||||
/* S[7] */
|
||||
4, 11, 2, 14, 15, 0, 8, 13, 3, 12, 9, 7, 5, 10, 6, 1,
|
||||
{ 4, 11, 2, 14, 15, 0, 8, 13, 3, 12, 9, 7, 5, 10, 6, 1,
|
||||
13, 0, 11, 7, 4, 9, 1, 10, 14, 3, 5, 12, 2, 15, 8, 6,
|
||||
1, 4, 11, 13, 12, 3, 7, 14, 10, 15, 6, 8, 0, 5, 9, 2,
|
||||
6, 11, 13, 8, 1, 4, 10, 7, 9, 5, 0, 15, 14, 2, 3, 12,
|
||||
6, 11, 13, 8, 1, 4, 10, 7, 9, 5, 0, 15, 14, 2, 3, 12},
|
||||
/* S[8] */
|
||||
13, 2, 8, 4, 6, 15, 11, 1, 10, 9, 3, 14, 5, 0, 12, 7,
|
||||
{13, 2, 8, 4, 6, 15, 11, 1, 10, 9, 3, 14, 5, 0, 12, 7,
|
||||
1, 15, 13, 8, 10, 3, 7, 4, 12, 5, 6, 11, 0, 14, 9, 2,
|
||||
7, 11, 4, 1, 9, 12, 14, 2, 0, 6, 10, 13, 15, 3, 5, 8,
|
||||
2, 1, 14, 7, 4, 10, 8, 13, 15, 12, 9, 0, 3, 5, 6, 11,
|
||||
2, 1, 14, 7, 4, 10, 8, 13, 15, 12, 9, 0, 3, 5, 6, 11}
|
||||
};
|
||||
|
||||
static unsigned char P32Tr[] = { /* 32-bit permutation function */
|
||||
|
|
|
@ -80,7 +80,7 @@ namespace R2
|
|||
public:
|
||||
virtual ~IServerEditionModule(){}
|
||||
virtual void createSessionWithoutSu(uint32 charId, NLMISC::CEntityId clientEid) = 0;
|
||||
virtual TPioneersSessionsAllowed * const getSessionAllowedForChar(TCharId charId) const = 0;
|
||||
virtual TPioneersSessionsAllowed * getSessionAllowedForChar(TCharId charId) const = 0;
|
||||
virtual CScenario* getScenarioById(TSessionId sessionId) const = 0;
|
||||
// getEditing position (use AdminModule::getPosition for having a position in editing and animation mode)
|
||||
virtual bool getPosition(TSessionId sessionId, double& x, double& y, double& orient, uint8& season, uint32 locationIndex = 0) = 0;
|
||||
|
|
|
@ -86,75 +86,6 @@
|
|||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|x64"
|
||||
OutputDirectory="..\..\..\obj64\$(ConfigurationName)\$(ProjectName)"
|
||||
IntermediateDirectory="..\..\..\obj64\$(ConfigurationName)\$(ProjectName)"
|
||||
ConfigurationType="4"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="4"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories=".."
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;LIBXML_STATIC"
|
||||
StringPooling="true"
|
||||
MinimalRebuild="true"
|
||||
ExceptionHandling="2"
|
||||
BasicRuntimeChecks="3"
|
||||
SmallerTypeCheck="true"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderThrough="stdpch.h"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="..\..\..\lib64\$(ProjectName)_d.lib"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="..\..\..\obj\$(ConfigurationName)\$(ProjectName)"
|
||||
|
@ -226,6 +157,75 @@
|
|||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|x64"
|
||||
OutputDirectory="..\..\..\obj64\$(ConfigurationName)\$(ProjectName)"
|
||||
IntermediateDirectory="..\..\..\obj64\$(ConfigurationName)\$(ProjectName)"
|
||||
ConfigurationType="4"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="4"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories=".."
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;LIBXML_STATIC"
|
||||
StringPooling="true"
|
||||
MinimalRebuild="true"
|
||||
ExceptionHandling="2"
|
||||
BasicRuntimeChecks="3"
|
||||
SmallerTypeCheck="true"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderThrough="stdpch.h"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="..\..\..\lib64\$(ProjectName)_d.lib"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|x64"
|
||||
OutputDirectory="..\..\..\obj64\$(ConfigurationName)\$(ProjectName)"
|
||||
|
@ -1482,7 +1482,7 @@
|
|||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
|
@ -1490,7 +1490,7 @@
|
|||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
|
@ -1694,6 +1694,14 @@
|
|||
RelativePath=".\time_weather_season\weather_setup_sheet_base.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\welcome_service_itf.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\welcome_service_itf.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\xml_auto_ptr.cpp"
|
||||
>
|
||||
|
|
|
@ -30,12 +30,13 @@ using namespace NLMISC;
|
|||
using namespace NLNET;
|
||||
using namespace std;
|
||||
|
||||
|
||||
#ifdef NL_OS_WINDOWS
|
||||
# ifdef FAST_MIRROR
|
||||
# pragma message(NL_LOC_MSG "Using **** FAST_MIRROR ****")
|
||||
# else
|
||||
# pragma message(NL_LOC_MSG "Not using FAST_MIRROR")
|
||||
# endif
|
||||
#endif // NL_OS_WINDOWS
|
||||
|
||||
|
||||
const string MirrorVersion = string("1.10-")+string(ListRowSizeString); // ADDED: Unidirectional Mode (don't wait for delta)
|
||||
|
@ -841,8 +842,10 @@ void CMirror::releaseTrackers( NLNET::CMessage& msgin )
|
|||
for ( istfar=smidsToFindAndRemove.begin(); istfar!=smidsToFindAndRemove.end(); ++istfar )
|
||||
{
|
||||
if ( (*istfar) != InvalidSMId )
|
||||
{
|
||||
MIRROR_INFO( "MIRROR: Need to remove tracker with smid %d", (*istfar) );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// Browse datasets
|
||||
|
|
|
@ -1208,7 +1208,7 @@ public:
|
|||
protected:
|
||||
|
||||
/// Default constructor
|
||||
CMirrorPropValueList() : _PtFront(NULL), _Container(NULL), _PropLocation() {}
|
||||
CMirrorPropValueList() : _Container(NULL), _PtFront(NULL), _PropLocation() {}
|
||||
|
||||
TSharedListRow allocateNewCell();
|
||||
|
||||
|
|
|
@ -318,7 +318,7 @@ namespace MBEHAV
|
|||
}
|
||||
|
||||
/// Cons cast into behaviour enum
|
||||
operator const EBehaviour () const
|
||||
operator EBehaviour () const
|
||||
{
|
||||
return (EBehaviour)Behaviour8;
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include "nel/net/login_cookie.h"
|
||||
|
||||
#include "../../nelns/welcome_service/welcome_service_itf.h"
|
||||
#include "game_share/welcome_service_itf.h"
|
||||
|
||||
#include "game_share/character_sync_itf.h"
|
||||
|
||||
|
|
|
@ -2572,7 +2572,7 @@ TUserRole CServerEditionModule::getRoleByCharId(TCharId charId) const
|
|||
}
|
||||
|
||||
|
||||
TPioneersSessionsAllowed * const CServerEditionModule::getSessionAllowedForChar(TCharId charId) const
|
||||
TPioneersSessionsAllowed * CServerEditionModule::getSessionAllowedForChar(TCharId charId) const
|
||||
{
|
||||
TPioneersSessionsAlloweds::const_iterator found = _PioneersSessionsAllowed.find(charId);
|
||||
if (found == _PioneersSessionsAllowed.end()) return NULL;
|
||||
|
|
|
@ -474,7 +474,7 @@ namespace R2
|
|||
TUserRole getRoleByCharId(TCharId charId) const;
|
||||
|
||||
// get the session that is about to be joined by a client, or NULL if not found
|
||||
TPioneersSessionsAllowed * const getSessionAllowedForChar(TCharId charId) const;
|
||||
TPioneersSessionsAllowed * getSessionAllowedForChar(TCharId charId) const;
|
||||
// get the scenario use by the user
|
||||
|
||||
CScenario* getScenarioByCharId(TCharId charId) const;
|
||||
|
|
458
code/ryzom/common/src/game_share/welcome_service_itf.cpp
Normal file
458
code/ryzom/common/src/game_share/welcome_service_itf.cpp
Normal file
|
@ -0,0 +1,458 @@
|
|||
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
|
||||
// Copyright (C) 2010 Winch Gate Property Limited
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
|
||||
#include "stdpch.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// WARNING : this is a generated file, don't change it !
|
||||
/////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "welcome_service_itf.h"
|
||||
|
||||
namespace WS
|
||||
{
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// WARNING : this is a generated file, don't change it !
|
||||
/////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
const CWelcomeServiceSkel::TMessageHandlerMap &CWelcomeServiceSkel::getMessageHandlers() const
|
||||
{
|
||||
static TMessageHandlerMap handlers;
|
||||
static bool init = false;
|
||||
|
||||
if (!init)
|
||||
{
|
||||
std::pair < TMessageHandlerMap::iterator, bool > res;
|
||||
|
||||
res = handlers.insert(std::make_pair(std::string("WU"), &CWelcomeServiceSkel::welcomeUser_skel));
|
||||
// if this assert, you have a doubly message name in your interface definition !
|
||||
nlassert(res.second);
|
||||
|
||||
res = handlers.insert(std::make_pair(std::string("DU"), &CWelcomeServiceSkel::disconnectUser_skel));
|
||||
// if this assert, you have a doubly message name in your interface definition !
|
||||
nlassert(res.second);
|
||||
|
||||
init = true;
|
||||
}
|
||||
|
||||
return handlers;
|
||||
}
|
||||
bool CWelcomeServiceSkel::fwdOnProcessModuleMessage(NLNET::IModuleProxy *sender, const NLNET::CMessage &message)
|
||||
{
|
||||
const TMessageHandlerMap &mh = getMessageHandlers();
|
||||
|
||||
TMessageHandlerMap::const_iterator it(mh.find(message.getName()));
|
||||
|
||||
if (it == mh.end())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
TMessageHandler cmd = it->second;
|
||||
(this->*cmd)(sender, message);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void CWelcomeServiceSkel::welcomeUser_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message)
|
||||
{
|
||||
H_AUTO(CWelcomeServiceSkel_welcomeUser_WU);
|
||||
uint32 charId;
|
||||
nlRead(__message, serial, charId);
|
||||
std::string userName;
|
||||
nlRead(__message, serial, userName);
|
||||
NLNET::CLoginCookie cookie;
|
||||
nlRead(__message, serial, cookie);
|
||||
std::string priviledge;
|
||||
nlRead(__message, serial, priviledge);
|
||||
std::string exPriviledge;
|
||||
nlRead(__message, serial, exPriviledge);
|
||||
WS::TUserRole mode;
|
||||
nlRead(__message, serial, mode);
|
||||
uint32 instanceId;
|
||||
nlRead(__message, serial, instanceId);
|
||||
welcomeUser(sender, charId, userName, cookie, priviledge, exPriviledge, mode, instanceId);
|
||||
}
|
||||
|
||||
void CWelcomeServiceSkel::disconnectUser_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message)
|
||||
{
|
||||
H_AUTO(CWelcomeServiceSkel_disconnectUser_DU);
|
||||
uint32 userId;
|
||||
nlRead(__message, serial, userId);
|
||||
disconnectUser(sender, userId);
|
||||
}
|
||||
// ask the welcome service to welcome a character
|
||||
void CWelcomeServiceProxy::welcomeUser(NLNET::IModule *sender, uint32 charId, const std::string &userName, const NLNET::CLoginCookie &cookie, const std::string &priviledge, const std::string &exPriviledge, WS::TUserRole mode, uint32 instanceId)
|
||||
{
|
||||
if (_LocalModuleSkel && _LocalModule->isImmediateDispatchingSupported())
|
||||
{
|
||||
// immediate local synchronous dispatching
|
||||
_LocalModuleSkel->welcomeUser(_ModuleProxy->getModuleGateway()->getPluggedModuleProxy(sender), charId, userName, cookie, priviledge, exPriviledge, mode, instanceId);
|
||||
}
|
||||
else
|
||||
{
|
||||
// send the message for remote dispatching and execution or local queing
|
||||
NLNET::CMessage __message;
|
||||
|
||||
buildMessageFor_welcomeUser(__message, charId, userName, cookie, priviledge, exPriviledge, mode, instanceId);
|
||||
|
||||
_ModuleProxy->sendModuleMessage(sender, __message);
|
||||
}
|
||||
}
|
||||
// ask the welcome service to disconnect a user
|
||||
void CWelcomeServiceProxy::disconnectUser(NLNET::IModule *sender, uint32 userId)
|
||||
{
|
||||
if (_LocalModuleSkel && _LocalModule->isImmediateDispatchingSupported())
|
||||
{
|
||||
// immediate local synchronous dispatching
|
||||
_LocalModuleSkel->disconnectUser(_ModuleProxy->getModuleGateway()->getPluggedModuleProxy(sender), userId);
|
||||
}
|
||||
else
|
||||
{
|
||||
// send the message for remote dispatching and execution or local queing
|
||||
NLNET::CMessage __message;
|
||||
|
||||
buildMessageFor_disconnectUser(__message, userId);
|
||||
|
||||
_ModuleProxy->sendModuleMessage(sender, __message);
|
||||
}
|
||||
}
|
||||
|
||||
// Message serializer. Return the message received in reference for easier integration
|
||||
const NLNET::CMessage &CWelcomeServiceProxy::buildMessageFor_welcomeUser(NLNET::CMessage &__message, uint32 charId, const std::string &userName, const NLNET::CLoginCookie &cookie, const std::string &priviledge, const std::string &exPriviledge, WS::TUserRole mode, uint32 instanceId)
|
||||
{
|
||||
__message.setType("WU");
|
||||
nlWrite(__message, serial, charId);
|
||||
nlWrite(__message, serial, const_cast < std::string& > (userName));
|
||||
nlWrite(__message, serial, const_cast < NLNET::CLoginCookie& > (cookie));
|
||||
nlWrite(__message, serial, const_cast < std::string& > (priviledge));
|
||||
nlWrite(__message, serial, const_cast < std::string& > (exPriviledge));
|
||||
nlWrite(__message, serial, mode);
|
||||
nlWrite(__message, serial, instanceId);
|
||||
|
||||
|
||||
return __message;
|
||||
}
|
||||
|
||||
// Message serializer. Return the message received in reference for easier integration
|
||||
const NLNET::CMessage &CWelcomeServiceProxy::buildMessageFor_disconnectUser(NLNET::CMessage &__message, uint32 userId)
|
||||
{
|
||||
__message.setType("DU");
|
||||
nlWrite(__message, serial, userId);
|
||||
|
||||
|
||||
return __message;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// WARNING : this is a generated file, don't change it !
|
||||
/////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
const CLoginServiceSkel::TMessageHandlerMap &CLoginServiceSkel::getMessageHandlers() const
|
||||
{
|
||||
static TMessageHandlerMap handlers;
|
||||
static bool init = false;
|
||||
|
||||
if (!init)
|
||||
{
|
||||
std::pair < TMessageHandlerMap::iterator, bool > res;
|
||||
|
||||
res = handlers.insert(std::make_pair(std::string("PUL"), &CLoginServiceSkel::pendingUserLost_skel));
|
||||
// if this assert, you have a doubly message name in your interface definition !
|
||||
nlassert(res.second);
|
||||
|
||||
init = true;
|
||||
}
|
||||
|
||||
return handlers;
|
||||
}
|
||||
bool CLoginServiceSkel::fwdOnProcessModuleMessage(NLNET::IModuleProxy *sender, const NLNET::CMessage &message)
|
||||
{
|
||||
const TMessageHandlerMap &mh = getMessageHandlers();
|
||||
|
||||
TMessageHandlerMap::const_iterator it(mh.find(message.getName()));
|
||||
|
||||
if (it == mh.end())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
TMessageHandler cmd = it->second;
|
||||
(this->*cmd)(sender, message);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void CLoginServiceSkel::pendingUserLost_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message)
|
||||
{
|
||||
H_AUTO(CLoginServiceSkel_pendingUserLost_PUL);
|
||||
NLNET::CLoginCookie cookie;
|
||||
nlRead(__message, serial, cookie);
|
||||
pendingUserLost(sender, cookie);
|
||||
}
|
||||
// An awaited user did not connect before the allowed timeout expire
|
||||
void CLoginServiceProxy::pendingUserLost(NLNET::IModule *sender, const NLNET::CLoginCookie &cookie)
|
||||
{
|
||||
if (_LocalModuleSkel && _LocalModule->isImmediateDispatchingSupported())
|
||||
{
|
||||
// immediate local synchronous dispatching
|
||||
_LocalModuleSkel->pendingUserLost(_ModuleProxy->getModuleGateway()->getPluggedModuleProxy(sender), cookie);
|
||||
}
|
||||
else
|
||||
{
|
||||
// send the message for remote dispatching and execution or local queing
|
||||
NLNET::CMessage __message;
|
||||
|
||||
buildMessageFor_pendingUserLost(__message, cookie);
|
||||
|
||||
_ModuleProxy->sendModuleMessage(sender, __message);
|
||||
}
|
||||
}
|
||||
|
||||
// Message serializer. Return the message received in reference for easier integration
|
||||
const NLNET::CMessage &CLoginServiceProxy::buildMessageFor_pendingUserLost(NLNET::CMessage &__message, const NLNET::CLoginCookie &cookie)
|
||||
{
|
||||
__message.setType("PUL");
|
||||
nlWrite(__message, serial, const_cast < NLNET::CLoginCookie& > (cookie));
|
||||
|
||||
|
||||
return __message;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// WARNING : this is a generated file, don't change it !
|
||||
/////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
const CWelcomeServiceClientSkel::TMessageHandlerMap &CWelcomeServiceClientSkel::getMessageHandlers() const
|
||||
{
|
||||
static TMessageHandlerMap handlers;
|
||||
static bool init = false;
|
||||
|
||||
if (!init)
|
||||
{
|
||||
std::pair < TMessageHandlerMap::iterator, bool > res;
|
||||
|
||||
res = handlers.insert(std::make_pair(std::string("RWS"), &CWelcomeServiceClientSkel::registerWS_skel));
|
||||
// if this assert, you have a doubly message name in your interface definition !
|
||||
nlassert(res.second);
|
||||
|
||||
res = handlers.insert(std::make_pair(std::string("RWSOS"), &CWelcomeServiceClientSkel::reportWSOpenState_skel));
|
||||
// if this assert, you have a doubly message name in your interface definition !
|
||||
nlassert(res.second);
|
||||
|
||||
res = handlers.insert(std::make_pair(std::string("WUR"), &CWelcomeServiceClientSkel::welcomeUserResult_skel));
|
||||
// if this assert, you have a doubly message name in your interface definition !
|
||||
nlassert(res.second);
|
||||
|
||||
res = handlers.insert(std::make_pair(std::string("UCP"), &CWelcomeServiceClientSkel::updateConnectedPlayerCount_skel));
|
||||
// if this assert, you have a doubly message name in your interface definition !
|
||||
nlassert(res.second);
|
||||
|
||||
init = true;
|
||||
}
|
||||
|
||||
return handlers;
|
||||
}
|
||||
bool CWelcomeServiceClientSkel::fwdOnProcessModuleMessage(NLNET::IModuleProxy *sender, const NLNET::CMessage &message)
|
||||
{
|
||||
const TMessageHandlerMap &mh = getMessageHandlers();
|
||||
|
||||
TMessageHandlerMap::const_iterator it(mh.find(message.getName()));
|
||||
|
||||
if (it == mh.end())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
TMessageHandler cmd = it->second;
|
||||
(this->*cmd)(sender, message);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void CWelcomeServiceClientSkel::registerWS_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message)
|
||||
{
|
||||
H_AUTO(CWelcomeServiceClientSkel_registerWS_RWS);
|
||||
uint32 shardId;
|
||||
nlRead(__message, serial, shardId);
|
||||
uint32 fixedSessionId;
|
||||
nlRead(__message, serial, fixedSessionId);
|
||||
bool isOnline;
|
||||
nlRead(__message, serial, isOnline);
|
||||
registerWS(sender, shardId, fixedSessionId, isOnline);
|
||||
}
|
||||
|
||||
void CWelcomeServiceClientSkel::reportWSOpenState_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message)
|
||||
{
|
||||
H_AUTO(CWelcomeServiceClientSkel_reportWSOpenState_RWSOS);
|
||||
bool isOnline;
|
||||
nlRead(__message, serial, isOnline);
|
||||
reportWSOpenState(sender, isOnline);
|
||||
}
|
||||
|
||||
void CWelcomeServiceClientSkel::welcomeUserResult_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message)
|
||||
{
|
||||
H_AUTO(CWelcomeServiceClientSkel_welcomeUserResult_WUR);
|
||||
uint32 userId;
|
||||
nlRead(__message, serial, userId);
|
||||
bool ok;
|
||||
nlRead(__message, serial, ok);
|
||||
std::string shardAddr;
|
||||
nlRead(__message, serial, shardAddr);
|
||||
std::string errorMsg;
|
||||
nlRead(__message, serial, errorMsg);
|
||||
welcomeUserResult(sender, userId, ok, shardAddr, errorMsg);
|
||||
}
|
||||
|
||||
void CWelcomeServiceClientSkel::updateConnectedPlayerCount_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message)
|
||||
{
|
||||
H_AUTO(CWelcomeServiceClientSkel_updateConnectedPlayerCount_UCP);
|
||||
uint32 nbOnlinePlayers;
|
||||
nlRead(__message, serial, nbOnlinePlayers);
|
||||
uint32 nbPendingPlayers;
|
||||
nlRead(__message, serial, nbPendingPlayers);
|
||||
updateConnectedPlayerCount(sender, nbOnlinePlayers, nbPendingPlayers);
|
||||
}
|
||||
// Register the welcome service in the ring session manager
|
||||
// The provided sessionId will be non-zero only for a shard with a fixed sessionId
|
||||
void CWelcomeServiceClientProxy::registerWS(NLNET::IModule *sender, uint32 shardId, uint32 fixedSessionId, bool isOnline)
|
||||
{
|
||||
if (_LocalModuleSkel && _LocalModule->isImmediateDispatchingSupported())
|
||||
{
|
||||
// immediate local synchronous dispatching
|
||||
_LocalModuleSkel->registerWS(_ModuleProxy->getModuleGateway()->getPluggedModuleProxy(sender), shardId, fixedSessionId, isOnline);
|
||||
}
|
||||
else
|
||||
{
|
||||
// send the message for remote dispatching and execution or local queing
|
||||
NLNET::CMessage __message;
|
||||
|
||||
buildMessageFor_registerWS(__message, shardId, fixedSessionId, isOnline);
|
||||
|
||||
_ModuleProxy->sendModuleMessage(sender, __message);
|
||||
}
|
||||
}
|
||||
// WS report it's current open state
|
||||
void CWelcomeServiceClientProxy::reportWSOpenState(NLNET::IModule *sender, bool isOnline)
|
||||
{
|
||||
if (_LocalModuleSkel && _LocalModule->isImmediateDispatchingSupported())
|
||||
{
|
||||
// immediate local synchronous dispatching
|
||||
_LocalModuleSkel->reportWSOpenState(_ModuleProxy->getModuleGateway()->getPluggedModuleProxy(sender), isOnline);
|
||||
}
|
||||
else
|
||||
{
|
||||
// send the message for remote dispatching and execution or local queing
|
||||
NLNET::CMessage __message;
|
||||
|
||||
buildMessageFor_reportWSOpenState(__message, isOnline);
|
||||
|
||||
_ModuleProxy->sendModuleMessage(sender, __message);
|
||||
}
|
||||
}
|
||||
// return for welcome user
|
||||
void CWelcomeServiceClientProxy::welcomeUserResult(NLNET::IModule *sender, uint32 userId, bool ok, const std::string &shardAddr, const std::string &errorMsg)
|
||||
{
|
||||
if (_LocalModuleSkel && _LocalModule->isImmediateDispatchingSupported())
|
||||
{
|
||||
// immediate local synchronous dispatching
|
||||
_LocalModuleSkel->welcomeUserResult(_ModuleProxy->getModuleGateway()->getPluggedModuleProxy(sender), userId, ok, shardAddr, errorMsg);
|
||||
}
|
||||
else
|
||||
{
|
||||
// send the message for remote dispatching and execution or local queing
|
||||
NLNET::CMessage __message;
|
||||
|
||||
buildMessageFor_welcomeUserResult(__message, userId, ok, shardAddr, errorMsg);
|
||||
|
||||
_ModuleProxy->sendModuleMessage(sender, __message);
|
||||
}
|
||||
}
|
||||
// transmits the current player counts
|
||||
void CWelcomeServiceClientProxy::updateConnectedPlayerCount(NLNET::IModule *sender, uint32 nbOnlinePlayers, uint32 nbPendingPlayers)
|
||||
{
|
||||
if (_LocalModuleSkel && _LocalModule->isImmediateDispatchingSupported())
|
||||
{
|
||||
// immediate local synchronous dispatching
|
||||
_LocalModuleSkel->updateConnectedPlayerCount(_ModuleProxy->getModuleGateway()->getPluggedModuleProxy(sender), nbOnlinePlayers, nbPendingPlayers);
|
||||
}
|
||||
else
|
||||
{
|
||||
// send the message for remote dispatching and execution or local queing
|
||||
NLNET::CMessage __message;
|
||||
|
||||
buildMessageFor_updateConnectedPlayerCount(__message, nbOnlinePlayers, nbPendingPlayers);
|
||||
|
||||
_ModuleProxy->sendModuleMessage(sender, __message);
|
||||
}
|
||||
}
|
||||
|
||||
// Message serializer. Return the message received in reference for easier integration
|
||||
const NLNET::CMessage &CWelcomeServiceClientProxy::buildMessageFor_registerWS(NLNET::CMessage &__message, uint32 shardId, uint32 fixedSessionId, bool isOnline)
|
||||
{
|
||||
__message.setType("RWS");
|
||||
nlWrite(__message, serial, shardId);
|
||||
nlWrite(__message, serial, fixedSessionId);
|
||||
nlWrite(__message, serial, isOnline);
|
||||
|
||||
|
||||
return __message;
|
||||
}
|
||||
|
||||
// Message serializer. Return the message received in reference for easier integration
|
||||
const NLNET::CMessage &CWelcomeServiceClientProxy::buildMessageFor_reportWSOpenState(NLNET::CMessage &__message, bool isOnline)
|
||||
{
|
||||
__message.setType("RWSOS");
|
||||
nlWrite(__message, serial, isOnline);
|
||||
|
||||
|
||||
return __message;
|
||||
}
|
||||
|
||||
// Message serializer. Return the message received in reference for easier integration
|
||||
const NLNET::CMessage &CWelcomeServiceClientProxy::buildMessageFor_welcomeUserResult(NLNET::CMessage &__message, uint32 userId, bool ok, const std::string &shardAddr, const std::string &errorMsg)
|
||||
{
|
||||
__message.setType("WUR");
|
||||
nlWrite(__message, serial, userId);
|
||||
nlWrite(__message, serial, ok);
|
||||
nlWrite(__message, serial, const_cast < std::string& > (shardAddr));
|
||||
nlWrite(__message, serial, const_cast < std::string& > (errorMsg));
|
||||
|
||||
|
||||
return __message;
|
||||
}
|
||||
|
||||
// Message serializer. Return the message received in reference for easier integration
|
||||
const NLNET::CMessage &CWelcomeServiceClientProxy::buildMessageFor_updateConnectedPlayerCount(NLNET::CMessage &__message, uint32 nbOnlinePlayers, uint32 nbPendingPlayers)
|
||||
{
|
||||
__message.setType("UCP");
|
||||
nlWrite(__message, serial, nbOnlinePlayers);
|
||||
nlWrite(__message, serial, nbPendingPlayers);
|
||||
|
||||
|
||||
return __message;
|
||||
}
|
||||
|
||||
}
|
541
code/ryzom/common/src/game_share/welcome_service_itf.h
Normal file
541
code/ryzom/common/src/game_share/welcome_service_itf.h
Normal file
|
@ -0,0 +1,541 @@
|
|||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// WARNING : this is a generated file, don't change it !
|
||||
/////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef WELCOME_SERVICE_ITF
|
||||
#define WELCOME_SERVICE_ITF
|
||||
#include "nel/misc/types_nl.h"
|
||||
#ifdef NL_COMP_VC8
|
||||
#include <memory>
|
||||
#endif
|
||||
#include "nel/misc/hierarchical_timer.h"
|
||||
#include "nel/misc/string_conversion.h"
|
||||
#include "nel/net/message.h"
|
||||
#include "nel/net/module.h"
|
||||
#include "nel/net/module_builder_parts.h"
|
||||
#include "nel/net/module_message.h"
|
||||
#include "nel/net/module_gateway.h"
|
||||
|
||||
#include "nel/net/login_cookie.h"
|
||||
|
||||
namespace WS
|
||||
{
|
||||
|
||||
|
||||
|
||||
struct TUserRole
|
||||
{
|
||||
enum TValues
|
||||
{
|
||||
ur_player,
|
||||
ur_editor,
|
||||
ur_animator,
|
||||
/// the highest valid value in the enum
|
||||
last_enum_item = ur_animator,
|
||||
/// a value equal to the last enum item +1
|
||||
end_of_enum,
|
||||
|
||||
invalid_val,
|
||||
|
||||
/// Number of enumerated values
|
||||
nb_enum_items = 3
|
||||
};
|
||||
|
||||
/// Index table to convert enum value to linear index table
|
||||
const std::map<TValues, uint32> &getIndexTable() const
|
||||
{
|
||||
static std::map<TValues, uint32> indexTable;
|
||||
static bool init = false;
|
||||
if (!init)
|
||||
{
|
||||
// fill the index table
|
||||
indexTable.insert(std::make_pair(ur_player, 0));
|
||||
indexTable.insert(std::make_pair(ur_editor, 1));
|
||||
indexTable.insert(std::make_pair(ur_animator, 2));
|
||||
|
||||
init = true;
|
||||
}
|
||||
|
||||
return indexTable;
|
||||
}
|
||||
|
||||
|
||||
static const NLMISC::CStringConversion<TValues> &getConversionTable()
|
||||
{
|
||||
NL_BEGIN_STRING_CONVERSION_TABLE(TValues)
|
||||
NL_STRING_CONVERSION_TABLE_ENTRY(ur_player)
|
||||
NL_STRING_CONVERSION_TABLE_ENTRY(ur_editor)
|
||||
NL_STRING_CONVERSION_TABLE_ENTRY(ur_animator)
|
||||
NL_STRING_CONVERSION_TABLE_ENTRY(invalid_val)
|
||||
};
|
||||
static NLMISC::CStringConversion<TValues>
|
||||
conversionTable(TValues_nl_string_conversion_table, sizeof(TValues_nl_string_conversion_table)
|
||||
/ sizeof(TValues_nl_string_conversion_table[0]), invalid_val);
|
||||
|
||||
return conversionTable;
|
||||
}
|
||||
|
||||
TValues _Value;
|
||||
|
||||
public:
|
||||
TUserRole()
|
||||
: _Value(invalid_val)
|
||||
{
|
||||
}
|
||||
TUserRole(TValues value)
|
||||
: _Value(value)
|
||||
{
|
||||
}
|
||||
|
||||
TUserRole(const std::string &str)
|
||||
{
|
||||
_Value = getConversionTable().fromString(str);
|
||||
}
|
||||
|
||||
void serial(NLMISC::IStream &s)
|
||||
{
|
||||
s.serialEnum(_Value);
|
||||
}
|
||||
|
||||
bool operator == (const TUserRole &other) const
|
||||
{
|
||||
return _Value == other._Value;
|
||||
}
|
||||
bool operator != (const TUserRole &other) const
|
||||
{
|
||||
return ! (_Value == other._Value);
|
||||
}
|
||||
bool operator < (const TUserRole &other) const
|
||||
{
|
||||
return _Value < other._Value;
|
||||
}
|
||||
|
||||
bool operator <= (const TUserRole &other) const
|
||||
{
|
||||
return _Value <= other._Value;
|
||||
}
|
||||
|
||||
bool operator > (const TUserRole &other) const
|
||||
{
|
||||
return !(_Value <= other._Value);
|
||||
}
|
||||
bool operator >= (const TUserRole &other) const
|
||||
{
|
||||
return !(_Value < other._Value);
|
||||
}
|
||||
|
||||
const std::string &toString() const
|
||||
{
|
||||
return getConversionTable().toString(_Value);
|
||||
}
|
||||
static const std::string &toString(TValues value)
|
||||
{
|
||||
return getConversionTable().toString(value);
|
||||
}
|
||||
|
||||
TValues getValue() const
|
||||
{
|
||||
return _Value;
|
||||
}
|
||||
|
||||
// return true if the actual value of the enum is valid, otherwise false
|
||||
bool isValid()
|
||||
{
|
||||
if (_Value == invalid_val)
|
||||
return false;
|
||||
|
||||
// not invalid, check other enum value
|
||||
return getConversionTable().isValid(_Value);
|
||||
}
|
||||
|
||||
|
||||
uint32 asIndex()
|
||||
{
|
||||
std::map<TValues, uint32>::const_iterator it(getIndexTable().find(_Value));
|
||||
nlassert(it != getIndexTable().end());
|
||||
return it->second;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// WARNING : this is a generated file, don't change it !
|
||||
/////////////////////////////////////////////////////////////////
|
||||
class CWelcomeServiceSkel
|
||||
{
|
||||
public:
|
||||
/// the interceptor type
|
||||
typedef NLNET::CInterceptorForwarder < CWelcomeServiceSkel> TInterceptor;
|
||||
protected:
|
||||
CWelcomeServiceSkel()
|
||||
{
|
||||
// do early run time check for message table
|
||||
getMessageHandlers();
|
||||
}
|
||||
virtual ~CWelcomeServiceSkel()
|
||||
{
|
||||
}
|
||||
|
||||
void init(NLNET::IModule *module)
|
||||
{
|
||||
_Interceptor.init(this, module);
|
||||
}
|
||||
|
||||
// unused interceptors
|
||||
std::string fwdBuildModuleManifest() const { return std::string(); }
|
||||
void fwdOnModuleUp(NLNET::IModuleProxy * /* moduleProxy */) {}
|
||||
void fwdOnModuleDown(NLNET::IModuleProxy * /* moduleProxy */) {}
|
||||
void fwdOnModuleSecurityChange(NLNET::IModuleProxy * /* moduleProxy */) {}
|
||||
|
||||
// process module message interceptor
|
||||
bool fwdOnProcessModuleMessage(NLNET::IModuleProxy *sender, const NLNET::CMessage &message);
|
||||
private:
|
||||
|
||||
typedef void (CWelcomeServiceSkel::*TMessageHandler)(NLNET::IModuleProxy *sender, const NLNET::CMessage &message);
|
||||
typedef std::map<std::string, TMessageHandler> TMessageHandlerMap;
|
||||
|
||||
const TMessageHandlerMap &getMessageHandlers() const;
|
||||
|
||||
|
||||
void welcomeUser_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message);
|
||||
|
||||
void disconnectUser_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message);
|
||||
|
||||
// declare one interceptor member of the skeleton
|
||||
TInterceptor _Interceptor;
|
||||
|
||||
// declare the interceptor forwarder as friend of this class
|
||||
friend class NLNET::CInterceptorForwarder < CWelcomeServiceSkel>;
|
||||
public:
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// WARNING : this is a generated file, don't change it !
|
||||
/////////////////////////////////////////////////////////////////
|
||||
|
||||
// ask the welcome service to welcome a character
|
||||
virtual void welcomeUser(NLNET::IModuleProxy *sender, uint32 charId, const std::string &userName, const NLNET::CLoginCookie &cookie, const std::string &priviledge, const std::string &exPriviledge, WS::TUserRole mode, uint32 instanceId) =0;
|
||||
// ask the welcome service to disconnect a user
|
||||
virtual void disconnectUser(NLNET::IModuleProxy *sender, uint32 userId) =0;
|
||||
|
||||
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// WARNING : this is a generated file, don't change it !
|
||||
/////////////////////////////////////////////////////////////////
|
||||
class CWelcomeServiceProxy
|
||||
{
|
||||
/// Smart pointer on the module proxy
|
||||
NLNET::TModuleProxyPtr _ModuleProxy;
|
||||
|
||||
// Pointer on the local module that implement the interface (if the proxy is for a local module)
|
||||
NLNET::TModulePtr _LocalModule;
|
||||
// Direct pointer on the server implementation interface for collocated module
|
||||
CWelcomeServiceSkel *_LocalModuleSkel;
|
||||
|
||||
|
||||
public:
|
||||
CWelcomeServiceProxy(NLNET::IModuleProxy *proxy)
|
||||
{
|
||||
nlassert(proxy->getModuleClassName() == "WelcomeService");
|
||||
_ModuleProxy = proxy;
|
||||
|
||||
// initialize collocated servant interface
|
||||
if (proxy->getModuleDistance() == 0)
|
||||
{
|
||||
_LocalModule = proxy->getLocalModule();
|
||||
nlassert(_LocalModule != NULL);
|
||||
CWelcomeServiceSkel::TInterceptor *interceptor = NULL;
|
||||
interceptor = static_cast < NLNET::CModuleBase* >(_LocalModule.getPtr())->getInterceptor(interceptor);
|
||||
nlassert(interceptor != NULL);
|
||||
|
||||
_LocalModuleSkel = interceptor->getParent();
|
||||
nlassert(_LocalModuleSkel != NULL);
|
||||
}
|
||||
else
|
||||
_LocalModuleSkel = 0;
|
||||
|
||||
}
|
||||
virtual ~CWelcomeServiceProxy()
|
||||
{
|
||||
}
|
||||
|
||||
NLNET::IModuleProxy *getModuleProxy()
|
||||
{
|
||||
return _ModuleProxy;
|
||||
}
|
||||
|
||||
// ask the welcome service to welcome a character
|
||||
void welcomeUser(NLNET::IModule *sender, uint32 charId, const std::string &userName, const NLNET::CLoginCookie &cookie, const std::string &priviledge, const std::string &exPriviledge, WS::TUserRole mode, uint32 instanceId);
|
||||
// ask the welcome service to disconnect a user
|
||||
void disconnectUser(NLNET::IModule *sender, uint32 userId);
|
||||
|
||||
// Message serializer. Return the message received in reference for easier integration
|
||||
static const NLNET::CMessage &buildMessageFor_welcomeUser(NLNET::CMessage &__message, uint32 charId, const std::string &userName, const NLNET::CLoginCookie &cookie, const std::string &priviledge, const std::string &exPriviledge, WS::TUserRole mode, uint32 instanceId);
|
||||
|
||||
// Message serializer. Return the message received in reference for easier integration
|
||||
static const NLNET::CMessage &buildMessageFor_disconnectUser(NLNET::CMessage &__message, uint32 userId);
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// WARNING : this is a generated file, don't change it !
|
||||
/////////////////////////////////////////////////////////////////
|
||||
class CLoginServiceSkel
|
||||
{
|
||||
public:
|
||||
/// the interceptor type
|
||||
typedef NLNET::CInterceptorForwarder < CLoginServiceSkel> TInterceptor;
|
||||
protected:
|
||||
CLoginServiceSkel()
|
||||
{
|
||||
// do early run time check for message table
|
||||
getMessageHandlers();
|
||||
}
|
||||
virtual ~CLoginServiceSkel()
|
||||
{
|
||||
}
|
||||
|
||||
void init(NLNET::IModule *module)
|
||||
{
|
||||
_Interceptor.init(this, module);
|
||||
}
|
||||
|
||||
// unused interceptors
|
||||
std::string fwdBuildModuleManifest() const { return std::string(); }
|
||||
void fwdOnModuleUp(NLNET::IModuleProxy * /* moduleProxy */) {}
|
||||
void fwdOnModuleDown(NLNET::IModuleProxy * /* moduleProxy */) {}
|
||||
void fwdOnModuleSecurityChange(NLNET::IModuleProxy * /* moduleProxy */) {}
|
||||
|
||||
// process module message interceptor
|
||||
bool fwdOnProcessModuleMessage(NLNET::IModuleProxy *sender, const NLNET::CMessage &message);
|
||||
private:
|
||||
|
||||
typedef void (CLoginServiceSkel::*TMessageHandler)(NLNET::IModuleProxy *sender, const NLNET::CMessage &message);
|
||||
typedef std::map<std::string, TMessageHandler> TMessageHandlerMap;
|
||||
|
||||
const TMessageHandlerMap &getMessageHandlers() const;
|
||||
|
||||
|
||||
void pendingUserLost_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message);
|
||||
|
||||
// declare one interceptor member of the skeleton
|
||||
TInterceptor _Interceptor;
|
||||
|
||||
// declare the interceptor forwarder as friend of this class
|
||||
friend class NLNET::CInterceptorForwarder < CLoginServiceSkel>;
|
||||
public:
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// WARNING : this is a generated file, don't change it !
|
||||
/////////////////////////////////////////////////////////////////
|
||||
|
||||
// An awaited user did not connect before the allowed timeout expire
|
||||
virtual void pendingUserLost(NLNET::IModuleProxy *sender, const NLNET::CLoginCookie &cookie) =0;
|
||||
|
||||
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// WARNING : this is a generated file, don't change it !
|
||||
/////////////////////////////////////////////////////////////////
|
||||
class CLoginServiceProxy
|
||||
{
|
||||
/// Smart pointer on the module proxy
|
||||
NLNET::TModuleProxyPtr _ModuleProxy;
|
||||
|
||||
// Pointer on the local module that implement the interface (if the proxy is for a local module)
|
||||
NLNET::TModulePtr _LocalModule;
|
||||
// Direct pointer on the server implementation interface for collocated module
|
||||
CLoginServiceSkel *_LocalModuleSkel;
|
||||
|
||||
|
||||
public:
|
||||
CLoginServiceProxy(NLNET::IModuleProxy *proxy)
|
||||
{
|
||||
|
||||
_ModuleProxy = proxy;
|
||||
|
||||
// initialize collocated servant interface
|
||||
if (proxy->getModuleDistance() == 0)
|
||||
{
|
||||
_LocalModule = proxy->getLocalModule();
|
||||
nlassert(_LocalModule != NULL);
|
||||
CLoginServiceSkel::TInterceptor *interceptor = NULL;
|
||||
interceptor = static_cast < NLNET::CModuleBase* >(_LocalModule.getPtr())->getInterceptor(interceptor);
|
||||
nlassert(interceptor != NULL);
|
||||
|
||||
_LocalModuleSkel = interceptor->getParent();
|
||||
nlassert(_LocalModuleSkel != NULL);
|
||||
}
|
||||
else
|
||||
_LocalModuleSkel = 0;
|
||||
|
||||
}
|
||||
virtual ~CLoginServiceProxy()
|
||||
{
|
||||
}
|
||||
|
||||
NLNET::IModuleProxy *getModuleProxy()
|
||||
{
|
||||
return _ModuleProxy;
|
||||
}
|
||||
|
||||
// An awaited user did not connect before the allowed timeout expire
|
||||
void pendingUserLost(NLNET::IModule *sender, const NLNET::CLoginCookie &cookie);
|
||||
|
||||
// Message serializer. Return the message received in reference for easier integration
|
||||
static const NLNET::CMessage &buildMessageFor_pendingUserLost(NLNET::CMessage &__message, const NLNET::CLoginCookie &cookie);
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// WARNING : this is a generated file, don't change it !
|
||||
/////////////////////////////////////////////////////////////////
|
||||
class CWelcomeServiceClientSkel
|
||||
{
|
||||
public:
|
||||
/// the interceptor type
|
||||
typedef NLNET::CInterceptorForwarder < CWelcomeServiceClientSkel> TInterceptor;
|
||||
protected:
|
||||
CWelcomeServiceClientSkel()
|
||||
{
|
||||
// do early run time check for message table
|
||||
getMessageHandlers();
|
||||
}
|
||||
virtual ~CWelcomeServiceClientSkel()
|
||||
{
|
||||
}
|
||||
|
||||
void init(NLNET::IModule *module)
|
||||
{
|
||||
_Interceptor.init(this, module);
|
||||
}
|
||||
|
||||
// unused interceptors
|
||||
std::string fwdBuildModuleManifest() const { return std::string(); }
|
||||
void fwdOnModuleUp(NLNET::IModuleProxy * /* moduleProxy */) {}
|
||||
void fwdOnModuleDown(NLNET::IModuleProxy * /* moduleProxy */) {}
|
||||
void fwdOnModuleSecurityChange(NLNET::IModuleProxy * /* moduleProxy */) {}
|
||||
|
||||
// process module message interceptor
|
||||
bool fwdOnProcessModuleMessage(NLNET::IModuleProxy *sender, const NLNET::CMessage &message);
|
||||
private:
|
||||
|
||||
typedef void (CWelcomeServiceClientSkel::*TMessageHandler)(NLNET::IModuleProxy *sender, const NLNET::CMessage &message);
|
||||
typedef std::map<std::string, TMessageHandler> TMessageHandlerMap;
|
||||
|
||||
const TMessageHandlerMap &getMessageHandlers() const;
|
||||
|
||||
|
||||
void registerWS_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message);
|
||||
|
||||
void reportWSOpenState_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message);
|
||||
|
||||
void welcomeUserResult_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message);
|
||||
|
||||
void updateConnectedPlayerCount_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message);
|
||||
|
||||
// declare one interceptor member of the skeleton
|
||||
TInterceptor _Interceptor;
|
||||
|
||||
// declare the interceptor forwarder as friend of this class
|
||||
friend class NLNET::CInterceptorForwarder < CWelcomeServiceClientSkel>;
|
||||
public:
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// WARNING : this is a generated file, don't change it !
|
||||
/////////////////////////////////////////////////////////////////
|
||||
|
||||
// Register the welcome service in the ring session manager
|
||||
// The provided sessionId will be non-zero only for a shard with a fixed sessionId
|
||||
virtual void registerWS(NLNET::IModuleProxy *sender, uint32 shardId, uint32 fixedSessionId, bool isOnline) =0;
|
||||
// WS report it's current open state
|
||||
virtual void reportWSOpenState(NLNET::IModuleProxy *sender, bool isOnline) =0;
|
||||
// return for welcome user
|
||||
virtual void welcomeUserResult(NLNET::IModuleProxy *sender, uint32 userId, bool ok, const std::string &shardAddr, const std::string &errorMsg) =0;
|
||||
// transmits the current player counts
|
||||
virtual void updateConnectedPlayerCount(NLNET::IModuleProxy *sender, uint32 nbOnlinePlayers, uint32 nbPendingPlayers) =0;
|
||||
|
||||
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// WARNING : this is a generated file, don't change it !
|
||||
/////////////////////////////////////////////////////////////////
|
||||
class CWelcomeServiceClientProxy
|
||||
{
|
||||
/// Smart pointer on the module proxy
|
||||
NLNET::TModuleProxyPtr _ModuleProxy;
|
||||
|
||||
// Pointer on the local module that implement the interface (if the proxy is for a local module)
|
||||
NLNET::TModulePtr _LocalModule;
|
||||
// Direct pointer on the server implementation interface for collocated module
|
||||
CWelcomeServiceClientSkel *_LocalModuleSkel;
|
||||
|
||||
|
||||
public:
|
||||
CWelcomeServiceClientProxy(NLNET::IModuleProxy *proxy)
|
||||
{
|
||||
|
||||
_ModuleProxy = proxy;
|
||||
|
||||
// initialize collocated servant interface
|
||||
if (proxy->getModuleDistance() == 0)
|
||||
{
|
||||
_LocalModule = proxy->getLocalModule();
|
||||
nlassert(_LocalModule != NULL);
|
||||
CWelcomeServiceClientSkel::TInterceptor *interceptor = NULL;
|
||||
interceptor = static_cast < NLNET::CModuleBase* >(_LocalModule.getPtr())->getInterceptor(interceptor);
|
||||
nlassert(interceptor != NULL);
|
||||
|
||||
_LocalModuleSkel = interceptor->getParent();
|
||||
nlassert(_LocalModuleSkel != NULL);
|
||||
}
|
||||
else
|
||||
_LocalModuleSkel = 0;
|
||||
|
||||
}
|
||||
virtual ~CWelcomeServiceClientProxy()
|
||||
{
|
||||
}
|
||||
|
||||
NLNET::IModuleProxy *getModuleProxy()
|
||||
{
|
||||
return _ModuleProxy;
|
||||
}
|
||||
|
||||
// Register the welcome service in the ring session manager
|
||||
// The provided sessionId will be non-zero only for a shard with a fixed sessionId
|
||||
void registerWS(NLNET::IModule *sender, uint32 shardId, uint32 fixedSessionId, bool isOnline);
|
||||
// WS report it's current open state
|
||||
void reportWSOpenState(NLNET::IModule *sender, bool isOnline);
|
||||
// return for welcome user
|
||||
void welcomeUserResult(NLNET::IModule *sender, uint32 userId, bool ok, const std::string &shardAddr, const std::string &errorMsg);
|
||||
// transmits the current player counts
|
||||
void updateConnectedPlayerCount(NLNET::IModule *sender, uint32 nbOnlinePlayers, uint32 nbPendingPlayers);
|
||||
|
||||
// Message serializer. Return the message received in reference for easier integration
|
||||
static const NLNET::CMessage &buildMessageFor_registerWS(NLNET::CMessage &__message, uint32 shardId, uint32 fixedSessionId, bool isOnline);
|
||||
|
||||
// Message serializer. Return the message received in reference for easier integration
|
||||
static const NLNET::CMessage &buildMessageFor_reportWSOpenState(NLNET::CMessage &__message, bool isOnline);
|
||||
|
||||
// Message serializer. Return the message received in reference for easier integration
|
||||
static const NLNET::CMessage &buildMessageFor_welcomeUserResult(NLNET::CMessage &__message, uint32 userId, bool ok, const std::string &shardAddr, const std::string &errorMsg);
|
||||
|
||||
// Message serializer. Return the message received in reference for easier integration
|
||||
static const NLNET::CMessage &buildMessageFor_updateConnectedPlayerCount(NLNET::CMessage &__message, uint32 nbOnlinePlayers, uint32 nbPendingPlayers);
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
|
@ -34,7 +34,7 @@ public:
|
|||
operator std::string() const { return std::string(_Value); }
|
||||
bool operator ! () const { return _Value == NULL; }
|
||||
operator const unsigned char *() const { return (const unsigned char *) _Value; }
|
||||
const char operator * () const { nlassert(_Value); return *_Value; }
|
||||
char operator * () const { nlassert(_Value); return *_Value; }
|
||||
/// NB : This remove previous owned pointer with xmlFree
|
||||
CXMLAutoPtr &operator = (const char *other)
|
||||
{
|
||||
|
|
320
code/ryzom/server/dynamic_scenario_service.cfg
Normal file
320
code/ryzom/server/dynamic_scenario_service.cfg
Normal file
|
@ -0,0 +1,320 @@
|
|||
// Auto generated config file
|
||||
// Use with commandline: dynamic_scenario_service -C. -L. --nobreak --writepid
|
||||
AESAliasName= "dss";
|
||||
|
||||
ASWebPort="46700";
|
||||
ASPort="46701";
|
||||
AESPort="46702";
|
||||
SUPort = 50505;
|
||||
SUGlobalPort = 50503;
|
||||
L3BSPort = "49950";
|
||||
L3SlaveBSPort = "49951";
|
||||
L3MasterLGSPort = 49992;
|
||||
LGSBSPort = 49994;
|
||||
L3LGSBSPort = 49995;
|
||||
SUHost = "localhost";
|
||||
MFSHost = "localhost";
|
||||
BSHost = "localhost:49990";
|
||||
SlaveBSHost = "";
|
||||
MasterLGSHost = "localhost";
|
||||
SlaveLGSHost = "localhost";
|
||||
LGSBSHost = "localhost";
|
||||
DBHost = "localhost";
|
||||
#define DONT_USE_LGS_SLAVE
|
||||
// Configure module gateway for layer 5 module comm
|
||||
StartCommands +=
|
||||
{
|
||||
// Create a gateway module
|
||||
"moduleManager.createModule StandardGateway gw",
|
||||
// add a layer 5 transport
|
||||
"gw.transportAdd L5Transport l5",
|
||||
// open the transport
|
||||
"gw.transportCmd l5(open)",
|
||||
|
||||
/// Create default connection with admin executor service
|
||||
// Create a gateway module
|
||||
"moduleManager.createModule StandardGateway gw_aes",
|
||||
// create the admin executor service module
|
||||
"moduleManager.createModule AdminExecutorServiceClient aes_client",
|
||||
"aes_client.plug gw_aes",
|
||||
|
||||
// create a layer 3 client to connect to aes gateway
|
||||
"gw_aes.transportAdd L3Client aes_l3c",
|
||||
"gw_aes.transportCmd aes_l3c(connect addr=localhost:"+AESPort+")",
|
||||
};
|
||||
|
||||
/// A list of vars to graph for any service
|
||||
GraphVars =
|
||||
{
|
||||
"ProcessUsedMemory", "60000", // every minute
|
||||
};
|
||||
|
||||
|
||||
/* Force default value for PDLib directory (e.g. SaveFilesDirectory...)
|
||||
* PLEASE NOTICE THAT THIS LINE MUST BE LEFT TO ""
|
||||
* Only log analyser must have the $shard parameter to find all shards root directory
|
||||
*/
|
||||
PDRootDirectory = "";
|
||||
|
||||
// Log PD updates to log file (1 enabled, 0 disabled), see PDLogSaveDirectory to choose where to log
|
||||
PDEnableLog = 1;
|
||||
|
||||
// Log PD StringManager updates to log file (1 enabled, 0 disabled), see PDLogSaveDirectory to choose where to log
|
||||
PDEnableStringLog = 0;
|
||||
|
||||
// Number of seconds between 2 logs to file
|
||||
PDLogUpdate = 10;
|
||||
|
||||
// MySGL wrapper strict mode - controls use of asserts if SQL requests fail
|
||||
MSWStrictMode=0;
|
||||
|
||||
// This is the mapping for logical continent to physical one
|
||||
ContinentNameTranslator =
|
||||
{
|
||||
"matis_newbie", "matis",
|
||||
"zorai_newbie", "zorai",
|
||||
"terre", "terre_oubliee",
|
||||
"sources", "sources_interdites"
|
||||
};
|
||||
|
||||
NegFiltersDebug = { "ZZZZZZZZZZZ" };
|
||||
NegFiltersInfo = { "ZZZZZZZZZZZ" };
|
||||
NegFiltersWarning = { "ZZZZZZZZZZZ", "Missing log context for log" };
|
||||
//NegFiltersDebug = { "NET", "ADMIN", "MIRROR", "NC", "PATH" };
|
||||
//NegFiltersInfo = { "NET", "ADMIN", "MIRROR", "NC", "CF", "TimerManagerUpdate" };
|
||||
// NegFiltersWarning = { "CT_LRC", "AnimalSpawned" };
|
||||
|
||||
// Block the system in the tick service that provokes stalls when overloaded
|
||||
WaitForBSThreshold=0;
|
||||
|
||||
// Only produce log*.log files and not <service name>*.log
|
||||
DontLog=1;
|
||||
|
||||
IgnoredFiles = { "continent.cfg", "__read_me.txt", "bandit.html", "flora_primr.primitive" };
|
||||
|
||||
// If the update loop is too slow, a thread will produce an assertion.
|
||||
// By default, the value is set to 10 minutes.
|
||||
// Set to 0 for no assertion.
|
||||
UpdateAssertionThreadTimeout = 6000000;
|
||||
|
||||
DefaultMaxExpectedBlockSize = 200000000; // 200 M !
|
||||
DefaultMaxSentBlockSize = 200000000; // 200 M !
|
||||
|
||||
// MS Packet size limit in bytes, PER DATASET (warning: depending on the weights, limits per property may be very small)
|
||||
MaxOutBandwidth = 100000000;
|
||||
|
||||
// how to sleep between 2 network updates
|
||||
// 0 = pipe
|
||||
// 1 = usleep
|
||||
// 2 = nanosleep
|
||||
// 3 = sched_yield
|
||||
// 4 = nothing
|
||||
UseYieldMethod = 0;
|
||||
|
||||
// The privileges needed to access any ring session
|
||||
PrivilegeForSessionAccess = ":DEV:SGM:GM:SG:";
|
||||
|
||||
// The max number of ring points (aka ring access) for each ecosystem
|
||||
MaxRingPoints = "A1:D7:F7:J8:L6:R13";
|
||||
|
||||
// Level limit for newb scenarios
|
||||
FreeTrialSkillLimit=21;
|
||||
|
||||
// Level limit for newb scenarios
|
||||
DefaultInterShardExchangeLevelCap=0;
|
||||
|
||||
// Configureation for DSS
|
||||
MaxNpcs = 300;
|
||||
MaxStaticObjects = 200;
|
||||
|
||||
// the following variable must be defined but should be empty - it's presence is used to change the behaviour
|
||||
// of the packed sheet reader
|
||||
GeorgePaths = { "" };
|
||||
|
||||
// Dissable nel net verbose logging
|
||||
VerboseNETTC = 0;
|
||||
VerboseLNETL0 = 0;
|
||||
VerboseLNETL1 = 0;
|
||||
VerboseLNETL2 = 0;
|
||||
VerboseLNETL3 = 0;
|
||||
VerboseLNETL4 = 0;
|
||||
VerboseLNETL5 = 0;
|
||||
VerboseLNETL6 = 0;
|
||||
|
||||
// Dissable ryzom verbose logging
|
||||
VerboseMIRROR = 0;
|
||||
VerboseRingRPLog = 0;
|
||||
VerboseCDBGroup = 0;
|
||||
|
||||
// What to do with characters coming from another mainland shard?
|
||||
// 0: teleport to the stored session id
|
||||
// 1: let the character play anyway, but leave the stored session id unchanged
|
||||
// 2: assign the stored session id with FixedSessionId and let play
|
||||
AllowCharsFromAllSessions = 0;
|
||||
|
||||
// Use Shard Unifier or not
|
||||
DontUseSU = 0;
|
||||
|
||||
// the domain's set of useful addresses
|
||||
LSHost = SUHost;
|
||||
RSMHost = SUHost;
|
||||
|
||||
// MFS config
|
||||
WebSrvUsersDirectory = "";
|
||||
WebRootDirectory = "/home/nevrax/live/save_shard/www";
|
||||
HoFHDTDirectory = "/local/www/hof/hdt";
|
||||
|
||||
// BS Specifics --------------------------------------------------------------------------
|
||||
// BS - set to 1 if a BS is not part of a naming service group (then BS not disclosed
|
||||
// to other services by the Layer 5, i.e. the services sending requests to BS have
|
||||
// to know its/their address(es) by another mean)
|
||||
BSDontUseNS = 1;
|
||||
// BS - set the host of the naming service where the BS register
|
||||
BSNSHost = "localhost";
|
||||
UseBS = 1;
|
||||
XMLSave = 0;
|
||||
|
||||
// Where to save specific shard data (ie: player backup), relatively to SaveShardRoot
|
||||
SaveFilesDirectory = "";
|
||||
|
||||
// where to save generic shard data (ie: packed_sheet)
|
||||
WriteFilesDirectory = "r2_shard/data_shard";
|
||||
|
||||
// Will SaveFilesDirectory will be converted to a full path?
|
||||
ConvertSaveFilesDirectoryToFullPath = 0;
|
||||
|
||||
// BS - Root directory where data are backuped to
|
||||
IncrementalBackupDirectory = "../incremental_backup";
|
||||
|
||||
// IOS - Directory to store ios.string_cache file
|
||||
StringManagerCacheDirectory = "../data_shard_local";
|
||||
|
||||
// IOS - Directory to log chat into
|
||||
LogChatDirectory = "../data_shard_local";
|
||||
|
||||
// MFS - Directories
|
||||
WebRootDirectory = "../www";
|
||||
|
||||
// Root directory where data from shards are stored into
|
||||
SaveShardRoot = "../save_shard/";
|
||||
|
||||
// SU Specifics --------------------------------------------------------------------------
|
||||
// SU - set to 1 if SU didn't use a naming service
|
||||
SUDontUseNS = 1;
|
||||
// SU - host for the NS used by SU
|
||||
SUNSHost = "localhost";
|
||||
// SU - listen address of the SU service (for L5 connections)
|
||||
SUAddress = SUHost+":"+SUPort;
|
||||
// SU - nel and ring database names
|
||||
DBNelName = "nel";
|
||||
DBRingName = "ring_open";
|
||||
// Nel DB user
|
||||
DBNelUser = "open";
|
||||
// Ring DB user
|
||||
DBRingUser = "open";
|
||||
// SU - password to access to the nel database with DBNelUseruser (default is no password)
|
||||
DBNelPass = "";
|
||||
// SU - password to access to the ring database with DBRingUser (default is no password)
|
||||
DBRingPass = "";
|
||||
|
||||
// WS Specifics --------------------------------------------------------------------------
|
||||
// WS - use or not the legacy WelcomeService from nel ns (only for backward compatibility during transition to ring)
|
||||
DontUseLSService = 1;
|
||||
|
||||
// Global config --------------------------------------------------------------------------
|
||||
// set to 0 if you want to use the admin system
|
||||
DontUseAES = 1;
|
||||
|
||||
// Dissable generation / display of nldebug messages
|
||||
DissableNLDebug = 1;
|
||||
DisableNLDebug = 1;
|
||||
ShardId = 201;
|
||||
BasePort = 51400;
|
||||
SaveFilesDirectory="open_ring01/";
|
||||
NSHost = "localhost";
|
||||
// Player limits (AIS, EGS, WS, FS)
|
||||
NbPlayersLimit = 5000;
|
||||
NbGuildLimit = 15000;
|
||||
PlayerLimit = NbPlayersLimit;
|
||||
ClientLimit = 1000;
|
||||
|
||||
// Set this shard as a ring (1) or mainland (0) shard (main behavior switch)
|
||||
IsRingShard = 1;
|
||||
|
||||
// Set a mainland SessionId.
|
||||
// Live: Must be 0 for ring shards, non-zero (usually ShardId) for mainland shards
|
||||
// Dev: Can be non-zero to initially connect a client to a ring shard
|
||||
NoWSShardId = ShardId;
|
||||
FixedSessionId = 0;
|
||||
|
||||
// Mirror limits
|
||||
DatasetSizefe_temp = 600000;
|
||||
DatasetSizefame = 26000;
|
||||
|
||||
// FS Specifics --------------------------------------------------------------------------
|
||||
// Client bandwidth ratio, set to 1 for standard operation, more than one allocate more bandwidth
|
||||
BandwidthRatio = 2;
|
||||
|
||||
// EGS Specifics --------------------------------------------------------------------------
|
||||
// Entity Limits (EGS)
|
||||
NbObjectsLimit = 2000;
|
||||
NbNpcSpawnedByEGSLimit = 5000;
|
||||
NbForageSourcesLimit = 10000;
|
||||
NbToxicCloudsLimit = 5000;
|
||||
|
||||
// AIS Specifics --------------------------------------------------------------------------
|
||||
// Entity Limits (AIS)
|
||||
NbPetLimit = NbPlayersLimit*4;
|
||||
NbFaunaLimit = 50000;
|
||||
NbNpcLimit = 50000;
|
||||
NbFxLimit = 500;
|
||||
|
||||
// This is the list of continent to use with their unique instance number
|
||||
UsedContinents =
|
||||
{
|
||||
"r2_desert", "10000",
|
||||
"r2_forest", "10001",
|
||||
"r2_jungle", "10002",
|
||||
"r2_lakes", "10003",
|
||||
"r2_roots", "10004",
|
||||
};
|
||||
|
||||
// define the primitives configuration used.
|
||||
UsedPrimitives =
|
||||
{
|
||||
};
|
||||
FSListenHost = "localhost";
|
||||
#include "dynamic_scenario_service_default.cfg"
|
||||
WriteFilesDirectory="../live/service_dynamic_scenario_service/";
|
||||
DontLog = 1;
|
||||
WebSrvHost = "http://localhost:50000/";
|
||||
Mainlands = {
|
||||
"302", "Open", "(Open Developer Community)", "en",
|
||||
};
|
||||
HomeMainlandNames =
|
||||
{
|
||||
"302", "Open", "open",
|
||||
};
|
||||
RRDVarPath = "../rrd_graphs";
|
||||
NegFiltersInfo+= {"FESTATS", "FETIME", "FERECV", "FESEND: sent SYNC message to client 1", "EIT: Register EId"};
|
||||
NegFiltersWarning+= {"PIPO_SESSION1", "casino_session_matis01", "invalid damage type 10", "_log_Item_Delete",
|
||||
"_log_Item_Money", "_log_Item_Create", "_log_Item_Move", "botChatMissionAdvance> invalid index 0",
|
||||
"_MaxRange(0) < _MinRange(1)", "Can't find craft plan sheet 'unknown.unknown'"};
|
||||
DontUseAES=1;
|
||||
RingRPEnabled=0;
|
||||
DomainName = "ryzom_open";
|
||||
EnableStlAllocatorChecker = 0;
|
||||
// start commands for setting up the exchange level caps of different ryzom shards
|
||||
StartCommands += { "setShardExchangeLimit 101 250" };
|
||||
StartCommands += { "setShardExchangeLimit 102 250" };
|
||||
StartCommands += { "setShardExchangeLimit 103 250" };
|
||||
StartCommands += { "setShardExchangeLimit 104 0" };
|
||||
StartCommands += { "setShardExchangeLimit 105 0" };
|
||||
StartCommands += { "displayShardExchangeLimits" };
|
||||
StartCommands += { "EnableStlAllocatorChecker 0" };
|
||||
|
||||
Paths = {
|
||||
".",
|
||||
"../common/data_common",
|
||||
"../common/data_leveldesign",
|
||||
};
|
9
code/ryzom/server/dynamic_scenario_service_default.cfg
Normal file
9
code/ryzom/server/dynamic_scenario_service_default.cfg
Normal file
|
@ -0,0 +1,9 @@
|
|||
|
||||
DelayBeforeStartAct = 1;
|
||||
MaxNpcs = 300;
|
||||
MaxStaticObjects = 200;
|
||||
|
||||
StartCommands +=
|
||||
{
|
||||
"unifiedNetwork.addService ShardUnifier ( address="+SUAddress+" sendId external autoRetry )",
|
||||
};
|
|
@ -1,29 +1,30 @@
|
|||
# Supporting modules and libraries.
|
||||
ADD_SUBDIRECTORY(admin_modules)
|
||||
ADD_SUBDIRECTORY(server_share)
|
||||
ADD_SUBDIRECTORY(ai_share)
|
||||
ADD_SUBDIRECTORY(gameplay_module_lib)
|
||||
ADD_SUBDIRECTORY(pd_lib)
|
||||
|
||||
ADD_SUBDIRECTORY(frontend_service)
|
||||
ADD_SUBDIRECTORY(entities_game_service)
|
||||
# Ryzom Services
|
||||
ADD_SUBDIRECTORY(ai_service)
|
||||
ADD_SUBDIRECTORY(backup_service)
|
||||
ADD_SUBDIRECTORY(dynamic_scenario_service)
|
||||
ADD_SUBDIRECTORY(entities_game_service)
|
||||
ADD_SUBDIRECTORY(frontend_service)
|
||||
ADD_SUBDIRECTORY(gpm_service)
|
||||
ADD_SUBDIRECTORY(input_output_service)
|
||||
|
||||
|
||||
|
||||
# Deprecated, no longer used.
|
||||
#ADD_SUBDIRECTORY(ags_test)
|
||||
#ADD_SUBDIRECTORY(ai_data_service)
|
||||
#ADD_SUBDIRECTORY(entity_view_service)
|
||||
#ADD_SUBDIRECTORY(general_utilities_service)
|
||||
#ADD_SUBDIRECTORY(patchman_service)
|
||||
|
||||
#ags_test
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
#
|
||||
#gpm_service
|
||||
#input_output_service
|
||||
#
|
||||
#log_analyser_service
|
||||
#logger_service
|
||||
#mail_forum_service
|
||||
|
|
|
@ -5660,7 +5660,8 @@ bool CCharacter::onAnimalHungry( uint petIndex, bool justBecameHungry )
|
|||
{
|
||||
// Consume to full satiety (last useful unit is entirely consumed)
|
||||
animal.Satiety = animal.MaxSatiety;
|
||||
nbUnits = (sint)((caloriesNeeded / caloriesPerUnit) + 1);
|
||||
nbUnits = (sint)ceil(caloriesNeeded / caloriesPerUnit);
|
||||
|
||||
}
|
||||
nbItemsLeftToConsume -= nbUnits;
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#include "entity_container.h"
|
||||
#include "game_share/ryzom_entity_id.h"
|
||||
#include "game_share/entity_types.h"
|
||||
#include "../../nelns/welcome_service/welcome_service_itf.h"
|
||||
#include "game_share/welcome_service_itf.h"
|
||||
|
||||
#include <vector>
|
||||
#include <deque>
|
||||
|
|
24
code/ryzom/server/src/gpm_service/CMakeLists.txt
Normal file
24
code/ryzom/server/src/gpm_service/CMakeLists.txt
Normal file
|
@ -0,0 +1,24 @@
|
|||
FILE(GLOB SRC *.cpp *.h)
|
||||
|
||||
ADD_EXECUTABLE(gpm_service ${SRC})
|
||||
|
||||
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/server/src ${LIBXML2_INCLUDE_DIR} ${MYSQL_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} ${NEL_INCLUDE_DIR})
|
||||
TARGET_LINK_LIBRARIES(gpm_service admin_modules
|
||||
game_share
|
||||
server_share
|
||||
${PLATFORM_LINKFLAGS}
|
||||
${LIBXML2_LIBRARIES}
|
||||
${NELMISC_LIBRARY}
|
||||
${NELNET_LIBRARY}
|
||||
${NELPACS_LIBRARY}
|
||||
${NELGEORGES_LIBRARY}
|
||||
${NELLIGO_LIBRARY})
|
||||
IF(WIN32)
|
||||
SET_TARGET_PROPERTIES(gpm_service PROPERTIES
|
||||
LINK_FLAGS "/NODEFAULTLIB:libcmt /SUBSYSTEM:WINDOWS"
|
||||
PROJECT_LABEL "Services: Global Position Manager Service (GPMS)")
|
||||
ENDIF(WIN32)
|
||||
ADD_DEFINITIONS(${LIBXML2_DEFINITIONS})
|
||||
|
||||
INSTALL(TARGETS gpm_service RUNTIME DESTINATION sbin COMPONENT services)
|
||||
|
35
code/ryzom/server/src/input_output_service/CMakeLists.txt
Normal file
35
code/ryzom/server/src/input_output_service/CMakeLists.txt
Normal file
|
@ -0,0 +1,35 @@
|
|||
FILE(GLOB SRC *.cpp *.h)
|
||||
|
||||
LIST(REMOVE_ITEM SRC ${CMAKE_CURRENT_SOURCE_DIR}/bot_chat_manager.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/bot_chat_manager.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ios_chat_log.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ios_chat_log.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ios_chat_log_inline.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ios_pd.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ios_pd.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ios_pd_inline.h)
|
||||
|
||||
ADD_EXECUTABLE(ios_service ${SRC})
|
||||
|
||||
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/server/src ${LIBXML2_INCLUDE_DIR} ${MYSQL_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} ${NEL_INCLUDE_DIR})
|
||||
TARGET_LINK_LIBRARIES(ios_service admin_modules
|
||||
pd_lib
|
||||
game_share
|
||||
server_share
|
||||
${PLATFORM_LINKFLAGS}
|
||||
${LIBXML2_LIBRARIES}
|
||||
${NELMISC_LIBRARY}
|
||||
${NELNET_LIBRARY}
|
||||
${NELPACS_LIBRARY}
|
||||
${NELGEORGES_LIBRARY}
|
||||
${NELLIGO_LIBRARY})
|
||||
IF(WIN32)
|
||||
SET_TARGET_PROPERTIES(ios_service PROPERTIES
|
||||
LINK_FLAGS "/NODEFAULTLIB:libcmt /SUBSYSTEM:WINDOWS"
|
||||
PROJECT_LABEL "Services: Input Ouput Service (IOS)")
|
||||
ENDIF(WIN32)
|
||||
ADD_DEFINITIONS(${LIBXML2_DEFINITIONS})
|
||||
|
||||
INSTALL(TARGETS ios_service RUNTIME DESTINATION sbin COMPONENT services)
|
||||
|
||||
|
31
code/ryzom/server/src/patchman_service/CMakeLists.txt
Normal file
31
code/ryzom/server/src/patchman_service/CMakeLists.txt
Normal file
|
@ -0,0 +1,31 @@
|
|||
FILE(GLOB SRC *.cpp *.h)
|
||||
|
||||
LIST(REMOVE_ITEM SRC ${CMAKE_CURRENT_SOURCE_DIR}/Backup\ 1\ of\ file_repository.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/rr_module_itf.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/rr_module_itf.h)
|
||||
|
||||
ADD_EXECUTABLE(patchman_service ${SRC})
|
||||
|
||||
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/server/src ${LIBXML2_INCLUDE_DIR} ${MYSQL_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} ${NEL_INCLUDE_DIR})
|
||||
TARGET_LINK_LIBRARIES(patchman_service admin_modules
|
||||
game_share
|
||||
server_share
|
||||
${PLATFORM_LINKFLAGS}
|
||||
${LIBXML2_LIBRARIES}
|
||||
${MYSQL_LIBRARIES}
|
||||
${ZLIB_LIBRARIES}
|
||||
${NELMISC_LIBRARY}
|
||||
${NELNET_LIBRARY}
|
||||
${NELPACS_LIBRARY}
|
||||
${NELGEORGES_LIBRARY}
|
||||
${NELLIGO_LIBRARY})
|
||||
IF(WIN32)
|
||||
SET_TARGET_PROPERTIES(patchman_service PROPERTIES
|
||||
LINK_FLAGS "/NODEFAULTLIB:libcmt /SUBSYSTEM:WINDOWS"
|
||||
PROJECT_LABEL "Services: Patch Manager (PMS)")
|
||||
ENDIF(WIN32)
|
||||
ADD_DEFINITIONS(${LIBXML2_DEFINITIONS})
|
||||
|
||||
INSTALL(TARGETS patchman_service RUNTIME DESTINATION sbin COMPONENT services)
|
||||
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
|
||||
// game share
|
||||
#include "game_share/deployment_configuration.h"
|
||||
//#include "game_share/deployment_configuration.h"
|
||||
|
||||
// local
|
||||
#include "module_admin_itf.h"
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
|
||||
// game share
|
||||
#include "game_share/deployment_configuration.h"
|
||||
//#include "game_share/deployment_configuration.h"
|
||||
|
||||
// local
|
||||
#include "module_admin_itf.h"
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
#include "nel/net/module_builder_parts.h"
|
||||
|
||||
// game share
|
||||
#include "game_share/deployment_configuration.h"
|
||||
//#include "game_share/deployment_configuration.h"
|
||||
|
||||
// local
|
||||
#include "module_admin_itf.h"
|
||||
|
|
|
@ -14,5 +14,5 @@
|
|||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#include "game_share/mysql_wrapper.cpp"
|
||||
#include "server_share/mysql_wrapper.cpp"
|
||||
|
||||
|
|
|
@ -36,11 +36,14 @@
|
|||
using namespace std;
|
||||
using namespace NLMISC;
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
// constants & utilities
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
|
||||
// From spa_server_patch_applier.cpp
|
||||
extern void writeVersionFile(const NLMISC::CSString& fileName, uint32 version);
|
||||
extern uint32 readVersionFile(const NLMISC::CSString& fileName);
|
||||
|
||||
NLMISC::CSString getRepositoryIndexFileName(const NLMISC::CSString& repositoryName)
|
||||
{
|
||||
return "repository_"+repositoryName+".idx";
|
||||
|
@ -380,7 +383,7 @@ CRepository::const_iterator CRepository::end() const
|
|||
return _Files.end();
|
||||
}
|
||||
|
||||
void CRepository::fillShortList(TFileInfoVector &files) const
|
||||
void CRepository::fillShortList(PATCHMAN::TFileInfoVector &files) const
|
||||
{
|
||||
// start by clearing out any previous contents in the files vector
|
||||
files.clear();
|
||||
|
|
|
@ -110,7 +110,7 @@ public:
|
|||
iterator end();
|
||||
const_iterator end() const;
|
||||
|
||||
void fillShortList(TFileInfoVector &files) const;
|
||||
void fillShortList(PATCHMAN::TFileInfoVector &files) const;
|
||||
|
||||
private:
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -14,6 +14,8 @@ CXXFLAGS = $(FLAGS_CMN) $(FLAGS_DBG_$(DBG)) \
|
|||
LDFLAGS = $(LD_FLAGS_CMN) \
|
||||
-L$(NEL_PATH)/lib \
|
||||
-L../admin_modules \
|
||||
-L$(RYZOM_COMMON_SRC)/game_share \
|
||||
-lgame_share \
|
||||
-lnelnet \
|
||||
-lnelmisc \
|
||||
-ladmin_modules \
|
||||
|
|
File diff suppressed because it is too large
Load diff
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue