Changed a massive swap statement for bounds checks
Instead of using a massive block of case statements in serial_utility.cpp, I've added FORMAT_* tags to SerialPacketType as a way to destinguish between type values, at least internally. I can't believe I missed this for so long. I've also added a placeholder for the network API, as I was working on that when I ran into this problem.
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
#include "character_system_api.hpp"
|
||||
#include "map_system_api.hpp"
|
||||
#include "monster_system_api.hpp"
|
||||
#include "network_api.hpp"
|
||||
#include "room_system_api.hpp"
|
||||
#include "waypoint_system_api.hpp"
|
||||
|
||||
@@ -65,6 +66,7 @@ static const luaL_Reg preloadedlibs[] = {
|
||||
{TORTUGA_CHARACTER_SYSTEM_API, openCharacterSystemAPI},
|
||||
{TORTUGA_MAP_SYSTEM_API, openMapSystemAPI},
|
||||
{TORTUGA_MONSTER_SYSTEM_API, openMonsterSystemAPI},
|
||||
{TORTUGA_NETWORK_API, openNetworkAPI},
|
||||
{TORTUGA_ROOM_SYSTEM_API, openRoomSystemAPI},
|
||||
{TORTUGA_WAYPOINT_SYSTEM_API, openWaypointSystemAPI},
|
||||
{NULL, NULL}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
/* Copyright: (c) Kayne Ruse 2013-2015
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any damages
|
||||
* arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any purpose,
|
||||
* including commercial applications, and to alter it and redistribute it
|
||||
* freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you must not
|
||||
* claim that you wrote the original software. If you use this software
|
||||
* in a product, an acknowledgment in the product documentation would be
|
||||
* appreciated but is not required.
|
||||
*
|
||||
* 2. Altered source versions must be plainly marked as such, and must not be
|
||||
* misrepresented as being the original software.
|
||||
*
|
||||
* 3. This notice may not be removed or altered from any source
|
||||
* distribution.
|
||||
*/
|
||||
#include "network_api.hpp"
|
||||
|
||||
static int pumpCharacterUpdate(lua_State* L) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const luaL_Reg networkLib[] = {
|
||||
{"PumpCharacterUpdate", pumpCharacterUpdate},
|
||||
{nullptr, nullptr}
|
||||
};
|
||||
|
||||
LUAMOD_API int openNetworkAPI(lua_State* L) {
|
||||
luaL_newlib(L, networkLib);
|
||||
return 1;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
/* Copyright: (c) Kayne Ruse 2013-2015
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any damages
|
||||
* arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any purpose,
|
||||
* including commercial applications, and to alter it and redistribute it
|
||||
* freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you must not
|
||||
* claim that you wrote the original software. If you use this software
|
||||
* in a product, an acknowledgment in the product documentation would be
|
||||
* appreciated but is not required.
|
||||
*
|
||||
* 2. Altered source versions must be plainly marked as such, and must not be
|
||||
* misrepresented as being the original software.
|
||||
*
|
||||
* 3. This notice may not be removed or altered from any source
|
||||
* distribution.
|
||||
*/
|
||||
#ifndef NETWORKAPI_HPP_
|
||||
#define NETWORKAPI_HPP_
|
||||
|
||||
#include "lua.hpp"
|
||||
|
||||
#define TORTUGA_NETWORK_API "network"
|
||||
LUAMOD_API int openNetworkAPI(lua_State* L);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user