Browse Source

Partial revert of 65b6861e84d29a8226680312ca4639bd15373bed
Created Small_cleanup branch to merge the mapcache clean up later, after debug.

Atemo 9 years ago
parent
commit
564f4f8100

+ 3 - 14
src/config/const.h

@@ -94,17 +94,6 @@
 	}
 	}
 #endif
 #endif
 
 
-        
-/**
- * Max Refine available to your server
- * Changing this limit requires edits to refine_db.txt
- **/
-#ifdef RENEWAL
-#	define MAX_REFINE 20
-#else
-#	define MAX_REFINE 10
-#endif
-
 /**
 /**
  * Default coordinate for new char
  * Default coordinate for new char
  * That map should be loaded by a mapserv
  * That map should be loaded by a mapserv
@@ -112,13 +101,13 @@
 #ifdef RENEWAL
 #ifdef RENEWAL
     #define MAP_DEFAULT_NAME "iz_int"
     #define MAP_DEFAULT_NAME "iz_int"
     #define MAP_DEFAULT_X 97
     #define MAP_DEFAULT_X 97
-    #define MAP_DEFAULT_Y 90 
+    #define MAP_DEFAULT_Y 90
 #else
 #else
     #define MAP_DEFAULT_NAME "new_zone01"
     #define MAP_DEFAULT_NAME "new_zone01"
     #define MAP_DEFAULT_X 53
     #define MAP_DEFAULT_X 53
     #define MAP_DEFAULT_Y 111
     #define MAP_DEFAULT_Y 111
-#endif        
-        
+#endif
+
 /**
 /**
  * End of File
  * End of File
  **/
  **/

+ 10 - 0
src/map/status.h

@@ -11,6 +11,16 @@ struct homun_data;
 struct mercenary_data;
 struct mercenary_data;
 struct status_change;
 struct status_change;
 
 
+/**
+ * Max Refine available to your server
+ * Changing this limit requires edits to refine_db.txt
+ **/
+#ifdef RENEWAL
+#	define MAX_REFINE 20
+#else
+#	define MAX_REFINE 10
+#endif
+
 /// Refine type
 /// Refine type
 enum refine_type {
 enum refine_type {
 	REFINE_TYPE_ARMOR	= 0,
 	REFINE_TYPE_ARMOR	= 0,

+ 0 - 2
src/tool/CMakeLists.txt

@@ -14,14 +14,12 @@ set( COMMON_HEADERS
 	"${COMMON_SOURCE_DIR}/des.h"
 	"${COMMON_SOURCE_DIR}/des.h"
 	"${COMMON_SOURCE_DIR}/grfio.h"
 	"${COMMON_SOURCE_DIR}/grfio.h"
 	"${COMMON_SOURCE_DIR}/utils.h"
 	"${COMMON_SOURCE_DIR}/utils.h"
-	"${COMMON_SOURCE_DIR}/cli.h"
 	)
 	)
 set( COMMON_SOURCES
 set( COMMON_SOURCES
 	${COMMON_MINI_SOURCES}
 	${COMMON_MINI_SOURCES}
 	"${COMMON_SOURCE_DIR}/des.c"
 	"${COMMON_SOURCE_DIR}/des.c"
 	"${COMMON_SOURCE_DIR}/grfio.c"
 	"${COMMON_SOURCE_DIR}/grfio.c"
 	"${COMMON_SOURCE_DIR}/utils.c"
 	"${COMMON_SOURCE_DIR}/utils.c"
-	"${COMMON_SOURCE_DIR}/cli.c"
 	)
 	)
 set( MAPCACHE_SOURCES
 set( MAPCACHE_SOURCES
 	"${CMAKE_CURRENT_SOURCE_DIR}/mapcache.c"
 	"${CMAKE_CURRENT_SOURCE_DIR}/mapcache.c"

+ 1 - 1
src/tool/Makefile.in

@@ -1,5 +1,5 @@
 
 
-COMMON_OBJ = minicore.o malloc.o showmsg.o strlib.o utils.o des.o grfio.o cli.o
+COMMON_OBJ = minicore.o malloc.o showmsg.o strlib.o utils.o des.o grfio.o
 COMMON_DIR_OBJ = $(COMMON_OBJ:%=../common/obj/%)
 COMMON_DIR_OBJ = $(COMMON_OBJ:%=../common/obj/%)
 COMMON_H = $(shell ls ../common/*.h)
 COMMON_H = $(shell ls ../common/*.h)
 COMMON_INCLUDE = -I../common/
 COMMON_INCLUDE = -I../common/

+ 20 - 21
src/tool/mapcache.c

@@ -9,16 +9,14 @@
 #include <unistd.h>
 #include <unistd.h>
 #endif
 #endif
 
 
-#include "../config/core.h"
-
 #include "../common/cbasetypes.h"
 #include "../common/cbasetypes.h"
 #include "../common/grfio.h"
 #include "../common/grfio.h"
 #include "../common/malloc.h"
 #include "../common/malloc.h"
 #include "../common/mmo.h"
 #include "../common/mmo.h"
 #include "../common/showmsg.h"
 #include "../common/showmsg.h"
 #include "../common/utils.h"
 #include "../common/utils.h"
-#include "../common/cli.h"
 
 
+#include "../config/renewal.h"
 
 
 #define NO_WATER 1000000
 #define NO_WATER 1000000
 
 
@@ -177,28 +175,24 @@ char *remove_extension(char *mapname)
 }
 }
 
 
 // Processes command-line arguments
 // Processes command-line arguments
-int process_args(int argc, char *argv[])
+void process_args(int argc, char *argv[])
 {
 {
 	int i;
 	int i;
 
 
-	for(i = 1; i < argc; i++) {
+	for(i = 0; i < argc; i++) {
 		if(strcmp(argv[i], "-grf") == 0) {
 		if(strcmp(argv[i], "-grf") == 0) {
-                   if(opt_has_next_value(argv[i],i,argc)) strcpy(grf_list_file, argv[++i]);
-                   else return 1;
+			if(++i < argc)
+				strcpy(grf_list_file, argv[i]);
 		} else if(strcmp(argv[i], "-list") == 0) {
 		} else if(strcmp(argv[i], "-list") == 0) {
-                   if(opt_has_next_value(argv[i],i,argc)) strcpy(map_list_file, argv[++i]);
-                   else return 1;
+			if(++i < argc)
+				strcpy(map_list_file, argv[i]);
 		} else if(strcmp(argv[i], "-cache") == 0) {
 		} else if(strcmp(argv[i], "-cache") == 0) {
-                   if(opt_has_next_value(argv[i],i,argc)) strcpy(map_cache_file, argv[++i]);
-                   else return 1;
-		} else if(strcmp(argv[i], "-rebuild") == 0) {
+			if(++i < argc)
+				strcpy(map_cache_file, argv[i]);
+		} else if(strcmp(argv[i], "-rebuild") == 0)
 			rebuild = 1;
 			rebuild = 1;
-                } else {
-                    ShowWarning("Invalid argument given '%s'.\n", argv[i]);
-                    return 1;
-                }
 	}
 	}
-        return 0;
+
 }
 }
 
 
 int do_init(int argc, char** argv)
 int do_init(int argc, char** argv)
@@ -208,12 +202,17 @@ int do_init(int argc, char** argv)
 	struct map_data map;
 	struct map_data map;
 	char name[MAP_NAME_LENGTH_EXT];
 	char name[MAP_NAME_LENGTH_EXT];
 
 
-	/* setup pre-defined, #define-dependant, use -cache option to override this */
-	sprintf(map_cache_file,"db/%smap_cache.dat",DBPATH);
+	/* setup pre-defined, #define-dependant */
+	sprintf(map_cache_file,"db/%s/map_cache.dat",
+#ifdef RENEWAL
+			"re"
+#else
+			"pre-re"
+#endif
+			);
 
 
 	// Process the command-line arguments
 	// Process the command-line arguments
-	if(process_args(argc, argv))
-            return 0;
+	process_args(argc, argv);
 
 
 	ShowStatus("Initializing grfio with %s\n", grf_list_file);
 	ShowStatus("Initializing grfio with %s\n", grf_list_file);
 	grfio_init(grf_list_file);
 	grfio_init(grf_list_file);

+ 1 - 3
vcproj-10/mapcache.vcxproj

@@ -130,7 +130,6 @@
     <ClCompile Include="..\src\common\showmsg.c" />
     <ClCompile Include="..\src\common\showmsg.c" />
     <ClCompile Include="..\src\common\strlib.c" />
     <ClCompile Include="..\src\common\strlib.c" />
     <ClCompile Include="..\src\common\utils.c" />
     <ClCompile Include="..\src\common\utils.c" />
-    <ClCompile Include="..\src\common\cli.c" />
     <ClCompile Include="..\src\tool\mapcache.c" />
     <ClCompile Include="..\src\tool\mapcache.c" />
   </ItemGroup>
   </ItemGroup>
   <ItemGroup>
   <ItemGroup>
@@ -144,8 +143,7 @@
     <ClInclude Include="..\src\common\strlib.h" />
     <ClInclude Include="..\src\common\strlib.h" />
     <ClInclude Include="..\src\common\utils.h" />
     <ClInclude Include="..\src\common\utils.h" />
     <ClInclude Include="..\src\common\winapi.h" />
     <ClInclude Include="..\src\common\winapi.h" />
-    <ClInclude Include="..\src\common\cli.h" />
-    <ClInclude Include="..\src\config\core.h" />
+    <ClInclude Include="..\src\config\renewal.h" />
   </ItemGroup>
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   <ImportGroup Label="ExtensionTargets">

+ 1 - 7
vcproj-10/mapcache.vcxproj.filters

@@ -22,9 +22,6 @@
     <ClCompile Include="..\src\common\utils.c">
     <ClCompile Include="..\src\common\utils.c">
       <Filter>common</Filter>
       <Filter>common</Filter>
     </ClCompile>
     </ClCompile>
-    <ClCompile Include="..\src\common\cli.c">
-      <Filter>common</Filter>
-    </ClCompile>
     <ClCompile Include="..\src\tool\mapcache.c">
     <ClCompile Include="..\src\tool\mapcache.c">
       <Filter>mapcache</Filter>
       <Filter>mapcache</Filter>
     </ClCompile>
     </ClCompile>
@@ -60,10 +57,7 @@
     <ClInclude Include="..\src\common\winapi.h">
     <ClInclude Include="..\src\common\winapi.h">
       <Filter>common</Filter>
       <Filter>common</Filter>
     </ClInclude>
     </ClInclude>
-    <ClInclude Include="..\src\common\cli.h">
-      <Filter>common</Filter>
-    </ClInclude>
-    <ClInclude Include="..\src\config\core.h">
+    <ClInclude Include="..\src\config\renewal.h">
       <Filter>config</Filter>
       <Filter>config</Filter>
     </ClInclude>
     </ClInclude>
   </ItemGroup>
   </ItemGroup>

+ 1 - 3
vcproj-12/mapcache.vcxproj

@@ -134,7 +134,6 @@
     <ClCompile Include="..\src\common\showmsg.c" />
     <ClCompile Include="..\src\common\showmsg.c" />
     <ClCompile Include="..\src\common\strlib.c" />
     <ClCompile Include="..\src\common\strlib.c" />
     <ClCompile Include="..\src\common\utils.c" />
     <ClCompile Include="..\src\common\utils.c" />
-    <ClCompile Include="..\src\common\cli.c" />
     <ClCompile Include="..\src\tool\mapcache.c" />
     <ClCompile Include="..\src\tool\mapcache.c" />
   </ItemGroup>
   </ItemGroup>
   <ItemGroup>
   <ItemGroup>
@@ -148,8 +147,7 @@
     <ClInclude Include="..\src\common\strlib.h" />
     <ClInclude Include="..\src\common\strlib.h" />
     <ClInclude Include="..\src\common\utils.h" />
     <ClInclude Include="..\src\common\utils.h" />
     <ClInclude Include="..\src\common\winapi.h" />
     <ClInclude Include="..\src\common\winapi.h" />
-    <ClInclude Include="..\src\common\cli.h" />
-    <ClInclude Include="..\src\config\core.h" />
+    <ClInclude Include="..\src\config\renewal.h" />
   </ItemGroup>
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   <ImportGroup Label="ExtensionTargets">

+ 1 - 7
vcproj-12/mapcache.vcxproj.filters

@@ -22,9 +22,6 @@
     <ClCompile Include="..\src\common\utils.c">
     <ClCompile Include="..\src\common\utils.c">
       <Filter>common</Filter>
       <Filter>common</Filter>
     </ClCompile>
     </ClCompile>
-    <ClCompile Include="..\src\common\cli.c">
-      <Filter>common</Filter>
-    </ClCompile>
     <ClCompile Include="..\src\tool\mapcache.c">
     <ClCompile Include="..\src\tool\mapcache.c">
       <Filter>mapcache</Filter>
       <Filter>mapcache</Filter>
     </ClCompile>
     </ClCompile>
@@ -60,10 +57,7 @@
     <ClInclude Include="..\src\common\winapi.h">
     <ClInclude Include="..\src\common\winapi.h">
       <Filter>common</Filter>
       <Filter>common</Filter>
     </ClInclude>
     </ClInclude>
-    <ClInclude Include="..\src\common\cli.h">
-      <Filter>common</Filter>
-    </ClInclude>
-    <ClInclude Include="..\src\config\core.h">
+    <ClInclude Include="..\src\config\renewal.h">
       <Filter>config</Filter>
       <Filter>config</Filter>
     </ClInclude>
     </ClInclude>
   </ItemGroup>
   </ItemGroup>

+ 1 - 3
vcproj-13/mapcache.vcxproj

@@ -134,7 +134,6 @@
     <ClCompile Include="..\src\common\showmsg.c" />
     <ClCompile Include="..\src\common\showmsg.c" />
     <ClCompile Include="..\src\common\strlib.c" />
     <ClCompile Include="..\src\common\strlib.c" />
     <ClCompile Include="..\src\common\utils.c" />
     <ClCompile Include="..\src\common\utils.c" />
-    <ClCompile Include="..\src\common\cli.c" />
     <ClCompile Include="..\src\tool\mapcache.c" />
     <ClCompile Include="..\src\tool\mapcache.c" />
   </ItemGroup>
   </ItemGroup>
   <ItemGroup>
   <ItemGroup>
@@ -148,8 +147,7 @@
     <ClInclude Include="..\src\common\strlib.h" />
     <ClInclude Include="..\src\common\strlib.h" />
     <ClInclude Include="..\src\common\utils.h" />
     <ClInclude Include="..\src\common\utils.h" />
     <ClInclude Include="..\src\common\winapi.h" />
     <ClInclude Include="..\src\common\winapi.h" />
-    <ClInclude Include="..\src\common\cli.h" />
-    <ClInclude Include="..\src\config\core.h" />
+    <ClInclude Include="..\src\config\renewal.h" />
   </ItemGroup>
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   <ImportGroup Label="ExtensionTargets">

+ 1 - 7
vcproj-13/mapcache.vcxproj.filters

@@ -22,9 +22,6 @@
     <ClCompile Include="..\src\common\utils.c">
     <ClCompile Include="..\src\common\utils.c">
       <Filter>common</Filter>
       <Filter>common</Filter>
     </ClCompile>
     </ClCompile>
-    <ClCompile Include="..\src\common\cli.c">
-      <Filter>common</Filter>
-    </ClCompile>
     <ClCompile Include="..\src\tool\mapcache.c">
     <ClCompile Include="..\src\tool\mapcache.c">
       <Filter>mapcache</Filter>
       <Filter>mapcache</Filter>
     </ClCompile>
     </ClCompile>
@@ -60,10 +57,7 @@
     <ClInclude Include="..\src\common\winapi.h">
     <ClInclude Include="..\src\common\winapi.h">
       <Filter>common</Filter>
       <Filter>common</Filter>
     </ClInclude>
     </ClInclude>
-    <ClCompile Include="..\src\common\cli.h">
-      <Filter>common</Filter>
-    </ClCompile>
-    <ClInclude Include="..\src\config\core.h">
+	<ClInclude Include="..\src\config\renewal.h">
       <Filter>config</Filter>
       <Filter>config</Filter>
     </ClInclude>
     </ClInclude>
   </ItemGroup>
   </ItemGroup>

+ 1 - 9
vcproj-9/mapcache.vcproj

@@ -270,14 +270,6 @@
 				RelativePath="..\src\common\winapi.h"
 				RelativePath="..\src\common\winapi.h"
 				>
 				>
 			</File>
 			</File>
-                        <File
-				RelativePath="..\src\common\cli.c"
-				>
-			</File>
-                        <File
-				RelativePath="..\src\common\cli.h"
-				>
-			</File>
 		</Filter>
 		</Filter>
 		<Filter
 		<Filter
 			Name="mapcache"
 			Name="mapcache"
@@ -287,7 +279,7 @@
 				>
 				>
 			</File>
 			</File>
 			<File
 			<File
-				RelativePath="..\src\config\core.h"
+				RelativePath="..\src\config\renewal.h"
 				>
 				>
 			</File>
 			</File>
 		</Filter>
 		</Filter>