Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv8572
Modified Files:
accounts.cpp accounts.h commands.cpp console_linux.cpp
console_win.cpp globals.cpp globals.h persistentbroker.cpp
wolf.dsp wolfpack.pro
Log Message:
- Improved the Windows console.
- Added missing license info
- Possibly fix linux link issues
Index: accounts.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/accounts.cpp,v
retrieving revision 1.63
retrieving revision 1.64
diff -C2 -d -r1.63 -r1.64
*** accounts.cpp 31 Aug 2003 20:06:42 -0000 1.63
--- accounts.cpp 9 Sep 2003 03:24:15 -0000 1.64
***************
*** 131,136 ****
// No Valid ACL specified
if( !acl_ )
! return false;
!
// No group? No Access!
QMap< QString, QMap< QString, bool > >::iterator groupIter = acl_->groups.find( group );
--- 131,145 ----
// No Valid ACL specified
if( !acl_ )
! {// Let's try harder get one.
! acl_ = cCommands::instance()->getACL( aclName_ ); // loads if there was any specified.
! if ( !acl_ )
! {
! acl_ = cCommands::instance()->getACL( "player" );
! if ( acl_ )
! aclName_ = "player";
! else
! return false;
! }
! }
// No group? No Access!
QMap< QString, QMap< QString, bool > >::iterator groupIter = acl_->groups.find( group );
***************
*** 148,152 ****
return aGroup[ "any" ];
- // TODO: Implement Group any here
return false;
}
--- 157,160 ----
Index: accounts.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/accounts.h,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** accounts.h 31 Aug 2003 20:06:42 -0000 1.29
--- accounts.h 9 Sep 2003 03:24:15 -0000 1.30
***************
*** 60,65 ****
QString login_;
QString password_;
! cAcl *acl_;
! QString aclName_;
QValueVector<P_PLAYER> characters_;
QDateTime lastLogin_;
--- 60,65 ----
QString login_;
QString password_;
! mutable cAcl *acl_;
! mutable QString aclName_;
QValueVector<P_PLAYER> characters_;
QDateTime lastLogin_;
Index: commands.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/commands.cpp,v
retrieving revision 1.199
retrieving revision 1.200
diff -C2 -d -r1.199 -r1.200
*** commands.cpp 8 Sep 2003 10:58:47 -0000 1.199
--- commands.cpp 9 Sep 2003 03:24:15 -0000 1.200
***************
*** 156,160 ****
{
const cElement *childTag = Tag->getChild( i );
-
if( childTag->name() == "group" )
{
--- 156,159 ----
***************
*** 164,168 ****
{
const cElement *groupTag = childTag->getChild( j );
!
if( groupTag->name() == "action" )
{
--- 163,167 ----
{
const cElement *groupTag = childTag->getChild( j );
!
if( groupTag->name() == "action" )
{
***************
*** 180,184 ****
}
}
-
_acls.insert( ACLname, acl );
}
--- 179,182 ----
Index: console_linux.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/console_linux.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** console_linux.cpp 8 Sep 2003 23:38:49 -0000 1.1
--- console_linux.cpp 9 Sep 2003 03:24:15 -0000 1.2
***************
*** 1,2 ****
--- 1,32 ----
+ //==================================================================================
+ //
+ // Wolfpack Emu (WP)
+ // UO Server Emulation Program
+ //
+ // Copyright 1997, 98 by Marcus Rating (Cironian)
+ // Copyright 2001-2003 by holders identified in authors.txt
+ // This program is free software; you can redistribute it and/or modify
+ // it under the terms of the GNU General Public License as published by
+ // the Free Software Foundation; either version 2 of the License, or
+ // (at your option) any later version.
+ //
+ // This program is distributed in the hope that it will be useful,
+ // but WITHOUT ANY WARRANTY; without even the implied warranty of
+ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ // GNU General Public License for more details.
+ //
+ // You should have received a copy of the GNU General Public License
+ // along with this program; if not, write to the Free Software
+ // Foundation, Inc., 59 Temple Palace - Suite 330, Boston, MA 02111-1307, USA.
+ //
+ // * In addition to that license, if you are running this program or modified
+ // * versions of it on a public system you HAVE TO make the complete source of
+ // * the version used by you available or provide people with a location to
+ // * download it.
+ //
+ //
+ //
+ // Wolfpack Homepage: http://wpdev.sf.net/
+ //==================================================================================
#include "console.h"
Index: console_win.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/console_win.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** console_win.cpp 8 Sep 2003 23:59:59 -0000 1.2
--- console_win.cpp 9 Sep 2003 03:24:15 -0000 1.3
***************
*** 1,2 ****
--- 1,31 ----
+ //==================================================================================
+ //
+ // Wolfpack Emu (WP)
+ // UO Server Emulation Program
+ //
+ // Copyright 2001-2003 by holders identified in authors.txt
+ // This program is free software; you can redistribute it and/or modify
+ // it under the terms of the GNU General Public License as published by
+ // the Free Software Foundation; either version 2 of the License, or
+ // (at your option) any later version.
+ //
+ // This program is distributed in the hope that it will be useful,
+ // but WITHOUT ANY WARRANTY; without even the implied warranty of
+ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ // GNU General Public License for more details.
+ //
+ // You should have received a copy of the GNU General Public License
+ // along with this program; if not, write to the Free Software
+ // Foundation, Inc., 59 Temple Palace - Suite 330, Boston, MA 02111-1307, USA.
+ //
+ // * In addition to that license, if you are running this program or modified
+ // * versions of it on a public system you HAVE TO make the complete source of
+ // * the version used by you available or provide people with a location to
+ // * download it.
+ //
+ //
+ //
+ // Wolfpack Homepage: http://wpdev.sf.net/
+ //==================================================================================
// System Includes
***************
*** 71,76 ****
// Set up the fonts we need
ZeroMemory( &lfont, sizeof( LOGFONT ) );
! qstrcpy( lfont.lfFaceName, "Courier" );
font = CreateFontIndirect( &lfont );
// Set the font of our logwindow
--- 100,111 ----
// Set up the fonts we need
ZeroMemory( &lfont, sizeof( LOGFONT ) );
! qstrcpy( lfont.lfFaceName, "Fixedsys" );
font = CreateFontIndirect( &lfont );
+ if ( !font )
+ {
+ ZeroMemory( &lfont, sizeof( LOGFONT ) );
+ qstrcpy( lfont.lfFaceName, "Courier" );
+ font = CreateFontIndirect( &lfont );
+ }
// Set the font of our logwindow
***************
*** 85,93 ****
SendMessage( logWindow, EM_SETCHARFORMAT, SCF_DEFAULT, (LPARAM)&cf );
! SendMessage( logWindow, EM_AUTOURLDETECT, 1, 0 );
SendMessage( logWindow, EM_SETEVENTMASK, 0, ENM_LINK|ENM_MOUSEEVENTS|ENM_KEYEVENTS );
// Create InputWindow
! inputWindow = CreateWindow( "EDIT", 0, ES_LEFT|ES_AUTOHSCROLL|WS_CHILD|WS_VISIBLE|WS_BORDER|WS_TABSTOP, 0, 0, 10, 10, hwnd, 0, appInstance, 0 );
return 0;
--- 120,128 ----
SendMessage( logWindow, EM_SETCHARFORMAT, SCF_DEFAULT, (LPARAM)&cf );
! SendMessage( logWindow, EM_AUTOURLDETECT, TRUE, 0 );
SendMessage( logWindow, EM_SETEVENTMASK, 0, ENM_LINK|ENM_MOUSEEVENTS|ENM_KEYEVENTS );
// Create InputWindow
! inputWindow = CreateWindow( "EDIT", 0, ES_LEFT|ES_AUTOHSCROLL|ES_AUTOVSCROLL|ES_NOHIDESEL|WS_CHILD|WS_VISIBLE|WS_BORDER|WS_TABSTOP, 0, 0, 10, 10, hwnd, 0, appInstance, 0 );
return 0;
***************
*** 165,186 ****
class cGuiThread : public QThread
{
protected:
! virtual void run()
{
! char **argv = (char**)malloc( 1 * sizeof( char* ) );
! argv[0] = "wolfpack.exe";
int argc = 1;
! main( argc, argv );
! free( argv[0] );
! free( argv );
! PostQuitMessage( 0 );
}
};
- cGuiThread *guiThread = 0;
-
int WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd )
{
--- 200,272 ----
class cGuiThread : public QThread
{
+ LPSTR cmdLine;
+ int returnValue_;
+
+ public:
+
+ cGuiThread( LPSTR lpCmdLine ) : cmdLine( lpCmdLine ) {}
+
+ int returnValue() { return returnValue_; }
+
protected:
!
! void run()
{
! QMemArray<pchar> argv( 8 );
! /*
! Since Windows programs don't get passed the command name as the
! first argument, we need to fetch it explicitly.
! */
! static char appFileName[256];
! GetModuleFileNameA( 0, appFileName, sizeof(appFileName) );
int argc = 1;
+ argv[0] = appFileName;
! /*
! Parse the Windows command line string. If an argument begins with a
! double quote, then spaces are considered part of the argument until the
! next double quote. The argument terminates at the second quote. Note
! that this is different from the usual Unix semantics.
! */
! char *p = cmdLine;
! char *p_end = p + strlen(p);
!
! while ( *p && p < p_end )
! {
! while ( isspace( (uchar)*p ) ) // skip whitespace
! p++;
! if (*p == '\0')
! break;
!
! if (*p == '"')
! {
! p++;
! if ( argc >= (int)argv.size()-1 )
! argv.resize( argv.size()*2 );
! argv[argc++] = p;
! while ( (*p != '\0') && (*p != '"') )
! p++;
! } else {
! if ( argc >= (int)argv.size()-1 )
! argv.resize( argv.size()*2 );
! argv[argc++] = p;
! while (*p != '\0' && !isspace( (uchar)*p ) )
! p++;
! }
! if (*p != '\0') {
! *p = '\0';
! p++;
! }
! }
! argv[argc] = 0;
!
! returnValue_ = main( argc, argv.data() );
!
! PostQuitMessage( returnValue_ );
}
};
int WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd )
{
***************
*** 223,228 ****
ShowWindow( mainWindow, SW_NORMAL );
! guiThread = new cGuiThread;
! guiThread->start();
MSG msg;
--- 309,314 ----
ShowWindow( mainWindow, SW_NORMAL );
! cGuiThread guiThread( lpCmdLine );
! guiThread.start();
MSG msg;
***************
*** 236,243 ****
keeprun = 0; // We quit, so let's quit the server too
! guiThread->wait();
! delete guiThread;
!
! return 0;
}
--- 322,329 ----
keeprun = 0; // We quit, so let's quit the server too
! guiThread.wait();
! FreeLibrary( hRiched );
!
! return guiThread.returnValue();
}
***************
*** 257,260 ****
--- 343,371 ----
{
// process \b properly
+ if ( sMessage.contains("\b") )
+ {
+ // Split the message
+ uint pos = sMessage.find("\b");
+ if ( pos > 0 )
+ send( sMessage.right(pos));
+ else
+ {
+ CHARRANGE range;
+ SendMessage( logWindow, EM_EXGETSEL, 0, (LPARAM)&range );
+ range.cpMin -= 1;
+ SendMessage( logWindow, EM_EXSETSEL, 0, (LPARAM)&range );
+ SendMessage( logWindow, EM_REPLACESEL, FALSE, 0 );
+ send( sMessage.left( sMessage.length() - 1 ) );
+ return;
+ }
+ }
+ // Make sure we append, so move to last character.
+ int nLines = SendMessage(logWindow, EM_GETLINECOUNT, 0, 0);
+ LONG nLastChar = SendMessage(logWindow, EM_LINEINDEX, nLines, 0);
+ CHARRANGE range;
+ range.cpMin = nLastChar;
+ range.cpMax = nLastChar;
+ SendMessage( logWindow, EM_EXSETSEL, 0, (LPARAM) &range);
+ // Now it will get right, even if the user had selected sth.
SendMessage( logWindow, EM_REPLACESEL, FALSE, (LPARAM)sMessage.latin1() );
}
Index: globals.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/globals.cpp,v
retrieving revision 1.101
retrieving revision 1.102
diff -C2 -d -r1.101 -r1.102
*** globals.cpp 8 Sep 2003 10:58:47 -0000 1.101
--- globals.cpp 9 Sep 2003 03:24:15 -0000 1.102
***************
*** 78,82 ****
int err, error;
! int keeprun;
//int now;
--- 78,82 ----
int err, error;
! volatile int keeprun;
//int now;
Index: globals.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/globals.h,v
retrieving revision 1.75
retrieving revision 1.76
diff -C2 -d -r1.75 -r1.76
*** globals.h 8 Sep 2003 10:58:47 -0000 1.75
--- globals.h 9 Sep 2003 03:24:16 -0000 1.76
***************
*** 75,79 ****
extern int autosaved, dosavewarning;
extern int err, error;
! extern int keeprun;
//extern int now;
extern int secure; // Secure mode
--- 75,79 ----
extern int autosaved, dosavewarning;
extern int err, error;
! extern volatile int keeprun;
//extern int now;
extern int secure; // Secure mode
Index: persistentbroker.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/persistentbroker.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** persistentbroker.cpp 8 Sep 2003 10:58:47 -0000 1.25
--- persistentbroker.cpp 9 Sep 2003 03:24:16 -0000 1.26
***************
*** 103,106 ****
--- 103,107 ----
connection->exec( "PRAGMA full_column_names = OFF;" );
connection->exec( "PRAGMA show_datatypes = OFF;" );
+ connection->exec( "PRAGMA parser_trace = OFF;" );
}
Index: wolf.dsp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolf.dsp,v
retrieving revision 1.221
retrieving revision 1.222
diff -C2 -d -r1.221 -r1.222
*** wolf.dsp 8 Sep 2003 23:39:25 -0000 1.221
--- wolf.dsp 9 Sep 2003 03:24:16 -0000 1.222
***************
*** 1,23 ****
# Microsoft Developer Studio Project File - Name="wolf" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
! # ** NICHT BEARBEITEN **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=wolf - Win32 Debug
! !MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE
! !MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl
!MESSAGE
!MESSAGE NMAKE /f "wolf.mak".
!MESSAGE
! !MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben
! !MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:
!MESSAGE
!MESSAGE NMAKE /f "wolf.mak" CFG="wolf - Win32 Debug"
!MESSAGE
! !MESSAGE Für die Konfiguration stehen zur Auswahl:
!MESSAGE
! !MESSAGE "wolf - Win32 Release" (basierend auf "Win32 (x86) Console Application")
! !MESSAGE "wolf - Win32 Debug" (basierend auf "Win32 (x86) Console Application")
!MESSAGE
--- 1,23 ----
# Microsoft Developer Studio Project File - Name="wolf" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
! # ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=wolf - Win32 Debug
! !MESSAGE This is not a valid makefile. To build this project using NMAKE,
! !MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "wolf.mak".
!MESSAGE
! !MESSAGE You can specify a configuration when running NMAKE
! !MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "wolf.mak" CFG="wolf - Win32 Debug"
!MESSAGE
! !MESSAGE Possible choices for configuration are:
!MESSAGE
! !MESSAGE "wolf - Win32 Release" (based on "Win32 (x86) Console Application")
! !MESSAGE "wolf - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
***************
*** 26,30 ****
# PROP Scc_ProjName "wolf"
# PROP Scc_LocalPath "."
! CPP=cl.exe
RSC=rc.exe
--- 26,30 ----
# PROP Scc_ProjName "wolf"
# PROP Scc_LocalPath "."
! CPP=xicl6.exe
RSC=rc.exe
***************
*** 50,54 ****
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
! LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt312.lib libmysql.lib /nologo /subsystem:windows /map /machine:I386 /nodefaultlib:"libcmt MSVCRTD" /out:"..\wolfpack.exe" /libpath:"lib\ZThread\lib" /libpath:"lib\Python\lib" /libpath:"lib\bugreport\lib" /libpath:"flatstore\Release" /opt:ref /opt:nowin98
--- 50,54 ----
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
! LINK32=xilink6.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt312.lib libmysql.lib /nologo /subsystem:windows /map /machine:I386 /nodefaultlib:"libcmt MSVCRTD" /out:"..\wolfpack.exe" /libpath:"lib\ZThread\lib" /libpath:"lib\Python\lib" /libpath:"lib\bugreport\lib" /libpath:"flatstore\Release" /opt:ref /opt:nowin98
***************
*** 75,81 ****
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
! LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
! # ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt312.lib /nologo /version:12.9 /subsystem:windows /map /debug /machine:I386 /out:"D:\Wolfpack\wolfpack.exe" /pdbtype:sept /libpath:"lib\bugreport\lib" /libpath:"flatstore\Debug"
# SUBTRACT LINK32 /pdb:none
--- 75,81 ----
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
! LINK32=xilink6.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
! # ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt320.lib /nologo /version:12.9 /subsystem:windows /map /debug /machine:I386 /out:"c:\Wolfpack\wolfpack.exe" /pdbtype:sept /libpath:"lib\bugreport\lib" /libpath:"flatstore\Debug"
# SUBTRACT LINK32 /pdb:none
Index: wolfpack.pro
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolfpack.pro,v
retrieving revision 1.154
retrieving revision 1.155
diff -C2 -d -r1.154 -r1.155
*** wolfpack.pro 8 Sep 2003 10:58:47 -0000 1.154
--- wolfpack.pro 9 Sep 2003 03:24:16 -0000 1.155
***************
*** 184,188 ****
utilsys.cpp \
wolfpack.cpp \
- wpconsole.cpp \
walking.cpp \
world.cpp \
--- 184,187 ----
***************
*** 277,281 ****
languages/wolfpack_ge.ts
! unix:SOURCES += srvparams_unix.cpp
! win32:SOURCES += srvparams_win.cpp
--- 276,283 ----
languages/wolfpack_ge.ts
! unix:SOURCES += srvparams_unix.cpp \
! console_unix.cpp
!
! win32:SOURCES += srvparams_win.cpp \
! console_win.cpp
|