Skip to content

Commit

Permalink
Initial Release on OTLand
Browse files Browse the repository at this point in the history
  • Loading branch information
themaoci committed Aug 8, 2022
1 parent 8784b1d commit f2afba7
Show file tree
Hide file tree
Showing 3,682 changed files with 336,274 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
56 changes: 56 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
cmake_minimum_required(VERSION 2.8)

set(CMAKE_DISABLE_SOURCE_CHANGES ON)
set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)

project(tfs)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

include(cotire)

add_compile_options(-Wall -Werror -pipe -fvisibility=hidden)

set(CMAKE_CXX_FLAGS_PERFORMANCE "${CMAKE_CXX_FLAGS_RELEASE} -march=native")

if (CMAKE_COMPILER_IS_GNUCXX)
add_compile_options(-fno-strict-aliasing)
endif()

include(FindCXX11)
include(FindLTO)

# Find packages.
find_package(Crypto++ REQUIRED)
find_package(PugiXML REQUIRED)
find_package(MySQL)
find_package(Threads)

# Selects LuaJIT if user defines or auto-detected
if(DEFINED USE_LUAJIT AND NOT USE_LUAJIT)
set(FORCE_LUAJIT ${USE_LUAJIT})
else()
find_package(LuaJIT)
set(FORCE_LUAJIT ${LuaJIT_FOUND})
endif()
option(USE_LUAJIT "Use LuaJIT" ${FORCE_LUAJIT})

if(FORCE_LUAJIT)
if(APPLE)
set(CMAKE_EXE_LINKER_FLAGS "-pagezero_size 10000 -image_base 100000000")
endif()
else()
find_package(Lua REQUIRED)
endif()

find_package(Boost 1.53.0 COMPONENTS system filesystem iostreams REQUIRED)

add_subdirectory(src)
add_executable(tfs ${tfs_SRC})

include_directories(${MYSQL_INCLUDE_DIR} ${LUA_INCLUDE_DIR} ${Boost_INCLUDE_DIRS} ${PUGIXML_INCLUDE_DIR} ${Crypto++_INCLUDE_DIR})
target_link_libraries(tfs ${MYSQL_CLIENT_LIBS} ${LUA_LIBRARIES} ${Boost_LIBRARIES} ${Boost_FILESYSTEM_LIBRARY} ${PUGIXML_LIBRARIES} ${Crypto++_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})

set_target_properties(tfs PROPERTIES COTIRE_CXX_PREFIX_HEADER_INIT "src/otpch.h")
set_target_properties(tfs PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE)
cotire(tfs)
118 changes: 118 additions & 0 deletions client_assertions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
----- 21/12/2020 19:26:13 - Lobus (127.0.0.1) -----
Debug Assertion 8.0 Container.h 226
Mon Dec 21 19:24:56 2020
Windows Version: 6.2 build 9200 on 2
Graphic Engine: DirectX9 (2)
Last Packet Types: 100 010 100 020 000 000 000 000 000 000
Last Packet: 129 004 010 001 000 000 016 050 000 001 100 129 125 057 125 007
Player Position: [0,0,0]
Player Name: GOD
Player.cpp 358: exception occurred, reason:
Network.cpp 980: exception occurred (ErrorCode = 0), reason:
Control.cpp 1309: exception occurred (Type = 100), reason:
Communication.cpp 1532: exception occurred (PlayerX = 32129) (PlayerY = 32057), reason:
Communication.cpp 1509: exception occurred (xmin = 0) (ymin = 0), reason:
Communication.cpp 1488: exception occurred (Type = 97) (OldType = 4611), reason:
Communication.cpp 1441: exception occurred (Type = 97) (CreatureID = 268435457), reason:
Objects.cpp 604: exception occurred (Number = 267), reason:
Container.h 226: index out of range (original i: 267, i: 266, min: 1, d: 266)

----- 21/12/2020 19:28:35 - GOD (127.0.0.1) -----
Debug Assertion 8.0 Container.h 226
Mon Dec 21 19:26:16 2020
Windows Version: 6.2 build 9200 on 2
Graphic Engine: DirectX9 (2)
Last Packet Types: 100 010 109 160 109 131 131 109 108 109
Last Packet: 129 004 010 001 000 000 016 050 000 001 100 129 125 057 125 007
Player Position: [0,0,0]
Player Name: GOD
Player.cpp 358: exception occurred, reason:
Network.cpp 980: exception occurred (ErrorCode = 0), reason:
Control.cpp 1309: exception occurred (Type = 100), reason:
Communication.cpp 1532: exception occurred (PlayerX = 32129) (PlayerY = 32057), reason:
Communication.cpp 1509: exception occurred (xmin = 0) (ymin = 0), reason:
Communication.cpp 1488: exception occurred (Type = 97) (OldType = 4611), reason:
Communication.cpp 1441: exception occurred (Type = 97) (CreatureID = 268435457), reason:
Objects.cpp 604: exception occurred (Number = 267), reason:
Container.h 226: index out of range (original i: 267, i: 266, min: 1, d: 266)
Comment:
----- 31/12/2020 01:20:08 - GOD (127.0.0.1) -----
Debug Assertion 8.0 Container.h 226
Thu Dec 31 01:16:51 2020
Windows Version: 6.2 build 9200 on 2
Graphic Engine: DirectX9 (2)
Last Packet Types: 133 180 132 131 106 108 140 160 160 134
Last Packet: 053 001 134 153 034 000 064 000 160 255 255 255 255 007 121 032
Player Position: [32129,32948,10]
Player Name: GOD
Player.cpp 358: exception occurred, reason:
MainFrm.cpp 507: exception occurred (nIDEvent = 1), reason:
Control.cpp 1408: exception occurred, reason:
Map.cpp 912: exception occurred (i = 3), reason:
Objects.cpp 724: exception occurred (Number = 39), reason:
Container.h 226: index out of range (original i: 39, i: 38, min: 1, d: 35)
Comment:
----- 31/12/2020 20:26:22 - Lobus (127.0.0.1) -----
Debug Assertion 8.0 Container.h 226
Thu Dec 31 20:25:12 2020
Windows Version: 6.2 build 9200 on 2
Graphic Engine: DirectX9 (2)
Last Packet Types: 162 142 104 109 104 109 104 109 104 109
Last Packet: 084 000 109 017 126 154 126 007 001 016 126 154 126 007 104 252
Player Position: [32272,32410,7]
Player Name: GOD
Player.cpp 358: exception occurred, reason:
Player.cpp 460: exception occurred, reason:
Control.cpp 1633: exception occurred (MessageType: 0 MaW: 2528050 MoW: 0), reason:
Control.cpp 1628: exception occurred, reason:
Control.cpp 379: exception occurred (Force?1:0 = 0), reason:
MainWindow.cpp 133: exception occurred (Surface = 1), reason:
GUI.cpp 1452: exception occurred (Surface = 1), reason:
MapWindow.cpp 861: exception occurred (Surface = 1), reason:
MapWindow.cpp 548: exception occurred (Obj = 4599), reason:
MapWindow.cpp 1113: exception occurred (posx = 160) (posy = 128), reason:
MapWindow.cpp 961: exception occurred, reason:
MapWindow.cpp 945: exception occurred (Creature->OutfitType = 267) (Creature->CreatureID = 268435456), reason:
Objects.cpp 494: exception occurred (Number = 267) (Flag = 25), reason:
Container.h 226: index out of range (original i: 267, i: 266, min: 1, d: 266)

----- 02/01/2021 14:21:22 - GOD (127.0.0.1) -----
Debug Assertion 8.0 NWin32Exception.cpp 50
Sat Jan 02 14:20:44 2021
Windows Version: 6.2 build 9200 on 2
Graphic Engine: DirectX9 (2)
Last Packet Types: 181 181 180 172 172 162 210 210 141 130
Last Packet: 033 000 180 023 025 000 084 104 101 114 101 032 105 115 032 110
Player Position: [32677,31656,7]
Player Name: GOD
Player.cpp 358: exception occurred, reason:
Player.cpp 460: exception occurred, reason:
Control.cpp 1633: exception occurred (MessageType: 50 MaW: 2497D18 MoW: 0), reason:
Control.cpp 1598: exception occurred (Type = 50), reason:
ConsoleWindow.cpp 2056: exception occurred (RecvMode = 5) (SendMode = 5), reason:
ConsoleWindow.cpp 2102: exception occurred (DebugProgressVariable = 0), reason:
NWin32Exception.cpp 50: win32 exception occurred, reason:
access violation (read attempt at 0000002C)
Comment:
----- 23/03/2022 19:08:57 - Lobus (127.0.0.1) -----
Debug Assertion 8.0 Container.h 226
Wed Mar 23 19:08:33 2022
Windows Version: 6.1 build 7601 on 2 with Service Pack 1
Graphic Engine: DirectX9 (2)
Last Packet Types: 172 172 180 180 131 180 162 162 141 130
Last Packet: 182 012 010 002 000 000 016 050 000 001 100 104 126 038 124 007
Player Position: [32360,31782,7]
Player Name: GOD
Player.cpp 358: exception occurred, reason:
Player.cpp 460: exception occurred, reason:
Control.cpp 1469: exception occurred (MaW: 3542EA0 MoW: 0 ), reason:
Control.cpp 379: exception occurred (Force?1:0 = 0), reason:
MainWindow.cpp 133: exception occurred (Surface = 1), reason:
GUI.cpp 1452: exception occurred (Surface = 1), reason:
MapWindow.cpp 861: exception occurred (Surface = 1), reason:
MapWindow.cpp 548: exception occurred (Obj = 870), reason:
MapWindow.cpp 1113: exception occurred (posx = 224) (posy = 160), reason:
MapWindow.cpp 1105: exception occurred (EffectNumber = 1) (Type = 40), reason:
Objects.cpp 691: exception occurred (Number = 40), reason:
Container.h 226: index out of range (original i: 40, i: 39, min: 1, d: 35)
Comment:
21 changes: 21 additions & 0 deletions cmake/FindCXX11.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
if(__FIND_CXX11_CMAKE__)
return()
endif()
set(__FIND_CXX11_CMAKE__ TRUE)

include(CheckCXXCompilerFlag)
enable_language(CXX)

check_cxx_compiler_flag("-std=c++11" COMPILER_KNOWS_CXX11)
if(COMPILER_KNOWS_CXX11)
add_compile_options(-std=c++11)

# Tested on Mac OS X 10.8.2 with XCode 4.6 Command Line Tools
# Clang requires this to find the correct c++11 headers
check_cxx_compiler_flag("-stdlib=libc++" COMPILER_KNOWS_STDLIB)
if(APPLE AND COMPILER_KNOWS_STDLIB)
add_compile_options(-stdlib=libc++)
endif()
else()
message(FATAL_ERROR "Your C++ compiler does not support C++11.")
endif()
13 changes: 13 additions & 0 deletions cmake/FindCrypto++.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Locate Crypto++ library
# This module defines
# Crypto++_FOUND
# Crypto++_INCLUDE_DIR
# Crypto++_LIBRARIES

find_path(Crypto++_INCLUDE_DIR NAMES cryptopp/cryptlib.h)
find_library(Crypto++_LIBRARIES NAMES cryptopp libcryptopp)

include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Crypto++ DEFAULT_MSG Crypto++_INCLUDE_DIR Crypto++_LIBRARIES)

mark_as_advanced(Crypto++_INCLUDE_DIR Crypto++_LIBRARIES)
14 changes: 14 additions & 0 deletions cmake/FindGMP.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Locate GMP library
# This module defines
# GMP_FOUND
# GMP_INCLUDE_DIR
# GMP_LIBRARIES

find_path(GMP_INCLUDE_DIR NAMES gmp.h)
find_library(GMP_LIBRARIES NAMES gmp libgmp)
find_library(GMPXX_LIBRARIES NAMES gmpxx libgmpxx)

include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GMP DEFAULT_MSG GMP_INCLUDE_DIR GMP_LIBRARIES GMPXX_LIBRARIES)

mark_as_advanced(GMP_INCLUDE_DIR GMP_LIBRARIES GMPXX_LIBRARIES)
12 changes: 12 additions & 0 deletions cmake/FindLTO.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
if(__FIND_LTO_CMAKE__)
return()
endif()
set(__FIND_LTO_CMAKE__ TRUE)

include(CheckCXXCompilerFlag)
enable_language(CXX)

check_cxx_compiler_flag("-flto" COMPILER_KNOWS_LTO)
if(COMPILER_KNOWS_LTO)
add_compile_options(-flto)
endif()
118 changes: 118 additions & 0 deletions cmake/FindLua.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# Locate Lua library
# This module defines
# LUA_EXECUTABLE, if found
# LUA_FOUND, if false, do not try to link to Lua
# LUA_LIBRARIES
# LUA_INCLUDE_DIR, where to find lua.h
# LUA_VERSION_STRING, the version of Lua found (since CMake 2.8.8)
#
# Note that the expected include convention is
# #include "lua.h"
# and not
# #include <lua/lua.h>
# This is because, the lua location is not standardized and may exist
# in locations other than lua/

#=============================================================================
# Copyright 2007-2009 Kitware, Inc.
# Modified to support Lua 5.2 by LuaDist 2012
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
#
# The required version of Lua can be specified using the
# standard syntax, e.g. FIND_PACKAGE(Lua 5.1)
# Otherwise the module will search for any available Lua implementation

# Always search for non-versioned lua first (recommended)
SET(_POSSIBLE_LUA_INCLUDE include include/lua)
SET(_POSSIBLE_LUA_EXECUTABLE lua)
SET(_POSSIBLE_LUA_LIBRARY lua)

# Determine possible naming suffixes (there is no standard for this)
IF(Lua_FIND_VERSION_MAJOR AND Lua_FIND_VERSION_MINOR)
SET(_POSSIBLE_SUFFIXES "${Lua_FIND_VERSION_MAJOR}${Lua_FIND_VERSION_MINOR}" "${Lua_FIND_VERSION_MAJOR}.${Lua_FIND_VERSION_MINOR}" "-${Lua_FIND_VERSION_MAJOR}.${Lua_FIND_VERSION_MINOR}")
ELSE(Lua_FIND_VERSION_MAJOR AND Lua_FIND_VERSION_MINOR)
SET(_POSSIBLE_SUFFIXES "52" "5.2" "-5.2" "51" "5.1" "-5.1")
ENDIF(Lua_FIND_VERSION_MAJOR AND Lua_FIND_VERSION_MINOR)

# Set up possible search names and locations
FOREACH(_SUFFIX ${_POSSIBLE_SUFFIXES})
LIST(APPEND _POSSIBLE_LUA_INCLUDE "include/lua${_SUFFIX}")
LIST(APPEND _POSSIBLE_LUA_EXECUTABLE "lua${_SUFFIX}")
LIST(APPEND _POSSIBLE_LUA_LIBRARY "lua${_SUFFIX}")
ENDFOREACH(_SUFFIX)

# Find the lua executable
FIND_PROGRAM(LUA_EXECUTABLE
NAMES ${_POSSIBLE_LUA_EXECUTABLE}
)

# Find the lua header
FIND_PATH(LUA_INCLUDE_DIR lua.h
HINTS
$ENV{LUA_DIR}
PATH_SUFFIXES ${_POSSIBLE_LUA_INCLUDE}
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt
)

# Find the lua library
FIND_LIBRARY(LUA_LIBRARY
NAMES ${_POSSIBLE_LUA_LIBRARY}
HINTS
$ENV{LUA_DIR}
PATH_SUFFIXES lib64 lib
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/sw
/opt/local
/opt/csw
/opt
)

IF(LUA_LIBRARY)
# include the math library for Unix
IF(UNIX AND NOT APPLE)
FIND_LIBRARY(LUA_MATH_LIBRARY m)
SET( LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}" CACHE STRING "Lua Libraries")
# For Windows and Mac, don't need to explicitly include the math library
ELSE(UNIX AND NOT APPLE)
SET( LUA_LIBRARIES "${LUA_LIBRARY}" CACHE STRING "Lua Libraries")
ENDIF(UNIX AND NOT APPLE)
ENDIF(LUA_LIBRARY)

# Determine Lua version
IF(LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h")
FILE(STRINGS "${LUA_INCLUDE_DIR}/lua.h" lua_version_str REGEX "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua .+\"")

STRING(REGEX REPLACE "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([^\"]+)\".*" "\\1" LUA_VERSION_STRING "${lua_version_str}")
UNSET(lua_version_str)
ENDIF()

INCLUDE(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
# all listed variables are TRUE
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua
REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR
VERSION_VAR LUA_VERSION_STRING)

MARK_AS_ADVANCED(LUA_INCLUDE_DIR LUA_LIBRARIES LUA_LIBRARY LUA_MATH_LIBRARY LUA_EXECUTABLE)

Loading

0 comments on commit f2afba7

Please sign in to comment.