diff options
author | Andrei Karas <akaras@inbox.ru> | 2018-07-30 06:17:29 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2018-07-30 06:17:29 +0300 |
commit | 0db888042bdbc2c1abecd1e4328ccb8ee448bd0e (patch) | |
tree | cf504e4c8ea8c57449b16ee02721a0f4cab6cf46 /src | |
parent | 7425f60930dd286544c12745361d4b6104d1bfa1 (diff) | |
download | manaplus-0db888042bdbc2c1abecd1e4328ccb8ee448bd0e.tar.gz manaplus-0db888042bdbc2c1abecd1e4328ccb8ee448bd0e.tar.bz2 manaplus-0db888042bdbc2c1abecd1e4328ccb8ee448bd0e.tar.xz manaplus-0db888042bdbc2c1abecd1e4328ccb8ee448bd0e.zip |
Split updateprotocol.cpp into files for lower memory usage in compilation.
Diffstat (limited to 'src')
-rw-r--r-- | src/CMakeLists.txt | 6 | ||||
-rw-r--r-- | src/Makefile.am | 6 | ||||
-rw-r--r-- | src/net/eathena/updateprotocol.cpp | 13 | ||||
-rw-r--r-- | src/net/eathena/updateprotocol_main.cpp | 47 | ||||
-rw-r--r-- | src/net/eathena/updateprotocol_main.h | 29 | ||||
-rw-r--r-- | src/net/eathena/updateprotocol_re.cpp | 47 | ||||
-rw-r--r-- | src/net/eathena/updateprotocol_re.h | 29 | ||||
-rw-r--r-- | src/net/eathena/updateprotocol_zero.cpp | 47 | ||||
-rw-r--r-- | src/net/eathena/updateprotocol_zero.h | 29 |
9 files changed, 246 insertions, 7 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1eaecb59b..f7b15bf85 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1750,6 +1750,12 @@ SET(SRCS net/eathena/traderecv.h net/eathena/updateprotocol.cpp net/eathena/updateprotocol.h + net/eathena/updateprotocol_main.cpp + net/eathena/updateprotocol_main.h + net/eathena/updateprotocol_re.cpp + net/eathena/updateprotocol_re.h + net/eathena/updateprotocol_zero.cpp + net/eathena/updateprotocol_zero.h net/eathena/vendinghandler.cpp net/eathena/vendinghandler.h net/eathena/vendingrecv.cpp diff --git a/src/Makefile.am b/src/Makefile.am index 79200aa12..d1f3029b5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2060,6 +2060,12 @@ SRC += gui/windows/bankwindow.cpp \ net/eathena/traderecv.h \ net/eathena/updateprotocol.cpp \ net/eathena/updateprotocol.h \ + net/eathena/updateprotocol_main.cpp \ + net/eathena/updateprotocol_main.h \ + net/eathena/updateprotocol_re.cpp \ + net/eathena/updateprotocol_re.h \ + net/eathena/updateprotocol_zero.cpp \ + net/eathena/updateprotocol_zero.h \ net/eathena/vendinghandler.cpp \ net/eathena/vendinghandler.h \ net/eathena/vendingrecv.cpp \ diff --git a/src/net/eathena/updateprotocol.cpp b/src/net/eathena/updateprotocol.cpp index 26f8c92d2..b7e662e7e 100644 --- a/src/net/eathena/updateprotocol.cpp +++ b/src/net/eathena/updateprotocol.cpp @@ -24,6 +24,9 @@ #include "net/eathena/network.h" #include "net/eathena/protocolout.h" +#include "net/eathena/updateprotocol_main.h" +#include "net/eathena/updateprotocol_re.h" +#include "net/eathena/updateprotocol_zero.h" #include "debug.h" @@ -31,7 +34,6 @@ extern int packetVersion; extern int packetVersionMain; extern int packetVersionRe; extern int packetVersionZero; -extern int serverVersion; extern int evolPacketOffset; extern bool packets_main; extern bool packets_re; @@ -73,10 +75,10 @@ void updateProtocol() #define PACKETS_UPDATE #include "net/protocoloutupdate.h" #include "net/eathena/packetsout.inc" -#include "net/eathena/packetsout_shuffle_main.inc" -#include "net/eathena/packetsout_shuffle_re.inc" -#include "net/eathena/packetsout_shuffle_zero.inc" #undef packet + updateProtocolMain(); + updateProtocolRe(); + updateProtocolZero(); Network *const network = Network::mInstance; if (network != nullptr) { @@ -87,9 +89,6 @@ void updateProtocol() } PACKETSOUT_VOID -PACKETSOUT_SHUFFLE_MAIN_VOID -PACKETSOUT_SHUFFLE_RE_VOID -PACKETSOUT_SHUFFLE_ZERO_VOID PROTOCOLOUTUPDATE_VOID PROTOCOLOUT_VOID diff --git a/src/net/eathena/updateprotocol_main.cpp b/src/net/eathena/updateprotocol_main.cpp new file mode 100644 index 000000000..0a4c3c57f --- /dev/null +++ b/src/net/eathena/updateprotocol_main.cpp @@ -0,0 +1,47 @@ +/* + * The ManaPlus Client + * Copyright (C) 2015-2018 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * 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 + * 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, see <http://www.gnu.org/licenses/>. + */ + +#include "net/eathena/updateprotocol_main.h" + +#include "logger.h" + +#include "net/eathena/network.h" +#include "net/eathena/protocolout.h" + +#include "debug.h" + +extern int packetVersion; +extern bool packets_main; + +namespace EAthena +{ + +void updateProtocolMain() +{ +#include "net/protocoloutupdate.h" +#include "net/eathena/packetsout_shuffle_main.inc" +#undef packet +} + +PACKETSOUT_SHUFFLE_MAIN_VOID +PROTOCOLOUTUPDATE_VOID +PROTOCOLOUT_VOID + +} // namespace EAthena diff --git a/src/net/eathena/updateprotocol_main.h b/src/net/eathena/updateprotocol_main.h new file mode 100644 index 000000000..1ebdd0fc0 --- /dev/null +++ b/src/net/eathena/updateprotocol_main.h @@ -0,0 +1,29 @@ +/* + * The ManaPlus Client + * Copyright (C) 2015-2018 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * 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 + * 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, see <http://www.gnu.org/licenses/>. + */ + +#ifndef NET_EATHENA_UPDATEPROTOCOL_MAIN_H +#define NET_EATHENA_UPDATEPROTOCOL_MAIN_H + +namespace EAthena +{ + void updateProtocolMain(); +} // namespace EAthena + +#endif // NET_EATHENA_UPDATEPROTOCOL_MAIN_H diff --git a/src/net/eathena/updateprotocol_re.cpp b/src/net/eathena/updateprotocol_re.cpp new file mode 100644 index 000000000..6552d3db8 --- /dev/null +++ b/src/net/eathena/updateprotocol_re.cpp @@ -0,0 +1,47 @@ +/* + * The ManaPlus Client + * Copyright (C) 2015-2018 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * 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 + * 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, see <http://www.gnu.org/licenses/>. + */ + +#include "net/eathena/updateprotocol_re.h" + +#include "logger.h" + +#include "net/eathena/network.h" +#include "net/eathena/protocolout.h" + +#include "debug.h" + +extern int packetVersion; +extern bool packets_re; + +namespace EAthena +{ + +void updateProtocolRe() +{ +#include "net/protocoloutupdate.h" +#include "net/eathena/packetsout_shuffle_re.inc" +#undef packet +} + +PACKETSOUT_SHUFFLE_RE_VOID +PROTOCOLOUTUPDATE_VOID +PROTOCOLOUT_VOID + +} // namespace EAthena diff --git a/src/net/eathena/updateprotocol_re.h b/src/net/eathena/updateprotocol_re.h new file mode 100644 index 000000000..57561ef13 --- /dev/null +++ b/src/net/eathena/updateprotocol_re.h @@ -0,0 +1,29 @@ +/* + * The ManaPlus Client + * Copyright (C) 2015-2018 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * 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 + * 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, see <http://www.gnu.org/licenses/>. + */ + +#ifndef NET_EATHENA_UPDATEPROTOCOL_RE_H +#define NET_EATHENA_UPDATEPROTOCOL_RE_H + +namespace EAthena +{ + void updateProtocolRe(); +} // namespace EAthena + +#endif // NET_EATHENA_UPDATEPROTOCOL_RE_H diff --git a/src/net/eathena/updateprotocol_zero.cpp b/src/net/eathena/updateprotocol_zero.cpp new file mode 100644 index 000000000..11511195f --- /dev/null +++ b/src/net/eathena/updateprotocol_zero.cpp @@ -0,0 +1,47 @@ +/* + * The ManaPlus Client + * Copyright (C) 2015-2018 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * 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 + * 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, see <http://www.gnu.org/licenses/>. + */ + +#include "net/eathena/updateprotocol_zero.h" + +#include "logger.h" + +#include "net/eathena/network.h" +#include "net/eathena/protocolout.h" + +#include "debug.h" + +extern int packetVersion; +extern bool packets_zero; + +namespace EAthena +{ + +void updateProtocolZero() +{ +#include "net/protocoloutupdate.h" +#include "net/eathena/packetsout_shuffle_zero.inc" +#undef packet +} + +PACKETSOUT_SHUFFLE_ZERO_VOID +PROTOCOLOUTUPDATE_VOID +PROTOCOLOUT_VOID + +} // namespace EAthena diff --git a/src/net/eathena/updateprotocol_zero.h b/src/net/eathena/updateprotocol_zero.h new file mode 100644 index 000000000..a7edf174c --- /dev/null +++ b/src/net/eathena/updateprotocol_zero.h @@ -0,0 +1,29 @@ +/* + * The ManaPlus Client + * Copyright (C) 2015-2018 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * 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 + * 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, see <http://www.gnu.org/licenses/>. + */ + +#ifndef NET_EATHENA_UPDATEPROTOCOL_ZERO_H +#define NET_EATHENA_UPDATEPROTOCOL_ZERO_H + +namespace EAthena +{ + void updateProtocolZero(); +} // namespace EAthena + +#endif // NET_EATHENA_UPDATEPROTOCOL_ZERO_H |