Skip to content

Commit

Permalink
Mapreg saving overhaul
Browse files Browse the repository at this point in the history
Server only saves variables that were changed, not all of them. Special Thanks to Yommy <3~!

Signed-off-by: shennetsind <ind@henn.et>
  • Loading branch information
shennetsind committed May 4, 2013
1 parent 18b1965 commit 3bfadf4
Show file tree
Hide file tree
Showing 3 changed files with 208 additions and 116 deletions.
19 changes: 10 additions & 9 deletions src/common/console.c
Expand Up @@ -337,15 +337,16 @@ int console_parse_timer(int tid, unsigned int tick, int id, intptr_t data) {
return 0;
}
void console_parse_final(void) {
InterlockedDecrement(&console->ptstate);
racond_signal(console->ptcond);

/* wait for thread to close */
rathread_wait(console->pthread, NULL);

racond_destroy(console->ptcond);
ramutex_destroy(console->ptmutex);

if( console->ptstate ) {
InterlockedDecrement(&console->ptstate);
racond_signal(console->ptcond);

/* wait for thread to close */
rathread_wait(console->pthread, NULL);

racond_destroy(console->ptcond);
ramutex_destroy(console->ptmutex);
}
}
void console_parse_init(void) {
cinput.count = 0;
Expand Down
14 changes: 12 additions & 2 deletions src/map/mapreg.h
@@ -1,9 +1,19 @@
// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
// For more information, see LICENCE in the main folder
// Copyright (c) Hercules Dev Team, licensed under GNU GPL.
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams

#ifndef _MAPREG_H_
#define _MAPREG_H_

struct mapreg_save {
int uid;
union {
int i;
char *str;
} u;
bool save;
};

void mapreg_reload(void);
void mapreg_final(void);
void mapreg_init(void);
Expand Down

0 comments on commit 3bfadf4

Please sign in to comment.