summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwizputer <wizputer@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-10 07:18:01 +0000
committerwizputer <wizputer@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-10 07:18:01 +0000
commitf1e841b7781e1b481cc43e861abb96bd5306829b (patch)
tree9c74b6f9325c7769bda3bb8b62e02832c4db2781
parentf7ca47e0e6c972cd826a2bba6380434ae61ce737 (diff)
downloadhercules-f1e841b7781e1b481cc43e861abb96bd5306829b.tar.gz
hercules-f1e841b7781e1b481cc43e861abb96bd5306829b.tar.bz2
hercules-f1e841b7781e1b481cc43e861abb96bd5306829b.tar.xz
hercules-f1e841b7781e1b481cc43e861abb96bd5306829b.zip
compile time fixes
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@533 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog.txt2
-rw-r--r--src/char_sql/GNUmakefile6
-rw-r--r--src/char_sql/Makefile6
-rw-r--r--src/char_sql/char.c25
-rw-r--r--src/login_sql/GNUmakefile4
-rw-r--r--src/login_sql/Makefile4
-rw-r--r--src/login_sql/login.c7
-rw-r--r--src/login_sql/login.h1
-rw-r--r--src/txt-converter/char/GNUmakefile2
-rw-r--r--src/txt-converter/login/GNUmakefile2
10 files changed, 30 insertions, 29 deletions
diff --git a/Changelog.txt b/Changelog.txt
index 4d2e2ba62..2c44bc107 100644
--- a/Changelog.txt
+++ b/Changelog.txt
@@ -1,6 +1,6 @@
Date Added
12/09
- * char-server -UNTESTED- [Wizputer]
+ * char-server changes -UNTESTED- [Wizputer]
* new method for getting GMs [Wizputer]
* Added unique key for Char names [Wizputer]
diff --git a/src/char_sql/GNUmakefile b/src/char_sql/GNUmakefile
index ba54c09d7..0f25010d8 100644
--- a/src/char_sql/GNUmakefile
+++ b/src/char_sql/GNUmakefile
@@ -1,8 +1,8 @@
all: char-server_sql
sql: char-server_sql
-COMMON_OBJ = ../common/core.o ../common/socket.o ../common/timer.o ../common/db.o ../common/malloc.o ../common/showmsg.o ../common/utils.o
-COMMON_H = ../common/core.h ../common/socket.h ../common/timer.h ../common/db.h ../common/malloc.h ../common/showmsg.h ../common/utils.h
+COMMON_OBJ = ../common/core.o ../common/socket.o ../common/timer.o ../common/db.o ../common/malloc.o ../common/showmsg.o ../common/utils.o ../common/nullpo.o
+COMMON_H = ../common/core.h ../common/socket.h ../common/timer.h ../common/db.h ../common/malloc.h ../common/showmsg.h ../common/utils.h ../common/nullpo.h
char-server_sql: char.o inter.o int_party.o int_guild.o int_storage.o int_pet.o strlib.o itemdb.o $(COMMON_OBJ)
$(CC) -o ../../$@ $^ $(LIB_S)
@@ -17,4 +17,4 @@ strlib.o: strlib.c strlib.h ../common/showmsg.h
itemdb.o: itemdb.c itemdb.h ../common/db.h ../common/mmo.h ../common/showmsg.h
clean:
- rm -f *.o ../../char-server_sql
+ rm -f *.o ../../char-server_sql \ No newline at end of file
diff --git a/src/char_sql/Makefile b/src/char_sql/Makefile
index ba54c09d7..0f25010d8 100644
--- a/src/char_sql/Makefile
+++ b/src/char_sql/Makefile
@@ -1,8 +1,8 @@
all: char-server_sql
sql: char-server_sql
-COMMON_OBJ = ../common/core.o ../common/socket.o ../common/timer.o ../common/db.o ../common/malloc.o ../common/showmsg.o ../common/utils.o
-COMMON_H = ../common/core.h ../common/socket.h ../common/timer.h ../common/db.h ../common/malloc.h ../common/showmsg.h ../common/utils.h
+COMMON_OBJ = ../common/core.o ../common/socket.o ../common/timer.o ../common/db.o ../common/malloc.o ../common/showmsg.o ../common/utils.o ../common/nullpo.o
+COMMON_H = ../common/core.h ../common/socket.h ../common/timer.h ../common/db.h ../common/malloc.h ../common/showmsg.h ../common/utils.h ../common/nullpo.h
char-server_sql: char.o inter.o int_party.o int_guild.o int_storage.o int_pet.o strlib.o itemdb.o $(COMMON_OBJ)
$(CC) -o ../../$@ $^ $(LIB_S)
@@ -17,4 +17,4 @@ strlib.o: strlib.c strlib.h ../common/showmsg.h
itemdb.o: itemdb.c itemdb.h ../common/db.h ../common/mmo.h ../common/showmsg.h
clean:
- rm -f *.o ../../char-server_sql
+ rm -f *.o ../../char-server_sql \ No newline at end of file
diff --git a/src/char_sql/char.c b/src/char_sql/char.c
index 6375c2602..396f33d7f 100644
--- a/src/char_sql/char.c
+++ b/src/char_sql/char.c
@@ -19,6 +19,7 @@
#endif
#include "../common/utils.h"
+#include "../common/nullpo.h"
#include <stdio.h>
#include <stdlib.h>
#include <netinet/in.h>
@@ -238,7 +239,7 @@ void read_gm_accounts(int fd, int len) {
return;
int i=0,account_id=0;
- unsigned char level*;
+ unsigned char *level;
if (gm_db)
do_final_gmdb();
@@ -252,8 +253,8 @@ void read_gm_accounts(int fd, int len) {
for(i=0;i<GM_num;i++) {
level = malloc(sizeof(unsigned char));
- *level = RFIFOB(fd,(10+5*(GM_num-1));
- account_id = RFIFOW(fd,(6+5*(GM_num-1))
+ *level = RFIFOB(fd,(10+5*(GM_num-1)));
+ account_id = RFIFOW(fd,(6+5*(GM_num-1)));
numdb_insert(gm_db, account_id, level);
@@ -1234,9 +1235,7 @@ void reply_login_request(int fd, int len) {
// if no map-server already connected, display a message...
if(!servers_connected)
printf("Awaiting maps from map-server.\n");
-
- request_gm_accounts();
-
+
// send USER COUNT PING to login server.
#ifdef DEBUG
printf("Add timer: (send_users_tologin)\n");
@@ -1508,7 +1507,7 @@ void recv_map_names(int fd, int len, unsigned char id) {
memset(server[id].map, 0, sizeof(server[id].map));
- int j = 0;
+ int j = 0,i;
unsigned char buf[16384];
int x;
@@ -1573,6 +1572,8 @@ void auth_request(int fd, int len) {
if (len < 22)
return;
+ int i;
+
#ifdef DEBUG
printf("(AUTH request) auth_fifo search %d %d %d\n", RFIFOL(fd, 2), RFIFOL(fd, 6), RFIFOL(fd, 10));
#endif
@@ -1620,9 +1621,9 @@ void auth_request(int fd, int len) {
RFIFOSKIP(fd,22);
}
-void set_map_users(int fd, int len) {
+void set_map_users(int fd, int len, unsigned char id) {
if (len < 6 || len < RFIFOW(fd,2))
- return 0;
+ return;
if (RFIFOW(fd,4) != server[id].users)
printf("map user: %d\n", RFIFOW(fd,4));
@@ -1636,7 +1637,7 @@ void set_map_users(int fd, int len) {
}
int parse_frommap(int fd) {
- int i = 0, j = 0,len;
+ int i = 0,len;
unsigned char id;
// Sometimes fd=0, and it will cause server crash. Don't know why. :(
@@ -1679,7 +1680,7 @@ int parse_frommap(int fd) {
case 0x2af7: read_gm_accounts(fd,len); break;
case 0x2afa: recv_map_names(fd,len,id); break;
case 0x2afc: auth_request(fd,len); break;
- case 0x2aff: set_map_users(fd,len); break;
+ case 0x2aff: set_map_users(fd,len,id); break;
// char saving
case 0x2b01:
@@ -3094,8 +3095,6 @@ int do_init(int argc, char **argv){
i = add_timer_interval(gettick() + 1000, map_anti_freeze_system, 0, 0, ANTI_FREEZE_INTERVAL * 1000); // checks every X seconds user specifies
}
- read_gm_account();
-
if ( console ) {
set_defaultconsoleparse(parse_console);
start_console();
diff --git a/src/login_sql/GNUmakefile b/src/login_sql/GNUmakefile
index 60d083abd..e941469e1 100644
--- a/src/login_sql/GNUmakefile
+++ b/src/login_sql/GNUmakefile
@@ -2,8 +2,8 @@ all: login-server_sql
sql: login-server_sql
shared_libs=all
-COMMON_OBJ = ../common/core.o ../common/socket.o ../common/timer.o ../common/db.o ../common/malloc.o ../common/showmsg.o
-COMMON_H = ../common/core.h ../common/socket.h ../common/timer.h ../common/mmo.h ../common/version.h ../common/db.h ../common/malloc.h ../common/showmsg.h
+COMMON_OBJ = ../common/core.o ../common/socket.o ../common/timer.o ../common/db.o ../common/malloc.o ../common/showmsg.o ../common/nullpo.o
+COMMON_H = ../common/core.h ../common/socket.h ../common/timer.h ../common/mmo.h ../common/version.h ../common/db.h ../common/malloc.h ../common/showmsg.h ../common/nullpo.h
login-server_sql: login.o char_int.o login_int.o md5calc.o strlib.o $(COMMON_OBJ)
$(CC) -o ../../$@ $^ $(LIB_S)
diff --git a/src/login_sql/Makefile b/src/login_sql/Makefile
index 60d083abd..e941469e1 100644
--- a/src/login_sql/Makefile
+++ b/src/login_sql/Makefile
@@ -2,8 +2,8 @@ all: login-server_sql
sql: login-server_sql
shared_libs=all
-COMMON_OBJ = ../common/core.o ../common/socket.o ../common/timer.o ../common/db.o ../common/malloc.o ../common/showmsg.o
-COMMON_H = ../common/core.h ../common/socket.h ../common/timer.h ../common/mmo.h ../common/version.h ../common/db.h ../common/malloc.h ../common/showmsg.h
+COMMON_OBJ = ../common/core.o ../common/socket.o ../common/timer.o ../common/db.o ../common/malloc.o ../common/showmsg.o ../common/nullpo.o
+COMMON_H = ../common/core.h ../common/socket.h ../common/timer.h ../common/mmo.h ../common/version.h ../common/db.h ../common/malloc.h ../common/showmsg.h ../common/nullpo.h
login-server_sql: login.o char_int.o login_int.o md5calc.o strlib.o $(COMMON_OBJ)
$(CC) -o ../../$@ $^ $(LIB_S)
diff --git a/src/login_sql/login.c b/src/login_sql/login.c
index 1f123ce91..c7e0a79c7 100644
--- a/src/login_sql/login.c
+++ b/src/login_sql/login.c
@@ -118,6 +118,7 @@ struct dbt *online_db;
// GM Database
struct dbt *gm_db;
+int lowest_gm_level = 1;
//-----------------------------------------------------
// Online User Database [Wizputer]
@@ -849,6 +850,9 @@ void sql_config_read(const char *cfgName){ /* Kalaspuff, to get login_db */
else if (strcmpi(w1, "loginlog_db") == 0) {
strcpy(loginlog_db, w2);
}
+ else if(strcmpi(w1,"lowest_gm_level")==0){
+ lowest_gm_level = atoi(w2);
+ }
}
fclose(fp);
printf("reading SQL configuration done.....\n");
@@ -964,9 +968,6 @@ int do_init(int argc,char **argv){
free(online_db);
online_db = numdb_init();
- // Read GMs from table
- read_GMs();
-
printf("The login-server is \033[1;32mready\033[0m (Server is listening on the port %d).\n\n", login_port);
return 0;
diff --git a/src/login_sql/login.h b/src/login_sql/login.h
index 33be44c1d..075284450 100644
--- a/src/login_sql/login.h
+++ b/src/login_sql/login.h
@@ -24,6 +24,7 @@
#include "../common/version.h"
#include "../common/db.h"
#include "../common/timer.h"
+#include "../common/nullpo.h"
#include "strlib.h"
diff --git a/src/txt-converter/char/GNUmakefile b/src/txt-converter/char/GNUmakefile
index 5d4c61535..56723ca5a 100644
--- a/src/txt-converter/char/GNUmakefile
+++ b/src/txt-converter/char/GNUmakefile
@@ -1,7 +1,7 @@
all: char-converter
sql: char-converter
-COMMON_OBJ = ../../common/core.o ../../common/socket.o ../../common/timer.o ../../common/db.o ../../common/malloc.o ../../common/showmsg.o
+COMMON_OBJ = ../../common/core.o ../../common/socket.o ../../common/timer.o ../../common/db.o ../../common/malloc.o
char-converter: char-converter.o strlib.o $(COMMON_OBJ)
$(CC) -o ../../../$@ $^ $(LIB_S)
diff --git a/src/txt-converter/login/GNUmakefile b/src/txt-converter/login/GNUmakefile
index 2d36f709f..9f34e143a 100644
--- a/src/txt-converter/login/GNUmakefile
+++ b/src/txt-converter/login/GNUmakefile
@@ -1,7 +1,7 @@
all: login-converter
sql: login-converter
-COMMON_OBJ = ../../common/core.o ../../common/socket.o ../../common/timer.o ../../common/db.o ../../common/malloc.o ../../common/showmsg.o
+COMMON_OBJ = ../../common/core.o ../../common/socket.o ../../common/timer.o ../../common/db.o ../../common/malloc.o
COMMON_H = ../../common/core.h ../../common/socket.h ../../common/timer.h ../../common/mmo.h ../../common/version.h ../../common/db.h ../../common/malloc.h
login-converter: login-converter.o ../../login_sql/md5calc.o ../../login_sql/strlib.o $(COMMON_OBJ)