--- /dev/null
+cmake_minimum_required (VERSION 2.6)
+project (TINNS C CXX)
+
+set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules")
+
+set (USE_SQLITE3 false CACHE BOOL "Use SQLITE3 instead of MySQL")
+set (USE_MYSQL_INCLUDE_DIR false CACHE BOOL "MySQL includes in ../include/mysql/")
+
+add_definitions (-std=c++0x -W -Wall -march=native -mtune=native -O2 -D_THREAD_SAFE -D_REENTRANT)
+
+if (USE_SQLITE3)
+add_definitions (-DSQLITE3)
+endif (USE_SQLITE3)
+
+if (USE_MYSQL_INCLUDE_DIR)
+add_definitions (-DMYSQL_INC_DIR)
+endif (USE_MYSQL_INCLUDE_DIR)
+
+find_package (RT REQUIRED)
+find_package (PTHREAD REQUIRED)
+find_package (MYSQL REQUIRED)
+find_package (SQLITE3 REQUIRED)
+find_package (PCRE REQUIRED)
+find_package (ZLIB REQUIRED)
+find_package (Lua51 REQUIRED)
+find_package (Boost REQUIRED)
+
+add_subdirectory (server)
+add_subdirectory (tools)
--- /dev/null
+You need cmake to build tinns and its tools.
+
+cmake is part of nearly all linux distributions and you may need to install
+first.
+
+debian/ubuntu: "apt-get install cmake"
+suse (11.0+): "zypper in cmake"
+
+After installing cmake just use it with the CMakeLists.txt file in this
+directory.
+
+"cmake CMakeLists.txt"
+
+cmake will now create a full buildsystem which can be used with the plain
+GNU make and checks for all missing packages/libs. You will get notified if
+something is missing.
+
+"cmake_distclean.sh" removes all cache and temp files from the cmake
+buildsystem.
+
+- Akiko
--- /dev/null
+#!/bin/bash
+
+rm -rf CMakeCache.txt
+rm -rf cmake_install.cmake
+rm -rf Makefile
+rm -rf CMakeFiles/
+rm -rf tools/cmake_install.cmake
+rm -rf tools/Makefile
+rm -rf tools/CMakeFiles/
+rm -rf tools/pak_decompress/cmake_install.cmake
+rm -rf tools/pak_decompress/Makefile
+rm -rf tools/pak_decompress/CMakeFiles/
+rm -rf tools/vfs_viewer/cmake_install.cmake
+rm -rf tools/vfs_viewer/Makefile
+rm -rf tools/vfs_viewer/CMakeFiles/
+rm -rf server/cmake_install.cmake
+rm -rf server/Makefile server/CMakeFiles/
+rm -rf server/src/cmake_install.cmake
+rm -rf server/src/Makefile server/src/CMakeFiles/
+rm -rf server/src/common/cmake_install.cmake
+rm -rf server/src/common/Makefile
+rm -rf server/src/common/CMakeFiles/
+rm -rf server/src/common/config/cmake_install.cmake
+rm -rf server/src/common/config/Makefile
+rm -rf server/src/common/config/CMakeFiles/
+rm -rf server/src/common/console/cmake_install.cmake
+rm -rf server/src/common/console/Makefile
+rm -rf server/src/common/console/CMakeFiles/
+rm -rf server/src/common/filesystem/cmake_install.cmake
+rm -rf server/src/common/filesystem/Makefile
+rm -rf server/src/common/filesystem/CMakeFiles/
+rm -rf server/src/common/misc/cmake_install.cmake
+rm -rf server/src/common/misc/Makefile
+rm -rf server/src/common/misc/CMakeFiles/
+rm -rf server/src/common/netcode/cmake_install.cmake
+rm -rf server/src/common/netcode/Makefile
+rm -rf server/src/common/netcode/CMakeFiles/
+rm -rf server/src/common/regex/cmake_install.cmake
+rm -rf server/src/common/regex/Makefile
+rm -rf server/src/common/regex/CMakeFiles/
+rm -rf server/src/dev-tools/cmake_install.cmake
+rm -rf server/src/dev-tools/Makefile
+rm -rf server/src/dev-tools/CMakeFiles/
+rm -rf server/src/game/cmake_install.cmake
+rm -rf server/src/game/Makefile
+rm -rf server/src/game/CMakeFiles/
+rm -rf server/src/game/decoder/cmake_install.cmake
+rm -rf server/src/game/decoder/Makefile
+rm -rf server/src/game/decoder/CMakeFiles/
+rm -rf server/src/game/def/cmake_install.cmake
+rm -rf server/src/game/def/Makefile
+rm -rf server/src/game/def/CMakeFiles/
+rm -rf server/src/game/gamecommands/cmake_install.cmake
+rm -rf server/src/game/gamecommands/Makefile
+rm -rf server/src/game/gamecommands/CMakeFiles/
+rm -rf server/src/info/cmake_install.cmake
+rm -rf server/src/info/Makefile
+rm -rf server/src/info/CMakeFiles/
+rm -rf server/src/patch/cmake_install.cmake
+rm -rf server/src/patch/Makefile
+rm -rf server/src/patch/CMakeFiles/
+
+# code counter
+
+LOG="/tmp/log.$$"
+LINES=0
+C=0
+
+find|grep "\.c$" >$LOG
+find|grep "\.cpp$" >>$LOG
+find|grep "\.h$" >>$LOG
+find|grep "\.hpp$" >>$LOG
+find|grep "\.sh$" >>$LOG
+find|grep "\.S$" >>$LOG
+find|grep "install-script$" >>$LOG
+find|grep "bar$" >>$LOG
+find|grep "colors$" >>$LOG
+find|grep "function$" >>$LOG
+while read L
+do
+ C=$((C+1))
+ W=$(cat $L|wc -l)
+ S=$(cat $L|wc -c)
+ SIZE=$((SIZE+S))
+ LINES=$((LINES+W))
+done <$LOG
+rm $LOG
+
+echo
+echo "--- REPOSITORY SUMMARY ---"
+echo "source files: $C (c/cpp/h/hpp/sh/S)"
+echo "lines of code: $LINES"
+echo "size of code: $SIZE bytes"
+echo
--- /dev/null
+find_path (MYSQL_INCLUDE_DIR mysql.h /usr/include)
+
+find_library (MYSQL_LIBRARY NAMES mysqlclient PATHS /usr/lib64 /usr/lib)
+
+if (MYSQL_INCLUDE_DIR AND MYSQL_LIBRARY)
+ set (MYSQL_FOUND TRUE)
+endif (MYSQL_INCLUDE_DIR AND MYSQL_LIBRARY)
+
+if (MYSQL_FOUND)
+ if (NOT mysqlclient_FIND_QUIETLY)
+ message (STATUS "Found mysql: ${MYSQL_LIBRARY}")
+ endif (NOT mysqlclient_FIND_QUIETLY)
+else (MYSQL_FOUND)
+ if (mysqlclient_FIND_REQUIRED)
+ message (FATAL ERROR "mysql not found")
+ endif (mysqlclient_FIND_REQUIRED)
+endif (MYSQL_FOUND)
--- /dev/null
+find_path (PCRE_INCLUDE_DIR pcre.h /usr/include)
+
+find_library (PCRE_LIBRARY NAMES pcre PATHS /usr/lib64 /usr/lib)
+
+if (PCRE_INCLUDE_DIR AND PCRE_LIBRARY)
+ set (PCRE_FOUND TRUE)
+endif (PCRE_INCLUDE_DIR AND PCRE_LIBRARY)
+
+if (PCRE_FOUND)
+ if (NOT pcre_FIND_QUIETLY)
+ message (STATUS "Found pcre: ${PCRE_LIBRARY}")
+ endif (NOT pcre_FIND_QUIETLY)
+else (PCRE_FOUND)
+ if (PCRE_FIND_REQUIRED)
+ message (FATAL ERROR "pcre not found")
+ endif (PCRE_FIND_REQUIRED)
+endif (PCRE_FOUND)
--- /dev/null
+find_path (PTHREAD_INCLUDE_DIR pthread.h /usr/include)
+
+find_library (PTHREAD_LIBRARY NAMES pthread PATHS /usr/lib64 /usr/lib)
+
+if (PTHREAD_INCLUDE_DIR AND PTHREAD_LIBRARY)
+ set (PTHREAD_FOUND TRUE)
+endif (PTHREAD_INCLUDE_DIR AND PTHREAD_LIBRARY)
+
+if (PTHREAD_FOUND)
+ if (NOT pthread_FIND_QUIETLY)
+ message (STATUS "Found pthread: ${PTHREAD_LIBRARY}")
+ endif (NOT pthread_FIND_QUIETLY)
+else (PTHREAD_FOUND)
+ if (pthread_FIND_REQUIRED)
+ message (FATAL ERROR "pthread not found")
+ endif (pthread_FIND_REQUIRED)
+endif (PTHREAD_FOUND)
--- /dev/null
+find_path (RT_INCLUDE_DIR time.h /usr/include)
+
+find_library (RT_LIBRARY NAMES rt PATHS /usr/lib64 /usr/lib)
+
+if (RT_INCLUDE_DIR AND RT_LIBRARY)
+ set (RT_FOUND TRUE)
+endif (RT_INCLUDE_DIR AND RT_LIBRARY)
+
+if (RT_FOUND)
+ if (NOT rt_FIND_QUIETLY)
+ message (STATUS "Found librt: ${RT_LIBRARY}")
+ endif (NOT rt_FIND_QUIETLY)
+else (RT_FOUND)
+ if (RT_FIND_REQUIRED)
+ message (FATAL ERROR "librt not found")
+ endif (RT_FIND_REQUIRED)
+endif (RT_FOUND)
--- /dev/null
+find_path (SQLITE3_INCLUDE_DIR sqlite3.h /usr/include)
+
+find_library (SQLITE3_LIBRARY NAMES sqlite3 PATHS /usr/lib64 /usr/lib)
+
+if (SQLITE3_INCLUDE_DIR AND SQLITE3_LIBRARY)
+ set (SQLITE3_FOUND TRUE)
+endif (SQLITE3_INCLUDE_DIR AND SQLITE3_LIBRARY)
+
+if (SQLITE3_FOUND)
+ if (NOT sqlite3_FIND_QUIETLY)
+ message (STATUS "Found sqlite3: ${SQLITE3_LIBRARY}")
+ endif (NOT sqlite3_FIND_QUIETLY)
+else (SQLITE3_FOUND)
+ if (SQLITE3_FIND_REQUIRED)
+ message (FATAL ERROR "sqlite3 not found")
+ endif (sqlite3_FIND_REQUIRED)
+endif (SQLITE3_FOUND)
-So far, if you type\r
- @test 1\r
- A copbot will spawn at your current location\r
-\r
- @test 5 <your local ID> 17\r
- the copbot will put out his weapon and run to a location in Plaza 1, left to medicare (i had to set a static pos here)\r
-\r
- @test 6 <your local ID> 0 4863\r
- the copbot will start shooting you.\r
-\r
- type\r
- @test 5 0 15\r
- and the copbot will put back his weapon and stop fire
\ No newline at end of file
+So far, if you type
+ @test 1
+ A copbot will spawn at your current location
+
+ @test 5 <your local ID> 17
+ the copbot will put out his weapon and run to a location in Plaza 1, left
+to medicare (i had to set a static pos here)
+
+ @test 6 <your local ID> 0 4863
+ the copbot will start shooting you.
+
+ type
+ @test 5 0 15
+ and the copbot will put back his weapon and stop fire
-Current @test commands are:\r
-\r
-@text 1 <npcID> <zoneID> <unknown1> <attackAnim>\r
-- Let <npcID> (use @debug it) attack <zoneID> which can be any npc or player\r
- <npcID>: For non-sql NPCs, you have to remove an offset of 255; So the left security officer\r
- in plaza 1 would have id 48 instead of 303\r
- Unknown 1 is .. unknown yet and seems to be unimportant\r
- attackAnim is the attack "style" of <npcID>. Varies from npc type to npc type\r
-\r
-@test 2 <faction ID> <faction ID>\r
-- Get relation of the 2 given factions. <0 means enemy\r
-\r
-\r
-! IF you find out what an "unknown" value does, tell us !
\ No newline at end of file
+Current @test commands are:
+
+@text 1 <npcID> <zoneID> <unknown1> <attackAnim>
+- Let <npcID> (use @debug it) attack <zoneID> which can be any npc or
+player
+ <npcID>: For non-sql NPCs, you have to remove an offset of 255; So the left
+security officer
+ in plaza 1 would have id 48 instead of 303
+ Unknown 1 is .. unknown yet and seems to be unimportant
+ attackAnim is the attack "style" of <npcID>. Varies from npc type to npc
+type
+
+@test 2 <faction ID> <faction ID>
+- Get relation of the 2 given factions. <0 means enemy
+
+
+! IF you find out what an "unknown" value does, tell us !
-(c) 2009; Written by Namikon for http://www.linux-addicted.net\r
-Last Updated: 15.10.2009\r
-----------------------------------------------------------------\r
-\r
-\r
-Hi. In this document i'll try to explain how the NPC Script-System works in\r
-Neocron.\r
-\r
-First off, we have the .lua scripts, like this one:\r
-\r
---snip--\r
-function DIALOG()\r
- NODE(0)\r
- SAY("Hi there")\r
- ANSWER("Yo man",1)\r
- NODE(1)\r
- SAY("See ya")\r
- ENDDIALOG()\r
-end\r
---snip--\r
-\r
-if you ever worked with lua, you'll notice that NODE, SAY and ANSWER are no\r
-common lua functions.\r
-Those function calls are defined in either missionheader.lua and/or \r
-dialogheader.lua. (Open scripts.def; The last entry tells you if the lua script\r
-defined in that line includes mission or dialogheader).\r
-\r
-So the lua files in the scripts/ folder cannot be executed alone. They HAVE to be\r
-combined with either dialogheader.lua or missionheader.lua.\r
-\r
-You might think now "What the heck, there is only one function, how is this supposed to work?"\r
-Thats correct. Only DIALOG() is defined. I'll explain how that works exactly below.\r
-\r
-First, in order to communicate with your lua script from c/c++ source code, you need\r
-a) An entry function, like main() that can be called from within your source\r
-b) A "callback" function, if the script needs any action to be done, like give and item\r
- let npc die, or whatever.\r
-c) A function to deliver results back to the running script. If you call RAND(2), you might want\r
- to know the result. Would you?\r
-\r
-For a), a function called "lSendAction" is defined\r
-For b), a function called "SendScriptMsg" is defined\r
-For c), a function called "SetResult" is defined\r
-\r
-So now how is this "single function dialog" working:\r
-You see those NODE() lines in the source. NODE is defined as:\r
-\r
---snip--\r
-function NODE(index) \r
- node = index \r
-end\r
---snip--\r
-\r
-"index" is a variable which is set to 0 uppon every script-start (mission/dialogheader, 1st line)\r
-So you have some variables, and a dozen of functions. If you start this lua script, nothing will happen.\r
-\r
-When you click on a NPC, your client sends "use item xx".\r
-The server detects if this id is an npc. If so, the server will send\r
-a packet back that tells the client what lua script to use.\r
-(The short name in scripts.def, not the entire scriptfile name; NCPD for example)\r
-\r
-Right after that packet, another one follows. This packet tells the client to call "lSendAction", with\r
-a given state number. After that, your dialog/mission script is running.\r
-\r
-lSendAction is defined as:\r
---snip--\r
-function lSendAction (in_dialogclass, newstate)\r
-\r
- dialogclass = in_dialogclass\r
- state = newstate\r
- counter = 0\r
- \r
- DIALOG()\r
-end\r
---snip--\r
-\r
-There is our DIALOG() call. So what happens here? Look at the entire script that is processed after \r
-a lSendAction call:\r
-\r
--------\r
-dialogclass, counter, state, node = 0\r
-\r
-function lSendAction (in_dialogclass, newstate)\r
-\r
- dialogclass = in_dialogclass\r
- state = newstate\r
- counter = 0\r
- \r
- DIALOG()\r
-end\r
-\r
-function NODE(index) \r
- node = index \r
-end\r
-\r
-function SAY(text)\r
- if (node==state) then\r
- SendScriptMsg("say", dialogclass,text)\r
- end\r
-end\r
-\r
-function ANSWER(text,resultstate)\r
- if (node==state) then \r
- counter = counter + 1\r
- SendScriptMsg("setanswer", dialogclass,counter,text,resultstate, 0)\r
- end\r
-end\r
-\r
-function ENDDIALOG()\r
- if (node==state) then\r
- SendScriptMsg("enddialog", dialogclass)\r
- end\r
-end\r
-\r
-function DIALOG()\r
- NODE(0)\r
- SAY("Hi there")\r
- ANSWER("Yo man",1)\r
- NODE(1)\r
- SAY("See ya")\r
- ENDDIALOG()\r
-end\r
--------\r
-\r
-- We call "lSendAction(0,0)"\r
-- Global var "state" is now 0 (the other 2 dont matter here)\r
-- NODE() is called:\r
--- NODE(0) is called, global var "node" is now 0\r
--- SAY is called\r
---- if-statement is true, state is equal node, so we call the c/c++ callback function "SendScriptMsg",\r
- Neocron now displays "Hi there" in a dialog screen\r
--- ANSWER() is called\r
---- if-statement is true, state is equal node, so we call the c/c++ callback function "SendScriptMsg",\r
- Neocron now displays "Yo man" in a dialog screen as selectable answer.\r
--- NODE(1) is called, global var "node" is now 1\r
--- SAY is called\r
---- if-statement is now FALSE. state is still 0, but we're at NODE 1, nothing happens\r
--- ENDDIALOG() is called\r
---- if-statement is FALSE. state is still 0, but we're at NODE 1, nothing happens\r
--- function DIALOG ends\r
-- Script execution finished\r
-\r
-Now, if we click the answer, the client sends the answernumber to us. !Nothing else! We ONLY get the\r
-answer number. Thats why in ANSWER the var "counter" is increased every call.\r
-Good for us, at the server is, lua does that for us. We only need to grab the correct answer number.\r
-\r
-Ok, we got the answernumber from our client. We know that our answer had this little 1 after its text.\r
-That 1 tells us which NODE comes next.\r
-So what would we send now to the client? Correct:\r
-\r
-- We call "lSendAction(0,1)"\r
-- Global var "state" is now 1 \r
-- NODE() is called:\r
--- NODE(0) is called, global var "node" is now 0\r
--- SAY is called\r
---- if-statement is false (node = 0, state = 1)\r
--- ANSWER is called\r
---- if-statement is false (node = 0, state = 1)\r
--- NODE(1) is called, global var "node" is now 1\r
--- SAY is called\r
---- if-statement is true, (node = 1, state = 1) so we call the c/c++ callback function "SendScriptMsg",\r
- Neocron now displays "See ya" in a dialog screen\r
--- ENDDIALOG() is called\r
---- if-statement is true, (node = 1, state = 1) so we call the c/c++ callback function "SendScriptMsg",\r
- Neocron closes the NPC dialog\r
--- function DIALOG ends\r
-- Script execution finished\r
-\r
-So far, thats how "normal" lua scripts work. Nothing special about that.\r
-But NPC scripts are far more complex; KK wrote BlackJack and roulette games for NC2\r
-in lua. They handle epic runs, let NPCs attack and give you tons of nice items on christmas\r
-if you where a good boy(girl) last year.\r
-\r
-So far, i know that the packet where you return a node Number can be extended with\r
-and u32 (?) value; And i think this could be either a hidden result, or \r
-a defined seed for an rand() generator, not sure about that yet.\r
-\r
-For takeitem/giveitem stuff, the script stops right after it called SendScriptMsg and returns\r
-to our callback function. We have now the time to give / take any item,\r
-check faction standings,... and return the result to our script before it continues.\r
-\r
-The client does *NOT* perform any action besides SAY.. and ANSWER.. stuff.\r
-All actions that lead to an result are performed by the server.\r
-Lets take TAKEITEM(90) as example and extend our basic script from above:\r
-\r
---snip\r
-<old script here>\r
-\r
-function TAKEITEM(itemtype)\r
- if (node==state) then\r
- SendScriptMsg("takeitem", dialogclass,itemtype)\r
- end\r
-end\r
-\r
-NODE (10)\r
- TAKEITEM(90)\r
- if (result==1) then\r
- SAY("Thanks for that copbot rifle")\r
- ANSWER("You're welcome")\r
- else\r
- SAY("You dont have a Copbot rifle")\r
- ANSWER("Too bad for you")\r
- end\r
-ENDDIALOG();\r
-\r
---snip\r
-\r
-You should already know what happens here, so i wont explain it again.\r
-Remember: \r
-- We choose the answer\r
-- The server processes the destination node\r
-- And sends us the Nodenumber back, together with results, if any.\r
-\r
-So, when the client reaches TAKEITEM(x), he will NOT take your item away,\r
-he will stop the script for a moment, like we do it on the server.\r
-\r
-Difference: The client looks inside the last lSendAction packet\r
-if there are any results. If so, he will call SendResults() and push\r
-these value(s) back to the script.\r
-You see, result is now set to the same value as it where on the server.\r
-\r
-One word about those values:\r
-They ARE integer. But KK decided that it would be cool to have negative AND positive\r
-results, they choose float as format.\r
-\r
-\r
-This RAW packet could be a positive answer to our TAKEITEM command:\r
-0E 03 91 00 1F 01 00 1A 0A 00 01 00 00 80 3F\r
-Which splits up as:\r
-0E - Packetlen\r
-03 - Commandset 0x03\r
-09 00 - UDP ID\r
-1F - Subcommand 1F\r
-01 00 - Local PlayerID\r
-1A - SubSubcommand Dialog\r
-0A 00 - NODE ID to be processed next (u16 format)\r
-01 - How many values will follow?\r
-00 00 80 3F - 1.0 in float\r
-\r
-\r
-===== !! THEORY !! =====\r
-===== !! This part is NOT verified yet !! =====\r
-\r
-If you have more than one result, for example if you take away 2 or more items,\r
-they are attached to the packet in the same order as they appear.\r
-If the first result is 0 and the second is 1,\r
-it would be like this:\r
-\r
-0E - Packetlen\r
-03 - Commandset 0x03\r
-09 00 - UDP ID\r
-1F - Subcommand 1F\r
-01 00 - Local PlayerID\r
-1A - SubSubcommand Dialog\r
-0A 00 - NODE ID to be processed next (u16 format)\r
-02 - How many values will follow?\r
-00 00 00 00 - 0.0 in float (and any other format too i know...)\r
-00 00 80 3F - 1.0 in float\r
-======================================= \r
-\r
-PM me if you can proof that this is correct, thanks!\r
-\r
-END\r
-\r
-If you find any typos, errors, whatever, please tell me over PM\r
-on linux-addicted.net.\r
-\r
--Namikon\r
-\r
-================== PACKETS BELOW ==================\r
-The packets are defined as:\r
-\r
-\r
-"LOADSCRIPT" Packet (After USE) // SERVER > CLIENT\r
-----\r
-<u8> Len\r
-<u8> 0x03\r
-<u16> UDP ID\r
-<u8> 0x1F\r
-<u16> Players ZoneID\r
-<u8> 0x18\r
-<u32> NPCs WorldID\r
-<u32> Some 32-bit value that changes everytime you click on an npc. We have *no* clue what this does :)\r
-<u32> 0x00000000\r
-<u8>* Name of the script \0 terminated\r
-----\r
-\r
-"lSendAction" Packet // SERVER > CLIENT // Server tells client which node next, and what results to use\r
-----\r
-<u8> Len\r
-<u8> 0x03\r
-<u16> UDP ID\r
-<u8> 0x1F\r
-<u16> Players ZoneID\r
-<u8> 0x1a\r
-<u16> NodeID\r
-<u8> # of Values to follow (float values)\r
-----\r
-\r
-"ANSWER x" // CLIENT > SERVER\r
-----\r
-<u8> Len\r
-<u8> 0x03\r
-<u16> UDP ID\r
-<u8> 0x1F\r
-<u16> Players ZoneID\r
-<u8> 0x1a\r
-<u8> AnswerNr\r
-----\r
+(c) 2009; Written by Namikon for http://www.linux-addicted.net
+Last Updated: 15.10.2009
+----------------------------------------------------------------
+
+
+Hi. In this document i'll try to explain how the NPC Script-System works in
+Neocron.
+
+First off, we have the .lua scripts, like this one:
+
+--snip--
+function DIALOG()
+ NODE(0)
+ SAY("Hi there")
+ ANSWER("Yo man",1)
+ NODE(1)
+ SAY("See ya")
+ ENDDIALOG()
+end
+--snip--
+
+if you ever worked with lua, you'll notice that NODE, SAY and ANSWER are no
+common lua functions.
+Those function calls are defined in either missionheader.lua and/or
+dialogheader.lua. (Open scripts.def; The last entry tells you if the lua
+script
+defined in that line includes mission or dialogheader).
+
+So the lua files in the scripts/ folder cannot be executed alone. They HAVE
+to be
+combined with either dialogheader.lua or missionheader.lua.
+
+You might think now "What the heck, there is only one function, how is this
+supposed to work?"
+Thats correct. Only DIALOG() is defined. I'll explain how that works exactly
+below.
+
+First, in order to communicate with your lua script from c/c++ source code,
+you need
+a) An entry function, like main() that can be called from within your
+source
+b) A "callback" function, if the script needs any action to be done, like
+give and item
+ let npc die, or whatever.
+c) A function to deliver results back to the running script. If you call
+RAND(2), you might want
+ to know the result. Would you?
+
+For a), a function called "lSendAction" is defined
+For b), a function called "SendScriptMsg" is defined
+For c), a function called "SetResult" is defined
+
+So now how is this "single function dialog" working:
+You see those NODE() lines in the source. NODE is defined as:
+
+--snip--
+function NODE(index)
+ node = index
+end
+--snip--
+
+"index" is a variable which is set to 0 uppon every script-start
+(mission/dialogheader, 1st line)
+So you have some variables, and a dozen of functions. If you start this lua
+script, nothing will happen.
+
+When you click on a NPC, your client sends "use item xx".
+The server detects if this id is an npc. If so, the server will send
+a packet back that tells the client what lua script to use.
+(The short name in scripts.def, not the entire scriptfile name; NCPD for
+example)
+
+Right after that packet, another one follows. This packet tells the client to
+call "lSendAction", with
+a given state number. After that, your dialog/mission script is running.
+
+lSendAction is defined as:
+--snip--
+function lSendAction (in_dialogclass, newstate)
+
+ dialogclass = in_dialogclass
+ state = newstate
+ counter = 0
+
+ DIALOG()
+end
+--snip--
+
+There is our DIALOG() call. So what happens here? Look at the entire script
+that is processed after
+a lSendAction call:
+
+-------
+dialogclass, counter, state, node = 0
+
+function lSendAction (in_dialogclass, newstate)
+
+ dialogclass = in_dialogclass
+ state = newstate
+ counter = 0
+
+ DIALOG()
+end
+
+function NODE(index)
+ node = index
+end
+
+function SAY(text)
+ if (node==state) then
+ SendScriptMsg("say", dialogclass,text)
+ end
+end
+
+function ANSWER(text,resultstate)
+ if (node==state) then
+ counter = counter + 1
+ SendScriptMsg("setanswer", dialogclass,counter,text,resultstate, 0)
+ end
+end
+
+function ENDDIALOG()
+ if (node==state) then
+ SendScriptMsg("enddialog", dialogclass)
+ end
+end
+
+function DIALOG()
+ NODE(0)
+ SAY("Hi there")
+ ANSWER("Yo man",1)
+ NODE(1)
+ SAY("See ya")
+ ENDDIALOG()
+end
+-------
+
+- We call "lSendAction(0,0)"
+- Global var "state" is now 0 (the other 2 dont matter here)
+- NODE() is called:
+-- NODE(0) is called, global var "node" is now 0
+-- SAY is called
+--- if-statement is true, state is equal node, so we call the c/c++ callback
+function "SendScriptMsg",
+ Neocron now displays "Hi there" in a dialog screen
+-- ANSWER() is called
+--- if-statement is true, state is equal node, so we call the c/c++ callback
+function "SendScriptMsg",
+ Neocron now displays "Yo man" in a dialog screen as selectable answer.
+-- NODE(1) is called, global var "node" is now 1
+-- SAY is called
+--- if-statement is now FALSE. state is still 0, but we're at NODE 1, nothing
+happens
+-- ENDDIALOG() is called
+--- if-statement is FALSE. state is still 0, but we're at NODE 1, nothing
+happens
+-- function DIALOG ends
+- Script execution finished
+
+Now, if we click the answer, the client sends the answernumber to us.
+!Nothing else! We ONLY get the
+answer number. Thats why in ANSWER the var "counter" is increased every
+call.
+Good for us, at the server is, lua does that for us. We only need to grab the
+correct answer number.
+
+Ok, we got the answernumber from our client. We know that our answer had this
+little 1 after its text.
+That 1 tells us which NODE comes next.
+So what would we send now to the client? Correct:
+
+- We call "lSendAction(0,1)"
+- Global var "state" is now 1
+- NODE() is called:
+-- NODE(0) is called, global var "node" is now 0
+-- SAY is called
+--- if-statement is false (node = 0, state = 1)
+-- ANSWER is called
+--- if-statement is false (node = 0, state = 1)
+-- NODE(1) is called, global var "node" is now 1
+-- SAY is called
+--- if-statement is true, (node = 1, state = 1) so we call the c/c++ callback
+function "SendScriptMsg",
+ Neocron now displays "See ya" in a dialog screen
+-- ENDDIALOG() is called
+--- if-statement is true, (node = 1, state = 1) so we call the c/c++ callback
+function "SendScriptMsg",
+ Neocron closes the NPC dialog
+-- function DIALOG ends
+- Script execution finished
+
+So far, thats how "normal" lua scripts work. Nothing special about that.
+But NPC scripts are far more complex; KK wrote BlackJack and roulette games
+for NC2
+in lua. They handle epic runs, let NPCs attack and give you tons of nice
+items on christmas
+if you where a good boy(girl) last year.
+
+So far, i know that the packet where you return a node Number can be extended
+with
+and u32 (?) value; And i think this could be either a hidden result, or
+a defined seed for an rand() generator, not sure about that yet.
+
+For takeitem/giveitem stuff, the script stops right after it called
+SendScriptMsg and returns
+to our callback function. We have now the time to give / take any item,
+check faction standings,... and return the result to our script before it
+continues.
+
+The client does *NOT* perform any action besides SAY.. and ANSWER.. stuff.
+All actions that lead to an result are performed by the server.
+Lets take TAKEITEM(90) as example and extend our basic script from above:
+
+--snip
+<old script here>
+
+function TAKEITEM(itemtype)
+ if (node==state) then
+ SendScriptMsg("takeitem", dialogclass,itemtype)
+ end
+end
+
+NODE (10)
+ TAKEITEM(90)
+ if (result==1) then
+ SAY("Thanks for that copbot rifle")
+ ANSWER("You're welcome")
+ else
+ SAY("You dont have a Copbot rifle")
+ ANSWER("Too bad for you")
+ end
+ENDDIALOG();
+
+--snip
+
+You should already know what happens here, so i wont explain it again.
+Remember:
+- We choose the answer
+- The server processes the destination node
+- And sends us the Nodenumber back, together with results, if any.
+So, when the client reaches TAKEITEM(x), he will NOT take your item away,
+he will stop the script for a moment, like we do it on the server.
+
+Difference: The client looks inside the last lSendAction packet
+if there are any results. If so, he will call SendResults() and push
+these value(s) back to the script.
+You see, result is now set to the same value as it where on the server.
+
+One word about those values:
+They ARE integer. But KK decided that it would be cool to have negative AND
+positive
+results, they choose float as format.
+
+
+This RAW packet could be a positive answer to our TAKEITEM command:
+0E 03 91 00 1F 01 00 1A 0A 00 01 00 00 80 3F
+Which splits up as:
+0E - Packetlen
+03 - Commandset 0x03
+09 00 - UDP ID
+1F - Subcommand 1F
+01 00 - Local PlayerID
+1A - SubSubcommand Dialog
+0A 00 - NODE ID to be processed next (u16 format)
+01 - How many values will follow?
+00 00 80 3F - 1.0 in float
+
+
+===== !! THEORY !! =====
+===== !! This part is NOT verified yet !! =====
+
+If you have more than one result, for example if you take away 2 or more
+items,
+they are attached to the packet in the same order as they appear.
+If the first result is 0 and the second is 1,
+it would be like this:
+
+0E - Packetlen
+03 - Commandset 0x03
+09 00 - UDP ID
+1F - Subcommand 1F
+01 00 - Local PlayerID
+1A - SubSubcommand Dialog
+0A 00 - NODE ID to be processed next (u16 format)
+02 - How many values will follow?
+00 00 00 00 - 0.0 in float (and any other format too i know...)
+00 00 80 3F - 1.0 in float
+=======================================
+
+PM me if you can proof that this is correct, thanks!
+
+END
+
+If you find any typos, errors, whatever, please tell me over PM
+on linux-addicted.net.
+
+-Namikon
+
+================== PACKETS BELOW ==================
+The packets are defined as:
+
+
+"LOADSCRIPT" Packet (After USE) // SERVER > CLIENT
+----
+<u8> Len
+<u8> 0x03
+<u16> UDP ID
+<u8> 0x1F
+<u16> Players ZoneID
+<u8> 0x18
+<u32> NPCs WorldID
+<u32> Some 32-bit value that changes everytime you click on an npc. We have
+*no* clue what this does :)
+<u32> 0x00000000
+<u8>* Name of the script \0 terminated
+----
+
+"lSendAction" Packet // SERVER > CLIENT // Server tells client which node
+next, and what results to use
+----
+<u8> Len
+<u8> 0x03
+<u16> UDP ID
+<u8> 0x1F
+<u16> Players ZoneID
+<u8> 0x1a
+<u16> NodeID
+<u8> # of Values to follow (float values)
+----
+
+"ANSWER x" // CLIENT > SERVER
+----
+<u8> Len
+<u8> 0x03
+<u16> UDP ID
+<u8> 0x1F
+<u16> Players ZoneID
+<u8> 0x1a
+<u8> AnswerNr
+----
+++ /dev/null
-trunk/src/developing -> newest branch
-trunk/src/stable -> this is going to be a stable branch
-trunk/src/testing -> this is for testing, right now it uses an older HawkNL
-trunk/docs -> this documentation stuff
-trunk/tools -> contains some tools useful for the server and the server files
-trunk/datapack -> contains missing files, modified files and patches
--- /dev/null
+------------------------------------------------------------------------
+r162 | Akiko | 2012-10-05 13:20:21 +0200 (Fri, 05 Oct 2012) | 3 lines
+Changed paths:
+ M /branch/Akikos_tinns_with_cmake/server/src/common/netcode.cpp
+
+- fixed a missing include (compiles now with GCC 4.7.2)
+
+
+------------------------------------------------------------------------
+r161 | Namikon | 2012-06-03 01:59:16 +0200 (Sun, 03 Jun 2012) | 1 line
+Changed paths:
+ M /branch/Akikos_tinns_with_cmake/CMakeLists.txt
+
+changed set boost to the real require boost...
+------------------------------------------------------------------------
+r160 | Namikon | 2012-06-03 01:45:30 +0200 (Sun, 03 Jun 2012) | 1 line
+Changed paths:
+ A /branch/Akikos_tinns_with_cmake/server/database/infoDB.s3db
+
+SQLite Database template added
+------------------------------------------------------------------------
+r159 | Namikon | 2012-06-03 01:44:37 +0200 (Sun, 03 Jun 2012) | 2 lines
+Changed paths:
+ M /branch/Akikos_tinns_with_cmake/server/conf/infoserver.conf
+ M /branch/Akikos_tinns_with_cmake/server/src/game/CMakeLists.txt
+ M /branch/Akikos_tinns_with_cmake/server/src/info/configtemplate.h
+
+prepared infoserver for SQLite stuff
+fixed gameserver makefile to find lua.h directory
+------------------------------------------------------------------------
+r158 | Namikon | 2012-06-03 00:53:36 +0200 (Sun, 03 Jun 2012) | 2 lines
+Changed paths:
+ M /branch/Akikos_tinns_with_cmake/CMakeLists.txt
+
+Fixed lua engine for lua versions 5.1+
+changed CMakeLists.txt to include the boost libraries for later use
+------------------------------------------------------------------------
+r157 | Namikon | 2012-06-03 00:52:59 +0200 (Sun, 03 Jun 2012) | 2 lines
+Changed paths:
+ M /branch/Akikos_tinns_with_cmake/server/src/game/lua_engine.cpp
+
+Fixed lua engine for lua versions 5.1+
+changed CMakeLists.txt to include the boost libraries for later use
+------------------------------------------------------------------------
+r156 | Akiko | 2011-08-23 12:25:17 +0200 (Tue, 23 Aug 2011) | 7 lines
+Changed paths:
+ M /branch/Akikos_tinns_with_cmake/server/src/common/CMakeLists.txt
+ D /branch/Akikos_tinns_with_cmake/server/src/common/config
+ A /branch/Akikos_tinns_with_cmake/server/src/common/config.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/common/config.h (from /branch/Akikos_tinns_with_cmake/server/src/include/config.h:155)
+ D /branch/Akikos_tinns_with_cmake/server/src/common/console
+ A /branch/Akikos_tinns_with_cmake/server/src/common/console.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/common/console.h (from /branch/Akikos_tinns_with_cmake/server/src/include/console.h:155)
+ D /branch/Akikos_tinns_with_cmake/server/src/common/filesystem
+ A /branch/Akikos_tinns_with_cmake/server/src/common/filesystem.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/common/filesystem.h (from /branch/Akikos_tinns_with_cmake/server/src/include/filesystem.h:155)
+ A /branch/Akikos_tinns_with_cmake/server/src/common/message.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/common/message.h (from /branch/Akikos_tinns_with_cmake/server/src/include/message.h:155)
+ D /branch/Akikos_tinns_with_cmake/server/src/common/misc
+ A /branch/Akikos_tinns_with_cmake/server/src/common/misc.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/common/misc.h (from /branch/Akikos_tinns_with_cmake/server/src/include/misc.h:155)
+ D /branch/Akikos_tinns_with_cmake/server/src/common/netcode
+ A /branch/Akikos_tinns_with_cmake/server/src/common/netcode.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/common/netcode.h
+ D /branch/Akikos_tinns_with_cmake/server/src/common/regex
+ A /branch/Akikos_tinns_with_cmake/server/src/common/regex++.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/common/regex++.h (from /branch/Akikos_tinns_with_cmake/server/src/include/regex++.h:155)
+ M /branch/Akikos_tinns_with_cmake/server/src/game/CMakeLists.txt
+ M /branch/Akikos_tinns_with_cmake/server/src/game/decoder/main.h
+ M /branch/Akikos_tinns_with_cmake/server/src/game/def/main.h
+ M /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/main.h
+ M /branch/Akikos_tinns_with_cmake/server/src/game/include/accounts.h
+ M /branch/Akikos_tinns_with_cmake/server/src/game/include/chars.h
+ M /branch/Akikos_tinns_with_cmake/server/src/game/main.h
+ M /branch/Akikos_tinns_with_cmake/server/src/game/worlds.cpp
+ D /branch/Akikos_tinns_with_cmake/server/src/include/config.h
+ D /branch/Akikos_tinns_with_cmake/server/src/include/connection-tcp.h
+ D /branch/Akikos_tinns_with_cmake/server/src/include/connection-udp.h
+ D /branch/Akikos_tinns_with_cmake/server/src/include/console.h
+ D /branch/Akikos_tinns_with_cmake/server/src/include/filesystem.h
+ D /branch/Akikos_tinns_with_cmake/server/src/include/message.h
+ D /branch/Akikos_tinns_with_cmake/server/src/include/misc.h
+ D /branch/Akikos_tinns_with_cmake/server/src/include/netcode.h
+ D /branch/Akikos_tinns_with_cmake/server/src/include/regex++.h
+ D /branch/Akikos_tinns_with_cmake/server/src/include/serversocket.h
+ M /branch/Akikos_tinns_with_cmake/server/src/info/CMakeLists.txt
+ M /branch/Akikos_tinns_with_cmake/server/src/info/accounts.h
+ M /branch/Akikos_tinns_with_cmake/server/src/info/main.h
+ M /branch/Akikos_tinns_with_cmake/server/src/patch/CMakeLists.txt
+ M /branch/Akikos_tinns_with_cmake/server/src/patch/main.h
+
+- joined common directories
+- joined all network stuff in two common files (netcode.*)
+- started to clean up includes massacre
+- started to to clean up code in the common parts
+- more C++0x changes
+
+
+------------------------------------------------------------------------
+r155 | Akiko | 2011-08-22 11:40:39 +0200 (Mon, 22 Aug 2011) | 6 lines
+Changed paths:
+ M /branch/Akikos_tinns_with_cmake/CMakeLists.txt
+ M /branch/Akikos_tinns_with_cmake/server/src/game/container.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/decoder/main.h
+ M /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/main.h
+ M /branch/Akikos_tinns_with_cmake/server/src/game/main.h
+ M /branch/Akikos_tinns_with_cmake/server/src/game/vehicle.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/info/main.h
+
+- changed CMake system to support older mysql installations (different
+ include directory)
+- fixed some "Container" issues to stay compatile to older compilers
+ (gcc 4.3)
+
+
+------------------------------------------------------------------------
+r154 | Akiko | 2011-08-22 10:32:46 +0200 (Mon, 22 Aug 2011) | 7 lines
+Changed paths:
+ M /branch/Akikos_tinns_with_cmake/CMakeLists.txt
+ M /branch/Akikos_tinns_with_cmake/cmake_distclean.sh
+ M /branch/Akikos_tinns_with_cmake/cmake_modules/FindMYSQL.cmake
+ A /branch/Akikos_tinns_with_cmake/cmake_modules/FindSQLITE3.cmake
+ M /branch/Akikos_tinns_with_cmake/server/src/common/config/main.h
+ M /branch/Akikos_tinns_with_cmake/server/src/common/console/main.h
+ M /branch/Akikos_tinns_with_cmake/server/src/common/filesystem/filesystem.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/common/filesystem/main.h
+ M /branch/Akikos_tinns_with_cmake/server/src/common/misc/main.h
+ M /branch/Akikos_tinns_with_cmake/server/src/common/misc/misc.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/common/netcode/connection-tcp.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/common/netcode/connection-udp.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/common/netcode/main.h
+ M /branch/Akikos_tinns_with_cmake/server/src/common/netcode/serversocket.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/dev-tools/getsvnrev.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/chars.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/decoder/main.h
+ M /branch/Akikos_tinns_with_cmake/server/src/game/def/def_trader.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/def/main.h
+ M /branch/Akikos_tinns_with_cmake/server/src/game/def/world_datparser.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/main.h
+ M /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/npc.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/rawf.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/include/defs.h
+ M /branch/Akikos_tinns_with_cmake/server/src/game/include/msgbuilder.h
+ M /branch/Akikos_tinns_with_cmake/server/src/game/include/multipart.h
+ M /branch/Akikos_tinns_with_cmake/server/src/game/include/npctemplate.h
+ M /branch/Akikos_tinns_with_cmake/server/src/game/item.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/main.h
+ M /branch/Akikos_tinns_with_cmake/server/src/game/msgbuilder.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/multipart.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/npc.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/npc_conversation.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/terminal_updatedb.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/info/main.h
+ M /branch/Akikos_tinns_with_cmake/server/src/patch/main.h
+ M /branch/Akikos_tinns_with_cmake/server/src/patch/patchserver.cpp
+ M /branch/Akikos_tinns_with_cmake/tools/pak_decompress/pak_decompress.cpp
+
+- enhanced distclean script to give a code summary
+- added SQLITE3 to CMake scripts
+- changed build options to C++0x
+- made code C++0x compileable
+- removed the damn "using namespace std" stuff
+
+
+------------------------------------------------------------------------
+r153 | Akiko | 2011-08-21 11:37:01 +0200 (Sun, 21 Aug 2011) | 3 lines
+Changed paths:
+ M /branch/Akikos_tinns_with_cmake/CMakeLists.txt
+ D /branch/Akikos_tinns_with_cmake/cmake_modules/FindLUA.cmake
+ M /branch/Akikos_tinns_with_cmake/cmake_modules/FindMYSQL.cmake
+ M /branch/Akikos_tinns_with_cmake/cmake_modules/FindPCRE.cmake
+ M /branch/Akikos_tinns_with_cmake/cmake_modules/FindPTHREAD.cmake
+ M /branch/Akikos_tinns_with_cmake/cmake_modules/FindRT.cmake
+ M /branch/Akikos_tinns_with_cmake/tools/pak_decompress/CMakeLists.txt
+ M /branch/Akikos_tinns_with_cmake/tools/vfs_viewer/CMakeLists.txt
+
+- updated CMAKE files to properly support multiarch environments
+
+
+------------------------------------------------------------------------
+r152 | Akiko | 2011-04-22 17:39:46 +0200 (Fri, 22 Apr 2011) | 4 lines
+Changed paths:
+ M /branch/Akikos_tinns_with_cmake/CMakeLists.txt
+ M /branch/Akikos_tinns_with_cmake/server/CMakeLists.txt
+ D /branch/Akikos_tinns_with_cmake/server/WORK_IN_PROGRESS
+ M /branch/Akikos_tinns_with_cmake/server/src/CMakeLists.txt
+ M /branch/Akikos_tinns_with_cmake/server/src/common/CMakeLists.txt
+ M /branch/Akikos_tinns_with_cmake/server/src/dev-tools/CMakeLists.txt
+ M /branch/Akikos_tinns_with_cmake/server/src/game/CMakeLists.txt
+ M /branch/Akikos_tinns_with_cmake/server/src/info/CMakeLists.txt
+ M /branch/Akikos_tinns_with_cmake/server/src/patch/CMakeLists.txt
+
+- cleaned up some cmake files
+- removed useless files
+
+
+------------------------------------------------------------------------
+r151 | Akiko | 2011-04-22 17:06:03 +0200 (Fri, 22 Apr 2011) | 5 lines
+Changed paths:
+ M /branch/Akikos_tinns_with_cmake/CMakeLists.txt
+ A /branch/Akikos_tinns_with_cmake/cmake_modules/FindLUA.cmake
+ M /branch/Akikos_tinns_with_cmake/server/src/game/CMakeLists.txt
+ M /branch/Akikos_tinns_with_cmake/server/src/game/chars.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/commands.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/decoder/main.h
+ M /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_0x13.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_helditemaction.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_terminal.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/def/world_datparser.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/test.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/include/chars.h
+ M /branch/Akikos_tinns_with_cmake/server/src/game/include/globals.h
+ M /branch/Akikos_tinns_with_cmake/server/src/game/lua_engine.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/main.h
+ M /branch/Akikos_tinns_with_cmake/server/src/game/msgbuilder.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/npc.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/npc_ai.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/npc_conversation.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/npctemplate.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/outpost.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/terminal.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/terminal_querydb.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/terminal_receivedb.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/terminal_tryaccess.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/terminal_updatedb.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/worlddatatemplate.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/info/infoserver.h
+
+- fixed all remaining issues from the big patchset
+- added lua cmake find script
+- this branch is compiling now, but's not tested
+
+
+------------------------------------------------------------------------
+r150 | Akiko | 2011-04-22 16:06:33 +0200 (Fri, 22 Apr 2011) | 5 lines
+Changed paths:
+ D /branch/Akikos_tinns_with_cmake/CHANGELOG
+ A /branch/Akikos_tinns_with_cmake/docs/ISC Example.txt (from /branch/Akikos_tinns_with_cmake/server/docs/ISC Example.txt:149)
+ A /branch/Akikos_tinns_with_cmake/docs/ISC ProtDef.txt (from /branch/Akikos_tinns_with_cmake/server/docs/ISC ProtDef.txt:149)
+ A /branch/Akikos_tinns_with_cmake/docs/NPCs.txt
+ A /branch/Akikos_tinns_with_cmake/docs/current_test_commands.txt
+ A /branch/Akikos_tinns_with_cmake/docs/how_npc_scripts_work.txt
+ M /branch/Akikos_tinns_with_cmake/server/conf/commands.conf
+ M /branch/Akikos_tinns_with_cmake/server/conf/gameserver.conf
+ A /branch/Akikos_tinns_with_cmake/server/data
+ A /branch/Akikos_tinns_with_cmake/server/data/scripts
+ A /branch/Akikos_tinns_with_cmake/server/data/scripts/lua
+ A /branch/Akikos_tinns_with_cmake/server/data/scripts/lua/zippy.lua
+ A /branch/Akikos_tinns_with_cmake/server/database/DB_v8
+ A /branch/Akikos_tinns_with_cmake/server/database/DB_v8/DB_v8_patch001.sql
+ A /branch/Akikos_tinns_with_cmake/server/database/DB_v8/TinNS_GameDB_rev8_BaseData.sql
+ A /branch/Akikos_tinns_with_cmake/server/database/DB_v8/changes.txt
+ A /branch/Akikos_tinns_with_cmake/server/database/DB_v8/patch_gamedb_rev7_to_rev8.sql
+ A /branch/Akikos_tinns_with_cmake/server/database/DB_v8/readme.txt
+ A /branch/Akikos_tinns_with_cmake/server/database/DB_v8/unified_game_DB_rev8.sql
+ A /branch/Akikos_tinns_with_cmake/server/database/DB_v8/unified_infoDB_rev8.sql
+ A /branch/Akikos_tinns_with_cmake/server/database/GameDB_patch_rev133-rev134.sql
+ A /branch/Akikos_tinns_with_cmake/server/database/GameDB_patch_rev134-rev140.sql
+ D /branch/Akikos_tinns_with_cmake/server/docs
+ M /branch/Akikos_tinns_with_cmake/server/init.d/tinns
+ M /branch/Akikos_tinns_with_cmake/server/src/common/misc/misc.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/CMakeLists.txt
+ M /branch/Akikos_tinns_with_cmake/server/src/game/chars.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/client.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/commands.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/configtemplate.h
+ M /branch/Akikos_tinns_with_cmake/server/src/game/container.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/decoder/main.h
+ M /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_0x13.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_0x1f.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_hack.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_hack.h
+ M /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_helditemaction.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_helditemaction.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_multipart.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_multipart.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_npcdialog.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_npcdialog.h
+ M /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_ping.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_ping.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_pvptrade.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_pvptrade.h
+ M /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_reqinfo.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_subskill.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_sync.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_terminal.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_terminal.h
+ M /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_useobject.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_worldIDinfo.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_worldIDinfo.h
+ M /branch/Akikos_tinns_with_cmake/server/src/game/def/def_factions.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/def/def_npc.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/def/def_scripts.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/def/gamedefs.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/def/world_datparser.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/def/world_datstruct.h
+ M /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/givemoney.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/npc.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/npc_shop.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/setlevel.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/setmainskill.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/setsubskill.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/t.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/test.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/globals.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/include/accounts.h
+ M /branch/Akikos_tinns_with_cmake/server/src/game/include/chars.h
+ M /branch/Akikos_tinns_with_cmake/server/src/game/include/commands.h
+ M /branch/Akikos_tinns_with_cmake/server/src/game/include/container.h
+ M /branch/Akikos_tinns_with_cmake/server/src/game/include/def_drugs.h
+ M /branch/Akikos_tinns_with_cmake/server/src/game/include/def_factions.h
+ M /branch/Akikos_tinns_with_cmake/server/src/game/include/def_items.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/def_scripts.h
+ M /branch/Akikos_tinns_with_cmake/server/src/game/include/defs.h
+ M /branch/Akikos_tinns_with_cmake/server/src/game/include/gamedefs.h
+ M /branch/Akikos_tinns_with_cmake/server/src/game/include/globals.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/lua_engine.h
+ M /branch/Akikos_tinns_with_cmake/server/src/game/include/msgbuilder.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/multipart.h
+ M /branch/Akikos_tinns_with_cmake/server/src/game/include/npc.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/npctemplate.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/outpost.h
+ M /branch/Akikos_tinns_with_cmake/server/src/game/include/skill.h
+ M /branch/Akikos_tinns_with_cmake/server/src/game/include/terminal.h
+ M /branch/Akikos_tinns_with_cmake/server/src/game/include/world_datparser.h
+ M /branch/Akikos_tinns_with_cmake/server/src/game/include/worlddatatemplate.h
+ M /branch/Akikos_tinns_with_cmake/server/src/game/include/worlds.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/lua_engine.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/main.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/main.h
+ M /branch/Akikos_tinns_with_cmake/server/src/game/msgbuilder.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/multipart.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/npc.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/npc_ai.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/npc_conversation.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/npctemplate.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/outpost.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/skill.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/terminal.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/terminal_querydb.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/terminal_receivedb.cpp
+ D /branch/Akikos_tinns_with_cmake/server/src/game/terminal_servermessage.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/terminal_tryaccess.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/terminal_updatedb.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/game/worlddatatemplate.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/include/external.h
+ M /branch/Akikos_tinns_with_cmake/server/src/include/message.h
+ M /branch/Akikos_tinns_with_cmake/server/src/include/misc.h
+ M /branch/Akikos_tinns_with_cmake/server/src/include/svnrevision.h
+ M /branch/Akikos_tinns_with_cmake/server/src/info/accounts.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/info/accounts.h
+ M /branch/Akikos_tinns_with_cmake/server/src/info/infoserver.cpp
+ M /branch/Akikos_tinns_with_cmake/server/src/info/infoserver.h
+
+- 128-149 commits added to my cmake branch
+- removed and moved some files
+- this commit will not compile (missing cmake entries, will fix this in the next commit)
+
+
+------------------------------------------------------------------------
+r149 | Namikon | 2009-10-26 21:48:24 +0100 (Mon, 26 Oct 2009) | 1 line
+Changed paths:
+ A /server/database/DB_v8/DB_v8_patch001.sql
+ D /server/database/DB_v8_patch001.sql
+
+moved DB patchfile
+------------------------------------------------------------------------
+r148 | Namikon | 2009-10-26 21:47:39 +0100 (Mon, 26 Oct 2009) | 3 lines
+Changed paths:
+ A /server/database/DB_v8
+ A /server/database/DB_v8/TinNS_GameDB_rev8_BaseData.sql
+ A /server/database/DB_v8/changes.txt
+ A /server/database/DB_v8/patch_gamedb_rev7_to_rev8.sql
+ A /server/database/DB_v8/readme.txt
+ A /server/database/DB_v8/unified_game DB_rev8.sql
+ A /server/database/DB_v8/unified_infoDB_rev8.sql
+ D /server/database/DB_v8.zip
+
+Deleted .zip file with databases
+Added single SQL files for structure only, and basedata for TinNS.
+Also added changelog
+------------------------------------------------------------------------
+r147 | Namikon | 2009-10-25 17:18:05 +0100 (Sun, 25 Oct 2009) | 6 lines
+Changed paths:
+ M /server/conf/gameserver.conf
+ A /server/database/DB_v8_patch001.sql
+ M /server/src/common/netcode/connection-udp.cpp
+ M /server/src/game/decoder/main.h
+ M /server/src/game/decoder/udp_0x13.cpp
+ A /server/src/game/decoder/udp_multipart.cpp
+ A /server/src/game/decoder/udp_multipart.h
+ M /server/src/game/decoder/udp_ping.h
+ M /server/src/game/globals.cpp
+ M /server/src/game/include/globals.h
+ A /server/src/game/include/multipart.h
+ M /server/src/game/main.cpp
+ M /server/src/game/main.h
+ A /server/src/game/multipart.cpp
+
+Added support for incoming multipart messages
+This is for UpdateDB only at the moment.
+Added DB patch to DB8.1
+This version is able to handle emails, forumposts and every terminal action where you can type in more than 1 line of text.
+However, its possible that you get an error on some actions, thats because the TerminalClass is not able yet to handle incomming
+calls larger than ~1kb. But this will change soon!
+------------------------------------------------------------------------
+r146 | Namikon | 2009-10-25 15:37:29 +0100 (Sun, 25 Oct 2009) | 1 line
+Changed paths:
+ M /server/database/DB_v8.zip
+
+databse fix
+------------------------------------------------------------------------
+r145 | Namikon | 2009-10-25 12:53:30 +0100 (Sun, 25 Oct 2009) | 1 line
+Changed paths:
+ A /server/database/DB_v8.zip
+
+DBv8
+------------------------------------------------------------------------
+r144 | Namikon | 2009-10-25 12:48:15 +0100 (Sun, 25 Oct 2009) | 6 lines
+Changed paths:
+ M /server/src/game/chars.cpp
+ M /server/src/game/client.cpp
+ M /server/src/game/container.cpp
+ M /server/src/game/decoder/main.h
+ M /server/src/game/decoder/udp_ping.cpp
+ M /server/src/game/decoder/udp_reqinfo.cpp
+ M /server/src/game/decoder/udp_sync.cpp
+ M /server/src/game/decoder/udp_terminal.cpp
+ M /server/src/game/decoder/udp_terminal.h
+ M /server/src/game/gamecommands/test.cpp
+ M /server/src/game/globals.cpp
+ M /server/src/game/include/chars.h
+ M /server/src/game/include/container.h
+ M /server/src/game/include/globals.h
+ M /server/src/game/include/msgbuilder.h
+ A /server/src/game/include/outpost.h
+ M /server/src/game/include/terminal.h
+ M /server/src/game/main.h
+ M /server/src/game/msgbuilder.cpp
+ M /server/src/game/npc_ai.cpp
+ A /server/src/game/outpost.cpp
+ M /server/src/game/terminal.cpp
+ A /server/src/game/terminal_querydb.cpp
+ M /server/src/game/terminal_receivedb.cpp
+ D /server/src/game/terminal_servermessage.cpp
+ M /server/src/game/terminal_tryaccess.cpp
+ M /server/src/game/terminal_updatedb.cpp
+ M /server/src/info/accounts.cpp
+ M /server/src/info/accounts.h
+ M /server/src/info/infoserver.cpp
+ M /server/src/info/infoserver.h
+
+- Rewrote terminal stuff. Citycom and GMTool are now enabled
+- Citycom and GMTool status: about 65% is working
+- Outposts now show their clan and faction. You also get the bonus if you're on clan/faction/etc
+- New GameDB and InfoDB: Rev8
+You MUST upgrade your database in order to use this revision!
+- Patched infoserver and gameserver to work with DB rev8
+------------------------------------------------------------------------
+r143 | Namikon | 2009-10-18 18:49:42 +0200 (Sun, 18 Oct 2009) | 28 lines
+Changed paths:
+ A /docs/current_test_commands.txt
+ M /server/src/game/chars.cpp
+ M /server/src/game/def/def_factions.cpp
+ M /server/src/game/gamecommands/npc.cpp
+ M /server/src/game/gamecommands/test.cpp
+ M /server/src/game/include/accounts.h
+ M /server/src/game/include/chars.h
+ M /server/src/game/include/commands.h
+ M /server/src/game/include/def_factions.h
+ M /server/src/game/include/msgbuilder.h
+ M /server/src/game/include/npc.h
+ M /server/src/game/lua_engine.cpp
+ M /server/src/game/msgbuilder.cpp
+ M /server/src/game/npc.cpp
+ A /server/src/game/npc_ai.cpp
+
+Rev xxx
+
+- Some new permanent combat/skillranks:
+Accountlevel 30+: Rank 50/50
+Accountlevel 50+: Rank 120/120
+Accountlevel 100: Rank 127/127
+
+- Fixed factions.def parser
+- Fixed servercrash when tried to spawn NPC in any location without SQL NPCs
+- Added AI for NPCs
+The "AI" is limited to SQL NPCs (worldid > 1000) only for now, and it
+does only react on other NPCs nearby.
+An spawned NPC will search its nearby location for enemies (Faction relation <0)
+and start attacking the closest one. The range is limited to 800 (whatever, meters.. localchat is 1600)
+If target runs out of sight (Distance 1500+) the attacker returns to normal
+
+Current @test commands are:
+
+@test 1 <npcID> <zoneID> <unknown1> <attackAnim>
+- Let <npcID> (use @debug it) attack <zoneID> which can be any npc or player
+ <npcID>: For non-sql NPCs, you have to remove an offset of 255; So the left security officer
+ in plaza 1 would have id 48 instead of 303
+ Unknown 1 is .. unknown yet and seems to be unimportant
+ attackAnim is the attack "style" of <npcID>. Varies from npc type to npc type. We'll need
+ a list of those values for each npc to be able to script actions for him
+
+@test 2 <faction ID> <faction ID>
+- Get relation of the 2 given factions. <0 means enemy
+------------------------------------------------------------------------
+r142 | Namikon | 2009-10-17 16:23:49 +0200 (Sat, 17 Oct 2009) | 1 line
+Changed paths:
+ M /server/src/game/include/lua_engine.h
+ M /server/src/include/external.h
+ D /server/src/include/lua
+
+Lua include fix
+------------------------------------------------------------------------
+r141 | Namikon | 2009-10-17 04:12:56 +0200 (Sat, 17 Oct 2009) | 1 line
+Changed paths:
+ M /server/conf/gameserver.conf
+ M /server/conf/infoserver.conf
+
+
+------------------------------------------------------------------------
+r140 | Namikon | 2009-10-17 04:07:20 +0200 (Sat, 17 Oct 2009) | 1 line
+Changed paths:
+ A /docs/how_npc_scripts_work.txt
+ A /docs/lua_callbacks.xls
+ M /server/conf/commands.conf
+ M /server/conf/gameserver.conf
+ M /server/conf/infoserver.conf
+ A /server/data
+ A /server/data/scripts
+ A /server/data/scripts/lua
+ A /server/data/scripts/lua/zippy.lua
+ A /server/database/GameDB_patch_rev134-rev140.sql
+ M /server/src/common/Makefile
+ M /server/src/common/misc/misc.cpp
+ M /server/src/game
+ M /server/src/game/Makefile
+ M /server/src/game/chars.cpp
+ M /server/src/game/client.cpp
+ M /server/src/game/commands.cpp
+ M /server/src/game/configtemplate.h
+ M /server/src/game/decoder
+ M /server/src/game/decoder/main.h
+ M /server/src/game/decoder/udp_reqinfo.cpp
+ M /server/src/game/decoder/udp_useobject.cpp
+ M /server/src/game/decoder/udp_worldIDinfo.cpp
+ M /server/src/game/decoder/udp_worldIDinfo.h
+ M /server/src/game/def
+ M /server/src/game/def/def_npc.cpp
+ M /server/src/game/def/def_scripts.cpp
+ M /server/src/game/gamecommands
+ A /server/src/game/gamecommands/npc.cpp
+ A /server/src/game/gamecommands/npc_shop.cpp
+ M /server/src/game/gamecommands/test.cpp
+ M /server/src/game/globals.cpp
+ M /server/src/game/include
+ M /server/src/game/include/chars.h
+ M /server/src/game/include/commands.h
+ M /server/src/game/include/def_items.h
+ M /server/src/game/include/def_npc.h
+ M /server/src/game/include/def_scripts.h
+ M /server/src/game/include/globals.h
+ A /server/src/game/include/lua_engine.h
+ M /server/src/game/include/msgbuilder.h
+ M /server/src/game/include/npc.h
+ A /server/src/game/lua_engine.cpp
+ M /server/src/game/main.cpp
+ M /server/src/game/main.h
+ M /server/src/game/msgbuilder.cpp
+ M /server/src/game/npc.cpp
+ M /server/src/game/npc_conversation.cpp
+ M /server/src/game/sql.cpp
+ M /server/src/include/external.h
+ A /server/src/include/lua
+ A /server/src/include/lua/lapi.h
+ A /server/src/include/lua/lauxlib.h
+ A /server/src/include/lua/lcode.h
+ A /server/src/include/lua/ldebug.h
+ A /server/src/include/lua/ldo.h
+ A /server/src/include/lua/lfunc.h
+ A /server/src/include/lua/lgc.h
+ A /server/src/include/lua/llex.h
+ A /server/src/include/lua/llimits.h
+ A /server/src/include/lua/lmem.h
+ A /server/src/include/lua/lobject.h
+ A /server/src/include/lua/lopcodes.h
+ A /server/src/include/lua/lparser.h
+ A /server/src/include/lua/lstate.h
+ A /server/src/include/lua/lstring.h
+ A /server/src/include/lua/ltable.h
+ A /server/src/include/lua/ltm.h
+ A /server/src/include/lua/lua.h
+ A /server/src/include/lua/luaconf.h
+ A /server/src/include/lua/lualib.h
+ A /server/src/include/lua/lundump.h
+ A /server/src/include/lua/lvm.h
+ A /server/src/include/lua/lzio.h
+ M /server/src/include/misc.h
+
+Too much to write it here. See forums Rev.140 for details
+------------------------------------------------------------------------
+r139 | Namikon | 2009-10-13 13:21:20 +0200 (Tue, 13 Oct 2009) | 2 lines
+Changed paths:
+ M /server/src/game/chars.cpp
+ M /server/src/game/decoder/udp_0x1f.cpp
+ A /server/src/game/decoder/udp_npcdialog.cpp
+ A /server/src/game/decoder/udp_npcdialog.h
+ A /server/src/game/def/def_scripts.cpp
+ M /server/src/game/def/gamedefs.cpp
+ M /server/src/game/include/chars.h
+ M /server/src/game/include/def_items.h
+ A /server/src/game/include/def_scripts.h
+ M /server/src/game/include/defs.h
+ M /server/src/game/include/gamedefs.h
+ M /server/src/game/include/msgbuilder.h
+ M /server/src/game/include/npc.h
+ M /server/src/game/msgbuilder.cpp
+ M /server/src/game/npc.cpp
+ M /server/src/game/npc_conversation.cpp
+ M /server/src/include/external.h
+
+NPC Dialogs work. (Well, at least the basic functions, no faction / money / item stuff yet)
+This has do be redone soon, since the way the lua file is processed (thanks maxxjag) makes it impossible to interpret the script correctly
+------------------------------------------------------------------------
+r138 | Namikon | 2009-10-12 21:09:37 +0200 (Mon, 12 Oct 2009) | 1 line
+Changed paths:
+ M /server/src/game/gamecommands/test.cpp
+
+small fix, just a typo
+------------------------------------------------------------------------
+r137 | Namikon | 2009-10-12 21:04:59 +0200 (Mon, 12 Oct 2009) | 2 lines
+Changed paths:
+ M /server/src/game/gamecommands/test.cpp
+ M /server/src/game/npc_conversation.cpp
+
+Fixed NPC Dialog Out-Of-Order Problem
+@test 12 <itemid> <0-255> will spawn any item in your inventory. pretty buggy but it works, somehow:P
+------------------------------------------------------------------------
+r136 | Namikon | 2009-10-11 23:23:34 +0200 (Sun, 11 Oct 2009) | 2 lines
+Changed paths:
+ M /server/src/game/include/npc.h
+ M /server/src/game/npc_conversation.cpp
+
+NPCs are now talking to us, yehaw :D
+Buggy, but working
+------------------------------------------------------------------------
+r135 | Namikon | 2009-10-11 19:57:24 +0200 (Sun, 11 Oct 2009) | 2 lines
+Changed paths:
+ M /server/database/GameDB_patch_rev133-rev134.sql
+ M /server/src/game/include/npc.h
+ M /server/src/game/npc_conversation.cpp
+
+- Fixed server crash uppon wrong TraderID
+- Added "allbuyer" option. Set itemID to -1 in DB to make any non-trader NPC an Allbuyer
+------------------------------------------------------------------------
+r134 | Namikon | 2009-10-11 17:22:25 +0200 (Sun, 11 Oct 2009) | 10 lines
+Changed paths:
+ A /server/database/GameDB_patch_rev133-rev134.sql
+ M /server/src/game/decoder/udp_useobject.cpp
+ M /server/src/game/def/world_datparser.cpp
+ M /server/src/game/def/world_datstruct.h
+ M /server/src/game/gamecommands/test.cpp
+ M /server/src/game/include/def_items.h
+ M /server/src/game/include/npc.h
+ M /server/src/game/include/npctemplate.h
+ M /server/src/game/npc.cpp
+ A /server/src/game/npc_conversation.cpp
+ M /server/src/game/npctemplate.cpp
+
+- NPC Subsystem Upgrade:
+- Every NPC has now its unique name. The name is generated when the NPC data is loaded from dat or SQL uppon zone entry
+and is valid as long as the zone is alive
+- NPCs are now WORKING! They don't die anymore (BIG thanks to sting, he found that little "offset" we didn't see)
+- NPC shops are working too (At least every trader has the correct list of items. You cannot buy items yet,
+but you see the correct items, with prices)
+- Custom spawned NPCs (From SQL) can have dynamic shops. Just add ZoneID, WorldID, itemID and price in npc_shops.
+There will be an ingame command to manage NPCs, for now use this example to let the NCPD in P1 sell COPBOT rifles =)
+
+insert into `npc_shop`(`c_npc_id`,`c_zoneid`,`c_itemid`,`c_itemprice`) values ( '48','1','90','50000');
+------------------------------------------------------------------------
+r133 | Hammag | 2009-07-04 14:44:13 +0200 (Sat, 04 Jul 2009) | 1 line
+Changed paths:
+ M /server/CHANGELOG
+ M /server/conf/gameserver.conf
+ M /server/conf/infoserver.conf
+ M /server/src/game/decoder/udp_0x1f.cpp
+ M /server/src/game/decoder/udp_hack.cpp
+ M /server/src/game/decoder/udp_hack.h
+ M /server/src/game/decoder/udp_helditemaction.cpp
+ M /server/src/game/decoder/udp_helditemaction.h
+ M /server/src/game/decoder/udp_ping.cpp
+ M /server/src/game/decoder/udp_pvptrade.cpp
+ M /server/src/game/decoder/udp_pvptrade.h
+ M /server/src/game/gamecommands/t.cpp
+ M /server/src/game/include/def_drugs.h
+ M /server/src/game/include/msgbuilder.h
+ M /server/src/game/main.cpp
+ M /server/src/game/msgbuilder.cpp
+ M /server/src/game/npc.cpp
+ M /server/src/include/message.h
+ M /server/src/include/svnrevision.h
+
+Some new packets for items use, and some fixes
+------------------------------------------------------------------------
+r132 | Namikon | 2009-06-23 16:36:42 +0200 (Tue, 23 Jun 2009) | 3 lines
+Changed paths:
+ M /server/src/game/commands.cpp
+ M /server/src/game/decoder/udp_0x13.cpp
+ M /server/src/game/decoder/udp_0x1f.cpp
+ M /server/src/game/decoder/udp_pvptrade.cpp
+ M /server/src/game/decoder/udp_pvptrade.h
+ M /server/src/game/decoder/udp_subskill.cpp
+ M /server/src/game/decoder/udp_worldIDinfo.cpp
+ M /server/src/game/decoder/udp_worldIDinfo.h
+ M /server/src/game/def/world_datparser.cpp
+ M /server/src/game/def/world_datstruct.h
+ M /server/src/game/gamecommands/givemoney.cpp
+ M /server/src/game/gamecommands/setlevel.cpp
+ M /server/src/game/gamecommands/setmainskill.cpp
+ M /server/src/game/gamecommands/setsubskill.cpp
+ M /server/src/game/gamecommands/test.cpp
+ M /server/src/game/include/commands.h
+ M /server/src/game/include/msgbuilder.h
+ M /server/src/game/include/npc.h
+ M /server/src/game/include/npctemplate.h
+ M /server/src/game/include/skill.h
+ M /server/src/game/include/world_datparser.h
+ M /server/src/game/include/worlddatatemplate.h
+ M /server/src/game/include/worlds.h
+ M /server/src/game/msgbuilder.cpp
+ M /server/src/game/npc.cpp
+ M /server/src/game/npctemplate.cpp
+ M /server/src/game/skill.cpp
+ M /server/src/game/worlddatatemplate.cpp
+
+As by request of Akkiko, (hopefully) fixed all files with \n\r. (Also switched by editor to only use \n now.
+As by request of Sting (and to revert my mistake i did a few days ago) re-enabled mUnknown and mLoot values in NPC.cpp
+Also reformattet the output, the old one was way to long
+------------------------------------------------------------------------
+r131 | Namikon | 2009-06-21 22:00:52 +0200 (Sun, 21 Jun 2009) | 4 lines
+Changed paths:
+ A /docs/NPCs.txt
+ M /server/src/game/def/world_datparser.cpp
+ M /server/src/game/def/world_datstruct.h
+ M /server/src/game/gamecommands/test.cpp
+ M /server/src/game/include/npc.h
+ A /server/src/game/include/npctemplate.h
+ M /server/src/game/include/world_datparser.h
+ M /server/src/game/include/worlddatatemplate.h
+ M /server/src/game/include/worlds.h
+ M /server/src/game/npc.cpp
+ A /server/src/game/npctemplate.cpp
+ M /server/src/game/worlddatatemplate.cpp
+ M /server/src/include/svnrevision.h
+ M /server/tinns
+
+Worked on NPC subsystem
+Server does now load NPC defs from SQL and the zone .dat files correctly AND it will spawn those NPCs at their correct location.
+however, they're all death and i dont know why... yet.
+A small test has been added to play with NPCs, see docs/NPCs.txt for details
+------------------------------------------------------------------------
+r130 | Namikon | 2009-06-20 23:51:31 +0200 (Sat, 20 Jun 2009) | 4 lines
+Changed paths:
+ M /server/conf/commands.conf
+ M /server/conf/gameserver.conf
+ M /server/conf/infoserver.conf
+ M /server/src/game/commands.cpp
+ M /server/src/game/decoder/udp_0x13.cpp
+ M /server/src/game/decoder/udp_0x1f.cpp
+ A /server/src/game/decoder/udp_pvptrade.cpp
+ A /server/src/game/decoder/udp_pvptrade.h
+ M /server/src/game/decoder/udp_subskill.cpp
+ A /server/src/game/decoder/udp_worldIDinfo.cpp
+ A /server/src/game/decoder/udp_worldIDinfo.h
+ M /server/src/game/gamecommands/setlevel.cpp
+ A /server/src/game/gamecommands/setmainskill.cpp
+ A /server/src/game/gamecommands/setsubskill.cpp
+ M /server/src/game/gamecommands/test.cpp
+ M /server/src/game/include/commands.h
+ M /server/src/game/include/msgbuilder.h
+ M /server/src/game/include/skill.h
+ M /server/src/game/msgbuilder.cpp
+ M /server/src/game/npc.cpp
+ M /server/src/game/skill.cpp
+ M /server/src/include/svnrevision.h
+
+- Added 2 new commands: setmainskill and setsubskill (The 1st for PSI, INT, STR,.. the 2nd for HCK,BRT, ...)
+- Added 2 new decoders for yet-unknown packets
+- Prepared future work on the npc subsystem. (They'll soon be able to shoot you :) )
+- Fixed subskill system. You can now increase any subskill without getting OOO Packets, as long as there are enough skillpoints left of course
+------------------------------------------------------------------------
+r129 | Namikon | 2009-06-20 12:38:54 +0200 (Sat, 20 Jun 2009) | 2 lines
+Changed paths:
+ M /server/src/game/gamecommands/givemoney.cpp
+ M /server/src/game/npc.cpp
+
+- Servercrash fixed in npc.cpp when debugmode enabled
+- Givemoney fixed, wasn't showing help on incomplete command
+------------------------------------------------------------------------
+r128 | Akiko | 2009-06-15 12:36:51 +0200 (Mon, 15 Jun 2009) | 5 lines
+Changed paths:
+ A /branch
+ A /branch/Akikos_tinns_with_cmake
+ A /branch/Akikos_tinns_with_cmake/CHANGELOG
+ A /branch/Akikos_tinns_with_cmake/CMakeLists.txt
+ A /branch/Akikos_tinns_with_cmake/LICENSE.txt
+ A /branch/Akikos_tinns_with_cmake/cmake_README
+ A /branch/Akikos_tinns_with_cmake/cmake_distclean.sh
+ A /branch/Akikos_tinns_with_cmake/cmake_modules
+ A /branch/Akikos_tinns_with_cmake/cmake_modules/FindMYSQL.cmake
+ A /branch/Akikos_tinns_with_cmake/cmake_modules/FindPCRE.cmake
+ A /branch/Akikos_tinns_with_cmake/cmake_modules/FindPTHREAD.cmake
+ A /branch/Akikos_tinns_with_cmake/cmake_modules/FindRT.cmake
+ A /branch/Akikos_tinns_with_cmake/docs
+ A /branch/Akikos_tinns_with_cmake/docs/Neocron1.ChatProtocol.pdf
+ A /branch/Akikos_tinns_with_cmake/docs/Neocron1.MainProtocol.pdf
+ A /branch/Akikos_tinns_with_cmake/docs/TinNS.QuickInstallation.pdf
+ A /branch/Akikos_tinns_with_cmake/docs/itemtypes.txt
+ A /branch/Akikos_tinns_with_cmake/server
+ A /branch/Akikos_tinns_with_cmake/server/CMakeLists.txt
+ A /branch/Akikos_tinns_with_cmake/server/WORK_IN_PROGRESS
+ A /branch/Akikos_tinns_with_cmake/server/conf
+ A /branch/Akikos_tinns_with_cmake/server/conf/commands.conf
+ A /branch/Akikos_tinns_with_cmake/server/conf/gameserver.conf
+ A /branch/Akikos_tinns_with_cmake/server/conf/global.conf
+ A /branch/Akikos_tinns_with_cmake/server/conf/infoserver.conf
+ A /branch/Akikos_tinns_with_cmake/server/conf/patchserver.conf
+ A /branch/Akikos_tinns_with_cmake/server/database
+ A /branch/Akikos_tinns_with_cmake/server/database/GameDB.sql
+ A /branch/Akikos_tinns_with_cmake/server/database/GameDB_migration_rev107-rev108.sql
+ A /branch/Akikos_tinns_with_cmake/server/database/GameDB_migration_rev81-rev82.sql
+ A /branch/Akikos_tinns_with_cmake/server/database/InfoDB.sql
+ A /branch/Akikos_tinns_with_cmake/server/docs
+ A /branch/Akikos_tinns_with_cmake/server/docs/ISC Example.txt
+ A /branch/Akikos_tinns_with_cmake/server/docs/ISC ProtDef.txt
+ A /branch/Akikos_tinns_with_cmake/server/init.d
+ A /branch/Akikos_tinns_with_cmake/server/init.d/tinns
+ A /branch/Akikos_tinns_with_cmake/server/src
+ A /branch/Akikos_tinns_with_cmake/server/src/CMakeLists.txt
+ A /branch/Akikos_tinns_with_cmake/server/src/common
+ A /branch/Akikos_tinns_with_cmake/server/src/common/CMakeLists.txt
+ A /branch/Akikos_tinns_with_cmake/server/src/common/config
+ A /branch/Akikos_tinns_with_cmake/server/src/common/config/config.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/common/config/main.h
+ A /branch/Akikos_tinns_with_cmake/server/src/common/console
+ A /branch/Akikos_tinns_with_cmake/server/src/common/console/console.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/common/console/main.h
+ A /branch/Akikos_tinns_with_cmake/server/src/common/filesystem
+ A /branch/Akikos_tinns_with_cmake/server/src/common/filesystem/filesystem.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/common/filesystem/main.h
+ A /branch/Akikos_tinns_with_cmake/server/src/common/misc
+ A /branch/Akikos_tinns_with_cmake/server/src/common/misc/main.h
+ A /branch/Akikos_tinns_with_cmake/server/src/common/misc/misc.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/common/netcode
+ A /branch/Akikos_tinns_with_cmake/server/src/common/netcode/connection-tcp.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/common/netcode/connection-udp.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/common/netcode/main.h
+ A /branch/Akikos_tinns_with_cmake/server/src/common/netcode/message.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/common/netcode/serversocket.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/common/netcode/udpmanager.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/common/regex
+ A /branch/Akikos_tinns_with_cmake/server/src/common/regex/regex++.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/dev-tools
+ A /branch/Akikos_tinns_with_cmake/server/src/dev-tools/CMakeLists.txt
+ A /branch/Akikos_tinns_with_cmake/server/src/dev-tools/cleandepfile.c
+ A /branch/Akikos_tinns_with_cmake/server/src/dev-tools/getsvnrev.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/dev-tools/make-bin-tarball
+ A /branch/Akikos_tinns_with_cmake/server/src/dev-tools/make-src-tarball
+ A /branch/Akikos_tinns_with_cmake/server/src/game
+ A /branch/Akikos_tinns_with_cmake/server/src/game/CMakeLists.txt
+ A /branch/Akikos_tinns_with_cmake/server/src/game/accounts.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/appartements.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/buddylist.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/chars.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/chat.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/client.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/clientmanager.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/commands.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/configtemplate.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/container.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/main.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/msgdecoder.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_0x08.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_0x08.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_0x13.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_0x13.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_0x1f.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_0x1f.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_0x22.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_0x22.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_0x2b.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_0x2b.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_OOO.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_OOO.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_appartment.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_appartment.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_charmove.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_charmove.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_chat.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_chat.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_deathrespawn.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_deathrespawn.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_entityposreq.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_entityposreq.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_hack.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_hack.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_helditemaction.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_helditemaction.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_itemmanualreload.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_itemmanualreload.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_itemmove.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_itemmove.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_itemuse.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_itemuse.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_killself.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_killself.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_outfitter.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_outfitter.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_packet0.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_packet0.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_ping.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_ping.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_popupresponse.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_popupresponse.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_quickaccessbelt.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_quickaccessbelt.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_reqinfo.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_reqinfo.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_subskill.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_subskill.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_sync.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_sync.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_terminal.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_terminal.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_useobject.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_useobject.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_vhc.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_vhc.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_zoning.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udp_zoning.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udpanalyser.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/decoder/udpanalyser.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/def
+ A /branch/Akikos_tinns_with_cmake/server/src/game/def/def_actionmod.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/def/def_ammo.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/def/def_appartements.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/def/def_appplaces.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/def/def_blueprintpieces.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/def/def_characters.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/def/def_charaction.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/def/def_charkinds.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/def/def_damage.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/def/def_drugs.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/def/def_factions.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/def/def_hack.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/def/def_implants.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/def/def_itemcontainer.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/def/def_itemmod.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/def/def_itemres.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/def/def_items.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/def/def_mission.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/def/def_npc.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/def/def_npcarmor.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/def/def_npcgroupspawn.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/def/def_outposts.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/def/def_recycles.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/def/def_respawn.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/def/def_shots.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/def/def_skills.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/def/def_subskills.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/def/def_trader.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/def/def_vehicles.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/def/def_vehiclesits.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/def/def_weapons.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/def/def_weather.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/def/def_worldfile.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/def/def_worldmodels.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/def/def_worlds.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/def/defparser.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/def/gamedefs.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/def/main.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/def/world_datparser.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/def/world_datstruct.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/doortemplate.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/furnituretemplate.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands
+ A /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/README
+ A /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/ban.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/brightness.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/broadcast.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/color.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/debug.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/effect.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/givemoney.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/h.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/info.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/jail.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/kick.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/listbans.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/main.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/online.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/rawf.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/recall.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/remove.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/setlevel.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/settime.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/shun.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/skin.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/spawnactor.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/speed.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/t.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/takemoney.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/teleport.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/test.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/unban.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/unjail.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/unshun.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/uptime.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/v.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/version.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/warp.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/warpto.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/gamecommands/weather.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/gamescript.cpp.inhib
+ A /branch/Akikos_tinns_with_cmake/server/src/game/gameserver.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/genreplist.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/globals.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/accounts.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/appartements.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/buddylist.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/chars.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/chat.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/client.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/clientmanager.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/commands.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/container.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/def.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/def_actionmod.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/def_ammo.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/def_appartements.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/def_appplaces.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/def_blueprintpieces.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/def_characters.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/def_charaction.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/def_charkinds.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/def_damage.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/def_drugs.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/def_factions.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/def_hack.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/def_implants.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/def_itemcontainer.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/def_itemmod.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/def_itemres.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/def_items.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/def_mission.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/def_npc.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/def_npcarmor.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/def_npcgroupspawn.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/def_outposts.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/def_recycles.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/def_respawn.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/def_shots.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/def_skills.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/def_subskills.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/def_trader.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/def_vehicles.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/def_vehiclesits.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/def_weapons.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/def_weather.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/def_worldfile.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/def_worldmodels.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/def_worlds.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/defmap.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/defparser.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/defs.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/doortemplate.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/furnituretemplate.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/gamedefs.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/gamescript.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/gameserver.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/genreplist.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/globals.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/inventory.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/isc.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/item.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/msgbuilder.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/msgdecoder.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/npc.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/rconsole.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/server.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/skill.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/sql.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/subway.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/terminal.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/vehicle.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/vhcaccessrequest.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/world_datparser.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/worldactors.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/worlddatatemplate.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/worlds.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/include/zoning.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/inventory.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/isc.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/item.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/main.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/main.h
+ A /branch/Akikos_tinns_with_cmake/server/src/game/msgbuilder.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/npc.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/rconsole.cpp.inhib
+ A /branch/Akikos_tinns_with_cmake/server/src/game/server.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/skill.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/sql.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/subway.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/terminal.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/terminal_receivedb.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/terminal_servermessage.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/terminal_tryaccess.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/terminal_updatedb.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/vehicle.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/vhcaccessrequest.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/worldactors.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/worlddatatemplate.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/worlds.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/game/zoning.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/include
+ A /branch/Akikos_tinns_with_cmake/server/src/include/config.h
+ A /branch/Akikos_tinns_with_cmake/server/src/include/connection-tcp.h
+ A /branch/Akikos_tinns_with_cmake/server/src/include/connection-udp.h
+ A /branch/Akikos_tinns_with_cmake/server/src/include/console.h
+ A /branch/Akikos_tinns_with_cmake/server/src/include/external.h
+ A /branch/Akikos_tinns_with_cmake/server/src/include/filesystem.h
+ A /branch/Akikos_tinns_with_cmake/server/src/include/message.h
+ A /branch/Akikos_tinns_with_cmake/server/src/include/misc.h
+ A /branch/Akikos_tinns_with_cmake/server/src/include/netcode.h
+ A /branch/Akikos_tinns_with_cmake/server/src/include/regex++.h
+ A /branch/Akikos_tinns_with_cmake/server/src/include/serversocket.h
+ A /branch/Akikos_tinns_with_cmake/server/src/include/svnrevision.h
+ A /branch/Akikos_tinns_with_cmake/server/src/include/tinns_mutex.h
+ A /branch/Akikos_tinns_with_cmake/server/src/include/tinns_semaphore.h
+ A /branch/Akikos_tinns_with_cmake/server/src/include/tinns_thread.h
+ A /branch/Akikos_tinns_with_cmake/server/src/include/types.h
+ A /branch/Akikos_tinns_with_cmake/server/src/include/version.h
+ A /branch/Akikos_tinns_with_cmake/server/src/info
+ A /branch/Akikos_tinns_with_cmake/server/src/info/CMakeLists.txt
+ A /branch/Akikos_tinns_with_cmake/server/src/info/accounts.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/info/accounts.h
+ A /branch/Akikos_tinns_with_cmake/server/src/info/client.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/info/client.h
+ A /branch/Akikos_tinns_with_cmake/server/src/info/configtemplate.h
+ A /branch/Akikos_tinns_with_cmake/server/src/info/globals.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/info/globals.h
+ A /branch/Akikos_tinns_with_cmake/server/src/info/infoserver.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/info/infoserver.h
+ A /branch/Akikos_tinns_with_cmake/server/src/info/main.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/info/main.h
+ A /branch/Akikos_tinns_with_cmake/server/src/info/server.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/info/server.h
+ A /branch/Akikos_tinns_with_cmake/server/src/info/sql.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/info/sql.h
+ A /branch/Akikos_tinns_with_cmake/server/src/patch
+ A /branch/Akikos_tinns_with_cmake/server/src/patch/CMakeLists.txt
+ A /branch/Akikos_tinns_with_cmake/server/src/patch/client.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/patch/client.h
+ A /branch/Akikos_tinns_with_cmake/server/src/patch/configtemplate.h
+ A /branch/Akikos_tinns_with_cmake/server/src/patch/globals.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/patch/globals.h
+ A /branch/Akikos_tinns_with_cmake/server/src/patch/main.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/patch/main.h
+ A /branch/Akikos_tinns_with_cmake/server/src/patch/patchserver.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/patch/patchserver.h
+ A /branch/Akikos_tinns_with_cmake/server/src/patch/server.cpp
+ A /branch/Akikos_tinns_with_cmake/server/src/patch/server.h
+ A /branch/Akikos_tinns_with_cmake/tools
+ A /branch/Akikos_tinns_with_cmake/tools/CMakeLists.txt
+ A /branch/Akikos_tinns_with_cmake/tools/pak_decompress
+ A /branch/Akikos_tinns_with_cmake/tools/pak_decompress/CMakeLists.txt
+ A /branch/Akikos_tinns_with_cmake/tools/pak_decompress/pak_decompress.cpp
+ A /branch/Akikos_tinns_with_cmake/tools/pak_decompress/pak_decompress.jar
+ A /branch/Akikos_tinns_with_cmake/tools/vfs_viewer
+ A /branch/Akikos_tinns_with_cmake/tools/vfs_viewer/CMakeLists.txt
+ A /branch/Akikos_tinns_with_cmake/tools/vfs_viewer/vfs_viewer.c
+
+- New branch with cmake buildsystem (version 2.6+)
+- Cleanups
+- Small Fixes
+
+
+------------------------------------------------------------------------
+r127 | Hammag | 2009-05-12 18:29:52 +0200 (Tue, 12 May 2009) | 1 line
+Changed paths:
+ M /server/CHANGELOG
+ M /server/conf/commands.conf
+ M /server/src/game/client.cpp
+ M /server/src/game/commands.cpp
+ M /server/src/game/decoder/udp_0x1f.cpp
+ M /server/src/game/decoder/udp_helditemaction.cpp
+ M /server/src/game/decoder/udp_helditemaction.h
+ M /server/src/game/gamecommands/t.cpp
+ A /server/src/game/gamecommands/weather.cpp
+ M /server/src/game/include/commands.h
+ M /server/src/game/include/inventory.h
+ M /server/src/game/include/msgbuilder.h
+ M /server/src/game/msgbuilder.cpp
+ M /server/src/include/svnrevision.h
+
+multiuser weapon visualisation, weather control
+------------------------------------------------------------------------
+r126 | Hammag | 2009-05-10 23:56:24 +0200 (Sun, 10 May 2009) | 1 line
+Changed paths:
+ M /server/CHANGELOG
+ M /server/src/game/decoder/udp_0x13.cpp
+ M /server/src/game/decoder/udp_0x1f.cpp
+ A /server/src/game/decoder/udp_deathrespawn.cpp
+ A /server/src/game/decoder/udp_deathrespawn.h
+ M /server/src/game/decoder/udp_helditemaction.cpp
+ M /server/src/game/decoder/udp_helditemaction.h
+ M /server/src/game/decoder/udp_itemmanualreload.cpp
+ M /server/src/game/decoder/udp_itemmanualreload.h
+ M /server/src/game/decoder/udp_killself.cpp
+ M /server/src/game/decoder/udp_quickaccessbelt.cpp
+ M /server/src/game/decoder/udp_zoning.cpp
+ M /server/src/game/decoder/udp_zoning.h
+ M /server/src/game/gamecommands/t.cpp
+ M /server/src/game/include/msgbuilder.h
+ M /server/src/game/msgbuilder.cpp
+ M /server/src/include/svnrevision.h
+
+More on weapon reload
+------------------------------------------------------------------------
+r125 | Hammag | 2009-05-10 02:15:46 +0200 (Sun, 10 May 2009) | 1 line
+Changed paths:
+ M /server/CHANGELOG
+ M /server/src/game/decoder/udp_0x1f.cpp
+ M /server/src/game/decoder/udp_helditemaction.cpp
+ M /server/src/game/decoder/udp_helditemaction.h
+ A /server/src/game/decoder/udp_itemmanualreload.cpp
+ A /server/src/game/decoder/udp_itemmanualreload.h
+ M /server/src/game/decoder/udp_itemmove.cpp
+ M /server/src/game/decoder/udp_itemmove.h
+ A /server/src/game/decoder/udp_itemuse.cpp
+ A /server/src/game/decoder/udp_itemuse.h
+ M /server/src/game/def/def_weapons.cpp
+ M /server/src/game/gamecommands/t.cpp
+ M /server/src/game/include/msgbuilder.h
+ M /server/src/game/include/vehicle.h
+ M /server/src/game/msgbuilder.cpp
+ M /server/src/include/svnrevision.h
+
+basic weapon reload anxrdxs weapon.def loading fix
+------------------------------------------------------------------------
+r124 | Hammag | 2009-05-01 12:51:36 +0200 (Fri, 01 May 2009) | 1 line
+Changed paths:
+ M /server/CHANGELOG
+ M /server/src/game/def/def_itemmod.cpp
+ M /server/src/game/def/def_mission.cpp
+ M /server/src/game/def/def_npcarmor.cpp
+ M /server/src/game/def/def_outposts.cpp
+ M /server/src/game/def/def_recycles.cpp
+ M /server/src/game/def/defparser.cpp
+ M /server/src/game/include/def_itemmod.h
+ M /server/src/game/include/def_npcarmor.h
+ M /server/src/game/include/def_recycles.h
+ M /server/src/game/include/defmap.h
+ M /server/src/include/svnrevision.h
+
+Addition of remaining .def support
+------------------------------------------------------------------------
+r123 | Hammag | 2009-04-29 19:30:26 +0200 (Wed, 29 Apr 2009) | 1 line
+Changed paths:
+ M /server/src/game/client.cpp
+ M /server/src/game/decoder/udp_terminal.cpp
+ M /server/src/game/decoder/udp_useobject.cpp
+ M /server/src/game/decoder/udp_vhc.cpp
+ M /server/src/game/def/def_actionmod.cpp
+ M /server/src/game/def/def_blueprintpieces.cpp
+ M /server/src/game/def/def_charaction.cpp
+ M /server/src/game/def/def_damage.cpp
+ M /server/src/game/def/def_drugs.cpp
+ A /server/src/game/def/def_implants.cpp
+ M /server/src/game/def/def_itemres.cpp
+ M /server/src/game/def/def_shots.cpp
+ M /server/src/game/def/def_trader.cpp
+ M /server/src/game/include/client.h
+ M /server/src/game/include/def_blueprintpieces.h
+ M /server/src/game/include/def_drugs.h
+ M /server/src/game/include/def_implants.h
+ M /server/src/game/include/def_itemres.h
+ M /server/src/game/include/def_shots.h
+ M /server/src/game/include/furnituretemplate.h
+ M /server/src/game/include/worlds.h
+ M /server/src/game/vehicle.cpp
+ M /server/src/game/worlddatatemplate.cpp
+ M /server/src/game/worlds.cpp
+ M /server/src/include/svnrevision.h
+
+some more .def support and various small fixes
+------------------------------------------------------------------------
+r122 | Hammag | 2009-04-28 13:36:48 +0200 (Tue, 28 Apr 2009) | 1 line
+Changed paths:
+ M /server/CHANGELOG
+ M /server/src/common/netcode/message.cpp
+ M /server/src/game/chars.cpp
+ M /server/src/game/client.cpp
+ M /server/src/game/clientmanager.cpp
+ M /server/src/game/decoder/udp_charmove.cpp
+ M /server/src/game/decoder/udp_helditemaction.cpp
+ M /server/src/game/decoder/udp_itemmove.cpp
+ M /server/src/game/decoder/udp_popupresponse.cpp
+ M /server/src/game/decoder/udp_quickaccessbelt.cpp
+ M /server/src/game/decoder/udp_sync.cpp
+ M /server/src/game/decoder/udp_terminal.cpp
+ M /server/src/game/decoder/udp_useobject.cpp
+ M /server/src/game/decoder/udp_vhc.cpp
+ M /server/src/game/decoder/udp_vhc.h
+ M /server/src/game/decoder/udp_zoning.cpp
+ M /server/src/game/gamecommands/jail.cpp
+ M /server/src/game/gamecommands/recall.cpp
+ M /server/src/game/gamecommands/t.cpp
+ M /server/src/game/gamecommands/unjail.cpp
+ M /server/src/game/gamecommands/warp.cpp
+ M /server/src/game/gamecommands/warpto.cpp
+ M /server/src/game/include/chars.h
+ M /server/src/game/include/client.h
+ M /server/src/game/include/clientmanager.h
+ M /server/src/game/include/msgbuilder.h
+ M /server/src/game/include/msgdecoder.h
+ M /server/src/game/include/npc.h
+ M /server/src/game/include/vehicle.h
+ M /server/src/game/include/worlds.h
+ M /server/src/game/msgbuilder.cpp
+ M /server/src/game/npc.cpp
+ M /server/src/game/vehicle.cpp
+ M /server/src/game/worlds.cpp
+ M /server/src/include/svnrevision.h
+
+Various fixes and more work on vhc
+------------------------------------------------------------------------
+r121 | Hammag | 2009-04-21 17:55:19 +0200 (Tue, 21 Apr 2009) | 1 line
+Changed paths:
+ M /server/src/game/client.cpp
+ M /server/src/game/decoder/udp_0x22.cpp
+ M /server/src/game/decoder/udp_ping.cpp
+ M /server/src/game/decoder/udp_ping.h
+ M /server/src/game/decoder/udp_sync.cpp
+ M /server/src/game/decoder/udp_sync.h
+ M /server/src/game/decoder/udp_zoning.cpp
+ M /server/src/game/def/world_datparser.cpp
+ M /server/src/game/gamecommands/t.cpp
+ M /server/src/game/gamecommands/test.cpp
+ M /server/src/game/include/msgbuilder.h
+ M /server/src/game/msgbuilder.cpp
+ M /server/src/include/svnrevision.h
+
+Some source formatting, minor additions and fixes, on-going protocol investigations
+------------------------------------------------------------------------
+r120 | Hammag | 2009-04-18 20:02:40 +0200 (Sat, 18 Apr 2009) | 1 line
+Changed paths:
+ M /server/CHANGELOG
+ M /server/src/game/client.cpp
+ M /server/src/game/decoder/udp_charmove.cpp
+ M /server/src/include/svnrevision.h
+
+Fixed bug that caused crash in some circumstances
+------------------------------------------------------------------------
+r119 | Hammag | 2009-04-18 19:25:46 +0200 (Sat, 18 Apr 2009) | 1 line
+Changed paths:
+ M /server/CHANGELOG
+ M /server/src/game/client.cpp
+ M /server/src/game/clientmanager.cpp
+ M /server/src/game/commands.cpp
+ M /server/src/game/decoder/udp_charmove.cpp
+ M /server/src/game/decoder/udp_charmove.h
+ M /server/src/game/decoder/udp_helditemaction.cpp
+ M /server/src/game/decoder/udp_helditemaction.h
+ M /server/src/game/decoder/udp_outfitter.h
+ M /server/src/game/decoder/udp_terminal.cpp
+ M /server/src/game/decoder/udp_vhc.cpp
+ M /server/src/game/def/def_mission.cpp
+ M /server/src/game/gamecommands/ban.cpp
+ M /server/src/game/gamecommands/jail.cpp
+ M /server/src/game/gamecommands/kick.cpp
+ M /server/src/game/gamecommands/recall.cpp
+ M /server/src/game/gamecommands/t.cpp
+ M /server/src/game/gamecommands/teleport.cpp
+ M /server/src/game/gamecommands/unjail.cpp
+ M /server/src/game/gamecommands/warp.cpp
+ M /server/src/game/gamecommands/warpto.cpp
+ M /server/src/game/include/chars.h
+ M /server/src/game/include/client.h
+ M /server/src/game/include/clientmanager.h
+ M /server/src/game/include/commands.h
+ M /server/src/game/include/msgbuilder.h
+ M /server/src/game/include/vehicle.h
+ M /server/src/game/msgbuilder.cpp
+ M /server/src/game/vehicle.cpp
+ M /server/src/include/svnrevision.h
+
+mutlichar vhc fixes and access management
+------------------------------------------------------------------------
+r118 | Hammag | 2009-04-17 01:04:18 +0200 (Fri, 17 Apr 2009) | 1 line
+Changed paths:
+ M /server/src/game/commands.cpp
+ M /server/src/game/decoder/udp_appartment.cpp
+ M /server/src/game/decoder/udp_chat.cpp
+ M /server/src/game/decoder/udp_hack.cpp
+ M /server/src/game/decoder/udp_packet0.cpp
+ M /server/src/game/decoder/udp_ping.cpp
+ M /server/src/game/decoder/udp_popupresponse.cpp
+ M /server/src/game/decoder/udp_quickaccessbelt.cpp
+ M /server/src/game/decoder/udp_reqinfo.cpp
+ M /server/src/game/decoder/udp_subskill.cpp
+ M /server/src/game/decoder/udp_sync.cpp
+ M /server/src/game/decoder/udp_useobject.cpp
+ M /server/src/game/decoder/udp_vhc.cpp
+ M /server/src/game/decoder/udp_zoning.cpp
+ M /server/src/game/gamecommands/givemoney.cpp
+ M /server/src/game/gamecommands/jail.cpp
+ M /server/src/game/gamecommands/recall.cpp
+ M /server/src/game/gamecommands/takemoney.cpp
+ M /server/src/game/gamecommands/teleport.cpp
+ M /server/src/game/gamecommands/test.cpp
+ M /server/src/game/gamecommands/unjail.cpp
+ M /server/src/game/gamecommands/warp.cpp
+ M /server/src/game/gamecommands/warpto.cpp
+ M /server/src/game/include/client.h
+ M /server/src/game/include/vehicle.h
+ M /server/src/game/include/vhcaccessrequest.h
+ M /server/src/game/npc.cpp
+ M /server/src/game/terminal.cpp
+ M /server/src/game/terminal_tryaccess.cpp
+ M /server/src/game/vehicle.cpp
+ M /server/src/game/vhcaccessrequest.cpp
+ M /server/src/game/worldactors.cpp
+ M /server/src/include/svnrevision.h
+
+Continuation of work on vhc access requests
+------------------------------------------------------------------------
+r117 | Hammag | 2009-04-16 16:40:57 +0200 (Thu, 16 Apr 2009) | 1 line
+Changed paths:
+ M /server/src/game/chars.cpp
+ M /server/src/game/clientmanager.cpp
+ M /server/src/game/commands.cpp
+ M /server/src/game/decoder/udp_popupresponse.cpp
+ M /server/src/game/decoder/udp_popupresponse.h
+ M /server/src/game/decoder/udp_useobject.cpp
+ M /server/src/game/decoder/udp_vhc.cpp
+ M /server/src/game/decoder/udp_vhc.h
+ M /server/src/game/include/chars.h
+ M /server/src/game/include/clientmanager.h
+ M /server/src/game/include/msgbuilder.h
+ M /server/src/game/include/vehicle.h
+ M /server/src/game/msgbuilder.cpp
+ M /server/src/game/vehicle.cpp
+ M /server/src/game/vhcaccessrequest.cpp
+ M /server/src/include/svnrevision.h
+
+Intermediate rev. DO NOT USE
+------------------------------------------------------------------------
+r116 | Hammag | 2009-04-15 01:11:08 +0200 (Wed, 15 Apr 2009) | 1 line
+Changed paths:
+ M /server/src/game/decoder/udp_0x1f.cpp
+ A /server/src/game/decoder/udp_popupresponse.cpp
+ A /server/src/game/decoder/udp_popupresponse.h
+ M /server/src/game/decoder/udp_zoning.cpp
+ M /server/src/game/decoder/udp_zoning.h
+ A /server/src/game/include/vhcaccessrequest.h
+ A /server/src/game/vhcaccessrequest.cpp
+ M /server/src/include/svnrevision.h
+
+more work on vhc
+------------------------------------------------------------------------
+r115 | Hammag | 2009-04-14 17:56:30 +0200 (Tue, 14 Apr 2009) | 1 line
+Changed paths:
+ M /server/src/game/chars.cpp
+ M /server/src/game/decoder/udp_0x1f.cpp
+ M /server/src/game/decoder/udp_itemmove.cpp
+ A /server/src/game/decoder/udp_killself.cpp
+ A /server/src/game/decoder/udp_killself.h
+ M /server/src/game/decoder/udp_terminal.cpp
+ M /server/src/game/decoder/udp_useobject.cpp
+ M /server/src/game/decoder/udp_vhc.cpp
+ M /server/src/game/decoder/udp_zoning.cpp
+ M /server/src/game/include/chars.h
+ M /server/src/game/include/msgbuilder.h
+ M /server/src/game/include/vehicle.h
+ M /server/src/game/msgbuilder.cpp
+ M /server/src/game/vehicle.cpp
+ M /server/src/include/svnrevision.h
+
+various minor things
+------------------------------------------------------------------------
+r114 | Hammag | 2009-04-13 01:20:51 +0200 (Mon, 13 Apr 2009) | 1 line
+Changed paths:
+ M /server/src/game/decoder/udp_0x13.cpp
+ M /server/src/game/decoder/udp_useobject.cpp
+ M /server/src/game/decoder/udp_vhc.cpp
+ M /server/src/game/decoder/udp_vhc.h
+ M /server/src/game/def/def_vehicles.cpp
+ M /server/src/game/include/def_vehicles.h
+ M /server/src/game/include/msgbuilder.h
+ M /server/src/game/include/vehicle.h
+ M /server/src/game/msgbuilder.cpp
+ M /server/src/game/vehicle.cpp
+ M /server/src/include/svnrevision.h
+
+Some work on vehicles
+------------------------------------------------------------------------
+r113 | Hammag | 2009-04-11 23:40:02 +0200 (Sat, 11 Apr 2009) | 1 line
+Changed paths:
+ M /server/CHANGELOG
+ M /server/src/common/misc/misc.cpp
+ M /server/src/game/appartements.cpp
+ M /server/src/game/container.cpp
+ M /server/src/game/decoder/udp_charmove.cpp
+ M /server/src/game/decoder/udp_useobject.cpp
+ M /server/src/game/decoder/udp_zoning.cpp
+ M /server/src/game/def/def_ammo.cpp
+ M /server/src/game/def/def_itemcontainer.cpp
+ M /server/src/game/def/def_items.cpp
+ M /server/src/game/def/def_npc.cpp
+ M /server/src/game/def/def_npcgroupspawn.cpp
+ M /server/src/game/def/def_trader.cpp
+ M /server/src/game/def/def_weather.cpp
+ M /server/src/game/def/def_worlds.cpp
+ M /server/src/game/gameserver.cpp
+ M /server/src/game/include/container.h
+ M /server/src/game/include/def_itemcontainer.h
+ M /server/src/game/include/def_items.h
+ M /server/src/game/include/gameserver.h
+ M /server/src/game/item.cpp
+ M /server/src/include/misc.h
+ M /server/src/include/svnrevision.h
+
+More .def files supported
+------------------------------------------------------------------------
+r112 | Hammag | 2009-04-07 00:46:45 +0200 (Tue, 07 Apr 2009) | 1 line
+Changed paths:
+ M /server/src/game/decoder/udp_vhc.cpp
+ M /server/src/game/decoder/udp_vhc.h
+ M /server/src/game/def/def_vehicles.cpp
+ M /server/src/game/def/def_vehiclesits.cpp
+ M /server/src/game/include/def_vehicles.h
+ M /server/src/game/msgbuilder.cpp
+ M /server/src/include/svnrevision.h
+
+Implement vehicles.def and vehiclesits.def support
+------------------------------------------------------------------------
+r111 | Hammag | 2009-04-04 16:49:02 +0200 (Sat, 04 Apr 2009) | 1 line
+Changed paths:
+ M /server/CHANGELOG
+ A /server/src/game/def/def_actionmod.cpp
+ A /server/src/game/def/def_ammo.cpp
+ M /server/src/game/def/def_appartements.cpp
+ M /server/src/game/def/def_appplaces.cpp
+ A /server/src/game/def/def_blueprintpieces.cpp
+ M /server/src/game/def/def_characters.cpp
+ A /server/src/game/def/def_charaction.cpp
+ A /server/src/game/def/def_damage.cpp
+ A /server/src/game/def/def_drugs.cpp
+ M /server/src/game/def/def_factions.cpp
+ M /server/src/game/def/def_hack.cpp
+ A /server/src/game/def/def_itemcontainer.cpp
+ A /server/src/game/def/def_itemmod.cpp
+ A /server/src/game/def/def_itemres.cpp
+ M /server/src/game/def/def_items.cpp
+ A /server/src/game/def/def_mission.cpp
+ A /server/src/game/def/def_npc.cpp
+ A /server/src/game/def/def_npcarmor.cpp
+ A /server/src/game/def/def_npcgroupspawn.cpp
+ A /server/src/game/def/def_outposts.cpp
+ A /server/src/game/def/def_recycles.cpp
+ M /server/src/game/def/def_respawn.cpp
+ A /server/src/game/def/def_shots.cpp
+ A /server/src/game/def/def_trader.cpp
+ A /server/src/game/def/def_vehicles.cpp
+ A /server/src/game/def/def_vehiclesits.cpp
+ M /server/src/game/def/def_weapons.cpp
+ A /server/src/game/def/def_weather.cpp
+ M /server/src/game/def/def_worldfile.cpp
+ M /server/src/game/def/def_worldmodels.cpp
+ M /server/src/game/def/def_worlds.cpp
+ M /server/src/game/def/gamedefs.cpp
+ M /server/src/game/def/main.h
+ A /server/src/game/include/def.h
+ A /server/src/game/include/def_actionmod.h
+ A /server/src/game/include/def_ammo.h
+ M /server/src/game/include/def_appartements.h
+ M /server/src/game/include/def_appplaces.h
+ A /server/src/game/include/def_blueprintpieces.h
+ M /server/src/game/include/def_characters.h
+ A /server/src/game/include/def_charaction.h
+ M /server/src/game/include/def_charkinds.h
+ A /server/src/game/include/def_damage.h
+ A /server/src/game/include/def_drugs.h
+ M /server/src/game/include/def_factions.h
+ M /server/src/game/include/def_hack.h
+ A /server/src/game/include/def_implants.h
+ A /server/src/game/include/def_itemcontainer.h
+ A /server/src/game/include/def_itemmod.h
+ A /server/src/game/include/def_itemres.h
+ M /server/src/game/include/def_items.h
+ A /server/src/game/include/def_mission.h
+ A /server/src/game/include/def_npc.h
+ A /server/src/game/include/def_npcarmor.h
+ A /server/src/game/include/def_npcgroupspawn.h
+ A /server/src/game/include/def_outposts.h
+ A /server/src/game/include/def_recycles.h
+ M /server/src/game/include/def_respawn.h
+ A /server/src/game/include/def_shots.h
+ M /server/src/game/include/def_skills.h
+ M /server/src/game/include/def_subskills.h
+ A /server/src/game/include/def_trader.h
+ A /server/src/game/include/def_vehicles.h
+ A /server/src/game/include/def_vehiclesits.h
+ M /server/src/game/include/def_weapons.h
+ A /server/src/game/include/def_weather.h
+ M /server/src/game/include/def_worldfile.h
+ M /server/src/game/include/def_worldmodels.h
+ M /server/src/game/include/def_worlds.h
+ M /server/src/game/include/defmap.h
+ M /server/src/game/include/defs.h
+ M /server/src/game/include/gamedefs.h
+ M /server/src/include/svnrevision.h
+
+Declarations and start of definition for .def files support
+------------------------------------------------------------------------
+r110 | Hammag | 2009-03-31 02:40:13 +0200 (Tue, 31 Mar 2009) | 1 line
+Changed paths:
+ M /server/CHANGELOG
+ M /server/src/game/appartements.cpp
+ M /server/src/game/chars.cpp
+ M /server/src/game/container.cpp
+ M /server/src/game/decoder/udp_hack.cpp
+ M /server/src/game/decoder/udp_useobject.cpp
+ M /server/src/game/decoder/udp_zoning.cpp
+ M /server/src/game/def/def_charkinds.cpp
+ M /server/src/game/def/def_items.cpp
+ M /server/src/game/def/def_respawn.cpp
+ M /server/src/game/def/def_skills.cpp
+ M /server/src/game/def/def_worldfile.cpp
+ M /server/src/game/def/gamedefs.cpp
+ M /server/src/game/def/world_datparser.cpp
+ M /server/src/game/include/def_appartements.h
+ M /server/src/game/include/def_hack.h
+ M /server/src/game/include/def_items.h
+ M /server/src/game/include/def_respawn.h
+ M /server/src/game/include/def_weapons.h
+ M /server/src/game/include/def_worldfile.h
+ A /server/src/game/include/defmap.h
+ M /server/src/game/include/defs.h
+ M /server/src/game/include/gamedefs.h
+ M /server/src/game/include/gamescript.h
+ M /server/src/game/item.cpp
+ M /server/src/game/main.h
+ M /server/src/game/msgbuilder.cpp
+ M /server/src/game/worldactors.cpp
+ M /server/src/game/worlds.cpp
+ M /server/src/include/svnrevision.h
+
+gamedefs architecture revamping
+------------------------------------------------------------------------
+r109 | Hammag | 2009-03-30 16:34:46 +0200 (Mon, 30 Mar 2009) | 1 line
+Changed paths:
+ M /server/CHANGELOG
+ M /server/src/game/decoder/udp_itemmove.cpp
+ M /server/src/game/def/def_items.cpp
+ A /server/src/game/def/def_weapons.cpp
+ M /server/src/game/def/gamedefs.cpp
+ M /server/src/game/def/main.h
+ A /server/src/game/include/def_weapons.h
+ M /server/src/game/include/defs.h
+ M /server/src/game/include/gamedefs.h
+ M /server/src/game/msgbuilder.cpp
+ M /server/src/include/svnrevision.h
+
+Added support for weapons.def
+------------------------------------------------------------------------
+r108 | Hammag | 2009-03-28 20:02:40 +0100 (Sat, 28 Mar 2009) | 1 line
+Changed paths:
+ M /server/CHANGELOG
+ A /server/database/GameDB.sql
+ D /server/database/GameDB5_to_GameDB6.sql
+ D /server/database/GameDB6.zip
+ A /server/database/GameDB_migration_rev107-rev108.sql
+ A /server/database/GameDB_migration_rev81-rev82.sql (from /server/database/GameDB5_to_GameDB6.sql:102)
+ A /server/database/InfoDB.sql
+ D /server/database/InfoDB2.zip
+ M /server/src/game/include/item.h
+ M /server/src/game/include/npc.h
+ M /server/src/game/msgbuilder.cpp
+ M /server/src/game/npc.cpp
+ M /server/src/include/svnrevision.h
+
+Database, inventory and subway changes
+------------------------------------------------------------------------
+r107 | Hammag | 2009-03-28 10:46:49 +0100 (Sat, 28 Mar 2009) | 1 line
+Changed paths:
+ M /server/src/game/commands.cpp
+ M /server/src/game/decoder/udp_charmove.cpp
+ M /server/src/game/decoder/udp_useobject.cpp
+ M /server/src/game/include/msgbuilder.h
+ M /server/src/game/msgbuilder.cpp
+ M /server/src/include/svnrevision.h
+
+Subway cab entering fix
+------------------------------------------------------------------------
+r106 | Hammag | 2009-03-27 20:22:48 +0100 (Fri, 27 Mar 2009) | 1 line
+Changed paths:
+ M /server/src/game/chars.cpp
+ M /server/src/game/container.cpp
+ M /server/src/game/decoder/udp_0x13.cpp
+ M /server/src/game/decoder/udp_0x1f.cpp
+ M /server/src/game/decoder/udp_charmove.cpp
+ A /server/src/game/decoder/udp_helditemaction.cpp
+ A /server/src/game/decoder/udp_helditemaction.h
+ M /server/src/game/decoder/udp_itemmove.cpp
+ M /server/src/game/decoder/udp_itemmove.h
+ M /server/src/game/gamecommands/t.cpp
+ M /server/src/game/gamecommands/v.cpp
+ M /server/src/game/include/chars.h
+ M /server/src/game/include/item.h
+ M /server/src/game/include/msgbuilder.h
+ M /server/src/game/item.cpp
+ M /server/src/game/msgbuilder.cpp
+ M /server/src/game/skill.cpp
+ M /server/src/include/svnrevision.h
+
+Experiments on item attributes encoding
+------------------------------------------------------------------------
+r105 | Hammag | 2009-03-20 14:22:21 +0100 (Fri, 20 Mar 2009) | 1 line
+Changed paths:
+ M /server/CHANGELOG
+ M /server/src/game/chars.cpp
+ M /server/src/game/decoder/udp_0x1f.cpp
+ A /server/src/game/decoder/udp_outfitter.cpp
+ A /server/src/game/decoder/udp_outfitter.h
+ M /server/src/game/def/def_characters.cpp
+ M /server/src/game/include/def_characters.h
+ M /server/src/include/svnrevision.h
+
+Outfitter implementation
+------------------------------------------------------------------------
+r104 | Hammag | 2009-03-19 23:01:19 +0100 (Thu, 19 Mar 2009) | 1 line
+Changed paths:
+ M /server/CHANGELOG
+ M /server/src/game/decoder/udp_0x1f.cpp
+ M /server/src/game/decoder/udp_entityposreq.cpp
+ M /server/src/game/decoder/udp_useobject.cpp
+ M /server/src/game/decoder/udp_zoning.cpp
+ M /server/src/game/decoder/udp_zoning.h
+ M /server/src/game/include/msgbuilder.h
+ M /server/src/game/include/worlddatatemplate.h
+ M /server/src/game/msgbuilder.cpp
+ M /server/src/game/worlddatatemplate.cpp
+ M /server/src/include/svnrevision.h
+
+Apt Genrep code fixes, Venture Wrap implementation
+------------------------------------------------------------------------
+r103 | Hammag | 2009-03-15 19:24:33 +0100 (Sun, 15 Mar 2009) | 1 line
+Changed paths:
+ M /server
+ M /server/CHANGELOG
+ M /server/src
+ M /server/src/Makefile
+ M /server/src/common/netcode/connection-tcp.cpp
+ M /server/src/common/netcode/connection-udp.cpp
+ M /server/src/common/netcode/message.cpp
+ M /server/src/dev-tools
+ M /server/src/game/chat.cpp
+ M /server/src/game/container.cpp
+ M /server/src/game/decoder/udp_chat.cpp
+ M /server/src/game/decoder/udp_terminal.cpp
+ M /server/src/game/decoder/udp_zoning.cpp
+ M /server/src/game/gamecommands/debug.cpp
+ M /server/src/game/include/chat.h
+ M /server/src/game/include/client.h
+ M /server/src/game/include/def_items.h
+ M /server/src/game/include/doortemplate.h
+ M /server/src/game/include/furnituretemplate.h
+ M /server/src/game/include/item.h
+ M /server/src/game/subway.cpp
+ M /server/src/game/vehicle.cpp
+ M /server/src/include/message.h
+ M /server/src/include/svnrevision.h
+ A /server/src/options.local.exemple
+
+Fixed various compilation warnings
+------------------------------------------------------------------------
+r102 | Akiko | 2008-08-26 21:21:14 +0200 (Tue, 26 Aug 2008) | 5 lines
+Changed paths:
+ M /server/src/Makefile
+ M /server/src/common/config/config.cpp
+ M /server/src/game/accounts.cpp
+ M /server/src/game/appartements.cpp
+ M /server/src/game/buddylist.cpp
+ M /server/src/game/chars.cpp
+ M /server/src/game/commands.cpp
+ M /server/src/game/container.cpp
+ M /server/src/game/def/def_appartements.cpp
+ M /server/src/game/def/def_appplaces.cpp
+ M /server/src/game/def/def_characters.cpp
+ M /server/src/game/def/def_charkinds.cpp
+ M /server/src/game/def/def_factions.cpp
+ M /server/src/game/def/def_hack.cpp
+ M /server/src/game/def/def_items.cpp
+ M /server/src/game/def/def_respawn.cpp
+ M /server/src/game/def/def_skills.cpp
+ M /server/src/game/def/def_subskills.cpp
+ M /server/src/game/def/def_worldfile.cpp
+ M /server/src/game/def/def_worldmodels.cpp
+ M /server/src/game/def/def_worlds.cpp
+ M /server/src/game/genreplist.cpp
+ M /server/src/game/include/worldactors.h
+ M /server/src/game/npc.cpp
+ M /server/src/game/terminal.cpp
+ M /server/src/game/worldactors.cpp
+ M /server/src/include/svnrevision.h
+ M /server/src/info/accounts.cpp
+
+- temporarly removed -Werrors option to stop breaking on gcc 4.3
+- who the fuck moved the atoi c-function into the std namespace of
+ c++?!? I want to see the system where that compiles!
+
+
+------------------------------------------------------------------------
+r101 | Akiko | 2008-08-26 19:31:07 +0200 (Tue, 26 Aug 2008) | 4 lines
+Changed paths:
+ A /docs (from /trunk/docs:100)
+ A /server (from /trunk/tinns-v2:100)
+ A /tools (from /trunk/tools:100)
+ D /trunk
+
+- refreshed directory struture
+- removed obsolete stuff
+
+
+------------------------------------------------------------------------
+r100 | Hammag | 2008-04-20 00:52:32 +0200 (Sun, 20 Apr 2008) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/src/game/chars.cpp
+ M /trunk/tinns-v2/src/game/client.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_useobject.cpp
+ M /trunk/tinns-v2/src/game/gameserver.cpp
+ M /trunk/tinns-v2/src/game/include/item.h
+ M /trunk/tinns-v2/src/game/include/msgbuilder.h
+ M /trunk/tinns-v2/src/game/item.cpp
+ M /trunk/tinns-v2/src/game/msgbuilder.cpp
+ M /trunk/tinns-v2/src/include/svnrevision.h
+
+Trader testing & Initial inventory fix
+------------------------------------------------------------------------
+r99 | Hammag | 2008-02-11 20:38:32 +0100 (Mon, 11 Feb 2008) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/src/game/decoder/udp_terminal.cpp
+ M /trunk/tinns-v2/src/include/svnrevision.h
+
+Fixed a (dumb) compilation issue
+------------------------------------------------------------------------
+r98 | Hammag | 2008-02-02 16:10:16 +0100 (Sat, 02 Feb 2008) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/src/include/svnrevision.h
+ M /trunk/tinns-v2/src/info/accounts.cpp
+
+Correction of the account creation/update SQL query
+------------------------------------------------------------------------
+r97 | Hammag | 2008-01-20 20:10:22 +0100 (Sun, 20 Jan 2008) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/src/common/console/console.cpp
+ M /trunk/tinns-v2/src/common/misc/misc.cpp
+ M /trunk/tinns-v2/src/common/netcode/message.cpp
+ M /trunk/tinns-v2/src/game/accounts.cpp
+ M /trunk/tinns-v2/src/game/appartements.cpp
+ M /trunk/tinns-v2/src/game/chars.cpp
+ M /trunk/tinns-v2/src/game/chat.cpp
+ M /trunk/tinns-v2/src/game/container.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_reqinfo.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_terminal.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/rawf.cpp
+ M /trunk/tinns-v2/src/game/gameserver.cpp
+ M /trunk/tinns-v2/src/game/globals.cpp
+ M /trunk/tinns-v2/src/game/include/sql.h
+ M /trunk/tinns-v2/src/game/npc.cpp
+ M /trunk/tinns-v2/src/game/sql.cpp
+ M /trunk/tinns-v2/src/game/terminal.cpp
+ M /trunk/tinns-v2/src/game/worldactors.cpp
+ M /trunk/tinns-v2/src/include/svnrevision.h
+ M /trunk/tinns-v2/src/info/accounts.cpp
+ M /trunk/tinns-v2/src/info/sql.cpp
+ M /trunk/tinns-v2/src/info/sql.h
+ M /trunk/tinns-v2/src/patch/patchserver.cpp
+
+Correction of some string-related security issues
+------------------------------------------------------------------------
+r96 | Hammag | 2007-12-28 00:52:21 +0100 (Fri, 28 Dec 2007) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/src/game/appartements.cpp
+ M /trunk/tinns-v2/src/game/chars.cpp
+ M /trunk/tinns-v2/src/game/client.cpp
+ M /trunk/tinns-v2/src/game/clientmanager.cpp
+ M /trunk/tinns-v2/src/game/decoder/main.h
+ M /trunk/tinns-v2/src/game/decoder/udp_0x13.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_charmove.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_charmove.h
+ M /trunk/tinns-v2/src/game/decoder/udp_sync.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_terminal.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_terminal.h
+ M /trunk/tinns-v2/src/game/decoder/udp_useobject.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_vhc.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_vhc.h
+ M /trunk/tinns-v2/src/game/decoder/udp_zoning.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/main.h
+ M /trunk/tinns-v2/src/game/include/chars.h
+ M /trunk/tinns-v2/src/game/include/client.h
+ M /trunk/tinns-v2/src/game/include/globals.h
+ M /trunk/tinns-v2/src/game/include/msgbuilder.h
+ M /trunk/tinns-v2/src/game/include/subway.h
+ M /trunk/tinns-v2/src/game/include/vehicle.h
+ M /trunk/tinns-v2/src/game/include/worlds.h
+ M /trunk/tinns-v2/src/game/main.h
+ M /trunk/tinns-v2/src/game/msgbuilder.cpp
+ M /trunk/tinns-v2/src/game/vehicle.cpp
+ M /trunk/tinns-v2/src/game/worlds.cpp
+ M /trunk/tinns-v2/src/include/svnrevision.h
+
+Vehicles basis
+------------------------------------------------------------------------
+r95 | Hammag | 2007-11-18 18:51:25 +0100 (Sun, 18 Nov 2007) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/src/game/subway.cpp
+ M /trunk/tinns-v2/src/include/svnrevision.h
+
+Small removal of a debug log
+------------------------------------------------------------------------
+r94 | Hammag | 2007-11-18 18:41:38 +0100 (Sun, 18 Nov 2007) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/src/game/chars.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_charmove.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_terminal.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_terminal.h
+ M /trunk/tinns-v2/src/game/decoder/udp_useobject.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_vhc.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/debug.cpp
+ M /trunk/tinns-v2/src/game/include/chars.h
+ M /trunk/tinns-v2/src/game/include/client.h
+ M /trunk/tinns-v2/src/game/include/msgbuilder.h
+ M /trunk/tinns-v2/src/game/include/subway.h
+ M /trunk/tinns-v2/src/game/msgbuilder.cpp
+ M /trunk/tinns-v2/src/game/subway.cpp
+ M /trunk/tinns-v2/src/include/svnrevision.h
+
+Subway should be working now
+------------------------------------------------------------------------
+r93 | Hammag | 2007-11-09 23:27:43 +0100 (Fri, 09 Nov 2007) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/src/game/chars.cpp
+ M /trunk/tinns-v2/src/game/client.cpp
+ M /trunk/tinns-v2/src/game/clientmanager.cpp
+ M /trunk/tinns-v2/src/game/container.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_0x13.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_charmove.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_sync.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_useobject.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_vhc.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_vhc.h
+ M /trunk/tinns-v2/src/game/decoder/udp_zoning.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/t.cpp
+ M /trunk/tinns-v2/src/game/gameserver.cpp
+ M /trunk/tinns-v2/src/game/globals.cpp
+ M /trunk/tinns-v2/src/game/include/chars.h
+ M /trunk/tinns-v2/src/game/include/globals.h
+ M /trunk/tinns-v2/src/game/include/msgbuilder.h
+ A /trunk/tinns-v2/src/game/include/subway.h
+ M /trunk/tinns-v2/src/game/include/worlds.h
+ M /trunk/tinns-v2/src/game/msgbuilder.cpp
+ A /trunk/tinns-v2/src/game/subway.cpp
+ M /trunk/tinns-v2/src/game/worldactors.cpp
+ M /trunk/tinns-v2/src/game/zoning.cpp
+ M /trunk/tinns-v2/src/include/message.h
+ M /trunk/tinns-v2/src/include/svnrevision.h
+
+Neocron city subway
+------------------------------------------------------------------------
+r92 | Hammag | 2007-10-28 16:32:43 +0100 (Sun, 28 Oct 2007) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/src/game/client.cpp
+ M /trunk/tinns-v2/src/game/container.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_entityposreq.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_itemmove.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_useobject.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/warpto.cpp
+ M /trunk/tinns-v2/src/game/include/client.h
+ M /trunk/tinns-v2/src/game/include/container.h
+ M /trunk/tinns-v2/src/game/msgbuilder.cpp
+ M /trunk/tinns-v2/src/include/svnrevision.h
+
+Warpto working
+------------------------------------------------------------------------
+r91 | Hammag | 2007-10-27 18:43:27 +0200 (Sat, 27 Oct 2007) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/src/game/appartements.cpp
+ M /trunk/tinns-v2/src/game/client.cpp
+ A /trunk/tinns-v2/src/game/container.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_useobject.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_zoning.cpp
+ M /trunk/tinns-v2/src/game/def/gamedefs.cpp
+ M /trunk/tinns-v2/src/game/gameserver.cpp
+ A /trunk/tinns-v2/src/game/include/container.h
+ M /trunk/tinns-v2/src/game/include/gamedefs.h
+ M /trunk/tinns-v2/src/game/include/worlddatatemplate.h
+ M /trunk/tinns-v2/src/game/include/worlds.h
+ M /trunk/tinns-v2/src/game/msgbuilder.cpp
+ M /trunk/tinns-v2/src/game/worlddatatemplate.cpp
+ M /trunk/tinns-v2/src/game/worlds.cpp
+ M /trunk/tinns-v2/src/game/zoning.cpp
+ M /trunk/tinns-v2/src/include/svnrevision.h
+
+Zoning fix and random box content improvement
+------------------------------------------------------------------------
+r90 | Hammag | 2007-10-25 08:56:07 +0200 (Thu, 25 Oct 2007) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/src/game/chars.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_0x13.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_0x1f.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_itemmove.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_itemmove.h
+ M /trunk/tinns-v2/src/game/decoder/udp_useobject.cpp
+ M /trunk/tinns-v2/src/game/def/world_datparser.cpp
+ M /trunk/tinns-v2/src/game/gameserver.cpp
+ M /trunk/tinns-v2/src/game/include/chars.h
+ M /trunk/tinns-v2/src/game/include/inventory.h
+ M /trunk/tinns-v2/src/game/include/item.h
+ M /trunk/tinns-v2/src/game/include/msgbuilder.h
+ M /trunk/tinns-v2/src/game/include/msgdecoder.h
+ M /trunk/tinns-v2/src/game/inventory.cpp
+ M /trunk/tinns-v2/src/game/msgbuilder.cpp
+ M /trunk/tinns-v2/src/include/svnrevision.h
+
+Item management changes - CHANGELOG not updated
+------------------------------------------------------------------------
+r89 | Hammag | 2007-09-02 23:40:04 +0200 (Sun, 02 Sep 2007) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/src/game/chars.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_itemmove.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_itemmove.h
+ M /trunk/tinns-v2/src/game/decoder/udp_quickaccessbelt.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_quickaccessbelt.h
+ M /trunk/tinns-v2/src/game/include/chars.h
+ M /trunk/tinns-v2/src/game/include/inventory.h
+ M /trunk/tinns-v2/src/game/include/item.h
+ M /trunk/tinns-v2/src/game/inventory.cpp
+ M /trunk/tinns-v2/src/game/msgbuilder.cpp
+ M /trunk/tinns-v2/src/include/svnrevision.h
+
+Some more work on containers
+------------------------------------------------------------------------
+r88 | Hammag | 2007-08-17 17:08:12 +0200 (Fri, 17 Aug 2007) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/src/game/chars.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_itemmove.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_quickaccessbelt.cpp
+ M /trunk/tinns-v2/src/game/include/chars.h
+ M /trunk/tinns-v2/src/game/include/def_items.h
+ M /trunk/tinns-v2/src/game/include/inventory.h
+ M /trunk/tinns-v2/src/game/include/item.h
+ M /trunk/tinns-v2/src/game/include/msgbuilder.h
+ M /trunk/tinns-v2/src/game/inventory.cpp
+ M /trunk/tinns-v2/src/game/item.cpp
+ M /trunk/tinns-v2/src/game/msgbuilder.cpp
+ M /trunk/tinns-v2/src/include/svnrevision.h
+
+Intermediate dev rev: Item management changes
+------------------------------------------------------------------------
+r87 | Hammag | 2007-07-15 19:00:31 +0200 (Sun, 15 Jul 2007) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/WORK_IN_PROGRESS
+ M /trunk/tinns-v2/conf/gameserver.conf
+ M /trunk/tinns-v2/conf/global.conf
+ M /trunk/tinns-v2/conf/infoserver.conf
+ M /trunk/tinns-v2/src/common/config/config.cpp
+ M /trunk/tinns-v2/src/game/Makefile
+ M /trunk/tinns-v2/src/game/accounts.cpp
+ M /trunk/tinns-v2/src/game/appartements.cpp
+ M /trunk/tinns-v2/src/game/chars.cpp
+ M /trunk/tinns-v2/src/game/configtemplate.h
+ M /trunk/tinns-v2/src/game/decoder/udp_itemmove.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_zoning.cpp
+ M /trunk/tinns-v2/src/game/gameserver.cpp
+ M /trunk/tinns-v2/src/game/globals.cpp
+ M /trunk/tinns-v2/src/game/include/accounts.h
+ M /trunk/tinns-v2/src/game/include/appartements.h
+ M /trunk/tinns-v2/src/game/include/chars.h
+ M /trunk/tinns-v2/src/game/include/sql.h
+ M /trunk/tinns-v2/src/game/main.cpp
+ M /trunk/tinns-v2/src/game/msgbuilder.cpp
+ M /trunk/tinns-v2/src/game/sql.cpp
+ M /trunk/tinns-v2/src/game/worlds.cpp
+ M /trunk/tinns-v2/src/game/zoning.cpp
+ M /trunk/tinns-v2/src/include/config.h
+ M /trunk/tinns-v2/src/include/regex++.h
+ M /trunk/tinns-v2/src/include/svnrevision.h
+ M /trunk/tinns-v2/src/info/Makefile
+ M /trunk/tinns-v2/src/info/accounts.cpp
+ M /trunk/tinns-v2/src/info/accounts.h
+ M /trunk/tinns-v2/src/info/client.cpp
+ M /trunk/tinns-v2/src/info/client.h
+ M /trunk/tinns-v2/src/info/configtemplate.h
+ M /trunk/tinns-v2/src/info/globals.cpp
+ M /trunk/tinns-v2/src/info/globals.h
+ M /trunk/tinns-v2/src/info/infoserver.cpp
+ M /trunk/tinns-v2/src/info/main.cpp
+ M /trunk/tinns-v2/src/info/sql.h
+ M /trunk/tinns-v2/src/patch/Makefile
+
+config include directive and PCRE names filters
+------------------------------------------------------------------------
+r86 | Hammag | 2007-06-21 01:44:21 +0200 (Thu, 21 Jun 2007) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/src/game/decoder/udp_entityposreq.cpp
+ M /trunk/tinns-v2/src/include/svnrevision.h
+
+small bugfix
+------------------------------------------------------------------------
+r85 | Hammag | 2007-06-19 21:11:22 +0200 (Tue, 19 Jun 2007) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/WORK_IN_PROGRESS
+ M /trunk/tinns-v2/src/game/decoder/udp_charmove.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_entityposreq.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_sync.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_useobject.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_zoning.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_zoning.h
+ M /trunk/tinns-v2/src/game/gamecommands/warp.cpp
+ M /trunk/tinns-v2/src/game/include/msgbuilder.h
+ M /trunk/tinns-v2/src/game/msgbuilder.cpp
+ M /trunk/tinns-v2/src/game/worlddatatemplate.cpp
+ M /trunk/tinns-v2/src/include/svnrevision.h
+
+Fixed most zoning
+------------------------------------------------------------------------
+r84 | Hammag | 2007-06-09 00:07:43 +0200 (Sat, 09 Jun 2007) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/WORK_IN_PROGRESS
+ M /trunk/tinns-v2/src/common/netcode/connection-udp.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_0x22.cpp
+ A /trunk/tinns-v2/src/game/decoder/udp_entityposreq.cpp
+ A /trunk/tinns-v2/src/game/decoder/udp_entityposreq.h
+ M /trunk/tinns-v2/src/game/decoder/udp_useobject.cpp
+ M /trunk/tinns-v2/src/game/def/world_datparser.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/h.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/setlevel.cpp
+ M /trunk/tinns-v2/src/game/include/msgbuilder.h
+ M /trunk/tinns-v2/src/game/include/worlddatatemplate.h
+ M /trunk/tinns-v2/src/game/include/worlds.h
+ M /trunk/tinns-v2/src/game/msgbuilder.cpp
+ M /trunk/tinns-v2/src/game/worlddatatemplate.cpp
+ M /trunk/tinns-v2/src/include/svnrevision.h
+
+UDP OOO management crash bugfix
+------------------------------------------------------------------------
+r83 | Hammag | 2007-06-05 01:36:04 +0200 (Tue, 05 Jun 2007) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/src/common/netcode/message.cpp
+ M /trunk/tinns-v2/src/game/chars.cpp
+ M /trunk/tinns-v2/src/game/chat.cpp
+ M /trunk/tinns-v2/src/game/client.cpp
+ M /trunk/tinns-v2/src/game/clientmanager.cpp
+ M /trunk/tinns-v2/src/game/decoder/msgdecoder.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_0x13.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_charmove.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_charmove.h
+ M /trunk/tinns-v2/src/game/decoder/udp_packet0.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_useobject.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_zoning.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/h.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/t.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/v.cpp
+ M /trunk/tinns-v2/src/game/gameserver.cpp
+ M /trunk/tinns-v2/src/game/include/chars.h
+ M /trunk/tinns-v2/src/game/include/client.h
+ M /trunk/tinns-v2/src/game/include/clientmanager.h
+ M /trunk/tinns-v2/src/game/include/gameserver.h
+ M /trunk/tinns-v2/src/game/include/msgbuilder.h
+ M /trunk/tinns-v2/src/game/msgbuilder.cpp
+ M /trunk/tinns-v2/src/include/message.h
+ M /trunk/tinns-v2/src/include/svnrevision.h
+
+multiuser crashbug fix (try) - movement improvements
+------------------------------------------------------------------------
+r82 | Hammag | 2007-05-28 23:25:02 +0200 (Mon, 28 May 2007) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ D /trunk/tinns-v2/database/GameDB4_to_GameDB5.sql
+ D /trunk/tinns-v2/database/GameDB5.zip
+ A /trunk/tinns-v2/database/GameDB5_to_GameDB6.sql
+ A /trunk/tinns-v2/database/GameDB6.zip
+ D /trunk/tinns-v2/database/tinns_sqldumb_rev77.zip
+ M /trunk/tinns-v2/src/common/netcode/connection-udp.cpp
+ M /trunk/tinns-v2/src/common/netcode/message.cpp
+ M /trunk/tinns-v2/src/common/netcode/udpmanager.cpp
+ M /trunk/tinns-v2/src/game/accounts.cpp
+ M /trunk/tinns-v2/src/game/chars.cpp
+ M /trunk/tinns-v2/src/game/chat.cpp
+ M /trunk/tinns-v2/src/game/client.cpp
+ M /trunk/tinns-v2/src/game/commands.cpp
+ D /trunk/tinns-v2/src/game/database.cpp
+ M /trunk/tinns-v2/src/game/decoder/main.h
+ M /trunk/tinns-v2/src/game/decoder/udp_chat.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_useobject.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/ban.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/givemoney.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/h.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/info.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/jail.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/kick.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/main.h
+ M /trunk/tinns-v2/src/game/gamecommands/recall.cpp
+ D /trunk/tinns-v2/src/game/gamecommands/rehash.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/setlevel.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/shun.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/skin.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/takemoney.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/teleport.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/unjail.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/unshun.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/warpto.cpp
+ M /trunk/tinns-v2/src/game/gameserver.cpp
+ M /trunk/tinns-v2/src/game/globals.cpp
+ M /trunk/tinns-v2/src/game/include/accounts.h
+ M /trunk/tinns-v2/src/game/include/chars.h
+ M /trunk/tinns-v2/src/game/include/client.h
+ M /trunk/tinns-v2/src/game/include/commands.h
+ D /trunk/tinns-v2/src/game/include/database.h
+ M /trunk/tinns-v2/src/game/include/globals.h
+ M /trunk/tinns-v2/src/game/main.cpp
+ M /trunk/tinns-v2/src/game/main.h
+ M /trunk/tinns-v2/src/game/sql.cpp
+ M /trunk/tinns-v2/src/game/terminal_tryaccess.cpp
+ M /trunk/tinns-v2/src/game/zoning.cpp
+ M /trunk/tinns-v2/src/include/message.h
+ M /trunk/tinns-v2/src/include/svnrevision.h
+
+Changed for dynamic account and char management
+------------------------------------------------------------------------
+r81 | Hammag | 2007-05-27 12:11:18 +0200 (Sun, 27 May 2007) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/src/Makefile
+ M /trunk/tinns-v2/src/dev-tools/Makefile
+ M /trunk/tinns-v2/src/dev-tools/setsvnrev
+ M /trunk/tinns-v2/src/game/decoder/udp_appartment.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_appartment.h
+ M /trunk/tinns-v2/src/include/svnrevision.h
+
+Disable use of getsvnrev. Other minor changes
+------------------------------------------------------------------------
+r80 | Namikon | 2007-01-13 10:59:05 +0100 (Sat, 13 Jan 2007) | 3 lines
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/src/game/decoder/udp_terminal.cpp
+ M /trunk/tinns-v2/src/game/include/terminal.h
+ M /trunk/tinns-v2/src/game/npc.cpp
+ M /trunk/tinns-v2/src/game/terminal.cpp
+ A /trunk/tinns-v2/src/game/terminal_receivedb.cpp
+ A /trunk/tinns-v2/src/game/terminal_servermessage.cpp
+ A /trunk/tinns-v2/src/game/terminal_tryaccess.cpp
+ A /trunk/tinns-v2/src/game/terminal_updatedb.cpp
+ M /trunk/tinns-v2/src/include/version.h
+
+- Added a few comments in npc.cpp and removed most debug outputs
+- Splitted up terminal.cpp into 5 files (All stuff in one file will get too big later)
+- Moved TryAccess handling for terminal stuff to PTerminal class
+------------------------------------------------------------------------
+r79 | Namikon | 2007-01-11 19:33:07 +0100 (Thu, 11 Jan 2007) | 5 lines
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/src/game/decoder/main.h
+ M /trunk/tinns-v2/src/game/decoder/udp_0x13.cpp
+ A /trunk/tinns-v2/src/game/decoder/udp_0x2b.cpp
+ A /trunk/tinns-v2/src/game/decoder/udp_0x2b.h
+ A /trunk/tinns-v2/src/game/decoder/udp_terminal.cpp
+ A /trunk/tinns-v2/src/game/decoder/udp_terminal.h
+ M /trunk/tinns-v2/src/game/globals.cpp
+ M /trunk/tinns-v2/src/game/include/globals.h
+ A /trunk/tinns-v2/src/game/include/terminal.h
+ M /trunk/tinns-v2/src/game/main.h
+ A /trunk/tinns-v2/src/game/terminal.cpp
+ M /trunk/tinns-v2/src/game/worldactors.cpp
+ M /trunk/tinns-v2/src/include/message.h
+ M /trunk/tinns-v2/src/include/version.h
+
+- Added up-to-date SQL dump to SVN. (But better use the newest neoX db!)
+- Fixed bug in worldactors that caused the following problems:
+> Spawned actors where removed uppon next serverstart/re-zone
+> Only one actor in a zone at once
+- Added first steps for ingame terminal handling
+------------------------------------------------------------------------
+r78 | Namikon | 2007-01-08 19:41:04 +0100 (Mon, 08 Jan 2007) | 1 line
+Changed paths:
+ A /trunk/tinns-v2/database/tinns_sqldumb_rev77.zip
+
+- Added SQL dumb. This dumb works with all Revisions up to R77
+------------------------------------------------------------------------
+r77 | Namikon | 2007-01-08 15:46:19 +0100 (Mon, 08 Jan 2007) | 4 lines
+Changed paths:
+ M /trunk/tinns-v2/src/common/netcode/udpmanager.cpp
+
+Fixed compiler error:
+In member function 'void ConnectionUDP::InsertUDPMessage(PMessage*)':
+udpmanager.cpp:133: error: conversion from 'int' to non-scalar type 'std::_Rb_tree_const_iterator >' requested
+on some systems
+------------------------------------------------------------------------
+r76 | Namikon | 2007-01-07 21:56:53 +0100 (Sun, 07 Jan 2007) | 4 lines
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/src/common/netcode/udpmanager.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_0x1f.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_hack.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_hack.h
+ M /trunk/tinns-v2/src/game/gamecommands/remove.cpp
+ M /trunk/tinns-v2/src/game/include/msgbuilder.h
+ M /trunk/tinns-v2/src/game/include/worldactors.h
+ M /trunk/tinns-v2/src/game/msgbuilder.cpp
+ M /trunk/tinns-v2/src/game/npc.cpp
+ M /trunk/tinns-v2/src/game/worldactors.cpp
+ M /trunk/tinns-v2/src/include/version.h
+
+- Added hacking ability to hackbuttons (Both static and dynamic worldactors)
+ Itemcontainers will follow when we have a management class for them
+- Removed several debug outputs, and changed others
+- Fixed an typo in command remove
+------------------------------------------------------------------------
+r75 | Namikon | 2007-01-07 19:51:02 +0100 (Sun, 07 Jan 2007) | 35 lines
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/conf/commands.conf
+ M /trunk/tinns-v2/src/common/netcode/connection-udp.cpp
+ M /trunk/tinns-v2/src/common/netcode/message.cpp
+ M /trunk/tinns-v2/src/common/netcode/udpmanager.cpp
+ M /trunk/tinns-v2/src/game/buddylist.cpp
+ M /trunk/tinns-v2/src/game/chars.cpp
+ M /trunk/tinns-v2/src/game/client.cpp
+ M /trunk/tinns-v2/src/game/clientmanager.cpp
+ M /trunk/tinns-v2/src/game/configtemplate.h
+ M /trunk/tinns-v2/src/game/decoder/main.h
+ A /trunk/tinns-v2/src/game/decoder/udp_0x08.cpp
+ A /trunk/tinns-v2/src/game/decoder/udp_0x08.h
+ M /trunk/tinns-v2/src/game/decoder/udp_OOO.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_reqinfo.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_sync.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_useobject.cpp
+ M /trunk/tinns-v2/src/game/decoder/udpanalyser.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/main.h
+ M /trunk/tinns-v2/src/game/gamecommands/remove.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/spawnactor.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/test.cpp
+ M /trunk/tinns-v2/src/game/gameserver.cpp
+ M /trunk/tinns-v2/src/game/genreplist.cpp
+ M /trunk/tinns-v2/src/game/globals.cpp
+ M /trunk/tinns-v2/src/game/include/client.h
+ M /trunk/tinns-v2/src/game/include/clientmanager.h
+ M /trunk/tinns-v2/src/game/include/commands.h
+ M /trunk/tinns-v2/src/game/include/globals.h
+ A /trunk/tinns-v2/src/game/include/npc.h
+ M /trunk/tinns-v2/src/game/include/worldactors.h
+ M /trunk/tinns-v2/src/game/inventory.cpp
+ M /trunk/tinns-v2/src/game/main.cpp
+ M /trunk/tinns-v2/src/game/main.h
+ M /trunk/tinns-v2/src/game/msgbuilder.cpp
+ A /trunk/tinns-v2/src/game/npc.cpp
+ M /trunk/tinns-v2/src/game/worldactors.cpp
+ M /trunk/tinns-v2/src/game/worlddatatemplate.cpp
+ M /trunk/tinns-v2/src/game/worlds.cpp
+ M /trunk/tinns-v2/src/include/connection-udp.h
+ M /trunk/tinns-v2/src/include/version.h
+
+Huge update!
+
+- Changed default level for @remove from 100 to 50, since we can now also remove dynamic actors with it
+- Added security check to @remove command: You cannot remove Dynamic actors over their IDs anymore.
+ Remove them with @remove actor command
+- UDPManager rewritten. Was almost completely wrong, dunno what happend with me when i first wrote it :P
+ However, it works now. The last 20 UDP messages with 0x03 commandset are saved, and get resend uppon
+ OOO notice from the client.
+ The manager also watches the outgoing UDP IDs. With his, it was possible to fix an udp increment bug in the zoning process.
+- Messages in the VIP queue arent parsed over the udpmanager. We'll have to rename this later on (or add a new queue)
+- The UDP/SessionID offset is now defined in connection-udp.h
+- NPC subsystem added. (Yeah ^^)
+ All NPCs that are in npc_spawns database spawn and stay in their world. We dont have an AI, so dont expect NPCs to
+ do *anything* yet. (Same goes for traders or copbots) But everything is prepared
+- Added function "IsWorldInUse" to clientmanager. In first line required for NPC manager, to check if a world is in use or not
+- Reformatted several files for better readability.
+- Extended dynamic worldactor management:
+ - Spawned worldactors are functional now. (Eg: Spawn a chair and sit on it) (Function is not 100% tested, it *could* procude an segfault, report it
+ if the server crashes for you on a certain actorID)
+ - Only valid worldmodel templates are accepted now while spawning actors
+ - If given worldmodel template needs an linked object (For example an door) you have to add the doorID in the @spawnactor command (example below)
+ - On serverstart and every initworld, the database is checked for duplicate worldactor IDs. If some are found, they get deleted
+ - Another check is done when an worldactor is spawned. If (for any reason) an invalid worldactorset is in the Database,
+ it is ignored uppon spawning. (invalid means, that the actor points to an invalid object, for example door or world)
+- Added detailed output for SQL errors (Prints not only "ERROR" or just returns nothing, instead a full errormessage is written to console)
+- MsgBuilder:
+ - Baselinepacket changed, monsters are now "red"
+ - Fixed increase_udp issue in BuildZoning1Msg
+- Added new decoder:
+ - 0x08: This small (only 1 byte) "packet" is only sent when the client exits abnormal (crash, sometimes on alt+f4)
+ Does nothing else than closing the connection serverside.
+
+*Note* Due the massive update of sourcecode, its likely that i forgot some debug outputs (You'll see D1, D2,.. or whatever else senseless text
+on the console). If you find something, tell me please over forum or bugtracker. But i will remove all outputs when i find some in the next
+releases
+------------------------------------------------------------------------
+r74 | Namikon | 2007-01-04 16:24:05 +0100 (Thu, 04 Jan 2007) | 13 lines
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/src/game/client.cpp
+ M /trunk/tinns-v2/src/game/commands.cpp
+ M /trunk/tinns-v2/src/game/decoder/main.h
+ M /trunk/tinns-v2/src/game/decoder/udp_sync.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_useobject.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_zoning.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/main.h
+ M /trunk/tinns-v2/src/game/gamecommands/remove.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/spawnactor.cpp
+ M /trunk/tinns-v2/src/game/globals.cpp
+ M /trunk/tinns-v2/src/game/include/client.h
+ M /trunk/tinns-v2/src/game/include/commands.h
+ M /trunk/tinns-v2/src/game/include/globals.h
+ M /trunk/tinns-v2/src/game/include/msgbuilder.h
+ A /trunk/tinns-v2/src/game/include/worldactors.h
+ M /trunk/tinns-v2/src/game/main.h
+ M /trunk/tinns-v2/src/game/msgbuilder.cpp
+ A /trunk/tinns-v2/src/game/worldactors.cpp
+ M /trunk/tinns-v2/src/include/version.h
+
+- WorldActor management class added.
+ Spawned actors now stay in that zone until someone removes them.
+
+ To remove spawned worldactors, the @remove command has been improved:
+ Type "@remove actor" to set your client into "REMOVE ACTOR" mode (You'll get
+ an ingame notice about this)
+ Then simply click on any dynamic worldactors to remove them. To leave this remove mode,
+ type "@remove actor" again. (And again you'll get a notice about that)
+
+ Note: You cannot remove static worldactors (those who are in the .dat files) with this.
+ It is possible to let them disappear (type @remove <rawID>) but they'll respawn when you re-zone.
+
+IMPORTANT: This release requires an database update! Make sure you have the latest mysql table availeable.
+------------------------------------------------------------------------
+r73 | Namikon | 2007-01-02 20:53:40 +0100 (Tue, 02 Jan 2007) | 10 lines
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/conf/commands.conf
+ M /trunk/tinns-v2/src/game/commands.cpp
+ M /trunk/tinns-v2/src/game/configtemplate.h
+ M /trunk/tinns-v2/src/game/gamecommands/debug.cpp
+ A /trunk/tinns-v2/src/game/gamecommands/spawnactor.cpp
+ M /trunk/tinns-v2/src/game/include/commands.h
+ M /trunk/tinns-v2/src/game/include/msgbuilder.h
+ M /trunk/tinns-v2/src/game/msgbuilder.cpp
+ M /trunk/tinns-v2/src/include/version.h
+
+- Added new command @spawnactor
+ Usage: @spawnactor <actorID> <functionType>
+ - ActorID can be found in models/pak_models.ini
+ - FunctionType defines the type of the actor.
+ This can be almost everything, from item containers to
+ apartmentlift accesspanels
+ This command spawns and static worldactor next to your current
+ position. Everyone who is within the range of UDP broadcast
+ can see / "use" the new actor. It isnt saved to sql yet, nor is it
+ managed. (You cant spawn an itemcontainer and open it)
+------------------------------------------------------------------------
+r72 | Namikon | 2007-01-01 23:35:13 +0100 (Mon, 01 Jan 2007) | 7 lines
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/src/game/chars.cpp
+ M /trunk/tinns-v2/src/game/chat.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_0x13.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_0x1f.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_charmove.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_charmove.h
+ A /trunk/tinns-v2/src/game/decoder/udp_hack.cpp
+ A /trunk/tinns-v2/src/game/decoder/udp_hack.h
+ M /trunk/tinns-v2/src/game/decoder/udp_itemmove.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_quickaccessbelt.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_useobject.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_useobject.h
+ M /trunk/tinns-v2/src/game/include/chars.h
+ M /trunk/tinns-v2/src/game/include/chat.h
+ M /trunk/tinns-v2/src/game/include/inventory.h
+ M /trunk/tinns-v2/src/game/include/msgbuilder.h
+ M /trunk/tinns-v2/src/game/inventory.cpp
+ M /trunk/tinns-v2/src/game/msgbuilder.cpp
+ M /trunk/tinns-v2/src/include/version.h
+
+**** Happy new year!! ****
+
+- Item movement within quickbelt works
+- Added hacktool to QB to test hacking
+- Added the last missing staffchar (GM>)
+- Added decoder for inithack and starthack messages
+- A few more changes i cannot remember
+------------------------------------------------------------------------
+r71 | Namikon | 2006-12-30 19:42:51 +0100 (Sat, 30 Dec 2006) | 4 lines
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/src/game/chars.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_0x1f.cpp
+ A /trunk/tinns-v2/src/game/decoder/udp_itemmove.cpp
+ A /trunk/tinns-v2/src/game/decoder/udp_itemmove.h
+ A /trunk/tinns-v2/src/game/decoder/udp_quickaccessbelt.cpp
+ A /trunk/tinns-v2/src/game/decoder/udp_quickaccessbelt.h
+ M /trunk/tinns-v2/src/game/include/chars.h
+ M /trunk/tinns-v2/src/game/include/msgbuilder.h
+ M /trunk/tinns-v2/src/game/msgbuilder.cpp
+ M /trunk/tinns-v2/src/game/sql.cpp
+ M /trunk/tinns-v2/src/include/version.h
+
+- Added handling class for item movement (QB<>Inv<>GoGu<>Ground), no real function yet, but its decoded
+- Added handling class for QuickBelt management. You can activate the flashlight in slot 0 now, and others can see it
+ The functions are prepared to handle any item that exists, but we dont have items working until now.
+- Removed Debug output from sql.cpp
+------------------------------------------------------------------------
+r70 | Namikon | 2006-12-30 08:16:09 +0100 (Sat, 30 Dec 2006) | 5 lines
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/src/game/chars.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_useobject.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/givemoney.cpp
+ M /trunk/tinns-v2/src/game/include/chars.h
+ M /trunk/tinns-v2/src/game/msgbuilder.cpp
+ M /trunk/tinns-v2/src/include/version.h
+
+- Added "life" to hackbuttons and entrance-fee buttons. (Level GM and higher can just "use" hackbuttons, lower levels
+ must hack it. For entrance fee buttons, everyone must pay. Why? Well, for what is the @givemoney command ^.^)
+ Since hacking is not working yet, (we have to add item-usage first) make sure to set your own level to 50+, or you
+ wont get these doors open)
+- Disabled some debug outputs forgotten in the last release
+------------------------------------------------------------------------
+r69 | Namikon | 2006-12-28 20:05:09 +0100 (Thu, 28 Dec 2006) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/src/common/netcode/connection-udp.cpp
+ M /trunk/tinns-v2/src/common/netcode/udpmanager.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_OOO.cpp
+ M /trunk/tinns-v2/src/include/version.h
+
+HotFix: OOO Manager
+------------------------------------------------------------------------
+r68 | Namikon | 2006-12-28 18:46:34 +0100 (Thu, 28 Dec 2006) | 6 lines
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/conf/commands.conf
+ M /trunk/tinns-v2/conf/gameserver.conf
+ M /trunk/tinns-v2/src/game/chars.cpp
+ M /trunk/tinns-v2/src/game/commands.cpp
+ M /trunk/tinns-v2/src/game/configtemplate.h
+ A /trunk/tinns-v2/src/game/gamecommands/givemoney.cpp
+ A /trunk/tinns-v2/src/game/gamecommands/takemoney.cpp
+ M /trunk/tinns-v2/src/game/include/chars.h
+ M /trunk/tinns-v2/src/game/include/commands.h
+ M /trunk/tinns-v2/src/game/include/msgbuilder.h
+ M /trunk/tinns-v2/src/game/msgbuilder.cpp
+ M /trunk/tinns-v2/src/include/version.h
+
+- 2 new ingame commands:
+ @givemoney <amount> [<charID or nick>]
+ @takemoney <amount> [<charID or nick>]
+ I dont think i have to explain what they do :)
+
+- Added universal udpmessage to trigger messages from text.ini
+------------------------------------------------------------------------
+r67 | Namikon | 2006-12-27 19:07:16 +0100 (Wed, 27 Dec 2006) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/src/game/include/msgbuilder.h
+ M /trunk/tinns-v2/src/game/msgbuilder.cpp
+ M /trunk/tinns-v2/src/include/version.h
+
+- Added 2 error messages for genrep activation. (Wrong faction and MC5 "broken")
+------------------------------------------------------------------------
+r66 | Namikon | 2006-12-27 00:10:46 +0100 (Wed, 27 Dec 2006) | 2 lines
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/src/common/netcode/udpmanager.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_0x1f.cpp
+ A /trunk/tinns-v2/src/game/decoder/udp_appartment.cpp
+ A /trunk/tinns-v2/src/game/decoder/udp_appartment.h
+ M /trunk/tinns-v2/src/game/include/msgbuilder.h
+ M /trunk/tinns-v2/src/game/msgbuilder.cpp
+ M /trunk/tinns-v2/src/game/sql.cpp
+ M /trunk/tinns-v2/src/include/version.h
+
+- Added, by Stings request, serveranswer to worldroute query: "Where is the Primary App" works now.
+- "Fixed" SQL function GetAptLocID(). Now only decreases the location value if the given AppartmentID is higher than 100000
+------------------------------------------------------------------------
+r65 | Namikon | 2006-12-26 22:36:21 +0100 (Tue, 26 Dec 2006) | 4 lines
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/src/common/netcode/connection-udp.cpp
+ A /trunk/tinns-v2/src/common/netcode/udpmanager.cpp
+ M /trunk/tinns-v2/src/game/chat.cpp
+ M /trunk/tinns-v2/src/game/client.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_OOO.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_sync.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/info.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/jail.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/recall.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/teleport.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/test.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/unjail.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/warp.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/warpto.cpp
+ M /trunk/tinns-v2/src/game/include/client.h
+ M /trunk/tinns-v2/src/game/msgbuilder.cpp
+ M /trunk/tinns-v2/src/include/connection-udp.h
+ M /trunk/tinns-v2/src/include/version.h
+
+- Added UDPManager functions to connection_udp. Keeps the last 20 important UDP messages in a queue, for
+ possible resend after a OOO notice by the client
+- Finally fixed the warpcircle and charvanish! The mentioned commands in Rev 62-63 now work as announced
+- UDP_ID and all related stuff moved to connection_udp. Will be more controlled in the future from there
+------------------------------------------------------------------------
+r64 | Namikon | 2006-12-25 00:28:34 +0100 (Mon, 25 Dec 2006) | 3 lines
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/src/game/client.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_sync.cpp
+ M /trunk/tinns-v2/src/game/include/client.h
+ M /trunk/tinns-v2/src/game/include/msgbuilder.h
+ M /trunk/tinns-v2/src/game/msgbuilder.cpp
+ M /trunk/tinns-v2/src/include/version.h
+
+- Fixed Blacksync issue when logging in
+- Disabled position update on warpto and recall commands. It's not possible at the moment to
+ force the client to update the charposition.
+------------------------------------------------------------------------
+r63 | Namikon | 2006-12-24 01:30:14 +0100 (Sun, 24 Dec 2006) | 9 lines
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/src/game/chat.cpp
+ M /trunk/tinns-v2/src/game/client.cpp
+ M /trunk/tinns-v2/src/game/clientmanager.cpp
+ M /trunk/tinns-v2/src/game/commands.cpp
+ A /trunk/tinns-v2/src/game/gamecommands/README
+ D /trunk/tinns-v2/src/game/gamecommands/adddoor.cpp
+ D /trunk/tinns-v2/src/game/gamecommands/addworlditem.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/ban.cpp
+ D /trunk/tinns-v2/src/game/gamecommands/delworlditem.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/jail.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/kick.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/recall.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/teleport.cpp
+ A /trunk/tinns-v2/src/game/gamecommands/test.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/unjail.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/warp.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/warpto.cpp
+ M /trunk/tinns-v2/src/game/include/chat.h
+ M /trunk/tinns-v2/src/game/include/client.h
+ M /trunk/tinns-v2/src/game/include/clientmanager.h
+ M /trunk/tinns-v2/src/game/include/commands.h
+ M /trunk/tinns-v2/src/game/include/msgbuilder.h
+ M /trunk/tinns-v2/src/game/msgbuilder.cpp
+ M /trunk/tinns-v2/src/include/version.h
+
+- Added experimental char warp-aura and char disappear packets to all warp-commands
+ (Worked while testing, but not after implementation into the commands)
+- Worked on Chatsystem: Localchat 99% working. Localchat is now limited to a small area around the player
+ (However, the chat is sent over TCP, like all other packets. It should be UDP, but this isnt working
+ for some reason. If anyone finds out why, tell us please)
+- Added Developercommand "@test". It has no fixed function, and is not configureable by config file.
+ Devs can easily add stuff there to test various things.
+- Removed adddoor, delworlditem and addworlditem completely from SVN, they're not needed anymore
+- And a few things i cant remember -.-
+------------------------------------------------------------------------
+r62 | Namikon | 2006-12-23 13:38:32 +0100 (Sat, 23 Dec 2006) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/src/game/include/commands.h
+
+Fixed multiline comment error on some compilers
+------------------------------------------------------------------------
+r61 | Namikon | 2006-12-23 09:36:18 +0100 (Sat, 23 Dec 2006) | 3 lines
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/conf/commands.conf
+ M /trunk/tinns-v2/src/game/commands.cpp
+ M /trunk/tinns-v2/src/game/configtemplate.h
+ M /trunk/tinns-v2/src/game/gamecommands/adddoor.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/addworlditem.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/delworlditem.cpp
+ M /trunk/tinns-v2/src/game/include/commands.h
+ M /trunk/tinns-v2/src/include/version.h
+
+Small update:
+- Removed ingamecommands "addworlditem", "delworlditem" and "adddoor". TinNS gets the worlddata dynamicly from loaded
+ .dat files instead of MySQL Database.
+------------------------------------------------------------------------
+r60 | Namikon | 2006-12-23 00:36:21 +0100 (Sat, 23 Dec 2006) | 3 lines
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/src/game/chars.cpp
+ M /trunk/tinns-v2/src/game/client.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_sync.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/ban.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/info.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/jail.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/recall.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/shun.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/teleport.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/unjail.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/unshun.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/warpto.cpp
+ M /trunk/tinns-v2/src/game/include/chars.h
+ M /trunk/tinns-v2/src/game/include/client.h
+ M /trunk/tinns-v2/src/include/version.h
+
+- Added several security checks to game commands
+- Added missing status outputs on successfull gamecommand
+- Added solution to send an delayed positionupdate after warping
+------------------------------------------------------------------------
+r59 | Namikon | 2006-12-22 22:56:08 +0100 (Fri, 22 Dec 2006) | 6 lines
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/src/game/accounts.cpp
+ M /trunk/tinns-v2/src/game/chars.cpp
+ M /trunk/tinns-v2/src/game/chat.cpp
+ M /trunk/tinns-v2/src/game/client.cpp
+ A /trunk/tinns-v2/src/game/gamecommands/Makefile
+ M /trunk/tinns-v2/src/game/gamecommands/jail.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/shun.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/teleport.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/unjail.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/unshun.cpp
+ M /trunk/tinns-v2/src/game/gamecommands/warp.cpp
+ M /trunk/tinns-v2/src/game/include/accounts.h
+ M /trunk/tinns-v2/src/game/include/chars.h
+ M /trunk/tinns-v2/src/include/version.h
+
+- Added missing Makefile for gamecommands/ subfolder
+- Removed check for ZoneID 552 from jail.cpp and unjail.cpp; This zone is never used
+- Moved mShunned from Account to chars
+- Added mJailed to chars with methods to identify a jailed player
+- Added explicit override to GM teleport and jail/unjail commands (The only way to move someone if target is jailed)
+- Completed shun/unshun command
+------------------------------------------------------------------------
+r58 | Namikon | 2006-12-22 17:34:02 +0100 (Fri, 22 Dec 2006) | 8 lines
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/src/dev-tools/Makefile
+ A /trunk/tinns-v2/src/dev-tools/getsvnrev.cpp
+ M /trunk/tinns-v2/src/dev-tools/setsvnrev
+ M /trunk/tinns-v2/src/game/Makefile
+ M /trunk/tinns-v2/src/game/commands.cpp
+ A /trunk/tinns-v2/src/game/gamecommands
+ A /trunk/tinns-v2/src/game/gamecommands/adddoor.cpp
+ A /trunk/tinns-v2/src/game/gamecommands/addworlditem.cpp
+ A /trunk/tinns-v2/src/game/gamecommands/ban.cpp
+ A /trunk/tinns-v2/src/game/gamecommands/brightness.cpp
+ A /trunk/tinns-v2/src/game/gamecommands/broadcast.cpp
+ A /trunk/tinns-v2/src/game/gamecommands/color.cpp
+ A /trunk/tinns-v2/src/game/gamecommands/debug.cpp
+ A /trunk/tinns-v2/src/game/gamecommands/delworlditem.cpp
+ A /trunk/tinns-v2/src/game/gamecommands/effect.cpp
+ A /trunk/tinns-v2/src/game/gamecommands/h.cpp
+ A /trunk/tinns-v2/src/game/gamecommands/info.cpp
+ A /trunk/tinns-v2/src/game/gamecommands/jail.cpp
+ A /trunk/tinns-v2/src/game/gamecommands/kick.cpp
+ A /trunk/tinns-v2/src/game/gamecommands/listbans.cpp
+ A /trunk/tinns-v2/src/game/gamecommands/main.h
+ A /trunk/tinns-v2/src/game/gamecommands/online.cpp
+ A /trunk/tinns-v2/src/game/gamecommands/rawf.cpp
+ A /trunk/tinns-v2/src/game/gamecommands/recall.cpp
+ A /trunk/tinns-v2/src/game/gamecommands/rehash.cpp
+ A /trunk/tinns-v2/src/game/gamecommands/remove.cpp
+ A /trunk/tinns-v2/src/game/gamecommands/setlevel.cpp
+ A /trunk/tinns-v2/src/game/gamecommands/settime.cpp
+ A /trunk/tinns-v2/src/game/gamecommands/shun.cpp
+ A /trunk/tinns-v2/src/game/gamecommands/skin.cpp
+ A /trunk/tinns-v2/src/game/gamecommands/speed.cpp
+ A /trunk/tinns-v2/src/game/gamecommands/t.cpp
+ A /trunk/tinns-v2/src/game/gamecommands/teleport.cpp
+ A /trunk/tinns-v2/src/game/gamecommands/unban.cpp
+ A /trunk/tinns-v2/src/game/gamecommands/unjail.cpp
+ A /trunk/tinns-v2/src/game/gamecommands/unshun.cpp
+ A /trunk/tinns-v2/src/game/gamecommands/uptime.cpp
+ A /trunk/tinns-v2/src/game/gamecommands/v.cpp
+ A /trunk/tinns-v2/src/game/gamecommands/version.cpp
+ A /trunk/tinns-v2/src/game/gamecommands/warp.cpp
+ A /trunk/tinns-v2/src/game/gamecommands/warpto.cpp
+ M /trunk/tinns-v2/src/game/worlds.cpp
+ A /trunk/tools/getsvnrev
+ A /trunk/tools/getsvnrev/Makefile
+ A /trunk/tools/getsvnrev/getsvnrev.cpp
+ M /trunk/tools/pak_decompress/pak_decompress.cpp
+
+<General changes>
+- Improved pak_decompress tool from Akiko
+- Added tool "getsvnrev" (Same again in src/dev_tools, required for make process)
+- Improved Hammag's setsvnrev bash script (Now does errorcheck and has an alternative way to
+ grab SVN revision if SVN is not installed)
+- Splitup of commands.cpp. Every command has now its own .cpp file in gamecommands/.
+ Makes it a lot easier to handle new commands or change/fix/remove existing ones
+- ReEnabled debug-output while loading world .dat files. Was commented out for some reason
+------------------------------------------------------------------------
+r57 | Namikon | 2006-12-21 21:51:07 +0100 (Thu, 21 Dec 2006) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+
+
+------------------------------------------------------------------------
+r56 | Namikon | 2006-12-21 21:47:41 +0100 (Thu, 21 Dec 2006) | 8 lines
+Changed paths:
+ M /trunk/tools/pak_decompress/pak_decompress.cpp
+
+Improved pak_decompress script from Akiko:
+- Added errorcheck for in/output file
+- Added check for NC and normal zLib files
+ (Can unpak both)
+- Added optional details-output
+
+The script is now capable to be used in batchfiles, since the only output is either [OK] <filename> or [ERROR] <filename>.
+if you dont want this, you can specify detailed output with all errors.
+------------------------------------------------------------------------
+r55 | Namikon | 2006-12-21 19:29:54 +0100 (Thu, 21 Dec 2006) | 34 lines
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/conf/commands.conf
+ M /trunk/tinns-v2/src/game
+ M /trunk/tinns-v2/src/game/accounts.cpp
+ M /trunk/tinns-v2/src/game/chat.cpp
+ M /trunk/tinns-v2/src/game/commands.cpp
+ M /trunk/tinns-v2/src/game/configtemplate.h
+ M /trunk/tinns-v2/src/game/globals.cpp
+ M /trunk/tinns-v2/src/game/include
+ M /trunk/tinns-v2/src/game/include/accounts.h
+ M /trunk/tinns-v2/src/game/include/commands.h
+ M /trunk/tinns-v2/src/game/include/globals.h
+ M /trunk/tinns-v2/src/include/external.h
+ M /trunk/tinns-v2/src/include/version.h
+ A /trunk/tinns-v2/tinns
+
+*Note*
+The new commands have to be tested first! Dont expect them to work yet, its just a upload
+since the entire command files got rewritten.
+
+<General changes>
+ - Rewritten entire commands.cpp/.h files
+ - Fixed ingame command @kick. Works now as it should.
+ Also sets a temp-ban for a configureable amount of seconds to prevent instant-relog.
+ - Added new ingame coommands:
+ @ban <charID/nick> <xS>/<xM>/<xH>/<xD> || @ban EvilUser 20m <- Bans "EvilUser" for 20 minutes.
+ - Bans given player for given time. You can only set ONE timevalue. (Either S/M/H or D. Not case sensitive)
+
+ @unban
+ - Not working yet. Has to be done by direct SQL access
+ @listbans
+ - Not working yet. Has to be done by direct SQL access
+
+ @shun <charID/nick>
+ - Blocks all incoming char/command traffic from given client until re relogs
+ Returns error if already shunned
+
+ @unshun <charID/nick>
+ - Remove shun instantly. Returns error if not shunned
+
+ @jail <charID/nick>
+ - Warp given player to Regants legacy. Returns error if player is already in Regants
+
+ @unjail <charID/nick>
+ - Free given player from Regants. Returns error if player is not in Regants/Jailed
+
+ @teleport <charID/nick> <worldID>
+ - Teleport given player to given world
+
+ - Added (experimental) startscript for TinNS. Has to be testen/debugged
+------------------------------------------------------------------------
+r54 | Hammag | 2006-12-20 20:52:20 +0100 (Wed, 20 Dec 2006) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/src/common/filesystem/filesystem.cpp
+ M /trunk/tinns-v2/src/game/def/defparser.cpp
+ M /trunk/tinns-v2/src/game/def/gamedefs.cpp
+ M /trunk/tinns-v2/src/game/def/world_datparser.cpp
+ M /trunk/tinns-v2/src/include/filesystem.h
+ M /trunk/tinns-v2/src/include/svnrevision.h
+ M /trunk/tinns-v2/src/patch/patchserver.cpp
+
+Fixed NC datafiles lookup
+------------------------------------------------------------------------
+r53 | Namikon | 2006-12-19 03:07:53 +0100 (Tue, 19 Dec 2006) | 8 lines
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/conf/commands.conf
+ M /trunk/tinns-v2/src/game/accounts.cpp
+ M /trunk/tinns-v2/src/game/chars.cpp
+ M /trunk/tinns-v2/src/game/chat.cpp
+ M /trunk/tinns-v2/src/game/client.cpp
+ M /trunk/tinns-v2/src/game/commands.cpp
+ M /trunk/tinns-v2/src/game/configtemplate.h
+ M /trunk/tinns-v2/src/game/gameserver.cpp
+ M /trunk/tinns-v2/src/game/include/accounts.h
+ M /trunk/tinns-v2/src/game/include/client.h
+ M /trunk/tinns-v2/src/game/include/commands.h
+ M /trunk/tinns-v2/src/game/include/msgbuilder.h
+ M /trunk/tinns-v2/src/game/msgbuilder.cpp
+
+its a pity, but the workaround didnt work. Still investigating this!
+MANY changes to the source, cant remember all. Here is what my brain has stored:
+
+- Direct chat completed. (If target player isnt online, you'll get this nice "Player not online" message)
+- ReEnabled AutoRehash, wasnt responsible for the crash
+- Added @kick, @info, @warpto, @recall and @setlevel. @info is tested and verified, @kick does nothing (yet) the
+ rest is untested but should work. (Hard to test with only 1 char online...)
+- Some more very small changes. If you want a detailed log, ask SVN history :D
+------------------------------------------------------------------------
+r52 | Namikon | 2006-12-18 02:01:53 +0100 (Mon, 18 Dec 2006) | 3 lines
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/src/game/accounts.cpp
+ M /trunk/tinns-v2/src/game/chars.cpp
+
+- Fixed bug that you could'nt see the welcome message after login
+- Added (hopefully) a workaround for our SegFault problem (2 user online, 3rd is trying to connect -> SegFault)
+
+------------------------------------------------------------------------
+r51 | Namikon | 2006-12-18 00:24:21 +0100 (Mon, 18 Dec 2006) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/src/game/accounts.cpp
+
+Fixed small issue in accounts.cpp. (Forgot the break; in the select() statement)
+------------------------------------------------------------------------
+r50 | Namikon | 2006-12-17 22:42:43 +0100 (Sun, 17 Dec 2006) | 8 lines
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ A /trunk/tinns-v2/conf/commands.conf
+ M /trunk/tinns-v2/src/game/accounts.cpp
+ M /trunk/tinns-v2/src/game/commands.cpp
+ M /trunk/tinns-v2/src/game/configtemplate.h
+ M /trunk/tinns-v2/src/game/globals.cpp
+ M /trunk/tinns-v2/src/game/include/globals.h
+ M /trunk/tinns-v2/src/info/configtemplate.h
+ M /trunk/tinns-v2/src/info/infoserver.cpp
+
+[GAME]
+- Fixed errors from last SVN release (Caused several segmentation faults)
+- Added configfile commands.conf
+- Added check for required accountlevel when trying to use ingame command
+
+[INFO]
+- Fixed errors from last SVN release (Caused several segmentation faults)
+- Added default values for isc stuff to configtemplate.h. I forgot to add them in the last revision
+------------------------------------------------------------------------
+r49 | Namikon | 2006-12-16 15:39:08 +0100 (Sat, 16 Dec 2006) | 8 lines
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/conf/gameserver.conf
+ M /trunk/tinns-v2/conf/infoserver.conf
+ M /trunk/tinns-v2/src/game/accounts.cpp
+ M /trunk/tinns-v2/src/game/configtemplate.h
+ M /trunk/tinns-v2/src/game/gameserver.cpp
+ M /trunk/tinns-v2/src/game/include/accounts.h
+ M /trunk/tinns-v2/src/info/accounts.cpp
+ M /trunk/tinns-v2/src/info/configtemplate.h
+ M /trunk/tinns-v2/src/info/infoserver.cpp
+
+<Infoserver>
+- Changed default error-return for Sql Checkaccount from -12 to -99, to create free place for further errormessages
+- Added require_validation to infoserver.conf. You can enable this if you like to create accounts on your own,
+ not by autoaccount.
+
+<Gameserver>
+- Removed traces of old AutoAccount creation in GameServer. AutoAcc should *only* be done by Infoserver!
+- Added accountlevel check.
+------------------------------------------------------------------------
+r48 | Namikon | 2006-12-15 20:06:34 +0100 (Fri, 15 Dec 2006) | 2 lines
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/conf/infoserver.conf
+ M /trunk/tinns-v2/docs/ISC ProtDef.txt
+
+Minor changes
+ISC additions
+------------------------------------------------------------------------
+r47 | Hammag | 2006-12-15 16:37:58 +0100 (Fri, 15 Dec 2006) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/src/dev-tools/make-bin-tarball
+ M /trunk/tinns-v2/src/game/decoder/udp_0x13.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_OOO.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_useobject.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_zoning.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_zoning.h
+ M /trunk/tinns-v2/src/include/svnrevision.h
+
+Minor fixes and additions
+------------------------------------------------------------------------
+r46 | Hammag | 2006-12-14 23:13:23 +0100 (Thu, 14 Dec 2006) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ A /trunk/tinns-v2/LICENSE.txt
+ M /trunk/tinns-v2/WORK_IN_PROGRESS
+ M /trunk/tinns-v2/src/Makefile
+ M /trunk/tinns-v2/src/Rules.make
+ A /trunk/tinns-v2/src/dev-tools/make-bin-tarball
+ A /trunk/tinns-v2/src/dev-tools/make-src-tarball
+ M /trunk/tinns-v2/src/game/decoder/udp_useobject.cpp
+ M /trunk/tinns-v2/src/include/svnrevision.h
+
+tarball tools and warning fixes
+------------------------------------------------------------------------
+r45 | Namikon | 2006-12-14 23:03:15 +0100 (Thu, 14 Dec 2006) | 3 lines
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ A /trunk/tinns-v2/docs/ISC Example.txt
+ M /trunk/tinns-v2/docs/ISC ProtDef.txt
+ M /trunk/tinns-v2/src/game/include/isc.h
+
+- Updated ISC definition file (v2)
+- Updated isc.h: Added enum for ISC connection stages
+- Added ISC Example.txt to show a few examples of an "normal" datatransfer between game and infoserver
+------------------------------------------------------------------------
+r44 | Hammag | 2006-12-13 17:23:28 +0100 (Wed, 13 Dec 2006) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/src/Makefile
+ M /trunk/tinns-v2/src/Rules.make
+ A /trunk/tinns-v2/src/dev-tools (from /trunk/tinns-v2/src/tools:43)
+ M /trunk/tinns-v2/src/dev-tools/Makefile
+ M /trunk/tinns-v2/src/dev-tools/cleandepfile.c
+ M /trunk/tinns-v2/src/dev-tools/setsvnrev
+ M /trunk/tinns-v2/src/include/svnrevision.h
+ D /trunk/tinns-v2/src/tools
+
+Added GPL file, some Makefile additions
+------------------------------------------------------------------------
+r43 | Namikon | 2006-12-13 12:12:23 +0100 (Wed, 13 Dec 2006) | 3 lines
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/src/game/chat.cpp
+
+- Quick update: I replaced the "old" function to check if a customchannel is enabled or not with a much
+ faster one. (Bitwise comparison)
+- Fixed an typo in chat.cpp
+------------------------------------------------------------------------
+r42 | Namikon | 2006-12-11 21:50:34 +0100 (Mon, 11 Dec 2006) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/src/game/chat.cpp
+
+Fixed (hopefully) custom channels. They're not loaded/saved from/to SQL yet, but you should be able to enable/disable them. upon entry, all channels are disabled, so you have to tick them every time you login
+------------------------------------------------------------------------
+r41 | Hammag | 2006-12-11 20:06:50 +0100 (Mon, 11 Dec 2006) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/src/Makefile
+ M /trunk/tinns-v2/src/Rules.make
+ M /trunk/tinns-v2/src/common/Makefile
+ M /trunk/tinns-v2/src/common/config/main.h
+ M /trunk/tinns-v2/src/common/console/main.h
+ M /trunk/tinns-v2/src/common/filesystem/main.h
+ M /trunk/tinns-v2/src/common/misc/main.h
+ M /trunk/tinns-v2/src/common/misc/misc.cpp
+ M /trunk/tinns-v2/src/common/netcode/main.h
+ M /trunk/tinns-v2/src/game/commands.cpp
+ M /trunk/tinns-v2/src/game/decoder/main.h
+ M /trunk/tinns-v2/src/game/def/main.h
+ M /trunk/tinns-v2/src/game/globals.cpp
+ M /trunk/tinns-v2/src/game/include/globals.h
+ M /trunk/tinns-v2/src/game/main.h
+ M /trunk/tinns-v2/src/include/misc.h
+ A /trunk/tinns-v2/src/include/svnrevision.h
+ M /trunk/tinns-v2/src/include/version.h
+ M /trunk/tinns-v2/src/info/globals.cpp
+ M /trunk/tinns-v2/src/info/globals.h
+ M /trunk/tinns-v2/src/info/main.h
+ M /trunk/tinns-v2/src/patch/globals.cpp
+ M /trunk/tinns-v2/src/patch/globals.h
+ M /trunk/tinns-v2/src/patch/main.h
+ A /trunk/tinns-v2/src/tools
+ A /trunk/tinns-v2/src/tools/Makefile
+ A /trunk/tinns-v2/src/tools/cleandepfile.c
+ A /trunk/tinns-v2/src/tools/setsvnrev
+
+added version command and dependency files fix
+------------------------------------------------------------------------
+r40 | Hammag | 2006-12-11 13:07:58 +0100 (Mon, 11 Dec 2006) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/src/Makefile
+ M /trunk/tinns-v2/src/common/Makefile
+ M /trunk/tinns-v2/src/game/decoder/udp_0x1f.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_chat.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_chat.h
+ M /trunk/tinns-v2/src/game/include/chars.h
+ M /trunk/tinns-v2/src/patch/patchserver.cpp
+
+Added Custom Chat Channel selection retrieval from client packets
+------------------------------------------------------------------------
+r39 | Namikon | 2006-12-11 00:58:54 +0100 (Mon, 11 Dec 2006) | 4 lines
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/src/game/chars.cpp
+ M /trunk/tinns-v2/src/game/chat.cpp
+ M /trunk/tinns-v2/src/game/include/chars.h
+ M /trunk/tinns-v2/src/game/include/chat.h
+
+Last update for this weekend lol ^^
+- Worked again on Chat subsystem. (What else)
+ This release may break tinns from working, until Hammag found a way to grab the data i need for the CustomChannels.
+
+------------------------------------------------------------------------
+r38 | Namikon | 2006-12-10 23:22:34 +0100 (Sun, 10 Dec 2006) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/src/game/chat.cpp
+ M /trunk/tinns-v2/src/game/include/chat.h
+
+Direct-Chat works now
+------------------------------------------------------------------------
+r37 | Namikon | 2006-12-10 20:06:03 +0100 (Sun, 10 Dec 2006) | 2 lines
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/src/game/buddylist.cpp
+ M /trunk/tinns-v2/src/game/chat.cpp
+ M /trunk/tinns-v2/src/game/include/buddylist.h
+ M /trunk/tinns-v2/src/game/include/chars.h
+
+- Worked again on Chat subsystem. Current status:
+> Buddy - Done. (100%)
+------------------------------------------------------------------------
+r36 | Namikon | 2006-12-10 15:47:12 +0100 (Sun, 10 Dec 2006) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/conf/gameserver.conf
+
+Forgot correct gameserver.conf
+------------------------------------------------------------------------
+r35 | Namikon | 2006-12-10 15:46:15 +0100 (Sun, 10 Dec 2006) | 17 lines
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/conf/gameserver.conf
+ M /trunk/tinns-v2/src/game/chat.cpp
+ M /trunk/tinns-v2/src/game/commands.cpp
+ M /trunk/tinns-v2/src/game/configtemplate.h
+ M /trunk/tinns-v2/src/game/gameserver.cpp
+ M /trunk/tinns-v2/src/game/include/chat.h
+
+- Added @broadcast. GM and higher can now send out "ADMIN> Server: <text>" broadcasts
+- Worked on Chat subsystem. Current status:
+> Buddy - Sends text to Buddy, everyone in the same Zone can read. No Buddylist yet
+> Local - Another problem, local is TCP on retail, we use UDP. Works for now, needs further research
+> Clan - Same as Buddy
+> Team - Same as Buddy
+> Direct - No function yet
+> GM - Done. (100%)
+> Admin - Done. (100%)
+> All others - Nearly done. Sends/Receives to/from correct channel, including zone/fraction/etc
+ limitation. However, you cant disable channels yet, needs further research.
+
+- 2 new options in gameserver.cfg:
+> broadcast_new - If set to 1, the server will send out an broadcast to channel OOC with
+ a welcome message. Default is 0.
+> broadcast_new_hidestaff - If set to 1, all "non-players" are not announced over OOC. Default is 0.
+- Fixed some typos in chat.h/.cpp
+------------------------------------------------------------------------
+r34 | Hammag | 2006-12-10 14:51:55 +0100 (Sun, 10 Dec 2006) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/src/Rules.make
+ M /trunk/tinns-v2/src/game/decoder/udp_useobject.cpp
+ M /trunk/tinns-v2/src/game/def/gamedefs.cpp
+ M /trunk/tinns-v2/src/game/gameserver.cpp
+ M /trunk/tinns-v2/src/game/include/furnituretemplate.h
+ M /trunk/tinns-v2/src/game/include/gamedefs.h
+ M /trunk/tinns-v2/src/game/worlddatatemplate.cpp
+ M /trunk/tinns-v2/src/info/infoserver.cpp
+ M /trunk/tinns-v2/src/info/infoserver.h
+ D /trunk/tinns-v2/src/netcode
+
+Done GR without DB, Fixed Makefile issue
+------------------------------------------------------------------------
+r33 | Namikon | 2006-12-10 11:36:52 +0100 (Sun, 10 Dec 2006) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/src/game/commands.cpp
+ M /trunk/tinns-v2/src/game/gameserver.cpp
+ M /trunk/tinns-v2/src/game/include/gameserver.h
+ M /trunk/tinns-v2/src/game/main.cpp
+ M /trunk/tinns-v2/src/include/external.h
+
+- Added @uptime to view server's uptime ingame
+------------------------------------------------------------------------
+r32 | Hammag | 2006-12-09 17:18:19 +0100 (Sat, 09 Dec 2006) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/src/common/Makefile
+ A /trunk/tinns-v2/src/common/regex
+ A /trunk/tinns-v2/src/common/regex/Makefile
+ A /trunk/tinns-v2/src/common/regex/regex++.cpp
+ M /trunk/tinns-v2/src/game/Makefile
+ M /trunk/tinns-v2/src/game/main.cpp
+ A /trunk/tinns-v2/src/include/regex++.h
+
+Added regex support for futur use, plus minor other modif
+------------------------------------------------------------------------
+r31 | Namikon | 2006-12-09 01:36:18 +0100 (Sat, 09 Dec 2006) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+
+
+------------------------------------------------------------------------
+r30 | Namikon | 2006-12-09 01:23:31 +0100 (Sat, 09 Dec 2006) | 7 lines
+Changed paths:
+ M /trunk/tinns-v2/src/game/accounts.cpp
+ M /trunk/tinns-v2/src/game/commands.cpp
+ M /trunk/tinns-v2/src/game/database.cpp
+ M /trunk/tinns-v2/src/game/include/accounts.h
+ M /trunk/tinns-v2/src/game/include/database.h
+ M /trunk/tinns-v2/src/game/main.cpp
+
+EXPERIMENTAL
+Compiled: Y
+Verified: N
+
+Changes:
+- Dynamic load/update of Account data every 30 seconds
+- @rehash: Reloads accountdata on request
+------------------------------------------------------------------------
+r29 | Hammag | 2006-11-26 03:21:46 +0100 (Sun, 26 Nov 2006) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/src/game/decoder/udp_useobject.cpp
+ M /trunk/tinns-v2/src/game/def/world_datparser.cpp
+ M /trunk/tinns-v2/src/game/doortemplate.cpp
+ M /trunk/tinns-v2/src/game/furnituretemplate.cpp
+ M /trunk/tinns-v2/src/game/include/doortemplate.h
+ M /trunk/tinns-v2/src/game/include/furnituretemplate.h
+ M /trunk/tinns-v2/src/game/include/msgbuilder.h
+ M /trunk/tinns-v2/src/game/include/worlddatatemplate.h
+ M /trunk/tinns-v2/src/game/msgbuilder.cpp
+ M /trunk/tinns-v2/src/game/worlddatatemplate.cpp
+ M /trunk/tinns-v2/src/include/misc.h
+
+Triggered doors made to work as expected
+------------------------------------------------------------------------
+r28 | Hammag | 2006-11-25 16:40:29 +0100 (Sat, 25 Nov 2006) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/src/common/netcode/connection-tcp.cpp
+ M /trunk/tinns-v2/src/common/netcode/connection-udp.cpp
+ M /trunk/tinns-v2/src/common/netcode/main.h
+ M /trunk/tinns-v2/src/game/appartements.cpp
+ M /trunk/tinns-v2/src/game/clientmanager.cpp
+ M /trunk/tinns-v2/src/game/commands.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_0x13.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_charmove.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_packet0.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_subskill.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_subskill.h
+ M /trunk/tinns-v2/src/game/decoder/udp_useobject.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_zoning.cpp
+ M /trunk/tinns-v2/src/game/gameserver.cpp
+ M /trunk/tinns-v2/src/game/include/appartements.h
+ M /trunk/tinns-v2/src/game/include/msgbuilder.h
+ M /trunk/tinns-v2/src/game/include/skill.h
+ M /trunk/tinns-v2/src/game/include/worlds.h
+ M /trunk/tinns-v2/src/game/msgbuilder.cpp
+ M /trunk/tinns-v2/src/game/worlds.cpp
+
+Multiple improvements in zoning, chair use and subskill increase
+------------------------------------------------------------------------
+r27 | Hammag | 2006-11-21 01:45:13 +0100 (Tue, 21 Nov 2006) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/conf/gameserver.conf
+ A /trunk/tinns-v2/src/game/appartements.cpp
+ M /trunk/tinns-v2/src/game/buddylist.cpp
+ M /trunk/tinns-v2/src/game/chars.cpp
+ M /trunk/tinns-v2/src/game/client.cpp
+ M /trunk/tinns-v2/src/game/clientmanager.cpp
+ M /trunk/tinns-v2/src/game/commands.cpp
+ M /trunk/tinns-v2/src/game/configtemplate.h
+ M /trunk/tinns-v2/src/game/decoder/udp_charmove.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_useobject.cpp
+ M /trunk/tinns-v2/src/game/def/world_datparser.cpp
+ M /trunk/tinns-v2/src/game/gameserver.cpp
+ M /trunk/tinns-v2/src/game/globals.cpp
+ A /trunk/tinns-v2/src/game/include/appartements.h
+ M /trunk/tinns-v2/src/game/include/chars.h
+ M /trunk/tinns-v2/src/game/include/client.h
+ M /trunk/tinns-v2/src/game/include/def_appartements.h
+ M /trunk/tinns-v2/src/game/include/furnituretemplate.h
+ M /trunk/tinns-v2/src/game/include/gameserver.h
+ M /trunk/tinns-v2/src/game/include/globals.h
+ M /trunk/tinns-v2/src/game/include/msgbuilder.h
+ M /trunk/tinns-v2/src/game/include/worlds.h
+ M /trunk/tinns-v2/src/game/msgbuilder.cpp
+ M /trunk/tinns-v2/src/game/worlds.cpp
+
+Fixed chairs related issues, added start apt creation
+------------------------------------------------------------------------
+r26 | Hammag | 2006-11-08 21:33:04 +0100 (Wed, 08 Nov 2006) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/conf/gameserver.conf
+ M /trunk/tinns-v2/src/game/chars.cpp
+ M /trunk/tinns-v2/src/game/client.cpp
+ M /trunk/tinns-v2/src/game/clientmanager.cpp
+ M /trunk/tinns-v2/src/game/commands.cpp
+ M /trunk/tinns-v2/src/game/configtemplate.h
+ M /trunk/tinns-v2/src/game/decoder/udp_charmove.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_useobject.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_useobject.h
+ M /trunk/tinns-v2/src/game/decoder/udp_zoning.cpp
+ M /trunk/tinns-v2/src/game/def/def_appplaces.cpp
+ M /trunk/tinns-v2/src/game/def/world_datparser.cpp
+ M /trunk/tinns-v2/src/game/def/world_datstruct.h
+ A /trunk/tinns-v2/src/game/doortemplate.cpp
+ M /trunk/tinns-v2/src/game/furnituretemplate.cpp
+ M /trunk/tinns-v2/src/game/globals.cpp
+ M /trunk/tinns-v2/src/game/include/chars.h
+ M /trunk/tinns-v2/src/game/include/def_worldmodels.h
+ A /trunk/tinns-v2/src/game/include/doortemplate.h
+ M /trunk/tinns-v2/src/game/include/furnituretemplate.h
+ M /trunk/tinns-v2/src/game/include/globals.h
+ M /trunk/tinns-v2/src/game/include/isc.h
+ M /trunk/tinns-v2/src/game/include/msgbuilder.h
+ M /trunk/tinns-v2/src/game/include/world_datparser.h
+ M /trunk/tinns-v2/src/game/include/worlddatatemplate.h
+ M /trunk/tinns-v2/src/game/include/worlds.h
+ M /trunk/tinns-v2/src/game/isc.cpp
+ M /trunk/tinns-v2/src/game/main.cpp
+ M /trunk/tinns-v2/src/game/msgbuilder.cpp
+ M /trunk/tinns-v2/src/game/worlddatatemplate.cpp
+ M /trunk/tinns-v2/src/game/worlds.cpp
+ M /trunk/tinns-v2/src/game/zoning.cpp
+
+Improvements on chairs, doors and zoning doors, as well as some bug fixes
+------------------------------------------------------------------------
+r25 | Hammag | 2006-10-26 02:14:07 +0200 (Thu, 26 Oct 2006) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/src/game/chars.cpp
+ M /trunk/tinns-v2/src/game/client.cpp
+ M /trunk/tinns-v2/src/game/commands.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_zoning.cpp
+ M /trunk/tinns-v2/src/game/def/world_datparser.cpp
+ M /trunk/tinns-v2/src/game/def/world_datstruct.h
+ M /trunk/tinns-v2/src/game/globals.cpp
+ M /trunk/tinns-v2/src/game/include/client.h
+ M /trunk/tinns-v2/src/game/include/globals.h
+ M /trunk/tinns-v2/src/game/include/worlds.h
+ M /trunk/tinns-v2/src/game/main.cpp
+ M /trunk/tinns-v2/src/game/worlds.cpp
+
+Finished on-demand world loading minimal functionalities
+------------------------------------------------------------------------
+r24 | Hammag | 2006-10-24 16:07:13 +0200 (Tue, 24 Oct 2006) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/src/game/include/worlds.h
+ M /trunk/tinns-v2/src/game/worlds.cpp
+
+Internal work only
+------------------------------------------------------------------------
+r23 | Hammag | 2006-10-13 22:15:05 +0200 (Fri, 13 Oct 2006) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/conf/gameserver.conf
+ M /trunk/tinns-v2/src/common/filesystem/filesystem.cpp
+ M /trunk/tinns-v2/src/game/configtemplate.h
+ M /trunk/tinns-v2/src/game/def/gamedefs.cpp
+ M /trunk/tinns-v2/src/game/def/main.h
+ M /trunk/tinns-v2/src/game/def/world_datparser.cpp
+ M /trunk/tinns-v2/src/game/globals.cpp
+ M /trunk/tinns-v2/src/game/include/gamedefs.h
+ M /trunk/tinns-v2/src/game/include/globals.h
+ M /trunk/tinns-v2/src/game/include/isc.h
+ M /trunk/tinns-v2/src/game/include/world_datparser.h
+ M /trunk/tinns-v2/src/game/include/worlds.h
+ M /trunk/tinns-v2/src/game/isc.cpp
+ M /trunk/tinns-v2/src/game/main.cpp
+ M /trunk/tinns-v2/src/game/main.h
+ M /trunk/tinns-v2/src/game/worlds.cpp
+ M /trunk/tinns-v2/src/info/infoserver.cpp
+ M /trunk/tinns-v2/src/info/infoserver.h
+
+serverlist update working, some bug fixes and other internazl stuff
+------------------------------------------------------------------------
+r22 | Hammag | 2006-10-13 01:11:15 +0200 (Fri, 13 Oct 2006) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/conf/gameserver.conf
+ M /trunk/tinns-v2/conf/infoserver.conf
+ M /trunk/tinns-v2/src/Rules.make
+ M /trunk/tinns-v2/src/game/Makefile
+ M /trunk/tinns-v2/src/game/accounts.cpp
+ M /trunk/tinns-v2/src/game/configtemplate.h
+ M /trunk/tinns-v2/src/game/globals.cpp
+ M /trunk/tinns-v2/src/game/include/isc.h
+ M /trunk/tinns-v2/src/game/include/sql.h
+ A /trunk/tinns-v2/src/game/isc.cpp (from /trunk/tinns-v2/src/game/isc.cpp.inhib:15)
+ D /trunk/tinns-v2/src/game/isc.cpp.inhib
+ M /trunk/tinns-v2/src/game/main.cpp
+ M /trunk/tinns-v2/src/game/server.cpp
+ M /trunk/tinns-v2/src/game/sql.cpp
+ M /trunk/tinns-v2/src/info/Makefile
+ M /trunk/tinns-v2/src/info/accounts.cpp
+ M /trunk/tinns-v2/src/info/configtemplate.h
+ M /trunk/tinns-v2/src/info/globals.cpp
+ M /trunk/tinns-v2/src/info/infoserver.cpp
+ M /trunk/tinns-v2/src/info/main.cpp
+ M /trunk/tinns-v2/src/info/sql.cpp
+ M /trunk/tinns-v2/src/info/sql.h
+ M /trunk/tinns-v2/src/patch/Makefile
+
+MySQL keepalive and other MySQL related fix
+------------------------------------------------------------------------
+r21 | Hammag | 2006-10-09 21:39:10 +0200 (Mon, 09 Oct 2006) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/src/common/filesystem/filesystem.cpp
+ M /trunk/tinns-v2/src/game/client.cpp
+ M /trunk/tinns-v2/src/game/commands.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_charmove.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_useobject.cpp
+ M /trunk/tinns-v2/src/game/def/world_datparser.cpp
+ M /trunk/tinns-v2/src/game/include/accounts.h
+ M /trunk/tinns-v2/src/game/include/client.h
+ M /trunk/tinns-v2/src/game/include/world_datparser.h
+ M /trunk/tinns-v2/src/game/include/worlddatatemplate.h
+ M /trunk/tinns-v2/src/game/include/worlds.h
+ M /trunk/tinns-v2/src/game/main.cpp
+ M /trunk/tinns-v2/src/game/worlddatatemplate.cpp
+ M /trunk/tinns-v2/src/game/worlds.cpp
+ M /trunk/tinns-v2/src/include/filesystem.h
+
+Implemented new version of @debug ingame admin command
+------------------------------------------------------------------------
+r20 | Hammag | 2006-10-08 01:25:59 +0200 (Sun, 08 Oct 2006) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/src/common/filesystem/filesystem.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_useobject.cpp
+ M /trunk/tinns-v2/src/game/def/def_appartements.cpp
+ M /trunk/tinns-v2/src/game/def/def_worldfile.cpp
+ M /trunk/tinns-v2/src/game/def/def_worlds.cpp
+ M /trunk/tinns-v2/src/game/def/gamedefs.cpp
+ M /trunk/tinns-v2/src/game/def/world_datparser.cpp
+ M /trunk/tinns-v2/src/game/def/world_datstruct.h
+ A /trunk/tinns-v2/src/game/furnituretemplate.cpp
+ M /trunk/tinns-v2/src/game/include/def_appartements.h
+ M /trunk/tinns-v2/src/game/include/def_worldfile.h
+ M /trunk/tinns-v2/src/game/include/def_worlds.h
+ A /trunk/tinns-v2/src/game/include/furnituretemplate.h
+ M /trunk/tinns-v2/src/game/include/gamedefs.h
+ M /trunk/tinns-v2/src/game/include/world_datparser.h
+ A /trunk/tinns-v2/src/game/include/worlddatatemplate.h
+ A /trunk/tinns-v2/src/game/include/worlds.h
+ M /trunk/tinns-v2/src/game/main.cpp
+ A /trunk/tinns-v2/src/game/worlddatatemplate.cpp
+ A /trunk/tinns-v2/src/game/worlds.cpp
+ M /trunk/tinns-v2/src/game/zoning.cpp
+
+Various small fixes and more work on .dat world files
+------------------------------------------------------------------------
+r19 | Hammag | 2006-10-04 11:53:18 +0200 (Wed, 04 Oct 2006) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ D /trunk/tinns-v2/defs
+ M /trunk/tinns-v2/src/game/decoder/udp_useobject.cpp
+ M /trunk/tinns-v2/src/game/msgbuilder.cpp
+
+warning fixes and def dir removal
+------------------------------------------------------------------------
+r18 | Hammag | 2006-10-03 18:17:47 +0200 (Tue, 03 Oct 2006) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/conf/gameserver.conf
+ M /trunk/tinns-v2/src/common/netcode/message.cpp
+ M /trunk/tinns-v2/src/game/accounts.cpp
+ M /trunk/tinns-v2/src/game/chars.cpp
+ M /trunk/tinns-v2/src/game/configtemplate.h
+ M /trunk/tinns-v2/src/game/decoder/udp_charmove.cpp
+ M /trunk/tinns-v2/src/game/gameserver.cpp
+ M /trunk/tinns-v2/src/game/include/chars.h
+ M /trunk/tinns-v2/src/game/inventory.cpp
+ M /trunk/tinns-v2/src/game/sql.cpp
+
+Critical bug correction in char creation process. Other changes linked with char creation and deletion
+------------------------------------------------------------------------
+r17 | Hammag | 2006-10-02 21:55:01 +0200 (Mon, 02 Oct 2006) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/conf/gameserver.conf
+ M /trunk/tinns-v2/src/Makefile
+ M /trunk/tinns-v2/src/common/config/config.cpp
+ M /trunk/tinns-v2/src/common/filesystem/filesystem.cpp
+ M /trunk/tinns-v2/src/common/netcode/message.cpp
+ M /trunk/tinns-v2/src/game/configtemplate.h
+ M /trunk/tinns-v2/src/game/decoder/udp_useobject.cpp
+ A /trunk/tinns-v2/src/game/def/world_datparser.cpp
+ A /trunk/tinns-v2/src/game/def/world_datstruct.h
+ M /trunk/tinns-v2/src/game/gameserver.cpp
+ M /trunk/tinns-v2/src/game/globals.cpp
+ M /trunk/tinns-v2/src/game/include/globals.h
+ A /trunk/tinns-v2/src/game/include/world_datparser.h
+ M /trunk/tinns-v2/src/game/main.cpp
+ D /trunk/tinns-v2/src/game/ttt.out
+
+Minor cleanup for public release and beginig of world file support
+------------------------------------------------------------------------
+r16 | Hammag | 2006-09-29 00:05:31 +0200 (Fri, 29 Sep 2006) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/WORK_IN_PROGRESS
+ M /trunk/tinns-v2/conf/gameserver.conf
+ M /trunk/tinns-v2/src/Rules.make
+ M /trunk/tinns-v2/src/game/commands.cpp
+ M /trunk/tinns-v2/src/game/configtemplate.h
+ M /trunk/tinns-v2/src/game/decoder/udp_useobject.cpp
+ M /trunk/tinns-v2/src/game/decoder/udp_zoning.cpp
+ A /trunk/tinns-v2/src/game/def/def_worldfile.cpp
+ M /trunk/tinns-v2/src/game/def/gamedefs.cpp
+ M /trunk/tinns-v2/src/game/def/main.h
+ A /trunk/tinns-v2/src/game/include/def_worldfile.h
+ M /trunk/tinns-v2/src/game/include/defs.h
+ M /trunk/tinns-v2/src/game/include/gamedefs.h
+ M /trunk/tinns-v2/src/game/zoning.cpp
+
+Full NC-file based zoning, GR registration fixed
+------------------------------------------------------------------------
+r15 | Hammag | 2006-09-28 17:34:24 +0200 (Thu, 28 Sep 2006) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+
+CHANGELOG update
+------------------------------------------------------------------------
+r14 | Hammag | 2006-09-28 17:03:56 +0200 (Thu, 28 Sep 2006) | 1 line
+Changed paths:
+ A /trunk/tinns-v2/database/GameDB4_to_GameDB5.sql
+
+Added SQL file to migrate gameserver DB from V4 to v5
+------------------------------------------------------------------------
+r13 | Hammag | 2006-09-28 15:32:06 +0200 (Thu, 28 Sep 2006) | 1 line
+Changed paths:
+ A /trunk/tinns-v2/database/GameDB5.zip
+
+Some additions to gameserver DB
+------------------------------------------------------------------------
+r12 | Hammag | 2006-09-28 15:30:01 +0200 (Thu, 28 Sep 2006) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/Makefile
+ M /trunk/tinns-v2/WORK_IN_PROGRESS
+ D /trunk/tinns-v2/database/GameDB4.zip
+ A /trunk/tinns-v2/src/Makefile
+ A /trunk/tinns-v2/src/Rules.make
+ A /trunk/tinns-v2/src/common/Makefile
+ A /trunk/tinns-v2/src/common/config/Makefile
+ A /trunk/tinns-v2/src/common/config/config.cpp
+ A /trunk/tinns-v2/src/common/config/main.h
+ A /trunk/tinns-v2/src/common/console/Makefile
+ A /trunk/tinns-v2/src/common/console/console.cpp
+ A /trunk/tinns-v2/src/common/console/main.h
+ A /trunk/tinns-v2/src/common/filesystem/Makefile
+ A /trunk/tinns-v2/src/common/filesystem/filesystem.cpp
+ A /trunk/tinns-v2/src/common/filesystem/main.h
+ A /trunk/tinns-v2/src/common/misc/Makefile
+ A /trunk/tinns-v2/src/common/misc/main.h
+ A /trunk/tinns-v2/src/common/misc/misc.cpp
+ A /trunk/tinns-v2/src/common/netcode
+ A /trunk/tinns-v2/src/common/netcode/Makefile
+ A /trunk/tinns-v2/src/common/netcode/connection-tcp.cpp
+ A /trunk/tinns-v2/src/common/netcode/connection-udp.cpp
+ A /trunk/tinns-v2/src/common/netcode/main.h
+ A /trunk/tinns-v2/src/common/netcode/message.cpp
+ A /trunk/tinns-v2/src/common/netcode/serversocket.cpp
+ M /trunk/tinns-v2/src/game/Makefile
+ D /trunk/tinns-v2/src/game/_inc
+ D /trunk/tinns-v2/src/game/accounts.h
+ A /trunk/tinns-v2/src/game/buddylist.cpp
+ M /trunk/tinns-v2/src/game/chars.cpp
+ D /trunk/tinns-v2/src/game/chars.h
+ D /trunk/tinns-v2/src/game/chat.h
+ M /trunk/tinns-v2/src/game/client.cpp
+ D /trunk/tinns-v2/src/game/client.h
+ M /trunk/tinns-v2/src/game/clientmanager.cpp
+ D /trunk/tinns-v2/src/game/clientmanager.h
+ M /trunk/tinns-v2/src/game/commands.cpp
+ D /trunk/tinns-v2/src/game/commands.h
+ D /trunk/tinns-v2/src/game/config.cpp
+ D /trunk/tinns-v2/src/game/config.h
+ A /trunk/tinns-v2/src/game/configtemplate.h
+ D /trunk/tinns-v2/src/game/console.cpp
+ D /trunk/tinns-v2/src/game/console.h
+ D /trunk/tinns-v2/src/game/database.h
+ A /trunk/tinns-v2/src/game/decoder
+ A /trunk/tinns-v2/src/game/decoder/Makefile
+ A /trunk/tinns-v2/src/game/decoder/main.h
+ A /trunk/tinns-v2/src/game/decoder/msgdecoder.cpp
+ A /trunk/tinns-v2/src/game/decoder/udp_0x13.cpp
+ A /trunk/tinns-v2/src/game/decoder/udp_0x13.h
+ A /trunk/tinns-v2/src/game/decoder/udp_0x1f.cpp
+ A /trunk/tinns-v2/src/game/decoder/udp_0x1f.h
+ A /trunk/tinns-v2/src/game/decoder/udp_0x22.cpp
+ A /trunk/tinns-v2/src/game/decoder/udp_0x22.h
+ A /trunk/tinns-v2/src/game/decoder/udp_OOO.cpp
+ A /trunk/tinns-v2/src/game/decoder/udp_OOO.h
+ A /trunk/tinns-v2/src/game/decoder/udp_charmove.cpp
+ A /trunk/tinns-v2/src/game/decoder/udp_charmove.h
+ A /trunk/tinns-v2/src/game/decoder/udp_chat.cpp
+ A /trunk/tinns-v2/src/game/decoder/udp_chat.h
+ A /trunk/tinns-v2/src/game/decoder/udp_packet0.cpp
+ A /trunk/tinns-v2/src/game/decoder/udp_packet0.h
+ A /trunk/tinns-v2/src/game/decoder/udp_ping.cpp
+ A /trunk/tinns-v2/src/game/decoder/udp_ping.h
+ A /trunk/tinns-v2/src/game/decoder/udp_reqinfo.cpp
+ A /trunk/tinns-v2/src/game/decoder/udp_reqinfo.h
+ A /trunk/tinns-v2/src/game/decoder/udp_subskill.cpp
+ A /trunk/tinns-v2/src/game/decoder/udp_subskill.h
+ A /trunk/tinns-v2/src/game/decoder/udp_sync.cpp
+ A /trunk/tinns-v2/src/game/decoder/udp_sync.h
+ A /trunk/tinns-v2/src/game/decoder/udp_useobject.cpp
+ A /trunk/tinns-v2/src/game/decoder/udp_useobject.h
+ A /trunk/tinns-v2/src/game/decoder/udp_vhc.cpp
+ A /trunk/tinns-v2/src/game/decoder/udp_vhc.h
+ A /trunk/tinns-v2/src/game/decoder/udp_zoning.cpp
+ A /trunk/tinns-v2/src/game/decoder/udp_zoning.h
+ A /trunk/tinns-v2/src/game/decoder/udpanalyser.cpp
+ A /trunk/tinns-v2/src/game/decoder/udpanalyser.h
+ A /trunk/tinns-v2/src/game/def
+ A /trunk/tinns-v2/src/game/def/Makefile
+ A /trunk/tinns-v2/src/game/def/def_appartements.cpp
+ A /trunk/tinns-v2/src/game/def/def_appplaces.cpp
+ A /trunk/tinns-v2/src/game/def/def_characters.cpp
+ A /trunk/tinns-v2/src/game/def/def_charkinds.cpp
+ A /trunk/tinns-v2/src/game/def/def_factions.cpp
+ A /trunk/tinns-v2/src/game/def/def_hack.cpp
+ A /trunk/tinns-v2/src/game/def/def_items.cpp
+ A /trunk/tinns-v2/src/game/def/def_respawn.cpp
+ A /trunk/tinns-v2/src/game/def/def_skills.cpp
+ A /trunk/tinns-v2/src/game/def/def_subskills.cpp
+ A /trunk/tinns-v2/src/game/def/def_worldmodels.cpp
+ A /trunk/tinns-v2/src/game/def/def_worlds.cpp
+ A /trunk/tinns-v2/src/game/def/defparser.cpp
+ A /trunk/tinns-v2/src/game/def/gamedefs.cpp
+ A /trunk/tinns-v2/src/game/def/main.h
+ D /trunk/tinns-v2/src/game/def_characters.cpp
+ D /trunk/tinns-v2/src/game/def_characters.h
+ D /trunk/tinns-v2/src/game/def_charkinds.cpp
+ D /trunk/tinns-v2/src/game/def_charkinds.h
+ D /trunk/tinns-v2/src/game/def_factions.cpp
+ D /trunk/tinns-v2/src/game/def_factions.h
+ D /trunk/tinns-v2/src/game/def_hack.cpp
+ D /trunk/tinns-v2/src/game/def_hack.h
+ D /trunk/tinns-v2/src/game/def_items.cpp
+ D /trunk/tinns-v2/src/game/def_items.h
+ D /trunk/tinns-v2/src/game/def_skills.cpp
+ D /trunk/tinns-v2/src/game/def_skills.h
+ D /trunk/tinns-v2/src/game/def_subskills.cpp
+ D /trunk/tinns-v2/src/game/def_subskills.h
+ D /trunk/tinns-v2/src/game/def_worlds.cpp
+ D /trunk/tinns-v2/src/game/def_worlds.h
+ D /trunk/tinns-v2/src/game/defparser.cpp
+ D /trunk/tinns-v2/src/game/defparser.h
+ D /trunk/tinns-v2/src/game/filesystem.cpp
+ D /trunk/tinns-v2/src/game/filesystem.h
+ D /trunk/tinns-v2/src/game/gamedefs.cpp
+ D /trunk/tinns-v2/src/game/gamedefs.h
+ A /trunk/tinns-v2/src/game/gamescript.cpp.inhib
+ M /trunk/tinns-v2/src/game/gameserver.cpp
+ D /trunk/tinns-v2/src/game/gameserver.h
+ A /trunk/tinns-v2/src/game/genreplist.cpp
+ M /trunk/tinns-v2/src/game/globals.cpp
+ D /trunk/tinns-v2/src/game/globals.h
+ A /trunk/tinns-v2/src/game/include
+ A /trunk/tinns-v2/src/game/include/accounts.h
+ A /trunk/tinns-v2/src/game/include/buddylist.h
+ A /trunk/tinns-v2/src/game/include/chars.h
+ A /trunk/tinns-v2/src/game/include/chat.h
+ A /trunk/tinns-v2/src/game/include/client.h
+ A /trunk/tinns-v2/src/game/include/clientmanager.h
+ A /trunk/tinns-v2/src/game/include/commands.h
+ A /trunk/tinns-v2/src/game/include/database.h
+ A /trunk/tinns-v2/src/game/include/def_appartements.h
+ A /trunk/tinns-v2/src/game/include/def_appplaces.h
+ A /trunk/tinns-v2/src/game/include/def_characters.h
+ A /trunk/tinns-v2/src/game/include/def_charkinds.h
+ A /trunk/tinns-v2/src/game/include/def_factions.h
+ A /trunk/tinns-v2/src/game/include/def_hack.h
+ A /trunk/tinns-v2/src/game/include/def_items.h
+ A /trunk/tinns-v2/src/game/include/def_respawn.h
+ A /trunk/tinns-v2/src/game/include/def_skills.h
+ A /trunk/tinns-v2/src/game/include/def_subskills.h
+ A /trunk/tinns-v2/src/game/include/def_worldmodels.h
+ A /trunk/tinns-v2/src/game/include/def_worlds.h
+ A /trunk/tinns-v2/src/game/include/defparser.h
+ A /trunk/tinns-v2/src/game/include/defs.h
+ A /trunk/tinns-v2/src/game/include/gamedefs.h
+ A /trunk/tinns-v2/src/game/include/gamescript.h
+ A /trunk/tinns-v2/src/game/include/gameserver.h
+ A /trunk/tinns-v2/src/game/include/genreplist.h
+ A /trunk/tinns-v2/src/game/include/globals.h
+ A /trunk/tinns-v2/src/game/include/inventory.h
+ A /trunk/tinns-v2/src/game/include/isc.h
+ A /trunk/tinns-v2/src/game/include/item.h
+ A /trunk/tinns-v2/src/game/include/msgbuilder.h
+ A /trunk/tinns-v2/src/game/include/msgdecoder.h
+ A /trunk/tinns-v2/src/game/include/rconsole.h
+ A /trunk/tinns-v2/src/game/include/server.h
+ A /trunk/tinns-v2/src/game/include/skill.h
+ A /trunk/tinns-v2/src/game/include/sql.h
+ A /trunk/tinns-v2/src/game/include/vehicle.h
+ A /trunk/tinns-v2/src/game/include/zoning.h
+ M /trunk/tinns-v2/src/game/inventory.cpp
+ D /trunk/tinns-v2/src/game/inventory.h
+ A /trunk/tinns-v2/src/game/isc.cpp.inhib
+ D /trunk/tinns-v2/src/game/item.h
+ M /trunk/tinns-v2/src/game/main.h
+ D /trunk/tinns-v2/src/game/misc.cpp
+ D /trunk/tinns-v2/src/game/misc.h
+ A /trunk/tinns-v2/src/game/msgbuilder.cpp
+ D /trunk/tinns-v2/src/game/mutex.h
+ A /trunk/tinns-v2/src/game/rconsole.cpp.inhib
+ D /trunk/tinns-v2/src/game/semaphore.h
+ D /trunk/tinns-v2/src/game/server.h
+ D /trunk/tinns-v2/src/game/skill.h
+ M /trunk/tinns-v2/src/game/sql.cpp
+ D /trunk/tinns-v2/src/game/sql.h
+ D /trunk/tinns-v2/src/game/thread.h
+ A /trunk/tinns-v2/src/game/ttt.out
+ D /trunk/tinns-v2/src/game/types.h
+ D /trunk/tinns-v2/src/game/vehicle.h
+ M /trunk/tinns-v2/src/game/zoning.cpp
+ D /trunk/tinns-v2/src/game/zoning.h
+ A /trunk/tinns-v2/src/include/config.h
+ A /trunk/tinns-v2/src/include/connection-tcp.h
+ A /trunk/tinns-v2/src/include/connection-udp.h
+ A /trunk/tinns-v2/src/include/console.h
+ A /trunk/tinns-v2/src/include/external.h
+ A /trunk/tinns-v2/src/include/filesystem.h
+ A /trunk/tinns-v2/src/include/message.h
+ A /trunk/tinns-v2/src/include/misc.h
+ A /trunk/tinns-v2/src/include/netcode.h
+ A /trunk/tinns-v2/src/include/serversocket.h
+ A /trunk/tinns-v2/src/include/tinns_mutex.h
+ A /trunk/tinns-v2/src/include/tinns_semaphore.h
+ A /trunk/tinns-v2/src/include/tinns_thread.h
+ A /trunk/tinns-v2/src/include/types.h
+ A /trunk/tinns-v2/src/include/version.h
+ M /trunk/tinns-v2/src/info/Makefile
+ D /trunk/tinns-v2/src/info/config.cpp
+ D /trunk/tinns-v2/src/info/config.h
+ A /trunk/tinns-v2/src/info/configtemplate.h
+ D /trunk/tinns-v2/src/info/console.cpp
+ D /trunk/tinns-v2/src/info/console.h
+ M /trunk/tinns-v2/src/info/globals.cpp
+ M /trunk/tinns-v2/src/info/globals.h
+ M /trunk/tinns-v2/src/info/infoserver.cpp
+ M /trunk/tinns-v2/src/info/main.h
+ D /trunk/tinns-v2/src/info/misc.cpp
+ D /trunk/tinns-v2/src/info/misc.h
+ M /trunk/tinns-v2/src/info/server.cpp
+ M /trunk/tinns-v2/src/info/server.h
+ D /trunk/tinns-v2/src/info/types.h
+ A /trunk/tinns-v2/src/lib
+ M /trunk/tinns-v2/src/patch/Makefile
+ D /trunk/tinns-v2/src/patch/config.cpp
+ D /trunk/tinns-v2/src/patch/config.h
+ A /trunk/tinns-v2/src/patch/configtemplate.h
+ D /trunk/tinns-v2/src/patch/console.cpp
+ D /trunk/tinns-v2/src/patch/console.h
+ D /trunk/tinns-v2/src/patch/filesystem.cpp
+ D /trunk/tinns-v2/src/patch/filesystem.h
+ M /trunk/tinns-v2/src/patch/globals.cpp
+ M /trunk/tinns-v2/src/patch/main.h
+ D /trunk/tinns-v2/src/patch/misc.cpp
+ D /trunk/tinns-v2/src/patch/misc.h
+ M /trunk/tinns-v2/src/patch/server.cpp
+ D /trunk/tinns-v2/src/patch/types.h
+ D /trunk/tinns-v2/src/version.h
+
+Major filetree, make system and internal structure changes as well as some functionnal additions
+------------------------------------------------------------------------
+r11 | Hammag | 2006-09-28 14:54:48 +0200 (Thu, 28 Sep 2006) | 1 line
+Changed paths:
+ A /trunk/tinns-v2/src/common
+ A /trunk/tinns-v2/src/common/config
+ A /trunk/tinns-v2/src/common/console
+ A /trunk/tinns-v2/src/common/filesystem
+ A /trunk/tinns-v2/src/common/misc
+ A /trunk/tinns-v2/src/include
+
+Creating new dirs
+------------------------------------------------------------------------
+r10 | Namikon | 2006-08-13 21:47:24 +0200 (Sun, 13 Aug 2006) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/CHANGELOG
+ A /trunk/tinns-v2/WORK_IN_PROGRESS
+ M /trunk/tinns-v2/conf/gameserver.conf
+ M /trunk/tinns-v2/conf/infoserver.conf
+ A /trunk/tinns-v2/database
+ A /trunk/tinns-v2/database/GameDB4.zip
+ A /trunk/tinns-v2/database/InfoDB2.zip
+ A /trunk/tinns-v2/docs
+ A /trunk/tinns-v2/docs/ISC ProtDef.txt
+ M /trunk/tinns-v2/src/game/Makefile
+ A /trunk/tinns-v2/src/game/_inc
+ A /trunk/tinns-v2/src/game/_inc/README
+ A /trunk/tinns-v2/src/game/_inc/baseline.inc.cpp
+ A /trunk/tinns-v2/src/game/_inc/chat_direct.inc.cpp
+ A /trunk/tinns-v2/src/game/_inc/player_jump.inc.cpp
+ A /trunk/tinns-v2/src/game/_inc/player_movement.inc.cpp
+ A /trunk/tinns-v2/src/game/_inc/subskills.inc.cpp
+ A /trunk/tinns-v2/src/game/_inc/udp_0x4c.inc.cpp
+ A /trunk/tinns-v2/src/game/_inc/use_aptaccess.inc.cpp
+ A /trunk/tinns-v2/src/game/_inc/use_chair.inc.cpp
+ A /trunk/tinns-v2/src/game/_inc/use_genrep.inc.cpp
+ A /trunk/tinns-v2/src/game/_inc/use_main.inc.cpp
+ A /trunk/tinns-v2/src/game/_inc/use_vehicle.inc.cpp
+ A /trunk/tinns-v2/src/game/_inc/zoning.inc.cpp
+ M /trunk/tinns-v2/src/game/accounts.cpp
+ M /trunk/tinns-v2/src/game/chars.cpp
+ M /trunk/tinns-v2/src/game/chars.h
+ M /trunk/tinns-v2/src/game/chat.cpp
+ M /trunk/tinns-v2/src/game/client.cpp
+ M /trunk/tinns-v2/src/game/client.h
+ M /trunk/tinns-v2/src/game/clientmanager.cpp
+ M /trunk/tinns-v2/src/game/clientmanager.h
+ M /trunk/tinns-v2/src/game/commands.cpp
+ M /trunk/tinns-v2/src/game/config.cpp
+ M /trunk/tinns-v2/src/game/database.cpp
+ M /trunk/tinns-v2/src/game/database.h
+ M /trunk/tinns-v2/src/game/def_characters.cpp
+ M /trunk/tinns-v2/src/game/def_characters.h
+ M /trunk/tinns-v2/src/game/def_charkinds.cpp
+ M /trunk/tinns-v2/src/game/def_charkinds.h
+ M /trunk/tinns-v2/src/game/def_items.cpp
+ M /trunk/tinns-v2/src/game/def_items.h
+ M /trunk/tinns-v2/src/game/def_worlds.h
+ M /trunk/tinns-v2/src/game/gameserver.cpp
+ M /trunk/tinns-v2/src/game/gameserver.h
+ M /trunk/tinns-v2/src/game/globals.cpp
+ A /trunk/tinns-v2/src/game/inventory.cpp
+ A /trunk/tinns-v2/src/game/inventory.h
+ A /trunk/tinns-v2/src/game/item.cpp
+ A /trunk/tinns-v2/src/game/item.h
+ M /trunk/tinns-v2/src/game/main.cpp
+ M /trunk/tinns-v2/src/game/main.h
+ M /trunk/tinns-v2/src/game/misc.cpp
+ M /trunk/tinns-v2/src/game/misc.h
+ M /trunk/tinns-v2/src/game/skill.h
+ M /trunk/tinns-v2/src/game/sql.cpp
+ M /trunk/tinns-v2/src/game/sql.h
+ M /trunk/tinns-v2/src/game/zoning.cpp
+ M /trunk/tinns-v2/src/game/zoning.h
+ M /trunk/tinns-v2/src/info/Makefile
+ M /trunk/tinns-v2/src/info/accounts.cpp
+ M /trunk/tinns-v2/src/info/client.h
+ M /trunk/tinns-v2/src/info/infoserver.cpp
+ M /trunk/tinns-v2/src/info/main.cpp
+ M /trunk/tinns-v2/src/info/main.h
+ M /trunk/tinns-v2/src/info/misc.cpp
+ M /trunk/tinns-v2/src/info/misc.h
+ M /trunk/tinns-v2/src/netcode/connection-tcp.cpp
+ M /trunk/tinns-v2/src/netcode/connection-tcp.h
+ M /trunk/tinns-v2/src/netcode/connection-udp.cpp
+ M /trunk/tinns-v2/src/netcode/connection-udp.h
+ A /trunk/tinns-v2/src/netcode/main.h
+ A /trunk/tinns-v2/src/netcode/message.cpp
+ A /trunk/tinns-v2/src/netcode/message.h
+ M /trunk/tinns-v2/src/netcode/serversocket.cpp
+ M /trunk/tinns-v2/src/netcode/serversocket.h
+ M /trunk/tinns-v2/src/patch/Makefile
+ M /trunk/tinns-v2/src/patch/client.h
+ M /trunk/tinns-v2/src/patch/main.cpp
+ M /trunk/tinns-v2/src/patch/main.h
+ M /trunk/tinns-v2/src/patch/patchserver.cpp
+ M /trunk/tinns-v2/src/version.h
+
+http://forum.linux-addicted.org/viewtopic.php?p=3069#3069
+------------------------------------------------------------------------
+r9 | Namikon | 2006-05-31 22:19:12 +0200 (Wed, 31 May 2006) | 1 line
+Changed paths:
+ A /trunk/tinns-v2/CHANGELOG
+ M /trunk/tinns-v2/conf/gameserver.conf
+ M /trunk/tinns-v2/conf/infoserver.conf
+ D /trunk/tinns-v2/database
+ M /trunk/tinns-v2/src/game/accounts.cpp
+ M /trunk/tinns-v2/src/game/chars.cpp
+ M /trunk/tinns-v2/src/game/chat.cpp
+ M /trunk/tinns-v2/src/game/client.cpp
+ M /trunk/tinns-v2/src/game/clientmanager.cpp
+ M /trunk/tinns-v2/src/game/commands.cpp
+ M /trunk/tinns-v2/src/game/config.cpp
+ M /trunk/tinns-v2/src/game/console.cpp
+ M /trunk/tinns-v2/src/game/database.cpp
+ M /trunk/tinns-v2/src/game/def_characters.cpp
+ M /trunk/tinns-v2/src/game/def_charkinds.cpp
+ M /trunk/tinns-v2/src/game/def_factions.cpp
+ M /trunk/tinns-v2/src/game/def_hack.cpp
+ M /trunk/tinns-v2/src/game/def_items.cpp
+ M /trunk/tinns-v2/src/game/def_skills.cpp
+ M /trunk/tinns-v2/src/game/def_subskills.cpp
+ M /trunk/tinns-v2/src/game/def_worlds.cpp
+ M /trunk/tinns-v2/src/game/defparser.cpp
+ M /trunk/tinns-v2/src/game/filesystem.cpp
+ M /trunk/tinns-v2/src/game/gamedefs.cpp
+ M /trunk/tinns-v2/src/game/gameserver.cpp
+ M /trunk/tinns-v2/src/game/globals.cpp
+ M /trunk/tinns-v2/src/game/globals.h
+ M /trunk/tinns-v2/src/game/main.cpp
+ A /trunk/tinns-v2/src/game/main.h
+ M /trunk/tinns-v2/src/game/misc.cpp
+ M /trunk/tinns-v2/src/game/misc.h
+ M /trunk/tinns-v2/src/game/server.cpp
+ M /trunk/tinns-v2/src/game/skill.cpp
+ M /trunk/tinns-v2/src/game/sql.cpp
+ M /trunk/tinns-v2/src/game/sql.h
+ D /trunk/tinns-v2/src/game/tinns.h
+ M /trunk/tinns-v2/src/game/vehicle.cpp
+ M /trunk/tinns-v2/src/game/zoning.cpp
+ M /trunk/tinns-v2/src/info/config.cpp
+ M /trunk/tinns-v2/src/info/console.cpp
+ M /trunk/tinns-v2/src/info/globals.cpp
+ M /trunk/tinns-v2/src/info/infoserver.cpp
+ M /trunk/tinns-v2/src/info/main.h
+ M /trunk/tinns-v2/src/info/misc.cpp
+ M /trunk/tinns-v2/src/netcode/connection-tcp.cpp
+ M /trunk/tinns-v2/src/netcode/connection-udp.cpp
+ M /trunk/tinns-v2/src/netcode/serversocket.cpp
+ M /trunk/tinns-v2/src/patch/client.cpp
+ M /trunk/tinns-v2/src/patch/config.cpp
+ M /trunk/tinns-v2/src/patch/console.cpp
+ M /trunk/tinns-v2/src/patch/filesystem.cpp
+ M /trunk/tinns-v2/src/patch/globals.cpp
+ M /trunk/tinns-v2/src/patch/globals.h
+ M /trunk/tinns-v2/src/patch/main.cpp
+ A /trunk/tinns-v2/src/patch/main.h
+ M /trunk/tinns-v2/src/patch/misc.cpp
+ M /trunk/tinns-v2/src/patch/patchserver.cpp
+ M /trunk/tinns-v2/src/patch/server.cpp
+ D /trunk/tinns-v2/src/patch/tinns.h
+ A /trunk/tinns-v2/src/version.h
+
+See CHANGELOG file for all recent changes
+------------------------------------------------------------------------
+r8 | Namikon | 2006-05-28 22:54:56 +0200 (Sun, 28 May 2006) | 2 lines
+Changed paths:
+ M /trunk/tinns-v2/src/game/Makefile
+ M /trunk/tinns-v2/src/game/client.cpp
+ M /trunk/tinns-v2/src/game/client.h
+ M /trunk/tinns-v2/src/game/gameserver.cpp
+ M /trunk/tinns-v2/src/info/client.cpp
+ M /trunk/tinns-v2/src/netcode/connection-udp.cpp
+ M /trunk/tinns-v2/src/netcode/connection-udp.h
+ M /trunk/tinns-v2/src/netcode/serversocket.cpp
+ M /trunk/tinns-v2/src/netcode/serversocket.h
+ M /trunk/tinns-v2/src/patch/client.cpp
+
+Fixed networklib, should work on every system now.
+Many temp solutions are in this source, we will fix that later
+------------------------------------------------------------------------
+r7 | bakkdoor | 2006-03-20 16:56:02 +0100 (Mon, 20 Mar 2006) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/src/netcode/connection-udp.h
+
+
+------------------------------------------------------------------------
+r6 | bakkdoor | 2006-03-20 16:54:38 +0100 (Mon, 20 Mar 2006) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/src/netcode/connection-udp.h
+
+
+------------------------------------------------------------------------
+r5 | bakkdoor | 2006-03-20 16:52:01 +0100 (Mon, 20 Mar 2006) | 1 line
+Changed paths:
+ M /trunk/tinns-v2/src/netcode/connection-udp.h
+
+
+------------------------------------------------------------------------
+r4 | bakkdoor | 2006-03-20 14:26:37 +0100 (Mon, 20 Mar 2006) | 1 line
+Changed paths:
+ D /trunk/tinns-v2/src/game/gamescript.cpp
+ D /trunk/tinns-v2/src/game/gamescript.h
+ D /trunk/tinns-v2/src/game/rconsole.cpp
+ D /trunk/tinns-v2/src/game/rconsole.h
+
+dont work yet.
+------------------------------------------------------------------------
+r3 | bakkdoor | 2006-03-17 02:51:46 +0100 (Fri, 17 Mar 2006) | 1 line
+Changed paths:
+ D /trunk/tinnl
+
+no need for it anymore.
+------------------------------------------------------------------------
+r2 | bakkdoor | 2006-03-17 02:50:30 +0100 (Fri, 17 Mar 2006) | 8 lines
+Changed paths:
+ A /trunk/tinns-v2
+ A /trunk/tinns-v2/Makefile
+ A /trunk/tinns-v2/conf
+ A /trunk/tinns-v2/conf/gameserver.conf
+ A /trunk/tinns-v2/conf/global.conf
+ A /trunk/tinns-v2/conf/infoserver.conf
+ A /trunk/tinns-v2/conf/patchserver.conf
+ A /trunk/tinns-v2/database
+ A /trunk/tinns-v2/database/config.cfg
+ A /trunk/tinns-v2/database/gameserver.sql.gz
+ A /trunk/tinns-v2/database/infoserver.sql.gz
+ A /trunk/tinns-v2/defs
+ A /trunk/tinns-v2/defs/pak_actionmod.def
+ A /trunk/tinns-v2/defs/pak_ammo.def
+ A /trunk/tinns-v2/defs/pak_appartements.def
+ A /trunk/tinns-v2/defs/pak_appplaces.def
+ A /trunk/tinns-v2/defs/pak_blueprintpieces.def
+ A /trunk/tinns-v2/defs/pak_characters.def
+ A /trunk/tinns-v2/defs/pak_charaction.def
+ A /trunk/tinns-v2/defs/pak_charkinds.def
+ A /trunk/tinns-v2/defs/pak_customanimstrings.def
+ A /trunk/tinns-v2/defs/pak_damage.def
+ A /trunk/tinns-v2/defs/pak_drugs.def
+ A /trunk/tinns-v2/defs/pak_effects.def
+ A /trunk/tinns-v2/defs/pak_fractions.def
+ A /trunk/tinns-v2/defs/pak_gameplaysettings.def
+ A /trunk/tinns-v2/defs/pak_hack.def
+ A /trunk/tinns-v2/defs/pak_implants.def
+ A /trunk/tinns-v2/defs/pak_itemcontainer.def
+ A /trunk/tinns-v2/defs/pak_itemmod.def
+ A /trunk/tinns-v2/defs/pak_itemplan.def
+ A /trunk/tinns-v2/defs/pak_itemres.def
+ A /trunk/tinns-v2/defs/pak_items.def
+ A /trunk/tinns-v2/defs/pak_maps.def
+ A /trunk/tinns-v2/defs/pak_menu.def
+ A /trunk/tinns-v2/defs/pak_missionbase.def
+ A /trunk/tinns-v2/defs/pak_modeltextures.def
+ A /trunk/tinns-v2/defs/pak_npc.def
+ A /trunk/tinns-v2/defs/pak_npcarmor.def
+ A /trunk/tinns-v2/defs/pak_npcgroupspawn.def
+ A /trunk/tinns-v2/defs/pak_npcloot.def
+ A /trunk/tinns-v2/defs/pak_outposts.def
+ A /trunk/tinns-v2/defs/pak_recycles.def
+ A /trunk/tinns-v2/defs/pak_respawn.def
+ A /trunk/tinns-v2/defs/pak_routemenu.def
+ A /trunk/tinns-v2/defs/pak_routesubmenu.def
+ A /trunk/tinns-v2/defs/pak_rsctables.def
+ A /trunk/tinns-v2/defs/pak_scripts.def
+ A /trunk/tinns-v2/defs/pak_shots.def
+ A /trunk/tinns-v2/defs/pak_skills.def
+ A /trunk/tinns-v2/defs/pak_subskill.def
+ A /trunk/tinns-v2/defs/pak_subskill_deu.def
+ A /trunk/tinns-v2/defs/pak_terminals.def
+ A /trunk/tinns-v2/defs/pak_trader.def
+ A /trunk/tinns-v2/defs/pak_tutorialchar.dat
+ A /trunk/tinns-v2/defs/pak_vehiclefx.def
+ A /trunk/tinns-v2/defs/pak_vehicles.def
+ A /trunk/tinns-v2/defs/pak_vehiclesits.def
+ A /trunk/tinns-v2/defs/pak_weapons.def
+ A /trunk/tinns-v2/defs/pak_weather.def
+ A /trunk/tinns-v2/defs/pak_worldinfo.def
+ A /trunk/tinns-v2/defs/pak_worldmodel.def
+ A /trunk/tinns-v2/src
+ A /trunk/tinns-v2/src/game
+ A /trunk/tinns-v2/src/game/Makefile
+ A /trunk/tinns-v2/src/game/accounts.cpp
+ A /trunk/tinns-v2/src/game/accounts.h
+ A /trunk/tinns-v2/src/game/chars.cpp
+ A /trunk/tinns-v2/src/game/chars.h
+ A /trunk/tinns-v2/src/game/chat.cpp
+ A /trunk/tinns-v2/src/game/chat.h
+ A /trunk/tinns-v2/src/game/client.cpp
+ A /trunk/tinns-v2/src/game/client.h
+ A /trunk/tinns-v2/src/game/clientmanager.cpp
+ A /trunk/tinns-v2/src/game/clientmanager.h
+ A /trunk/tinns-v2/src/game/commands.cpp
+ A /trunk/tinns-v2/src/game/commands.h
+ A /trunk/tinns-v2/src/game/config.cpp
+ A /trunk/tinns-v2/src/game/config.h
+ A /trunk/tinns-v2/src/game/console.cpp
+ A /trunk/tinns-v2/src/game/console.h
+ A /trunk/tinns-v2/src/game/database.cpp
+ A /trunk/tinns-v2/src/game/database.h
+ A /trunk/tinns-v2/src/game/def_characters.cpp
+ A /trunk/tinns-v2/src/game/def_characters.h
+ A /trunk/tinns-v2/src/game/def_charkinds.cpp
+ A /trunk/tinns-v2/src/game/def_charkinds.h
+ A /trunk/tinns-v2/src/game/def_factions.cpp
+ A /trunk/tinns-v2/src/game/def_factions.h
+ A /trunk/tinns-v2/src/game/def_hack.cpp
+ A /trunk/tinns-v2/src/game/def_hack.h
+ A /trunk/tinns-v2/src/game/def_items.cpp
+ A /trunk/tinns-v2/src/game/def_items.h
+ A /trunk/tinns-v2/src/game/def_skills.cpp
+ A /trunk/tinns-v2/src/game/def_skills.h
+ A /trunk/tinns-v2/src/game/def_subskills.cpp
+ A /trunk/tinns-v2/src/game/def_subskills.h
+ A /trunk/tinns-v2/src/game/def_worlds.cpp
+ A /trunk/tinns-v2/src/game/def_worlds.h
+ A /trunk/tinns-v2/src/game/defparser.cpp
+ A /trunk/tinns-v2/src/game/defparser.h
+ A /trunk/tinns-v2/src/game/filesystem.cpp
+ A /trunk/tinns-v2/src/game/filesystem.h
+ A /trunk/tinns-v2/src/game/gamedefs.cpp
+ A /trunk/tinns-v2/src/game/gamedefs.h
+ A /trunk/tinns-v2/src/game/gamescript.cpp
+ A /trunk/tinns-v2/src/game/gamescript.h
+ A /trunk/tinns-v2/src/game/gameserver.cpp
+ A /trunk/tinns-v2/src/game/gameserver.h
+ A /trunk/tinns-v2/src/game/globals.cpp
+ A /trunk/tinns-v2/src/game/globals.h
+ A /trunk/tinns-v2/src/game/main.cpp
+ A /trunk/tinns-v2/src/game/misc.cpp
+ A /trunk/tinns-v2/src/game/misc.h
+ A /trunk/tinns-v2/src/game/mutex.h
+ A /trunk/tinns-v2/src/game/rconsole.cpp
+ A /trunk/tinns-v2/src/game/rconsole.h
+ A /trunk/tinns-v2/src/game/semaphore.h
+ A /trunk/tinns-v2/src/game/server.cpp
+ A /trunk/tinns-v2/src/game/server.h
+ A /trunk/tinns-v2/src/game/skill.cpp
+ A /trunk/tinns-v2/src/game/skill.h
+ A /trunk/tinns-v2/src/game/sql.cpp
+ A /trunk/tinns-v2/src/game/sql.h
+ A /trunk/tinns-v2/src/game/thread.h
+ A /trunk/tinns-v2/src/game/tinns.h
+ A /trunk/tinns-v2/src/game/types.h
+ A /trunk/tinns-v2/src/game/vehicle.cpp
+ A /trunk/tinns-v2/src/game/vehicle.h
+ A /trunk/tinns-v2/src/game/zoning.cpp
+ A /trunk/tinns-v2/src/game/zoning.h
+ A /trunk/tinns-v2/src/info
+ A /trunk/tinns-v2/src/info/Makefile
+ A /trunk/tinns-v2/src/info/accounts.cpp
+ A /trunk/tinns-v2/src/info/accounts.h
+ A /trunk/tinns-v2/src/info/client.cpp
+ A /trunk/tinns-v2/src/info/client.h
+ A /trunk/tinns-v2/src/info/config.cpp
+ A /trunk/tinns-v2/src/info/config.h
+ A /trunk/tinns-v2/src/info/console.cpp
+ A /trunk/tinns-v2/src/info/console.h
+ A /trunk/tinns-v2/src/info/globals.cpp
+ A /trunk/tinns-v2/src/info/globals.h
+ A /trunk/tinns-v2/src/info/infoserver.cpp
+ A /trunk/tinns-v2/src/info/infoserver.h
+ A /trunk/tinns-v2/src/info/main.cpp
+ A /trunk/tinns-v2/src/info/main.h
+ A /trunk/tinns-v2/src/info/misc.cpp
+ A /trunk/tinns-v2/src/info/misc.h
+ A /trunk/tinns-v2/src/info/server.cpp
+ A /trunk/tinns-v2/src/info/server.h
+ A /trunk/tinns-v2/src/info/sql.cpp
+ A /trunk/tinns-v2/src/info/sql.h
+ A /trunk/tinns-v2/src/info/types.h
+ A /trunk/tinns-v2/src/netcode
+ A /trunk/tinns-v2/src/netcode/connection-tcp.cpp
+ A /trunk/tinns-v2/src/netcode/connection-tcp.h
+ A /trunk/tinns-v2/src/netcode/connection-udp.cpp
+ A /trunk/tinns-v2/src/netcode/connection-udp.h
+ A /trunk/tinns-v2/src/netcode/serversocket.cpp
+ A /trunk/tinns-v2/src/netcode/serversocket.h
+ A /trunk/tinns-v2/src/patch
+ A /trunk/tinns-v2/src/patch/Makefile
+ A /trunk/tinns-v2/src/patch/client.cpp
+ A /trunk/tinns-v2/src/patch/client.h
+ A /trunk/tinns-v2/src/patch/config.cpp
+ A /trunk/tinns-v2/src/patch/config.h
+ A /trunk/tinns-v2/src/patch/console.cpp
+ A /trunk/tinns-v2/src/patch/console.h
+ A /trunk/tinns-v2/src/patch/filesystem.cpp
+ A /trunk/tinns-v2/src/patch/filesystem.h
+ A /trunk/tinns-v2/src/patch/globals.cpp
+ A /trunk/tinns-v2/src/patch/globals.h
+ A /trunk/tinns-v2/src/patch/main.cpp
+ A /trunk/tinns-v2/src/patch/misc.cpp
+ A /trunk/tinns-v2/src/patch/misc.h
+ A /trunk/tinns-v2/src/patch/patchserver.cpp
+ A /trunk/tinns-v2/src/patch/patchserver.h
+ A /trunk/tinns-v2/src/patch/server.cpp
+ A /trunk/tinns-v2/src/patch/server.h
+ A /trunk/tinns-v2/src/patch/tinns.h
+ A /trunk/tinns-v2/src/patch/types.h
+
+tinns-v2 added:
+- new netcode (check out /src/netcode)
+- split into 3 executables (patch/info/gameserver)
+- some other stuff
+-> it works for me here in my (bakkdoor) lan, but not over internet. there's still a problem with the udp-code i believe. tcp works perfectly. try it out on lan etc.
+- besides, there's still an error, if a client is connected and another one tries to connect (login error at gameserver) - should be fixable though.
+
+bakkdoor.
+------------------------------------------------------------------------
+r1 | Akiko | 2006-01-30 07:42:59 +0100 (Mon, 30 Jan 2006) | 3 lines
+Changed paths:
+ A /trunk
+ A /trunk/datapack
+ A /trunk/datapack/defs
+ A /trunk/datapack/patches
+ A /trunk/docs
+ A /trunk/docs/Neocron1.ChatProtocol.pdf
+ A /trunk/docs/Neocron1.MainProtocol.pdf
+ A /trunk/docs/TinNS.QuickInstallation.pdf
+ A /trunk/docs/itemtypes.txt
+ A /trunk/docs/readme
+ A /trunk/tinnl
+ A /trunk/tinns
+ A /trunk/tinns/development
+ A /trunk/tinns/development/HawkNL
+ A /trunk/tinns/development/HawkNL/crc.c
+ A /trunk/tinns/development/HawkNL/err.c
+ A /trunk/tinns/development/HawkNL/errorstr.c
+ A /trunk/tinns/development/HawkNL/group.c
+ A /trunk/tinns/development/HawkNL/hawklib.h
+ A /trunk/tinns/development/HawkNL/hawkthreads.h
+ A /trunk/tinns/development/HawkNL/htcondition.c
+ A /trunk/tinns/development/HawkNL/hthread.c
+ A /trunk/tinns/development/HawkNL/htinternal.h
+ A /trunk/tinns/development/HawkNL/htmutex.c
+ A /trunk/tinns/development/HawkNL/ipx.c
+ A /trunk/tinns/development/HawkNL/ipx.h
+ A /trunk/tinns/development/HawkNL/loopback.c
+ A /trunk/tinns/development/HawkNL/loopback.h
+ A /trunk/tinns/development/HawkNL/nl.c
+ A /trunk/tinns/development/HawkNL/nl.h
+ A /trunk/tinns/development/HawkNL/nlinternal.h
+ A /trunk/tinns/development/HawkNL/nltime.c
+ A /trunk/tinns/development/HawkNL/parallel.h
+ A /trunk/tinns/development/HawkNL/serial.h
+ A /trunk/tinns/development/HawkNL/sock.c
+ A /trunk/tinns/development/HawkNL/sock.h
+ A /trunk/tinns/development/HawkNL/wsock.h
+ A /trunk/tinns/development/Makefile
+ A /trunk/tinns/development/README
+ A /trunk/tinns/development/TinyXML
+ A /trunk/tinns/development/TinyXML/tinystr.cpp
+ A /trunk/tinns/development/TinyXML/tinystr.h
+ A /trunk/tinns/development/TinyXML/tinyxml.cpp
+ A /trunk/tinns/development/TinyXML/tinyxml.h
+ A /trunk/tinns/development/TinyXML/tinyxmlerror.cpp
+ A /trunk/tinns/development/TinyXML/tinyxmlparser.cpp
+ A /trunk/tinns/development/accounts.cpp
+ A /trunk/tinns/development/accounts.h
+ A /trunk/tinns/development/chars.cpp
+ A /trunk/tinns/development/chars.h
+ A /trunk/tinns/development/chat.cpp
+ A /trunk/tinns/development/chat.h
+ A /trunk/tinns/development/client.cpp
+ A /trunk/tinns/development/client.h
+ A /trunk/tinns/development/clientmanager.cpp
+ A /trunk/tinns/development/clientmanager.h
+ A /trunk/tinns/development/commands.cpp
+ A /trunk/tinns/development/commands.h
+ A /trunk/tinns/development/config.cpp
+ A /trunk/tinns/development/config.h
+ A /trunk/tinns/development/console.cpp
+ A /trunk/tinns/development/console.h
+ A /trunk/tinns/development/database
+ A /trunk/tinns/development/database/config.cfg
+ A /trunk/tinns/development/database.cpp
+ A /trunk/tinns/development/database.h
+ A /trunk/tinns/development/def_characters.cpp
+ A /trunk/tinns/development/def_characters.h
+ A /trunk/tinns/development/def_charkinds.cpp
+ A /trunk/tinns/development/def_charkinds.h
+ A /trunk/tinns/development/def_factions.cpp
+ A /trunk/tinns/development/def_factions.h
+ A /trunk/tinns/development/def_hack.cpp
+ A /trunk/tinns/development/def_hack.h
+ A /trunk/tinns/development/def_items.cpp
+ A /trunk/tinns/development/def_items.h
+ A /trunk/tinns/development/def_skills.cpp
+ A /trunk/tinns/development/def_skills.h
+ A /trunk/tinns/development/def_subskills.cpp
+ A /trunk/tinns/development/def_subskills.h
+ A /trunk/tinns/development/def_worlds.cpp
+ A /trunk/tinns/development/def_worlds.h
+ A /trunk/tinns/development/defparser.cpp
+ A /trunk/tinns/development/defparser.h
+ A /trunk/tinns/development/filesystem.cpp
+ A /trunk/tinns/development/filesystem.h
+ A /trunk/tinns/development/gamedefs.cpp
+ A /trunk/tinns/development/gamedefs.h
+ A /trunk/tinns/development/gameserver.cpp
+ A /trunk/tinns/development/gameserver.h
+ A /trunk/tinns/development/globals.cpp
+ A /trunk/tinns/development/globals.h
+ A /trunk/tinns/development/infoserver.cpp
+ A /trunk/tinns/development/infoserver.h
+ A /trunk/tinns/development/main.cpp
+ A /trunk/tinns/development/misc.cpp
+ A /trunk/tinns/development/misc.h
+ A /trunk/tinns/development/mutex.h
+ A /trunk/tinns/development/patchserver.cpp
+ A /trunk/tinns/development/patchserver.h
+ A /trunk/tinns/development/rconsole.cpp
+ A /trunk/tinns/development/rconsole.h
+ A /trunk/tinns/development/semaphore.h
+ A /trunk/tinns/development/server.cpp
+ A /trunk/tinns/development/server.h
+ A /trunk/tinns/development/skill.cpp
+ A /trunk/tinns/development/skill.h
+ A /trunk/tinns/development/socket.cpp
+ A /trunk/tinns/development/socket.h
+ A /trunk/tinns/development/sql.cpp
+ A /trunk/tinns/development/sql.h
+ A /trunk/tinns/development/thread.h
+ A /trunk/tinns/development/tinns.h
+ A /trunk/tinns/development/types.h
+ A /trunk/tinns/development/vehicle.cpp
+ A /trunk/tinns/development/vehicle.h
+ A /trunk/tinns/development/zoning.cpp
+ A /trunk/tinns/development/zoning.h
+ A /trunk/tinns/stable
+ A /trunk/tinns/testing
+ A /trunk/tinns/testing/HawkNL
+ A /trunk/tinns/testing/HawkNL/condition.c
+ A /trunk/tinns/testing/HawkNL/crc.c
+ A /trunk/tinns/testing/HawkNL/err.c
+ A /trunk/tinns/testing/HawkNL/errorstr.c
+ A /trunk/tinns/testing/HawkNL/group.c
+ A /trunk/tinns/testing/HawkNL/ipx.c
+ A /trunk/tinns/testing/HawkNL/ipx.h
+ A /trunk/tinns/testing/HawkNL/loopback.c
+ A /trunk/tinns/testing/HawkNL/loopback.h
+ A /trunk/tinns/testing/HawkNL/mutex.c
+ A /trunk/tinns/testing/HawkNL/nl.c
+ A /trunk/tinns/testing/HawkNL/nl.h
+ A /trunk/tinns/testing/HawkNL/nlinternal.h
+ A /trunk/tinns/testing/HawkNL/nltime.c
+ A /trunk/tinns/testing/HawkNL/parallel.h
+ A /trunk/tinns/testing/HawkNL/serial.h
+ A /trunk/tinns/testing/HawkNL/sock.c
+ A /trunk/tinns/testing/HawkNL/sock.h
+ A /trunk/tinns/testing/HawkNL/thread.c
+ A /trunk/tinns/testing/HawkNL/wsock.h
+ A /trunk/tinns/testing/Makefile
+ A /trunk/tinns/testing/TinyXML
+ A /trunk/tinns/testing/TinyXML/tinystr.cpp
+ A /trunk/tinns/testing/TinyXML/tinystr.h
+ A /trunk/tinns/testing/TinyXML/tinyxml.cpp
+ A /trunk/tinns/testing/TinyXML/tinyxml.h
+ A /trunk/tinns/testing/TinyXML/tinyxmlerror.cpp
+ A /trunk/tinns/testing/TinyXML/tinyxmlparser.cpp
+ A /trunk/tinns/testing/accounts.cpp
+ A /trunk/tinns/testing/accounts.h
+ A /trunk/tinns/testing/chars.cpp
+ A /trunk/tinns/testing/chars.h
+ A /trunk/tinns/testing/client.cpp
+ A /trunk/tinns/testing/client.h
+ A /trunk/tinns/testing/config.cpp
+ A /trunk/tinns/testing/config.h
+ A /trunk/tinns/testing/console.cpp
+ A /trunk/tinns/testing/console.h
+ A /trunk/tinns/testing/database
+ A /trunk/tinns/testing/database/accounts.xml
+ A /trunk/tinns/testing/database/chars.xml
+ A /trunk/tinns/testing/database/config.xml
+ A /trunk/tinns/testing/database/playerchars
+ A /trunk/tinns/testing/database/playerchars/1.xml
+ A /trunk/tinns/testing/database.cpp
+ A /trunk/tinns/testing/database.h
+ A /trunk/tinns/testing/def_characters.cpp
+ A /trunk/tinns/testing/def_characters.h
+ A /trunk/tinns/testing/def_charkinds.cpp
+ A /trunk/tinns/testing/def_charkinds.h
+ A /trunk/tinns/testing/def_factions.cpp
+ A /trunk/tinns/testing/def_factions.h
+ A /trunk/tinns/testing/def_hack.cpp
+ A /trunk/tinns/testing/def_hack.h
+ A /trunk/tinns/testing/def_items.cpp
+ A /trunk/tinns/testing/def_items.h
+ A /trunk/tinns/testing/def_skills.cpp
+ A /trunk/tinns/testing/def_skills.h
+ A /trunk/tinns/testing/def_subskills.cpp
+ A /trunk/tinns/testing/def_subskills.h
+ A /trunk/tinns/testing/def_worlds.cpp
+ A /trunk/tinns/testing/def_worlds.h
+ A /trunk/tinns/testing/defparser.cpp
+ A /trunk/tinns/testing/defparser.h
+ A /trunk/tinns/testing/filesystem.cpp
+ A /trunk/tinns/testing/filesystem.h
+ A /trunk/tinns/testing/gamedefs.cpp
+ A /trunk/tinns/testing/gamedefs.h
+ A /trunk/tinns/testing/gameserver.cpp
+ A /trunk/tinns/testing/gameserver.h
+ A /trunk/tinns/testing/globals.cpp
+ A /trunk/tinns/testing/globals.h
+ A /trunk/tinns/testing/infoserver.cpp
+ A /trunk/tinns/testing/infoserver.h
+ A /trunk/tinns/testing/main.cpp
+ A /trunk/tinns/testing/misc.cpp
+ A /trunk/tinns/testing/misc.h
+ A /trunk/tinns/testing/mutex.h
+ A /trunk/tinns/testing/patchserver.cpp
+ A /trunk/tinns/testing/patchserver.h
+ A /trunk/tinns/testing/rconsole.cpp
+ A /trunk/tinns/testing/rconsole.h
+ A /trunk/tinns/testing/semaphore.h
+ A /trunk/tinns/testing/server.cpp
+ A /trunk/tinns/testing/server.h
+ A /trunk/tinns/testing/socket.cpp
+ A /trunk/tinns/testing/socket.h
+ A /trunk/tinns/testing/thread.h
+ A /trunk/tinns/testing/tinns.h
+ A /trunk/tinns/testing/types.h
+ A /trunk/tinns/testing/zoning.cpp
+ A /trunk/tinns/testing/zoning.h
+ A /trunk/tools
+ A /trunk/tools/pak_decompress
+ A /trunk/tools/pak_decompress/Makefile
+ A /trunk/tools/pak_decompress/pak_decompress.cpp
+ A /trunk/tools/pak_decompress/pak_decompress.jar
+ A /trunk/tools/vfs_viewer
+ A /trunk/tools/vfs_viewer/Makefile
+ A /trunk/tools/vfs_viewer/vfs_viewer.c
+
+- reimport of tinns after repository crash (what ever that was)
+
+
+------------------------------------------------------------------------
+++ /dev/null
-<GPL>\r
- TinNS (TinNS is not a Neocron Server)\r
- Copyright (C) 2005 Linux Addicted Community\r
- maintainer Akiko <akiko@gmx.org>\r
-\r
- This program is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU General Public License\r
- as published by the Free Software Foundation; either version 2\r
- of the License, or (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
- 02110-1301, USA.\r
-</GPL>\r
-\r
-Developers:\r
-- Akiko\r
-- bakkdoor\r
-- Namikon\r
-- Hammag\r
-\r
-> Recent changes\r
-====================\r
-Namikon; 31.05.2006 22:12 GMT+1\r
-----------\r
-<General changes>\r
-- Introduced CHANGELOG file\r
-- Added version.h to enable a way to create release tarballs/binaries\r
-- Fixed a dozen of typos and bugs from the additions of the last 2 days\r
-- "Clean build"; Should compile without any error now. (Note: Not "work", "compile" :) )\r
-\r
-\r
-<Source changes>\r
-[GAME]\r
-globals.cpp :: ShutdownTinNS()\r
- - Renamed to Shutdown()\r
- - Added svn version output to startup procedure\r
- - Fixed minor typos/console outputs\r
-config.cpp :: LoadOptions()\r
- - Changed configfile, now loads data from /conf/gameserver.cfg\r
- - Added full 2 DB support (was: "sql_*" now: "info_sql_*" and "game_sql_*")\r
-\r
-[INFO]\r
-\r
-[PATCH]\r
-globals.cpp :: ShutdownTinNS()\r
- - Renamed to Shutdown()\r
-\r
-[ALL]\r
-misc.cpp :: GetSVNRev()\r
- - Added handling for version.h defines\r
-====================\r
-Hammag; 06.07.2006 02:17 GMT+1\r
-----------\r
-<General changes>\r
-- Put UDP sockets in non-blocking mode.\r
-- Checked and modified all socket related stuff to work in non-blocking mode.\r
-- Lowered CPU use from 100% to ~0% by changing from sched_yield() to I/O wait sleep using Select.\r
- This avoid runingthe main loop when there's nothing to do (some more improvements are to come\r
- on this topic).\r
-- The socket Select now waits for any tcp OR UDP socket incoming data.\r
-- Fixed some pointer issues in netcode.\r
-\r
-\r
-<Source changes>\r
-[GAME]\r
- \r
-[INFO]\r
-misc.h\r
- - added declaration of utility function IPlongToString()\r
-misc.cpp :: IPlongToString()\r
- - implemented function to convert IP address in u32 format to string\r
-infoserver.cpp :: HandleServerList()\r
- - now use IPlongToString() to display server IP on Console\r
-\r
-[PATCH]\r
-\r
-[ALL]\r
-patchserver.cpp, infoserver.cpp, gameserver.cpp :: Start()\r
- - set 10 msec timeout for socket select, which sets the max wait time\r
- for the main loop when no activity.\r
-\r
-main.cpp\r
- - commented out sched_yield() in main loop, as it is not needed anymore.\r
-\r
-main.h\r
- - moved-up tinns-specific types include to ready them for netcode compilation\r
-\r
-[NETCODE]\r
-connection-tcp.cpp :: ConnectionTCP()\r
- - moved-in non-blocking setting from ServerSocket::getTCPConnection()\r
- for better class coherency\r
-connection-tcp.cpp :: update()\r
- - modified to deal correctly with would-block socket writes.\r
- - fixed a pointer and size issue in socket recv\r
-\r
-connection-udp.h :: class\r
- - added private member m_ServerSocket\r
- - added ServerSocket parameter in constructor prototype\r
- \r
-connection-udp.cpp :: ConnectionUDP()\r
- - modified to set m_ServerSocket from constructor parameters\r
-connection-udp.cpp :: ~ConnectionUDP()\r
- - added socket removal from fd sets by calling m_ServerSocket->delSocketFromSet\r
-connection-udp.cpp :: update()\r
- - modified to check m_ServerSocket->isDataAvailable() before trying to read from socket\r
- - fixed a pointer and size issue in socket recv\r
-\r
-serversocket.h :: class\r
- - added settimeout public method\r
- - added fd_set m_MainSetUDP private member\r
- - added fd_set m_MainSetGlobal private member (= m_MainSetTCP + m_MainSetUDP)\r
- \r
-serversocket.cpp :: ServerSocket()\r
- - moved m_TimeOut initialization in constructor\r
- - added m_MainSetUDP and m_MainSetGlobal init\r
-serversocket.cpp :: settimeout()\r
- - implemented method to set m_TimeOut to permit tuning\r
-serversocket.cpp :: open()\r
- - added m_MainSetUDP and m_MainSetGlobal init\r
- - added m_ListenerTCP to m_MainSetGlobal too\r
-serversocket.cpp :: update()\r
- - now m_MainSetGlobal is copied to m_ReadSetTCP set,\r
- - added a local fdMax for select\r
- - use a temp timeout structure in select as select doc says select implementation\r
- for Linux could change this value\r
-serversocket.cpp :: getUDPConnection()\r
- - now pass this pointer to new ConnectionUDP constructor\r
- - new UDP sockets are added to m_MainSetUDP and m_MainSetGlobal,\r
- and kept track of in m_FdMaxUDP\r
-serversocket.cpp :: getTCPConnection()\r
- - fixed a struct length issue (?) in accept\r
- - now new TCP sockets are added to m_MainSetGlobal too\r
- - moved non-blocking setting to ConnectionTCP::ConnectionTCP() for better class coherency\r
-serversocket.cpp :: delSocketFromSet()\r
- - added removal of sockfd from m_MainSetUDP and m_MainSetGlobal too\r
- \r
-====================\r
-Hammag; 30.07.2006 02:17 GMT+1\r
-----------\r
-<General changes>\r
- - Baseline fixed, full zoning now really works with multiplayer\r
- - Multiuser now works. Multiple login + mutual viewing.\r
- Now a char displays as expected ingame for himself as for others.(some movement/positionning glitches remain)\r
- - Warning: code for using items hasn't been fixed, so every thing 2nd+ user does will be\r
- attriuted to 1st user and provoque OOO flood.\r
- So don't try using items, except for the first user.\r
- - added @skin command. Reminder use by @skin, little mode description in commands.cpp header\r
-\r
-<Source changes>\r
-[GAME]\r
- - Many changes in many files\r
- - amongst other, rewrited baseline.inc.cpp with new PMessage object as an exemple\r
- - added PItem & PInventory classes\r
-\r
-[NETCODE]\r
- - Added PMessage class for network message input/output\r
- - UDP & TCP connection classes now has an interface for PMessages\r
- \r
-====================\r
-Hammag; 06.08.2006 02:17 GMT+1\r
-----------\r
-<General changes>\r
- - code for using items should now be fixed for most case (see above) so activating items in multiuser mode is no longer a limitation\r
- - a similar issue in @warp command has been solved (and spawn location added as an optional command line parameter as in NeoX)\r
- - further modifications to the netcode to cope with NAT. New options added to config file\r
- - rework of the config.cpp implementation, to enable easy addition of new option and more explicit error checking. See comments at begining of config.cpp\r
- - gametime flow fixed. Start time is set to 0 ATM\r
- - other minor changes. See source files starts for info\r
- - conf/gameserver.conf extended with NAT related options\r
-\r
-<Source changes>\r
-[GAME]\r
- - Many changes in many files for modifications stated above\r
- - Changes to ClientManager to make it work and add methods to dispatch messages to clients\r
- - game/Makefile updated\r
- \r
-[NETCODE]\r
- - Changes in most files for modifications stated above\r
-\r
-[INFO]\r
-client.cpp :: GetAdress()\r
- - updated implementation to use ConnectionTCP::GetRemoteAddress()\r
-\r
-[PATCH]\r
-client.cpp :: GetAdress()\r
- - updated implementation to use ConnectionTCP::GetRemoteAddress()\r
- \r
-====================\r
-Hammag; 24.08.2006 02:17 GMT+1\r
-----------\r
-<General changes>\r
- - movement/positionning in multiuser is now fixed \r
- - implemented NC messages decoding new base classes. Not used yet\r
-\r
-<Source changes>\r
-[GAME]\r
- - added PUdpMsgDecoder class, which objects manage UDP packets decoding\r
- - added PUdpMsgAnalyser class, which is the base class that real packet analyser objects will be derived from\r
- Analysis exemple is not yet implemented\r
- - added PUdpMsgUnknown class, which is the most simple exemple of final packet analyser object (used for unkown packets)\r
-\r
-====================\r
-Hammag; 26.08.2006 02:17 GMT+1\r
-----------\r
-<General changes>\r
- - A modified source tree is now used. The corresponding changes have been applied to the whole source code,\r
- resulting in some move to some common components directories, common includes and corresponding changes\r
- in servers source\r
- - A new Makefile system is now used. All makefiles have been remade accordingly.\r
-\r
-<Source changes>\r
-[ALL]\r
-Put version.h in include dir\r
-Created include/external.h\r
-Removed corresponding includes from all main.h, and replaced by external.h\r
-\r
-[CONSOLE]\r
-Moved console *.cpp files in common/console\r
-Moved console's *.h in include dir\r
-Added a main.h in common/console for specific private includes\r
-Made Console class generic, added output file as constructor parameter,\r
- changed servers code accordingly\r
-Removed Console-> in Console->ColorText(...) in PConsole::~PConsole()\r
-\r
-[NETCODE]\r
-Moved netcode .cpp files in common/netcode\r
-Moved netcode's *.h in include dir, changed netcode's main.h to netcode.h\r
-Added a main.h in common/netcode for specific private includes\r
-\r
-====================\r
-Hammag; 27.08.2006 18:30 GMT+1\r
-----------\r
-<General changes>\r
- - Changed config class as a common component\r
- - Changed "misc" functions as a common components\r
- - Removed some old code, some old defines, and changed some defines to config entry\r
-\r
-[CONFIG] \r
-Moved config .cpp file in common/config\r
-Moved config *.h in include dir\r
-Added a main.h in common/config for specific private includes\r
-Made Config class generic, added option tempate and config file as LoadOptions parameter,\r
- changed servers code accordingly, by making use of the shared class\r
- and adding a templateconfig.h file included in the place where config loading is done\r
-\r
-[MISC]\r
-Merged all misc functions in a single misc.h and a single misc.cpp files\r
-Moved config *.h in include dir\r
-Move the misc.cpp in common/misc\r
-Added a main.h in common/misc for specific private includes\r
-\r
-[ALL SERVERS]\r
-Modified global.cpp and main.h to use shared PConfig class and shared misc functions\r
-Removed misc.* and config.* from servers sources\r
-\r
-====================\r
-Hammag; 10.09.2006 00:00 GMT+1\r
-----------\r
-<General changes>\r
- - Changed filesystem class as a common component\r
- - Added command @effect to play with skins effect (see commands.cpp for details)\r
- - Added command @speed to play with speed (see commands.cpp for details)\r
- - Removed some more #include directive from some main.h files to put them only\r
- when needed in .cpp file. This eliminated some unnecessary dependencies and\r
- makes recompile faster.\r
- - Migrated message decoding to new system for all messages types except 0x13/0x1f (yes... stil lots to do)\r
- \r
-\r
-[ALL SERVERS]\r
-Moved filesystem.h to include dir, and filesystem.cpp to common/filesystem dir\r
-Removed filesystem.* from servers sources\r
-Changed patchserver and gameserver accordingly\r
-\r
-\r
-[GAME]\r
-Added game/include dir to put all .h file to highly facilitate includes.\r
-Added corresponding include directory path directive in game and game/* makefiles\r
-\r
-Put all .def related stuff in game/def subdir.\r
-*.h files are in game/include\r
-\r
-Put all message decoding related stuff in game/decoder subdir.\r
-msgdecoder.h file are in game/include.\r
-Other .h files which are not exposed to other gameserver componenets are in game/decoder subdir.\r
-\r
-Created a PMsgBuilder class to put message creating methods in it.\r
-A global PMsgBuilder* MsgBuilder instance is added to gameserver.\r
-Modified globals.*, gameserver.*, clientmanager.cpp, commands.cpp and various game/_inc accordingly\r
-\r
-Moved PGameState definition from gameserver.cpp to gameserver.h\r
-\r
-Added PChar* GetChar() method to PClient\r
-\r
-Added WorldMap request basic support in PMsgBuilder::BuildReqInfoAnswerMsg() (for futur use)\r
-Added BodyEffect and SpeedOverride members to PChar class, as well as methods to set and get these values\r
-Added support for BodyEffect and SpeedOverride in PMsgBuilder::BuildCharHelloMsg()\r
-\r
-Reorganised code related to UDP Sync in order to avoid duplicate code.\r
-Put most of corresponding message building functions in PMsgBuilder class.\r
-\r
-====================\r
-Hammag; 22.09.2006 00:00 GMT+1\r
-----------\r
-<General changes>\r
- - Added Buddy list management (just the list though, buddy chat isn't working yet)\r
- Added a new gameserver DB table ti save the buddy list: buddy_list \r
- - Added Direct chat management (just char selection though, direct chat isn't working yet, and selection isn't saved in DB yet)\r
- - Added Genrep list management. List is now working and saved. Registration of GR doesn't register the right GR though (working on that)\r
- - Added loading of worldmodel.def and appplace.def files for later (very soon) use.\r
- - Migrated most of message handling to new decoder system.\r
- Item use is migrated in "a compatibility mode" until item management is fully based on world .dat and worldmodel.def files\r
-\r
-[GAME]\r
-Removed game/_inc directory\r
-Removed all UDP message analysis and handling from gameserver.cpp\r
-Created mode decoder classes in game/decoder\r
-Moved most UDP packet creation code from gameserver.cpp to msgbuilder.cpp, using PMessages\r
-Added PBuddyList class\r
-Added PGenrepList class\r
-Added loading/saving of Buddy List and Genrep List to char loading/saving in chars.cpp\r
-\r
-Added new members to PChar to store skin color and brightness (aka "darkness") in chars.h and char.cpp (not saved in DB yet)\r
- and corresponding support in PMsgBuilder::BuildCharHelloMsg()\r
-Added new commands "@color" and "@brightness"\r
-\r
-====================\r
-Hammag; 27.09.2006 20:00 GMT+1\r
-----------\r
-<General changes>\r
- - Added loading of appartements.def and respawn.def files for later (very soon) use.\r
- - Corrected and modified dependencies management in make system.\r
- No unwanted file date change should occure anymore\r
-\r
-[GAME]\r
-Zoning to appartment now make use of appartements.def data instead of hardcoded data (zoning.cpp)\r
-Added PMySQL::GetAptLocation() method in sql.cpp\r
-Prepared some modification for WorldItems and Appartments in sql.cpp (these methodes will later be put in specific classes)\r
-\r
-====================\r
-Hammag; 28.09.2006 17:30 GMT+1\r
-----------\r
-<General changes>\r
- - Updated the gamserver DB install file to version 5 (database/GameDB5.zip) needed\r
- by the current TinNS version.\r
- - Added a SQL file to update existing gamserver DB from version 4 to version 5\r
- (database/GameDB4_to_GameDB5.sql)\r
- - Zoning is now fully based on NC files rather than hardcoded.\r
- \r
-[GAME]\r
-Filename in now taken from appartments.def (for app zoning) or from worlds.ini (general case)\r
-Zoning out of appartment (Lift exit) is based on appplaces.def (was in the 27.09.2006 version already)\r
-Corrected GR use. Now GR gets it true name, and this good name can be registred in the char GR list\r
- and seved in DB.\r
-Changlog in command.cpp updated from last additions (22.09.2006)\r
-\r
-====================\r
-Hammag; 02.10.2006 23:30 GMT+1\r
-----------\r
-<General changes>\r
- - Started implementation of .dat worldfile parser\r
- - added a gameserver config option dev_debug to control development debug outputs\r
- \r
-[GAME]\r
-Added PWorldDatParser class, with files include/world_datparser.h and def/world_datparser.cpp\r
- (this classes might change/be replaced by a PWorldTemplate class very soon)\r
-\r
-====================\r
-Hammag; 03.10.2006 16:30 GMT+1\r
-----------\r
-<General changes>\r
- - Fix a big bug in gameserver causing server crash when using new character\r
- after its creation without server restart inbetween\r
- - added a gameserver config option auto_save_period to control character autosave period (in sec)\r
- \r
-[GAME]\r
-chars.cpp/.h :\r
- added PChar::CreateNewChar() and moved effective char creation from PChars to PChar\r
- added PChar::SQLDelete() (but not implemented yet)\r
- added use of auto_save_period config option in PChars::update()\r
- removed old XML-storage related code\r
-accounts.cpp : \r
- fixed an issue in PAccount::SetBannedStatus() that was causing the "can't update banned status" error message.\r
-gameserver.cpp :\r
- added some more DB cleanup when a char is deleted. Still incomplete and will later be done in PChar::SQLDelete()\r
-various .cpp files:\r
- put more log output under control of dev_debug config option\r
-\r
-====================\r
-Hammag; 04.10.2006 12:00 GMT+1\r
-----------\r
-<General changes>\r
- - Minor fixes to avoid some warnings\r
- - def directory removed from repository\r
- \r
-====================\r
-Hammag; 08.10.2006 01:25 GMT+1\r
-----------\r
-[rev. 20]\r
-\r
-<General changes> \r
- - fixed .pak archive deep file reading\r
- - implemented world furniture loading from world dat file (static furniture only atm)\r
- - implemented loading of worlds templates from .dat files (just for test now, will be used very soon)\r
-\r
-WARNING: more NC files & dirs will be needed for the gameserver from now on:\r
-./def/* (as already used by previous revisions)\r
-./worlds.pak\r
-./worlds/*\r
-./terrain.pak\r
-./terrain/*\r
-\r
-with . being the gameserver's starting dir (a config option will be added soon to set this dir to something else if wanted)\r
-\r
-[COMMON]\r
-filesystem.cpp :\r
- Fixed package reading to enable access to "subdirectories" in archive,\r
- as well as translation from unix to dos path separator for in-archive search \r
- Removed the "file not found" message the PFileSystem::Open() was issuing in the corresponding case.\r
- A NULL returned for PFile* is sufficient for the calling proc to manage the situation.\r
- Changed file search in archives to case-insensitive.\r
- \r
-[GAME]\r
-def_worlds.cpp :\r
- added quotes and spaces trim to mName and mDatFile.\r
-def/gamedefs.cpp :\r
- minor changes in PGameDefs::LoadWorldFileDefs() to make it more silent\r
-added furnituretemplate.cpp/.h (PFurnitureItemTemplate class)\r
-added worlddatatemplate.cpp/.h (PWorldDataTemplate class)\r
-added worlds.cpp/.h (PWorld and PWorlds classes)\r
-\r
-====================\r
-Hammag; 08.10.2006 01:25 GMT+1\r
-----------\r
-[rev. 21]\r
-\r
-<General changes>\r
- - changed ingame debug management for a more generic @debug command:\r
- @debug 0|1 : disable|enable all debug outputs\r
- @debug loc[ation] 0|1 : disable|enable location output on move\r
- @debug it[emid] 0|1 : disable|enable item ID output on item use\r
- in the last two forms, omiting 0 or 1 just toggles the debug output\r
- - some additions on worlds data checking/loading\r
-\r
-[GAME]\r
-accounts.h :\r
- removed IsAdminDebug() and SetAdminDebug() methods\r
-client.cpp/.h : \r
- added GetDebugMode() and SetDebugMode() methods, along with mDebugMode[] private member.\r
-commands.cpp :\r
- implemented new version of @debug command\r
-decoder/udp_charmove.cpp :\r
- implemented ingame location debug output on move\r
-decoder/udp_charmove.cpp :\r
- implemented ingame item use debug output\r
-\r
-====================\r
-Hammag; 11.10.2006 01:25 GMT+1\r
-----------\r
-[rev. 22]\r
-\r
-<General changes>\r
- - added MySQL keepalive function to avoid connection loss on long server inactivity periods\r
- - fixed unreleased MYSQL_RES after all DB Res queries in infoserver leading to memory leak\r
- - reintroduced Namikon's ISC \r
-\r
-[Make]\r
-Rules.make:\r
- fixed libs order in linker args to avoid lib not found on some systems\r
-patch/Makefile :\r
- commented out some unused libs in linker args\r
-info/Makefile :\r
- fixed libs order in linker args to avoid lib not found on some systems\r
- commented out some unused libs in linker args\r
-game/Makefile :\r
- fixed libs order in linker args to avoid lib not found on some systems\r
- commented out some unused libs in linker args\r
-\r
-[GAME]\r
-configtemplate.h, gameserver.conf :\r
- added 'mysql_wait_timeout' config option, to be set to value of the\r
- wait_timout system variable from the MySQL server (default 28800 sec).\r
- It triggers the MySQL keepalive for both gameDB and infoDB connections.\r
- Value 0 disables this keepalive function.\r
-sql.cpp/.h :\r
- added Update() method, which now include MySQL keepalive management and CheckResCount()\r
- added mKeepaliveDelay and mLastKeepaliveSent members\r
-main.cpp :\r
- updated main loop to call MySQL->Update() instead of MySQL->CheckResCount()\r
-global.cpp :\r
- added Hammag to the coders list\r
-isc.cpp/.h : reintroduced Namikon's ISC for implementation of serverlist update\r
- through MySQL in the coming days.\r
- \r
-[INFO]\r
-configtemplate.h, infoserver.conf :\r
- added 'mysql_wait_timeout' config option (see [GAME])\r
-sql.cpp/.h :\r
- added Update() method, which now include MySQL keepalive management\r
- added mKeepaliveDelay and mLastKeepaliveSent members\r
- added FreeSQLResult() method to perform mysql_free_result()\r
-main.cpp :\r
- added call to MySQL->Update() in the main loop\r
-accounts.cpp, infoserver.cpp :\r
- added call to FreeSQLResult() where required\r
-global.cpp :\r
- added Hammag to the coders list\r
-\r
-====================\r
-Hammag; 13.10.2006 20:00 GMT+1\r
-----------\r
-[rev. 23]\r
-\r
-<General changes>\r
- - activated modified ISC component. Server list and user count displayed by the infoserver\r
- are now updated by the gameserver using the "MySQL" method (same as Neopolis X)\r
- - added 'nc_data_path' option to gameserver.conf. It must be set to the root path of the nc data,\r
- either the NC1 directory or a copy. ./ means reative to gameserver start dir\r
- - 'defs_path' and 'worlds_path' are not used anymore in gameserver.conf\r
- \r
-[GAME]\r
-isc.cpp/isc.h :\r
- implemented MySQL mode\r
- some other generic addition to the PISC class\r
-configtemplate.h :\r
- set 'isc_method' default to 1 (i.e. MySQL mode only)\r
- set 'isc_update_intervall' default to 60 sec\r
-def/main.h : \r
- values of DEF_* defines for def filenames now include patgh relative to nc_data_path\r
-gamedefs.cpp :\r
- modified to take into account main.h modifs and nc_data_path\r
-\r
-[INFO]\r
-infoserver.cpp :\r
- modified PInfoSrver::GSLiveCheck() to be independant of gameserver time.\r
- No time sync is needed between servers anymore.\r
-\r
-[COMMON]\r
-filesystem.cpp :\r
- fixed a bug when handling some files .pak archives with path starting with ./\r
-\r
-====================\r
-Hammag; 24.10.2006 17:00 GMT+1\r
-----------\r
-[rev. 24]\r
-<General changes>\r
-Internal changes only\r
-\r
-====================\r
-Hammag; 26.10.2006 02:15 GMT+1\r
-----------\r
-[rev. 25]\r
-\r
-<General changes>\r
- - finished world data on-demand loading\r
- - fixed an issue in world "furniture" data loading\r
- \r
-[GAME]\r
-added a Worlds global object (class PWorlds)\r
-modified PChar and PClient classes to Lease/Release world when char changes location,\r
- which shall now be done using the new PClient::ChangeCharLocation method\r
-modified decoder/udp_zoning accordingly\r
-modified def/world_datstruct.h and def/world_datparser.cpp to fix world data loading\r
-\r
-====================\r
-Hammag; 08.11.2006 22:00 GMT+1\r
-----------\r
-[rev. 26]\r
-\r
-<General changes>\r
- - added isc_server_id in gameserver.conf, to be set to s_id value from infoserver DB.\r
- server status should then be kept up to date in the server selection window of NC client\r
- - fixed a bug leading to char location being reset to bad zone when login in under some circumstances\r
- - sitting on chairs now works again and is seen by others chars. Some more thing are to be added to this though.\r
- - all dungeon/sewers/UG entries should work. But spawning place are not always right, as it seems that info in\r
- appplaces.def is not allways the right one (about the "entity")\r
- - all doors should open and be seen opening by other chars. Locked doors will open like any others\r
- as I haven't found the link bewteen button and door\r
- - other internal changes\r
-\r
-====================\r
-Hammag; 21.11.2006 02:00 GMT+1\r
-----------\r
-[rev. 27]\r
-\r
-<General changes>\r
- - fixed teleport-to-nowhere-when-leaving-chair issue\r
- - implemented free chair check\r
- - implemented nice position when leaving chair (orientation still not fixed ...)\r
- => problem of char disapearing for others when sitting for some time still not fixed*\r
- - added "new_char_location" option in gameserver.conf, with default to mc5 starting zone\r
- - added starting apartment creation\r
-\r
-====================\r
-Hammag; 25.11.2006 16:45 GMT+1\r
-----------\r
-[rev. 28]\r
-\r
-<General changes>\r
- - fixed a bug when zoning to holomatch zones\r
- - fixed Holomatch exit (but still same problem for spawning entity as in some dungeon zoning)\r
- - fixed UG exit (but still same problem for spawning entity as in some dungeon zoning)\r
- - fixed appartement lift use\r
- - fixed char-vanish-for-others-when-sitting-too-long issue\r
- (but already sitting char still invisible for loggin-in chars)\r
- - fixed a bug in starting apartment creation \r
- - increased TCP timeout which caused connection loss when taking too much time creating a char\r
- - subskill increasing now works (freely, ie. without any check against class or available skill points)\r
- \r
-====================\r
-Hammag; 26.11.2006 02:00 GMT+1\r
-----------\r
-[rev. 29]\r
-\r
-<General changes>\r
- - triggered doors now work as expected (hopefully... the trigger button is the one\r
- closest to the door). Hack button an money button just work like standard buttons for the moment.\r
-\r
-====================\r
-Namikon; 09.12.2006 01:20 GMT+1\r
-----------\r
-[rev. 30]\r
-\r
-[GAME]\r
- - (Hopefully) Fixed Autoaccount problem with Gameserver (Rehashing accountdata now every 30 seconds. However,\r
- this isnt verified.)\r
- - New command: @rehash. Does the same as the server every 30 seconds, for those who cant wait :P\r
- \r
-====================\r
-Namikon; 09.12.2006 01:32 GMT+1\r
-----------\r
-[rev. 31]\r
-- Forget to update the Changelog, ^_^\r
-\r
-====================\r
-Hammag; 09.12.2006 16:40 GMT+1\r
-----------\r
-[rev. 32]\r
-This revision is mostly a commit of intermediate change to avoid future conflicts, with no new functionnalty added\r
-\r
-<General changes>\r
- - added regexsupport for futur use in user strings control (username, password, charname, etc)\r
-\r
-[GAME]\r
-main.cpp: changed type used for time in DB rehash from u32 (causing complile warning) to std::time_t which\r
- is the time type (for seconds) now used in gameserver.\r
- \r
-[COMMON]\r
-regex : added the RegEx class (Simple C++ wrapper for PCRE) to the tinns lib :\r
- common/regex/regex++.cpp\r
- include/regex++.h\r
-\r
-====================\r
-Namikon; 10.12.2006 11:35 GMT+1\r
-----------\r
-[rev. 33]\r
-\r
-<General changes>\r
-- Added @uptime to view server's uptime ingame\r
-\r
-[GAME]\r
-gameserver.h: Added "std::time_t mServerStartupTime" and public inline "GetStartTime()" to receive Server's\r
- startup timestamp anywhere in the source\r
-gameserver.cpp: Added mServerStartupTime to gameserver's class constructor (Var gets set one time uppon startup)\r
-commands.cpp: Added @uptime. Generates readeable output in the form (Years, Months, Weeks, Days, ...) from the\r
- difference between mServerStartUp and the current timestamp\r
-\r
-====================\r
-Hammag; 10.12.2006 14:50 GMT+1\r
-----------\r
-[rev. 34]\r
-\r
-<General changes>\r
- - GenReps now dont need database info anymore.\r
- However, the solution is not satisfaying, but will do until we find better\r
- - Fixed Makefile issue about buggy dependency files\r
- - Removed old unused src/netcode directory (the right dir is in src/common)\r
-\r
-[GAME]\r
-worlddatatemplate.cpp : in SetLinkedObjects(), added storage of GR order to later access to entity info\r
-def/gamedef.h/.cpp : added GetRespawnEntity() to get GR entity value from respawn.def, by entry order,\r
- with management of exceptions in zones 1 & 2\r
-decoder/udp_useobject.cpp : now use PGameDefs::GetRespawnEntity() to get the entity of a GR object\r
-\r
-[INFO]\r
-Minor change in client connection message after checking for what looked to be a memleak (but was not ! :-D )\r
-\r
-====================\r
-Namikon; 10.12.2006 15:30 GMT+1\r
-----------\r
-[rev. 35]\r
-\r
-- Added @broadcast. GM and higher can now send out "ADMIN> Server: <text>" broadcasts\r
-- Worked on Chat subsystem. Current status:\r
-> Buddy - Sends text to Buddy, everyone in the same Zone can read. No Buddylist yet\r
-> Local - Another problem, local is TCP on retail, we use UDP. Works for now, needs further research\r
-> Clan - Same as Buddy\r
-> Team - Same as Buddy\r
-> Direct - No function yet\r
-> GM - Done. (100%)\r
-> Admin - Done. (100%)\r
-> All others - Nearly done. Sends/Receives to/from correct channel, including zone/fraction/etc\r
- limitation. However, you cant disable channels yet, needs further research.\r
-\r
-- 2 new options in gameserver.cfg: \r
-> broadcast_new - If set to 1, the server will send out an broadcast to channel OOC with\r
- a welcome message. Default is 0.\r
-> broadcast_new_hidestaff - If set to 1, all "non-players" are not announced over OOC. Default is 0.\r
-- Fixed some typos in chat.h/.cpp\r
-\r
-[GAME]\r
-chat.h/.cpp : Corrected some typos.\r
- Added sendBroadcast (Admin channel)\r
- Added sendOOCBroadcast (OOC channel)\r
- Added all missing sendXXX functions\r
- Removed several Console outputs. We know it works, no need to debug it anymore.\r
-gameserver.cpp : Changed current welcome message to new OOC broadcast method\r
-configtemplate.h: Added 2 new default values for broadcast on connect\r
-commands.cpp : Added @broadcast command. First command which checks your accesslevel. (as announced before)\r
-\r
-====================\r
-Namikon; 10.12.2006 15:30 GMT+1\r
-----------\r
-[rev. 36+37]\r
-\r
-- Worked again on Chat subsystem. Current status:\r
-> Buddy - Done. (100%)\r
-\r
-[GAME]\r
-buddylist.cpp / .h : Added function "IsInBuddy()" to perform a simple check "Is a buddy? y/n"\r
-chars.h : Added inline to pass IsBuddy to buddylist->IsInBuddy()\r
-chat.cpp : Fixed sendBuddy function. Working as it should now\r
-\r
-====================\r
-Namikon; 10.12.2006 23:20 GMT+1\r
-----------\r
-[rev. 38]\r
-- Worked again on Chat subsystem. Current status:\r
-> Direct - Done. (100%)\r
-\r
-[GAME]\r
-chat.cpp/.h : Added new function sendPlayerDirect, altered main-chatloop, order is now Local, Direct, others\r
-\r
-====================\r
-Namikon; 11.12.2006 00:59 GMT+1\r
-----------\r
-[rev. 39]\r
-Last update for this weekend lol ^^\r
-- Worked again on Chat subsystem. (What else)\r
- This release may break tinns from working, until Hammag found a way to grab the data i need for the CustomChannels.\r
-\r
-[GAME]\r
-chat.cpp/.h : Added check for every custom channel if its enabled or not\r
-chars.cpp/.h : Added inline and variable to hold custom channel info\r
-\r
-====================\r
-Hammag; 11.12.2006 13:00 GMT+1\r
-----------\r
-[rev. 40]\r
- - added Custom Chat Channel selection retrieval from client packets\r
- - temp deactivated regex lib compilation as there still are some issues with dependencies\r
- \r
-[GAME]\r
-chars.h : Added SetActiveChannels method\r
- Regrouped some method declarations by theme\r
-decoder/udp_chat.h/.cpp : added PUdpChatChannels class for custom channel info decoding\r
-\r
-[PATCH]\r
-Minor change in client connection message, same as what has been done for infoserver.\r
-\r
-====================\r
-Hammag; 11.12.2006 20:10 GMT+1\r
-----------\r
-[rev. 41]\r
-\r
-<General changes>\r
- - added @version command\r
- - added directory src/tools for compile tools and corresponding makefile\r
- - dependency files issues should hopefully be solved now once for all\r
- \r
-[GAME]\r
-commands.cpp: added @version command\r
-\r
-[PATCH]\r
-Minor change in client connection message, same as what has been done for infoserver.\r
-\r
-[All Servers]\r
-Added src/include/svnrevision.h (automatically updated)\r
-Removed inclusion of version.h for everywhere, and added it to each global.cpp\r
-Added ServerVersion and SVNRevision as global strings (globals.h) for each server\r
-Modified accordingly version display at server start in global.cpp\r
-\r
-[LIBS]\r
-misc.h/.cpp: Commented out GetSVNRev() that is not used anymore\r
-\r
-[TOOLS]\r
- - added src/tools/cleandepfile.c\r
- cleandepfile is used to clean dependency files generated by g++\r
- - added src/tools/setsvnrev script to update the new src/include/svnrevision.h\r
- when needed\r
- - updated src/Makefile and src/Rules.make accordingly\r
- No manual action should be needed to manage svn revision number inclusion in source\r
- Game/Info/Patch servers version can still be set in version.h\r
-\r
-====================\r
-Namikon; 11.12.2006 21:46 GMT+1\r
-----------\r
-[rev. 42]\r
-\r
-<General changes>\r
-- Fixed (hopefully) customchannels. They're not loaded / saved from/to SQL yet, but you should be able to enable/disable them.\r
- uppon entry, all channels are disabled.\r
-\r
-Hopefully, because i cant verify it. (No time to compile and try it). Will verify (and debug) it in the next few days\r
-\r
-====================\r
-Namikon; 13.12.2006 12:02 GMT+1\r
-----------\r
-[rev. 43]\r
-- Quick update: I replaced the "old" function to check if a customchannel is enabled or not with a much\r
- faster one. (Bitwise comparison)\r
-- Fixed an typo in chat.cpp\r
-\r
-====================\r
-Hammag; 13.12.2006 17:10 GMT+1\r
-----------\r
-[rev. 44]\r
-\r
-<General changes>\r
- - Added missing GPL licence file LICENCE.txt\r
- - Renamed directory tools to dev-tools to distinguish from futur NC tools\r
- - Fixed a small prototype issue causing compile warnings in dev-tools/cleandepfile.c\r
- - Added option DO_DEBUG in Makefile to be uncommented if you want debug symbols and not stripped binaries\r
- - Added inclusion of src/options.local (if exists, which is not mandatory) in Makefile to set local Makefile options\r
- This is mostly for developer use, as it enables local compilation customization without propagation to SVN,\r
- and avoids the need to use 'svn revert Makefile' each time...\r
- \r
- My current options.local file looks like:\r
-#\r
-# Local Makefile custom options\r
-# not in SVN !\r
-#\r
-DO_DEBUG = y\r
-CXXFLAGS += -march=pentium4\r
-\r
- If I don't want to use these additonal options and test the real config, I just rename it to something else.\r
-\r
-====================\r
-Namikon; 14.12.2006 22:58 GMT+1\r
-----------\r
-[rev. 45]\r
-- Updated ISC definition file (v2)\r
-- Updated isc.h: Added enum for ISC connection stages\r
-- Added ISC Example.txt to show a few examples of an "normal" datatransfer between game and infoserver\r
-\r
-\r
-====================\r
-Hammag; 14.12.2006 23:10 GMT+1\r
-----------\r
-[rev. 46]\r
-\r
-<General changes>\r
- - Really added missing GPL licence file LICENCE.txt this time (hopefully...)\r
- - Some compilation warning fixes\r
- - Added internal tools to ease sources & bin packages generation\r
- \r
- make sourcetar : Builds a clean archive of all that is needed to compile and run TinNS (except NC data)\r
- make bin tar : Builds a clean archive of TinNS binaries and other files needed to run TinNS (except NC data)\r
- Also alerts about src/options.local presence. (To be improved as check is done AFTER compilation right now ...)\r
- Destination directory for tarballs is set in Makefile with TARBALLS_DEST (default ~)\r
-\r
-[DEV-TOOLS]\r
-Modifies src/Makefile (added sourcetar and bintar targets) and src/Rules.make\r
-Added make-src-tarball and make-bin-tarball in src/dev-tools\r
-\r
-====================\r
-Hammag; 15.12.2006 16:40 GMT+1\r
-----------\r
-[rev. 47]\r
-\r
-<General changes>\r
- - minor internal changes only\r
-\r
-[GAME]\r
-decoder/udp_useobject.cpp : fixed again some signed to unsigned cast issue.\r
-decoder/udp_zoning.cpp .h : added PUdpEndOfZoning class\r
-decoder/udp_OOO.cpp : made message reception verbose\r
-\r
-====================\r
-Namikon; 15.12.2006 20:02 GMT+1\r
-----------\r
-[rev. 48]\r
-\r
-<General changes>\r
- - minor internal changes only\r
-\r
-[GAME]\r
-Updated ISC ProtDef again. The protocol itself will be called ISCP from now on (Inter-Server-Communication-Protocol)\r
-Updated infoserver.conf, added ISC config values\r
-\r
-====================\r
-Namikon; 16.12.2006 15:36 GMT+1\r
-----------\r
-[rev. 49]\r
-\r
-[IMPORTANT]\r
-From this release on, TinNS will check more and more for accountlevels.\r
-If you want admin access, you have to edit your MySQL table. (Admin: Level 100)\r
-Its not much yet, but the first steps have been made, and more will follow.\r
-Next step will be the gamemaster/admin commands.\r
-\r
-<Infoserver>\r
-- Changed default error-return for Sql Checkaccount from -12 to -99, to create free place for further errormessages\r
-- Added require_validation to infoserver.conf. You can enable this if you like to create accounts on your own,\r
- not by autoaccount.\r
-\r
-<Gameserver>\r
-- Removed traces of old AutoAccount creation in GameServer. AutoAcc should *only* be done by Infoserver!\r
-- Added accountlevel check.\r
-\r
-====================\r
-Namikon; 17.12.2006 22:42 GMT+1\r
-----------\r
-[rev. 50]\r
-\r
-IMPORTANT:\r
-This rev keeps crashing and it also causes OutOfOrder packets, for whatever reason. we have to trace\r
-this down first.\r
-\r
-[GAME]\r
-- Fixed errors from last SVN release (Caused several segmentation faults)\r
-- Added configfile commands.conf\r
-- Added check for required accountlevel when trying to use ingame command\r
-\r
-[INFO]\r
-- Fixed errors from last SVN release (Caused several segmentation faults)\r
-- Added default values for isc stuff to configtemplate.h. I forgot to add them in the last revision\r
-\r
-====================\r
-Namikon; 18.12.2006 00:23 GMT+1\r
-----------\r
-[rev. 51]\r
-\r
-Small update:\r
-- Fixed AccountLevel (You always got full admin access after login)\r
-\r
-====================\r
-Namikon; 18.12.2006 01:57 GMT+1\r
-----------\r
-[rev. 52]\r
-\r
-- Fixed bug that you could'nt see the welcome message after login\r
-- Added (hopefully) a workaround for our SegFault problem (2 user online, 3rd is trying to connect -> SegFault)\r
-\r
-====================\r
-Namikon; 19.12.2006 03:03 GMT+1\r
-----------\r
-[rev. 53]\r
-\r
-its a pity, but the workaround didnt work. Still investigating this!\r
-MANY changes to the source, cant remember all. Here is what my brain has stored:\r
-\r
-- Direct chat completed. (If target player isnt online, you'll get this nice "Player not online" message)\r
-- ReEnabled AutoRehash, wasnt responsible for the crash\r
-- Added @kick, @info, @warpto, @recall and @setlevel. @info is tested and verified, @kick does nothing (yet) the\r
- rest is untested but should work. (Hard to test with only 1 char online...)\r
-- Some more very small changes. If you want a detailed log, ask SVN history :D\r
-\r
-====================\r
-Hammag; 20.12.2006 21:00 GMT+1\r
-----------\r
-[rev. 54]\r
-\r
-<General changes>\r
- - fixed bug in NC datafiles lookup when nc_data_path was set to something else than .\r
-\r
-[LIBS]\r
-filesystem/filesystem.cpp .h : added base path arg to file open method.\r
-\r
-[GAME]\r
-def/defparser.cpp, def/world_dataparser.cpp : modified accordingly to changes made to PFileSystem\r
-\r
-[PATCH]\r
-patchserver.cpp : modified accordingly to changes made to PFileSystem\r
-\r
-\r
-====================\r
-Namikon; 21.12.2006 19:28 GMT+1\r
-----------\r
-[rev. 55]\r
-\r
-*Note*\r
-The new commands have to be tested first! Dont expect them to work yet, its just a upload\r
-since the entire command files got rewritten.\r
-\r
-<General changes>\r
- - Rewritten entire commands.cpp/.h files\r
- - Fixed ingame command @kick. Works now as it should.\r
- Also sets a temp-ban for a configureable amount of seconds to prevent instant-relog.\r
- - Added new ingame coommands:\r
- @ban <charID/nick> <xS>/<xM>/<xH>/<xD> || @ban EvilUser 20m <- Bans "EvilUser" for 20 minutes.\r
- - Bans given player for given time. You can only set ONE timevalue. (Either S/M/H or D. Not case sensitive)\r
-\r
- @unban\r
- - Not working yet. Has to be done by direct SQL access\r
- @listbans\r
- - Not working yet. Has to be done by direct SQL access\r
-\r
- @shun <charID/nick>\r
- - Blocks all incoming char/command traffic from given client until re relogs\r
- Returns error if already shunned\r
-\r
- @unshun <charID/nick>\r
- - Remove shun instantly. Returns error if not shunned\r
-\r
- @jail <charID/nick>\r
- - Warp given player to Regants legacy. Returns error if player is already in Regants\r
-\r
- @unjail <charID/nick>\r
- - Free given player from Regants. Returns error if player is not in Regants/Jailed\r
-\r
- @teleport <charID/nick> <worldID>\r
- - Teleport given player to given world\r
-\r
- - Added (experimental) startscript for TinNS. Has to be testen/debugged\r
-\r
-[COMMON]\r
- <external.h> Added <cctype> to get access to isdigit() function\r
- <version.h> Increased VerNr\r
-\r
-[GAME]\r
- <accounts.cpp/.h> Added vars&methods to store shunned status\r
- <globals.cpp/.h> Added global class for gamecommands\r
- <chat.cpp> Changed GameCommand call to work with the new command class\r
- <commands.cpp/.h> Completely rewritten. Moved every ingame command into own method, called by\r
- a main function which takes care of all args. Maybe has to be improved later, but its ok for now.\r
-\r
-====================\r
-Namikon; 21.12.2006 21:50 GMT+1\r
-----------\r
-[rev. 56]\r
-\r
-Improved pak_decompress script from Akiko\r
-- Added errorcheck for in/output file\r
-- Added check for NC and normal zLib files\r
- (Can unpak both)\r
-- Added optional details-output\r
-\r
-The script is now capable to be used in batchfiles, since the only output is either [OK] <filename> or [ERROR] <filename>.\r
-if you dont want this, you can specify detailed output with all errors.\r
-\r
-====================\r
-Namikon; 21.12.2006 21:55 GMT+1\r
-----------\r
-[rev. 57]\r
-\r
-Forgot the CHANGELOG ^^\r
-\r
-====================\r
-Namikon; 22.12.2006 17:33 GMT+1\r
-----------\r
-[rev. 58]\r
-\r
-<General changes>\r
-- Improved pak_decompress tool from Akiko\r
-- Added tool "getsvnrev" (Same again in src/dev_tools, required for make process)\r
-- Improved Hammag's setsvnrev bash script (Now does errorcheck and has an alternative way to\r
- grab SVN revision if SVN is not installed)\r
-- Splitup of commands.cpp. Every command has now its own .cpp file in gamecommands/.\r
- Makes it a lot easier to handle new commands or change/fix/remove existing ones\r
-- ReEnabled debug-output while loading world .dat files. Was commented out for some reason\r
-\r
-No real "changes" or "fixes" to main-source files. Only splitup's and new/improved devtools.\r
-See SVN->Diff for details\r
-\r
-====================\r
-Namikon; 22.12.2006 22:55 GMT+1\r
-----------\r
-[rev. 59]\r
-<internal version: 0.1.5 Dev>\r
-\r
-- Added missing Makefile for gamecommands/ subfolder\r
-- Removed check for ZoneID 552 from jail.cpp and unjail.cpp; This zone is never used\r
-- Moved mShunned from Account to chars\r
-- Added mJailed to chars with methods to identify a jailed player\r
-- Added explicit override to GM teleport and jail/unjail commands (The only way to move someone if target is jailed)\r
-- Completed shun/unshun command\r
-\r
-====================\r
-Namikon; 22.12.2006 22:55 GMT+1\r
-----------\r
-[rev. 60]\r
-<internal version: 0.1.6 Dev>\r
-\r
-- Added several security checks to game commands\r
-- Added missing status outputs on successfull gamecommand\r
-- Added solution to send an delayed positionupdate after warping\r
-\r
-====================\r
-Namikon; 23.12.2006 09:31 GMT+1\r
-----------\r
-[rev. 61]\r
-<internal version: 0.1.7 Dev>\r
-\r
-Small update:\r
-- Removed ingamecommands "addworlditem", "delworlditem" and "adddoor". TinNS gets the worlddata dynamicly from loaded\r
- .dat files instead of MySQL Database.\r
- \r
-commands.conf : Removed config settings for the 3 commands mentioned above\r
-commands.cpp/.h : Commented out the 3 mentioned commands\r
-adddoor.cpp : Commented out entire file\r
-delworlditem.cpp: Commented out entire file\r
-addworlditem.cpp: Commented out entire file\r
-\r
-====================\r
-Namikon; 24.12.2006 01:30 GMT+1\r
-----------\r
-[rev. 62-63]\r
-<internal version: 0.1.8 Dev - 0.1.10 Dev>\r
-\r
-- Added experimental char warp-aura and char disappear packets to all warp-commands\r
- (Worked while testing, but not after implementation into the commands)\r
-- Worked on Chatsystem: Localchat 99% working. Localchat is now limited to a small area around the player\r
- (However, the chat is sent over TCP, like all other packets. It should be UDP, but this isnt working\r
- for some reason. If anyone finds out why, tell us please)\r
-- Added Developercommand "@test". It has no fixed function, and is not configureable by config file.\r
- Devs can easily add stuff there to test various things.\r
-- Removed adddoor, delworlditem and addworlditem completely from SVN, they're not needed anymore\r
-- And a few things i cant remember -.-\r
-\r
-====================\r
-Namikon; 25.12.2006 00:24 GMT+1\r
-----------\r
-[rev. 64]\r
-<internal version: 0.1.11 Dev>\r
-\r
-- Fixed Blacksync issue when logging in\r
-- Disabled position update on warpto and recall commands. It's not possible at the moment to\r
- force the client to update the charposition.\r
- \r
-====================\r
-Namikon; 26.12.2006 22:33 GMT+1\r
-----------\r
-[rev. 65]\r
-<internal version: 0.1.13 Dev>\r
-\r
-- Added UDPManager functions to connection_udp. Keeps the last 20 important UDP messages in a queue, for\r
- possible resend after a OOO notice by the client\r
-- Finally fixed the warpcircle and charvanish! The mentioned commands in Rev 62-63 now work as announced\r
-- UDP_ID and all related stuff moved to connection_udp. Will be more controlled in the future from there\r
-\r
-====================\r
-Namikon; 26.12.2006 22:33 GMT+1\r
-----------\r
-[rev. 66]\r
-<internal version: 0.1.14 Dev>\r
-\r
-- Added, by Stings request, serveranswer to worldroute query: "Where is the Primary App" works now.\r
-- "Fixed" SQL function GetAptLocID(). Now only decreases the location value if the given AppartmentID is higher than 100000\r
-\r
-====================\r
-Namikon; 27.12.2006 19:05 GMT+1\r
-----------\r
-[rev. 67]\r
-<internal version: 0.1.15 Dev>\r
-\r
-Small update\r
-- Added 2 error messages for genrep activation. (Wrong faction and MC5 "broken")\r
-\r
-====================\r
-Namikon; 28.12.2006 18:45 GMT+1\r
-----------\r
-[rev. 68]\r
-<internal version: 0.1.16 Dev>\r
-\r
-- 2 new ingame commands:\r
- @givemoney <amount> [<charID or nick>]\r
- @takemoney <amount> [<charID or nick>]\r
- I dont think i have to explain what they do :)\r
-\r
-- Added universal udpmessage to trigger messages from text.ini\r
-\r
-====================\r
-Namikon; 28.12.2006 20:02 GMT+1\r
-----------\r
-[rev. 69]\r
-<internal version: 0.1.16H Dev>\r
-\r
-Internal Release / "Hotfix"\r
-The udpmanager was planned to cancel OOO notices, but he causes an segfault when trying to send the message.\r
-Its not clear yet why, therefore, the OOO handling got disabled. It will be re-enabled when this is fixed.\r
-\r
-====================\r
-Namikon; 30.12.2006 08:11 GMT+1\r
-----------\r
-[rev. 70]\r
-<internal version: 0.1.17 Dev>\r
-\r
-- Added "life" to hackbuttons and entrance-fee buttons. (Level GM and higher can just "use" hackbuttons, lower levels\r
- must hack it. For entrance fee buttons, everyone must pay. Why? Well, for what is the @givemoney command ^.^)\r
- Since hacking is not working yet, (we have to add item-usage first) make sure to set your own level to 50+, or you\r
- wont get these doors open)\r
-- Disabled some debug outputs forgotten in the last release\r
-\r
-====================\r
-Namikon; 30.12.2006 19:41 GMT+1\r
-----------\r
-[rev. 71]\r
-<internal version: 0.1.18 Dev - 0.1.22 Dev>\r
-\r
-- Added handling class for item movement (QB<>Inv<>GoGu<>Ground), no real function yet, but its decoded\r
-- Added handling class for QuickBelt management. You can activate the flashlight in slot 0 now, and others can see it\r
- The functions are prepared to handle any item that exists, but we dont have items working until now.\r
-- Removed Debug output from sql.cpp\r
-\r
-====================\r
-Namikon; 01.01.2007 23:32 GMT+1\r
-----------\r
-[rev. 72]\r
-<internal version: 0.1.22 Dev - 0.1.24 Dev>\r
-\r
-**** Happy new year!! ****\r
-\r
-- Item movement within quickbelt works\r
-- Added hacktool to QB to test hacking\r
-- Added the last missing staffchar (GM>)\r
-- Added decoder for inithack and starthack messages\r
-- A few more changes i cannot remember\r
-\r
-====================\r
-Namikon; 02.01.2007 20:52 GMT+1\r
-----------\r
-[rev. 73]\r
-<internal version: 0.1.25 Dev>\r
-\r
-- Added new command @spawnactor\r
- Usage: @spawnactor <actorID> <functionType>\r
- - ActorID can be found in models/pak_models.ini\r
- - FunctionType defines the type of the actor.\r
- This can be almost everything, from item containers to\r
- apartmentlift accesspanels\r
- This command spawns and static worldactor next to your current\r
- position. Everyone who is within the range of UDP broadcast\r
- can see / "use" the new actor. It isnt saved to sql yet, nor is it\r
- managed. (You cant spawn an itemcontainer and open it)\r
- \r
-Thanks to Sting for this release! We where working on hack-stuff (doors, hackboxes,..)\r
-when he found the required information to make this possible.\r
-\r
-====================\r
-Namikon; 04.01.2007 16:15 GMT+1\r
-----------\r
-[rev. 74]\r
-<internal version: 0.1.26 Dev>\r
-\r
-- WorldActor management class added.\r
- Spawned actors now stay in that zone as long until someone removes them.\r
- \r
- To remove spawned worldactors, the @remove command has been improved:\r
- Type "@remove actor" to set your client into "REMOVE ACTOR" mode (You'll get\r
- an ingame notice about this)\r
- Then simply click on any dynamic worldactors to remove them. To leave this remove mode,\r
- type "@remove actor" again. (And again you'll get a notice about that)\r
- \r
- Note: You cannot remove static worldactors (those who are in the .dat files) with this.\r
- It is possible to let them disappear (type @remove <rawID>) but they'll respawn when you re-zone.\r
- \r
-IMPORTANT: This release requires an database update! Make sure you have the latest mysql table availeable.\r
-\r
-====================\r
-Namikon; 07.01.2007 19:40 GMT+1\r
-----------\r
-[rev. 75]\r
-<internal version: 0.1.27 Dev - 0.1.35 Dev>\r
-\r
-Huge update!\r
-\r
-- Changed default level for @remove from 100 to 50, since we can now also remove dynamic actors with it\r
-- Added security check to @remove command: You cannot remove Dynamic actors over their IDs anymore.\r
- Remove them with @remove actor command\r
-- UDPManager rewritten. Was almost completely wrong, dunno what happend with me when i first wrote it :P\r
- However, it works now. The last 20 UDP messages with 0x03 commandset are saved, and get resend uppon\r
- OOO notice from the client.\r
- The manager also watches the outgoing UDP IDs. With his, it was possible to fix an udp increment bug in the zoning process.\r
-- Messages in the VIP queue arent parsed over the udpmanager. We'll have to rename this later on (or add a new queue)\r
-- The UDP/SessionID offset is now defined in connection-udp.h\r
-- NPC subsystem added. (Yeah ^^)\r
- All NPCs that are in npc_spawns database spawn and stay in their world. We dont have an AI, so dont expect NPCs to\r
- do *anything* yet. (Same goes for traders or copbots) But everything is prepared\r
-- Added function "IsWorldInUse" to clientmanager. In first line required for NPC manager, to check if a world is in use or not\r
-- Reformatted several files for better readability.\r
-- Extended dynamic worldactor management:\r
- - Spawned worldactors are functional now. (Eg: Spawn a chair and sit on it) (Function is not 100% tested, it *could* procude an segfault, report it\r
- if the server crashes for you on a certain actorID)\r
- - Only valid worldmodel templates are accepted now while spawning actors\r
- - If given worldmodel template needs an linked object (For example an door) you have to add the doorID in the @spawnactor command (example below)\r
- - On serverstart and every initworld, the database is checked for duplicate worldactor IDs. If some are found, they get deleted\r
- - Another check is done when an worldactor is spawned. If (for any reason) an invalid worldactorset is in the Database,\r
- it is ignored uppon spawning. (invalid means, that the actor points to an invalid object, for example door or world)\r
-- Added detailed output for SQL errors (Prints not only "ERROR" or just returns nothing, instead a full errormessage is written to console)\r
-- MsgBuilder:\r
- - Baselinepacket changed, monsters are now "red"\r
- - Fixed increase_udp issue in BuildZoning1Msg\r
-- Added new decoder:\r
- - 0x08: This small (only 1 byte) "packet" is only sent when the client exits abnormal (crash, sometimes on alt+f4)\r
- Does nothing else than closing the connection serverside.\r
- \r
-*Note* Due the massive update of sourcecode, its likely that i forgot some debug outputs (You'll see D1, D2,.. or whatever else senseless text\r
-on the console). If you find something, tell me please over forum or bugtracker. But i will remove all outputs when i find some in the next\r
-releases\r
-\r
-====================\r
-Namikon; 07.01.2007 21:52 GMT+1\r
-----------\r
-[rev. 76]\r
-<internal version: 0.1.36 Dev>\r
-\r
-- Added hacking ability to hackbuttons (Both static and dynamic worldactors)\r
- Itemcontainers will follow when we have a management class for them\r
-- Removed several debug outputs, and changed others\r
-- Fixed an typo in command remove\r
-\r
-====================\r
-Namikon; 08.01.2007 15:47 GMT+1\r
-----------\r
-[rev. 77]\r
-<internal version: 0.1.36 Dev>\r
-\r
-Fixed compiler error:\r
-In member function 'void ConnectionUDP::InsertUDPMessage(PMessage*)':\r
-udpmanager.cpp:133: error: conversion from 'int' to non-scalar type 'std::_Rb_tree_const_iterator >' requested\r
-on some systems\r
-\r
-====================\r
-Namikon; 11.01.2007 19:31 GMT+1\r
-----------\r
-[rev. 78-79]\r
-<internal version: 0.1.37 Dev>\r
-\r
-- Added up-to-date SQL dump to SVN. (But better use the newest neoX db!)\r
-- Fixed bug in worldactors that caused the following problems:\r
-> Spawned actors where removed uppon next serverstart/re-zone\r
-> Only one actor in a zone at once\r
-- Added first steps for ingame terminal handling\r
-\r
-====================\r
-Namikon; 13.01.2007 10:57 GMT+1\r
-----------\r
-[rev. 80]\r
-<internal version: 0.1.38 Dev>\r
-\r
-- Added a few comments in npc.cpp and removed most debug outputs\r
-- Splitted up terminal.cpp into 5 files (All stuff in one file will get too big later)\r
-- Moved TryAccess handling for terminal stuff to PTerminal class\r
-\r
-====================\r
-Hammag; 27.05.2007 12:15 GMT+2\r
-----------\r
-[rev. 81]\r
-\r
-<General changes>\r
- - Minor internal changes\r
- \r
-[MAKEFILE]\r
-- Makefile, dev_tools/Makefile, setsvnrev: Disabled the use of getsvnrev.\r
- If someone has no SVN, and got sources from tarball, he can compile with the included svnversion.h\r
- If he does coding, he needs SVN to commit changes, so there's no need for getsvnrev.\r
- If he's doing coding and hasn't SVN, and got sources from tarball, then he won't have .svn files\r
- needed by getsvnrev at hand.\r
- As I don't see the use of getsvnrev, I disabled it. If it is really needed sometimes,I can add\r
- a local option to enable it on a case by case basis.\r
- Anyway, if someone submits code changes without having be given write access to SVN, he must submit\r
- them to a tinNS dev who has access, so code review, testing and SVN management will be done properly.\r
-- Other minor change on files cleanup \r
-\r
-[GAME]\r
-- game/decoder/udp_appartment.* : minor correction on files info\r
-\r
-====================\r
-Hammag; 28.05.2007 23:15 GMT+2\r
-----------\r
-[rev. 82]\r
-\r
-<General changes>\r
- - Major change to account management and character loading:\r
- Accounts are not stored in-mem anymore, and database is queried when needed instead.\r
- Chars are loaded when needed, and unloaded when not neaded anymore.\r
- - New Gameserver Database version (6)\r
- - Various fixes.\r
-\r
-[DATABASE]\r
- - GameDB5.zip has been replaced by GameDB6.zip holding the full gameserver dump to be used\r
- to get a fresh new DB needed by this revision of TinNS\r
- - GameDB5_to_GameDB6.sql can also be applied to migrate from version 5 to 6 of gameserver DB\r
- - infoserver DB is not changed (i.e. version 2)\r
-\r
-[GAME]\r
-More than 50 files changed.\r
- - in addition to the changes stated above, Char creation and charslot assignement is now\r
- fixed.\r
- **** PLEASE MANUALLY FIX THE SLOT NUM OF EXISTING CHARS OR RECREATE THE CHARS ****\r
- (Server will complain in logs and won't be hurt by muliple SLOT 0 chars anyway)\r
- - @rehash command has been removed as not used anymore\r
- - database.cpp and inclide/database.h have been deleted along with PDatabase class\r
- - PAccounts class has been removed\r
-\r
-[NETCODE]\r
- - Fixed mem leak in ConnectionUDP:\r
- PMessage held in UDP backlog not being released in object destructor\r
- - The static member PMessage::ListPools() can now be used anywhere to get a view of\r
- message buffer pools use (in use / free buffers)\r
-\r
-====================\r
-Hammag; 05.06.2007 01:30 GMT+2\r
-----------\r
-[rev. 83]\r
-\r
-<General changes>\r
- - fixed a bug which might be the cause of the "multiuser+char creation crash"\r
- (hopefully solved now)\r
- - many improvements in char movement (now much more responsively seen by others)\r
- - Sitting chars are now visible by later login-in chars\r
- - internal changes to PClient\r
-\r
-[GAME]\r
- - udp_charmove.* : PUdpCharAttitudeUpdate and PUdpCharSitting code is now taken\r
- care of in PUdpCharPosUpdate.\r
- These two classes are removed.\r
- - msgbuilder.* : added MsgBuilder::BuildCharPosUpdate2Msg\r
- - client.* : added PClient::FillInUDP_ID() to take care in one place of all UDP_ID\r
- filling-in of USP packets\r
- added PClient::SendTCPMessage() and PClient::SendUDPMessage(), which take care\r
- of NULL TCP or UDP sockets.\r
- - chars.* : added PChars::CharExist() to check for char existence by name\r
- - chat.cpp : fixed a repeated bug that led to crash when some client was connected\r
- without a char ingame (like in char selection, creation or deletion phase) and\r
- some chat was sent to him (like when someone else was coming ingame)\r
-\r
-====================\r
-Hammag; 09.06.2007 00:10 GMT+2\r
-----------\r
-[rev. 84]\r
-\r
-<General changes>\r
- - fixed a bug causing the server to crash under some conditions\r
- - fixed account management so that ingame account level setting doesn't need relog\r
- to be effective\r
-\r
-[GAME]\r
-Started work on the type 0x20 zoning doors.\r
-Added decoder/udp_entityposreq.cpp decoder/udp_entityposreq.h\r
-\r
-[LIBS]\r
-connection-udp.cpp: Fixed a bug causing server to crash when resending packet.\r
-\r
-====================\r
-Hammag; 19.06.2007 21:10 GMT+2\r
-----------\r
-[rev. 85]\r
-\r
-<General changes>\r
- - fixed zoning (hopefully)\r
-\r
-[GAME]\r
-Fixed zoning for "2nd type zoning" in sewers/caves and UG exits.\r
-There might remain some wrong zoning points in some case, as there seem to be some duplicate\r
-zoning spawn location in some zone data... but the "keep last spawn location" policy seem to work ok.\r
-Only spawn point issue when GRing in apt should remain.\r
-\r
-====================\r
-Hammag; 21.06.2007 01:45 GMT+2\r
-----------\r
-[rev. 86]\r
-\r
-<General changes>\r
- - bug fix\r
-\r
-[GAME]\r
-decoder/udp_entityposreq.cpp: fixed a bug\r
-\r
-====================\r
-Hammag; 15.07.2007 19:00 GMT+2\r
-----------\r
-[rev. 87]\r
-\r
-<General changes>\r
- - infoserver & gameserver now make use of common config/global.conf file (as least in\r
- default conf/*.conf files)\r
-\r
-[LIBS]\r
-config.* :\r
- - conf/*.conf file can now use the 'include' directive to include other config files\r
- - Now use PCRE RegEx instead of "strtok", enabling rentrance and removing potential issues.\r
- - Added GetOption & GetOptionInt with const std::string parameter\r
- - Fixed a bug in EOF detection in the main file reading loop\r
-\r
-conf/global.conf : Moved/added following directives in conf/global.conf\r
- minlevel = 0\r
- username_filter = ^[a-z][\w\-]{2-14}$\r
- password_filter = ^[[:graph:]]{3-15}$\r
-\r
-[INFO]\r
- Added username and password syntax filter in config (username_filter and password_filter\r
- directives, see above). Filters are case insensivite PCRE RegEx.\r
- Note: theses filter need to protect at least against sql injection.\r
- accounts.* : built common code with gamseserver (Not put in common tinns lib atm\r
- because of DB access and log issues)\r
- \r
-[GAME]\r
- Added charname and clanname (for future use) syntax filter in config/gameserver.conf :\r
- charname_filter = ^[a-z]+([\-\ ]?[a-z]+){0-2}$\r
- clanname_filter = ^[a-z][\w\-\ ]{2-14}$\r
- Filters are case insensivite PCRE RegEx.\r
- Note: theses filter need to protect at least against sql injection.\r
-\r
- sql.*, appartments.* : Moved Apt request methods from PMySQL to PAppartements\r
-\r
-====================\r
-Hammag; 27.10.2007 19:00 GMT+2\r
-----------\r
-[rev. 88 to 90]\r
-<General changes>\r
- Items management\r
-\r
-[GAME]\r
- Added container.cpp & container.h to implement classes used to manage all containers (including backpack, belt, armor, implant, processor, gogo, boxes, etc.)\r
- Implemented basic item moves between containers.\r
- Box content is randomly generated, and are not saved (you can use them to get rid of items)\r
- No partial quantity move/stacking management yet\r
- "take all" from boxes doesn't work yet (couldn't figure out yet how it works in detail)\r
- No item to/from ground yet, no trading yet, no item type recognition/pre-req/management for implants & armors yet\r
-\r
-[LIBS]\r
- Netcode: a bug in packet decoding was revealed, which seem to somtime lead to (maybe) infinite loop. Not fixed yet.\r
- \r
-====================\r
-Hammag; 27.10.2007 19:00 GMT+2\r
-----------\r
-[rev. 91]\r
-\r
-[GAME]\r
- Zoning issue fixed (a bug was leading to always load the same zone data for all zones with the same .bsp file, which is wrong)\r
- Improved random-filled boxes\r
- Excluded "temporary-items" from available item catalog (ItemsDef)\r
-\r
-====================\r
-Hammag; 28.10.2007 16:15 GMT+2\r
-----------\r
-[rev. 92]\r
-<General changes>\r
- @warpto command now works.\r
- \r
-[GAME]\r
- Improved container loading in odrer not lo load invalid items from DB.\r
- Items are not deleted from DB because it could cause loss of inventory\r
- in case of issue with items.def content or loading.\r
-\r
-Hammag; 9.11.2007 23:30 GMT+2\r
-----------\r
-[rev. 93]\r
-<General changes>\r
- Worked on subway.\r
- Subway cabs are now spawned, can be entered, and can be exited but with a wrong pos (you get back to your starting pos :-D )\r
- There is a delay between cab door opening/closing, and the acceptance of your entering request, so try multiple times.\r
- Visibility between subway travellers isn't working.\r
- \r
- More work needed on that topic, and some server-side computations need to be fully recreated/emulated.\r
- \r
-[GAME]\r
- subway.cpp/.h : Added PSubway class to manage Neocron subway cabs.\r
- Many files: Extended the Chair system to a general Seat system, used for subway and maybe for vhc.\r
-\r
-Hammag; 18.11.2007 18:45 GMT+2\r
-----------\r
-[rev. 94]\r
-<General changes>\r
- Subway is now apparently running well.\r
- Much work was needed to achieve that as some server-side computations were needed to emulate the subway movements.\r
- There still may be some timing issues about the subway cab positions and door status on the long run...\r
- Visibility between subway travellers isn't working yet. It will be done when working on vehicules to try make it all the same way.\r
-\r
- Added subcommand @debug subway\r
- \r
-[GAME]\r
- subway.cpp/.h : Various changes\r
- decoder/udp_charmove.cpp/.h , decoder/udp_useobject.cpp/.h : Various changes for subway use\r
- chars.cpp/.h : moved PCharPosition class out of PChar, and added some required methods to it\r
- decoder/udp_terminal.h/.cpp : started some work on that\r
-\r
-Hammag; 28.12.2007 00:50 GMT+2\r
-----------\r
-[rev. 96]\r
-<General changes>\r
- Basic vehicle is in place.\r
- One vhc of each type is available to every character. No prereq limitation.\r
- Only pilot access available, and for the owner only.\r
- No zoning yet.\r
- Orientation issues from the others chars point of view.\r
- Many things not implemented (and a good part still to be decoded)\r
- \r
-[GAME]\r
- Many changes in decoders and char, client and vehicle code.\r
-\r
-Hammag; 20.01.2008 20:00 GMT+2\r
-----------\r
-[rev. 97]\r
-<General changes>\r
- [GAME + INFO]\r
- sql.cpp/.h : added EscapeString() methode to PMySQL class, to permit string escape in SQL queries\r
- *.cpp : escape all strings used in SQL queries, which is now mandatory.\r
- [GAME + INFO + PATCH]\r
- *.cpp : replaced strcpy(), strcat(), sprintf() with respectively strncpy(), strncat(), snprintf()\r
- The first ones are now forbidden.\r
-\r
-Hammag; 2.02.2008 16:15 GMT+2\r
-----------\r
-[rev. 98]\r
-\r
-[Infoserver]\r
-accounts.cpp : Correction of the account creation/update SQL query - thank to drhawk ;)\r
-\r
-Hammag; 11.02.2008 20:30 GMT+2\r
-----------\r
-[rev. 99]\r
-Correction of an initialization issue that caused compilation error on some environments.\r
-\r
-Hammag; 20.04.2008 00:50 GMT+1\r
-----------\r
-[rev. 100]\r
-\r
-<Gameserver>\r
-msgbuilder.h/.cpp: added method PMessage* BuildTraderItemListMsg() (test version)\r
-decoded/upd_useobject.cpp: change so that only vhc terminal opens vhc interface\r
-client.cpp: added fragmented message type 0xac for traders\r
-chars.cpp: fixed initial inventory saving\r
-item.cpp/.h: added new method PItem::MakeStandardItem()\r
-\r
-Hammag; 15.03.2009 19:25 GMT+1\r
-----------\r
-[rev. 103]\r
-Fixed various warnings due to C++ compiler being more picky.\r
- TinNS should now compile without warning on gcc version 4.3.2\r
- Abort compliation on warning reactivated in makefile (-Werror)\r
-\r
-Added file options.local.exemple to set custom complilation options (read it for more info)\r
-\r
-Hammag; 19.03.2009 13:00 GMT+1\r
-----------\r
-[rev. 104]\r
-\r
-<Gameserver>\r
- Fixed some errors in apartment Genrep'ing code\r
- Implemted Venture Warp\r
-\r
-Hammag; 20.03.2009 14:20 GMT+1\r
-----------\r
-[rev. 105]\r
-\r
-<Gameserver>\r
- Implemted Outfitter (not persistent yet. No need for that now)\r
-\r
-Hammag; 28.03.2009 14:20 GMT+1\r
-----------\r
-[rev. 106 - 108]\r
-\r
-<Database> (by Sting)\r
- Slight changes to npcspawn table in Game Database.\r
- Removal of most npc out of J01\r
-\r
-<Gameserver>\r
- Fixed inventory so that items found in boxes and put in inventory are saved as expected\r
- Some testing code for inventory\r
- Fixed entry in Subway cabs, which had been broken during addition of vhc\r
- \r
-<SVN>\r
- Removed zipped database sql files, and put a non-compressed version instead. this will allow to track the changes made to these file.\r
- Nota: We should later split these files in database structure files on the one hand, and database data on the other hand.\r
-\r
-Hammag; 30.03.2009 14:20 GMT+1\r
-----------\r
-[rev. 109]\r
-\r
-<Gameserver>\r
- Added support for weapons.def\r
-\r
-Hammag; 31.03.2009 02:35 GMT+1\r
-----------\r
-[rev. 110]\r
-\r
-<Gameserver>\r
- Modified the gamedefs system to allow easier, cleaner and C++ oriented integration of currently missing def files support.\r
- Access to gamedefs data has changed a (little) bit, so take a look at changes in exiting code.\r
-\r
-Hammag; 04.04.2009 02:35 GMT+1\r
-----------\r
-[rev. 111]\r
-\r
-<Gameserver>\r
- Added all .h files and declarations for all needed .def files.\r
- Added all corresponding .cpp file with skeleton. Effective file parsing method still needed to be implemented for each .def. TinNS should complile and run however, with only a bunch of .def loading error at server start (but that's not blocking)\r
-\r
-\r
-Hammag; 11.04.2009 23:40 GMT+1\r
-----------\r
-[rev. 112-113]\r
-\r
-<Gameserver>\r
- Implemented support for more .def files\r
- Moved random number generation methods out of PGameServer to global functions in common/misc\r
- Content of item boxes, trashcans, bags, etc. is now based on .def files. Cabinet content is kept as before, i.e generating fully random items.\r
- \r
-Hammag; 18.04.2009 19:10 GMT+1\r
-----------\r
-[rev. 114-119]\r
-\r
-<Gameserver>\r
- Implemented multi-char vhc support:\r
- - vhc should now be seen the right way (good pos, good direction) by all present chars\r
- - Access to spawned vhc requires owner autorization [This is still bugging for some part though]\r
- Fixed various small things\r
- Tried an implementation of Jumping (in order to have jumps seen by other chars) [Not tested at all]\r
- \r
- As these various things require at least 2 simultaneous connexions, and as I can't easily do that atm, it has not been fully tested.\r
- \r
- Warning: my server crashed while I was away with 2 chars connected. I didn't search for the reason, so don't let your server running on an Internet accessible host when you're away.\r
-\r
-Hammag; 18.04.2009 20:00 GMT+1\r
-----------\r
-[rev. 120]\r
-\r
-<Gameserver>\r
- Fixed and added bug in handling deconnection of seating char that was causing the crash mentinned in the previous rev.\r
-\r
-Hammag; 28.04.2009 13:30 GMT+1\r
-----------\r
-[rev. 121-122]\r
-\r
-<Gameserver>\r
- Fixed many little accessory things, potential bugs and discrepencies\r
- Cleaned up source code format in some files\r
- Deactivated as most debug output when dev_debug is not set in conf file (but setting it will generate lots of output !)\r
- Continued work on vhc. Some small fixes and multichar tests still need to be performed\r
-\r
-Hammag; 01.05.2009 13:10 GMT+1\r
-----------\r
-[rev. 123-124]\r
-\r
-<Gameserver>\r
- Small fixes on vhc zoning\r
- Support for all remaining .def added. Good loading of expected data has not been validated yet.\r
-\r
-Hammag; 10.05.2009 02:15 GMT+1\r
-----------\r
-[rev. 125]\r
-\r
-<Gameserver>\r
- Fixed loading of weapons.def\r
- Started implementation of multiuser viewing of weapon use and basic manual weapon reload\r
-\r
-Hammag; 10.05.2009 23:55 GMT+1\r
-----------\r
-[rev. 126]\r
-\r
-<Gameserver>\r
- Improved working and multiuser viewing of weapon reload\r
- Started implementation of char death and respawn\r
-\r
-Hammag; 12.05.2009 18:00 GMT+1\r
-----------\r
-[rev. 127]\r
-\r
-<Gameserver>\r
- Added support for weapon addons effects activation (flashlight/zoom(not tested)/silencer/laser)\r
- Added weather control packet\r
- Added zone weather control command @weather ?|<weather id> [<target char id>]\r
- Added command @who as alias of @online\r
- Added command @whois as alias of @info\r
-\r
-\r
-?????\r
-[rev. 128 to 132]\r
-NO ONE BOTHERED TO PUT A COMMENT IN THE CHANGELOG\r
-so.. taken from SVN log:\r
-...\r
-------------------------------------------------------------------------\r
-r130 | Namikon | 2009-06-20 23:51:31 +0200 (sam 20 jun 2009) | 4 lines\r
-\r
-- Added 2 new commands: setmainskill and setsubskill (The 1st for PSI, INT, STR,.. the 2nd for HCK,BRT, ...)\r
-- Added 2 new decoders for yet-unknown packets\r
-- Prepared future work on the npc subsystem. (They'll soon be able to shoot you :) )\r
-- Fixed subskill system. You can now increase any subskill without getting OOO Packets, as long as there are enough skillpoints left of course\r
-------------------------------------------------------------------------\r
-r132 | Namikon | 2009-06-23 16:36:42 +0200 (mar 23 jun 2009) | 3 lines\r
-\r
-As by request of Akkiko, (hopefully) fixed all files with \n\r. (Also switched by editor to only use \n now.\r
-As by request of Sting (and to revert my mistake i did a few days ago) re-enabled mUnknown and mLoot values in NPC.cpp\r
-Also reformattet the output, the old one was way to long\r
-------------------------------------------------------------------------\r
-\r
-Hammag; 07.07.2009 14:40 GMT+2\r
-----------\r
-[rev. 133]\r
-\r
-<Config>\r
- Reverted gameserver.conf and infoserver.conf to their previous content which shouldn't be changed to installation-specific values !!!\r
-\r
-<Gameserver>\r
- Fixed naming of added class "PPvPTrade" to PUdpPvPTrade to try a bit to keep coherent...\r
- Added packets for held item use, drug use, recration unit use (experimental, not fully functionnal)\r
- Fixed use of decoded packed initially taken as "hack init/start"\r
- Fixed 2 compil-fatal SYNTAX ERRORS in npc.cpp ...\r
- \r
--- /dev/null
+add_subdirectory (src)
+++ /dev/null
-.DEFAULT_GOAL := all
-
-all .DEFAULT :
- $(MAKE) -C src $(MAKECMDGOALS)
-
+++ /dev/null
-The purpose of this proposed file is to give a fairly up to date view\r
-on the work in progress, to avoid double work...\r
-\r
-Hammag; 08.07.2006 - updated 21.09.2006\r
------\r
-The aim of current modifications are to change a bit of the general architecture of TinNS\r
-[DONE] Source tree, Makefiles, and includes will first be reorganised to permit more modularity and code sharing amongst the 3 servers,\r
- and easy exclusion of unfinished code.\r
- Some Makefile targets to facilitate common code individual compilation remains to be done\r
-\r
-The aim of some modifications I'll restart later will be to to finish the full character login,\r
-that is a char that displays as expected ingame (for himself at first),\r
-and has his stats, equipment and changes well kept in DB.\r
-\r
-It involves modification of:\r
- - [DONE] full char creation with use of profession templates (for money and inventory)\r
- except for :\r
- - remaining SP calculation\r
- - starting XP calculation\r
- - additions and modifications on some char data definitions\r
- - char items and containers management\r
- - [DONE] char data saving in DB including inventory\r
- But belt, implants & armor, chat conf and other secondary info not implemented yet\r
- - modifications to char loading from DB\r
- [DONE] for inventory\r
- [NOT DONE] for rest of char items and complementary infos (see above)\r
- - minor modifications to autosave\r
- [DONE] but more improvements will have to be done when more efficiency needed\r
- - [DONE]full filling-in of the baseline for char visual aspects, stats and inventory\r
- - [DONE] make use of worldinfo.def, appplaces.def, appartments.def, respawn.def to manage genreping and\r
- appartment in/out rather than hardcoded info (e.g. zoning.cpp) and manually built database.\r
- - [DONE] make use of world .dat files and worldmodels.def to manage item use rather than\r
- a manually built database.\r
- - [DONE] dynamic loading/unloading of chars, non mem-resident account info\r
-\r
-Notes\r
-----------------\r
-command @skin to play with skins\r
- Usage: @skin #<chardef idx>\r
- for use with the index id from characters.def\r
- or @skin <model>|-|# [<head>[ <torso>[ <legs>]]]\r
- <model> is the model id found after the model name in characters.def\r
- # resets to real char skin\r
- - means current skin\r
- incrementaly optional <head>, <torso> and <legs> are values 0-9\r
- As a side effect, just doing @skin - will display you current skin infos (and change to the same ...)\r
-\r
-command @effect to play with skins effect\r
- Usage: @effect <effect> [<density>]\r
- with <effect> = 0 to 17 and <density> = 0 (max density) to 255 (min density)\r
- <density> is meaningfull for some of the effects only\r
- Note: you won't see the effect on yourself. Only other chars will see it ...\r
- Effects found:\r
- 0 = no effect\r
- 1 = poison smoke\r
- 2 = electricity\r
- 3 = deflector (instant white flash)\r
- 4 = heal bubbles\r
- 5 = be a light in the darkness !!!\r
- 6 = flames\r
- 7 = stun particles\r
- 8 = group heal\r
- 9 = group deflector (?)\r
- 10= damage boost\r
- 11= group damage boost\r
- 12= shelter (instant yellow flash)\r
- 13= group deflector (?)\r
- 14= stealth\r
- 15= anti poison aura\r
- 16= I don't remember this one: swarming yellow & blue bubbles\r
- 17= true sight\r
-\r
-command @speed to play with speed\r
- Usage: @speed <newspeed> | #\r
- with <speed> = 0 (no move).. 254 , 255 or # meaning "no speed override"\r
\r
// do actions with NPCs\r
npc = 50\r
-\r
server_name = Irata\r
\r
// IP Adress of the Gameserver when reached without NAT (what you care for on your local network)\r
-server_ip = 127.0.0.1\r
+server_ip = 85.65.85.65\r
// Network adress that is to be considered as non-NATed. Put 0 if no NAT is used at all\r
no_nat_net = 1\r
// IP Adress of the Gameserver when reached with NAT (e.g. for users connecting from Internet thought your firewall or router when you have multiple computers)\r
// no effect if no_nat_net is 0\r
-server_nat_ip = 123.123.123.123\r
+server_nat_ip = 192.168.1.1\r
\r
// TCP port the gameserver listens on.\r
// Default is 12000\r
// TinNS Infoserver configuration file\r
// =====================================\r
\r
+// Database settings\r
+// Define what Database you want to use.\r
+// Possible values = mysql, sqlite\r
+// Defaults to sqlite\r
+database_type = sqlite\r
+\r
// MySQL settings\r
//================\r
// Hostname of the MySQL Database (under linux, you may use "localhost")\r
// or 0 to disable keepalive. 28800 is the usual default value on MySQL servers\r
mysql_wait_timeout = 28800\r
\r
+// SQLite settings\r
+//================\r
+// Location and name of the Database file\r
+sqlite_databasefile = infoDB.s3db\r
+\r
// ISC settings\r
// ================\r
// Method of data exchange\r
-function DIALOG()\r
-\r
-NODE(0)\r
- SAY("Hi. Please choose, time is money!")\r
- ANSWER("Give me 100000 NC!",2)\r
- ANSWER("Take 100000 NC!",3)\r
-\r
-NODE(2)\r
- GIVEMONEY(100000)\r
- SAY("Here you go, have fun")\r
- ENDDIALOG()\r
-\r
-NODE(3)\r
- TAKEMONEY(100000)\r
- SAY("Cool, thanks :)")\r
- ENDDIALOG()\r
-\r
-end
\ No newline at end of file
+function DIALOG()
+
+NODE(0)
+ SAY("Hi. Please choose, time is money!")
+ ANSWER("Give me 100000 NC!",2)
+ ANSWER("Take 100000 NC!",3)
+
+NODE(2)
+ GIVEMONEY(100000)
+ SAY("Here you go, have fun")
+ ENDDIALOG()
+
+NODE(3)
+ TAKEMONEY(100000)
+ SAY("Cool, thanks :)")
+ ENDDIALOG()
+
+end
-use gameserver;\r
-\r
-alter table `emails` change `e_body` `e_body` varchar(2048) character set latin1 collate latin1_swedish_ci NOT NULL;
\ No newline at end of file
+use gameserver;
+
+alter table `emails` change `e_body` `e_body` varchar(2048) character set latin1 collate latin1_swedish_ci NOT NULL;
-USE `gameserver`;\r
-\r
-/*Data for the table `forums` */\r
-\r
-insert into `forums`(`f_id`,`f_name`,`f_area`,`f_showname`) values (1,'bbsnctradeweap',1,'nc.trading.weapons/armor'),(2,'bbsnctraderare',1,'nc.trading.rareparts'),(3,'bbsnctradeimp',1,'nc.trading.implants/boneenforcements'),(4,'bbsnctradepsi',1,'nc.trading.psi equipment'),(5,'bbsnctradeblue',1,'nc.trading.blueprints'),(6,'bbsnctradeitem',1,'nc.trading.itemparts/raw materials'),(7,'bbsnctradedrug',1,'nc.trading.drugs'),(8,'bbsneocronmarket',1,'nc.trading.miscellaneous'),(9,'bbsncrunnerano',2,'nc.runner.anouncements'),(10,'bbsncrunnerserv',2,'nc.runner.services'),(11,'bbsncrunnereven',2,'nc.runner.events'),(12,'bbsncrunnerauct',2,'nc.runner.auctions'),(13,'bbsncrunnerclan',2,'nc.runner.clan recruitment'),(14,'bbsncrunnerfind',2,'nc.runner.find team'),(15,'bbsncrunnerhelp',2,'nc.runner.runner2runnerhelp'),(16,'bbsneocrongeneral',3,'nc.talk.general'),(17,'bbsnctalkpolitics',3,'nc.talk.political discussions'),(18,'bbfgeneral',11,'private.faction.general'),(19,'bbcgeneral',12,'private.clan.general');\r
-\r
-/*Data for the table `npc_spawns` */\r
-\r
-insert into `npc_spawns`(`npc_id`,`npc_worldid`,`npc_nameid`,`npc_typeid`,`npc_name`,`npc_location`,`npc_x`,`npc_y`,`npc_z`,`npc_angle`,`npc_clothing`,`npc_loot`,`npc_unknown`,`npc_trader`,`npc_customname`,`npc_customscript`,`npc_shop_quality`,`npc_scripting`) values (9942,1020,385,61093,'WSK',1,33808,31332,32512,30,6612,0,8814,0,'Zippy the Trader','scripts/lua/zippy.lua',50,1),(9943,1020,388,17634,'WSK',3,30063,34111,33136,90,6616,0,14035,0,'Event Info',NULL,50,1),(9944,1018,387,32772,'WSK',101,31938,32165,32512,130,6616,0,16675,0,'Event Info',NULL,50,1),(9945,1019,215,50585,'WSK',101,34209,33864,32512,359,197,0,19499,195,NULL,NULL,50,1),(9946,1020,385,13542,'WSK',101,33261,33113,32672,2,4342,0,17892,0,'VotR Paperboy',NULL,50,1),(9947,1019,389,10890,'WSK',401,31105,32463,31936,92,6613,0,14572,0,'Event Info',NULL,50,1),(9948,1020,1629,26858,'WSK',401,31265,30718,31952,177,2827,0,12567,0,NULL,NULL,50,1),(9949,256,151,31996,'WSK',2046,32168,36946,33946,30,9888,0,738,1,NULL,NULL,50,1),(9950,261,143,58099,'WSK',2046,34016,36182,33970,30,22655,0,2306,200,NULL,NULL,50,1),(9951,963,216,356,'WSK',2046,32703,34945,33818,25,4191,0,3154,196,NULL,NULL,50,1),(9952,976,2818,15528,'WSK',2071,23436,21380,35220,185,7214,0,9785,0,NULL,NULL,50,1),(9953,971,386,5040,'WSK',2181,38000,24127,33854,264,6622,0,2590,0,NULL,NULL,50,1),(9954,1020,836,43282,'MBOTFLY',2181,43068,26020,34020,0,31788,0,405,0,NULL,NULL,50,1),(9955,988,836,41913,'MBOTFLY',2181,41537,28260,33860,0,50146,0,380,0,NULL,NULL,50,1),(9956,1006,800,15709,'MBOT',2181,42047,28256,33786,0,14348,0,220,0,NULL,NULL,50,1),(9957,1005,800,28598,'MBOT',2181,44419,23412,33445,0,8332,0,585,0,NULL,NULL,50,1),(9958,1014,672,28153,'DOGBOT',2181,38041,29414,34088,0,21948,0,221,0,NULL,NULL,50,1),(9959,984,677,32746,'WBADGUY',2181,37985,31043,33939,0,21616,0,222,0,NULL,NULL,50,1),(9960,973,606,26878,'MUTANTB',2181,26220,27158,34106,0,20679,0,490,0,NULL,NULL,50,1),(9961,975,800,11783,'MBOT',2181,31285,23969,33970,0,722,0,38,0,NULL,NULL,50,1),(9962,981,640,61001,'FLYMUT',2181,26672,26657,34281,0,20684,0,1510,0,NULL,NULL,50,1),(9963,985,610,1100,'MGMUT',2181,28040,26301,34083,0,21559,0,628,0,NULL,NULL,50,1),(9964,986,640,1159,'FLYMUT',2181,27424,27264,34328,0,21560,0,1503,0,NULL,NULL,50,1),(9965,987,626,53397,'MUTANTB',2181,26386,27672,34135,0,20680,0,407,0,NULL,NULL,50,1),(9966,999,602,19865,'MUTANTB',2181,26771,26119,34228,0,21559,0,271,0,NULL,NULL,50,1),(9967,1003,730,39449,'BROBOT',2181,25425,32173,34055,0,20939,0,4285,0,NULL,NULL,50,1);\r
-\r
-/*Data for the table `outposts` */\r
-\r
-insert into `outposts`(`o_id`,`o_outnum`,`o_security`,`o_clan`,`o_gr`) values (1,2006,0,0,0),(2,2028,0,0,0),(3,2031,0,0,0),(4,2047,0,0,0),(5,2049,0,0,0),(6,2052,9,3,0),(7,2066,0,0,0),(8,2067,0,0,0),(9,2069,0,0,0),(10,2071,0,0,0),(11,2073,0,0,0),(12,2090,0,0,0),(13,2105,0,0,0),(14,2111,0,0,0),(15,2112,0,0,0),(16,2128,0,0,0),(17,2132,0,0,0),(18,2143,0,0,0),(19,2147,0,0,0),(20,2149,0,0,0),(21,2151,0,0,0),(22,2153,0,0,0),(23,2155,0,0,0),(24,2156,0,0,0),(25,2164,0,0,0),(26,2165,0,0,0),(27,2167,0,0,0),(28,2168,0,0,0),(29,2171,0,0,0),(30,2175,0,0,0),(31,2189,0,0,0),(32,2194,0,0,0),(33,2204,0,0,0),(34,2205,0,0,0),(35,2207,0,0,0),(36,2212,0,0,0);\r
-\r
-/*Data for the table `stockx` */\r
-\r
-insert into `stockx`(`st_id`,`st_factid`,`st_curval`,`st_oldval`) values (1,9,1227,1227),(2,2,2499,2400),(3,6,1269,1269),(4,10,1387,1387),(5,8,676,676),(6,14,783,783),(7,15,591,591),(8,3,1779,1779),(9,5,879,879),(10,11,1581,2000),(11,4,1544,1544);\r
+USE `gameserver`;
+
+/*Data for the table `forums` */
+
+insert into `forums`(`f_id`,`f_name`,`f_area`,`f_showname`) values (1,'bbsnctradeweap',1,'nc.trading.weapons/armor'),(2,'bbsnctraderare',1,'nc.trading.rareparts'),(3,'bbsnctradeimp',1,'nc.trading.implants/boneenforcements'),(4,'bbsnctradepsi',1,'nc.trading.psi equipment'),(5,'bbsnctradeblue',1,'nc.trading.blueprints'),(6,'bbsnctradeitem',1,'nc.trading.itemparts/raw materials'),(7,'bbsnctradedrug',1,'nc.trading.drugs'),(8,'bbsneocronmarket',1,'nc.trading.miscellaneous'),(9,'bbsncrunnerano',2,'nc.runner.anouncements'),(10,'bbsncrunnerserv',2,'nc.runner.services'),(11,'bbsncrunnereven',2,'nc.runner.events'),(12,'bbsncrunnerauct',2,'nc.runner.auctions'),(13,'bbsncrunnerclan',2,'nc.runner.clan recruitment'),(14,'bbsncrunnerfind',2,'nc.runner.find team'),(15,'bbsncrunnerhelp',2,'nc.runner.runner2runnerhelp'),(16,'bbsneocrongeneral',3,'nc.talk.general'),(17,'bbsnctalkpolitics',3,'nc.talk.political discussions'),(18,'bbfgeneral',11,'private.faction.general'),(19,'bbcgeneral',12,'private.clan.general');
+
+/*Data for the table `npc_spawns` */
+
+insert into `npc_spawns`(`npc_id`,`npc_worldid`,`npc_nameid`,`npc_typeid`,`npc_name`,`npc_location`,`npc_x`,`npc_y`,`npc_z`,`npc_angle`,`npc_clothing`,`npc_loot`,`npc_unknown`,`npc_trader`,`npc_customname`,`npc_customscript`,`npc_shop_quality`,`npc_scripting`) values (9942,1020,385,61093,'WSK',1,33808,31332,32512,30,6612,0,8814,0,'Zippy the Trader','scripts/lua/zippy.lua',50,1),(9943,1020,388,17634,'WSK',3,30063,34111,33136,90,6616,0,14035,0,'Event Info',NULL,50,1),(9944,1018,387,32772,'WSK',101,31938,32165,32512,130,6616,0,16675,0,'Event Info',NULL,50,1),(9945,1019,215,50585,'WSK',101,34209,33864,32512,359,197,0,19499,195,NULL,NULL,50,1),(9946,1020,385,13542,'WSK',101,33261,33113,32672,2,4342,0,17892,0,'VotR Paperboy',NULL,50,1),(9947,1019,389,10890,'WSK',401,31105,32463,31936,92,6613,0,14572,0,'Event Info',NULL,50,1),(9948,1020,1629,26858,'WSK',401,31265,30718,31952,177,2827,0,12567,0,NULL,NULL,50,1),(9949,256,151,31996,'WSK',2046,32168,36946,33946,30,9888,0,738,1,NULL,NULL,50,1),(9950,261,143,58099,'WSK',2046,34016,36182,33970,30,22655,0,2306,200,NULL,NULL,50,1),(9951,963,216,356,'WSK',2046,32703,34945,33818,25,4191,0,3154,196,NULL,NULL,50,1),(9952,976,2818,15528,'WSK',2071,23436,21380,35220,185,7214,0,9785,0,NULL,NULL,50,1),(9953,971,386,5040,'WSK',2181,38000,24127,33854,264,6622,0,2590,0,NULL,NULL,50,1),(9954,1020,836,43282,'MBOTFLY',2181,43068,26020,34020,0,31788,0,405,0,NULL,NULL,50,1),(9955,988,836,41913,'MBOTFLY',2181,41537,28260,33860,0,50146,0,380,0,NULL,NULL,50,1),(9956,1006,800,15709,'MBOT',2181,42047,28256,33786,0,14348,0,220,0,NULL,NULL,50,1),(9957,1005,800,28598,'MBOT',2181,44419,23412,33445,0,8332,0,585,0,NULL,NULL,50,1),(9958,1014,672,28153,'DOGBOT',2181,38041,29414,34088,0,21948,0,221,0,NULL,NULL,50,1),(9959,984,677,32746,'WBADGUY',2181,37985,31043,33939,0,21616,0,222,0,NULL,NULL,50,1),(9960,973,606,26878,'MUTANTB',2181,26220,27158,34106,0,20679,0,490,0,NULL,NULL,50,1),(9961,975,800,11783,'MBOT',2181,31285,23969,33970,0,722,0,38,0,NULL,NULL,50,1),(9962,981,640,61001,'FLYMUT',2181,26672,26657,34281,0,20684,0,1510,0,NULL,NULL,50,1),(9963,985,610,1100,'MGMUT',2181,28040,26301,34083,0,21559,0,628,0,NULL,NULL,50,1),(9964,986,640,1159,'FLYMUT',2181,27424,27264,34328,0,21560,0,1503,0,NULL,NULL,50,1),(9965,987,626,53397,'MUTANTB',2181,26386,27672,34135,0,20680,0,407,0,NULL,NULL,50,1),(9966,999,602,19865,'MUTANTB',2181,26771,26119,34228,0,21559,0,271,0,NULL,NULL,50,1),(9967,1003,730,39449,'BROBOT',2181,25425,32173,34055,0,20939,0,4285,0,NULL,NULL,50,1);
+
+/*Data for the table `outposts` */
+
+insert into `outposts`(`o_id`,`o_outnum`,`o_security`,`o_clan`,`o_gr`) values (1,2006,0,0,0),(2,2028,0,0,0),(3,2031,0,0,0),(4,2047,0,0,0),(5,2049,0,0,0),(6,2052,9,3,0),(7,2066,0,0,0),(8,2067,0,0,0),(9,2069,0,0,0),(10,2071,0,0,0),(11,2073,0,0,0),(12,2090,0,0,0),(13,2105,0,0,0),(14,2111,0,0,0),(15,2112,0,0,0),(16,2128,0,0,0),(17,2132,0,0,0),(18,2143,0,0,0),(19,2147,0,0,0),(20,2149,0,0,0),(21,2151,0,0,0),(22,2153,0,0,0),(23,2155,0,0,0),(24,2156,0,0,0),(25,2164,0,0,0),(26,2165,0,0,0),(27,2167,0,0,0),(28,2168,0,0,0),(29,2171,0,0,0),(30,2175,0,0,0),(31,2189,0,0,0),(32,2194,0,0,0),(33,2204,0,0,0),(34,2205,0,0,0),(35,2207,0,0,0),(36,2212,0,0,0);
+
+/*Data for the table `stockx` */
+
+insert into `stockx`(`st_id`,`st_factid`,`st_curval`,`st_oldval`) values (1,9,1227,1227),(2,2,2499,2400),(3,6,1269,1269),(4,10,1387,1387),(5,8,676,676),(6,14,783,783),(7,15,591,591),(8,3,1779,1779),(9,5,879,879),(10,11,1581,2000),(11,4,1544,1544);
-CHANGELOG FOR GameDB 8 and InfoDB 8\r
------------------------------------\r
-\r
-v7 > v8:\r
-INFOSERVER:\r
-- No changes so far\r
-\r
-GAMESERVER:\r
-Renamed table 'bug report' to 'bug_report'\r
-- Changed br_desc from VARCHAR(256) to VARCHAR(1024) as this is the size found in .tsc files\r
-\r
-Changed table "characters":\r
-- Added col c_online\r
-- Added col c_clan\r
-- Added col c_soullight\r
-\r
-Added table "clanlevels"\r
-\r
-Changed table "clans":\r
-- Renamed c_faction to cl_faction, also changed type from INT(10) to INT(2)\r
-- Renamed c_id to cl_id\r
-- Renamed c_longname to cl_name, also changed type from VARCHAR(45) to CHAR(16) as this is the size found in .tsc files\r
-- Renamed c_shortname to cl_shortdesc, also changed type from VARCHAR(45) to CHAR(64) as this is the size found in .tsc files\r
-- Added col cl_appid\r
-- Added col cl_description\r
-- Added col cl_leader\r
-- Added col cl_minsympathy\r
-- Added col cl_money\r
-- Added col cl_representative\r
-\r
-Added table "clanwars"\r
-\r
-Added table "datacubes"\r
-\r
-Changed table "forum_posts"\r
-- Added col fp_factionid\r
-- Added col fp_clanid\r
-- Changed col fp_content from VARCHAR(1024) to VARCHAR(2048) as this is the size found in .tsc files\r
-\r
-Changed table "guides"\r
-- Changed col g_content from VARCHAR(512) to TEXT, as the size in .tsc files is set to 32768\r
-- Added col g_language\r
-- Added col g_chapter\r
-- Added col g_part\r
-\r
-Added table "moneytransactions"\r
-\r
-Changed table "neochronicle"\r
-- Changed col nc_content from VARCHAR(512) to TEXT, as the size in .tsc files is set to 32768\r
-- Added col nc_lang\r
-- Added col nc_approved\r
-- Added col nc_author\r
-- Added col nc_icon\r
-\r
-Changed table "neocron articles"\r
-- Changed col na_content from VARCHAR(512) to TEXT, as the size in .tsc files is set to 32768\r
-\r
-Added table "npc_shop"\r
-\r
-Changed table "npc_spawns"\r
-- Added col npc_unknown\r
-- Added col npc_trader\r
-- Added col npc_customname\r
-- Added col npc_customscript\r
-- Added col npc_shop_quality\r
-- Added col npc_scripting\r
-\r
-Added table "stockx_depots"\r
-\r
-Added table "support"\r
-\r
-Changed table "vehicles"\r
-- Added col v_world\r
-\r
-Added table "worlds"
\ No newline at end of file
+CHANGELOG FOR GameDB 8 and InfoDB 8
+-----------------------------------
+
+v7 > v8:
+INFOSERVER:
+- No changes so far
+
+GAMESERVER:
+Renamed table 'bug report' to 'bug_report'
+- Changed br_desc from VARCHAR(256) to VARCHAR(1024) as this is the size
+found in .tsc files
+
+Changed table "characters":
+- Added col c_online
+- Added col c_clan
+- Added col c_soullight
+
+Added table "clanlevels"
+
+Changed table "clans":
+- Renamed c_faction to cl_faction, also changed type from INT(10) to INT(2)
+- Renamed c_id to cl_id
+- Renamed c_longname to cl_name, also changed type from VARCHAR(45) to
+CHAR(16) as this is the size found in .tsc files
+- Renamed c_shortname to cl_shortdesc, also changed type from VARCHAR(45) to
+CHAR(64) as this is the size found in .tsc files
+- Added col cl_appid
+- Added col cl_description
+- Added col cl_leader
+- Added col cl_minsympathy
+- Added col cl_money
+- Added col cl_representative
+
+Added table "clanwars"
+
+Added table "datacubes"
+
+Changed table "forum_posts"
+- Added col fp_factionid
+- Added col fp_clanid
+- Changed col fp_content from VARCHAR(1024) to VARCHAR(2048) as this is the
+size found in .tsc files
+
+Changed table "guides"
+- Changed col g_content from VARCHAR(512) to TEXT, as the size in .tsc files
+is set to 32768
+- Added col g_language
+- Added col g_chapter
+- Added col g_part
+
+Added table "moneytransactions"
+
+Changed table "neochronicle"
+- Changed col nc_content from VARCHAR(512) to TEXT, as the size in .tsc files
+is set to 32768
+- Added col nc_lang
+- Added col nc_approved
+- Added col nc_author
+- Added col nc_icon
+
+Changed table "neocron articles"
+- Changed col na_content from VARCHAR(512) to TEXT, as the size in .tsc files
+is set to 32768
+
+Added table "npc_shop"
+
+Changed table "npc_spawns"
+- Added col npc_unknown
+- Added col npc_trader
+- Added col npc_customname
+- Added col npc_customscript
+- Added col npc_shop_quality
+- Added col npc_scripting
+
+Added table "stockx_depots"
+
+Added table "support"
+
+Changed table "vehicles"
+- Added col v_world
+
+Added table "worlds"
-/* Create table in target */\r
-DROP TABLE `bug report`;\r
-\r
-CREATE TABLE `bug_report`(\r
- `br_id` int(10) unsigned NOT NULL auto_increment , \r
- `br_type` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Type' , \r
- `br_desc` varchar(1024) COLLATE latin1_swedish_ci NOT NULL COMMENT 'Description' , \r
- `br_fromid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Char ID of reporter' , \r
- `br_location` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Location where problem occured' , \r
- `br_status` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Status' , \r
- `br_datetime` varchar(45) COLLATE latin1_swedish_ci NOT NULL COMMENT 'Date/Time' , \r
- `br_supid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Supporter ID' , \r
- PRIMARY KEY (`br_id`) \r
-) ENGINE=InnoDB DEFAULT CHARSET='latin1';\r
-\r
-\r
-/* Alter table in target */\r
-ALTER TABLE `characters` \r
- ADD COLUMN `c_online` int(1) NULL DEFAULT '0' after `c_slot`, \r
- ADD COLUMN `c_clan` int(10) NULL DEFAULT '0' after `c_online`, \r
- ADD COLUMN `c_soullight` int(3) NULL DEFAULT '10' after `c_clan`, COMMENT='';\r
-\r
-/* Create table in target */\r
-CREATE TABLE `clanlevels`(\r
- `cll_id` int(10) NOT NULL auto_increment , \r
- `cll_clanid` int(10) NULL DEFAULT '0' , \r
- `cll_level` int(2) NULL DEFAULT '0' , \r
- `cll_desc` char(255) COLLATE latin1_general_ci NULL , \r
- `cll_charid` int(10) NULL , \r
- PRIMARY KEY (`cll_id`) \r
-) ENGINE=MyISAM DEFAULT CHARSET='latin1';\r
-\r
-\r
-/* Alter table in target */\r
-ALTER TABLE `clans` \r
- ADD COLUMN `cl_id` int(10) unsigned NOT NULL auto_increment first, \r
- ADD COLUMN `cl_shortdesc` char(16) COLLATE latin1_general_ci NULL after `cl_id`, \r
- ADD COLUMN `cl_name` char(64) COLLATE latin1_general_ci NULL after `cl_shortdesc`, \r
- ADD COLUMN `cl_faction` int(2) NULL after `cl_name`, \r
- ADD COLUMN `cl_description` varchar(256) COLLATE latin1_general_ci NULL after `cl_faction`, \r
- ADD COLUMN `cl_leader` int(10) NULL DEFAULT '0' after `cl_description`, \r
- ADD COLUMN `cl_money` int(10) NULL DEFAULT '0' after `cl_leader`, \r
- ADD COLUMN `cl_minsympathy` int(3) NULL DEFAULT '70' after `cl_money`, \r
- ADD COLUMN `cl_appid` int(10) NULL DEFAULT '0' after `cl_minsympathy`, \r
- ADD COLUMN `cl_representative` int(10) NULL DEFAULT '0' after `cl_appid`, \r
- DROP COLUMN `c_id`, \r
- DROP COLUMN `c_shortname`, \r
- DROP COLUMN `c_longname`, \r
- DROP COLUMN `c_faction`, \r
- DROP KEY `PRIMARY`, add PRIMARY KEY(`cl_id`), ENGINE=MyISAM, COMMENT='';\r
-\r
-/* Create table in target */\r
-CREATE TABLE `clanwars`(\r
- `cw_id` int(10) NOT NULL auto_increment , \r
- `cw_initclan` int(10) NULL DEFAULT '0' , \r
- `cw_enemyclan` int(10) NULL DEFAULT '0' , \r
- `cw_starttime` varchar(45) COLLATE latin1_general_ci NULL , \r
- `cw_status` int(2) NULL DEFAULT '0' , \r
- `cw_statement_initiator` varchar(512) COLLATE latin1_general_ci NULL , \r
- `cw_statement_enemy` varchar(512) COLLATE latin1_general_ci NULL , \r
- PRIMARY KEY (`cw_id`) \r
-) ENGINE=MyISAM DEFAULT CHARSET='latin1';\r
-\r
-\r
-/* Create table in target */\r
-CREATE TABLE `datacubes`(\r
- `cb_id` int(10) NOT NULL auto_increment , \r
- `cb_securitycode` char(30) COLLATE latin1_general_ci NULL , \r
- `cb_inscription` tinytext COLLATE latin1_general_ci NULL , \r
- PRIMARY KEY (`cb_id`) \r
-) ENGINE=MyISAM DEFAULT CHARSET='latin1';\r
-\r
-\r
-/* Alter table in target */\r
-ALTER TABLE `forum_posts` \r
- CHANGE `fp_content` `fp_content` varchar(2048) COLLATE latin1_swedish_ci NOT NULL after `fp_fromid`, \r
- ADD COLUMN `fp_factionid` int(2) NULL DEFAULT '0' after `fp_forumid`, \r
- ADD COLUMN `fp_clanid` int(10) NULL DEFAULT '0' after `fp_factionid`, COMMENT='';\r
-\r
-/* Alter table in target */\r
-ALTER TABLE `guides` \r
- ADD COLUMN `g_language` int(2) NULL after `g_title`, \r
- CHANGE `g_content` `g_content` text COLLATE latin1_swedish_ci NOT NULL after `g_language`, \r
- ADD COLUMN `g_chapter` int(1) NULL DEFAULT '0' after `g_content`, \r
- ADD COLUMN `g_part` int(1) NULL DEFAULT '0' after `g_chapter`, COMMENT='';\r
-\r
-/* Create table in target */\r
-CREATE TABLE `moneytransactions`(\r
- `mt_id` int(10) NOT NULL auto_increment , \r
- `mt_clanid` int(10) NULL DEFAULT '0' , \r
- `mt_amount` int(10) NULL DEFAULT '0' , \r
- `mt_player` int(10) NULL DEFAULT '0' , \r
- `mt_date` char(45) COLLATE latin1_general_ci NULL DEFAULT '2750-01-01 00:00:00' , \r
- `mt_comment` char(255) COLLATE latin1_general_ci NULL DEFAULT '0' , \r
- PRIMARY KEY (`mt_id`) \r
-) ENGINE=MyISAM DEFAULT CHARSET='latin1';\r
-\r
-\r
-/* Alter table in target */\r
-ALTER TABLE `neochronicle` \r
- CHANGE `nc_content` `nc_content` text COLLATE latin1_swedish_ci NOT NULL after `nc_name`, \r
- ADD COLUMN `nc_lang` int(2) NULL after `nc_datetime`, \r
- ADD COLUMN `nc_approved` int(1) NULL DEFAULT '0' after `nc_lang`, \r
- ADD COLUMN `nc_author` char(45) COLLATE latin1_swedish_ci NULL after `nc_approved`, \r
- ADD COLUMN `nc_icon` int(10) NULL DEFAULT '0' after `nc_author`, COMMENT='';\r
-\r
-/* Alter table in target */\r
-ALTER TABLE `neocron articles` \r
- CHANGE `na_content` `na_content` text COLLATE latin1_swedish_ci NOT NULL after `na_name`, COMMENT='';\r
-\r
-/* Create table in target */\r
-CREATE TABLE `npc_shop`(\r
- `c_npc_id` int(11) NULL COMMENT 'The NPC WorldID' , \r
- `c_zoneid` int(11) NULL COMMENT 'The ZoneID in which the NPC is' , \r
- `c_itemid` int(11) NULL COMMENT 'ItemID for sale' , \r
- `c_itemprice` int(11) NULL COMMENT 'Price for this item' \r
-) ENGINE=MyISAM DEFAULT CHARSET='latin1';\r
-\r
-\r
-/* Alter table in target */\r
-ALTER TABLE `npc_spawns` \r
- ADD COLUMN `npc_unknown` int(10) unsigned NOT NULL DEFAULT '0' after `npc_loot`, \r
- ADD COLUMN `npc_trader` int(10) unsigned NOT NULL DEFAULT '0' after `npc_unknown`, \r
- ADD COLUMN `npc_customname` varchar(80) COLLATE latin1_swedish_ci NULL after `npc_trader`, \r
- ADD COLUMN `npc_customscript` varchar(100) COLLATE latin1_swedish_ci NULL after `npc_customname`, \r
- ADD COLUMN `npc_shop_quality` int(3) NULL DEFAULT '50' COMMENT 'The quality of items if this npc has items to sell' after `npc_customscript`, \r
- ADD COLUMN `npc_scripting` int(1) NULL DEFAULT '1' COMMENT '1: Scripts enabled 0: Scripts disabled' after `npc_shop_quality`, COMMENT='';\r
-\r
-/* Create table in target */\r
-CREATE TABLE `stockx_depots`(\r
- `sxd_id` int(10) NOT NULL auto_increment , \r
- `sxd_playerid` int(10) NULL DEFAULT '0' , \r
- `sxd_st_id` int(10) NULL DEFAULT '0' , \r
- `sxd_amount` int(10) NULL DEFAULT '0' , \r
- `sxd_paid` int(10) NULL DEFAULT '0' , \r
- PRIMARY KEY (`sxd_id`) \r
-) ENGINE=MyISAM DEFAULT CHARSET='latin1';\r
-\r
-\r
-/* Create table in target */\r
-CREATE TABLE `support`(\r
- `su_id` int(10) NOT NULL auto_increment , \r
- `su_player` int(10) NULL DEFAULT '0' , \r
- `su_datetime` varchar(45) COLLATE latin1_general_ci NULL , \r
- `su_supporterid` int(10) NULL DEFAULT '0' , \r
- `su_desc` char(255) COLLATE latin1_general_ci NULL , \r
- `su_type` int(1) NULL DEFAULT '0' , \r
- `su_worldid` int(10) NULL DEFAULT '0' , \r
- `su_inwork` int(1) NULL DEFAULT '0' , \r
- `su_finished` int(1) NULL DEFAULT '0' , \r
- PRIMARY KEY (`su_id`) \r
-) ENGINE=MyISAM DEFAULT CHARSET='latin1';\r
-\r
-\r
-/* Alter table in target */\r
-ALTER TABLE `vehicles` \r
- ADD COLUMN `v_world` int(10) NULL DEFAULT '0' after `v_status`, COMMENT='';\r
-\r
-/* Create table in target */\r
-CREATE TABLE `worlds`(\r
- `wr_id` int(10) NOT NULL DEFAULT '0' , \r
- `wr_group` int(10) NULL DEFAULT '0' , \r
- PRIMARY KEY (`wr_id`) \r
-) ENGINE=MyISAM DEFAULT CHARSET='latin1';\r
+/* Create table in target */
+DROP TABLE `bug report`;
+
+CREATE TABLE `bug_report`(
+ `br_id` int(10) unsigned NOT NULL auto_increment ,
+ `br_type` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Type' ,
+ `br_desc` varchar(1024) COLLATE latin1_swedish_ci NOT NULL COMMENT 'Description' ,
+ `br_fromid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Char ID of reporter' ,
+ `br_location` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Location where problem occured' ,
+ `br_status` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Status' ,
+ `br_datetime` varchar(45) COLLATE latin1_swedish_ci NOT NULL COMMENT 'Date/Time' ,
+ `br_supid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Supporter ID' ,
+ PRIMARY KEY (`br_id`)
+) ENGINE=InnoDB DEFAULT CHARSET='latin1';
+
+
+/* Alter table in target */
+ALTER TABLE `characters`
+ ADD COLUMN `c_online` int(1) NULL DEFAULT '0' after `c_slot`,
+ ADD COLUMN `c_clan` int(10) NULL DEFAULT '0' after `c_online`,
+ ADD COLUMN `c_soullight` int(3) NULL DEFAULT '10' after `c_clan`, COMMENT='';
+
+/* Create table in target */
+CREATE TABLE `clanlevels`(
+ `cll_id` int(10) NOT NULL auto_increment ,
+ `cll_clanid` int(10) NULL DEFAULT '0' ,
+ `cll_level` int(2) NULL DEFAULT '0' ,
+ `cll_desc` char(255) COLLATE latin1_general_ci NULL ,
+ `cll_charid` int(10) NULL ,
+ PRIMARY KEY (`cll_id`)
+) ENGINE=MyISAM DEFAULT CHARSET='latin1';
+
+
+/* Alter table in target */
+ALTER TABLE `clans`
+ ADD COLUMN `cl_id` int(10) unsigned NOT NULL auto_increment first,
+ ADD COLUMN `cl_shortdesc` char(16) COLLATE latin1_general_ci NULL after `cl_id`,
+ ADD COLUMN `cl_name` char(64) COLLATE latin1_general_ci NULL after `cl_shortdesc`,
+ ADD COLUMN `cl_faction` int(2) NULL after `cl_name`,
+ ADD COLUMN `cl_description` varchar(256) COLLATE latin1_general_ci NULL after `cl_faction`,
+ ADD COLUMN `cl_leader` int(10) NULL DEFAULT '0' after `cl_description`,
+ ADD COLUMN `cl_money` int(10) NULL DEFAULT '0' after `cl_leader`,
+ ADD COLUMN `cl_minsympathy` int(3) NULL DEFAULT '70' after `cl_money`,
+ ADD COLUMN `cl_appid` int(10) NULL DEFAULT '0' after `cl_minsympathy`,
+ ADD COLUMN `cl_representative` int(10) NULL DEFAULT '0' after `cl_appid`,
+ DROP COLUMN `c_id`,
+ DROP COLUMN `c_shortname`,
+ DROP COLUMN `c_longname`,
+ DROP COLUMN `c_faction`,
+ DROP KEY `PRIMARY`, add PRIMARY KEY(`cl_id`), ENGINE=MyISAM, COMMENT='';
+
+/* Create table in target */
+CREATE TABLE `clanwars`(
+ `cw_id` int(10) NOT NULL auto_increment ,
+ `cw_initclan` int(10) NULL DEFAULT '0' ,
+ `cw_enemyclan` int(10) NULL DEFAULT '0' ,
+ `cw_starttime` varchar(45) COLLATE latin1_general_ci NULL ,
+ `cw_status` int(2) NULL DEFAULT '0' ,
+ `cw_statement_initiator` varchar(512) COLLATE latin1_general_ci NULL ,
+ `cw_statement_enemy` varchar(512) COLLATE latin1_general_ci NULL ,
+ PRIMARY KEY (`cw_id`)
+) ENGINE=MyISAM DEFAULT CHARSET='latin1';
+
+
+/* Create table in target */
+CREATE TABLE `datacubes`(
+ `cb_id` int(10) NOT NULL auto_increment ,
+ `cb_securitycode` char(30) COLLATE latin1_general_ci NULL ,
+ `cb_inscription` tinytext COLLATE latin1_general_ci NULL ,
+ PRIMARY KEY (`cb_id`)
+) ENGINE=MyISAM DEFAULT CHARSET='latin1';
+
+
+/* Alter table in target */
+ALTER TABLE `forum_posts`
+ CHANGE `fp_content` `fp_content` varchar(2048) COLLATE latin1_swedish_ci NOT NULL after `fp_fromid`,
+ ADD COLUMN `fp_factionid` int(2) NULL DEFAULT '0' after `fp_forumid`,
+ ADD COLUMN `fp_clanid` int(10) NULL DEFAULT '0' after `fp_factionid`, COMMENT='';
+
+/* Alter table in target */
+ALTER TABLE `guides`
+ ADD COLUMN `g_language` int(2) NULL after `g_title`,
+ CHANGE `g_content` `g_content` text COLLATE latin1_swedish_ci NOT NULL after `g_language`,
+ ADD COLUMN `g_chapter` int(1) NULL DEFAULT '0' after `g_content`,
+ ADD COLUMN `g_part` int(1) NULL DEFAULT '0' after `g_chapter`, COMMENT='';
+
+/* Create table in target */
+CREATE TABLE `moneytransactions`(
+ `mt_id` int(10) NOT NULL auto_increment ,
+ `mt_clanid` int(10) NULL DEFAULT '0' ,
+ `mt_amount` int(10) NULL DEFAULT '0' ,
+ `mt_player` int(10) NULL DEFAULT '0' ,
+ `mt_date` char(45) COLLATE latin1_general_ci NULL DEFAULT '2750-01-01 00:00:00' ,
+ `mt_comment` char(255) COLLATE latin1_general_ci NULL DEFAULT '0' ,
+ PRIMARY KEY (`mt_id`)
+) ENGINE=MyISAM DEFAULT CHARSET='latin1';
+
+
+/* Alter table in target */
+ALTER TABLE `neochronicle`
+ CHANGE `nc_content` `nc_content` text COLLATE latin1_swedish_ci NOT NULL after `nc_name`,
+ ADD COLUMN `nc_lang` int(2) NULL after `nc_datetime`,
+ ADD COLUMN `nc_approved` int(1) NULL DEFAULT '0' after `nc_lang`,
+ ADD COLUMN `nc_author` char(45) COLLATE latin1_swedish_ci NULL after `nc_approved`,
+ ADD COLUMN `nc_icon` int(10) NULL DEFAULT '0' after `nc_author`, COMMENT='';
+
+/* Alter table in target */
+ALTER TABLE `neocron articles`
+ CHANGE `na_content` `na_content` text COLLATE latin1_swedish_ci NOT NULL after `na_name`, COMMENT='';
+
+/* Create table in target */
+CREATE TABLE `npc_shop`(
+ `c_npc_id` int(11) NULL COMMENT 'The NPC WorldID' ,
+ `c_zoneid` int(11) NULL COMMENT 'The ZoneID in which the NPC is' ,
+ `c_itemid` int(11) NULL COMMENT 'ItemID for sale' ,
+ `c_itemprice` int(11) NULL COMMENT 'Price for this item'
+) ENGINE=MyISAM DEFAULT CHARSET='latin1';
+
+
+/* Alter table in target */
+ALTER TABLE `npc_spawns`
+ ADD COLUMN `npc_unknown` int(10) unsigned NOT NULL DEFAULT '0' after `npc_loot`,
+ ADD COLUMN `npc_trader` int(10) unsigned NOT NULL DEFAULT '0' after `npc_unknown`,
+ ADD COLUMN `npc_customname` varchar(80) COLLATE latin1_swedish_ci NULL after `npc_trader`,
+ ADD COLUMN `npc_customscript` varchar(100) COLLATE latin1_swedish_ci NULL after `npc_customname`,
+ ADD COLUMN `npc_shop_quality` int(3) NULL DEFAULT '50' COMMENT 'The quality of items if this npc has items to sell' after `npc_customscript`,
+ ADD COLUMN `npc_scripting` int(1) NULL DEFAULT '1' COMMENT '1: Scripts enabled 0: Scripts disabled' after `npc_shop_quality`, COMMENT='';
+
+/* Create table in target */
+CREATE TABLE `stockx_depots`(
+ `sxd_id` int(10) NOT NULL auto_increment ,
+ `sxd_playerid` int(10) NULL DEFAULT '0' ,
+ `sxd_st_id` int(10) NULL DEFAULT '0' ,
+ `sxd_amount` int(10) NULL DEFAULT '0' ,
+ `sxd_paid` int(10) NULL DEFAULT '0' ,
+ PRIMARY KEY (`sxd_id`)
+) ENGINE=MyISAM DEFAULT CHARSET='latin1';
+
+
+/* Create table in target */
+CREATE TABLE `support`(
+ `su_id` int(10) NOT NULL auto_increment ,
+ `su_player` int(10) NULL DEFAULT '0' ,
+ `su_datetime` varchar(45) COLLATE latin1_general_ci NULL ,
+ `su_supporterid` int(10) NULL DEFAULT '0' ,
+ `su_desc` char(255) COLLATE latin1_general_ci NULL ,
+ `su_type` int(1) NULL DEFAULT '0' ,
+ `su_worldid` int(10) NULL DEFAULT '0' ,
+ `su_inwork` int(1) NULL DEFAULT '0' ,
+ `su_finished` int(1) NULL DEFAULT '0' ,
+ PRIMARY KEY (`su_id`)
+) ENGINE=MyISAM DEFAULT CHARSET='latin1';
+
+
+/* Alter table in target */
+ALTER TABLE `vehicles`
+ ADD COLUMN `v_world` int(10) NULL DEFAULT '0' after `v_status`, COMMENT='';
+
+/* Create table in target */
+CREATE TABLE `worlds`(
+ `wr_id` int(10) NOT NULL DEFAULT '0' ,
+ `wr_group` int(10) NULL DEFAULT '0' ,
+ PRIMARY KEY (`wr_id`)
+) ENGINE=MyISAM DEFAULT CHARSET='latin1';
-This directory contains an UPDATE and a FULL DUMP\r
-for both InfoDB and GameDB.\r
-If you want to keep your data and just upgrade the structure,\r
-use\r
- patch_gamedb_rev7_to_rev8.sql\r
-\r
-to get up to date. However, it is recommended to use the FULL files\r
-to build a new database.\r
-\r
-Note: For TinNS, you'll have to apply "TinNS_GameDB_rev8_BaseData.sql"\r
-after creating the base-tables!\r
-\r
-See changes.txt for information about what has changed from DB7 to DB8
\ No newline at end of file
+This directory contains an UPDATE and a FULL DUMP
+for both InfoDB and GameDB.
+If you want to keep your data and just upgrade the structure,
+use
+ patch_gamedb_rev7_to_rev8.sql
+
+to get up to date. However, it is recommended to use the FULL files
+to build a new database.
+
+Note: For TinNS, you'll have to apply "TinNS_GameDB_rev8_BaseData.sql"
+after creating the base-tables!
+
+See changes.txt for information about what has changed from DB7 to DB8
-/*!40101 SET NAMES utf8 */;\r
-\r
-/*!40101 SET SQL_MODE=''*/;\r
-\r
-/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;\r
-/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;\r
-\r
-CREATE DATABASE /*!32312 IF NOT EXISTS*/`gameserver` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_general_ci */;\r
-\r
-USE `gameserver`;\r
-\r
-/*Table structure for table `apartments` */\r
-\r
-DROP TABLE IF EXISTS `apartments`;\r
-\r
-CREATE TABLE `apartments` (\r
- `apt_id` int(10) unsigned NOT NULL auto_increment,\r
- `apt_location` int(10) unsigned NOT NULL default '0',\r
- `apt_type` int(10) unsigned NOT NULL default '0',\r
- `apt_password` varchar(45) NOT NULL default '',\r
- `apt_owner` int(10) unsigned NOT NULL default '0',\r
- PRIMARY KEY (`apt_id`)\r
-) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;\r
-\r
-/*Table structure for table `buddy_list` */\r
-\r
-DROP TABLE IF EXISTS `buddy_list`;\r
-\r
-CREATE TABLE `buddy_list` (\r
- `bud_id` int(10) NOT NULL auto_increment,\r
- `bud_charid` int(10) NOT NULL default '0',\r
- `bud_buddyid` mediumint(10) NOT NULL default '0',\r
- PRIMARY KEY (`bud_id`)\r
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;\r
-\r
-/*Table structure for table `bug_report` */\r
-\r
-DROP TABLE IF EXISTS `bug_report`;\r
-\r
-CREATE TABLE `bug_report` (\r
- `br_id` int(10) unsigned NOT NULL auto_increment,\r
- `br_type` int(10) unsigned NOT NULL default '0' COMMENT 'Type',\r
- `br_desc` varchar(1024) NOT NULL COMMENT 'Description',\r
- `br_fromid` int(10) unsigned NOT NULL default '0' COMMENT 'Char ID of reporter',\r
- `br_location` int(10) unsigned NOT NULL default '0' COMMENT 'Location where problem occured',\r
- `br_status` int(10) unsigned NOT NULL default '0' COMMENT 'Status',\r
- `br_datetime` varchar(45) NOT NULL COMMENT 'Date/Time',\r
- `br_supid` int(10) unsigned NOT NULL default '0' COMMENT 'Supporter ID',\r
- PRIMARY KEY (`br_id`)\r
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;\r
-\r
-/*Table structure for table `characters` */\r
-\r
-DROP TABLE IF EXISTS `characters`;\r
-\r
-CREATE TABLE `characters` (\r
- `c_id` int(10) unsigned NOT NULL auto_increment,\r
- `c_name` varchar(45) default '',\r
- `c_str_lvl` int(10) unsigned default '0',\r
- `c_str_pts` int(10) unsigned default '0',\r
- `c_int_lvl` int(10) unsigned default '0',\r
- `c_int_pts` int(10) unsigned default '0',\r
- `c_dex_lvl` int(10) unsigned default '0',\r
- `c_dex_pts` int(10) unsigned default '0',\r
- `c_con_lvl` int(10) unsigned default '0',\r
- `c_con_pts` int(10) unsigned default '0',\r
- `c_psi_lvl` int(10) unsigned default '0',\r
- `c_psi_pts` int(10) unsigned default '0',\r
- `a_id` int(10) unsigned default '0',\r
- `c_class` int(10) unsigned default '0',\r
- `c_profession` int(10) unsigned default '0',\r
- `c_sex` int(10) unsigned default '0',\r
- `c_location` int(10) unsigned default '1',\r
- `c_mc` int(10) unsigned default '0',\r
- `c_hc` int(10) unsigned default '0',\r
- `c_tra` int(10) unsigned default '0',\r
- `c_pc` int(10) unsigned default '0',\r
- `c_rc` int(10) unsigned default '0',\r
- `c_tc` int(10) unsigned default '0',\r
- `c_vhc` int(10) unsigned default '0',\r
- `c_agl` int(10) unsigned default '0',\r
- `c_rep` int(10) unsigned default '0',\r
- `c_rec` int(10) unsigned default '0',\r
- `c_rcl` int(10) unsigned default '0',\r
- `c_atl` int(10) unsigned default '0',\r
- `c_end` int(10) unsigned default '0',\r
- `c_for` int(10) unsigned default '0',\r
- `c_fir` int(10) unsigned default '0',\r
- `c_enr` int(10) unsigned default '0',\r
- `c_xrr` int(10) unsigned default '0',\r
- `c_por` int(10) unsigned default '0',\r
- `c_htl` int(10) unsigned default '0',\r
- `c_hck` int(10) unsigned default '0',\r
- `c_brt` int(10) unsigned default '0',\r
- `c_psu` int(10) unsigned default '0',\r
- `c_wep` int(10) unsigned default '0',\r
- `c_cst` int(10) unsigned default '0',\r
- `c_res` int(10) unsigned default '0',\r
- `c_imp` int(10) unsigned default '0',\r
- `c_ppu` int(10) unsigned default '0',\r
- `c_apu` int(10) unsigned default '0',\r
- `c_mst` int(10) unsigned default '0',\r
- `c_ppw` int(10) unsigned default '0',\r
- `c_psr` int(10) unsigned default '0',\r
- `c_wpw` int(10) unsigned default '0',\r
- `c_apt` int(10) unsigned default '0',\r
- `c_cash` int(10) unsigned default '0',\r
- `c_head` int(10) unsigned default '0',\r
- `c_torso` int(10) unsigned default '0',\r
- `c_legs` int(10) unsigned default '0',\r
- `c_str_xp` float default '0',\r
- `c_int_xp` float default '0',\r
- `c_dex_xp` float default '0',\r
- `c_psi_xp` float default '0',\r
- `c_con_xp` float default '0',\r
- `c_pos_x` float NOT NULL default '0',\r
- `c_pos_y` float NOT NULL default '0',\r
- `c_pos_z` float NOT NULL default '0',\r
- `c_angle_ud` float NOT NULL default '0',\r
- `c_angle_lr` float NOT NULL default '0',\r
- `c_faction` int(10) unsigned NOT NULL default '0',\r
- `c_slot` smallint(5) unsigned NOT NULL default '0',\r
- `c_online` int(1) default '0',\r
- `c_clan` int(10) default '0',\r
- `c_soullight` int(3) default '10',\r
- PRIMARY KEY (`c_id`)\r
-) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;\r
-\r
-/*Table structure for table `clanlevels` */\r
-\r
-DROP TABLE IF EXISTS `clanlevels`;\r
-\r
-CREATE TABLE `clanlevels` (\r
- `cll_id` int(10) NOT NULL auto_increment,\r
- `cll_clanid` int(10) default '0',\r
- `cll_level` int(2) default '0',\r
- `cll_desc` char(255) collate latin1_general_ci default NULL,\r
- `cll_charid` int(10) default NULL,\r
- PRIMARY KEY (`cll_id`)\r
-) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;\r
-\r
-/*Table structure for table `clans` */\r
-\r
-DROP TABLE IF EXISTS `clans`;\r
-\r
-CREATE TABLE `clans` (\r
- `cl_id` int(10) unsigned NOT NULL auto_increment,\r
- `cl_shortdesc` char(16) collate latin1_general_ci default NULL,\r
- `cl_name` char(64) collate latin1_general_ci default NULL,\r
- `cl_faction` int(2) default NULL,\r
- `cl_description` varchar(256) collate latin1_general_ci default NULL,\r
- `cl_leader` int(10) default '0',\r
- `cl_money` int(10) default '0',\r
- `cl_minsympathy` int(3) default '70',\r
- `cl_appid` int(10) default '0',\r
- `cl_representative` int(10) default '0',\r
- PRIMARY KEY (`cl_id`)\r
-) ENGINE=MyISAM AUTO_INCREMENT=1002 DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;\r
-\r
-/*Table structure for table `clanwars` */\r
-\r
-DROP TABLE IF EXISTS `clanwars`;\r
-\r
-CREATE TABLE `clanwars` (\r
- `cw_id` int(10) NOT NULL auto_increment,\r
- `cw_initclan` int(10) default '0',\r
- `cw_enemyclan` int(10) default '0',\r
- `cw_starttime` varchar(45) collate latin1_general_ci default '',\r
- `cw_status` int(2) default '0',\r
- `cw_statement_initiator` varchar(512) collate latin1_general_ci default '',\r
- `cw_statement_enemy` varchar(512) collate latin1_general_ci default '',\r
- PRIMARY KEY (`cw_id`)\r
-) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;\r
-\r
-/*Table structure for table `contacts` */\r
-\r
-DROP TABLE IF EXISTS `contacts`;\r
-\r
-CREATE TABLE `contacts` (\r
- `c_id` int(10) unsigned NOT NULL auto_increment,\r
- `c_listid` int(10) unsigned NOT NULL default '0' COMMENT 'Who''s list?',\r
- `c_conid` int(10) unsigned NOT NULL default '0' COMMENT 'Char ID of person on list',\r
- `c_type` int(10) unsigned NOT NULL default '0' COMMENT '1=Personal, 2=Business, 3=Allied',\r
- `c_desc` varchar(256) NOT NULL,\r
- PRIMARY KEY (`c_id`)\r
-) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;\r
-\r
-/*Table structure for table `datacubes` */\r
-\r
-DROP TABLE IF EXISTS `datacubes`;\r
-\r
-CREATE TABLE `datacubes` (\r
- `cb_id` int(10) NOT NULL auto_increment,\r
- `cb_securitycode` char(30) collate latin1_general_ci default '',\r
- `cb_inscription` tinytext collate latin1_general_ci,\r
- PRIMARY KEY (`cb_id`)\r
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;\r
-\r
-/*Table structure for table `emails` */\r
-\r
-DROP TABLE IF EXISTS `emails`;\r
-\r
-CREATE TABLE `emails` (\r
- `e_id` int(10) unsigned NOT NULL auto_increment,\r
- `e_subject` varchar(128) NOT NULL default '',\r
- `e_fromid` int(10) unsigned NOT NULL default '0',\r
- `e_datetime` varchar(45) NOT NULL default '0',\r
- `e_toid` int(10) unsigned NOT NULL default '0',\r
- `e_body` varchar(512) NOT NULL,\r
- `e_new` tinyint(1) NOT NULL default '1',\r
- `e_replied` tinyint(1) NOT NULL default '0',\r
- PRIMARY KEY (`e_id`)\r
-) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;\r
-\r
-/*Table structure for table `forum_posts` */\r
-\r
-DROP TABLE IF EXISTS `forum_posts`;\r
-\r
-CREATE TABLE `forum_posts` (\r
- `fp_id` int(10) unsigned NOT NULL auto_increment,\r
- `fp_name` varchar(45) NOT NULL default '',\r
- `fp_fromid` int(10) unsigned NOT NULL default '0',\r
- `fp_content` varchar(2048) NOT NULL default '',\r
- `fp_datetime` varchar(45) NOT NULL default '',\r
- `fp_replyid` int(10) unsigned NOT NULL default '0',\r
- `fp_forumid` int(10) unsigned NOT NULL default '0',\r
- `fp_factionid` int(2) default '0',\r
- `fp_clanid` int(10) default '0',\r
- PRIMARY KEY (`fp_id`)\r
-) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;\r
-\r
-/*Table structure for table `forums` */\r
-\r
-DROP TABLE IF EXISTS `forums`;\r
-\r
-CREATE TABLE `forums` (\r
- `f_id` int(10) unsigned NOT NULL auto_increment,\r
- `f_name` varchar(45) NOT NULL default '',\r
- `f_area` int(10) unsigned NOT NULL default '0',\r
- `f_showname` varchar(45) NOT NULL default '',\r
- PRIMARY KEY (`f_id`)\r
-) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=latin1;\r
-\r
-/*Table structure for table `genrep` */\r
-\r
-DROP TABLE IF EXISTS `genrep`;\r
-\r
-CREATE TABLE `genrep` (\r
- `g_id` int(10) unsigned NOT NULL auto_increment,\r
- `g_worldid` int(10) unsigned NOT NULL default '0',\r
- `g_stationid` int(10) unsigned NOT NULL default '0',\r
- `g_charid` int(10) unsigned NOT NULL default '0',\r
- PRIMARY KEY (`g_id`)\r
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;\r
-\r
-/*Table structure for table `guides` */\r
-\r
-DROP TABLE IF EXISTS `guides`;\r
-\r
-CREATE TABLE `guides` (\r
- `g_id` int(10) unsigned NOT NULL auto_increment,\r
- `g_type` int(10) unsigned NOT NULL default '0',\r
- `g_title` varchar(45) NOT NULL default '',\r
- `g_language` int(2) default NULL,\r
- `g_content` text NOT NULL,\r
- `g_chapter` int(1) default '0',\r
- `g_part` int(1) default '0',\r
- PRIMARY KEY (`g_id`)\r
-) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;\r
-\r
-/*Table structure for table `inventory` */\r
-\r
-DROP TABLE IF EXISTS `inventory`;\r
-\r
-CREATE TABLE `inventory` (\r
- `inv_id` int(10) unsigned NOT NULL auto_increment,\r
- `inv_charid` int(10) unsigned NOT NULL default '0',\r
- `inv_loc` int(10) unsigned NOT NULL default '0',\r
- `inv_x` int(10) unsigned NOT NULL default '0',\r
- `inv_y` int(10) unsigned NOT NULL default '0',\r
- `inv_itemid` int(10) unsigned NOT NULL default '0',\r
- `inv_flag` int(10) unsigned NOT NULL default '0',\r
- `inv_qty` int(10) unsigned NOT NULL default '0',\r
- `inv_sqty` int(10) unsigned NOT NULL default '0',\r
- `inv_cdur` int(10) unsigned NOT NULL default '0',\r
- `inv_dmg` int(10) unsigned NOT NULL default '0',\r
- `inv_frq` int(10) unsigned NOT NULL default '0',\r
- `inv_hnd` int(10) unsigned NOT NULL default '0',\r
- `inv_rng` int(10) unsigned NOT NULL default '0',\r
- `inv_mdur` int(10) unsigned NOT NULL default '0',\r
- `inv_slots` int(10) unsigned NOT NULL default '0',\r
- `inv_slt1` int(10) unsigned NOT NULL default '0',\r
- `inv_slt2` int(10) unsigned NOT NULL default '0',\r
- `inv_slt3` int(10) unsigned NOT NULL default '0',\r
- `inv_slt4` int(10) unsigned NOT NULL default '0',\r
- `inv_slt5` int(10) unsigned NOT NULL default '0',\r
- `inv_atype` int(10) unsigned NOT NULL default '0',\r
- `inv_contain` int(10) unsigned NOT NULL default '0',\r
- PRIMARY KEY (`inv_id`)\r
-) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=latin1;\r
-\r
-/*Table structure for table `moneytransactions` */\r
-\r
-DROP TABLE IF EXISTS `moneytransactions`;\r
-\r
-CREATE TABLE `moneytransactions` (\r
- `mt_id` int(10) NOT NULL auto_increment,\r
- `mt_clanid` int(10) default '0',\r
- `mt_amount` int(10) default '0',\r
- `mt_player` int(10) default '0',\r
- `mt_date` char(45) collate latin1_general_ci default '2750-01-01 00:00:00',\r
- `mt_comment` char(255) collate latin1_general_ci default '0',\r
- PRIMARY KEY (`mt_id`)\r
-) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;\r
-\r
-/*Table structure for table `neochronicle` */\r
-\r
-DROP TABLE IF EXISTS `neochronicle`;\r
-\r
-CREATE TABLE `neochronicle` (\r
- `nc_id` int(10) unsigned NOT NULL auto_increment,\r
- `nc_name` varchar(45) NOT NULL default '',\r
- `nc_content` text NOT NULL,\r
- `nc_datetime` varchar(45) NOT NULL default '',\r
- `nc_lang` int(2) default NULL,\r
- `nc_approved` int(1) default '0',\r
- `nc_author` char(45) default '',\r
- `nc_icon` int(10) default '0',\r
- PRIMARY KEY (`nc_id`)\r
-) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1;\r
-\r
-/*Table structure for table `neocron articles` */\r
-\r
-DROP TABLE IF EXISTS `neocron articles`;\r
-\r
-CREATE TABLE `neocron articles` (\r
- `na_id` int(10) unsigned NOT NULL auto_increment,\r
- `na_datetime` varchar(45) NOT NULL default '',\r
- `na_author` varchar(45) NOT NULL default '0',\r
- `na_name` varchar(45) NOT NULL default '',\r
- `na_content` text NOT NULL,\r
- `na_approval` int(10) unsigned NOT NULL default '0',\r
- PRIMARY KEY (`na_id`)\r
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;\r
-\r
-/*Table structure for table `npc_shop` */\r
-\r
-DROP TABLE IF EXISTS `npc_shop`;\r
-\r
-CREATE TABLE `npc_shop` (\r
- `c_npc_id` int(11) default NULL COMMENT 'The NPC WorldID',\r
- `c_zoneid` int(11) default NULL COMMENT 'The ZoneID in which the NPC is',\r
- `c_itemid` int(11) default NULL COMMENT 'ItemID for sale',\r
- `c_itemprice` int(11) default NULL COMMENT 'Price for this item'\r
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;\r
-\r
-/*Table structure for table `npc_spawns` */\r
-\r
-DROP TABLE IF EXISTS `npc_spawns`;\r
-\r
-CREATE TABLE `npc_spawns` (\r
- `npc_id` int(10) unsigned NOT NULL auto_increment,\r
- `npc_worldid` int(10) unsigned NOT NULL default '0',\r
- `npc_nameid` int(10) unsigned NOT NULL default '0',\r
- `npc_typeid` int(10) unsigned NOT NULL default '0',\r
- `npc_name` varchar(45) NOT NULL default '',\r
- `npc_location` int(10) unsigned NOT NULL default '0',\r
- `npc_x` int(10) unsigned NOT NULL default '0',\r
- `npc_y` int(10) unsigned NOT NULL default '0',\r
- `npc_z` int(10) unsigned NOT NULL default '0',\r
- `npc_angle` int(11) NOT NULL default '0',\r
- `npc_clothing` int(10) unsigned NOT NULL default '0',\r
- `npc_loot` int(10) unsigned NOT NULL default '0',\r
- `npc_unknown` int(10) unsigned NOT NULL default '0',\r
- `npc_trader` int(10) unsigned NOT NULL default '0',\r
- `npc_customname` varchar(80) default NULL,\r
- `npc_customscript` varchar(100) default NULL,\r
- `npc_shop_quality` int(3) default '50' COMMENT 'The quality of items if this npc has items to sell',\r
- `npc_scripting` int(1) default '1' COMMENT '1: Scripts enabled 0: Scripts disabled',\r
- PRIMARY KEY (`npc_id`)\r
-) ENGINE=InnoDB AUTO_INCREMENT=9968 DEFAULT CHARSET=latin1;\r
-\r
-/*Table structure for table `outposts` */\r
-\r
-DROP TABLE IF EXISTS `outposts`;\r
-\r
-CREATE TABLE `outposts` (\r
- `o_id` int(10) unsigned NOT NULL auto_increment,\r
- `o_outnum` int(10) unsigned NOT NULL default '0',\r
- `o_security` int(10) unsigned NOT NULL default '0',\r
- `o_clan` int(10) unsigned NOT NULL default '0',\r
- `o_gr` int(10) unsigned NOT NULL default '0',\r
- PRIMARY KEY (`o_id`)\r
-) ENGINE=InnoDB AUTO_INCREMENT=2213 DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;\r
-\r
-/*Table structure for table `stockx` */\r
-\r
-DROP TABLE IF EXISTS `stockx`;\r
-\r
-CREATE TABLE `stockx` (\r
- `st_id` int(10) unsigned NOT NULL auto_increment,\r
- `st_factid` int(10) unsigned NOT NULL default '0',\r
- `st_curval` float NOT NULL default '0',\r
- `st_oldval` float NOT NULL default '0',\r
- PRIMARY KEY (`st_id`)\r
-) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=latin1;\r
-\r
-/*Table structure for table `stockx_depots` */\r
-\r
-DROP TABLE IF EXISTS `stockx_depots`;\r
-\r
-CREATE TABLE `stockx_depots` (\r
- `sxd_id` int(10) NOT NULL auto_increment,\r
- `sxd_playerid` int(10) default '0',\r
- `sxd_st_id` int(10) default '0',\r
- `sxd_amount` int(10) default '0',\r
- `sxd_paid` int(10) default '0',\r
- PRIMARY KEY (`sxd_id`)\r
-) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;\r
-\r
-/*Table structure for table `support` */\r
-\r
-DROP TABLE IF EXISTS `support`;\r
-\r
-CREATE TABLE `support` (\r
- `su_id` int(10) NOT NULL auto_increment,\r
- `su_player` int(10) default '0',\r
- `su_datetime` varchar(45) collate latin1_general_ci default '',\r
- `su_supporterid` int(10) default '0',\r
- `su_desc` char(255) collate latin1_general_ci default '',\r
- `su_type` int(1) default '0',\r
- `su_worldid` int(10) default '0',\r
- `su_inwork` int(1) default '0',\r
- `su_finished` int(1) default '0',\r
- PRIMARY KEY (`su_id`)\r
-) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;\r
-\r
-/*Table structure for table `vehicles` */\r
-\r
-DROP TABLE IF EXISTS `vehicles`;\r
-\r
-CREATE TABLE `vehicles` (\r
- `v_id` int(10) unsigned NOT NULL auto_increment,\r
- `v_owner` int(10) unsigned NOT NULL default '0',\r
- `v_type` int(10) unsigned NOT NULL default '0',\r
- `v_condition` int(10) unsigned NOT NULL default '0',\r
- `v_status` int(10) unsigned NOT NULL default '0',\r
- `v_world` int(10) default '0',\r
- PRIMARY KEY (`v_id`)\r
-) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;\r
-\r
-/*Table structure for table `world_actors` */\r
-\r
-DROP TABLE IF EXISTS `world_actors`;\r
-\r
-CREATE TABLE `world_actors` (\r
- `wa_id` int(10) unsigned NOT NULL auto_increment COMMENT 'Unique ID',\r
- `wa_actor_id` int(10) unsigned default NULL COMMENT 'u32 ID for the worldactor',\r
- `wa_actor_map` int(10) unsigned default NULL COMMENT 'World/Zone ID',\r
- `wa_actor_model` int(10) unsigned default NULL COMMENT 'ID of worldactor (pak_models.ini)',\r
- `wa_actor_type` int(10) unsigned default NULL COMMENT 'Function type of the actor',\r
- `wa_posX` int(10) unsigned default NULL,\r
- `wa_posY` int(10) unsigned default NULL,\r
- `wa_posZ` int(10) unsigned default NULL,\r
- `wa_rotX` int(10) unsigned default NULL,\r
- `wa_rotY` int(10) unsigned default NULL,\r
- `wa_rotZ` int(10) unsigned default NULL,\r
- `wa_option1` int(10) unsigned default NULL,\r
- `wa_option2` int(10) unsigned default NULL,\r
- `wa_option3` int(10) unsigned default NULL,\r
- PRIMARY KEY (`wa_id`)\r
-) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;\r
-\r
-/*Table structure for table `worlds` */\r
-\r
-DROP TABLE IF EXISTS `worlds`;\r
-\r
-CREATE TABLE `worlds` (\r
- `wr_id` int(10) NOT NULL default '0',\r
- `wr_group` int(10) default '0',\r
- PRIMARY KEY (`wr_id`)\r
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;\r
-\r
-\r
+/*!40101 SET NAMES utf8 */;
+
+/*!40101 SET SQL_MODE=''*/;
+
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
+
+CREATE DATABASE /*!32312 IF NOT EXISTS*/`gameserver` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_general_ci */;
+
+USE `gameserver`;
+
+/*Table structure for table `apartments` */
+
+DROP TABLE IF EXISTS `apartments`;
+
+CREATE TABLE `apartments` (
+ `apt_id` int(10) unsigned NOT NULL auto_increment,
+ `apt_location` int(10) unsigned NOT NULL default '0',
+ `apt_type` int(10) unsigned NOT NULL default '0',
+ `apt_password` varchar(45) NOT NULL default '',
+ `apt_owner` int(10) unsigned NOT NULL default '0',
+ PRIMARY KEY (`apt_id`)
+) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
+
+/*Table structure for table `buddy_list` */
+
+DROP TABLE IF EXISTS `buddy_list`;
+
+CREATE TABLE `buddy_list` (
+ `bud_id` int(10) NOT NULL auto_increment,
+ `bud_charid` int(10) NOT NULL default '0',
+ `bud_buddyid` mediumint(10) NOT NULL default '0',
+ PRIMARY KEY (`bud_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+/*Table structure for table `bug_report` */
+
+DROP TABLE IF EXISTS `bug_report`;
+
+CREATE TABLE `bug_report` (
+ `br_id` int(10) unsigned NOT NULL auto_increment,
+ `br_type` int(10) unsigned NOT NULL default '0' COMMENT 'Type',
+ `br_desc` varchar(1024) NOT NULL COMMENT 'Description',
+ `br_fromid` int(10) unsigned NOT NULL default '0' COMMENT 'Char ID of reporter',
+ `br_location` int(10) unsigned NOT NULL default '0' COMMENT 'Location where problem occured',
+ `br_status` int(10) unsigned NOT NULL default '0' COMMENT 'Status',
+ `br_datetime` varchar(45) NOT NULL COMMENT 'Date/Time',
+ `br_supid` int(10) unsigned NOT NULL default '0' COMMENT 'Supporter ID',
+ PRIMARY KEY (`br_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+/*Table structure for table `characters` */
+
+DROP TABLE IF EXISTS `characters`;
+
+CREATE TABLE `characters` (
+ `c_id` int(10) unsigned NOT NULL auto_increment,
+ `c_name` varchar(45) default '',
+ `c_str_lvl` int(10) unsigned default '0',
+ `c_str_pts` int(10) unsigned default '0',
+ `c_int_lvl` int(10) unsigned default '0',
+ `c_int_pts` int(10) unsigned default '0',
+ `c_dex_lvl` int(10) unsigned default '0',
+ `c_dex_pts` int(10) unsigned default '0',
+ `c_con_lvl` int(10) unsigned default '0',
+ `c_con_pts` int(10) unsigned default '0',
+ `c_psi_lvl` int(10) unsigned default '0',
+ `c_psi_pts` int(10) unsigned default '0',
+ `a_id` int(10) unsigned default '0',
+ `c_class` int(10) unsigned default '0',
+ `c_profession` int(10) unsigned default '0',
+ `c_sex` int(10) unsigned default '0',
+ `c_location` int(10) unsigned default '1',
+ `c_mc` int(10) unsigned default '0',
+ `c_hc` int(10) unsigned default '0',
+ `c_tra` int(10) unsigned default '0',
+ `c_pc` int(10) unsigned default '0',
+ `c_rc` int(10) unsigned default '0',
+ `c_tc` int(10) unsigned default '0',
+ `c_vhc` int(10) unsigned default '0',
+ `c_agl` int(10) unsigned default '0',
+ `c_rep` int(10) unsigned default '0',
+ `c_rec` int(10) unsigned default '0',
+ `c_rcl` int(10) unsigned default '0',
+ `c_atl` int(10) unsigned default '0',
+ `c_end` int(10) unsigned default '0',
+ `c_for` int(10) unsigned default '0',
+ `c_fir` int(10) unsigned default '0',
+ `c_enr` int(10) unsigned default '0',
+ `c_xrr` int(10) unsigned default '0',
+ `c_por` int(10) unsigned default '0',
+ `c_htl` int(10) unsigned default '0',
+ `c_hck` int(10) unsigned default '0',
+ `c_brt` int(10) unsigned default '0',
+ `c_psu` int(10) unsigned default '0',
+ `c_wep` int(10) unsigned default '0',
+ `c_cst` int(10) unsigned default '0',
+ `c_res` int(10) unsigned default '0',
+ `c_imp` int(10) unsigned default '0',
+ `c_ppu` int(10) unsigned default '0',
+ `c_apu` int(10) unsigned default '0',
+ `c_mst` int(10) unsigned default '0',
+ `c_ppw` int(10) unsigned default '0',
+ `c_psr` int(10) unsigned default '0',
+ `c_wpw` int(10) unsigned default '0',
+ `c_apt` int(10) unsigned default '0',
+ `c_cash` int(10) unsigned default '0',
+ `c_head` int(10) unsigned default '0',
+ `c_torso` int(10) unsigned default '0',
+ `c_legs` int(10) unsigned default '0',
+ `c_str_xp` float default '0',
+ `c_int_xp` float default '0',
+ `c_dex_xp` float default '0',
+ `c_psi_xp` float default '0',
+ `c_con_xp` float default '0',
+ `c_pos_x` float NOT NULL default '0',
+ `c_pos_y` float NOT NULL default '0',
+ `c_pos_z` float NOT NULL default '0',
+ `c_angle_ud` float NOT NULL default '0',
+ `c_angle_lr` float NOT NULL default '0',
+ `c_faction` int(10) unsigned NOT NULL default '0',
+ `c_slot` smallint(5) unsigned NOT NULL default '0',
+ `c_online` int(1) default '0',
+ `c_clan` int(10) default '0',
+ `c_soullight` int(3) default '10',
+ PRIMARY KEY (`c_id`)
+) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
+
+/*Table structure for table `clanlevels` */
+
+DROP TABLE IF EXISTS `clanlevels`;
+
+CREATE TABLE `clanlevels` (
+ `cll_id` int(10) NOT NULL auto_increment,
+ `cll_clanid` int(10) default '0',
+ `cll_level` int(2) default '0',
+ `cll_desc` char(255) collate latin1_general_ci default NULL,
+ `cll_charid` int(10) default NULL,
+ PRIMARY KEY (`cll_id`)
+) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
+
+/*Table structure for table `clans` */
+
+DROP TABLE IF EXISTS `clans`;
+
+CREATE TABLE `clans` (
+ `cl_id` int(10) unsigned NOT NULL auto_increment,
+ `cl_shortdesc` char(16) collate latin1_general_ci default NULL,
+ `cl_name` char(64) collate latin1_general_ci default NULL,
+ `cl_faction` int(2) default NULL,
+ `cl_description` varchar(256) collate latin1_general_ci default NULL,
+ `cl_leader` int(10) default '0',
+ `cl_money` int(10) default '0',
+ `cl_minsympathy` int(3) default '70',
+ `cl_appid` int(10) default '0',
+ `cl_representative` int(10) default '0',
+ PRIMARY KEY (`cl_id`)
+) ENGINE=MyISAM AUTO_INCREMENT=1002 DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
+
+/*Table structure for table `clanwars` */
+
+DROP TABLE IF EXISTS `clanwars`;
+
+CREATE TABLE `clanwars` (
+ `cw_id` int(10) NOT NULL auto_increment,
+ `cw_initclan` int(10) default '0',
+ `cw_enemyclan` int(10) default '0',
+ `cw_starttime` varchar(45) collate latin1_general_ci default '',
+ `cw_status` int(2) default '0',
+ `cw_statement_initiator` varchar(512) collate latin1_general_ci default '',
+ `cw_statement_enemy` varchar(512) collate latin1_general_ci default '',
+ PRIMARY KEY (`cw_id`)
+) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
+
+/*Table structure for table `contacts` */
+
+DROP TABLE IF EXISTS `contacts`;
+
+CREATE TABLE `contacts` (
+ `c_id` int(10) unsigned NOT NULL auto_increment,
+ `c_listid` int(10) unsigned NOT NULL default '0' COMMENT 'Who''s list?',
+ `c_conid` int(10) unsigned NOT NULL default '0' COMMENT 'Char ID of person on list',
+ `c_type` int(10) unsigned NOT NULL default '0' COMMENT '1=Personal, 2=Business, 3=Allied',
+ `c_desc` varchar(256) NOT NULL,
+ PRIMARY KEY (`c_id`)
+) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
+
+/*Table structure for table `datacubes` */
+
+DROP TABLE IF EXISTS `datacubes`;
+
+CREATE TABLE `datacubes` (
+ `cb_id` int(10) NOT NULL auto_increment,
+ `cb_securitycode` char(30) collate latin1_general_ci default '',
+ `cb_inscription` tinytext collate latin1_general_ci,
+ PRIMARY KEY (`cb_id`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
+
+/*Table structure for table `emails` */
+
+DROP TABLE IF EXISTS `emails`;
+
+CREATE TABLE `emails` (
+ `e_id` int(10) unsigned NOT NULL auto_increment,
+ `e_subject` varchar(128) NOT NULL default '',
+ `e_fromid` int(10) unsigned NOT NULL default '0',
+ `e_datetime` varchar(45) NOT NULL default '0',
+ `e_toid` int(10) unsigned NOT NULL default '0',
+ `e_body` varchar(512) NOT NULL,
+ `e_new` tinyint(1) NOT NULL default '1',
+ `e_replied` tinyint(1) NOT NULL default '0',
+ PRIMARY KEY (`e_id`)
+) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
+
+/*Table structure for table `forum_posts` */
+
+DROP TABLE IF EXISTS `forum_posts`;
+
+CREATE TABLE `forum_posts` (
+ `fp_id` int(10) unsigned NOT NULL auto_increment,
+ `fp_name` varchar(45) NOT NULL default '',
+ `fp_fromid` int(10) unsigned NOT NULL default '0',
+ `fp_content` varchar(2048) NOT NULL default '',
+ `fp_datetime` varchar(45) NOT NULL default '',
+ `fp_replyid` int(10) unsigned NOT NULL default '0',
+ `fp_forumid` int(10) unsigned NOT NULL default '0',
+ `fp_factionid` int(2) default '0',
+ `fp_clanid` int(10) default '0',
+ PRIMARY KEY (`fp_id`)
+) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
+
+/*Table structure for table `forums` */
+
+DROP TABLE IF EXISTS `forums`;
+
+CREATE TABLE `forums` (
+ `f_id` int(10) unsigned NOT NULL auto_increment,
+ `f_name` varchar(45) NOT NULL default '',
+ `f_area` int(10) unsigned NOT NULL default '0',
+ `f_showname` varchar(45) NOT NULL default '',
+ PRIMARY KEY (`f_id`)
+) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=latin1;
+
+/*Table structure for table `genrep` */
+
+DROP TABLE IF EXISTS `genrep`;
+
+CREATE TABLE `genrep` (
+ `g_id` int(10) unsigned NOT NULL auto_increment,
+ `g_worldid` int(10) unsigned NOT NULL default '0',
+ `g_stationid` int(10) unsigned NOT NULL default '0',
+ `g_charid` int(10) unsigned NOT NULL default '0',
+ PRIMARY KEY (`g_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+/*Table structure for table `guides` */
+
+DROP TABLE IF EXISTS `guides`;
+
+CREATE TABLE `guides` (
+ `g_id` int(10) unsigned NOT NULL auto_increment,
+ `g_type` int(10) unsigned NOT NULL default '0',
+ `g_title` varchar(45) NOT NULL default '',
+ `g_language` int(2) default NULL,
+ `g_content` text NOT NULL,
+ `g_chapter` int(1) default '0',
+ `g_part` int(1) default '0',
+ PRIMARY KEY (`g_id`)
+) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
+
+/*Table structure for table `inventory` */
+
+DROP TABLE IF EXISTS `inventory`;
+
+CREATE TABLE `inventory` (
+ `inv_id` int(10) unsigned NOT NULL auto_increment,
+ `inv_charid` int(10) unsigned NOT NULL default '0',
+ `inv_loc` int(10) unsigned NOT NULL default '0',
+ `inv_x` int(10) unsigned NOT NULL default '0',
+ `inv_y` int(10) unsigned NOT NULL default '0',
+ `inv_itemid` int(10) unsigned NOT NULL default '0',
+ `inv_flag` int(10) unsigned NOT NULL default '0',
+ `inv_qty` int(10) unsigned NOT NULL default '0',
+ `inv_sqty` int(10) unsigned NOT NULL default '0',
+ `inv_cdur` int(10) unsigned NOT NULL default '0',
+ `inv_dmg` int(10) unsigned NOT NULL default '0',
+ `inv_frq` int(10) unsigned NOT NULL default '0',
+ `inv_hnd` int(10) unsigned NOT NULL default '0',
+ `inv_rng` int(10) unsigned NOT NULL default '0',
+ `inv_mdur` int(10) unsigned NOT NULL default '0',
+ `inv_slots` int(10) unsigned NOT NULL default '0',
+ `inv_slt1` int(10) unsigned NOT NULL default '0',
+ `inv_slt2` int(10) unsigned NOT NULL default '0',
+ `inv_slt3` int(10) unsigned NOT NULL default '0',
+ `inv_slt4` int(10) unsigned NOT NULL default '0',
+ `inv_slt5` int(10) unsigned NOT NULL default '0',
+ `inv_atype` int(10) unsigned NOT NULL default '0',
+ `inv_contain` int(10) unsigned NOT NULL default '0',
+ PRIMARY KEY (`inv_id`)
+) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=latin1;
+
+/*Table structure for table `moneytransactions` */
+
+DROP TABLE IF EXISTS `moneytransactions`;
+
+CREATE TABLE `moneytransactions` (
+ `mt_id` int(10) NOT NULL auto_increment,
+ `mt_clanid` int(10) default '0',
+ `mt_amount` int(10) default '0',
+ `mt_player` int(10) default '0',
+ `mt_date` char(45) collate latin1_general_ci default '2750-01-01 00:00:00',
+ `mt_comment` char(255) collate latin1_general_ci default '0',
+ PRIMARY KEY (`mt_id`)
+) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
+
+/*Table structure for table `neochronicle` */
+
+DROP TABLE IF EXISTS `neochronicle`;
+
+CREATE TABLE `neochronicle` (
+ `nc_id` int(10) unsigned NOT NULL auto_increment,
+ `nc_name` varchar(45) NOT NULL default '',
+ `nc_content` text NOT NULL,
+ `nc_datetime` varchar(45) NOT NULL default '',
+ `nc_lang` int(2) default NULL,
+ `nc_approved` int(1) default '0',
+ `nc_author` char(45) default '',
+ `nc_icon` int(10) default '0',
+ PRIMARY KEY (`nc_id`)
+) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1;
+
+/*Table structure for table `neocron articles` */
+
+DROP TABLE IF EXISTS `neocron articles`;
+
+CREATE TABLE `neocron articles` (
+ `na_id` int(10) unsigned NOT NULL auto_increment,
+ `na_datetime` varchar(45) NOT NULL default '',
+ `na_author` varchar(45) NOT NULL default '0',
+ `na_name` varchar(45) NOT NULL default '',
+ `na_content` text NOT NULL,
+ `na_approval` int(10) unsigned NOT NULL default '0',
+ PRIMARY KEY (`na_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+/*Table structure for table `npc_shop` */
+
+DROP TABLE IF EXISTS `npc_shop`;
+
+CREATE TABLE `npc_shop` (
+ `c_npc_id` int(11) default NULL COMMENT 'The NPC WorldID',
+ `c_zoneid` int(11) default NULL COMMENT 'The ZoneID in which the NPC is',
+ `c_itemid` int(11) default NULL COMMENT 'ItemID for sale',
+ `c_itemprice` int(11) default NULL COMMENT 'Price for this item'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
+
+/*Table structure for table `npc_spawns` */
+
+DROP TABLE IF EXISTS `npc_spawns`;
+
+CREATE TABLE `npc_spawns` (
+ `npc_id` int(10) unsigned NOT NULL auto_increment,
+ `npc_worldid` int(10) unsigned NOT NULL default '0',
+ `npc_nameid` int(10) unsigned NOT NULL default '0',
+ `npc_typeid` int(10) unsigned NOT NULL default '0',
+ `npc_name` varchar(45) NOT NULL default '',
+ `npc_location` int(10) unsigned NOT NULL default '0',
+ `npc_x` int(10) unsigned NOT NULL default '0',
+ `npc_y` int(10) unsigned NOT NULL default '0',
+ `npc_z` int(10) unsigned NOT NULL default '0',
+ `npc_angle` int(11) NOT NULL default '0',
+ `npc_clothing` int(10) unsigned NOT NULL default '0',
+ `npc_loot` int(10) unsigned NOT NULL default '0',
+ `npc_unknown` int(10) unsigned NOT NULL default '0',
+ `npc_trader` int(10) unsigned NOT NULL default '0',
+ `npc_customname` varchar(80) default NULL,
+ `npc_customscript` varchar(100) default NULL,
+ `npc_shop_quality` int(3) default '50' COMMENT 'The quality of items if this npc has items to sell',
+ `npc_scripting` int(1) default '1' COMMENT '1: Scripts enabled 0: Scripts disabled',
+ PRIMARY KEY (`npc_id`)
+) ENGINE=InnoDB AUTO_INCREMENT=9968 DEFAULT CHARSET=latin1;
+
+/*Table structure for table `outposts` */
+
+DROP TABLE IF EXISTS `outposts`;
+
+CREATE TABLE `outposts` (
+ `o_id` int(10) unsigned NOT NULL auto_increment,
+ `o_outnum` int(10) unsigned NOT NULL default '0',
+ `o_security` int(10) unsigned NOT NULL default '0',
+ `o_clan` int(10) unsigned NOT NULL default '0',
+ `o_gr` int(10) unsigned NOT NULL default '0',
+ PRIMARY KEY (`o_id`)
+) ENGINE=InnoDB AUTO_INCREMENT=2213 DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
+
+/*Table structure for table `stockx` */
+
+DROP TABLE IF EXISTS `stockx`;
+
+CREATE TABLE `stockx` (
+ `st_id` int(10) unsigned NOT NULL auto_increment,
+ `st_factid` int(10) unsigned NOT NULL default '0',
+ `st_curval` float NOT NULL default '0',
+ `st_oldval` float NOT NULL default '0',
+ PRIMARY KEY (`st_id`)
+) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=latin1;
+
+/*Table structure for table `stockx_depots` */
+
+DROP TABLE IF EXISTS `stockx_depots`;
+
+CREATE TABLE `stockx_depots` (
+ `sxd_id` int(10) NOT NULL auto_increment,
+ `sxd_playerid` int(10) default '0',
+ `sxd_st_id` int(10) default '0',
+ `sxd_amount` int(10) default '0',
+ `sxd_paid` int(10) default '0',
+ PRIMARY KEY (`sxd_id`)
+) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
+
+/*Table structure for table `support` */
+
+DROP TABLE IF EXISTS `support`;
+
+CREATE TABLE `support` (
+ `su_id` int(10) NOT NULL auto_increment,
+ `su_player` int(10) default '0',
+ `su_datetime` varchar(45) collate latin1_general_ci default '',
+ `su_supporterid` int(10) default '0',
+ `su_desc` char(255) collate latin1_general_ci default '',
+ `su_type` int(1) default '0',
+ `su_worldid` int(10) default '0',
+ `su_inwork` int(1) default '0',
+ `su_finished` int(1) default '0',
+ PRIMARY KEY (`su_id`)
+) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
+
+/*Table structure for table `vehicles` */
+
+DROP TABLE IF EXISTS `vehicles`;
+
+CREATE TABLE `vehicles` (
+ `v_id` int(10) unsigned NOT NULL auto_increment,
+ `v_owner` int(10) unsigned NOT NULL default '0',
+ `v_type` int(10) unsigned NOT NULL default '0',
+ `v_condition` int(10) unsigned NOT NULL default '0',
+ `v_status` int(10) unsigned NOT NULL default '0',
+ `v_world` int(10) default '0',
+ PRIMARY KEY (`v_id`)
+) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
+
+/*Table structure for table `world_actors` */
+
+DROP TABLE IF EXISTS `world_actors`;
+
+CREATE TABLE `world_actors` (
+ `wa_id` int(10) unsigned NOT NULL auto_increment COMMENT 'Unique ID',
+ `wa_actor_id` int(10) unsigned default NULL COMMENT 'u32 ID for the worldactor',
+ `wa_actor_map` int(10) unsigned default NULL COMMENT 'World/Zone ID',
+ `wa_actor_model` int(10) unsigned default NULL COMMENT 'ID of worldactor (pak_models.ini)',
+ `wa_actor_type` int(10) unsigned default NULL COMMENT 'Function type of the actor',
+ `wa_posX` int(10) unsigned default NULL,
+ `wa_posY` int(10) unsigned default NULL,
+ `wa_posZ` int(10) unsigned default NULL,
+ `wa_rotX` int(10) unsigned default NULL,
+ `wa_rotY` int(10) unsigned default NULL,
+ `wa_rotZ` int(10) unsigned default NULL,
+ `wa_option1` int(10) unsigned default NULL,
+ `wa_option2` int(10) unsigned default NULL,
+ `wa_option3` int(10) unsigned default NULL,
+ PRIMARY KEY (`wa_id`)
+) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
+
+/*Table structure for table `worlds` */
+
+DROP TABLE IF EXISTS `worlds`;
+
+CREATE TABLE `worlds` (
+ `wr_id` int(10) NOT NULL default '0',
+ `wr_group` int(10) default '0',
+ PRIMARY KEY (`wr_id`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
+
+
-/*\r
-SQLyog Enterprise - MySQL GUI v7.1 \r
-MySQL - 5.0.51a-24+lenny2 : Database - infoserver\r
-*********************************************************************\r
-*/\r\r
-\r
-/*!40101 SET NAMES utf8 */;\r
-\r
-/*!40101 SET SQL_MODE=''*/;\r
-\r
-/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;\r
-/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;\r
-\r
-CREATE DATABASE /*!32312 IF NOT EXISTS*/`infoserver` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_general_ci */;\r
-\r
-USE `infoserver`;\r
-\r
-/*Table structure for table `accounts` */\r
-\r
-DROP TABLE IF EXISTS `accounts`;\r
-\r
-CREATE TABLE `accounts` (\r
- `a_id` int(10) unsigned NOT NULL auto_increment,\r
- `a_username` varchar(45) NOT NULL default '',\r
- `a_password` varchar(45) NOT NULL default '',\r
- `a_priv` int(10) unsigned default '0',\r
- `a_status` int(10) unsigned default '0',\r
- `a_bandate` int(11) unsigned NOT NULL default '0',\r
- `a_emailaddress` varchar(255) NOT NULL,\r
- `a_creationdate` datetime NOT NULL default '0000-00-00 00:00:00',\r
- `a_lastused` datetime NOT NULL default '0000-00-00 00:00:00',\r
- PRIMARY KEY (`a_id`)\r
-) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;\r
-\r
-/*Table structure for table `server_list` */\r
-\r
-DROP TABLE IF EXISTS `server_list`;\r
-\r
-CREATE TABLE `server_list` (\r
- `s_id` int(10) unsigned NOT NULL auto_increment,\r
- `s_name` varchar(15) NOT NULL default 'NC server',\r
- `s_wanaddr` varchar(15) NOT NULL default '127.0.0.1',\r
- `s_port` int(10) unsigned NOT NULL default '12000',\r
- `s_players` int(10) unsigned NOT NULL default '0',\r
- `s_lastupdate` datetime NOT NULL default '0000-00-00 00:00:00',\r
- `s_lanaddr` varchar(15) NOT NULL default '127.0.0.1',\r
- PRIMARY KEY (`s_id`)\r
-) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;\r
-\r
-/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;\r
-/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;\r
+/*
+SQLyog Enterprise - MySQL GUI v7.1
+MySQL - 5.0.51a-24+lenny2 : Database - infoserver
+*********************************************************************
+*/+
+
+/*!40101 SET NAMES utf8 */;
+
+/*!40101 SET SQL_MODE=''*/;
+
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
+
+CREATE DATABASE /*!32312 IF NOT EXISTS*/`infoserver` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_general_ci */;
+
+USE `infoserver`;
+
+/*Table structure for table `accounts` */
+
+DROP TABLE IF EXISTS `accounts`;
+
+CREATE TABLE `accounts` (
+ `a_id` int(10) unsigned NOT NULL auto_increment,
+ `a_username` varchar(45) NOT NULL default '',
+ `a_password` varchar(45) NOT NULL default '',
+ `a_priv` int(10) unsigned default '0',
+ `a_status` int(10) unsigned default '0',
+ `a_bandate` int(11) unsigned NOT NULL default '0',
+ `a_emailaddress` varchar(255) NOT NULL,
+ `a_creationdate` datetime NOT NULL default '0000-00-00 00:00:00',
+ `a_lastused` datetime NOT NULL default '0000-00-00 00:00:00',
+ PRIMARY KEY (`a_id`)
+) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
+
+/*Table structure for table `server_list` */
+
+DROP TABLE IF EXISTS `server_list`;
+
+CREATE TABLE `server_list` (
+ `s_id` int(10) unsigned NOT NULL auto_increment,
+ `s_name` varchar(15) NOT NULL default 'NC server',
+ `s_wanaddr` varchar(15) NOT NULL default '127.0.0.1',
+ `s_port` int(10) unsigned NOT NULL default '12000',
+ `s_players` int(10) unsigned NOT NULL default '0',
+ `s_lastupdate` datetime NOT NULL default '0000-00-00 00:00:00',
+ `s_lanaddr` varchar(15) NOT NULL default '127.0.0.1',
+ PRIMARY KEY (`s_id`)
+) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
+
+/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
+/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
--- Database: `gameserver`\r
---\r
--- New stuff for NPC Subsystem\r
---\r
-USE `gameserver`;\r
-\r
--- --------------------------------------------------------\r
-\r
---\r
--- Table structure for table `npc_spawns`\r
---\r
-\r
-DROP TABLE IF EXISTS `npc_spawns`;\r
-SET @saved_cs_client = @@character_set_client;\r
-SET character_set_client = utf8;\r
-CREATE TABLE `npc_spawns` (\r
- `npc_id` int(10) unsigned NOT NULL AUTO_INCREMENT,\r
- `npc_worldid` int(10) unsigned NOT NULL DEFAULT '0',\r
- `npc_nameid` int(10) unsigned NOT NULL DEFAULT '0',\r
- `npc_typeid` int(10) unsigned NOT NULL DEFAULT '0',\r
- `npc_name` varchar(45) NOT NULL DEFAULT '',\r
- `npc_location` int(10) unsigned NOT NULL DEFAULT '0',\r
- `npc_x` int(10) unsigned NOT NULL DEFAULT '0',\r
- `npc_y` int(10) unsigned NOT NULL DEFAULT '0',\r
- `npc_z` int(10) unsigned NOT NULL DEFAULT '0',\r
- `npc_angle` int(11) NOT NULL DEFAULT '0',\r
- `npc_clothing` int(10) unsigned NOT NULL DEFAULT '0',\r
- `npc_loot` int(10) unsigned NOT NULL DEFAULT '0',\r
- `npc_unknown` int(10) unsigned NOT NULL DEFAULT '0',\r
- `npc_trader` int(10) unsigned NOT NULL DEFAULT '0',\r
- `npc_customname` varchar(80) DEFAULT NULL,\r
- `npc_customscript` varchar(100) DEFAULT NULL,\r
- `npc_shop_quality` int(3) DEFAULT '50' NULL COMMENT 'The quality of items if this npc has items to sell',\r
- PRIMARY KEY (`npc_id`)\r
-) ENGINE=InnoDB AUTO_INCREMENT=9916 DEFAULT CHARSET=latin1;\r
-SET character_set_client = @saved_cs_client;\r
-\r
---\r
--- Dumping data for table `npc_spawns`\r
---\r
-\r
-LOCK TABLES `npc_spawns` WRITE;\r
-/*!40000 ALTER TABLE `npc_spawns` DISABLE KEYS */;\r
-INSERT INTO `npc_spawns` (npc_worldid, npc_nameid, npc_typeid, npc_name, npc_location, npc_x, npc_y, npc_z, npc_angle, npc_clothing, npc_unknown, npc_trader, npc_customname)\r
-VALUES \r
-(1020,385,61093,'WSK',1,33808,31332,32512,30,6612,8814,0,'Event Info'),\r
-(1020,388,17634,'WSK',3,30063,34111,33136,90,6616,14035,0,'Event Info'),\r
-(1018,387,32772,'WSK',101,31938,32165,32512,130,6616,16675,0,'Event Info'),\r
-(1019,215,50585,'WSK',101,34209,33864,32512,359,197,19499,195,NULL),\r
-(1020,385,13542,'WSK',101,33261,33113,32672,2,4342,17892,0,'VotR Paperboy'),\r
-(1019,389,10890,'WSK',401,31105,32463,31936,92,6613,14572,0,'Event Info'),\r
-(1020,1629,26858,'WSK',401,31265,30718,31952,177,2827,12567,0,NULL),\r
-(976,2818,15528,'WSK',2071,23436,21380,35220,185,7214,9785,0,NULL),\r
-(971,386,5040,'WSK',2181,38000,24127,33854,264,6622,2590,0,NULL),\r
-(1020,836,43282,'MBOTFLY',2181,43068,26020,34020,0,31788,405,0,NULL),\r
-(988,836,41913,'MBOTFLY',2181,41537,28260,33860,0,50146,380,0,NULL),\r
-(1006,800,15709,'MBOT',2181,42047,28256,33786,0,14348,220,0,NULL),\r
-(1005,800,28598,'MBOT',2181,44419,23412,33445,0,8332,585,0,NULL),\r
-(1014,672,28153,'DOGBOT',2181,38041,29414,34088,0,21948,221,0,NULL),\r
-(984,677,32746,'WBADGUY',2181,37985,31043,33939,0,21616,222,0,NULL),\r
-(973,606,26878,'MUTANTB',2181,26220,27158,34106,0,20679,490,0,NULL),\r
-(975,800,11783,'MBOT',2181,31285,23969,33970,0,722,38,0,NULL),\r
-(981,640,61001,'FLYMUT',2181,26672,26657,34281,0,20684,1510,0,NULL),\r
-(985,610,1100,'MGMUT',2181,28040,26301,34083,0,21559,628,0,NULL),\r
-(986,640,1159,'FLYMUT',2181,27424,27264,34328,0,21560,1503,0,NULL),\r
-(987,626,53397,'MUTANTB',2181,26386,27672,34135,0,20680,407,0,NULL),\r
-(999,602,19865,'MUTANTB',2181,26771,26119,34228,0,21559,271,0,NULL),\r
-(1003,730,39449,'BROBOT',2181,25425,32173,34055,0,20939,4285,0,NULL);\r
-/*!40000 ALTER TABLE `npc_spawns` \r
-ENABLE KEYS */;\r
-UNLOCK TABLES;\r
-\r
-DROP TABLE IF EXISTS `npc_shop`;\r
-CREATE TABLE `npc_shop`(\r
- `c_npc_id` int COMMENT 'The NPC WorldID',\r
- `c_zoneid` int COMMENT 'The ZoneID in which the NPC is',\r
- `c_itemid` int COMMENT 'ItemID for sale',\r
- `c_itemprice` int COMMENT 'Price for this item');
\ No newline at end of file
+-- Database: `gameserver`
+--
+-- New stuff for NPC Subsystem
+--
+USE `gameserver`;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `npc_spawns`
+--
+
+DROP TABLE IF EXISTS `npc_spawns`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `npc_spawns` (
+ `npc_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `npc_worldid` int(10) unsigned NOT NULL DEFAULT '0',
+ `npc_nameid` int(10) unsigned NOT NULL DEFAULT '0',
+ `npc_typeid` int(10) unsigned NOT NULL DEFAULT '0',
+ `npc_name` varchar(45) NOT NULL DEFAULT '',
+ `npc_location` int(10) unsigned NOT NULL DEFAULT '0',
+ `npc_x` int(10) unsigned NOT NULL DEFAULT '0',
+ `npc_y` int(10) unsigned NOT NULL DEFAULT '0',
+ `npc_z` int(10) unsigned NOT NULL DEFAULT '0',
+ `npc_angle` int(11) NOT NULL DEFAULT '0',
+ `npc_clothing` int(10) unsigned NOT NULL DEFAULT '0',
+ `npc_loot` int(10) unsigned NOT NULL DEFAULT '0',
+ `npc_unknown` int(10) unsigned NOT NULL DEFAULT '0',
+ `npc_trader` int(10) unsigned NOT NULL DEFAULT '0',
+ `npc_customname` varchar(80) DEFAULT NULL,
+ `npc_customscript` varchar(100) DEFAULT NULL,
+ `npc_shop_quality` int(3) DEFAULT '50' NULL COMMENT 'The quality of items if this npc has items to sell',
+ PRIMARY KEY (`npc_id`)
+) ENGINE=InnoDB AUTO_INCREMENT=9916 DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Dumping data for table `npc_spawns`
+--
+
+LOCK TABLES `npc_spawns` WRITE;
+/*!40000 ALTER TABLE `npc_spawns` DISABLE KEYS */;
+INSERT INTO `npc_spawns` (npc_worldid, npc_nameid, npc_typeid, npc_name, npc_location, npc_x, npc_y, npc_z, npc_angle, npc_clothing, npc_unknown, npc_trader, npc_customname)
+VALUES
+(1020,385,61093,'WSK',1,33808,31332,32512,30,6612,8814,0,'Event Info'),
+(1020,388,17634,'WSK',3,30063,34111,33136,90,6616,14035,0,'Event Info'),
+(1018,387,32772,'WSK',101,31938,32165,32512,130,6616,16675,0,'Event Info'),
+(1019,215,50585,'WSK',101,34209,33864,32512,359,197,19499,195,NULL),
+(1020,385,13542,'WSK',101,33261,33113,32672,2,4342,17892,0,'VotR Paperboy'),
+(1019,389,10890,'WSK',401,31105,32463,31936,92,6613,14572,0,'Event Info'),
+(1020,1629,26858,'WSK',401,31265,30718,31952,177,2827,12567,0,NULL),
+(976,2818,15528,'WSK',2071,23436,21380,35220,185,7214,9785,0,NULL),
+(971,386,5040,'WSK',2181,38000,24127,33854,264,6622,2590,0,NULL),
+(1020,836,43282,'MBOTFLY',2181,43068,26020,34020,0,31788,405,0,NULL),
+(988,836,41913,'MBOTFLY',2181,41537,28260,33860,0,50146,380,0,NULL),
+(1006,800,15709,'MBOT',2181,42047,28256,33786,0,14348,220,0,NULL),
+(1005,800,28598,'MBOT',2181,44419,23412,33445,0,8332,585,0,NULL),
+(1014,672,28153,'DOGBOT',2181,38041,29414,34088,0,21948,221,0,NULL),
+(984,677,32746,'WBADGUY',2181,37985,31043,33939,0,21616,222,0,NULL),
+(973,606,26878,'MUTANTB',2181,26220,27158,34106,0,20679,490,0,NULL),
+(975,800,11783,'MBOT',2181,31285,23969,33970,0,722,38,0,NULL),
+(981,640,61001,'FLYMUT',2181,26672,26657,34281,0,20684,1510,0,NULL),
+(985,610,1100,'MGMUT',2181,28040,26301,34083,0,21559,628,0,NULL),
+(986,640,1159,'FLYMUT',2181,27424,27264,34328,0,21560,1503,0,NULL),
+(987,626,53397,'MUTANTB',2181,26386,27672,34135,0,20680,407,0,NULL),
+(999,602,19865,'MUTANTB',2181,26771,26119,34228,0,21559,271,0,NULL),
+(1003,730,39449,'BROBOT',2181,25425,32173,34055,0,20939,4285,0,NULL);
+/*!40000 ALTER TABLE `npc_spawns`
+ENABLE KEYS */;
+UNLOCK TABLES;
+
+DROP TABLE IF EXISTS `npc_shop`;
+CREATE TABLE `npc_shop`(
+ `c_npc_id` int COMMENT 'The NPC WorldID',
+ `c_zoneid` int COMMENT 'The ZoneID in which the NPC is',
+ `c_itemid` int COMMENT 'ItemID for sale',
+ `c_itemprice` int COMMENT 'Price for this item');
-/*\r
-SQLyog Community Edition- MySQL GUI v7.02 \r
-MySQL - 5.0.51a-24+lenny2 : Database - gameserver\r
-*********************************************************************\r
-*/\r
-\r
-/*!40101 SET NAMES utf8 */;\r
-\r
-/*!40101 SET SQL_MODE=''*/;\r
-\r
-/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;\r
-/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;\r
-\r
-CREATE DATABASE /*!32312 IF NOT EXISTS*/`gameserver` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_general_ci */;\r
-\r
-USE `gameserver`;\r
-\r
-/*Table structure for table `npc_spawns` */\r
-\r
-DROP TABLE IF EXISTS `npc_spawns`;\r
-\r
-CREATE TABLE `npc_spawns` (\r
- `npc_id` int(10) unsigned NOT NULL auto_increment,\r
- `npc_worldid` int(10) unsigned NOT NULL default '0',\r
- `npc_nameid` int(10) unsigned NOT NULL default '0',\r
- `npc_typeid` int(10) unsigned NOT NULL default '0',\r
- `npc_name` varchar(45) NOT NULL default '',\r
- `npc_location` int(10) unsigned NOT NULL default '0',\r
- `npc_x` int(10) unsigned NOT NULL default '0',\r
- `npc_y` int(10) unsigned NOT NULL default '0',\r
- `npc_z` int(10) unsigned NOT NULL default '0',\r
- `npc_angle` int(11) NOT NULL default '0',\r
- `npc_clothing` int(10) unsigned NOT NULL default '0',\r
- `npc_loot` int(10) unsigned NOT NULL default '0',\r
- `npc_unknown` int(10) unsigned NOT NULL default '0',\r
- `npc_trader` int(10) unsigned NOT NULL default '0',\r
- `npc_customname` varchar(80) default NULL,\r
- `npc_customscript` varchar(100) default NULL,\r
- `npc_shop_quality` int(3) default '50' COMMENT 'The quality of items if this npc has items to sell',\r
- `npc_scripting` int(1) default '1' COMMENT '1: Scripts enabled 0: Scripts disabled',\r
- PRIMARY KEY (`npc_id`)\r
-) ENGINE=InnoDB AUTO_INCREMENT=9942 DEFAULT CHARSET=latin1;\r
-\r
-/*Data for the table `npc_spawns` */\r
-\r
-insert into `npc_spawns`(`npc_id`,`npc_worldid`,`npc_nameid`,`npc_typeid`,`npc_name`,`npc_location`,`npc_x`,`npc_y`,`npc_z`,`npc_angle`,`npc_clothing`,`npc_loot`,`npc_unknown`,`npc_trader`,`npc_customname`,`npc_customscript`,`npc_shop_quality`,`npc_scripting`) values (9916,1020,385,61093,'WSK',1,33808,31332,32512,30,6612,0,8814,0,'Zippy the Trader','scripts/lua/zippy.lua',50,1),(9917,1018,387,32772,'WSK',101,31938,32165,32512,130,6616,0,16675,0,'Event Info',NULL,50,1),(9918,1019,215,50585,'WSK',101,34209,33864,32512,359,197,0,19499,195,'VotR Paperboy',NULL,50,1),(9919,1020,385,13542,'WSK',101,33261,33113,32672,2,4342,0,17892,0,NULL,NULL,50,1),(9920,976,2818,15528,'WSK',2071,23436,21380,35220,185,7214,0,9785,0,NULL,NULL,50,1),(9921,971,386,5040,'WSK',2181,38000,24127,33854,264,6622,0,2590,0,NULL,NULL,50,1),(9922,1020,836,43282,'MBOTFLY',2181,43068,26020,34020,0,31788,0,405,0,NULL,NULL,50,1),(9923,988,836,41913,'MBOTFLY',2181,41537,28260,33860,0,50146,0,380,0,NULL,NULL,50,1),(9924,1006,800,15709,'MBOT',2181,42047,28256,33786,0,14348,0,220,0,NULL,NULL,50,1),(9925,1005,800,28598,'MBOT',2181,44419,23412,33445,0,8332,0,585,0,NULL,NULL,50,1),(9926,1014,672,28153,'DOGBOT',2181,38041,29414,34088,0,21948,0,221,0,NULL,NULL,50,1),(9927,984,677,32746,'WBADGUY',2181,37985,31043,33939,0,21616,0,222,0,NULL,NULL,50,1),(9928,973,606,26878,'MUTANTB',2181,26220,27158,34106,0,20679,0,490,0,NULL,NULL,50,1),(9929,975,800,11783,'MBOT',2181,31285,23969,33970,0,722,0,38,0,NULL,NULL,50,1),(9930,981,640,61001,'FLYMUT',2181,26672,26657,34281,0,20684,0,1510,0,NULL,NULL,50,1),(9931,985,610,1100,'MGMUT',2181,28040,26301,34083,0,21559,0,628,0,NULL,NULL,50,1),(9932,986,640,1159,'FLYMUT',2181,27424,27264,34328,0,21560,0,1503,0,NULL,NULL,50,1),(9933,987,626,53397,'MUTANTB',2181,26386,27672,34135,0,20680,0,407,0,NULL,NULL,50,1),(9934,999,602,19865,'MUTANTB',2181,26771,26119,34228,0,21559,0,271,0,NULL,NULL,50,1),(9935,1003,730,39449,'BROBOT',2181,25425,32173,34055,0,20939,0,4285,0,NULL,NULL,50,1);\r
-\r
-/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;\r
-/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;\r
+/*
+SQLyog Community Edition- MySQL GUI v7.02
+MySQL - 5.0.51a-24+lenny2 : Database - gameserver
+*********************************************************************
+*/
+
+/*!40101 SET NAMES utf8 */;
+
+/*!40101 SET SQL_MODE=''*/;
+
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
+
+CREATE DATABASE /*!32312 IF NOT EXISTS*/`gameserver` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_general_ci */;
+
+USE `gameserver`;
+
+/*Table structure for table `npc_spawns` */
+
+DROP TABLE IF EXISTS `npc_spawns`;
+
+CREATE TABLE `npc_spawns` (
+ `npc_id` int(10) unsigned NOT NULL auto_increment,
+ `npc_worldid` int(10) unsigned NOT NULL default '0',
+ `npc_nameid` int(10) unsigned NOT NULL default '0',
+ `npc_typeid` int(10) unsigned NOT NULL default '0',
+ `npc_name` varchar(45) NOT NULL default '',
+ `npc_location` int(10) unsigned NOT NULL default '0',
+ `npc_x` int(10) unsigned NOT NULL default '0',
+ `npc_y` int(10) unsigned NOT NULL default '0',
+ `npc_z` int(10) unsigned NOT NULL default '0',
+ `npc_angle` int(11) NOT NULL default '0',
+ `npc_clothing` int(10) unsigned NOT NULL default '0',
+ `npc_loot` int(10) unsigned NOT NULL default '0',
+ `npc_unknown` int(10) unsigned NOT NULL default '0',
+ `npc_trader` int(10) unsigned NOT NULL default '0',
+ `npc_customname` varchar(80) default NULL,
+ `npc_customscript` varchar(100) default NULL,
+ `npc_shop_quality` int(3) default '50' COMMENT 'The quality of items if this npc has items to sell',
+ `npc_scripting` int(1) default '1' COMMENT '1: Scripts enabled 0: Scripts disabled',
+ PRIMARY KEY (`npc_id`)
+) ENGINE=InnoDB AUTO_INCREMENT=9942 DEFAULT CHARSET=latin1;
+
+/*Data for the table `npc_spawns` */
+
+insert into `npc_spawns`(`npc_id`,`npc_worldid`,`npc_nameid`,`npc_typeid`,`npc_name`,`npc_location`,`npc_x`,`npc_y`,`npc_z`,`npc_angle`,`npc_clothing`,`npc_loot`,`npc_unknown`,`npc_trader`,`npc_customname`,`npc_customscript`,`npc_shop_quality`,`npc_scripting`) values (9916,1020,385,61093,'WSK',1,33808,31332,32512,30,6612,0,8814,0,'Zippy the Trader','scripts/lua/zippy.lua',50,1),(9917,1018,387,32772,'WSK',101,31938,32165,32512,130,6616,0,16675,0,'Event Info',NULL,50,1),(9918,1019,215,50585,'WSK',101,34209,33864,32512,359,197,0,19499,195,'VotR Paperboy',NULL,50,1),(9919,1020,385,13542,'WSK',101,33261,33113,32672,2,4342,0,17892,0,NULL,NULL,50,1),(9920,976,2818,15528,'WSK',2071,23436,21380,35220,185,7214,0,9785,0,NULL,NULL,50,1),(9921,971,386,5040,'WSK',2181,38000,24127,33854,264,6622,0,2590,0,NULL,NULL,50,1),(9922,1020,836,43282,'MBOTFLY',2181,43068,26020,34020,0,31788,0,405,0,NULL,NULL,50,1),(9923,988,836,41913,'MBOTFLY',2181,41537,28260,33860,0,50146,0,380,0,NULL,NULL,50,1),(9924,1006,800,15709,'MBOT',2181,42047,28256,33786,0,14348,0,220,0,NULL,NULL,50,1),(9925,1005,800,28598,'MBOT',2181,44419,23412,33445,0,8332,0,585,0,NULL,NULL,50,1),(9926,1014,672,28153,'DOGBOT',2181,38041,29414,34088,0,21948,0,221,0,NULL,NULL,50,1),(9927,984,677,32746,'WBADGUY',2181,37985,31043,33939,0,21616,0,222,0,NULL,NULL,50,1),(9928,973,606,26878,'MUTANTB',2181,26220,27158,34106,0,20679,0,490,0,NULL,NULL,50,1),(9929,975,800,11783,'MBOT',2181,31285,23969,33970,0,722,0,38,0,NULL,NULL,50,1),(9930,981,640,61001,'FLYMUT',2181,26672,26657,34281,0,20684,0,1510,0,NULL,NULL,50,1),(9931,985,610,1100,'MGMUT',2181,28040,26301,34083,0,21559,0,628,0,NULL,NULL,50,1),(9932,986,640,1159,'FLYMUT',2181,27424,27264,34328,0,21560,0,1503,0,NULL,NULL,50,1),(9933,987,626,53397,'MUTANTB',2181,26386,27672,34135,0,20680,0,407,0,NULL,NULL,50,1),(9934,999,602,19865,'MUTANTB',2181,26771,26119,34228,0,21559,0,271,0,NULL,NULL,50,1),(9935,1003,730,39449,'BROBOT',2181,25425,32173,34055,0,20939,0,4285,0,NULL,NULL,50,1);
+
+/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
+/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
--- /dev/null
+# move base dir to src
+include_directories (${TINNS_SOURCE_DIR}/server/src)
+
+add_subdirectory (common)
+add_subdirectory (dev-tools)
+add_subdirectory (game)
+add_subdirectory (info)
+add_subdirectory (patch)
+++ /dev/null
-#
-# TinNS main Makefile
-#
-# Adapted by Hammag from the Makefile system for Linux kernel.
-#
-
-# NOTA: Be carefull no to put extra spaces at EOL when specifing dir path !
-
-# Config options
-export CONFIG_GAMEMONKEY := n
-
-# Debug mode compilation option
-# Uncommenting the following line will activate degub symbols generation
-# and inhibit binries stripping
-#DO_DEBUG = y
-
-# Do not change TOPDIR definiton
-TOPDIR := $(shell /bin/pwd)
-
-# Source code subdirs (libraries directories excluded)
-SUBDIRS = patch info game
-
-# Shortcut targets (when you dont want to make all)
-# generic form is as follows, with tinnslibs rule in first if needed
-#SHORTCUT_TARGETn :=[name] : tinnslibs _dir_[sub_dir]
-# Implemented for n=0..9 atm. See at the end of the file if more needed
-
-SHORTCUT_TARGET0 :=libs : min_needed
-SHORTCUT_TARGET1 :=gameserver : min_needed _dir_game
-SHORTCUT_TARGET2 :=infoserver : min_needed _dir_info
-SHORTCUT_TARGET3 :=patchserver : min_needed _dir_patch
-
-# Directory where we want to build executables in
-BINDEST = $(TOPDIR)/..
-
-# Commun include files stuff
-HPATH = $(TOPDIR)/include
-FINDHPATH = $(HPATH)
-#FINDHPATH = $(HPATH) $(HPATH)/netcode $(HPATH)/console $(HPATH)/config
-#FINDHPATH = $(HPATH) $(TOPDIR)/game/include $(TOPDIR)/game/decoder
-
-# TinNS libaries stuff
-LIBS = $(TOPDIR)/lib
-LIBSSRC = common
-
-# Common CFLAGS for all source tree
-CPPFLAGS := -I$(HPATH)
-CXXFLAGS := $(CPPFLAGS) -pedantic -W -Wall -Wno-long-long -O3 \
- -D_GNU_SOURCE -D_THREAD_SAFE -D_REENTRANT
-#CXXFLAGS += -march=$(shell arch)
-#CXXFLAGS += -Werror
-
-# Common Linker Flags for all source tree (partial linking with LD (ld))
-LDFLAGS := -r
-
-# Common Linker Flags for all source tree (final linking with CXX (g++))
-LINKFLAGS := -L$(LIBS)
-
-# specific files to be removed with 'make clean'
-CLEAN_FILES = $(BINDEST)/gameserver $(BINDEST)/infoserver \
- $(BINDEST)/patchserver
-
-# defines where Source tarball and Binaries tarball will be put (for dev use)
-# Use ABSOLUTE path
-TARBALLS_DEST = ~
-
-# Include local Makefile options/override if needed (for dev use only)
--include options.local
-
-#
-# Install stuf not done yet
-#
-# INSTALL_PATH := $TOP_DIR/..
-# export INSTALL_PATH
-
-
-#####################################################
-#***************************************************#
-# No further config should be needed after this line
-# for usual operations
-#***************************************************#
-ifdef DO_DEBUG
- CXXFLAGS += -O0 -ggdb
-endif
-
-CFLAGS := CXXFLAGS
-
-HOSTCC = gcc
-HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
-
-#
-# Include the make variables (CC, etc...)
-#
-CROSS_COMPILE =
-
-CC = $(CROSS_COMPILE)gcc
-CXX = $(CROSS_COMPILE)g++
-LD = $(CROSS_COMPILE)ld
-AR = $(CROSS_COMPILE)ar
-STRIP = $(CROSS_COMPILE)strip
-PERL = perl
-DEPDIR = .dep
-TOOLS = $(TOPDIR)/dev-tools
-export TOPDIR HPATH HOSTCC HOSTCFLAGS CROSS_COMPILE LD CC \
- CXX AR STRIP MAKE CPPFLAGS CXXFLAGS CFLAGS LDFLAGS LINKFLAGS
-export BINDEST LIBS DEPDIR TOOLS DO_DEBUG
-#
-#
-#
-ALLSUBDIRS = $(LIBSSRC) $(SUBDIRS)
-
-# directories removed with 'make clean'
-#CLEAN_DIRS =
-
-# files removed with 'make cleaner'
-CLEANER_FILES= \
- scripts/lxdialog/*.o scripts/lxdialog/lxdialog \
- .hdepend dev-tools/cleandepfile \
-
-# directories removed with 'make cleaner'
-#CLEANER_DIRS = \
- include/config
-
-
-############################################
-# Rules Start
-#
-all: do-it-all
-
-do-it-all: min_needed tinnssubdirs
-
-min_needed: dev_tools svnrev tinnslibs
-
-#
-#
-#
-dev_tools: dummy
- $(MAKE) -C $(TOOLS)
-
-tinnslibs : $(patsubst %, _ldir_%, $(LIBSSRC))
-$(patsubst %, _ldir_%, $(LIBSSRC)) : dummy
- $(MAKE) -C $(patsubst _ldir_%, %, $@)
-
-tinnssubdirs: $(patsubst %, _dir_%, $(SUBDIRS)) tinnslibs
-$(patsubst %, _dir_%, $(SUBDIRS)) : dummy
- $(MAKE) -C $(patsubst _dir_%, %, $@)
-
-svnrev:
- @$(TOOLS)/setsvnrev $(TOPDIR) $(HPATH)/svnrevision.h
-
-clean:
- find . \( -name '*.[oas]' -o -name core -o -name '.*.flags' \) -type f -print \
- | grep -v lxdialog/ | xargs rm -f
- rm -f $(CLEAN_FILES) $(BINDEST)/.*.flags
- rm -rf $(CLEAN_DIRS)
-
-cleaner: clean
- find . \( -size 0 -o -name .depend -o -name .no_msg_stop \) -type f -print | xargs rm -f
- find . -name .dep -type d -print | xargs rm -Rf
- rm -f $(CLEANER_FILES)
- rm -rf $(CLEANER_DIRS)
-
-distclean: cleaner
- rm -f core `find . \( -not -type d \) -and \
- \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
- -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
- -o -name '.*.rej' -o -name '.SUMS' -o -size 0 \) -type f -print`
-
-backup: cleaner
- cd .. && tar cf - src/ | gzip -9 > tinns-svnrev-`svnversion .`-backup.gz
- sync
-
-sourcetar:
- @$(TOOLS)/make-src-tarball $(TARBALLS_DEST) $(HPATH)/svnrevision.h
-
-bintar: do-it-all dummy
- @$(TOOLS)/make-bin-tarball $(TARBALLS_DEST) $(HPATH)/svnrevision.h $(BINDEST)
-
-sums:
- find . -type f -print | sort | xargs sum > .SUMS
-
-depend dep:
- @echo This rule is not used anymore. Just do make
-
-
-include Rules.make
-
-$(SHORTCUT_TARGET0)
-$(SHORTCUT_TARGET1)
-$(SHORTCUT_TARGET2)
-$(SHORTCUT_TARGET3)
-$(SHORTCUT_TARGET4)
-$(SHORTCUT_TARGET5)
-$(SHORTCUT_TARGET6)
-$(SHORTCUT_TARGET7)
-$(SHORTCUT_TARGET8)
-$(SHORTCUT_TARGET9)
-
+++ /dev/null
-#
-# This file contains rules which are shared between multiple Makefiles.
-#
-# Adapted by Hammag from the Makefile system for Linux kernel.
-#
-#####################################################
-#***************************************************#
-# This file is not intended to be modified
-#***************************************************#
-
-#
-# False targets.
-#
-.PHONY: dummy
-
-#
-# Special variables which should not be exported
-#
-unexport EXTRA_CXXFLAGS
-unexport EXTRA_LINKFLAGS
-unexport EXTRA_LDFLAGS
-unexport EXTRA_ARFLAGS
-unexport SUBDIRS
-unexport SUB_DIRS
-unexport ALL_SUB_DIRS
-unexport B_TARGET
-unexport B_REALTARGET
-unexport O_TARGET
-unexport L_TARGET
-unexport L_REALTARGET
-
-unexport obj-y
-unexport obj-n
-unexport obj-
-unexport subdir-y
-unexport subdir-n
-unexport subdir-
-
-comma := ,
-
-
-SUB_DIRS := $(subdir-y)
-#ALL_SUB_DIRS := $(sort $(subdir-y) $(subdir-n) $(subdir-))
-ALL_SUB_DIRS := $(sort $(subdir-y))
-ifdef B_TARGET
- ifdef BINDEST
- B_REALTARGET := $(strip $(BINDEST))/$(B_TARGET)
- else
- B_REALTARGET := $(B_TARGET)
- endif
-endif
-L_REALTARGET := $(patsubst %,$(LIBS)/lib%.a,$(L_TARGET))
-ALL_TARGETS := $(B_REALTARGET) $(O_TARGET) $(L_REALTARGET)
-
-#
-# Get things started.
-#
-first_rule: sub_dirs
- $(if $(strip $(ALL_TARGETS)),@$(MAKE) --no-print-directory all_targets,)
-
-#
-# Common rules
-#
-%.o: %.cpp
- @if [ ! -d .dep ]; then mkdir .dep ; fi
- $(CXX) -MD -MP $(CXXFLAGS) $(EXTRA_CXXFLAGS) $(CXXFLAGS_$@) -c $< -o $@
- @ ( \
- $(TOOLS)/cleandepfile < $(@:.o=.d) > $(DEPDIR)/$(@:.o=.dep); \
- rm -f $(@:.o=.d); \
- )
- @ ( \
- echo 'ifeq ($(strip $(subst $(comma),:,$(CXXFLAGS) $(EXTRA_CXXFLAGS) $(CXXFLAGS_$@))),$$(strip $$(subst $$(comma),:,$$(CXXFLAGS) $$(EXTRA_CXXFLAGS) $$(CXXFLAGS_$@))))' ; \
- echo 'FILES_FLAGS_UP_TO_DATE += $@' ; \
- echo 'endif' \
- ) > $(dir $@)/.$(notdir $@).flags
-
-#
-#
-#
-all_targets: $(ALL_TARGETS)
-
-#
-# Rule to compile a set of .o files into one executable file
-#
-ifdef B_REALTARGET
-
-FULLEXT_LINKFLAGS := $(patsubst %,-l%,$(LINK_TINNSLIBS)) $(EXTRA_LINKFLAGS)
-LIBDEP := $(patsubst %,$(LIBS)/lib%.a,$(LINK_TINNSLIBS))
-
-$(B_REALTARGET): $(obj-y) $(LIBDEP)
- @rm -f $@
- ifneq "$(strip $(obj-y))" ""
- $(CXX) -o $@ $(filter $(obj-y), $^) $(LINKFLAGS) $(FULLEXT_LINKFLAGS)
- ifndef DO_DEBUG
- @$(STRIP) $@
- endif
- else
- @echo No object files to build $@ !!!
- endif
- @ ( \
- echo 'ifeq ($(strip $(subst $(comma),:,$(LINKFLAGS) $(FULLEXT_LINKFLAGS) $(obj-y))),$$(strip $$(subst $$(comma),:,$$(LINKFLAGS) $$(FULLEXT_LINKFLAGS) $$(obj-y))))' ; \
- echo 'FILES_FLAGS_UP_TO_DATE += $@' ; \
- echo 'endif' \
- ) > $(dir $@)/.$(notdir $@).flags
-endif # B_REALTARGET
-
-#
-# Rule to compile a set of .o files into one .o file
-#
-ifdef O_TARGET
-$(O_TARGET): $(obj-y)
- rm -f $@
- ifneq "$(strip $(obj-y))" ""
- $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) -o $@ $(filter $(obj-y), $^)
- else
- @echo No object files to build $@ !!!
-# $(AR) rcs $@
- endif
- @ ( \
- echo 'ifeq ($(strip $(subst $(comma),:,$(LDFLAGS) $(EXTRA_LDFLAGS) $(obj-y))),$$(strip $$(subst $$(comma),:,$$(LDFLAGS) $$(EXTRA_LDFLAGS) $$(obj-y))))' ; \
- echo 'FILES_FLAGS_UP_TO_DATE += $@' ; \
- echo 'endif' \
- ) > $(dir $@)/.$(notdir $@).flags
-endif # O_TARGET
-
-#
-# Rule to compile a set of .o files into one .a file, creating,
-# adding or updating it
-#
-ifdef L_REALTARGET
-$(L_REALTARGET): $(obj-y)
-# rm -f $@
- @ if [ ! -d $(LIBS) ]; then mkdir $(LIBS); fi
- $(if $(filter $(obj-y),$?),$(AR) $(EXTRA_ARFLAGS) rcs $@ $(filter $(obj-y),$?),)
- @ ( \
- echo 'ifeq ($(strip $(subst $(comma),:,$(EXTRA_ARFLAGS) $(obj-y))),$$(strip $$(subst $$(comma),:,$$(EXTRA_ARFLAGS) $$(obj-y))))' ; \
- echo 'FILES_FLAGS_UP_TO_DATE += $@' ; \
- echo 'endif' \
- ) > $(dir $@)/.$(notdir $@).flags
-endif #L_REALTARGET
-
-#
-# This make dependencies quickly
-#
-fastdep: dummy
- @$(TOPDIR)/scripts/mkdep $(CXXFLAGS) $(EXTRA_CXXFLAGS) -- $(wildcard *.h) $(wildcard *.cpp) > .depend
-ifdef ALL_SUB_DIRS
- @$(MAKE) $(patsubst %,_sfdep_%,$(ALL_SUB_DIRS)) _FASTDEP_ALL_SUB_DIRS="$(ALL_SUB_DIRS)"
-endif
-
-ifdef _FASTDEP_ALL_SUB_DIRS
-$(patsubst %,_sfdep_%,$(_FASTDEP_ALL_SUB_DIRS)):
- @$(MAKE) -C $(patsubst _sfdep_%,%,$@) fastdep
-endif
-
-
-#
-# A rule to make subdirectories
-#
-subdir-list = $(sort $(patsubst %,_subdir_%,$(SUB_DIRS)))
-sub_dirs: dummy $(subdir-list)
-
-ifdef SUB_DIRS
-$(subdir-list) : dummy
- $(MAKE) -C $(patsubst _subdir_%,%,$@)
-endif
-
-#
-# A rule to do nothing
-#
-dummy:
-#
-# This is useful for testing
-#
-script:
- $(SCRIPT)
-
-dep: fastdep
-
-#
-# include dependency files if they exist
-#
-ifneq ($(wildcard $(DEPDIR)),)
- ifneq ($(wildcard $(obj-y)),)
- -include $(patsubst %.o,$(DEPDIR)/%.dep,$(obj-y))
- endif
-endif
-
-ifneq ($(wildcard $(TOPDIR)/.hdepend),)
-include $(TOPDIR)/.hdepend
-endif
-
-#
-# Find files whose flags have changed and force recompilation.
-# For safety, this works in the converse direction:
-# every file is forced, except those whose flags are positively up-to-date.
-#
-FILES_FLAGS_UP_TO_DATE :=
-
-# For use in expunging commas from flags, which mung our checking.
-comma = ,
-
-FILES_FLAGS_EXIST := $(wildcard .*.flags)
-ifdef B_TARGET
- ifneq ($(B_REALTARGET),$(B_TARGET))
- FILES_FLAGS_EXIST += $(wildcard $(dir $(B_REALTARGET))/.$(notdir $(B_REALTARGET)).flags)
- FILESTEST := $(dir $(B_REALTARGET))/.$(notdir $(B_REALTARGET)).flags
- endif
-endif
-ifdef L_REALTARGET
- FILES_FLAGS_EXIST += $(wildcard $(dir $(L_REALTARGET))/.$(notdir $(L_REALTARGET)).flags)
-endif
-
-ifneq ($(FILES_FLAGS_EXIST),)
-include $(FILES_FLAGS_EXIST)
-endif
-
-FILES_FLAGS_CHANGED := $(strip \
- $(filter-out $(FILES_FLAGS_UP_TO_DATE), \
- $(obj-y) $(ALL_TARGETS) \
- ))
-
-ifneq ($(FILES_FLAGS_CHANGED),)
-$(FILES_FLAGS_CHANGED): dummy
-endif
-
--- /dev/null
+add_library (common config.cpp console.cpp filesystem.cpp misc.cpp message.cpp netcode.cpp
+ regex++.cpp)
+++ /dev/null
-#
-# TinNS per-directory Makefile
-#
-# Adapted by Hammag from the Makefile system for Linux kernel.
-#
-# 14 Sep 2000, Christoph Hellwig <hch@infradead.org>
-# Rewritten to use lists instead of if-statements.
-#
-
-######################################################
-# Target for this directory and its sub-dirs
-######################################################
-# Case 1 : target is an executable named as defined
-#B_TARGET := testor2
-
-# Case 2 : target is a TinNS lib name
-# (use short name, as in -l linker option)
-#L_TARGET := tinns
-
-# Case 3 (usual): objects shall be made available to the parent dir
-# The following line will set that automatically
-# (Should match dir name + .o suffix)
-#O_TARGET := $(addsuffix .o,$(notdir $(shell /bin/pwd)))
-# Manualy define this only if you need to force the compiled obj name
-#O_TARGET := game.o
-
-
-######################################################
-# Local flags
-######################################################
-# local dir CXX Flags
-#EXTRA_CXXFLAGS := -I/usr/include/mysql
-
-# per-object CXX Flags
-#CXXFLAGS_funcdef2.o := -g
-
-# local dir Linker Flags (for intermediate .o linking)
-#EXTRA_LDFLAGS :=
-
-# any tinns Lib used (short name, as in -l linker option)
-#LINK_TINNSLIBS := tinns
-
-# local dir Linker Flags (for final executable linking)
-#EXTRA_LINKFLAGS := -lrt -lpthread -lz -lm -lcrypt -L"/usr/lib/mysql" -lmysqlclient
-
-
-#####################################################
-# Subdirectories
-#####################################################
-subdir-y := config console filesystem misc netcode regex
-subdir-$(CONFIG_GAMEMONKEY) += gamemonkey
-
-
-#####################################################
-#***************************************************#
-# No further config should be needed after this line
-#***************************************************#
-ifdef TOPDIR
-
-# build list of objects ib loca ldir
-obj-y := $(patsubst %.cpp,%.o,$(wildcard *.cpp))
-# add final object from each subdir
-obj-y += $(join $(subdir-y),$(subdir-y:%=/%.o))
-
-include $(TOPDIR)/Rules.make
-
-else #TOPDIR undef, Makefile called from non-top dir
-
-# Memorize the first calling dir in case we wanted to
-# lauch local actions from top Makefile
- ifndef FIRSTDIR
- FIRSTDIR :=$(CURDIR)
- export FIRSTDIR
- endif
-
-uptoparent :
- $(MAKE) -C .. $(MAKECMDGOALS)
-
-.DEFAULT :
- $(MAKE) -C .. $(MAKECMDGOALS)
-
-endif #TOPDIR
-
-/*\r
- TinNS (TinNS is not a Neocron Server)\r
- Copyright (C) 2005 Linux Addicted Community\r
- maintainer Akiko <akiko@gmx.org>\r
-\r
- This program is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU General Public License\r
- as published by the Free Software Foundation; either version 2\r
- of the License, or (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
- 02110-1301, USA.\r
-*/\r
-\r
-\r
-\r
-/*\r
- config.cpp\r
-\r
- Authors:\r
- - Akiko\r
- - Namikon\r
- - someone else?\r
-\r
- MODIFIED: Unknown date / Unknown author\r
- REASON: - initial release by unknown\r
- MODIFIED: 23 Dec 2005 Namikon\r
- REASON: - Added GPL\r
- MODIFIED: 07 Jan 2006 Namikon\r
- REASON: - Started to replace XML with CFG files \r
- MODIFIED: 05 Aug 2006 Hammag\r
- REASON: - changed LoadOptions() implementation.\r
- This should make addition of new options really easier, as well as config syntax error tracking\r
- See config.h for info\r
- MODIFIED: 27 Aug 2006 Hammag\r
- REASON: - Modified LoadOption() methode to make it generic,\r
- with an options template and the config file as arguments\r
- - Removed the ConfigTemplate that was used for gameserver only.\r
- - Removed old unused code\r
- MODIFIED: 25 Jun 2007 Hammag\r
- REASON: - Added include support\r
- - Now use PCRE RegEx instead of "strtok", enabling rentrance and removing\r
- potential issues.\r
- - Added GetOption & GetOptionInt with const std::string parameter\r
- - Fixed a bug in EOF detection in the main file reading loop\r
-*/\r
-\r
-#include "main.h"\r
+#include "common/config.h"\r
\r
+#include <cstring>\r
+#include "common/console.h"\r
+#include "common/misc.h"\r
\r
PConfig::PConfig()\r
{\r
--- /dev/null
+#pragma once\r
+\r
+#include <iostream>\r
+#include <map>\r
+#include "common/regex++.h"\r
+\r
+class PConfig\r
+{\r
+ private :\r
+ typedef std::map<std::string, std::string> OptionsMap;\r
+ OptionsMap mOptions;\r
+ RegEx* mOptValRegEx;\r
+ RegEx* mIncludeRegEx;\r
+ \r
+ bool LoadOptions(const char* nConfigTemplate[][2], const char* nConfigFile, int nDepth);\r
+ \r
+ public :\r
+ PConfig();\r
+ ~PConfig();\r
+\r
+ inline bool LoadOptions(const char* nConfigTemplate[][2], const char* nConfigFile)\r
+ { return LoadOptions(nConfigTemplate, nConfigFile, 0); }\r
+ inline const std::string &GetOption(const char *Name) const { return GetOption((std::string) Name); }\r
+ const std::string &GetOption(const std::string Name) const;\r
+ int GetOptionInt(const char *Name) const { return GetOptionInt((std::string) Name); }\r
+ int GetOptionInt(const std::string Name) const;\r
+};\r
+\r
+// Max nested includes\r
+#define CONFIG_MAXDEPTH 4\r
+\r
+/*\r
+ The list of valid config options is now set in the array ConfigTemplate\r
+ A default value can be set for each option, whiches makes the option optionnal in config file\r
+ If no default value is set, the option is mandatory.\r
+ Duplicate option entries in config file are also checked, and only the first value is kept\r
+ Unkown options are rejected\r
+ Duplicates, unkown and default use generate a warning in logs but don't break options loading\r
+ Missing mandatory option generate an error in log and break option loading (imediate return false)\r
+ \r
+ The ConfigTemplate parameter must have the structure shown in the following exemple:\r
+\r
+const char* ConfigTemplate[][2] = {\r
+ // {option_name, default_value} if default_value is empty string, it means option is mandatory\r
+ // List ends with empty string for option_name\r
+ {"info_sql_host", "127.0.0.1"},\r
+ {"info_sql_port", "3306"},\r
+ {"info_sql_username", ""},\r
+ {"info_sql_password", ""},\r
+ {"", ""} // do not change this line (end mark)\r
+};\r
+\r
+*/\r
+\r
+extern class PConfig* Config;\r
+++ /dev/null
-#
-# TinNS per-directory Makefile
-#
-# Adapted by Hammag from the Makefile system for Linux kernel.
-#
-# 14 Sep 2000, Christoph Hellwig <hch@infradead.org>
-# Rewritten to use lists instead of if-statements.
-#
-
-######################################################
-# Target for this directory and its sub-dirs
-######################################################
-# Case 1 : target is an executable named as defined
-#B_TARGET := testor2
-
-# Case 2 : target is a TinNS lib name
-# (use short name, as in -l linker option)
-L_TARGET := tinns
-
-# Case 3 (usual): objects shall be made available to the parent dir
-# The following line will set that automatically
-# (Should match dir name + .o suffix)
-#O_TARGET := $(addsuffix .o,$(notdir $(shell /bin/pwd)))
-# Manualy define this only if you need to force the compiled obj name
-#O_TARGET := game.o
-
-
-######################################################
-# Local flags
-######################################################
-# local dir CXX Flags
-#EXTRA_CXXFLAGS := -I/usr/include/mysql
-
-# per-object CXX Flags
-#CXXFLAGS_funcdef2.o := -g
-
-# local dir Linker Flags (for intermediate .o linking)
-#EXTRA_LDFLAGS :=
-
-# any tinns Lib used (short name, as in -l linker option)
-#LINK_TINNSLIBS := tinns
-
-# local dir Linker Flags (for final executable linking)
-#EXTRA_LINKFLAGS := -lrt -lpthread -lz -lm -lcrypt -L"/usr/lib/mysql" -lmysqlclient
-
-
-#####################################################
-# Subdirectories
-#####################################################
-#subdir-y := def
-#subdir-$(CONFIG_GAMEMONKEY) += gamemonkey
-
-
-#####################################################
-#***************************************************#
-# No further config should be needed after this line
-#***************************************************#
-ifdef TOPDIR
-
-# build list of objects ib loca ldir
-obj-y := $(patsubst %.cpp,%.o,$(wildcard *.cpp))
-# add final object from each subdir
-obj-y += $(join $(subdir-y),$(subdir-y:%=/%.o))
-
-include $(TOPDIR)/Rules.make
-
-else #TOPDIR undef, Makefile called from non-top dir
-
-# Memorize the first calling dir in case we wanted to
-# lauch local actions from top Makefile
- ifndef FIRSTDIR
- FIRSTDIR :=$(CURDIR)
- export FIRSTDIR
- endif
-
-uptoparent :
- $(MAKE) -C .. $(MAKECMDGOALS)
-
-.DEFAULT :
- $(MAKE) -C .. $(MAKECMDGOALS)
-
-endif #TOPDIR
-
+++ /dev/null
-/*\r
- TinNS (TinNS is not a Neocron Server)\r
- Copyright (C) 2005 Linux Addicted Community\r
- maintainer Akiko <akiko@gmx.org>\r
-\r
- This program is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU General Public License\r
- as published by the Free Software Foundation; either version 2\r
- of the License, or (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
- 02110-1301, USA.\r
-*/\r
-\r
-\r
-\r
-/*\r
- main.h - main include file, contains all needed includes and important definitions\r
-\r
- MODIFIED: 27 Aug 2006 Hammag\r
- REASON: - created \r
- \r
-*/\r
-\r
-#ifndef MAIN_H\r
-#define MAIN_H\r
-\r
-//#include "version.h"\r
-\r
-//basic includes\r
-#include "external.h"\r
-\r
-//tinns includes\r
-#include "types.h"\r
-#include "config.h"\r
-\r
-#include "console.h"\r
-#include "misc.h"\r
-\r
-using namespace std;\r
-\r
-// Better change that to a static members\r
-extern class PConsole* Console;\r
-\r
-#endif\r
-\r
-/*\r
- TinNS (TinNS is not a Neocron Server)\r
- Copyright (C) 2005 Linux Addicted Community\r
- maintainer Akiko <akiko@gmx.org>\r
-\r
- This program is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU General Public License\r
- as published by the Free Software Foundation; either version 2\r
- of the License, or (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
- 02110-1301, USA.\r
-*/\r
-\r
-\r
-\r
-/*\r
- console.cpp\r
-\r
- Authors:\r
- - Akiko\r
- - Namikon\r
- - someone else?\r
-\r
- MODIFIED: Unknown date / Unknown author\r
- REASON: - initial release by unknown\r
-\r
- MODIFIED: 25 Dec 2005 Namikon\r
- REASON: - Added GPL\r
- MODIFIED: 06 Jan 2006 Namikon\r
- REASON: - Added Print() function for colored console output\r
- - Added ColorText() to give selectable parts of an output another color\r
- - Added LPrint() to print like eAthena does\r
- Dont forget to use LClose() after using LPrint :)\r
- MODIFIED: 26 Aug 2006 Hammag\r
- REASON: - Added nLogFile as a constructor parameter, to make the class generic \r
- - Removed Console-> in Console->ColorText(...) in PConsole::~PConsole()\r
-*/\r
-\r
-#include "main.h"\r
+#include "common/console.h"\r
+\r
+#include <sstream>\r
+#include <cstring>\r
+#include <cstdarg>\r
\r
PConsole::PConsole(const char *nLogFile)\r
{\r
--- /dev/null
+#pragma once\r
+\r
+#include <iostream>\r
+#include <fstream>\r
+#include <chrono>\r
+\r
+enum COLORS\r
+{\r
+ BLACK,\r
+ RED,\r
+ GREEN,\r
+ YELLOW,\r
+ BLUE,\r
+ MAGENTA,\r
+ CYAN,\r
+ WHITE\r
+};\r
+\r
+class PConsole {\r
+private:\r
+ std::ofstream mLogFile;\r
+ time_t mLastLogTime;\r
+\r
+public:\r
+ PConsole(const char *nLogFile);\r
+ ~PConsole();\r
+ void Print(const char *Fmt_, ...);\r
+ void Print(COLORS foreground, COLORS background, const char *Fmt_, ...);\r
+ char *ColorText(COLORS foreground, COLORS background, const char *Fmt, ...);\r
+\r
+ void LPrint(const char *Fmt_, ...);\r
+ void LPrint(COLORS foreground, COLORS background, const char *Fmt_, ...);\r
+ void LClose();\r
+ void Update();\r
+};\r
+\r
+extern class PConsole *Console;\r
+++ /dev/null
-#
-# TinNS per-directory Makefile
-#
-# Adapted by Hammag from the Makefile system for Linux kernel.
-#
-# 14 Sep 2000, Christoph Hellwig <hch@infradead.org>
-# Rewritten to use lists instead of if-statements.
-#
-
-######################################################
-# Target for this directory and its sub-dirs
-######################################################
-# Case 1 : target is an executable named as defined
-#B_TARGET := testor2
-
-# Case 2 : target is a TinNS lib name
-# (use short name, as in -l linker option)
-L_TARGET := tinns
-
-# Case 3 (usual): objects shall be made available to the parent dir
-# The following line will set that automatically
-# (Should match dir name + .o suffix)
-#O_TARGET := $(addsuffix .o,$(notdir $(shell /bin/pwd)))
-# Manualy define this only if you need to force the compiled obj name
-#O_TARGET := game.o
-
-
-######################################################
-# Local flags
-######################################################
-# local dir CXX Flags
-#EXTRA_CXXFLAGS := -I/usr/include/mysql
-
-# per-object CXX Flags
-#CXXFLAGS_funcdef2.o := -g
-
-# local dir Linker Flags (for intermediate .o linking)
-#EXTRA_LDFLAGS :=
-
-# any tinns Lib used (short name, as in -l linker option)
-#LINK_TINNSLIBS := tinns
-
-# local dir Linker Flags (for final executable linking)
-#EXTRA_LINKFLAGS := -lrt -lpthread -lz -lm -lcrypt -L"/usr/lib/mysql" -lmysqlclient
-
-
-#####################################################
-# Subdirectories
-#####################################################
-#subdir-y := def
-#subdir-$(CONFIG_GAMEMONKEY) += gamemonkey
-
-
-#####################################################
-#***************************************************#
-# No further config should be needed after this line
-#***************************************************#
-ifdef TOPDIR
-
-# build list of objects ib loca ldir
-obj-y := $(patsubst %.cpp,%.o,$(wildcard *.cpp))
-# add final object from each subdir
-obj-y += $(join $(subdir-y),$(subdir-y:%=/%.o))
-
-include $(TOPDIR)/Rules.make
-
-else #TOPDIR undef, Makefile called from non-top dir
-
-# Memorize the first calling dir in case we wanted to
-# lauch local actions from top Makefile
- ifndef FIRSTDIR
- FIRSTDIR :=$(CURDIR)
- export FIRSTDIR
- endif
-
-uptoparent :
- $(MAKE) -C .. $(MAKECMDGOALS)
-
-.DEFAULT :
- $(MAKE) -C .. $(MAKECMDGOALS)
-
-endif #TOPDIR
-
+++ /dev/null
-/*\r
- TinNS (TinNS is not a Neocron Server)\r
- Copyright (C) 2005 Linux Addicted Community\r
- maintainer Akiko <akiko@gmx.org>\r
-\r
- This program is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU General Public License\r
- as published by the Free Software Foundation; either version 2\r
- of the License, or (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
- 02110-1301, USA.\r
-*/\r
-\r
-\r
-\r
-/*\r
- main.h - main include file, contains all needed includes and important definitions\r
-\r
- MODIFIED: 26 Aug 2006 Hammag\r
- REASON: - created from gameserver main.h and modified as needed\r
-\r
-*/\r
-\r
-#ifndef MAIN_H\r
-#define MAIN_H\r
-\r
-//#include "version.h"\r
-\r
-//basic includes\r
-#include "external.h"\r
-\r
-//tinns includes\r
-#include "types.h"\r
-#include "console.h"\r
-\r
-using namespace std;\r
-\r
-#endif\r
-\r
-/*\r
- TinNS (TinNS is not a Neocron Server)\r
- Copyright (C) 2005 Linux Addicted Community\r
- maintainer Akiko <akiko@gmx.org>\r
+#include "common/filesystem.h"\r
\r
- This program is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU General Public License\r
- as published by the Free Software Foundation; either version 2\r
- of the License, or (at your option) any later version.\r
+#include <sstream>\r
+#include <cstring>\r
+#include <zlib.h>\r
+#include "common/console.h"\r
\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
- 02110-1301, USA.\r
-*/\r
-\r
-\r
-\r
-/*\r
- filesystem.cpp\r
- \r
- Authors:\r
- - Akiko\r
- - Namikon\r
- - someone else?\r
- \r
- MODIFIED: Unknown date / Unknown author\r
- REASON: - initial release by unknown\r
- MODIFIED: 25 Dec 2005 Namikon\r
- REASON: - Added GPL\r
- MODIFIED: 31 August 2005 Akiko\r
- REASON: - modified the path handling of the open function\r
- MODIFIED: 29 Sep 2006 Hammag\r
- REASON: - added a safety check on read size in PFile::Read \r
- MODIFIED: 07 Oct 2006 Hammag\r
- REASON: - Fixed package reading to enable access to "subdirectories" in archive,\r
- as well as translation from unix to dos path separator for in-archive search \r
- - Removed the "file not found" message the PFileSystem::Open() was issuing in the corresponding case.\r
- A NULL returned for PFile* is sufficient for the calling proc to manage the situation.\r
- - Changed file search in archives to case-insensitive\r
- \r
- MODIFIED: 08 Oct 2006 Hammag\r
- REASON: - added ClearCache() methode to clear pak cache when .pak access is not used anymore\r
-\r
-*/\r
-\r
-#include "main.h"\r
-\r
-/*\r
- implements file access semantics for Neocron .pak files\r
- supports both single packed files and file archives\r
-\r
- how neocron files are accessed:\r
- - if path/filename.ext exists, the file is opened\r
- - (else) if path/pak_filename.ext exists, the file is opened\r
- - (else) if an archive named path_head.pak exists, path_tail\filename.ext is opened from the archive\r
- here path is split in path_head\path_tail\r
- \r
-*/\r
-const s8 DELIM = '/';\r
+const int8_t DELIM = '/';\r
\r
PFile::PFile()\r
{\r
{\r
}\r
\r
-bool PFile::ReadData(std::FILE *F, u32 Size)\r
+bool PFile::ReadData(FILE *F, uint32_t Size)\r
{\r
mBuffer.reserve(Size);\r
std::fread(&mBuffer[0], 1, Size, F);\r
return true;\r
}\r
\r
-bool PFile::ReadUnpakData(std::FILE *F, u32 Size, u32 UncSize)\r
+bool PFile::ReadUnpakData(FILE *F, uint32_t Size, uint32_t UncSize)\r
{\r
- std::vector<u8> temp;\r
+ std::vector<int8_t> temp;\r
temp.reserve(Size);\r
mBuffer.reserve(UncSize);\r
\r
\r
unsigned long us=UncSize;\r
unsigned long s=Size;\r
- uncompress(&mBuffer[0], &us, &temp[0], s);\r
+ uncompress(reinterpret_cast<Bytef *>(&mBuffer[0]), &us, reinterpret_cast<const Bytef *>(&temp[0]), s);\r
mDataSize=us;\r
return true;\r
}\r
\r
-int PFile::Read(void *Dest, u32 DestSize)\r
+int PFile::Read(void *Dest, uint32_t DestSize)\r
{\r
- int m = min(mDataSize-mDataOffs, DestSize);\r
+ int m = std::min(mDataSize-mDataOffs, DestSize);\r
if (m <= 0)\r
return 0;\r
memcpy(Dest, &mBuffer[mDataOffs], m);\r
return m;\r
}\r
\r
-void PFile::Seek(u32 Offset)\r
+void PFile::Seek(uint32_t Offset)\r
{\r
- mDataOffs = min(mDataSize-1, Offset);\r
+ mDataOffs = std::min(mDataSize-1, Offset);\r
}\r
\r
std::string PFile::ReadString()\r
}\r
}\r
\r
-PFileSystem::PPakFileList* PFileSystem::CachePak(const std::string &Pak, std::FILE *F)\r
+PFileSystem::PPakFileList* PFileSystem::CachePak(const std::string &Pak, FILE *F)\r
{\r
PPakFiles::iterator n = mPaks.find(Pak);\r
if(n != mPaks.end())\r
}\r
}\r
\r
-void splitpath(const string &file, string &path, string &name, string &ext)\r
+void splitpath(const std::string& file, std::string& path, std::string& name, std::string& ext)\r
{\r
unsigned long pos = file.rfind(DELIM);\r
\r
- if (pos == string::npos)\r
+ if (pos == std::string::npos)\r
{\r
path = "";\r
name = file;\r
}\r
\r
pos = name.rfind('.');\r
- if (pos == string::npos)\r
+ if (pos == std::string::npos)\r
{\r
ext = "";\r
}\r
}\r
}\r
\r
-PFile *PFileSystem::Open(const std::string &Package, const char *File, std::string BasePath)\r
+PFile *PFileSystem::Open(const std::string& Package, const char *File, std::string BasePath)\r
{\r
std::string name = "";\r
std::string ext = "";\r
path = path.substr(2, path.length() -2);\r
}\r
unsigned long pos = path.find(DELIM);\r
- if (pos == string::npos)\r
+ if (pos == std::string::npos)\r
{\r
pak2 = path;\r
name2 = name;\r
pak2 = path.substr(0, pos);\r
name2 = path.substr(pos + 1) + '\\' + name;\r
pos = name2.find(DELIM);\r
- while (pos != string::npos)\r
+ while (pos != std::string::npos)\r
{\r
name2[pos] = '\\';\r
pos = name2.find(DELIM);\r
--- /dev/null
+#pragma once\r
+\r
+#include <iostream>\r
+#include <vector>\r
+#include <string>\r
+#include <map>\r
+\r
+class PFile {\r
+ friend class PFileSystem;\r
+private:\r
+ std::vector<int8_t> mBuffer;\r
+ uint32_t mDataSize;\r
+ uint32_t mDataOffs;\r
+ bool ReadData(FILE *F, uint32_t Size);\r
+ bool ReadUnpakData(FILE *F, uint32_t Size, uint32_t UncSize);\r
+\r
+public:\r
+ PFile();\r
+ ~PFile();\r
+ inline bool Eof() { return mDataOffs>=mDataSize; }\r
+ int Read(void *Dest, uint32_t DestSize);\r
+ void Seek(uint32_t Offset);\r
+ std::string ReadString();\r
+ inline uint32_t GetSize() const { return mDataSize; }\r
+};\r
+\r
+#pragma pack(push, 1)\r
+//#pragma pack(1)\r
+struct PPakHeader {\r
+ int mID;\r
+ int mNumFiles;\r
+};\r
+\r
+struct PPakFileHeader {\r
+ int mUnknown0;\r
+ int mOffset;\r
+ int mCompressedSize;\r
+ int mUncompressedSize;\r
+ int mNameLen; // including 0\r
+ char *mFilename;\r
+};\r
+#pragma pack(pop)\r
+\r
+class PFileSystem {\r
+private:\r
+ typedef std::map<std::string, PPakFileHeader*> PPakFileList;\r
+ typedef std::map<std::string, PPakFileList*> PPakFiles;\r
+ PPakFiles mPaks;\r
+ PPakFileList *CachePak(const std::string &Pak, FILE *F);\r
+\r
+public:\r
+ PFileSystem();\r
+ ~PFileSystem();\r
+ PFile *Open(const std::string &Package, const char *File, std::string BasePath);\r
+ bool Close(PFile *File);\r
+ void ClearCache();\r
+};\r
+++ /dev/null
-#
-# TinNS per-directory Makefile
-#
-# Adapted by Hammag from the Makefile system for Linux kernel.
-#
-# 14 Sep 2000, Christoph Hellwig <hch@infradead.org>
-# Rewritten to use lists instead of if-statements.
-#
-
-######################################################
-# Target for this directory and its sub-dirs
-######################################################
-# Case 1 : target is an executable named as defined
-#B_TARGET := testor2
-
-# Case 2 : target is a TinNS lib name
-# (use short name, as in -l linker option)
-L_TARGET := tinns
-
-# Case 3 (usual): objects shall be made available to the parent dir
-# The following line will set that automatically
-# (Should match dir name + .o suffix)
-#O_TARGET := $(addsuffix .o,$(notdir $(shell /bin/pwd)))
-# Manualy define this only if you need to force the compiled obj name
-#O_TARGET := game.o
-
-
-######################################################
-# Local flags
-######################################################
-# local dir CXX Flags
-#EXTRA_CXXFLAGS := -I/usr/include/mysql
-
-# per-object CXX Flags
-#CXXFLAGS_funcdef2.o := -g
-
-# local dir Linker Flags (for intermediate .o linking)
-#EXTRA_LDFLAGS :=
-
-# any tinns Lib used (short name, as in -l linker option)
-#LINK_TINNSLIBS := tinns
-
-# local dir Linker Flags (for final executable linking)
-#EXTRA_LINKFLAGS := -lrt -lpthread -lz -lm -lcrypt -L"/usr/lib/mysql" -lmysqlclient
-
-
-#####################################################
-# Subdirectories
-#####################################################
-#subdir-y := def
-#subdir-$(CONFIG_GAMEMONKEY) += gamemonkey
-
-
-#####################################################
-#***************************************************#
-# No further config should be needed after this line
-#***************************************************#
-ifdef TOPDIR
-
-# build list of objects ib loca ldir
-obj-y := $(patsubst %.cpp,%.o,$(wildcard *.cpp))
-# add final object from each subdir
-obj-y += $(join $(subdir-y),$(subdir-y:%=/%.o))
-
-include $(TOPDIR)/Rules.make
-
-else #TOPDIR undef, Makefile called from non-top dir
-
-# Memorize the first calling dir in case we wanted to
-# lauch local actions from top Makefile
- ifndef FIRSTDIR
- FIRSTDIR :=$(CURDIR)
- export FIRSTDIR
- endif
-
-uptoparent :
- $(MAKE) -C .. $(MAKECMDGOALS)
-
-.DEFAULT :
- $(MAKE) -C .. $(MAKECMDGOALS)
-
-endif #TOPDIR
-
+++ /dev/null
-/*\r
- TinNS (TinNS is not a Neocron Server)\r
- Copyright (C) 2005 Linux Addicted Community\r
- maintainer Akiko <akiko@gmx.org>\r
-\r
- This program is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU General Public License\r
- as published by the Free Software Foundation; either version 2\r
- of the License, or (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
- 02110-1301, USA.\r
-*/\r
-\r
-\r
-\r
-/*\r
- main.h - main include file, contains all needed includes and important definitions\r
-\r
- MODIFIED: 27 Aug 2006 Hammag\r
- REASON: - created \r
- \r
-*/\r
-\r
-#ifndef MAIN_H\r
-#define MAIN_H\r
-\r
-//#include "version.h"\r
-\r
-//basic includes\r
-#include "external.h"\r
-\r
-//tinns includes\r
-#include "types.h"\r
-#include "config.h"\r
-\r
-#include "console.h"\r
-#include "misc.h"\r
-\r
-#include "filesystem.h"\r
-\r
-using namespace std;\r
-\r
-// Better change that to a static members\r
-extern class PConsole* Console;\r
-//extern class PConfig* Config;\r
-\r
-#endif\r
-\r
+#include "common/message.h"
-/*
- TinNS (TinNS is not a Neocron Server)
- Copyright (C) 2005 Linux Addicted Community
- maintainer Akiko <akiko@gmx.org>
+#include <cstring>
+#include "common/console.h"
- 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 (at your option) 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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
-*/
-
-
-
-/*
- message.cpp - a data message & message pool class for tcp and udp connections (and maybe more later)
-
-
- Authors:
- - Hammag
-
- MODIFIED: 15 jul 2006 Hammag
- REASON: - Creation
-*/
-
-/*
-#include "../game/main.h"
-#include "message.h"
-*/
-#include "main.h"
-
-const u16 PMessage::smMsgSizes[] = {MESSAGE_SIZES_LIST};
+const uint16_t PMessage::smMsgSizes[] = {MESSAGE_SIZES_LIST};
PMsgData* PMessage::smMsgPoolHead[] = {MESSAGE_POOL_INIT};
int PMessage::smMsgPoolCount[] = {MESSAGE_POOL_COUNT_INIT};
int PMessage::smMsgCount = 0;
}
}
-PMessage::PMessage(u16 nRequestedSize)
+PMessage::PMessage(uint16_t nRequestedSize)
{
GetMsgBuffer(nRequestedSize);
mUsedSize = 0;
++smMsgCount;
}
-void PMessage::GetMsgBuffer(u16 nRequestedSize) //no optimisation to try to used larger unused buffer
+void PMessage::GetMsgBuffer(uint16_t nRequestedSize) //no optimisation to try to used larger unused buffer
{
//Console->Print("Allocating buffer for size %d", nRequestedSize);
for (mPoolId = 0; mPoolId < MESSAGE_SIZES_NB; mPoolId++)
//Console->Print("Pool Empty, creating new buffers");
mData = new PMsgData[MESSAGE_ALLOC_NB];
for (int i = 0; i < MESSAGE_ALLOC_NB; i++)
- mData[i].mBuffer = new u8[mMaxSize];
+ mData[i].mBuffer = new uint8_t[mMaxSize];
if (MESSAGE_ALLOC_NB > 1)
{
//Console->Print("Buffer %08xd back in pool %d.", mData, mPoolId);
}
-void PMessage::CheckAndExtend(u16 nRequestedSize) // This is SIZE checked, not max OFFSET
+void PMessage::CheckAndExtend(uint16_t nRequestedSize) // This is SIZE checked, not max OFFSET
{
//Console->Print("Checking size: max %d, req %d", mMaxSize, nRequestedSize);
if (nRequestedSize > mMaxSize)
}
}
-void PMessage::SetNextByteOffset(u16 nPos)
+void PMessage::SetNextByteOffset(uint16_t nPos)
{
if (nPos >= mMaxSize)
CheckAndExtend(nPos+1);
mNextByteOffset = nPos;
}
-void PMessage::ForceSize(u16 nUsedSize)
+void PMessage::ForceSize(uint16_t nUsedSize)
{
if (nUsedSize > mMaxSize)
CheckAndExtend(nUsedSize);
}
// Writing methods
-u8* PMessage::GetMessageDataPointer(u16 nUsedSize)
+uint8_t* PMessage::GetMessageDataPointer(uint16_t nUsedSize)
{
if (nUsedSize > mMaxSize)
CheckAndExtend(nUsedSize);
if (nUsedSize > mUsedSize)
mUsedSize = nUsedSize;
- return (u8*) (mData->mBuffer);
+ return (uint8_t*) (mData->mBuffer);
}
-PMessage& PMessage::Fill(u8 Value, u16 StartOffset, u16 FillSize)
+PMessage& PMessage::Fill(uint8_t Value, uint16_t StartOffset, uint16_t FillSize)
{
if (FillSize == 0)
FillSize = mMaxSize;
return *this;
}
-PMessage& PMessage::Write(const void* nData, u16 nLength)
+PMessage& PMessage::Write(const void* nData, uint16_t nLength)
{
- u16 tmpOffset = mNextByteOffset + nLength;
+ uint16_t tmpOffset = mNextByteOffset + nLength;
if (tmpOffset > mMaxSize)
CheckAndExtend(tmpOffset);
memcpy((void*)(mData->mBuffer + mNextByteOffset), (void*)nData, (size_t)nLength);
PMessage& PMessage::operator << (PMessage& nMessage)
{
- u16 tmpOffset = mNextByteOffset + nMessage.mUsedSize;
+ uint16_t tmpOffset = mNextByteOffset + nMessage.mUsedSize;
if (tmpOffset > mMaxSize)
CheckAndExtend(tmpOffset);
memcpy((void*)(mData->mBuffer + mNextByteOffset), (void*)(nMessage.mData->mBuffer), (size_t)(nMessage.mUsedSize));
PMessage& PMessage::operator << (const char* nString) //for null terminated string ! Copies includes ending \0
{
int StringL = strlen(nString)+1;
- u16 tmpOffset = mNextByteOffset + StringL;
+ uint16_t tmpOffset = mNextByteOffset + StringL;
if (tmpOffset > mMaxSize)
CheckAndExtend(tmpOffset);
memcpy((void*)(mData->mBuffer + mNextByteOffset), (void*)nString, (size_t)StringL);
return *this;
}
-PMessage& PMessage::operator << (u8 nU8)
+PMessage& PMessage::operator << (uint8_t nU8)
{
- u16 tmpOffset = mNextByteOffset+1;
+ uint16_t tmpOffset = mNextByteOffset+1;
if (tmpOffset > mMaxSize)
CheckAndExtend(tmpOffset);
mData->mBuffer[mNextByteOffset] = nU8;
return *this;
}
-PMessage& PMessage::operator << (u16 nU16)
+PMessage& PMessage::operator << (uint16_t nU16)
{
- u16 tmpOffset = mNextByteOffset+2;
+ uint16_t tmpOffset = mNextByteOffset+2;
if (tmpOffset > mMaxSize)
CheckAndExtend(tmpOffset);
- *(u16*)(mData->mBuffer + mNextByteOffset) = nU16;
+ *(uint16_t*)(mData->mBuffer + mNextByteOffset) = nU16;
mNextByteOffset = tmpOffset;
UpdateUsedSize();
return *this;
}
-PMessage& PMessage::operator << (u32 nU32)
+PMessage& PMessage::operator << (uint32_t nU32)
{
- u16 tmpOffset = mNextByteOffset+4;
+ uint16_t tmpOffset = mNextByteOffset+4;
if (tmpOffset > mMaxSize)
CheckAndExtend(tmpOffset);
- *(u32*)(mData->mBuffer + mNextByteOffset) = nU32;
+ *(uint32_t*)(mData->mBuffer + mNextByteOffset) = nU32;
mNextByteOffset = tmpOffset;
UpdateUsedSize();
return *this;
}
-PMessage& PMessage::operator << (f32 nF32)
+PMessage& PMessage::operator << (float nF32)
{
- u16 tmpOffset = mNextByteOffset+4;
+ uint16_t tmpOffset = mNextByteOffset+4;
if (tmpOffset > mMaxSize)
CheckAndExtend(tmpOffset);
- *(f32*)(mData->mBuffer + mNextByteOffset) = nF32;
+ *(float*)(mData->mBuffer + mNextByteOffset) = nF32;
mNextByteOffset = tmpOffset;
UpdateUsedSize();
return *this;
}
// Mixt methods
-u8& PMessage::U8Data(u16 nOffset)
+uint8_t& PMessage::U8Data(uint16_t nOffset)
{
- u16 tmpOffset = nOffset+1;
+ uint16_t tmpOffset = nOffset+1;
if (tmpOffset > mMaxSize)
CheckAndExtend(tmpOffset);
if (tmpOffset > mUsedSize)
return mData->mBuffer[nOffset];
}
-u16& PMessage::U16Data(u16 nOffset)
+uint16_t& PMessage::U16Data(uint16_t nOffset)
{
- u16 tmpOffset = nOffset+2;
+ uint16_t tmpOffset = nOffset+2;
if (tmpOffset > mMaxSize)
CheckAndExtend(tmpOffset);
if (tmpOffset > mUsedSize)
mUsedSize = tmpOffset;
- return *(u16*)(mData->mBuffer + nOffset);
+ return *(uint16_t*)(mData->mBuffer + nOffset);
}
-u32& PMessage::U32Data(u16 nOffset)
+uint32_t& PMessage::U32Data(uint16_t nOffset)
{
- u16 tmpOffset = nOffset+4;
+ uint16_t tmpOffset = nOffset+4;
if (tmpOffset > mMaxSize)
CheckAndExtend(tmpOffset);
if (tmpOffset > mUsedSize)
mUsedSize = tmpOffset;
- return *(u32*)(mData->mBuffer + nOffset);
+ return *(uint32_t*)(mData->mBuffer + nOffset);
}
-f32& PMessage::F32Data(u16 nOffset)
+float& PMessage::F32Data(uint16_t nOffset)
{
- u16 tmpOffset = nOffset+4;
+ uint16_t tmpOffset = nOffset+4;
if (tmpOffset > mMaxSize)
CheckAndExtend(tmpOffset);
if (tmpOffset > mUsedSize)
mUsedSize = tmpOffset;
- return *(f32*)(mData->mBuffer + nOffset);
+ return *(float*)(mData->mBuffer + nOffset);
}
PMessage& PMessage::operator = (PMessage& nMessage)
}
// Reading methods
-PMessage* PMessage::GetChunk(u16 StartOffset, u16 ChunkSize, u16 ChunkNumber)
+PMessage* PMessage::GetChunk(uint16_t StartOffset, uint16_t ChunkSize, uint16_t ChunkNumber)
{
- u16 ReqStartOffset = StartOffset + ChunkNumber * ChunkSize;
+ uint16_t ReqStartOffset = StartOffset + ChunkNumber * ChunkSize;
if (ReqStartOffset >= mUsedSize)
return NULL;
- u16 RealChunkSize = (ChunkSize < mUsedSize - ReqStartOffset) ? ChunkSize : mUsedSize - ReqStartOffset;
+ uint16_t RealChunkSize = (ChunkSize < mUsedSize - ReqStartOffset) ? ChunkSize : mUsedSize - ReqStartOffset;
PMessage* MsgChunk = new PMessage(RealChunkSize);
memcpy((void*)(MsgChunk->mData->mBuffer), (void*)(mData->mBuffer + ReqStartOffset), (size_t)RealChunkSize);
PMessage& PMessage::operator >> (std::string& nString) //read up to null or EOM
{
int i;
- u8* StringStart = mData->mBuffer + mNextByteOffset;
+ uint8_t* StringStart = mData->mBuffer + mNextByteOffset;
char* FinalStringStart;
for (i = 0; mNextByteOffset + i < mUsedSize; i++)
{
return *this;
}
-PMessage& PMessage::operator >> (u8& nU8)
+PMessage& PMessage::operator >> (uint8_t& nU8)
{
- u16 tmpOffset = mNextByteOffset+1;
+ uint16_t tmpOffset = mNextByteOffset+1;
nU8 = (tmpOffset > mUsedSize) ? 0 : mData->mBuffer[mNextByteOffset];
mNextByteOffset = tmpOffset;
return *this;
}
-PMessage& PMessage::operator >> (u16& nU16)
+PMessage& PMessage::operator >> (uint16_t& nU16)
{
- u16 tmpOffset = mNextByteOffset+2;
- nU16 = (tmpOffset > mUsedSize) ? 0 : *(u16*)(mData->mBuffer + mNextByteOffset);
+ uint16_t tmpOffset = mNextByteOffset+2;
+ nU16 = (tmpOffset > mUsedSize) ? 0 : *(uint16_t*)(mData->mBuffer + mNextByteOffset);
mNextByteOffset = tmpOffset;
return *this;
}
-PMessage& PMessage::operator >> (u32& nU32)
+PMessage& PMessage::operator >> (uint32_t& nU32)
{
- u16 tmpOffset = mNextByteOffset+4;
- nU32 = (tmpOffset > mUsedSize) ? 0 : *(u32*)(mData->mBuffer + mNextByteOffset);
+ uint16_t tmpOffset = mNextByteOffset+4;
+ nU32 = (tmpOffset > mUsedSize) ? 0 : *(uint32_t*)(mData->mBuffer + mNextByteOffset);
mNextByteOffset = tmpOffset;
return *this;
}
-PMessage& PMessage::operator >> (f32& nF32)
+PMessage& PMessage::operator >> (float& nF32)
{
- u16 tmpOffset = mNextByteOffset+4;
- nF32 = (tmpOffset > mUsedSize) ? 0 : *(f32*)(mData->mBuffer + mNextByteOffset);
+ uint16_t tmpOffset = mNextByteOffset+4;
+ nF32 = (tmpOffset > mUsedSize) ? 0 : *(float*)(mData->mBuffer + mNextByteOffset);
mNextByteOffset = tmpOffset;
return *this;
}
sAsciiDump = "";
for (j = 0; (j < 16) && ((i+j) < mUsedSize); j++)
{
- snprintf(tmpStr, 64, " %02hx",(u8)tmpBuff[i+j]);
+ snprintf(tmpStr, 64, " %02hx",(uint8_t)tmpBuff[i+j]);
sDump += tmpStr;
sAsciiDump += ((tmpBuff[i+j]>'\x19') && (tmpBuff[i+j]<'\x7F')) ? tmpBuff[i+j] : '.';
}
char* tmpBuff = (char*) GetMessageData();
Console->Print("%s T:%02hx UID:%04hx UHID:%04hx Fnct:%02hx Seq:%04hx Cmd:%02hx Cmd2:%02hx Cmd3:%02hx",
- nComment, (u8)tmpBuff[0], *(u16*)&tmpBuff[1], *(u16*)&tmpBuff[3], (u8)tmpBuff[6], *(u16*)&tmpBuff[7], (u8)tmpBuff[9], (u8)tmpBuff[10], (u8)tmpBuff[12] );
+ nComment, (uint8_t)tmpBuff[0], *(uint16_t*)&tmpBuff[1], *(uint16_t*)&tmpBuff[3], (uint8_t)tmpBuff[6], *(uint16_t*)&tmpBuff[7], (uint8_t)tmpBuff[9], (uint8_t)tmpBuff[10], (uint8_t)tmpBuff[12] );
}
--- /dev/null
+#pragma once
+
+#include <iostream>
+
+#define MESSAGE_SIZES_LIST 32, 64, 128, 256, 512, 1024, 4096
+#define MESSAGE_POOL_INIT NULL, NULL, NULL, NULL, NULL, NULL, NULL
+#define MESSAGE_POOL_COUNT_INIT 0, 0, 0, 0, 0, 0, 0
+#define MESSAGE_SIZES_NB 7
+#define MESSAGE_ALLOC_NB 4
+
+struct PMsgData {
+ PMsgData* mNextMsgData;
+ uint8_t* mBuffer; // NB: no need to manage buffer deletion atm, as they will stay until server end
+};
+//NB: putting mPoolId & mMaxSize in PMsgData rather than PMessage would be cleaner, but would put more mem overhead on each buffer
+// Doesn't matter much as PMsgData management is done only through PMessage
+
+class PMessage {
+ private:
+ static const uint16_t smMsgSizes[MESSAGE_SIZES_NB];
+ static PMsgData* smMsgPoolHead[MESSAGE_SIZES_NB];
+ static int smMsgPoolCount[MESSAGE_SIZES_NB];
+ static int smMsgCount; //Used to trace unreleased messages with CheckMsgCount()
+
+ uint8_t mPoolId;
+ uint16_t mMaxSize;
+ PMsgData* mData;
+ uint16_t mUsedSize;
+ uint16_t mNextByteOffset;
+
+ void GetMsgBuffer(uint16_t nRequestedSize = 0); // the requested size is just a hint to avoid internal reaffectation of buffer
+ void ReleaseMsgBuffer();
+ void CheckAndExtend(uint16_t nRequestedSize); // This is SIZE checked, not max OFFSET
+ inline void UpdateUsedSize() { if (mNextByteOffset > mUsedSize) mUsedSize = mNextByteOffset; }
+
+ public:
+ static void CheckMsgCount(); //To be used in a place where no new message should remain between calls
+
+ PMessage(uint16_t nRequestedSize = 0); // max size will be extended as needed in later write accesses (up to max configured size)
+ PMessage(PMessage& nMessage); // creates a (size optimized, offset reset) copy of nMessage
+ inline ~PMessage() { ReleaseMsgBuffer(); --smMsgCount; }
+
+ void SetNextByteOffset(uint16_t nPos);
+ inline void IncreaseNextByteOffset(uint16_t nIncrement) { SetNextByteOffset(mNextByteOffset + nIncrement); }
+ inline void SetNextByteAtEnd() { mNextByteOffset = mUsedSize; }
+ inline uint16_t GetNextByteOffset() { return mNextByteOffset; }
+ void ForceSize(uint16_t nUsedSize);
+ inline uint16_t GetSize() { return mUsedSize; }
+ inline uint16_t GetMaxSize() { return mMaxSize; }
+ inline bool EOM() {return (mNextByteOffset >= mUsedSize);} // End Of Message
+
+ // Writing methods
+ uint8_t* GetMessageDataPointer(uint16_t nUsedSize); // extends buffer as needed by nUsedSize, and sets UsedSize at min nUsedSize
+ PMessage& Fill(uint8_t Value = 0, uint16_t StartOffset = 0, uint16_t FillSize = 0); // !!! Does NOT update UsedSize, fills only up to current maxSize
+ inline PMessage& Reset() { mNextByteOffset = mUsedSize = 0; return *this; }
+ inline PMessage& Clear() { return this->Fill(0).Reset(); }
+ PMessage& Write(const void* nData, uint16_t nLength);
+ PMessage& operator << (PMessage& nMessage);
+ PMessage& operator << (const char* nString); //for null terminated string ! Copies includes ending \0
+ inline PMessage& operator << (std::string& nString) { return (*this << nString.c_str()); }
+ PMessage& operator << (uint8_t nU8);
+ inline PMessage& operator << (char nChar) { return (*this << (uint8_t) nChar);}
+ PMessage& operator << (uint16_t nU16);
+ PMessage& operator << (uint32_t nU32);
+ PMessage& operator << (float nF32);
+
+ // Mixt methods
+
+ //The next 3 methods do NOT update NextByteOffset, but DO increase message size (UsedSize ans MaxSize) as needed by nOffset.
+ uint8_t& U8Data(uint16_t nOffset);
+ uint16_t& U16Data(uint16_t nOffset);
+ uint32_t& U32Data(uint16_t nOffset);
+ float& F32Data(uint16_t nOffset);
+
+ // *** didn't managed to overload [] operator :-/
+ inline uint8_t& operator [] (uint16_t nOffset) { return U8Data(nOffset); }
+ //inline u16& operator [] (u16 nOffset) { return U16Data(nOffset); }
+ //u32& operator [] (u16 nOffset);
+
+ // Really makes a different message instance, with all data copied (no data shared)
+ PMessage& operator = (PMessage& nMessage);
+
+ // Reading methods
+ // ChunkNumber count from 0, return NULL for empty chunk (ie StartOffset is over UsedSize). NextByteOffset NOT updated
+ PMessage* GetChunk(uint16_t StartOffset, uint16_t ChunkSize, uint16_t ChunkNumber = 0);
+
+ // Return pointer to the START of message data.
+ inline uint8_t const* GetMessageData() { return mData->mBuffer; }
+
+ //Following methods do NOT extend message or Used, and return 0/empty string if over UsedSize
+ PMessage& operator >> (std::string& nString); //read up to null or EOM
+ PMessage& operator >> (uint8_t& nU8);
+ inline PMessage& operator >> (char& nChar) { return (*this >> (uint8_t&) nChar);}
+ PMessage& operator >> (uint16_t& nU16);
+ PMessage& operator >> (uint32_t& nU32);
+ PMessage& operator >> (float& nF32);
+
+ // info/debug methods
+ static void ListPools();
+ static void DumpPools();
+ void Dump();
+ void DumpHead(char* nComment = "");
+};
-/*\r
- TinNS (TinNS is not a Neocron Server)\r
- Copyright (C) 2005 Linux Addicted Community\r
- maintainer Akiko <akiko@gmx.org>\r
-\r
- This program is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU General Public License\r
- as published by the Free Software Foundation; either version 2\r
- of the License, or (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
- 02110-1301, USA.\r
-*/\r
-\r
-\r
-\r
-/*\r
- misc.cpp\r
-\r
- Authors:\r
- - Akiko\r
- - Namikon\r
- - someone else?\r
-\r
- MODIFIED: Unknown date / Unknown author\r
- REASON: - initial release by unknown\r
-\r
- MODIFIED: 25 Dec 2005 Namikon\r
- REASON: - Added GPL\r
- MODIFIED: 07 Jan 2006 Namikon\r
- REASON: - Added function to trim a string/char\r
- MODIFIED: 01 Jul 2006 hammag\r
- REASON: - add IPlongToString()\r
- MODIFIED: 27 Aug 2006 Hammag\r
- REASON: - Merged misc function from all 3 servers\r
- MODIFIED: 11 Dec 2006 Hammag\r
- REASON: - Commented out GetSVNRev() that is not used anymore\r
-\r
- TODO:\r
- - Put Network Utility function in a netutility.cpp in netcode\r
- - Put GetAccessString() as a static member of Accounts class\r
-*/\r
-\r
-#include "main.h"\r
-\r
-u32 IPStringToDWord( const char *IP )\r
+#include "common/misc.h"\r
+\r
+#include <cstring>\r
+#include <cstdarg>\r
+#include <netinet/in.h>\r
+#include <arpa/inet.h>\r
+#include "common/console.h"\r
+\r
+uint32_t IPStringToDWord( const char *IP )\r
{\r
if ( !IP )\r
return 0;\r
\r
- u32 a, b, c, d;\r
+ uint32_t a, b, c, d;\r
if ( std::sscanf( IP, "%u.%u.%u.%u", &a, &b, &c, &d ) != 4 )\r
return 0;\r
\r
return ( d << 24 ) | ( c << 16 ) | ( b << 8 ) | a;\r
}\r
\r
-char *IPlongToString( const u32 IP )\r
+char *IPlongToString( const uint32_t IP )\r
{\r
struct in_addr in_IP;\r
\r
//NEW\r
//this function allow to print a packet\r
//just for tracking values\r
-void PrintPacket( u8 *Packet, int PacketSize )\r
+void PrintPacket( uint8_t *Packet, int PacketSize )\r
{\r
Console->Print( "inside : PrintPacket" );\r
\r
{\r
Console->Print( "PacketSize is : %d", PacketSize );\r
\r
- u8 value = 0;\r
+ uint8_t value = 0;\r
for ( int i = 0;i < PacketSize;i++ )\r
{\r
- value = *( u8* ) & Packet[i];\r
+ value = *( uint8_t* ) & Packet[i];\r
Console->Print( "value[%d] is : %x", i, value );\r
}\r
}\r
if(nString->length() > 3)\r
{\r
size_t tfound;\r
- string t_replacechr ("\"");\r
+ std::string t_replacechr ("\"");\r
\r
tfound = nString->find(t_replacechr);\r
- while(tfound != string::npos)\r
+ while(tfound != std::string::npos)\r
{\r
nString->replace(tfound, 1, " ");\r
tfound = nString->find( t_replacechr, tfound +1 );\r
}\r
}\r
\r
+\r
void Trim( char *t )\r
{\r
RTrim( t );\r
void LTrim( std::string *stString )\r
{\r
unsigned int i; //Count VAR\r
- string buf; //Temp String VAR\r
+ std::string buf; //Temp String VAR\r
\r
if ( !stString->length() ) return; //If The Length Is 0\r
\r
return tmpstring;\r
}\r
\r
-u16 DistanceApprox( const u16 x1, const u16 y1, const u16 z1, const u16 x2, const u16 y2, const u16 z2 )\r
+uint16_t DistanceApprox( const uint16_t x1, const uint16_t y1, const uint16_t z1, const uint16_t x2, const uint16_t y2, const uint16_t z2 )\r
{\r
- u16 DX, DY, DZ, DMax;\r
- u32 DMinSum, DApprox;\r
+ uint16_t DX, DY, DZ, DMax;\r
+ uint32_t DMinSum, DApprox;\r
\r
DMax = DX = ( x1 >= x2 ) ? x1 - x2 : x2 - x1;\r
DMinSum = DY = ( y1 >= y2 ) ? y1 - y2 : y2 - y1;\r
DMinSum += DZ;\r
}\r
\r
- DApprox = DMax + ( u32 )( 0.33 * DMinSum );\r
+ DApprox = DMax + ( uint32_t )( 0.33 * DMinSum );\r
if ( DApprox > 65535 )\r
{\r
DApprox = 65535;\r
if (fDist != 0) Console->Print("Dist: %f\tApprox: %d\tError: %d (%d%)", fDist, DApprox, (int)(DApprox-fDist), (int)(100*(DApprox-fDist)/fDist));\r
*/\r
\r
- return ( u16 )DApprox;\r
+ return ( uint16_t )DApprox;\r
}\r
\r
/*** Portable pseudo-random number generator ***/\r
// until native standardized C++ lib support\r
\r
-u32 mInternalRand = 1;\r
+uint32_t mInternalRand = 1;\r
\r
-void InitRandom( u32 nInitialisationValue )\r
+void InitRandom( uint32_t nInitialisationValue )\r
{\r
mInternalRand = nInitialisationValue;\r
}\r
\r
-u16 GetRandom( u16 MaxVal, u16 MinVal )\r
+uint16_t GetRandom( uint16_t MaxVal, uint16_t MinVal )\r
{\r
mInternalRand = mInternalRand * 1103515245 + 12345; //from rand() manpage\r
- return ( u16 )( MinVal + (( mInternalRand >> 16 ) % 32768 % ( MaxVal - MinVal + 1 ) ) );\r
+ return ( uint16_t )( MinVal + (( mInternalRand >> 16 ) % 32768 % ( MaxVal - MinVal + 1 ) ) );\r
}\r
\r
-f32 GetRandomFloat()\r
+float GetRandomFloat()\r
{\r
mInternalRand = mInternalRand * 1103515245 + 12345; //from rand() manpage\r
- return (( f32 )(( mInternalRand >> 16 ) % 32768 ) / ( f32 )32768 );\r
+ return (( float )(( mInternalRand >> 16 ) % 32768 ) / ( float )32768 );\r
}\r
--- /dev/null
+#pragma once\r
+\r
+#include <iostream>\r
+#include <string>\r
+\r
+uint32_t IPStringToDWord(const char *IP);\r
+char *IPlongToString(const uint32_t IP);\r
+std::string GetAccessString(int level);\r
+//void GetSVNRev(char *version);\r
+\r
+void PrintPacket(uint8_t *Packet, int PacketSize);\r
+\r
+// Cleanup for strings read from .def\r
+void CleanUpString(std::string *nString);\r
+void Trim(char *t);\r
+void Trim(std::string *stString);\r
+void RTrim(char *t);\r
+void RTrim(std::string *stString);\r
+void LTrim(char *t);\r
+void LTrim(std::string *stString);\r
+std::string &Ssprintf(const char *fmt, ...);\r
+\r
+uint16_t DistanceApprox(const uint16_t x1, const uint16_t y1, const uint16_t z1, const uint16_t x2, const uint16_t y2, const uint16_t z2);\r
+float Distance(const float x1, const float y1, const float z1, const float x2, const float y2, const float z2);\r
+float Distance(const float x1, const float y1, const float x2, const float y2); // 2D only version\r
+\r
+void InitRandom(uint32_t nInitialisationValue);\r
+uint16_t GetRandom(uint16_t MaxVal, uint16_t MinVal = 0); // u16 value between MinVal and MaxVal (inclusive) with max range 32768\r
+float GetRandomFloat(); // f32 value between 0 and 1\r
+++ /dev/null
-#
-# TinNS per-directory Makefile
-#
-# Adapted by Hammag from the Makefile system for Linux kernel.
-#
-# 14 Sep 2000, Christoph Hellwig <hch@infradead.org>
-# Rewritten to use lists instead of if-statements.
-#
-
-######################################################
-# Target for this directory and its sub-dirs
-######################################################
-# Case 1 : target is an executable named as defined
-#B_TARGET := testor2
-
-# Case 2 : target is a TinNS lib name
-# (use short name, as in -l linker option)
-L_TARGET := tinns
-
-# Case 3 (usual): objects shall be made available to the parent dir
-# The following line will set that automatically
-# (Should match dir name + .o suffix)
-#O_TARGET := $(addsuffix .o,$(notdir $(shell /bin/pwd)))
-# Manualy define this only if you need to force the compiled obj name
-#O_TARGET := game.o
-
-
-######################################################
-# Local flags
-######################################################
-# local dir CXX Flags
-#EXTRA_CXXFLAGS := -I/usr/include/mysql
-
-# per-object CXX Flags
-#CXXFLAGS_funcdef2.o := -g
-
-# local dir Linker Flags (for intermediate .o linking)
-#EXTRA_LDFLAGS :=
-
-# any tinns Lib used (short name, as in -l linker option)
-#LINK_TINNSLIBS := tinns
-
-# local dir Linker Flags (for final executable linking)
-#EXTRA_LINKFLAGS := -lrt -lpthread -lz -lm -lcrypt -L"/usr/lib/mysql" -lmysqlclient
-
-
-#####################################################
-# Subdirectories
-#####################################################
-#subdir-y := def
-#subdir-$(CONFIG_GAMEMONKEY) += gamemonkey
-
-
-#####################################################
-#***************************************************#
-# No further config should be needed after this line
-#***************************************************#
-ifdef TOPDIR
-
-# build list of objects ib loca ldir
-obj-y := $(patsubst %.cpp,%.o,$(wildcard *.cpp))
-# add final object from each subdir
-obj-y += $(join $(subdir-y),$(subdir-y:%=/%.o))
-
-include $(TOPDIR)/Rules.make
-
-else #TOPDIR undef, Makefile called from non-top dir
-
-# Memorize the first calling dir in case we wanted to
-# lauch local actions from top Makefile
- ifndef FIRSTDIR
- FIRSTDIR :=$(CURDIR)
- export FIRSTDIR
- endif
-
-uptoparent :
- $(MAKE) -C .. $(MAKECMDGOALS)
-
-.DEFAULT :
- $(MAKE) -C .. $(MAKECMDGOALS)
-
-endif #TOPDIR
-
+++ /dev/null
-/*\r
- TinNS (TinNS is not a Neocron Server)\r
- Copyright (C) 2005 Linux Addicted Community\r
- maintainer Akiko <akiko@gmx.org>\r
-\r
- This program is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU General Public License\r
- as published by the Free Software Foundation; either version 2\r
- of the License, or (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
- 02110-1301, USA.\r
-*/\r
-\r
-\r
-\r
-/*\r
- main.h - main include file, contains all needed includes and important definitions\r
-\r
- MODIFIED: 27 Aug 2006 Hammag\r
- REASON: - created \r
- \r
-*/\r
-\r
-#ifndef MAIN_H\r
-#define MAIN_H\r
-\r
-//#include "version.h"\r
-\r
-//basic includes\r
-#include "external.h"\r
-#include <arpa/inet.h> // needed fo inet_ntoa() in IPlongToString()\r
-\r
-//tinns includes\r
-#include "types.h"\r
-#include "misc.h"\r
-\r
-#include "console.h"\r
-\r
-using namespace std;\r
-\r
-// Better change that to a static members if needed (PrintPacket could be outdated, or put in netcode)\r
-extern class PConsole* Console;\r
-\r
-#endif\r
--- /dev/null
+#include "common/netcode.h"
+
+#include <cstring>
+#include <fcntl.h>
+#include <unistd.h>
+#include <arpa/inet.h>
+#include "common/console.h"
+#include "common/config.h"
+
+ConnectionTCP::ConnectionTCP(int sockfd, struct sockaddr_in addr, ServerSocket* server)
+{
+ mSockfd = sockfd;
+ mRemoteAddr = addr;
+
+ if(server)
+ {
+ mServerSocket = server;
+ }
+
+ // set new socket to non-blocking
+ fcntl(mSockfd, F_SETFL, O_NONBLOCK);
+
+ mbConnected = true; // client obviously is connected at creation...
+
+ mTimeOutValue = DEFAULT_TCP_TIMEOUT;
+ mLastActive = std::time(NULL);
+
+ mReceiveBufferMsg = NULL;
+ mSendBufferMsg = NULL;
+}
+
+ConnectionTCP::~ConnectionTCP()
+{
+ if (mServerSocket)
+ {
+ mServerSocket->delSocketFromSet(mSockfd);
+ }
+ close(mSockfd);
+
+ if (mReceiveBufferMsg)
+ {
+ delete mReceiveBufferMsg;
+ }
+
+ while (!mQueueIn.empty())
+ {
+ delete mQueueIn.front();
+ mQueueIn.pop();
+ }
+
+ if (mSendBufferMsg)
+ {
+ delete mSendBufferMsg;
+ }
+}
+
+char* ConnectionTCP::getRemoteAddress()
+{
+ return inet_ntoa(mRemoteAddr.sin_addr);
+}
+
+bool ConnectionTCP::timeOut() const
+{
+ time_t now = std::time(NULL);
+ if((now-mLastActive) >= mTimeOutValue)
+ return true;
+
+ return false;
+}
+
+PMessage* ConnectionTCP::GetMessage()
+{
+ PMessage* RetVal;
+
+ if (mQueueIn.empty())
+ RetVal = NULL;
+ else
+ {
+ RetVal = mQueueIn.front();
+ mQueueIn.pop();
+ }
+ return RetVal;
+}
+
+void ConnectionTCP::DeleteOutgoingMessages()
+{
+ while (! mQueueOut.empty())
+ {
+ delete mQueueOut.front();
+ mQueueOut.pop();
+ }
+}
+
+bool ConnectionTCP::update() // non optimal read-algorithm atm, but well ... :p
+{
+ PMessage* tmpMsg;
+ int numBytes;
+ uint8_t const* DataStart;
+ uint16_t DataSize;
+ uint8_t* MsgStart;
+ uint16_t MsgOffset;
+ uint16_t MsgLen;
+
+ //check if data is available for this socket and if yes, read into a new PMessage and put it on incoming queue
+ if(mServerSocket->isDataAvailable(mSockfd))
+ {
+//Console->Print("ConnectionTCP::update() - IN Data avail");
+ if (mReceiveBufferMsg == NULL)
+ {
+ mReceiveBufferMsg = new PMessage(RECVBUFFERSIZE);
+ }
+
+ DataSize = mReceiveBufferMsg->GetSize();
+ numBytes = recv(mSockfd, (char*) mReceiveBufferMsg->GetMessageDataPointer(RECVBUFFERSIZE - DataSize) + DataSize, RECVBUFFERSIZE - DataSize, 0); // get the data
+
+ if(numBytes > 0)
+ {
+//Console->Print(GREEN, BLACK, "ConnectionTCP::update() - Data received");
+ mbConnected = true;
+ mReceiveBufferMsg->ForceSize(DataSize + numBytes);
+ mLastActive = std::time(NULL);
+
+ while(mReceiveBufferMsg && mReceiveBufferMsg->GetSize())
+ {
+ DataStart = mReceiveBufferMsg->GetMessageData();
+ DataSize = mReceiveBufferMsg->GetSize();
+ MsgStart = (uint8_t*)memchr(DataStart, 0xfe, DataSize);
+
+ if (MsgStart)
+ {
+ MsgOffset = MsgStart - DataStart;
+ if (MsgOffset)
+ {
+ Console->Print(YELLOW, BLACK, "ConnectionTCP::update() Message head found 0x%04hx bytes after packet start. Inbetween data will be discarded.", MsgOffset);
+ }
+ if (MsgOffset + 3 <= DataSize)
+ {
+ MsgLen = *(uint16_t*)(DataStart + MsgOffset + 1);
+//Console->Print(GREEN, BLACK, "ConnectionTCP::update() TCP Message body length 0x%04hx (buffer 0x%04hx)", MsgLen, mReceiveBufferMsg->GetSize());
+ if (MsgOffset + 3 + MsgLen <= DataSize)
+ {
+ tmpMsg = mReceiveBufferMsg->GetChunk(MsgOffset, MsgLen + 3); // Change (MsgOffset, MsgLen + 3) to (MsgOffset + 3, MsgLen) to REMOVE head & length from message head
+ mQueueIn.push(tmpMsg);
+
+ if (MsgOffset + 3 + MsgLen < DataSize)
+ {
+ tmpMsg = mReceiveBufferMsg->GetChunk(MsgOffset + 3 + MsgLen, DataSize - (MsgOffset + 3 + MsgLen));
+ }
+ else
+ {
+ tmpMsg = NULL;
+ }
+
+ delete mReceiveBufferMsg;
+ mReceiveBufferMsg = tmpMsg;
+ }
+ }
+ }
+ else
+ {
+ break;
+ }
+ }
+ }
+ else if(numBytes == 0) // disconnected !!
+ {
+ mbConnected = false; // set to not-connected and close the socket
+ if (mServerSocket)
+ {
+ mServerSocket->delSocketFromSet(mSockfd);
+ }
+ close(mSockfd);
+ return false;
+ }
+ else
+ {
+ if(errno != EAGAIN)
+ { // an error has occured -> output it to the console
+ perror("tcp-receive");
+ Console->Print(RED, BLACK, "mSockfd:%d MaxRead:%d ", mSockfd, RECVBUFFERSIZE);
+ }
+ }
+ }
+
+ // send data from outgoing queue
+ flushSendBuffer(); // manage old write compatibility
+ while(! mQueueOut.empty())
+ {
+//Console->Print("ConnectionUDP::update() - OUT Data avail");
+ tmpMsg = mQueueOut.front();
+ int numBytes = send(mSockfd, (char*) tmpMsg->GetMessageData(), tmpMsg->GetSize(), 0);
+ if(numBytes == -1) // error while sending data -> output error-msg to console
+ {
+ if (errno == EAGAIN)
+ {
+ break;
+ }
+ else
+ {
+ perror("tcp-send");
+ //close(mSockfd);
+ return false;
+ }
+ }
+ else if(numBytes > 0)
+ {
+//Console->Print(GREEN, BLACK, "ConnectionTCP::update() - Data sent");
+ mLastActive = std::time(NULL);
+ mQueueOut.pop(); // message written, we can remove it from queue
+ delete tmpMsg; // and delete the message
+ }
+ }
+
+ return true;
+}
+
+/**** Old I/F compatibility functions ****/
+
+int ConnectionTCP::getRecvBufferSize()
+{
+ PMessage* tmpMsg;
+
+ if (mQueueIn.empty())
+ return 0;
+
+ tmpMsg = mQueueIn.front();
+ uint16_t _size = tmpMsg->GetSize()-tmpMsg->GetNextByteOffset();
+ if (_size <= 0)
+ {
+ mQueueIn.pop();
+ delete tmpMsg;
+ if (mQueueIn.empty())
+ return 0;
+ tmpMsg = mQueueIn.front();
+ tmpMsg->SetNextByteOffset(0);
+ _size = tmpMsg->GetSize();
+ }
+ return _size;
+}
+
+int ConnectionTCP::getSendBufferSize()
+{
+ if(mSendBufferMsg == NULL)
+ return 0;
+ else
+ return mSendBufferMsg->GetSize();
+}
+
+void ConnectionTCP::flushSendBuffer()
+{
+//Console->Print("ConnectionTCP::flushSendBuffer()");
+ if((mSendBufferMsg != NULL) && (mSendBufferMsg->GetSize() > 0))
+ {
+ SendMessage(mSendBufferMsg);
+ mSendBufferMsg = NULL;
+//Console->Print(YELLOW, BLACK, "ConnectionTCP::flushSendBuffer() - Data flushed");
+ }
+}
+
+const uint8_t* ConnectionTCP::read(int* size)
+{
+ PMessage* tmpMsg;
+//Console->Print("ConnectionTCP::read() - trying to read up to %d bytes", *size);
+ if (mQueueIn.empty() || !size)
+ {
+//Console->Print("ConnectionTCP::read() - no more packet");
+ return NULL;
+ }
+
+ tmpMsg = mQueueIn.front();
+ uint16_t _size = tmpMsg->GetSize()-tmpMsg->GetNextByteOffset();
+//Console->Print("ConnectionTCP::read() - %d bytes remaining in current packet", _size);
+ if (_size <= 0)
+ {
+//Console->Print("ConnectionTCP::read() - trying next packet");
+ mQueueIn.pop();
+ delete tmpMsg;
+ if (mQueueIn.empty())
+ {
+//Console->Print("ConnectionUDP::read() - no more packet");
+ return NULL;
+ }
+ tmpMsg = mQueueIn.front();
+ _size = tmpMsg->GetSize();
+ tmpMsg->SetNextByteOffset(0);
+ }
+
+ if(*size==0)
+ {
+ *size=_size;
+ }
+ else
+ {
+ *size = std::min(*size, (int32_t)_size);
+ }
+
+ uint8_t const* ptr = tmpMsg->GetMessageData() + tmpMsg->GetNextByteOffset();
+ tmpMsg->SetNextByteOffset(tmpMsg->GetNextByteOffset()+ *size);
+//Console->Print(GREEN, BLACK, "ConnectionTCP::read() - %d bytes read", *size);
+ return ptr;
+}
+
+int ConnectionTCP::write(const void* data, int size)
+{
+ // data is stored in mSendBufferMsg. Gets queued in next flushSendBuffer() or update()
+ if (mSendBufferMsg == NULL)
+ {
+//Console->Print("ConnectionTCP::write() creating new mSendBufferMsg");
+ mSendBufferMsg = new PMessage(SENDBUFFERSIZE);
+ }
+
+ mSendBufferMsg->Write(data, (uint16_t)size);
+//Console->Print(GREEN, BLACK, "ConnectionUDP::write() %d bytes written to mSendBufferMsg (total size %d)", size, mSendBufferMsg->GetSize());
+ return size;
+}
+
+int ConnectionTCP::write(const char *String)
+{
+ if(!String)
+ return 0;
+
+ return write(String, strlen(String));
+}
+
+int ConnectionTCP::write(uint8_t Data)
+{
+ return write(&Data, sizeof(uint8_t));
+}
+
+int ConnectionTCP::write(uint16_t Data)
+{
+ return write(&Data, sizeof(uint16_t));
+}
+
+int ConnectionTCP::write(uint32_t Data)
+{
+ return write(&Data, sizeof(uint32_t));
+}
+
+int ConnectionTCP::write(float Data)
+{
+ return write(&Data, sizeof(float));
+}
+
+int ConnectionTCP::write(double Data)
+{
+ return write(&Data, sizeof(double));
+}
+
+ConnectionUDP::ConnectionUDP(int sockfd, int port, int remoteadress, int remoteport, ServerSocket* server)
+{
+ mSockfd = sockfd;
+ mPort = port;
+ //Console->Print("local UDP port: %d", port);
+ if(server)
+ {
+ mServerSocket = server;
+ }
+
+ mTimeOutValue = DEFAULT_UDP_TIMEOUT;
+ mLastActive = std::time(NULL);
+
+ mRemoteAddr.sin_family = AF_INET; // host byte order
+ mRemoteAddr.sin_port = htons(remoteport); // short, network byte order
+ mRemoteAddr.sin_addr.s_addr = remoteadress; // TODO: Get IP of client
+
+ //Bind client to server in a udp pseudo-connection
+ /*if(connect(sockfd, (struct sockaddr *)&mRemoteAddr, sizeof(struct sockaddr )))
+ {
+ Console->Print("Error on pseudo-connecting udp socket to %s:%d", inet_ntoa(mRemoteAddr.sin_addr),ntohs(mRemoteAddr.sin_port));
+ perror("udp connect"); //exception should be thrown here
+ }
+ else */
+ {
+ Console->Print("Client UDP %s:%d", inet_ntoa(mRemoteAddr.sin_addr), ntohs(mRemoteAddr.sin_port));
+ }
+ // set UDP-socket to non-blocking
+ fcntl(sockfd, F_SETFL, O_NONBLOCK);
+
+ // mRemoteAddr.sin_addr.s_addr = INADDR_ANY; // automatically fill with my IP
+ // memset(&(mRemoteAddr.sin_zero), '\0', 8); // zero the rest of the struct
+ mSendBufferMsg = NULL;
+
+ mUDP_ID = 0;
+ mSessionID = SESSION_UDP_OFFSET;
+ mLastUDPID = 0;
+ mTransactionID = 0;
+}
+
+
+ConnectionUDP::~ConnectionUDP()
+{
+ if (mServerSocket)
+ {
+ mServerSocket->delSocketFromSet(mSockfd);
+ }
+ close(mSockfd);
+
+ if (mSendBufferMsg)
+ {
+ delete mSendBufferMsg;
+ }
+
+ while (!mQueueIn.empty())
+ {
+ delete mQueueIn.front();
+ mQueueIn.pop();
+ }
+
+ while (!mQueueOut.empty())
+ {
+ delete mQueueOut.front();
+ mQueueOut.pop();
+ }
+ while (!mVIPQueueOut.empty())
+ {
+ delete mVIPQueueOut.front();
+ mVIPQueueOut.pop();
+ }
+ for(PMessageMap::iterator it=UDPMessages.begin(); it!=UDPMessages.end(); it++)
+ {
+ delete it->second;
+ UDPMessages.erase(it);
+ }
+}
+
+void ConnectionUDP::InsertUDPMessage(PMessage* nMsg)
+{
+ if (!nMsg)
+ return;
+
+ if(nMsg->U8Data(0) != 0x13) return; // Only add real UDP messages here
+// 0 1 2 3 4 5 6 7 8 9 a b c d e f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28
+// 13 07 00 F2 00 05 03 02 00 11 11 05 03 03 00 11 11 05 03 04 00 11 11 05 03 05 00 11 11 05 03 06 00 11 11 05 03 07 00 11 11
+
+ // Grab submessages from packet, check if message is 0x03 commandset. If not, dont add message
+ PMessage* tWorkMsg = NULL;
+
+ uint16_t tCurPos = 5;
+ uint8_t tSubMsgLen = 0;
+ uint16_t tmpUDPID = 0;
+ //nMsg->Dump();
+ while(tCurPos < (nMsg->GetSize() - 1)) // Loop while we still have more frames. (-1: GetSize starts at 1, pos pointer at 0)
+ {
+ //Console->Print("tCurPos = %d nMsg->GetSize = %d", tCurPos, nMsg->GetSize());
+ tSubMsgLen = nMsg->U8Data(tCurPos) + 1; // Get the lenght of the frame, and add the lenght byte
+ if(nMsg->U8Data(tCurPos+1) != 0x03)
+ {
+ //Console->Print("Ignoring UDP message, no 0x03 commandset");
+ tCurPos += tSubMsgLen; // Set pointer to the end of this frame
+ continue; // Skip if frame is not an 0x03 commandset
+ }
+ //Console->Print("MsgLen: %d", tSubMsgLen);
+ tWorkMsg = nMsg->GetChunk(tCurPos, tSubMsgLen); // get the frame.
+ //Console->Print("Msg:");
+ //tWorkMsg->Dump();
+ tmpUDPID = nMsg->U16Data(tCurPos + 2); // Get the UDP ID of this frame
+ //Console->Print("UDP ID: %d", tmpUDPID);
+ PMessageMap::const_iterator it = UDPMessages.find(tmpUDPID); // Try to find the UDP ID in the queue
+ if(it->second) // If we already have this UDP msg, print error
+ {
+ Console->Print("%s Packet *NOT* added to history buffer, UdpID %d already sent! (This may cause an OOO)", Console->ColorText(RED, BLACK, "[WARNING]"), tmpUDPID);
+ nMsg->Dump();
+ }
+ else // We dont have this msg? Add it!
+ {
+ //Console->Print("Added UDP ID %d to messagebuffer", tmpUDPID);
+ UDPMessages.insert(std::make_pair(tmpUDPID, tWorkMsg));
+ mLastUDPID++;
+ }
+ tCurPos += tSubMsgLen; // Set pointer to the end of this frame
+ }
+}
+
+void ConnectionUDP::UpdateMessageBuffer()
+{
+ int erasednum = 0;
+ // Delete all old messages
+ for(PMessageMap::iterator it=UDPMessages.begin(); it!=UDPMessages.end(); it++)
+ {
+ if((int)it->first < (int)(mLastUDPID - MAX_RETENTION))
+ {
+ erasednum++;
+ delete it->second;
+ UDPMessages.erase(it);
+ }
+ }
+ /* // Debug output
+ if(erasednum > 0)
+ Console->Print("[UpdateMessageBuffer] Done updating messagequeue, %d entries deleted", erasednum);
+ */
+}
+
+void ConnectionUDP::ResetMessageBuffer()
+{
+ if(mUDP_ID != 0)
+ {
+ Console->Print("%s MessageQueue got erased but UDP_ID is still >0", Console->ColorText(RED, BLACK, "[WARNING]"));
+ }
+ for(PMessageMap::iterator it=UDPMessages.begin(); it!=UDPMessages.end(); it++)
+ {
+ delete it->second;
+ UDPMessages.erase(it);
+ }
+ mLastUDPID = 0;
+// Console->Print("[udpmanager] Erased messagebuffer");
+}
+
+void ConnectionUDP::ReSendUDPMessage(uint16_t nUDP_ID)
+{
+ // ReSend packet with given UDP_ID
+ if(nUDP_ID > mLastUDPID)
+ {
+ Console->Print("%s Cannot resend packet with UDP_ID %d, msgnumber is higher than last known udpID", Console->ColorText(RED, BLACK, "[PANIC]"), nUDP_ID);
+ }
+ else
+ {
+ // UDP_ID seems to be valid, now search for it
+ PMessageMap::const_iterator it = UDPMessages.find(nUDP_ID);
+ if(it == UDPMessages.end())
+ {
+ int dynRetention = (int)mLastUDPID - nUDP_ID;
+ if(dynRetention > MAX_RETENTION)
+ {
+ Console->Print("%s Packet with UDP_ID %d not found. Increase #define MAX_RETENTION to at least %d", Console->ColorText(RED, BLACK, "[WARNING]"), nUDP_ID, dynRetention);
+ }
+ else
+ {
+ Console->Print("%s Packet with UDP_ID %d is missing in the packet queue!", Console->ColorText(RED, BLACK, "[PANIC]"), nUDP_ID);
+ }
+ Console->Print("Trying to cancel OOO notice by sending dummy packet");
+ PMessage* tmpMsg = new PMessage(14);
+ //u16 tmpSessionID = mLastUDPID + SESSION_UDP_OFFSET;
+ *tmpMsg << (uint8_t)0x13;
+ *tmpMsg << nUDP_ID;
+ *tmpMsg << (uint16_t)(nUDP_ID + SESSION_UDP_OFFSET);
+ *tmpMsg << (uint8_t)0x08;
+ *tmpMsg << (uint8_t)0x03;
+ *tmpMsg << nUDP_ID;
+ *tmpMsg << (uint8_t)0x1F;
+ *tmpMsg << (uint16_t)0xFFFF; // Should do nothing, CharID 65535 should never exist
+ *tmpMsg << (uint16_t)0x3C01; // This value IS wrong way, so that nothing can happen at all
+ SendMessage(tmpMsg, true);
+ }
+ else if(it->second)
+ {
+ Console->Print("[OOO-Buster] ReSending UDP packet with ID %d", nUDP_ID);
+ // Build new message, including the missing UDP packets as content
+ uint16_t MsgSize = it->second->GetSize();
+ PMessage* tmpMsg = new PMessage(MsgSize + 5); // Create new message
+ *tmpMsg << (uint8_t)0x13;
+ *tmpMsg << nUDP_ID;
+ *tmpMsg << (uint16_t)(nUDP_ID + SESSION_UDP_OFFSET);
+// *tmpMsg << mUDP_ID;
+// *tmpMsg << mSessionID;
+// *tmpMsg << *it->second; // This should work, but it doesnt! Causes segfault after sending a few packets
+ for(int x = 0; x < MsgSize; x++)
+ {
+ *tmpMsg << it->second->U8Data(x);
+ }
+ SendMessage(tmpMsg, true); // Add message to outgoing VIP queue
+ }
+ }
+}
+
+bool ConnectionUDP::timeOut() const
+{
+ time_t now = std::time(NULL);
+ if((now-mLastActive) >= mTimeOutValue)
+ return true;
+
+ return false;
+}
+
+char* ConnectionUDP::getRemoteAddress()
+{
+ return inet_ntoa(mRemoteAddr.sin_addr);
+}
+
+PMessage* ConnectionUDP::GetMessage()
+{
+ PMessage* RetVal;
+
+ if (mQueueIn.empty())
+ RetVal = NULL;
+ else
+ {
+ RetVal = mQueueIn.front();
+ mQueueIn.pop();
+ }
+ return RetVal;
+}
+
+void ConnectionUDP::DeleteOutgoingMessages()
+{
+ while (! mQueueOut.empty())
+ {
+ PMessage* tmpMsg;
+ tmpMsg = mQueueOut.front();
+ mQueueOut.pop();
+ delete tmpMsg;
+ }
+ while (! mVIPQueueOut.empty())
+ {
+ PMessage* tmpMsg2;
+ tmpMsg2 = mVIPQueueOut.front();
+ mVIPQueueOut.pop();
+ delete tmpMsg2;
+ }
+}
+
+bool ConnectionUDP::update()
+{
+ PMessage* tmpMsg;
+ int numBytes;
+ bool gotVIPmsg;
+
+ // send data from outgoing queue
+ flushSendBuffer(); // manage old write compatibility
+
+ // Update messagebuffer; Erase all messages older than MAX_RETENTION
+ UpdateMessageBuffer();
+
+ if (! mQueueOut.empty() || ! mVIPQueueOut.empty())
+ {
+ //Console->Print(GREEN, BLACK, "ConnectionUDP::update() - Sending messages -----------------");
+ // Console->Print("ConnectionUDP::update() - %d messages waiting in Output Queue", mQueueOut.size());
+ while(! mQueueOut.empty() || ! mVIPQueueOut.empty())
+ {
+ //Console->Print("ConnectionUDP::update() - OUT Data avail");
+
+ // First, take a look at the VIP Query. If not empty, send these packets first
+ gotVIPmsg = false;
+ if(! mVIPQueueOut.empty())
+ {
+ tmpMsg = mVIPQueueOut.front();
+ gotVIPmsg = true;
+ Console->Print("ConnectionUDP::update() - Got VIP (Very important packet) that is waiting to be sent");
+ }
+ else
+ {
+ tmpMsg = mQueueOut.front();
+
+ // We ignore VIP packets for now. They are only meant to OOO packets
+ InsertUDPMessage(tmpMsg);
+ }
+ //int numBytes = send(mSockfd, tmpMsg->GetMessageData(), tmpMsg->GetSize(), 0);
+ int numBytes = sendto(mSockfd, (char*) tmpMsg->GetMessageData(), tmpMsg->GetSize(), 0, (struct sockaddr *)&mRemoteAddr, sizeof(struct sockaddr));
+ if(numBytes > 0)
+ {
+ //Console->Print(GREEN, BLACK, "ConnectionUDP::update() - Data sent");
+ mLastActive = std::time(NULL);
+ if(gotVIPmsg == true)
+ {
+ mVIPQueueOut.pop();
+ }
+ else
+ {
+ mQueueOut.pop(); // message written, we can remove it from queue
+ }
+ //Console->Print(GREEN, BLACK, "ConnectionUDP::update() - Message sent:");
+ //tmpMsg->DumpHead("OUT Msg:"); // ====
+ //tmpMsg->Dump();
+ delete tmpMsg; // and delete the message
+ }
+ else
+ {
+ if (errno == EAGAIN)
+ {
+ break;
+ }
+ else // error while sending data -> output error-msg to console
+ {
+ perror("udp-send2");
+ //close(mSockfd);
+ return false;
+ }
+ }
+ }
+ //if (! mQueueOut.empty())
+ // Console->Print(YELLOW, BLACK, "ConnectionUDP::update() - %d messages remaining in Output Queue", mQueueOut.size());
+ }
+
+ //check if data is available from this socket and if yes, read into a new PMessage and put it on incoming queue
+ if(mServerSocket->isDataAvailable(mSockfd))
+ {
+ //Console->Print("ConnectionUDP::update() - IN Data avail");
+ while (1)
+ {
+ tmpMsg = new PMessage(RECVBUFFERSIZE);
+ socklen_t addrlen;
+ addrlen = sizeof(mRemoteAddr);
+ //struct sockaddr_in tempAddr; // need to built in check,
+ // if the incoming data is coming from the client or someone else!
+ //numBytes = recv(mSockfd, tmpMsg->GetMessageDataPointer(RECVBUFFERSIZE), RECVBUFFERSIZE, 0); // get the data
+ numBytes = recvfrom(mSockfd, (char*) tmpMsg->GetMessageDataPointer(RECVBUFFERSIZE), RECVBUFFERSIZE, 0, (struct sockaddr *)&mRemoteAddr, &addrlen);
+ if(numBytes > 0)
+ {
+ //Console->Print(GREEN, BLACK, "ConnectionUDP::update() - Data received");
+ mLastActive = std::time(NULL);
+ tmpMsg->ForceSize(numBytes);
+ mQueueIn.push(tmpMsg);
+ //tmpMsg->DumpHead("IN Msg :"); // ====
+ }
+ else
+ {
+ delete tmpMsg;
+ if(errno != EAGAIN)
+ { // an error has occured -> output it to the console
+ perror("udp-receive");
+ Console->Print(RED, BLACK, "mSockfd:%d MaxRead:%d ", mSockfd, RECVBUFFERSIZE);
+ }
+ break;
+ }
+ }
+ //Console->Print("ConnectionUDP::update() - %d messages ready in Input Queue", mQueueIn.size());
+ }
+ return true;
+}
+
+void ConnectionUDP::SendMessage(PMessage* nMessage, bool nVIP)
+{
+ if (nMessage)
+ {
+ if(nVIP == true)
+ mVIPQueueOut.push(nMessage);
+ else
+ mQueueOut.push(nMessage);
+ }
+}
+
+/**************** Old I/F compatibility stuff ******************/
+
+int ConnectionUDP::getRecvBufferSize()
+{
+ PMessage* tmpMsg;
+
+ if (mQueueIn.empty())
+ return 0;
+
+ tmpMsg = mQueueIn.front();
+ uint16_t _size = tmpMsg->GetSize()-tmpMsg->GetNextByteOffset();
+ if (_size <= 0)
+ {
+ mQueueIn.pop();
+ delete tmpMsg;
+ if (mQueueIn.empty())
+ return 0;
+ tmpMsg = mQueueIn.front();
+ tmpMsg->SetNextByteOffset(0);
+ _size = tmpMsg->GetSize();
+ }
+ return _size;
+}
+
+int ConnectionUDP::getSendBufferSize()
+{
+ if(mSendBufferMsg == NULL)
+ return 0;
+ else
+ return mSendBufferMsg->GetSize();
+}
+
+void ConnectionUDP::flushSendBuffer()
+{
+ //Console->Print("ConnectionUDP::flushSendBuffer()");
+ if((mSendBufferMsg != NULL) && (mSendBufferMsg->GetSize() > 0))
+ {
+ SendMessage(mSendBufferMsg);
+ mSendBufferMsg = NULL;
+ //Console->Print(YELLOW, BLACK, "ConnectionUDP::flushSendBuffer() - Data flushed");
+ }
+}
+
+const uint8_t *ConnectionUDP::read(int *size)
+{
+ PMessage* tmpMsg;
+ //Console->Print("ConnectionUDP::read() - trying to read up to %d bytes", *size);
+ if (mQueueIn.empty() || !size)
+ {
+ //Console->Print("ConnectionUDP::read() - no more packet");
+ return NULL;
+ }
+
+ tmpMsg = mQueueIn.front();
+ uint16_t _size = tmpMsg->GetSize()-tmpMsg->GetNextByteOffset();
+ //Console->Print("ConnectionUDP::read() - %d bytes remaining in current packet", _size);
+ if (_size <= 0)
+ {
+ //Console->Print("ConnectionUDP::read() - trying next packet");
+ mQueueIn.pop();
+ delete tmpMsg;
+ if (mQueueIn.empty())
+ {
+ //Console->Print("ConnectionUDP::read() - no more packet");
+ return NULL;
+ }
+ tmpMsg = mQueueIn.front();
+ _size = tmpMsg->GetSize();
+ tmpMsg->SetNextByteOffset(0);
+ }
+
+ if(*size==0)
+ {
+ *size=_size;
+ }
+ else
+ {
+ *size = std::min(*size, (int32_t)_size);
+ }
+
+ uint8_t const *ptr = tmpMsg->GetMessageData() + tmpMsg->GetNextByteOffset();
+ tmpMsg->SetNextByteOffset(tmpMsg->GetNextByteOffset()+ *size);
+ //Console->Print(GREEN, BLACK, "ConnectionUDP::read() - %d bytes read", *size);
+ return ptr;
+}
+
+int ConnectionUDP::write(const void* data, int size)
+{
+ // data is stored in mSendBufferMsg. Gets queued in next flushSendBuffer() or update()
+ if (mSendBufferMsg == NULL)
+ {
+ //Console->Print("ConnectionUDP::write() creating new mSendBufferMsg");
+ mSendBufferMsg = new PMessage(SENDBUFFERSIZE);
+ }
+ mSendBufferMsg->Write(data, (uint16_t)size);
+ //Console->Print(GREEN, BLACK, "ConnectionUDP::write() %d bytes written to mSendBufferMsg (total size %d)", size, mSendBufferMsg->GetSize());
+ return size;
+}
+
+int ConnectionUDP::write(const char *String)
+{
+ if(!String)
+ return 0;
+
+ return write(String, strlen(String));
+}
+
+int ConnectionUDP::write(uint8_t Data)
+{
+ return write(&Data, sizeof(uint8_t));
+}
+
+int ConnectionUDP::write(uint16_t Data)
+{
+ return write(&Data, sizeof(uint16_t));
+}
+
+int ConnectionUDP::write(uint32_t Data)
+{
+ return write(&Data, sizeof(uint32_t));
+}
+
+int ConnectionUDP::write(float Data)
+{
+ return write(&Data, sizeof(float));
+}
+
+int ConnectionUDP::write(double Data)
+{
+ return write(&Data, sizeof(double));
+}
+
+/// ***********************************************
+
+void ConnectionUDP::SetUDP_ID(uint16_t id)
+{
+ if (mUDP_ID == 0xffff)
+ {
+ mUDP_ID = 0;
+ }
+ else
+ {
+ mUDP_ID = id;
+ }
+ if(mUDP_ID == 0) // If UDPID is set to zero, erase message buffer too
+ ResetMessageBuffer();
+}
+
+ServerSocket::ServerSocket()
+{
+ FD_ZERO(&m_MainSetTCP); // clear the master and temp sets
+ FD_ZERO(&m_ReadSetTCP);
+ FD_ZERO(&m_MainSetUDP);
+ FD_ZERO(&m_MainSetGlobal);
+
+ m_FdMaxUDP=0;
+
+ m_TimeOut.tv_sec = 0;
+ m_TimeOut.tv_usec = 30;
+
+ //m_LastUDPPort = 5000;
+}
+
+ServerSocket::~ServerSocket()
+{
+ close(m_ListenerTCP);
+}
+
+void ServerSocket::settimeout(int32_t timeout_sec, int32_t timeout_usec)
+{
+ if ((timeout_sec >= 0) && (timeout_usec >= 0))
+ {
+ m_TimeOut.tv_sec = timeout_sec;
+ m_TimeOut.tv_usec = timeout_usec;
+ }
+
+}
+
+bool ServerSocket::open(int port)
+{
+ // get the tcp listener
+ if ((m_ListenerTCP = socket(PF_INET, SOCK_STREAM, 0)) == -1)
+ {
+ perror("tcp-socket");
+ return false;
+ }
+
+ int yes=1;
+
+ // lose the pesky "address already in use" error message
+ if (setsockopt(m_ListenerTCP, SOL_SOCKET, SO_REUSEADDR, &yes,
+ sizeof(int)) == -1) {
+ perror("tcp-setsockopt");
+ return false;
+ }
+
+ // bind
+ memset(&m_ServerAddr,0,sizeof(struct sockaddr_in));
+ m_ServerAddr.sin_family = AF_INET;
+ m_ServerAddr.sin_addr.s_addr = INADDR_ANY;
+ m_ServerAddr.sin_port = htons(port);
+
+ // bind with tcp sockfd
+ if (bind(m_ListenerTCP, (struct sockaddr *)&m_ServerAddr, sizeof(struct sockaddr)) == -1)
+ {
+ perror("tcp-bind");
+ return false;
+ }
+
+ // set listening-socket to non-blocking
+ fcntl(m_ListenerTCP, F_SETFL, O_NONBLOCK);
+
+ // listen
+ if (listen(m_ListenerTCP, 10) == -1)
+ {
+ perror("tcp-listen");
+ return false;
+ }
+
+ FD_ZERO(&m_MainSetTCP);
+ FD_ZERO(&m_ReadSetTCP);
+ FD_ZERO(&m_MainSetUDP);
+ FD_ZERO(&m_MainSetGlobal);
+
+ m_FdMaxUDP=0;
+
+ // add the listener to the master sets
+ FD_SET(m_ListenerTCP, &m_MainSetTCP);
+ FD_SET(m_ListenerTCP, &m_MainSetGlobal);
+
+ // keep track of the biggest file descriptor
+ m_FdMaxTCP = m_ListenerTCP; // so far, it's this one
+
+ //Console->Print("Server running on port %d", port);
+
+ return true;
+}
+
+void ServerSocket::update()
+{
+ struct timeval tmp_TimeOut;
+ int fdMax;
+
+ // copy fd_sets from main-set to temp. read-set
+ m_ReadSetTCP = m_MainSetGlobal;
+
+ fdMax = std::max(m_FdMaxTCP, m_FdMaxUDP);
+
+ //FD_ZERO(&m_ReadSetTCP);
+ //FD_SET (m_ListenerTCP, &m_ReadSetTCP);
+
+ // select incoming data for tcp & udp
+ tmp_TimeOut = m_TimeOut; //save m_TimeOut... will be modified by select
+ if (select(fdMax+1, &m_ReadSetTCP, NULL, NULL, &tmp_TimeOut) == -1)
+ {
+ perror("select");
+ }
+
+ //Select exit condition logging
+ /*
+ if ((tmp_TimeOut.tv_sec == 0) && (tmp_TimeOut.tv_usec == 0))
+ {
+ Console->LPrint(GREEN, BLACK, "[Idle]");
+ Console->LPrint(" Exiting select on timeout (remains %d sec and %d usec)", tmp_TimeOut.tv_sec, tmp_TimeOut.tv_usec);
+ Console->LClose();
+ }
+ else
+ {
+ Console->LPrint(YELLOW, BLACK, "[Active]");
+ Console->LPrint(" Exiting select with remaining time %d sec and %d usec", tmp_TimeOut.tv_sec, tmp_TimeOut.tv_usec);
+ Console->LClose();
+ }
+ */
+
+ // check for new tcp connections
+ if (FD_ISSET(m_ListenerTCP, &m_ReadSetTCP)) // we got one!!
+ {
+ m_bNewTCPConnection = true;
+ }
+ else
+ {
+ m_bNewTCPConnection = false;
+ }
+
+}
+
+bool ServerSocket::newConnection()
+{
+ return (m_bNewTCPConnection);
+}
+
+ConnectionTCP* ServerSocket::getTCPConnection()
+{
+ if(m_bNewTCPConnection)
+ {
+ struct sockaddr_in RemoteAddr; // new incoming client address
+ socklen_t addrlen = sizeof(RemoteAddr);
+ int NewSockfd; // newly accept()ed socket descriptor
+
+ // handle new connections
+ if ((NewSockfd = accept(m_ListenerTCP, (struct sockaddr *)&RemoteAddr, &addrlen)) == -1)
+ {
+ m_bNewTCPConnection = false; // set back to normal
+ perror("tcp-accept");
+ return 0;
+ }
+ else
+ {
+ FD_SET(NewSockfd, &m_MainSetTCP); // add to master TCP set
+ FD_SET(NewSockfd, &m_MainSetGlobal); // add to master global set
+ if (NewSockfd > m_FdMaxTCP) // keep track of the maximum
+ {
+ m_FdMaxTCP = NewSockfd;
+ }
+
+ ConnectionTCP* tcpConn = new ConnectionTCP(NewSockfd, RemoteAddr, this);
+
+ m_bNewTCPConnection = false; // set back to normal
+
+ return tcpConn;
+ }
+ }
+
+ return 0;
+}
+
+ConnectionUDP* ServerSocket::getUDPConnection(uint32_t remoteadress, int32_t remoteport)
+{
+ int udpSockfd;
+
+ if ((udpSockfd = socket(PF_INET, SOCK_DGRAM, 0)) == -1)
+ {
+ perror("udp-socket");
+ return NULL;
+ }
+
+ struct sockaddr_in my_addr;
+
+ uint16_t Port = Config->GetOptionInt("gameserver_udpport_min");
+ uint16_t maxPort = Config->GetOptionInt("gameserver_udpport_max");
+
+ my_addr.sin_family = AF_INET; // host byte order
+ my_addr.sin_port = htons(Port); // short, network byte order
+ my_addr.sin_addr.s_addr = INADDR_ANY; // automatically fill with my IP
+ memset(&(my_addr.sin_zero), '\0', 8); // zero the rest of the struct
+
+ //Search a free udp port to use (could be optimised for faster port allocation)
+ while (bind(udpSockfd, (struct sockaddr *)&my_addr, sizeof(struct sockaddr)) == -1)
+ {
+ if (errno == EADDRINUSE)
+ {
+ my_addr.sin_port = htons(++Port);
+ if (Port > maxPort)
+ {
+ Console->Print(RED, BLACK,"No more free UDP port in configured range");
+ return NULL;
+ }
+ }
+ else
+ {
+ perror("udp-bind");
+ return NULL;
+ }
+ }
+
+ FD_SET(udpSockfd, &m_MainSetUDP); // add to master UDP set
+ FD_SET(udpSockfd, &m_MainSetGlobal); // add to master global set
+ if (udpSockfd > m_FdMaxUDP) // keep track of the maximum
+ {
+ m_FdMaxUDP = udpSockfd;
+ }
+
+ ConnectionUDP* udpConn = new ConnectionUDP(udpSockfd, Port, remoteadress, remoteport, this);
+
+ //m_LastUDPPort++;
+
+ return udpConn;
+}
+
+bool ServerSocket::isDataAvailable(int sockfd)
+{
+ if(FD_ISSET(sockfd, &m_ReadSetTCP))
+ {
+ return true;
+ }
+
+ return false;
+}
+
+void ServerSocket::delSocketFromSet(int sockfd)
+{
+ FD_CLR(sockfd, &m_MainSetTCP);
+ FD_CLR(sockfd, &m_MainSetUDP);
+ FD_CLR(sockfd, &m_MainSetGlobal);
+}
+
+void ServerSocket::closeServer()
+{
+ close(m_ListenerTCP);
+}
--- /dev/null
+#pragma once
+
+#include <iostream>
+#include <chrono>
+#include <queue>
+#include <map>
+#include <netinet/in.h>
+#include "common/message.h"
+
+#define RECVBUFFERSIZE 4096
+#define SENDBUFFERSIZE 4096
+#define DEFAULT_TCP_TIMEOUT 600
+#define DEFAULT_UDP_TIMEOUT 60
+#define SESSION_UDP_OFFSET 37917
+#define MAX_RETENTION 20
+
+class ConnectionTCP;
+class ConnectionUDP;
+class ServerSocket;
+
+class ConnectionTCP {
+private:
+ int32_t mSockfd;
+ struct sockaddr_in mRemoteAddr;
+ time_t mLastActive;
+ time_t mTimeOutValue;
+ bool mbConnected;
+ ServerSocket *mServerSocket; // pointer to ServerSocket
+ std::queue<PMessage *> mQueueIn;
+ std::queue<PMessage *> mQueueOut;
+ PMessage *mReceiveBufferMsg;
+ // old stuff
+ PMessage *mSendBufferMsg;
+
+public:
+ ConnectionTCP(int32_t sockfd, struct sockaddr_in addr, ServerSocket *server);
+ ~ConnectionTCP();
+
+ struct sockaddr_in getAddr()
+ {
+ return mRemoteAddr;
+ }
+ int32_t getSockfd()
+ {
+ return mSockfd;
+ }
+ char *getRemoteAddress();
+ void setServer(ServerSocket *server)
+ {
+ if (server)
+ mServerSocket = server;
+ }
+ bool timeOut() const;
+ inline time_t GetTimeOutValue() const
+ {
+ return mTimeOutValue;
+ }
+ inline void SetTimeOutValue(time_t Value)
+ {
+ mTimeOutValue = Value;
+ }
+ bool update();
+ bool isConnected()
+ {
+ return mbConnected;
+ }
+ inline void SendMessage(PMessage *nMessage)
+ {
+ mQueueOut.push(nMessage);
+ }
+ PMessage *GetMessage();
+ void DeleteOutgoingMessages();
+ // old stuff
+ void flushSendBuffer();
+ int32_t getRecvBufferSize();
+ int32_t getSendBufferSize();
+ const uint8_t *read(int32_t *size);
+ int32_t write(const void *data, int32_t size);
+ int32_t write(uint8_t data);
+ int32_t write(uint16_t data);
+ int32_t write(uint32_t data);
+ int32_t write(float data);
+ int32_t write(double data);
+ int32_t write(const char *string);
+};
+
+class ConnectionUDP {
+ typedef std::map<uint16_t, PMessage *> PMessageMap;
+private:
+ int32_t mSockfd;
+ struct sockaddr_in mRemoteAddr;
+ time_t mLastActive;
+ time_t mTimeOutValue;
+ int32_t mPort;
+ ServerSocket *mServerSocket;
+ std::queue<PMessage *> mQueueIn;
+ std::queue<PMessage *> mQueueOut;
+ std::queue<PMessage *> mVIPQueueOut;
+ // UDP MessageBuffer
+ uint16_t mUDP_ID;
+ uint16_t mLastUDPID;
+ uint16_t mSessionID;
+ uint16_t mTransactionID;
+ PMessageMap UDPMessages;
+ PMessageMap::iterator GetMsgListBegin()
+ {
+ return UDPMessages.begin();
+ }
+ PMessageMap::iterator GetMsgListEnd()
+ {
+ return UDPMessages.end();
+ }
+ void InsertUDPMessage(PMessage *nMsg); // save message for later OOO handling
+ void UpdateMessageBuffer(); // delete old packets, depending on define "MAX_RETENTION"
+ void ResetMessageBuffer(); // done whe UDP_ID gets set to zero
+ // old stuff
+ PMessage *mSendBufferMsg;
+
+public:
+ ConnectionUDP(int32_t sockfd, int32_t port, int32_t remoteaddress, int32_t remoteport, ServerSocket *server);
+ ~ConnectionUDP();
+
+ bool update();
+ int32_t getPort()
+ {
+ return mPort;
+ }
+ struct sockaddr_in getAddr()
+ {
+ return mRemoteAddr;
+ }
+ int32_t getSockfd()
+ {
+ return mSockfd;
+ }
+ char *getRemoteAddress();
+ bool timeOut() const;
+ inline time_t getTimeOutValue() const
+ {
+ return mTimeOutValue;
+ }
+ inline void setTimeOutValue(time_t Value)
+ {
+ mTimeOutValue = Value;
+ }
+ void SendMessage(PMessage *nMessage, bool nVIP = false);
+ inline int32_t GetReadyMessageNumber()
+ {
+ return mQueueIn.size();
+ }
+ PMessage *GetMessage();
+ void DeleteOutgoingMessages();
+ // MessageBuffer
+ void ReSendUDPMessage(uint16_t nUDP_ID); // OOO
+ inline uint16_t GetUDP_ID() const
+ {
+ return mUDP_ID;
+ }
+ inline uint16_t GetSessionID() const
+ {
+ return SESSION_UDP_OFFSET + mUDP_ID;
+ }
+ inline uint16_t GetTransactionID()
+ {
+ return mTransactionID;
+ }
+ void SetUDP_ID(uint16_t id);
+ inline void IncreaseUDP_ID()
+ {
+ SetUDP_ID(mUDP_ID + 1);
+ }
+ inline void ResetTransactionID()
+ {
+ mTransactionID = 10170;
+ }
+ inline void IncreaseTransactionID(uint8_t nInc = 1)
+ {
+ mTransactionID += nInc;
+ }
+ // old stuff
+ int32_t getRecvBufferSize();
+ int32_t getSendBufferSize();
+ void flushSendBuffer();
+ const uint8_t *read(int32_t *size);
+ int32_t write(const void *data, int32_t size);
+ int32_t write(uint8_t data);
+ int32_t write(uint16_t data);
+ int32_t write(uint32_t data);
+ int32_t write(float data);
+ int32_t write(double data);
+ int32_t write(const char *string);
+};
+
+class ServerSocket {
+private:
+ fd_set m_MainSetTCP; // master file descriptor list for tcp-connections
+ fd_set m_ReadSetTCP; // temp file descriptor list for select() for tcp-connections
+ fd_set m_MainSetUDP; // master file descriptor list for udp-connections
+ fd_set m_MainSetGlobal; // master file descriptor list for udp+tcp connections
+ struct sockaddr_in m_ServerAddr;
+ int32_t m_ListenerTCP; // listen socket
+ int32_t m_FdMaxTCP; // highest current file-descriptor (tcp)
+ int32_t m_FdMaxUDP; // highest current file-descriptor (udp)
+ bool m_bNewTCPConnection;
+ struct timeval m_TimeOut;
+
+public:
+ ServerSocket();
+ ~ServerSocket();
+ void settimeout(int32_t timeout_sec, int32_t timeout_usec);
+ bool open(int32_t port);
+ void update();
+ bool newConnection();
+ ConnectionTCP *getTCPConnection();
+ ConnectionUDP *getUDPConnection(uint32_t remoteaddress, int32_t remoteport);
+ bool isDataAvailable(int32_t sockfd);
+ void delSocketFromSet(int32_t sockfd);
+ void closeServer();
+};
+++ /dev/null
-#
-# TinNS per-directory Makefile
-#
-# Adapted by Hammag from the Makefile system for Linux kernel.
-#
-# 14 Sep 2000, Christoph Hellwig <hch@infradead.org>
-# Rewritten to use lists instead of if-statements.
-#
-
-######################################################
-# Target for this directory and its sub-dirs
-######################################################
-# Case 1 : target is an executable named as defined
-#B_TARGET := testor2
-
-# Case 2 : target is a TinNS lib name
-# (use short name, as in -l linker option)
-L_TARGET := tinns
-
-# Case 3 (usual): objects shall be made available to the parent dir
-# The following line will set that automatically
-# (Should match dir name + .o suffix)
-#O_TARGET := $(addsuffix .o,$(notdir $(shell /bin/pwd)))
-# Manualy define this only if you need to force the compiled obj name
-#O_TARGET := game.o
-
-
-######################################################
-# Local flags
-######################################################
-# local dir CXX Flags
-#EXTRA_CXXFLAGS := -I/usr/include/mysql
-
-# per-object CXX Flags
-#CXXFLAGS_funcdef2.o := -g
-
-# local dir Linker Flags (for intermediate .o linking)
-#EXTRA_LDFLAGS :=
-
-# any tinns Lib used (short name, as in -l linker option)
-#LINK_TINNSLIBS := tinns
-
-# local dir Linker Flags (for final executable linking)
-#EXTRA_LINKFLAGS := -lrt -lpthread -lz -lm -lcrypt -L"/usr/lib/mysql" -lmysqlclient
-
-
-#####################################################
-# Subdirectories
-#####################################################
-#subdir-y := def
-#subdir-$(CONFIG_GAMEMONKEY) += gamemonkey
-
-
-#####################################################
-#***************************************************#
-# No further config should be needed after this line
-#***************************************************#
-ifdef TOPDIR
-
-# build list of objects ib loca ldir
-obj-y := $(patsubst %.cpp,%.o,$(wildcard *.cpp))
-# add final object from each subdir
-obj-y += $(join $(subdir-y),$(subdir-y:%=/%.o))
-
-include $(TOPDIR)/Rules.make
-
-else #TOPDIR undef, Makefile called from non-top dir
-
-# Memorize the first calling dir in case we wanted to
-# lauch local actions from top Makefile
- ifndef FIRSTDIR
- FIRSTDIR :=$(CURDIR)
- export FIRSTDIR
- endif
-
-uptoparent :
- $(MAKE) -C .. $(MAKECMDGOALS)
-
-.DEFAULT :
- $(MAKE) -C .. $(MAKECMDGOALS)
-
-endif #TOPDIR
-
+++ /dev/null
-/*\r
- TinNS (TinNS is not a Neocron Server)\r
- Copyright (C) 2005 Linux Addicted Community\r
- maintainer Akiko <akiko@gmx.org>\r
-\r
- This program is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU General Public License\r
- as published by the Free Software Foundation; either version 2\r
- of the License, or (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
- 02110-1301, USA.\r
-*/\r
-\r
-\r
-\r
-/*\r
- connection-tcp.cpp - a connection class for tcp\r
-\r
- Authors:\r
- - bakkdoor\r
-\r
- MODIFIED: 09 Feb 2006 bakkdoor\r
- REASON: - introduced\r
- \r
- MODIFIED: 27 Jun 2006 hammag\r
- REASON: - added m_ServerSocket check in ~ConnectionTCP()\r
- - added m_ServerSocket check in update() in disconnection case\r
- - corrected recv *buf and len parameters in update()\r
- to avoid unread in-buffer data smashing\r
- \r
- MODIFIED: 01 Jul 2006 hammag\r
- REASON: - update() : modified to deal correctly with would-block socket writes.\r
- - ConnectionTCP() : moved-in non-blocking setting from\r
- ServerSocket::getTCPConnection() for better class coherency\r
-\r
- MODIFIED: 24 Jul 2006 hammag\r
- REASON: - ConnectionTCP() : added m_SendSize, m_RecvRewind and m_RecvSize missing initialisation\r
- which caused nice segfaults on unlucky days :p\r
- \r
- MODIFIED: 24 Jul 2006 hammag\r
- REASON: - changed member data prefix from "m_" to "m" in for homogeneity with the reste of TinNS code\r
- - added private members data mQueueIn and mQueueOut\r
- - added public members methods SendMessage(), GetMessage(), DeleteOutgoingMessages() and modified code accordingly\r
- - changed old read/write methods implementation to message queues usage\r
- NOTA: - as previously, ConnectionTCP class takes care of separating messages in the TCP stream according\r
- to NC TCP packet lentgh field. Additionnaly, it does look for the 0xFE signature byte in front of the packet lentgh field.\r
- \r
- MODIFIED: 26 Jul 2006 hammag\r
- REASON: - enabled multiple network send in on single update() call\r
-\r
- MODIFIED: 05 Aug 2006 hammag\r
- REASON: - renamed "getLocalAddress()" to "getRemoteAddress()" as it is ... what it does !\r
- \r
- TODO: - add real priority management when needed. atm all outgoing messages are put in the same queue\r
- - add pending outgoing message management in case of EAGAIN (request temp add to writeset & mngt by the "scheduler")\r
- - set TCP socket option SO_KEEPALIVE to be firewall-users friendly (else connexion may be lost when no zoning occurs for a long time, like in real NC ;-) )\r
- - don't access Config object from netcode's objects. Use parameter members\r
- set by object owner.\r
-\r
-*/\r
-\r
-#include "main.h"\r
-\r
-ConnectionTCP::ConnectionTCP(int sockfd, struct sockaddr_in addr, ServerSocket* server)\r
-{\r
- mSockfd = sockfd;\r
- mRemoteAddr = addr;\r
- \r
- if(server)\r
- {\r
- mServerSocket = server;\r
- }\r
-\r
- // set new socket to non-blocking\r
- fcntl(mSockfd, F_SETFL, O_NONBLOCK);\r
- \r
- mbConnected = true; // client obviously is connected at creation...\r
-\r
- mTimeOutValue = DEFAULT_TCP_TIMEOUT;\r
- mLastActive = std::time(NULL);\r
- \r
- mReceiveBufferMsg = NULL;\r
- mSendBufferMsg = NULL;\r
-}\r
-\r
-ConnectionTCP::~ConnectionTCP()\r
-{\r
- if (mServerSocket)\r
- {\r
- mServerSocket->delSocketFromSet(mSockfd);\r
- }\r
- close(mSockfd);\r
- \r
- if (mReceiveBufferMsg)\r
- {\r
- delete mReceiveBufferMsg;\r
- }\r
- \r
- while (!mQueueIn.empty())\r
- {\r
- delete mQueueIn.front();\r
- mQueueIn.pop();\r
- }\r
-\r
- if (mSendBufferMsg)\r
- {\r
- delete mSendBufferMsg;\r
- }\r
-}\r
-\r
-char* ConnectionTCP::getRemoteAddress()\r
-{\r
- return inet_ntoa(mRemoteAddr.sin_addr);\r
-}\r
-\r
-bool ConnectionTCP::timeOut() const\r
-{\r
- time_t now = std::time(NULL);\r
- if((now-mLastActive) >= mTimeOutValue)\r
- return true;\r
-\r
- return false;\r
-}\r
-\r
-PMessage* ConnectionTCP::GetMessage()\r
-{\r
- PMessage* RetVal;\r
- \r
- if (mQueueIn.empty())\r
- RetVal = NULL;\r
- else\r
- {\r
- RetVal = mQueueIn.front();\r
- mQueueIn.pop();\r
- }\r
- return RetVal;\r
-}\r
-\r
-void ConnectionTCP::DeleteOutgoingMessages()\r
-{\r
- while (! mQueueOut.empty())\r
- {\r
- delete mQueueOut.front();\r
- mQueueOut.pop();\r
- } \r
-}\r
-\r
-bool ConnectionTCP::update() // non optimal read-algorithm atm, but well ... :p\r
-{\r
- PMessage* tmpMsg;\r
- int numBytes;\r
- u8 const* DataStart;\r
- u16 DataSize;\r
- u8* MsgStart;\r
- u16 MsgOffset;\r
- u16 MsgLen;\r
- \r
- //check if data is available for this socket and if yes, read into a new PMessage and put it on incoming queue\r
- if(mServerSocket->isDataAvailable(mSockfd))\r
- {\r
-//Console->Print("ConnectionTCP::update() - IN Data avail");\r
- if (mReceiveBufferMsg == NULL)\r
- {\r
- mReceiveBufferMsg = new PMessage(RECVBUFFERSIZE);\r
- }\r
- \r
- DataSize = mReceiveBufferMsg->GetSize();\r
- numBytes = recv(mSockfd, (char*) mReceiveBufferMsg->GetMessageDataPointer(RECVBUFFERSIZE - DataSize) + DataSize, RECVBUFFERSIZE - DataSize, 0); // get the data\r
-\r
- if(numBytes > 0)\r
- {\r
-//Console->Print(GREEN, BLACK, "ConnectionTCP::update() - Data received");\r
- mbConnected = true;\r
- mReceiveBufferMsg->ForceSize(DataSize + numBytes);\r
- mLastActive = std::time(NULL);\r
- \r
- while(mReceiveBufferMsg && mReceiveBufferMsg->GetSize())\r
- {\r
- DataStart = mReceiveBufferMsg->GetMessageData();\r
- DataSize = mReceiveBufferMsg->GetSize();\r
- MsgStart = (u8*)memchr(DataStart, 0xfe, DataSize);\r
- \r
- if (MsgStart)\r
- {\r
- MsgOffset = MsgStart - DataStart;\r
- if (MsgOffset)\r
- {\r
- Console->Print(YELLOW, BLACK, "ConnectionTCP::update() Message head found 0x%04hx bytes after packet start. Inbetween data will be discarded.", MsgOffset);\r
- }\r
- if (MsgOffset + 3 <= DataSize)\r
- {\r
- MsgLen = *(u16*)(DataStart + MsgOffset + 1);\r
-//Console->Print(GREEN, BLACK, "ConnectionTCP::update() TCP Message body length 0x%04hx (buffer 0x%04hx)", MsgLen, mReceiveBufferMsg->GetSize());\r
- if (MsgOffset + 3 + MsgLen <= DataSize)\r
- {\r
- tmpMsg = mReceiveBufferMsg->GetChunk(MsgOffset, MsgLen + 3); // Change (MsgOffset, MsgLen + 3) to (MsgOffset + 3, MsgLen) to REMOVE head & length from message head\r
- mQueueIn.push(tmpMsg);\r
- \r
- if (MsgOffset + 3 + MsgLen < DataSize)\r
- {\r
- tmpMsg = mReceiveBufferMsg->GetChunk(MsgOffset + 3 + MsgLen, DataSize - (MsgOffset + 3 + MsgLen));\r
- }\r
- else\r
- {\r
- tmpMsg = NULL;\r
- }\r
- \r
- delete mReceiveBufferMsg;\r
- mReceiveBufferMsg = tmpMsg; \r
- }\r
- }\r
- }\r
- else\r
- {\r
- break;\r
- }\r
- }\r
- }\r
- else if(numBytes == 0) // disconnected !!\r
- {\r
- mbConnected = false; // set to not-connected and close the socket\r
- if (mServerSocket)\r
- {\r
- mServerSocket->delSocketFromSet(mSockfd);\r
- }\r
- close(mSockfd); \r
- return false;\r
- }\r
- else\r
- {\r
- if(errno != EAGAIN) \r
- { // an error has occured -> output it to the console\r
- perror("tcp-receive");\r
- Console->Print(RED, BLACK, "mSockfd:%d MaxRead:%d ", mSockfd, RECVBUFFERSIZE);\r
- }\r
- } \r
- }\r
-\r
- // send data from outgoing queue\r
- flushSendBuffer(); // manage old write compatibility\r
- while(! mQueueOut.empty())\r
- {\r
-//Console->Print("ConnectionUDP::update() - OUT Data avail");\r
- tmpMsg = mQueueOut.front();\r
- int numBytes = send(mSockfd, (char*) tmpMsg->GetMessageData(), tmpMsg->GetSize(), 0);\r
- if(numBytes == -1) // error while sending data -> output error-msg to console\r
- {\r
- if (errno == EAGAIN)\r
- {\r
- break;\r
- }\r
- else\r
- {\r
- perror("tcp-send");\r
- //close(mSockfd);\r
- return false;\r
- }\r
- }\r
- else if(numBytes > 0)\r
- {\r
-//Console->Print(GREEN, BLACK, "ConnectionTCP::update() - Data sent");\r
- mLastActive = std::time(NULL);\r
- mQueueOut.pop(); // message written, we can remove it from queue\r
- delete tmpMsg; // and delete the message\r
- }\r
- }\r
-\r
- return true;\r
-}\r
-\r
-/**** Old I/F compatibility functions ****/\r
-\r
-int ConnectionTCP::getRecvBufferSize()\r
-{\r
- PMessage* tmpMsg;\r
- \r
- if (mQueueIn.empty())\r
- return 0;\r
-\r
- tmpMsg = mQueueIn.front();\r
- u16 _size = tmpMsg->GetSize()-tmpMsg->GetNextByteOffset();\r
- if (_size <= 0)\r
- {\r
- mQueueIn.pop();\r
- delete tmpMsg;\r
- if (mQueueIn.empty())\r
- return 0;\r
- tmpMsg = mQueueIn.front();\r
- tmpMsg->SetNextByteOffset(0);\r
- _size = tmpMsg->GetSize();\r
- }\r
- return _size;\r
-}\r
-\r
-int ConnectionTCP::getSendBufferSize()\r
-{\r
- if(mSendBufferMsg == NULL)\r
- return 0;\r
- else\r
- return mSendBufferMsg->GetSize();\r
-}\r
-\r
-void ConnectionTCP::flushSendBuffer()\r
-{\r
-//Console->Print("ConnectionTCP::flushSendBuffer()");\r
- if((mSendBufferMsg != NULL) && (mSendBufferMsg->GetSize() > 0))\r
- {\r
- SendMessage(mSendBufferMsg);\r
- mSendBufferMsg = NULL;\r
-//Console->Print(YELLOW, BLACK, "ConnectionTCP::flushSendBuffer() - Data flushed");\r
- }\r
-}\r
-\r
-const u8* ConnectionTCP::read(int* size)\r
-{\r
- PMessage* tmpMsg;\r
-//Console->Print("ConnectionTCP::read() - trying to read up to %d bytes", *size); \r
- if (mQueueIn.empty() || !size)\r
- {\r
-//Console->Print("ConnectionTCP::read() - no more packet");\r
- return NULL;\r
- }\r
-\r
- tmpMsg = mQueueIn.front();\r
- u16 _size = tmpMsg->GetSize()-tmpMsg->GetNextByteOffset();\r
-//Console->Print("ConnectionTCP::read() - %d bytes remaining in current packet", _size);\r
- if (_size <= 0)\r
- {\r
-//Console->Print("ConnectionTCP::read() - trying next packet");\r
- mQueueIn.pop();\r
- delete tmpMsg;\r
- if (mQueueIn.empty())\r
- {\r
-//Console->Print("ConnectionUDP::read() - no more packet");\r
- return NULL;\r
- }\r
- tmpMsg = mQueueIn.front();\r
- _size = tmpMsg->GetSize();\r
- tmpMsg->SetNextByteOffset(0);\r
- }\r
- \r
- if(*size==0)\r
- {\r
- *size=_size;\r
- }\r
- else\r
- {\r
- *size=min(*size, (s32)_size);\r
- }\r
-\r
- u8 const* ptr = tmpMsg->GetMessageData() + tmpMsg->GetNextByteOffset();\r
- tmpMsg->SetNextByteOffset(tmpMsg->GetNextByteOffset()+ *size);\r
-//Console->Print(GREEN, BLACK, "ConnectionTCP::read() - %d bytes read", *size);\r
- return ptr;\r
-}\r
-\r
-int ConnectionTCP::write(const void* data, int size)\r
-{\r
- // data is stored in mSendBufferMsg. Gets queued in next flushSendBuffer() or update()\r
- if (mSendBufferMsg == NULL)\r
- {\r
-//Console->Print("ConnectionTCP::write() creating new mSendBufferMsg");\r
- mSendBufferMsg = new PMessage(SENDBUFFERSIZE);\r
- }\r
- \r
- mSendBufferMsg->Write(data, (u16)size);\r
-//Console->Print(GREEN, BLACK, "ConnectionUDP::write() %d bytes written to mSendBufferMsg (total size %d)", size, mSendBufferMsg->GetSize());\r
- return size;\r
-}\r
-\r
-int ConnectionTCP::write(const char *String)\r
-{\r
- if(!String)\r
- return 0;\r
-\r
- return write(String, strlen(String));\r
-}\r
-\r
-int ConnectionTCP::write(u8 Data)\r
-{\r
- return write(&Data, sizeof(u8));\r
-}\r
-\r
-int ConnectionTCP::write(u16 Data)\r
-{\r
- return write(&Data, sizeof(u16));\r
-}\r
-\r
-int ConnectionTCP::write(u32 Data)\r
-{\r
- return write(&Data, sizeof(u32));\r
-}\r
-\r
-int ConnectionTCP::write(float Data)\r
-{\r
- return write(&Data, sizeof(float));\r
-}\r
-\r
-int ConnectionTCP::write(double Data)\r
-{\r
- return write(&Data, sizeof(double));\r
-}\r
+++ /dev/null
-/*\r
- TinNS (TinNS is not a Neocron Server)\r
- Copyright (C) 2005 Linux Addicted Community\r
- maintainer Akiko <akiko@gmx.org>\r
-\r
- This program is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU General Public License\r
- as published by the Free Software Foundation; either version 2\r
- of the License, or (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
- 02110-1301, USA.\r
-*/\r
-\r
-\r
-\r
-/*\r
- connection-udp.cpp - a connection class for udp\r
-\r
- Authors:\r
- - bakkdoor\r
-\r
- MODIFIED: 09 Feb 2006 bakkdoor\r
- REASON: - introduced\r
-\r
- MODIFIED: 27 Jun 2006 hammag\r
- REASON: - put UDP socket in non-blocking mode in ConnectionUDP to avoid blocking\r
- in update() as it can be called without data available.\r
- - modified update() accordingly.\r
- - modified flushSendBuffer() accordingly; >> !!! leads to data loss if packet could not be sent\r
- and connection closed just after that. Is it a problem before UDP connection closure (ie logout) ???\r
- - corrected recv *buf and len parameters in update() to avoid\r
- unread in-buffer data smashing.\r
- - added initialisation of addrlen in update().\r
-\r
- MODIFIED: 01 Jul 2006 hammag\r
- REASON: - ConnectionUDP(): modified to set m_ServerSocket\r
- - update(): modified to check m_ServerSocket->isDataAvailable()\r
- before trying to read from socket\r
- - ~ConnectionUDP(): added socket removal from fd set\r
-\r
- MODIFIED: 24 Jul 2006 hammag\r
- REASON: - changed member data prefix from "m_" to "m" in for homogeneity with the reste of TinNS code\r
- - added private members data mQueueIn and mQueueOut\r
- - added public members methods SendMessage(), GetMessage(), DeleteOutgoingMessages() and modified code accordingly\r
- - changed old read/write methods implementation to message queues usage\r
-\r
- MODIFIED: 26 Jul 2006 hammag\r
- REASON: - enabled multiple network receive & send in on single update() call\r
-\r
- MODIFIED: 29 Jul 2006 hammag\r
- REASON: - changed order of network read/write in update(): now first write, then read\r
-\r
- MODIFIED: 05 Aug 2006 hammag\r
- REASON: - a pseudo-connection is now established on the udp socket, so that we don't need to care\r
- for client IP/port in later processing\r
- REASON: - renamed "getLocalAddress()" to "getRemoteAddress()" as it is ... what it does !\r
-\r
-\r
- TODO: - split update so the main loop is : read - process - write - wait for something to read\r
- - add try vector read & write with recvmsg/sendmsg\r
- - add real priority management when needed. atm all outgoing messages are put in the same queue\r
- - add pending outgoing message management in case of EAGAIN (request temp add to writeset & mngt by the "scheduler")\r
- - best sizing of receive message could be done with ioctl:\r
- "int value;\r
- error = ioctl(tcp_socket, ioctl_type, &value);\r
- SIOCINQ\r
- Gets a pointer to an integer as argument. Returns the size of\r
- the next pending datagram in the integer in bytes, or 0 when no\r
- datagram is pending."\r
- - check incoming packets Source IP for matching with registered client IP, to avoid DOS & other things\r
- - maybe dont allow source port change (eg. because of NAT) more than once (at the begining only) for same reasons\r
- - check incoming messages UDP_ID to reject old messages and -if possible- request OOO granted messages (to be done at higher message decoding level thought)\r
- - manage an ageing queue of sent granted messages for resent if OOO notified by client\r
- - don't access Config object from netcode's objects. Use parameter members\r
- set by object owner.\r
-*/\r
-\r
-#include "main.h"\r
-\r
-ConnectionUDP::ConnectionUDP(int sockfd, int port, int remoteadress, int remoteport, ServerSocket* server)\r
-{\r
- mSockfd = sockfd;\r
- mPort = port;\r
- //Console->Print("local UDP port: %d", port);\r
- if(server)\r
- {\r
- mServerSocket = server;\r
- }\r
-\r
- mTimeOutValue = DEFAULT_UDP_TIMEOUT;\r
- mLastActive = std::time(NULL);\r
-\r
- mRemoteAddr.sin_family = AF_INET; // host byte order\r
- mRemoteAddr.sin_port = htons(remoteport); // short, network byte order\r
- mRemoteAddr.sin_addr.s_addr = remoteadress; // TODO: Get IP of client\r
-\r
- //Bind client to server in a udp pseudo-connection\r
- /*if(connect(sockfd, (struct sockaddr *)&mRemoteAddr, sizeof(struct sockaddr )))\r
- {\r
- Console->Print("Error on pseudo-connecting udp socket to %s:%d", inet_ntoa(mRemoteAddr.sin_addr),ntohs(mRemoteAddr.sin_port));\r
- perror("udp connect"); //exception should be thrown here\r
- }\r
- else */\r
- {\r
- Console->Print("Client UDP %s:%d", inet_ntoa(mRemoteAddr.sin_addr), ntohs(mRemoteAddr.sin_port));\r
- }\r
- // set UDP-socket to non-blocking\r
- fcntl(sockfd, F_SETFL, O_NONBLOCK);\r
-\r
- // mRemoteAddr.sin_addr.s_addr = INADDR_ANY; // automatically fill with my IP\r
- // memset(&(mRemoteAddr.sin_zero), '\0', 8); // zero the rest of the struct\r
- mSendBufferMsg = NULL;\r
-\r
- mUDP_ID = 0;\r
- mSessionID = SESSION_UDP_OFFSET;\r
- mLastUDPID = 0;\r
- mTransactionID = 0;\r
-}\r
-\r
-\r
-ConnectionUDP::~ConnectionUDP()\r
-{\r
- if (mServerSocket)\r
- {\r
- mServerSocket->delSocketFromSet(mSockfd);\r
- }\r
- close(mSockfd);\r
-\r
- if (mSendBufferMsg)\r
- {\r
- delete mSendBufferMsg;\r
- }\r
-\r
- while (!mQueueIn.empty())\r
- {\r
- delete mQueueIn.front();\r
- mQueueIn.pop();\r
- }\r
-\r
- while (!mQueueOut.empty())\r
- {\r
- delete mQueueOut.front();\r
- mQueueOut.pop();\r
- }\r
- while (!mVIPQueueOut.empty())\r
- {\r
- delete mVIPQueueOut.front();\r
- mVIPQueueOut.pop();\r
- }\r
- for(PMessageMap::iterator it=UDPMessages.begin(); it!=UDPMessages.end(); it++)\r
- {\r
- delete it->second;\r
- UDPMessages.erase(it);\r
- }\r
-}\r
-\r
-\r
-bool ConnectionUDP::timeOut() const\r
-{\r
- time_t now = std::time(NULL);\r
- if((now-mLastActive) >= mTimeOutValue)\r
- return true;\r
-\r
- return false;\r
-}\r
-\r
-char* ConnectionUDP::getRemoteAddress()\r
-{\r
- return inet_ntoa(mRemoteAddr.sin_addr);\r
-}\r
-\r
-PMessage* ConnectionUDP::GetMessage()\r
-{\r
- PMessage* RetVal;\r
-\r
- if (mQueueIn.empty())\r
- RetVal = NULL;\r
- else\r
- {\r
- RetVal = mQueueIn.front();
- mQueueIn.pop();\r
- }\r
- return RetVal;\r
-}\r
-\r
-void ConnectionUDP::DeleteOutgoingMessages()\r
-{\r
- while (! mQueueOut.empty())\r
- {\r
- PMessage* tmpMsg;\r
- tmpMsg = mQueueOut.front();\r
- mQueueOut.pop();\r
- delete tmpMsg;\r
- }\r
- while (! mVIPQueueOut.empty())\r
- {\r
- PMessage* tmpMsg2;\r
- tmpMsg2 = mVIPQueueOut.front();\r
- mVIPQueueOut.pop();\r
- delete tmpMsg2;\r
- }\r
-}\r
-\r
-bool ConnectionUDP::update()\r
-{\r
- PMessage* tmpMsg;\r
- int numBytes;\r
- bool gotVIPmsg;\r
-\r
- // send data from outgoing queue\r
- flushSendBuffer(); // manage old write compatibility\r
-\r
- // Update messagebuffer; Erase all messages older than MAX_RETENTION\r
- UpdateMessageBuffer();\r
-\r
- if (! mQueueOut.empty() || ! mVIPQueueOut.empty())\r
- {\r
- //Console->Print(GREEN, BLACK, "ConnectionUDP::update() - Sending messages -----------------");\r
- // Console->Print("ConnectionUDP::update() - %d messages waiting in Output Queue", mQueueOut.size());\r
- while(! mQueueOut.empty() || ! mVIPQueueOut.empty())\r
- {\r
- //Console->Print("ConnectionUDP::update() - OUT Data avail");\r
-\r
- // First, take a look at the VIP Query. If not empty, send these packets first\r
- gotVIPmsg = false;\r
- if(! mVIPQueueOut.empty())\r
- {\r
- tmpMsg = mVIPQueueOut.front();\r
- gotVIPmsg = true;\r
- Console->Print("ConnectionUDP::update() - Got VIP (Very important packet) that is waiting to be sent");\r
- }\r
- else\r
- {\r
- tmpMsg = mQueueOut.front();\r
-\r
- // We ignore VIP packets for now. They are only meant to OOO packets\r
- InsertUDPMessage(tmpMsg);\r
- }\r
- //int numBytes = send(mSockfd, tmpMsg->GetMessageData(), tmpMsg->GetSize(), 0);\r
- int numBytes = sendto(mSockfd, (char*) tmpMsg->GetMessageData(), tmpMsg->GetSize(), 0, (struct sockaddr *)&mRemoteAddr, sizeof(struct sockaddr));\r
- if(numBytes > 0)\r
- {\r
- //Console->Print(GREEN, BLACK, "ConnectionUDP::update() - Data sent");\r
- mLastActive = std::time(NULL);\r
- if(gotVIPmsg == true)\r
- {\r
- mVIPQueueOut.pop();\r
- }\r
- else\r
- {\r
- mQueueOut.pop(); // message written, we can remove it from queue\r
- }\r
- //Console->Print(GREEN, BLACK, "ConnectionUDP::update() - Message sent:");\r
- //tmpMsg->DumpHead("OUT Msg:"); // ====\r
- //tmpMsg->Dump();\r
- delete tmpMsg; // and delete the message\r
- }\r
- else\r
- {\r
- if (errno == EAGAIN)\r
- {\r
- break;\r
- }\r
- else // error while sending data -> output error-msg to console\r
- {\r
- perror("udp-send2");\r
- //close(mSockfd);\r
- return false;\r
- }\r
- }\r
- }\r
- //if (! mQueueOut.empty())\r
- // Console->Print(YELLOW, BLACK, "ConnectionUDP::update() - %d messages remaining in Output Queue", mQueueOut.size());\r
- }\r
-\r
- //check if data is available from this socket and if yes, read into a new PMessage and put it on incoming queue\r
- if(mServerSocket->isDataAvailable(mSockfd))\r
- {\r
- //Console->Print("ConnectionUDP::update() - IN Data avail");\r
- while (1)\r
- {\r
- tmpMsg = new PMessage(RECVBUFFERSIZE);\r
- socklen_t addrlen;\r
- addrlen = sizeof(mRemoteAddr);\r
- //struct sockaddr_in tempAddr; // need to built in check,\r
- // if the incoming data is coming from the client or someone else!\r
- //numBytes = recv(mSockfd, tmpMsg->GetMessageDataPointer(RECVBUFFERSIZE), RECVBUFFERSIZE, 0); // get the data\r
- numBytes = recvfrom(mSockfd, (char*) tmpMsg->GetMessageDataPointer(RECVBUFFERSIZE), RECVBUFFERSIZE, 0, (struct sockaddr *)&mRemoteAddr, &addrlen);\r
- if(numBytes > 0)\r
- {\r
- //Console->Print(GREEN, BLACK, "ConnectionUDP::update() - Data received");\r
- mLastActive = std::time(NULL);\r
- tmpMsg->ForceSize(numBytes);\r
- mQueueIn.push(tmpMsg);\r
- //tmpMsg->DumpHead("IN Msg :"); // ====\r
- }\r
- else\r
- {\r
- delete tmpMsg;\r
- if(errno != EAGAIN)\r
- { // an error has occured -> output it to the console\r
- perror("udp-receive");\r
- Console->Print(RED, BLACK, "mSockfd:%d MaxRead:%d ", mSockfd, RECVBUFFERSIZE);\r
- }\r
- break;\r
- }\r
- }\r
- //Console->Print("ConnectionUDP::update() - %d messages ready in Input Queue", mQueueIn.size());\r
- }
-\r
- return true;\r
-}\r
-
-void ConnectionUDP::SendMessage(PMessage* nMessage, bool nVIP)\r
-{\r
- if (nMessage)\r
- {\r
- if(nVIP == true)\r
- mVIPQueueOut.push(nMessage);\r
- else\r
- mQueueOut.push(nMessage);\r
- }\r
-}\r
-\r
-/**************** Old I/F compatibility stuff ******************/\r
-\r
-int ConnectionUDP::getRecvBufferSize()\r
-{\r
- PMessage* tmpMsg;\r
-\r
- if (mQueueIn.empty())\r
- return 0;\r
-\r
- tmpMsg = mQueueIn.front();\r
- u16 _size = tmpMsg->GetSize()-tmpMsg->GetNextByteOffset();\r
- if (_size <= 0)\r
- {\r
- mQueueIn.pop();\r
- delete tmpMsg;\r
- if (mQueueIn.empty())\r
- return 0;\r
- tmpMsg = mQueueIn.front();\r
- tmpMsg->SetNextByteOffset(0);\r
- _size = tmpMsg->GetSize();\r
- }\r
- return _size;\r
-}\r
-\r
-int ConnectionUDP::getSendBufferSize()\r
-{\r
- if(mSendBufferMsg == NULL)\r
- return 0;\r
- else\r
- return mSendBufferMsg->GetSize();\r
-}\r
-\r
-void ConnectionUDP::flushSendBuffer()\r
-{\r
- //Console->Print("ConnectionUDP::flushSendBuffer()");\r
- if((mSendBufferMsg != NULL) && (mSendBufferMsg->GetSize() > 0))\r
- {\r
- SendMessage(mSendBufferMsg);\r
- mSendBufferMsg = NULL;\r
- //Console->Print(YELLOW, BLACK, "ConnectionUDP::flushSendBuffer() - Data flushed");\r
- }\r
-}\r
-\r
-const u8* ConnectionUDP::read(int* size)\r
-{\r
- PMessage* tmpMsg;\r
- //Console->Print("ConnectionUDP::read() - trying to read up to %d bytes", *size);\r
- if (mQueueIn.empty() || !size)\r
- {\r
- //Console->Print("ConnectionUDP::read() - no more packet");\r
- return NULL;\r
- }\r
-\r
- tmpMsg = mQueueIn.front();\r
- u16 _size = tmpMsg->GetSize()-tmpMsg->GetNextByteOffset();\r
- //Console->Print("ConnectionUDP::read() - %d bytes remaining in current packet", _size);\r
- if (_size <= 0)\r
- {\r
- //Console->Print("ConnectionUDP::read() - trying next packet");\r
- mQueueIn.pop();\r
- delete tmpMsg;\r
- if (mQueueIn.empty())\r
- {\r
- //Console->Print("ConnectionUDP::read() - no more packet");\r
- return NULL;\r
- }\r
- tmpMsg = mQueueIn.front();\r
- _size = tmpMsg->GetSize();\r
- tmpMsg->SetNextByteOffset(0);\r
- }\r
-\r
- if(*size==0)\r
- {\r
- *size=_size;\r
- }\r
- else\r
- {\r
- *size=min(*size, (s32)_size);\r
- }\r
-\r
- u8 const* ptr = tmpMsg->GetMessageData() + tmpMsg->GetNextByteOffset();\r
- tmpMsg->SetNextByteOffset(tmpMsg->GetNextByteOffset()+ *size);\r
- //Console->Print(GREEN, BLACK, "ConnectionUDP::read() - %d bytes read", *size);\r
- return ptr;\r
-}\r
-\r
-int ConnectionUDP::write(const void* data, int size)\r
-{\r
- // data is stored in mSendBufferMsg. Gets queued in next flushSendBuffer() or update()\r
- if (mSendBufferMsg == NULL)\r
- {\r
- //Console->Print("ConnectionUDP::write() creating new mSendBufferMsg");\r
- mSendBufferMsg = new PMessage(SENDBUFFERSIZE);\r
- }\r
- mSendBufferMsg->Write(data, (u16)size);\r
- //Console->Print(GREEN, BLACK, "ConnectionUDP::write() %d bytes written to mSendBufferMsg (total size %d)", size, mSendBufferMsg->GetSize());\r
- return size;\r
-}\r
-\r
-int ConnectionUDP::write(const char *String)\r
-{\r
- if(!String)\r
- return 0;\r
-\r
- return write(String, strlen(String));\r
-}\r
-\r
-int ConnectionUDP::write(u8 Data)\r
-{\r
- return write(&Data, sizeof(u8));\r
-}\r
-\r
-int ConnectionUDP::write(u16 Data)\r
-{\r
- return write(&Data, sizeof(u16));\r
-}\r
-\r
-int ConnectionUDP::write(u32 Data)\r
-{\r
- return write(&Data, sizeof(u32));\r
-}\r
-\r
-int ConnectionUDP::write(float Data)\r
-{\r
- return write(&Data, sizeof(float));\r
-}\r
-\r
-int ConnectionUDP::write(double Data)\r
-{\r
- return write(&Data, sizeof(double));\r
-}\r
-\r
-/// ***********************************************\r
-\r
-void ConnectionUDP::SetUDP_ID(u16 id)\r
-{\r
- if (mUDP_ID == 0xffff)\r
- {\r
- mUDP_ID = 0;\r
- }\r
- else\r
- {\r
- mUDP_ID = id;\r
- }\r
- if(mUDP_ID == 0) // If UDPID is set to zero, erase message buffer too\r
- ResetMessageBuffer();\r
-}\r
-\r
+++ /dev/null
-/*\r
- TinNS (TinNS is not a Neocron Server)\r
- Copyright (C) 2005 Linux Addicted Community\r
- maintainer Akiko <akiko@gmx.org>\r
-\r
- This program is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU General Public License\r
- as published by the Free Software Foundation; either version 2\r
- of the License, or (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
- 02110-1301, USA.\r
-*/\r
-\r
-\r
-\r
-/*\r
- main.h - main include file, contains all needed includes and important definitions\r
-\r
- MODIFIED: 26 Aug 2006 Hammag\r
- REASON: - created from gameserver main.h and modified as needed\r
- \r
- TODO: - move RECVBUFFERSIZE, SENDBUFFERSIZE, DEFAULT_TIMEOUT to config file\r
- - change Console & Config from external to static members if possible\r
- \r
-*/\r
-\r
-#ifndef MAIN_H\r
-#define MAIN_H\r
-\r
-//#include "version.h"\r
-\r
-//basic includes\r
-#include "external.h"\r
-\r
-//tinns includes\r
-#include "types.h"\r
-#include "netcode.h"\r
-\r
-#include "console.h"\r
-#include "config.h"\r
-\r
-using namespace std;\r
-\r
-/*\r
-static const int RECVBUFFERSIZE = 4096;\r
-static const int SENDBUFFERSIZE = 4096;\r
-\r
-static const time_t DEFAULT_TIMEOUT = 60;\r
-*/\r
-\r
-// To be put in config file\r
-#define RECVBUFFERSIZE 4096\r
-#define SENDBUFFERSIZE 4096\r
-#define DEFAULT_TCP_TIMEOUT 600\r
-#define DEFAULT_UDP_TIMEOUT 60\r
-\r
-// Better change that to a static members of each netcode class\r
-extern class PConsole* Console;\r
-extern class PConfig* Config;\r
-\r
-#endif\r
-\r
+++ /dev/null
-/*\r
- TinNS (TinNS is not a Neocron Server)\r
- Copyright (C) 2005 Linux Addicted Community\r
- maintainer Akiko <akiko@gmx.org>\r
-\r
- This program is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU General Public License\r
- as published by the Free Software Foundation; either version 2\r
- of the License, or (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
- 02110-1301, USA.\r
-*/\r
-\r
-\r
-\r
-/*\r
- serversocket.h - a serversocket class managing all connections (udp/tcp)\r
-\r
- Authors:\r
- - bakkdoor\r
-\r
- MODIFIED: 09 Feb 2006 bakkdoor\r
- REASON: - introduced\r
- \r
- MODIFIED: 27 Jun 2006 hammag\r
- REASON: - added modif to keep m_TimeOut value in update() as select (may) modifie this\r
- parameter in Linux\r
- \r
- MODIFIED: 01 Jul 2006 hammag\r
- REASON: - ServerSocket() : moved m_TimeOut initialization in constructor\r
- - added settimeout() method to permit various behaviors\r
- - ServerSocket(), open() : added m_MainSetUDP and m_MainSetGlobal init\r
- - open() : add m_ListenerTCP to m_MainSetGlobal too\r
- - update() : now m_MainSetGlobal is copied to m_ReadSetTCP set,\r
- and added a local fdMax for select\r
- - getUDPConnection(): add new UDP socket to m_MainSetUDP and m_MainSetGlobal, \r
- and keep track in m_FdMaxUDP\r
- - getTCPConnection(): add new TCP socket to m_MainSetGlobal too\r
- - delSocketFromSet() : added removal of sockfd from m_MainSetUDP and m_MainSetGlobal too\r
- - getTCPConnection() : moved non-blocking setting to ConnectionTCP::ConnectionTCP() for better class coherency\r
- - getUDPConnection(): added this to new ConnectionUDP creation parameters\r
- \r
- MODIFIED: 05 Aug 2006 hammag\r
- REASON: - now use UDP port in selected range for client connection (see .h) \r
- \r
- TODO: - delSocketFromSet() : Could now be improved with two separte methodes for TCP and UDP removal\r
- - in all 3 servers: put select timeout setting in config file.\r
- - don't access Config object from netcode's objects. Use parameter members\r
- set by object owner.\r
-*/\r
-\r
-#include "main.h"\r
-\r
-ServerSocket::ServerSocket()\r
-{\r
- FD_ZERO(&m_MainSetTCP); // clear the master and temp sets\r
- FD_ZERO(&m_ReadSetTCP);\r
- FD_ZERO(&m_MainSetUDP);\r
- FD_ZERO(&m_MainSetGlobal);\r
- \r
- m_FdMaxUDP=0;\r
- \r
- m_TimeOut.tv_sec = 0;\r
- m_TimeOut.tv_usec = 30;\r
- \r
- //m_LastUDPPort = 5000;\r
-}\r
-\r
-ServerSocket::~ServerSocket()\r
-{\r
- close(m_ListenerTCP);\r
-}\r
-\r
-void ServerSocket::settimeout(long timeout_sec, long timeout_usec)\r
-{\r
- if ((timeout_sec >= 0) && (timeout_usec >= 0))\r
- {\r
- m_TimeOut.tv_sec = timeout_sec;\r
- m_TimeOut.tv_usec = timeout_usec;\r
- }\r
- \r
-}\r
-\r
-bool ServerSocket::open(int port)\r
-{\r
- // get the tcp listener\r
- if ((m_ListenerTCP = socket(PF_INET, SOCK_STREAM, 0)) == -1)\r
- {\r
- perror("tcp-socket");\r
- return false;\r
- }\r
-\r
- int yes=1;\r
-\r
- // lose the pesky "address already in use" error message\r
- if (setsockopt(m_ListenerTCP, SOL_SOCKET, SO_REUSEADDR, &yes,\r
- sizeof(int)) == -1) {\r
- perror("tcp-setsockopt");\r
- return false;\r
- }\r
-\r
- // bind\r
- memset(&m_ServerAddr,0,sizeof(struct sockaddr_in));\r
- m_ServerAddr.sin_family = AF_INET;\r
- m_ServerAddr.sin_addr.s_addr = INADDR_ANY;\r
- m_ServerAddr.sin_port = htons(port);\r
-\r
- // bind with tcp sockfd\r
- if (bind(m_ListenerTCP, (struct sockaddr *)&m_ServerAddr, sizeof(struct sockaddr)) == -1)\r
- {\r
- perror("tcp-bind");\r
- return false;\r
- }\r
-\r
- // set listening-socket to non-blocking\r
- fcntl(m_ListenerTCP, F_SETFL, O_NONBLOCK);\r
-\r
- // listen\r
- if (listen(m_ListenerTCP, 10) == -1)\r
- {\r
- perror("tcp-listen");\r
- return false;\r
- }\r
-\r
- FD_ZERO(&m_MainSetTCP);\r
- FD_ZERO(&m_ReadSetTCP);\r
- FD_ZERO(&m_MainSetUDP);\r
- FD_ZERO(&m_MainSetGlobal);\r
- \r
- m_FdMaxUDP=0;\r
- \r
- // add the listener to the master sets\r
- FD_SET(m_ListenerTCP, &m_MainSetTCP);\r
- FD_SET(m_ListenerTCP, &m_MainSetGlobal);\r
-\r
- // keep track of the biggest file descriptor\r
- m_FdMaxTCP = m_ListenerTCP; // so far, it's this one\r
-\r
- //Console->Print("Server running on port %d", port);\r
-\r
- return true;\r
-}\r
-\r
-void ServerSocket::update()\r
-{\r
- struct timeval tmp_TimeOut;\r
- int fdMax;\r
- \r
- // copy fd_sets from main-set to temp. read-set\r
- m_ReadSetTCP = m_MainSetGlobal;\r
-\r
- fdMax = max(m_FdMaxTCP, m_FdMaxUDP);\r
- \r
- //FD_ZERO(&m_ReadSetTCP);\r
- //FD_SET (m_ListenerTCP, &m_ReadSetTCP);\r
-\r
- // select incoming data for tcp & udp\r
- tmp_TimeOut = m_TimeOut; //save m_TimeOut... will be modified by select\r
- if (select(fdMax+1, &m_ReadSetTCP, NULL, NULL, &tmp_TimeOut) == -1)\r
- {\r
- perror("select");\r
- }\r
- \r
- //Select exit condition logging\r
- /*\r
- if ((tmp_TimeOut.tv_sec == 0) && (tmp_TimeOut.tv_usec == 0))\r
- {\r
- Console->LPrint(GREEN, BLACK, "[Idle]");\r
- Console->LPrint(" Exiting select on timeout (remains %d sec and %d usec)", tmp_TimeOut.tv_sec, tmp_TimeOut.tv_usec);\r
- Console->LClose();\r
- }\r
- else \r
- {\r
- Console->LPrint(YELLOW, BLACK, "[Active]");\r
- Console->LPrint(" Exiting select with remaining time %d sec and %d usec", tmp_TimeOut.tv_sec, tmp_TimeOut.tv_usec);\r
- Console->LClose();\r
- }\r
- */\r
-\r
- // check for new tcp connections\r
- if (FD_ISSET(m_ListenerTCP, &m_ReadSetTCP)) // we got one!!\r
- {\r
- m_bNewTCPConnection = true;\r
- }\r
- else\r
- {\r
- m_bNewTCPConnection = false;\r
- }\r
-\r
-}\r
-\r
-bool ServerSocket::newConnection()\r
-{\r
- return (m_bNewTCPConnection);\r
-}\r
-\r
-ConnectionTCP* ServerSocket::getTCPConnection()\r
-{\r
- if(m_bNewTCPConnection)\r
- {\r
- struct sockaddr_in RemoteAddr; // new incoming client address\r
- socklen_t addrlen = sizeof(RemoteAddr);\r
- int NewSockfd; // newly accept()ed socket descriptor\r
-\r
- // handle new connections\r
- if ((NewSockfd = accept(m_ListenerTCP, (struct sockaddr *)&RemoteAddr, &addrlen)) == -1)\r
- {\r
- m_bNewTCPConnection = false; // set back to normal\r
- perror("tcp-accept");\r
- return 0;\r
- }\r
- else\r
- {\r
- FD_SET(NewSockfd, &m_MainSetTCP); // add to master TCP set\r
- FD_SET(NewSockfd, &m_MainSetGlobal); // add to master global set\r
- if (NewSockfd > m_FdMaxTCP) // keep track of the maximum\r
- {\r
- m_FdMaxTCP = NewSockfd;\r
- }\r
-\r
- ConnectionTCP* tcpConn = new ConnectionTCP(NewSockfd, RemoteAddr, this);\r
-\r
- m_bNewTCPConnection = false; // set back to normal\r
-\r
- return tcpConn;\r
- }\r
- }\r
-\r
- return 0;\r
-}\r
-\r
-ConnectionUDP* ServerSocket::getUDPConnection(long remoteadress, int remoteport)\r
-{\r
- int udpSockfd;\r
-\r
- if ((udpSockfd = socket(PF_INET, SOCK_DGRAM, 0)) == -1)\r
- {\r
- perror("udp-socket");\r
- return NULL;\r
- }\r
-\r
- struct sockaddr_in my_addr;\r
-\r
- u16 Port = Config->GetOptionInt("gameserver_udpport_min");\r
- u16 maxPort = Config->GetOptionInt("gameserver_udpport_max");\r
-\r
- my_addr.sin_family = AF_INET; // host byte order\r
- my_addr.sin_port = htons(Port); // short, network byte order\r
- my_addr.sin_addr.s_addr = INADDR_ANY; // automatically fill with my IP\r
- memset(&(my_addr.sin_zero), '\0', 8); // zero the rest of the struct\r
-\r
- //Search a free udp port to use (could be optimised for faster port allocation)\r
- while (bind(udpSockfd, (struct sockaddr *)&my_addr, sizeof(struct sockaddr)) == -1)\r
- {\r
- if (errno == EADDRINUSE)\r
- { \r
- my_addr.sin_port = htons(++Port);\r
- if (Port > maxPort)\r
- {\r
- Console->Print(RED, BLACK,"No more free UDP port in configured range");\r
- return NULL;\r
- }\r
- }\r
- else\r
- { \r
- perror("udp-bind");\r
- return NULL;\r
- }\r
- }\r
-\r
- FD_SET(udpSockfd, &m_MainSetUDP); // add to master UDP set\r
- FD_SET(udpSockfd, &m_MainSetGlobal); // add to master global set\r
- if (udpSockfd > m_FdMaxUDP) // keep track of the maximum\r
- {\r
- m_FdMaxUDP = udpSockfd;\r
- }\r
- \r
- ConnectionUDP* udpConn = new ConnectionUDP(udpSockfd, Port, remoteadress, remoteport, this);\r
-\r
- //m_LastUDPPort++;\r
-\r
- return udpConn;\r
-}\r
-\r
-bool ServerSocket::isDataAvailable(int sockfd)\r
-{\r
- if(FD_ISSET(sockfd, &m_ReadSetTCP))\r
- {\r
- return true;\r
- }\r
-\r
- return false;\r
-}\r
-\r
-void ServerSocket::delSocketFromSet(int sockfd)\r
-{\r
- FD_CLR(sockfd, &m_MainSetTCP);\r
- FD_CLR(sockfd, &m_MainSetUDP);\r
- FD_CLR(sockfd, &m_MainSetGlobal);\r
-}\r
-\r
-void ServerSocket::closeServer()\r
-{\r
- close(m_ListenerTCP);\r
-}\r
+++ /dev/null
-/*\r
- TinNS (TinNS is not a Neocron Server)\r
- Copyright (C) 2005 Linux Addicted Community\r
- maintainer Akiko <akiko@gmx.org>\r
-\r
- This program is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU General Public License\r
- as published by the Free Software Foundation; either version 2\r
- of the License, or (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
- 02110-1301, USA.\r
-*/\r
-\r
-/*\r
- udpmanager.cpp - Manager for UDP Messages. Watches UDP_ID's and keeps\r
- message history for possible OutOfOrder requests\r
-*/\r
-\r
-#include "main.h"\r
-\r
-void ConnectionUDP::UpdateMessageBuffer()\r
-{\r
- int erasednum = 0;\r
- // Delete all old messages\r
- for(PMessageMap::iterator it=UDPMessages.begin(); it!=UDPMessages.end(); it++)\r
- {\r
- if((int)it->first < (int)(mLastUDPID - MAX_RETENTION))\r
- {\r
- erasednum++;\r
- delete it->second;\r
- UDPMessages.erase(it);\r
- }\r
- }\r
- /* // Debug output\r
- if(erasednum > 0)\r
- Console->Print("[UpdateMessageBuffer] Done updating messagequeue, %d entries deleted", erasednum);\r
- */\r
-}\r
-\r
-void ConnectionUDP::ResetMessageBuffer()\r
-{\r
- if(mUDP_ID != 0)\r
- {\r
- Console->Print("%s MessageQueue got erased but UDP_ID is still >0", Console->ColorText(RED, BLACK, "[WARNING]"));\r
- }\r
- for(PMessageMap::iterator it=UDPMessages.begin(); it!=UDPMessages.end(); it++)\r
- {\r
- delete it->second;\r
- UDPMessages.erase(it);\r
- }\r
- mLastUDPID = 0;\r
-// Console->Print("[udpmanager] Erased messagebuffer");\r
-}\r
-\r
-void ConnectionUDP::ReSendUDPMessage(u16 nUDP_ID)\r
-{\r
- // ReSend packet with given UDP_ID\r
- if(nUDP_ID > mLastUDPID)\r
- {\r
- Console->Print("%s Cannot resend packet with UDP_ID %d, msgnumber is higher than last known udpID", Console->ColorText(RED, BLACK, "[PANIC]"), nUDP_ID);\r
- }\r
- else\r
- {\r
- // UDP_ID seems to be valid, now search for it\r
- PMessageMap::const_iterator it = UDPMessages.find(nUDP_ID);\r
- if(it == UDPMessages.end())\r
- {\r
- int dynRetention = (int)mLastUDPID - nUDP_ID;\r
- if(dynRetention > MAX_RETENTION)\r
- {\r
- Console->Print("%s Packet with UDP_ID %d not found. Increase #define MAX_RETENTION to at least %d", Console->ColorText(RED, BLACK, "[WARNING]"), nUDP_ID, dynRetention);\r
- }\r
- else\r
- {\r
- Console->Print("%s Packet with UDP_ID %d is missing in the packet queue!", Console->ColorText(RED, BLACK, "[PANIC]"), nUDP_ID);\r
- }\r
- Console->Print("Trying to cancel OOO notice by sending dummy packet");\r
- PMessage* tmpMsg = new PMessage(14);\r
- //u16 tmpSessionID = mLastUDPID + SESSION_UDP_OFFSET;\r
- *tmpMsg << (u8)0x13;\r
- *tmpMsg << nUDP_ID;\r
- *tmpMsg << (u16)(nUDP_ID + SESSION_UDP_OFFSET);\r
- *tmpMsg << (u8)0x08;\r
- *tmpMsg << (u8)0x03;\r
- *tmpMsg << nUDP_ID;\r
- *tmpMsg << (u8)0x1F;\r
- *tmpMsg << (u16)0xFFFF; // Should do nothing, CharID 65535 should never exist\r
- *tmpMsg << (u16)0x3C01; // This value IS wrong way, so that nothing can happen at all\r
- SendMessage(tmpMsg, true);\r
- }\r
- else if(it->second)\r
- {\r
- Console->Print("[OOO-Buster] ReSending UDP packet with ID %d", nUDP_ID);\r
- // Build new message, including the missing UDP packets as content\r
- u16 MsgSize = it->second->GetSize();\r
- PMessage* tmpMsg = new PMessage(MsgSize + 5); // Create new message\r
- *tmpMsg << (u8)0x13;\r
- *tmpMsg << nUDP_ID;\r
- *tmpMsg << (u16)(nUDP_ID + SESSION_UDP_OFFSET);\r
-// *tmpMsg << mUDP_ID;\r
-// *tmpMsg << mSessionID;\r
-// *tmpMsg << *it->second; // This should work, but it doesnt! Causes segfault after sending a few packets\r
- for(int x = 0; x < MsgSize; x++)\r
- {\r
- *tmpMsg << it->second->U8Data(x);\r
- }\r
- SendMessage(tmpMsg, true); // Add message to outgoing VIP queue\r
- }\r
- }\r
-}\r
-\r
-void ConnectionUDP::InsertUDPMessage(PMessage* nMsg)\r
-{\r
- if (!nMsg)\r
- return;\r
-\r
- if(nMsg->U8Data(0) != 0x13) return; // Only add real UDP messages here\r
-// 0 1 2 3 4 5 6 7 8 9 a b c d e f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28\r
-// 13 07 00 F2 00 05 03 02 00 11 11 05 03 03 00 11 11 05 03 04 00 11 11 05 03 05 00 11 11 05 03 06 00 11 11 05 03 07 00 11 11\r
-\r
- // Grab submessages from packet, check if message is 0x03 commandset. If not, dont add message\r
- PMessage* tWorkMsg = NULL;\r
-\r
- u16 tCurPos = 5;\r
- u8 tSubMsgLen = 0;\r
- u16 tmpUDPID = 0;\r
- //nMsg->Dump();\r
- while(tCurPos < (nMsg->GetSize() - 1)) // Loop while we still have more frames. (-1: GetSize starts at 1, pos pointer at 0)\r
- {\r
- //Console->Print("tCurPos = %d nMsg->GetSize = %d", tCurPos, nMsg->GetSize());\r
- tSubMsgLen = nMsg->U8Data(tCurPos) + 1; // Get the lenght of the frame, and add the lenght byte\r
- if(nMsg->U8Data(tCurPos+1) != 0x03)\r
- {\r
- //Console->Print("Ignoring UDP message, no 0x03 commandset");\r
- tCurPos += tSubMsgLen; // Set pointer to the end of this frame\r
- continue; // Skip if frame is not an 0x03 commandset\r
- }\r
- //Console->Print("MsgLen: %d", tSubMsgLen);\r
- tWorkMsg = nMsg->GetChunk(tCurPos, tSubMsgLen); // get the frame.\r
- //Console->Print("Msg:");\r
- //tWorkMsg->Dump();\r
- tmpUDPID = nMsg->U16Data(tCurPos + 2); // Get the UDP ID of this frame\r
- //Console->Print("UDP ID: %d", tmpUDPID);\r
- PMessageMap::const_iterator it = UDPMessages.find(tmpUDPID); // Try to find the UDP ID in the queue\r
- if(it->second) // If we already have this UDP msg, print error\r
- {\r
- Console->Print("%s Packet *NOT* added to history buffer, UdpID %d already sent! (This may cause an OOO)", Console->ColorText(RED, BLACK, "[WARNING]"), tmpUDPID);\r
- nMsg->Dump();\r
- }\r
- else // We dont have this msg? Add it!\r
- {\r
- //Console->Print("Added UDP ID %d to messagebuffer", tmpUDPID);\r
- UDPMessages.insert(std::make_pair(tmpUDPID, tWorkMsg));\r
- mLastUDPID++;\r
- }\r
- tCurPos += tSubMsgLen; // Set pointer to the end of this frame\r
- }\r
-}\r
-//
-// regex.hpp 1.0 Copyright (c) 2003 Peter Petersen (pp@on-time.de)
-// Simple C++ wrapper for PCRE
-//
-// This source file is freeware. You may use it for any purpose without
-// restriction except that the copyright notice as the top of this file as
-// well as this paragraph may not be removed or altered.
-//
-#include <string.h>
-#include "regex++.h"
+#include "common/regex++.h"
+
+#include <cstring>
RegEx::RegEx(const char * regex, int options)
{
--- /dev/null
+#pragma once
+
+#include <iostream>
+
+#ifndef _PCRE_H
+#include "pcre.h"
+#endif
+
+class RegEx {
+private:
+ pcre * re;
+ pcre_extra * pe;
+ int substrcount;
+ int * ovector;
+ const char * lastsubject;
+ int slen;
+ const char * * matchlist;
+
+ inline void ClearMatchList(void)
+ {
+ if (matchlist)
+ {
+ pcre_free_substring_list(matchlist);
+ matchlist = NULL;
+ }
+ }
+
+public:
+ RegEx(const char * regex, int options = 0);
+ ~RegEx();
+ inline int SubStrings(void) const { return substrcount; }
+ bool Search(const char * subject, int len = -1, int options = 0);
+ bool SearchAgain(int options = 0);
+ const char * Match(int i = 1);
+};
+++ /dev/null
-#
-# TinNS per-directory Makefile
-#
-# Adapted by Hammag from the Makefile system for Linux kernel.
-#
-# 14 Sep 2000, Christoph Hellwig <hch@infradead.org>
-# Rewritten to use lists instead of if-statements.
-#
-
-######################################################
-# Target for this directory and its sub-dirs
-######################################################
-# Case 1 : target is an executable named as defined
-#B_TARGET := testor2
-
-# Case 2 : target is a TinNS lib name
-# (use short name, as in -l linker option)
-L_TARGET := tinns
-
-# Case 3 (usual): objects shall be made available to the parent dir
-# The following line will set that automatically
-# (Should match dir name + .o suffix)
-#O_TARGET := $(addsuffix .o,$(notdir $(shell /bin/pwd)))
-# Manualy define this only if you need to force the compiled obj name
-#O_TARGET := game.o
-
-
-######################################################
-# Local flags
-######################################################
-# local dir CXX Flags
-#EXTRA_CXXFLAGS := -I/usr/include/mysql
-
-# per-object CXX Flags
-#CXXFLAGS_funcdef2.o := -g
-
-# local dir Linker Flags (for intermediate .o linking)
-#EXTRA_LDFLAGS :=
-
-# any tinns Lib used (short name, as in -l linker option)
-#LINK_TINNSLIBS := tinns
-
-# local dir Linker Flags (for final executable linking)
-#EXTRA_LINKFLAGS := -lrt -lpthread -lz -lm -lcrypt -L"/usr/lib/mysql" -lmysqlclient
-
-
-#####################################################
-# Subdirectories
-#####################################################
-#subdir-y := def
-#subdir-$(CONFIG_GAMEMONKEY) += gamemonkey
-
-
-#####################################################
-#***************************************************#
-# No further config should be needed after this line
-#***************************************************#
-ifdef TOPDIR
-
-# build list of objects ib loca ldir
-obj-y := $(patsubst %.cpp,%.o,$(wildcard *.cpp))
-# add final object from each subdir
-obj-y += $(join $(subdir-y),$(subdir-y:%=/%.o))
-
-include $(TOPDIR)/Rules.make
-
-else #TOPDIR undef, Makefile called from non-top dir
-
-# Memorize the first calling dir in case we wanted to
-# lauch local actions from top Makefile
- ifndef FIRSTDIR
- FIRSTDIR :=$(CURDIR)
- export FIRSTDIR
- endif
-
-uptoparent :
- $(MAKE) -C .. $(MAKECMDGOALS)
-
-.DEFAULT :
- $(MAKE) -C .. $(MAKECMDGOALS)
-
-endif #TOPDIR
-
--- /dev/null
+add_executable (getsvnrev getsvnrev.cpp)
+add_executable (cleandepfile cleandepfile.c)
+++ /dev/null
-all: cleandepfile
-#all: cleandepfile svnrev
-
-cleandepfile: cleandepfile.c
- $(HOSTCC) $(HOSTCFLAGS) -o $@ $<
-
-#svnrev: getsvnrev.cpp
-# g++ -pedantic -Wall -c getsvnrev.cpp -o getsvnrev.o
-# g++ -o getsvnrev getsvnrev.o -lstdc++ -lz
-
/*
cleandepfile.c
- CREATED: 11 Dec 2006 Hammag
+ CREATED: 11 Dec 2006 Hammag
+ MODIFIED: 09 Jun 2009 Akiko
+ REASON: - corrected warning (args)
*/
#include <string.h>
return 1;
}
-int main(int argc, char **argv)
+int main(void)
{
int ret;
int len;
/*\r
TinNS (TinNS is not a Neocron Server)\r
- pak_decompress - pak file decompression tool\r
- Copyright (C) 2005 Akiko <akiko@gmx.org>\r
+ Copyright (C) 2005 Linux Addicted Community\r
+ maintainer Akiko <akiko@gmx.org>\r
\r
This program is free software; you can redistribute it and/or\r
modify it under the terms of the GNU General Public License\r
\r
MODIFIED: 22 Dec 2006 Namikon\r
REASON: - started this tool\r
+ MODIFIED: 09 Jun 2009 Akiko\r
+ REASON: - more C++ stylish\r
+ - missing libs (cstring, cstdlib)\r
\r
TODO:\r
- Better way to get SVN rev than this (2nd number in file)\r
*/\r
\r
\r
-#include <stdio.h>\r
+#include <cstdio>\r
+#include <cstring>\r
+#include <cstdlib>\r
#include <iostream>\r
\r
-using namespace std;\r
-\r
int main(int argc, char **argv)\r
{\r
- string targetdir;\r
+ std::string targetdir;\r
FILE *f;\r
\r
if(argc == 2)\r
\r
fclose(f);\r
\r
- cout << rev << endl;\r
+ std::cout << rev << std::endl;\r
}\r
else\r
{\r
- cout << "0" << endl;\r
+ std::cout << "0" << std::endl;\r
}\r
return(0);\r
}\r
+++ /dev/null
-#!/bin/bash
-#
-###########################################################
-# setsvnrev script for TinNS. Original written by Hammag, #
-# improved by Namikon. #
-# See bottom of file for GPL license. #
-###########################################################
-# #
-# Last edited: 08.01.2076 18:02 GMT +1 by Hammag #
-# #
-###########################################################
-# How this works: #
-# Everytime you do "make", this script is called. #
-# It will check the current svn headerfile if its #
-# a new revision or just a recompile. #
-# IF it is a new revision, the script tries to get #
-# the actual version from the official SVN #
-# tool "svnversion". If your server has no SVN #
-# installed (which is not good if you want to #
-# participate in TinNS dev), or it is outdated for #
-# some reason, you must manually update svnrev.h #
-# This number is then written to svnrev.h, compiled #
-# into Patch, Info and Gameserver, and can be viewed #
-# ingame by typing @version #
-###########################################################
-
-if [[ $# -ne 2 ]]; then
- echo "Error - usage:" `basename $0` "<svn base path> <svnrev.h filepath>" >&2
- exit -1
-fi
-
-#We exit silently if no SVN system seem to be used locally
-if [[ ! -d $1/.svn ]]; then exit 0; fi
-
-v=`svnversion $1`
-if [[ $? -ne 0 ]]; then
- echo "###### WARNING : can't get SVN revision number ######"
- echo " You must manually update rev number in include/version.h before any public release !"
- if [[ ! -f .no_msg_stop ]]; then
- echo
- echo ---- Press a key to continue ----
- read -s -n 1
- touch .no_msg_stop
- fi
- exit 0
-fi
-#if expr "$v" : '[0-9]\+$' > /dev/null; then
- current=`echo $v | sed 's/^\([0-9]*:\)\?\([0-9]\+\)[^0-9]*/\2/'`
- modif=`echo $v | sed 's/^\([0-9]*:\)\?[0-9]\+[^0-9]*\(M\)/\2/'`
- #echo svnver: $v
- #echo current: $current
- #echo modif: $modif
-
- if [[ $modif == M ]]; then
- current=$[$current + 1];
- fi
-#else
-# v=`$1/dev-tools/getsvnrev $1`
-# if [ "$v" = "0" ]; then
-# exit 0;
-# fi
-# if ! expr "$v" : '[0-9]\+$' > /dev/null; then
-# echo "Error: Unable to get SVN Revision!";
-# exit 0;
-# fi
-# if [ -z "$v" ]; then
-# echo "Error: Unable to get SVN Revision!";
-# exit 0;
-# fi
-# current="$v"
-#fi
-
-filever=`grep TINNS_SVN_REVISION $2 | sed 's/^.*"\([0-9]\+\)".*$/\1/'`
-#echo svnver in file: $filever
-
-if [[ $filever -ge $current ]]; then
- echo No SVN Revision number change needed
- exit 0;
-fi
-
-echo Updating SVN Revision number to $current
-
-cat >$2 <<ENDOFDOC
-/*
- TinNS (TinNS is not a Neocron Server)
- Copyright (C) 2005 Linux Addicted Community
- maintainer Akiko <akiko@gmx.org>
-
- 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 (at your option) 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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
-*/
-
-/*
- THIS FILE IS GENERATED BY THE MAKE COMMAND make svnrev
- It is to be updated by this command before each revision commit operation
- PLEASE DON'T MODIFY BY HAND
-*/
-
-#ifndef SVN_REV_DEF
-#define SVN_REV_DEF
-
-#define TINNS_SVN_REVISION "$current"
-
-#endif
-
-ENDOFDOC
-
--- /dev/null
+include_directories (${TINNS_SOURCE_DIR}/server/src/game ${LUA_INCLUDE_DIR})
+
+add_executable (gameserver
+ # decoder stuff
+ decoder/msgdecoder.cpp decoder/udp_0x13.cpp decoder/udp_0x1f.cpp decoder/udp_0x22.cpp
+ decoder/udp_0x2b.cpp decoder/udpanalyser.cpp decoder/udp_appartment.cpp decoder/udp_charmove.cpp
+ decoder/udp_chat.cpp decoder/udp_deathrespawn.cpp decoder/udp_entityposreq.cpp
+ decoder/udp_hack.cpp decoder/udp_helditemaction.cpp decoder/udp_0x08.cpp decoder/udp_OOO.cpp
+ decoder/udp_itemmanualreload.cpp decoder/udp_itemmove.cpp decoder/udp_itemuse.cpp
+ decoder/udp_killself.cpp decoder/udp_outfitter.cpp decoder/udp_packet0.cpp decoder/udp_ping.cpp
+ decoder/udp_popupresponse.cpp decoder/udp_quickaccessbelt.cpp decoder/udp_reqinfo.cpp
+ decoder/udp_subskill.cpp decoder/udp_sync.cpp decoder/udp_terminal.cpp decoder/udp_useobject.cpp
+ decoder/udp_vhc.cpp decoder/udp_zoning.cpp decoder/udp_worldIDinfo.cpp decoder/udp_multipart.cpp
+ decoder/udp_pvptrade.cpp decoder/udp_npcdialog.cpp
+ # def file stuff
+ def/def_actionmod.cpp def/def_ammo.cpp def/def_appartements.cpp def/def_appplaces.cpp
+ def/def_blueprintpieces.cpp def/def_characters.cpp def/def_charaction.cpp def/def_charkinds.cpp
+ def/def_damage.cpp def/def_drugs.cpp def/def_factions.cpp def/def_hack.cpp def/def_implants.cpp
+ def/def_itemcontainer.cpp def/def_itemmod.cpp def/def_itemres.cpp def/def_items.cpp
+ def/def_mission.cpp def/def_npcarmor.cpp def/def_npc.cpp def/def_npcgroupspawn.cpp
+ def/def_outposts.cpp def/defparser.cpp def/def_recycles.cpp def/def_respawn.cpp
+ def/def_shots.cpp def/def_skills.cpp def/def_subskills.cpp def/def_trader.cpp
+ def/def_vehicles.cpp def/def_vehiclesits.cpp def/def_weapons.cpp def/def_weather.cpp
+ def/def_worldfile.cpp def/def_worldmodels.cpp def/def_worlds.cpp def/gamedefs.cpp
+ def/world_datparser.cpp def/def_scripts.cpp
+ # gamecommands stuff
+ gamecommands/ban.cpp gamecommands/brightness.cpp gamecommands/broadcast.cpp gamecommands/color.cpp
+ gamecommands/debug.cpp gamecommands/effect.cpp gamecommands/givemoney.cpp gamecommands/h.cpp
+ gamecommands/info.cpp gamecommands/npc_shop.cpp gamecommands/jail.cpp gamecommands/kick.cpp
+ gamecommands/listbans.cpp gamecommands/online.cpp gamecommands/rawf.cpp gamecommands/recall.cpp
+ gamecommands/remove.cpp gamecommands/setlevel.cpp gamecommands/settime.cpp
+ gamecommands/setsubskill.cpp gamecommands/shun.cpp gamecommands/setmainskill.cpp
+ gamecommands/skin.cpp gamecommands/spawnactor.cpp gamecommands/speed.cpp gamecommands/takemoney.cpp
+ gamecommands/t.cpp gamecommands/teleport.cpp gamecommands/test.cpp gamecommands/unban.cpp
+ gamecommands/unjail.cpp gamecommands/unshun.cpp gamecommands/uptime.cpp gamecommands/v.cpp
+ gamecommands/version.cpp gamecommands/warp.cpp gamecommands/warpto.cpp gamecommands/weather.cpp
+ gamecommands/npc.cpp
+ # gameserver stuff
+ globals.cpp terminal_querydb.cpp multipart.cpp accounts.cpp appartements.cpp buddylist.cpp
+ chars.cpp chat.cpp client.cpp clientmanager.cpp commands.cpp container.cpp doortemplate.cpp
+ furnituretemplate.cpp gameserver.cpp genreplist.cpp inventory.cpp isc.cpp item.cpp main.cpp
+ lua_engine.cpp msgbuilder.cpp npc.cpp server.cpp skill.cpp sql.cpp subway.cpp terminal.cpp
+ terminal_receivedb.cpp terminal_tryaccess.cpp npc_conversation.cpp terminal_updatedb.cpp
+ vehicle.cpp vhcaccessrequest.cpp worldactors.cpp worlddatatemplate.cpp worlds.cpp zoning.cpp
+ outpost.cpp npc_ai.cpp npctemplate.cpp)
+
+target_link_libraries (gameserver common ${MYSQL_LIBRARY} ${PCRE_LIBRARY} ${ZLIB_LIBRARY} ${RT_LIBRARY} ${LUA_LIBRARY})
+++ /dev/null
-#
-# TinNS per-directory Makefile
-#
-# Adapted by Hammag from the Makefile system for Linux kernel.
-#
-# 14 Sep 2000, Christoph Hellwig <hch@infradead.org>
-# Rewritten to use lists instead of if-statements.
-#
-
-######################################################
-# Target for this directory and its sub-dirs
-######################################################
-# Case 1 : target is an executable named as defined
-B_TARGET := gameserver
-
-# Case 2 : target is a TinNS lib name
-# (use short name, as in -l linker option)
-#L_TARGET := tinns
-
-# Case 3 (usual): objects shall be made available to the parent dir
-# The following line will set that automatically
-# (Should match dir name + .o suffix)
-#O_TARGET := $(addsuffix .o,$(notdir $(shell /bin/pwd)))
-# Manualy define this only if you need to force the compiled obj name
-#O_TARGET := game.o
-
-
-######################################################
-# Local flags
-######################################################
-# local dir CXX Flags
-EXTRA_CXXFLAGS := -I/usr/include/mysql -Iinclude
-
-# per-object CXX Flags
-#CXXFLAGS_funcdef2.o := -g
-
-# local dir Linker Flags (for intermediate .o linking)
-#EXTRA_LDFLAGS :=
-
-# any tinns Lib used (short name, as in -l linker option)
-LINK_TINNSLIBS := tinns
-
-# local dir Linker Flags (for final executable linking)
-#EXTRA_LINKFLAGS := -lpthread -lm -lcrypt -lrt -L"/usr/lib/mysql" -lmysqlclient -lz
-EXTRA_LINKFLAGS := -lrt -L"/usr/lib/mysql" -lmysqlclient -lz -lpcre -llua
-
-
-#####################################################
-# Subdirectories
-#####################################################
-subdir-y := decoder def gamecommands
-#subdir-$(CONFIG_GAMEMONKEY) += gamemonkey
-
-
-#####################################################
-#***************************************************#
-# No further config should be needed after this line
-#***************************************************#
-ifdef TOPDIR
-
-# build list of objects ib loca ldir
-obj-y := $(patsubst %.cpp,%.o,$(wildcard *.cpp))
-# add final object from each subdir
-obj-y += $(join $(subdir-y),$(subdir-y:%=/%.o))
-
-include $(TOPDIR)/Rules.make
-
-else #TOPDIR undef, Makefile called from non-top dir
-
-# Memorize the first calling dir in case we wanted to
-# lauch local actions from top Makefile
- ifndef FIRSTDIR
- FIRSTDIR :=$(CURDIR)
- export FIRSTDIR
- endif
-
-uptoparent :
- $(MAKE) -C .. $(MAKECMDGOALS)
-
-.DEFAULT :
- $(MAKE) -C .. $(MAKECMDGOALS)
-
-endif #TOPDIR
-
REASON: - Changed FmtTxt() to sprintf(). It does... uhm, the same :D\r
MODIFIED: 06 Jan 2006 Namikon\r
REASON: - Removed the old XML loading functions, and changed the SQL ones to work with the Global Neopolis/TinNS Database\r
- - Added SetBannedStatus(<unix timestamp>) to ban/unban an account (use SetBannedStatus(0) to unban a player)\r
+ - Added SetBannedStatus(<unix timestamp>) to ban/unban an account (use SetBannedStatus(0) to unban a player)\r
MODIFIED: 03 Oct 2006 Hammag\r
REASON: - Fixed an issue in PAccount::SetBannedStatus() that was causing the "can't update banned status" error message.\r
\r
MODIFIED: 27 May 2007 Hammag\r
REASON: - Full changes for on-demand account access (no more memory-resident account data)\r
+ MODIFIED: 09 Jun 2009 Akiko\r
+ REASON: - adjusted includes for new build system\r
+ - clean ups\r
*/\r
\r
\r
2 = Banned\r
*/\r
#include "main.h"\r
-#include "accounts.h"\r
+#include "include/accounts.h"\r
\r
/** Static members **/\r
RegEx* PAccount::mUsernameRegexFilter = NULL;\r
\r
\r
/*\r
- appartements.cpp - appartements class\r
+ appartements.cpp - appartements class\r
\r
MODIFIED: 20 Nov 2006 Hammag\r
REASON: - creation\r
- \r
+ MODIFIED: 09 Jun 2009 Akiko\r
+ REASON: - adjusted includes for new buildsystem\r
*/\r
\r
#include "main.h"\r
\r
-#include "appartements.h"\r
-#include "gamedefs.h"\r
-#include "def_appartements.h"\r
-#include "worlds.h"\r
+#include "include/appartements.h"\r
+#include "include/gamedefs.h"\r
+#include "include/def_appartements.h"\r
+#include "include/worlds.h"\r
\r
PAppartements::PAppartements()\r
{\r
/*\r
- TinNS (TinNS is not a Neocron Server)\r
- Copyright (C) 2005 Linux Addicted Community\r
-\r
- This program is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU General Public License\r
- as published by the Free Software Foundation; either version 2\r
- of the License, or (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
- 02110-1301, USA.\r
+ TinNS (TinNS is not a Neocron Server)\r
+ Copyright (C) 2005 Linux Addicted Community\r
+\r
+ This program is free software; you can redistribute it and/or\r
+ modify it under the terms of the GNU General Public License\r
+ as published by the Free Software Foundation; either version 2\r
+ of the License, or (at your option) any later version.\r
+\r
+ This program is distributed in the hope that it will be useful,\r
+ but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ GNU General Public License for more details.\r
+\r
+ You should have received a copy of the GNU General Public License\r
+ along with this program; if not, write to the Free Software\r
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
+ 02110-1301, USA.\r
*/\r
\r
\r
\r
/*\r
- buddylist.cpp - classe for chat buddylist\r
+ buddylist.cpp - class for chat buddylist\r
\r
- MODIFIED: 19 Sep 2006 Hammag\r
- REASON: - creation\r
+ MODIFIED: 19 Sep 2006 Hammag\r
+ REASON: - creation\r
+ MODIFIED: 09 Jun 2009 Akiko\r
+ REASON: - adjusted includes for new buildsystem\r
+ - clean ups\r
\r
- TODO: - link with a online char list, updated when needed (chars in/out, or list modified)\r
+ TODO: - link with a online char list, updated when needed (chars in/out, or list modified)\r
*/\r
\r
#include "main.h"\r
-#include "buddylist.h"\r
+#include "include/buddylist.h"\r
\r
PBuddyList::PBuddyList(u32 nOwnerCharID)\r
{\r
/*\r
- TinNS (TinNS is not a Neocron Server)\r
- Copyright (C) 2005 Linux Addicted Community\r
- maintainer Akiko <akiko@gmx.org>\r
-\r
- This program is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU General Public License\r
- as published by the Free Software Foundation; either version 2\r
- of the License, or (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
- 02110-1301, USA.\r
+ TinNS (TinNS is not a Neocron Server)\r
+ Copyright (C) 2005 Linux Addicted Community\r
+ maintainer Akiko <akiko@gmx.org>\r
+\r
+ This program is free software; you can redistribute it and/or\r
+ modify it under the terms of the GNU General Public License\r
+ as published by the Free Software Foundation; either version 2\r
+ of the License, or (at your option) any later version.\r
+\r
+ This program is distributed in the hope that it will be useful,\r
+ but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ GNU General Public License for more details.\r
+\r
+ You should have received a copy of the GNU General Public License\r
+ along with this program; if not, write to the Free Software\r
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
+ 02110-1301, USA.\r
*/\r
\r
\r
\r
/*\r
- chars.cpp\r
-\r
- MODIFIED: 22 Dec 2005 Namikon\r
- REASON: - Added GPL\r
- MODIFIED: 01 Jan 2006 Namikon\r
- REASON: - Added SQLLoad() function to PChar and PChars\r
- - Changed FmtTxt() to sprintf(). It does... uhm, the same :D\r
- - Added IsOnline var and function\r
- MODIFIED: 06 Jan 2005 Namikon\r
- REASON: - Added colored console ouputs\r
- - Removed XM Load() and Save() functions\r
- - Rewrote parts of SQLLoad to work with the global NeoPolis / TinNS database\r
- - Added FillinCharDetails to fill the baseline up with the char details\r
- MODIFIED: 03 Oct 2006 Hammag\r
- REASON: - PChar::CreateNewChar() and moved effective char creation from PChars to PChar\r
- - added PChar::SQLDelete()\r
- This method is put here because we want the char to be loaded when deleted from DB to avoid\r
- any player to use it at the same time.\r
- - added use of auto_save_period config option in PChars::update()\r
- - removed old XML-storage related code\r
-\r
- TODO: - implement PChar::SQLDelete()\r
+ chars.cpp\r
+\r
+ MODIFIED: 22 Dec 2005 Namikon\r
+ REASON: - Added GPL\r
+ MODIFIED: 01 Jan 2006 Namikon\r
+ REASON: - Added SQLLoad() function to PChar and PChars\r
+ - Changed FmtTxt() to sprintf(). It does... uhm, the same :D\r
+ - Added IsOnline var and function\r
+ MODIFIED: 06 Jan 2005 Namikon\r
+ REASON: - Added colored console ouputs\r
+ - Removed XM Load() and Save() functions\r
+ - Rewrote parts of SQLLoad to work with the global NeoPolis / TinNS database\r
+ - Added FillinCharDetails to fill the baseline up with the char details\r
+ MODIFIED: 03 Oct 2006 Hammag\r
+ REASON: - PChar::CreateNewChar() and moved effective char creation from PChars to PChar\r
+ - added PChar::SQLDelete()\r
+ This method is put here because we want the char to be loaded when deleted from DB to avoid\r
+ any player to use it at the same time.\r
+ - added use of auto_save_period config option in PChars::update()\r
+ - removed old XML-storage related code\r
+ MODIFIED: 09 Jun 2009 Akiko\r
+ REASON: - adjusted includes for ne buildsystem\r
+ - clean ups\r
+\r
+ TODO: - implement PChar::SQLDelete()\r
*/\r
\r
#include "main.h"\r
-#include "worlds.h"\r
-#include "appartements.h"\r
-#include "container.h"\r
-#include "inventory.h"\r
-#include "vhcaccessrequest.h"\r
+#include "include/worlds.h"\r
+#include "include/appartements.h"\r
+#include "include/container.h"\r
+#include "include/inventory.h"\r
+#include "include/vhcaccessrequest.h"\r
\r
// PCharCoordinates\r
void PCharCoordinates::SetInterpolate( PCharCoordinates& Pos1, PCharCoordinates& Pos2, f32 nCoef )\r
// SQL Layout\r
enum\r
{\r
- c_id,
- c_name,
- c_str_lvl,
- c_str_pts,
- c_int_lvl,
- c_int_pts,
- c_dex_lvl,
- c_dex_pts,
- c_con_lvl,
- c_con_pts,
- c_psi_lvl,
- c_psi_pts,
- a_id,
- c_class,
- c_profession,
- c_sex,
- c_location,
- c_mc,
- c_hc,
- c_tra,
- c_pc,
- c_rc,
- c_tc,
- c_vhc,
- c_agl,
- c_rep,
- c_rec,
- c_rcl,
- c_atl,
- c_end,
- c_for,
- c_fir,
- c_enr,
- c_xrr,
- c_por,
- c_hlt,
- c_hck,
- c_brt,
- c_psu,
- c_wep,
- c_cst,
- c_res,
- c_imp,
- c_ppu,
- c_apu,
- c_mst,
- c_ppw,
- c_psr,
- c_wpw,
- c_apt,
- c_cash,
- c_head,
- c_torso,
- c_legs,
- c_str_xp,
- c_int_xp,
- c_dex_xp,
- c_psi_xp,
- c_con_xp,
- c_pos_x,
- c_pos_y,
- c_pos_z,
- c_angle_ud,
- c_angle_lr,
- c_faction,
- c_slot,
- c_online,
- c_clan,
+ c_id,\r
+ c_name,\r
+ c_str_lvl,\r
+ c_str_pts,\r
+ c_int_lvl,\r
+ c_int_pts,\r
+ c_dex_lvl,\r
+ c_dex_pts,\r
+ c_con_lvl,\r
+ c_con_pts,\r
+ c_psi_lvl,\r
+ c_psi_pts,\r
+ a_id,\r
+ c_class,\r
+ c_profession,\r
+ c_sex,\r
+ c_location,\r
+ c_mc,\r
+ c_hc,\r
+ c_tra,\r
+ c_pc,\r
+ c_rc,\r
+ c_tc,\r
+ c_vhc,\r
+ c_agl,\r
+ c_rep,\r
+ c_rec,\r
+ c_rcl,\r
+ c_atl,\r
+ c_end,\r
+ c_for,\r
+ c_fir,\r
+ c_enr,\r
+ c_xrr,\r
+ c_por,\r
+ c_hlt,\r
+ c_hck,\r
+ c_brt,\r
+ c_psu,\r
+ c_wep,\r
+ c_cst,\r
+ c_res,\r
+ c_imp,\r
+ c_ppu,\r
+ c_apu,\r
+ c_mst,\r
+ c_ppw,\r
+ c_psr,\r
+ c_wpw,\r
+ c_apt,\r
+ c_cash,\r
+ c_head,\r
+ c_torso,\r
+ c_legs,\r
+ c_str_xp,\r
+ c_int_xp,\r
+ c_dex_xp,\r
+ c_psi_xp,\r
+ c_con_xp,\r
+ c_pos_x,\r
+ c_pos_y,\r
+ c_pos_z,\r
+ c_angle_ud,\r
+ c_angle_lr,\r
+ c_faction,\r
+ c_slot,\r
+ c_online,\r
+ c_clan,\r
c_soullight\r
};\r
\r
mSeatInUseObjectId = 0;\r
mSeatInUseSeatId = 0;\r
mVhcAccessRequestList = NULL;\r
-\r
+ \r
mContainerInExclusiveUse = NULL;\r
\r
mIsOnline = false;\r
\r
// Required for initial OOC Broadcast welcome message.\r
//Gets overwritten as soon as the first PingPacket arrives\r
- mActiveChatChannels = 262144;
-
- mClanLevel = 0;
+ mActiveChatChannels = 262144;\r
+ mClanLevel = 0;\r
mClanID = 0;\r
}\r
\r
PChar::~PChar()\r
-{
- // Addition; Set char's online status to OFFLINE
- char sqlqry[50];
- snprintf(sqlqry, 50, "UPDATE characters SET c_online = 0 WHERE c_id = %d", mID);
- MySQL->GameQuery(sqlqry);
+{\r
+ // Addition; Set char's online status to OFFLINE\r
+ char sqlqry[50];\r
+ snprintf(sqlqry, 50, "UPDATE characters SET c_online = 0 WHERE c_id = %d", mID);\r
+ MySQL->GameQuery(sqlqry);\r
\r
delete Skill;\r
delete mBuddyList;\r
}\r
}\r
}\r
-
-void PChar::LoadClanLevel()
-{
- MYSQL_RES *result;
- char query[200];
-
- snprintf(query, 200, "SELECT cll_level FROM clanlevels WHERE cll_charid = %d AND cll_clanid = %d", mID, mClanID);
- result = MySQL->GameResQuery( query );
- if ( result == NULL )
- {
- mClanID = 0;
- Console->Print( RED, BLACK, "PChar::GetClanLevel could not load ClanLevel from the database" );
- Console->Print( "Query was:" );
- Console->Print( "%s", query );
- MySQL->ShowGameSQLError();
- return;
- }
- else if(mysql_num_rows(result) == 0)
- {
- mClanID = 0;
- Console->Print( RED, BLACK, "PChar::GetClanLevel No level entry found for clan!" );
- return;
- }
- mClanLevel = atoi(mysql_fetch_row(result)[0]);
- if (gDevDebug) Console->Print("Loaded ClanLevel %d for char %d, clan %d", mClanLevel, mID, mClanID);
-}
+\r
+void PChar::LoadClanLevel()\r
+{\r
+ MYSQL_RES *result;\r
+ char query[200];\r
+\r
+ snprintf(query, 200, "SELECT cll_level FROM clanlevels WHERE cll_charid = %d AND cll_clanid = %d", mID, mClanID);\r
+ result = MySQL->GameResQuery( query );\r
+ if ( result == NULL )\r
+ {\r
+ mClanID = 0;\r
+ Console->Print( RED, BLACK, "PChar::GetClanLevel could not load ClanLevel from the database" );\r
+ Console->Print( "Query was:" );\r
+ Console->Print( "%s", query );\r
+ MySQL->ShowGameSQLError();\r
+ return;\r
+ }\r
+ else if(mysql_num_rows(result) == 0)\r
+ {\r
+ mClanID = 0;\r
+ Console->Print( RED, BLACK, "PChar::GetClanLevel No level entry found for clan!" );\r
+ return;\r
+ }\r
+ mClanLevel = atoi(mysql_fetch_row(result)[0]);\r
+ if (gDevDebug) Console->Print("Loaded ClanLevel %d for char %d, clan %d", mClanLevel, mID, mClanID);\r
+}\r
\r
bool PChar::SQLLoad( int CharID )\r
{\r
int primapt = atoi( row[c_apt] );\r
mPrimaryApt = static_cast<u32>( primapt );\r
mStartApt = mPrimaryApt;\r
-
- mSoullight = atoi( row[c_soullight] );
- mClanID = atoi( row[c_clan] );
- if(mClanID > 0)
- LoadClanLevel();
+\r
+ mSoullight = atoi( row[c_soullight] );\r
+ mClanID = atoi( row[c_clan] );\r
+ if(mClanID > 0)\r
+ LoadClanLevel();\r
\r
// Cash\r
f32 cashvalue = atof( row[c_cash] );\r
}\r
\r
}\r
- MySQL->FreeGameSQLResult( result );
-
- // Addition; Set char's online status to ONLINE
- char sqlqry[50];
- snprintf(sqlqry, 50, "UPDATE characters SET c_online = 1 WHERE c_id = %d", mID);
+ MySQL->FreeGameSQLResult( result );\r
+\r
+ // Addition; Set char's online status to ONLINE\r
+ char sqlqry[50];\r
+ snprintf(sqlqry, 50, "UPDATE characters SET c_online = 1 WHERE c_id = %d", mID);\r
MySQL->GameQuery(sqlqry);\r
\r
return true;\r
return mCombatRank;\r
}\r
\r
+\r
u8 PChar::GetMainRank()\r
{\r
// Override for Special Account Levels\r
if ( !nChar )\r
return false;\r
\r
- mLastID = max( mLastID, nChar->GetID() );\r
+ mLastID = std::max( mLastID, nChar->GetID() );\r
if ( mChars.insert( std::make_pair( nChar->GetID(), nChar ) ).second )\r
{\r
if ( gDevDebug )\r
Authors:\r
- Namikon\r
- bakkdoor\r
+ - Akiko\r
\r
MODIFIED: 30 Nov 2005 Namikon/Akiko\r
REASON: - initial release by Namikon\r
MODIFIED: 17 Dec 2005 bakkdoor\r
REASON: - introduced new structure for chatsystem\r
- -> PChat class\r
+ MODIFIED: 09 Jun 2009 Akiko\r
+ REASON: - adjusted includes for new buildsystem\r
+ - clean ups\r
\r
- ToDo:\r
+ TODO:\r
- Add "hooks" to process chatevents everywhere in the source <-- kind of done. you can use the global PChat Instance.\r
Check:\r
Chat->send(PClient* receiver, const u8* Channel, const char* AuthorNickName, char* text, bool debugOut=false);\r
*/\r
\r
#include "main.h"\r
-#include "msgbuilder.h"\r
+#include "include/msgbuilder.h"\r
\r
PChat::PChat()\r
{\r
/*\r
- TinNS (TinNS is not a Neocron Server)\r
- Copyright (C) 2005 Linux Addicted Community\r
- maintainer Akiko <akiko@gmx.org>\r
-\r
- This program is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU General Public License\r
- as published by the Free Software Foundation; either version 2\r
- of the License, or (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
- 02110-1301, USA.\r
+ TinNS (TinNS is not a Neocron Server)\r
+ Copyright (C) 2005 Linux Addicted Community\r
+ maintainer Akiko <akiko@gmx.org>\r
+\r
+ This program is free software; you can redistribute it and/or\r
+ modify it under the terms of the GNU General Public License\r
+ as published by the Free Software Foundation; either version 2\r
+ of the License, or (at your option) any later version.\r
+\r
+ This program is distributed in the hope that it will be useful,\r
+ but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ GNU General Public License for more details.\r
+\r
+ You should have received a copy of the GNU General Public License\r
+ along with this program; if not, write to the Free Software\r
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
+ 02110-1301, USA.\r
*/\r
\r
\r
\r
/*\r
- client.cpp\r
-\r
- Authors:\r
- - v00d00\r
- - Akiko\r
- - Namikon\r
-\r
- MODIFIED: 30 Nov 2005 Akiko\r
- REASON: - added GPL\r
- - added modifications by Namikon\r
+ client.cpp\r
+\r
+ Authors:\r
+ - v00d00\r
+ - Akiko\r
+ - Namikon\r
+\r
+ MODIFIED: 30 Nov 2005 Akiko\r
+ REASON: - added GPL\r
+ - added modifications by Namikon\r
+ MODIFIED: 09 Jun 2009 Akiko\r
+ REASON: - adjusted includes for new buildsystem\r
*/\r
\r
#include "main.h"\r
\r
-#include "worlds.h"\r
-#include "msgbuilder.h"\r
-#include "subway.h"\r
+#include "include/worlds.h"\r
+#include "include/msgbuilder.h"\r
+#include "include/subway.h"\r
#include "decoder/udp_charmove.h"\r
\r
PClient::PClient( int Index )\r
/*\r
- TinNS (TinNS is not a Neocron Server)\r
- Copyright (C) 2005 Linux Addicted Community\r
- maintainer Akiko <akiko@gmx.org>\r
-\r
- This program is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU General Public License\r
- as published by the Free Software Foundation; either version 2\r
- of the License, or (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
- 02110-1301, USA.\r
+ TinNS (TinNS is not a Neocron Server)\r
+ Copyright (C) 2005 Linux Addicted Community\r
+ maintainer Akiko <akiko@gmx.org>\r
+\r
+ This program is free software; you can redistribute it and/or\r
+ modify it under the terms of the GNU General Public License\r
+ as published by the Free Software Foundation; either version 2\r
+ of the License, or (at your option) any later version.\r
+\r
+ This program is distributed in the hope that it will be useful,\r
+ but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ GNU General Public License for more details.\r
+\r
+ You should have received a copy of the GNU General Public License\r
+ along with this program; if not, write to the Free Software\r
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
+ 02110-1301, USA.\r
*/\r
\r
\r
\r
/*\r
- client.cpp\r
-\r
- Authors:\r
- - bakkdoor\r
-\r
- MODIFIED: 13 Dec 2005 bakkdoor\r
- REASON: - introduced\r
- MODIFIED: 29 Jul 2006 Hammag\r
- REASON: - Added UDP broadcast fonction\r
- - Added "zone players say Hello" fonction\r
- - Modified the ID used as would should avoid muliplying the IDs for the same client.\r
- Now using Client.GetLocalID() as the key (=Client.mIndex + 1) which is used in NC protocol\r
- - Modified getClientByID()\r
- - Removed getClientID(). Simply do Client->GetLocalID()\r
- - Modified deleteClientFromListByID() and renamed to deleteClientFromList()\r
- - Modified destructor as to not destroy stored clients, which is already done in PServer\r
- (even if it could well be done here in near futur)\r
-\r
- MODIFIED: 12 Aug 2006 Hammag\r
- REASON: - implemented range filtering in UDPBroadcast()\r
- - implemented the two versions of UDPBroadcast()\r
-\r
- TODO: - these are just begining of modif, as the Client Manager is bound to be a major component for multiplayer management\r
+ client.cpp\r
+\r
+ Authors:\r
+ - bakkdoor\r
+ - Akiko\r
+\r
+ MODIFIED: 13 Dec 2005 bakkdoor\r
+ REASON: - introduced\r
+ MODIFIED: 29 Jul 2006 Hammag\r
+ REASON: - Added UDP broadcast fonction\r
+ - Added "zone players say Hello" fonction\r
+ - Modified the ID used as would should avoid muliplying the IDs for the same client.\r
+ Now using Client.GetLocalID() as the key (=Client.mIndex + 1) which is used in NC protocol\r
+ - Modified getClientByID()\r
+ - Removed getClientID(). Simply do Client->GetLocalID()\r
+ - Modified deleteClientFromListByID() and renamed to deleteClientFromList()\r
+ - Modified destructor as to not destroy stored clients, which is already done in PServer\r
+ (even if it could well be done here in near futur)\r
+\r
+ MODIFIED: 12 Aug 2006 Hammag\r
+ REASON: - implemented range filtering in UDPBroadcast()\r
+ - implemented the two versions of UDPBroadcast()\r
+ MODIFIED: 09 Jun 2009 Akiko\r
+ REASON: - adjusted includes for new buildsystem\r
+ - clean ups\r
+\r
+ TODO: - these are just begining of modif, as the Client Manager is bound to be a major component for multiplayer management\r
*/\r
\r
#include "main.h"\r
\r
-#include "msgbuilder.h"\r
+#include "include/msgbuilder.h"\r
\r
PClientManager::PClientManager()\r
{\r
*/
#include "main.h"
-#include "client.h"
-#include "msgbuilder.h"
-#include "worlds.h"
-#include "worldactors.h"
+#include "include/client.h"
+#include "include/msgbuilder.h"
+#include "include/worlds.h"
+#include "include/worldactors.h"
PCommands::PCommands()
{
}
// ok, we have the command, now read the args
- // Loop till entire chatpacket is parsed or MAXARGS is reached\r
+ // Loop till entire chatpacket is parsed or MAXARGS is reached\r
bool tEncapsedString = false;
while (packet[posPacket] != '\0' && ArgC <= MAXARGS)
{
// First set tmpPos for next Arg to 0
tmpPos = 0;
-\r
+ \r
// Now loop until next space ' ' or end '\0' is reached\r
// Added extraction of encapsulated strings "test 123 123"\r
while (packet[posPacket] != ' ' || tEncapsedString == true)
- {\r
+ {\r
// Watch out for >"<\r
if(packet[posPacket] == '"')\r
tEncapsedString = !tEncapsedString;\r
tmpPos++;\r
}\r
// Increment tmpPos and posPacket\r
- posPacket++;\r
+ posPacket++;\r
if(packet[posPacket] == '\0')\r
break;\r
}
// Terminate current ArgV
ArgV[ArgC][tmpPos] = '\0';
- // Heh, we got one! Now more to next arg\r
- ArgC++;\r
+ // Heh, we got one! Now more to next arg\r
+ ArgC++;\r
// Search next arg (Maybe someone typed more than one whitespace)
while (packet[posPacket] == ' ' && packet[posPacket] != '\0')
else if (strcmp(Command, "setsubskill") == 0)
{
doCmdSetSubSkill();
- }\r
+ }\r
else if (strcmp(Command, "npc") == 0)\r
- {\r
+ {\r
doNPC();\r
- }\r
+ }\r
else if (strcmp(Command, "npcshop") == 0)\r
- {\r
+ {\r
doNPC_Shop();\r
- }\r
+ }\r
// Else: unknown command. Ignore
}
{"password_filter", "^[[:graph:]]{3,15}$"},\r
{"charname_filter", "^[a-z]+([\\-\\ ]?[a-z]+){0,2}$"},\r
{"clanname_filter", "^[a-z][\\w\\-\\ ]{2,14}$"},\r
-\r
+ \r
// For futur use:\r
// {"max_chars_per_account", "4"},\r
// {"multiple_logins_per_account", "0"}, // 0=nobody, 1=gm+ only, 2=everybody\r
{"setsubskill", "50"}, // Set subskill (BRT,HCK,PPU,...) of own char or someone else\r
{"npc", "50"}, // do actions with NPCs\r
\r
-\r
{"", ""} // do not change this line (end mark)\r
};\r
/*\r
- TinNS (TinNS is not a Neocron Server)\r
- Copyright (C) 2005 Linux Addicted Community\r
-\r
- This program is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU General Public License\r
- as published by the Free Software Foundation; either version 2\r
- of the License, or (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
- 02110-1301, USA.\r
+ TinNS (TinNS is not a Neocron Server)\r
+ Copyright (C) 2005 Linux Addicted Community\r
+\r
+ This program is free software; you can redistribute it and/or\r
+ modify it under the terms of the GNU General Public License\r
+ as published by the Free Software Foundation; either version 2\r
+ of the License, or (at your option) any later version.\r
+\r
+ This program is distributed in the hope that it will be useful,\r
+ but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ GNU General Public License for more details.\r
+\r
+ You should have received a copy of the GNU General Public License\r
+ along with this program; if not, write to the Free Software\r
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
+ 02110-1301, USA.\r
*/\r
\r
\r
\r
/*\r
- container.cpp - base classe for containers\r
-\r
-\r
- MODIFIED: 28 Jul 2008 Hammag\r
- REASON: - creation\r
+ container.cpp - base classe for containers\r
\r
+ MODIFIED: 28 Jul 2008 Hammag\r
+ REASON: - creation\r
+ MODIFIED: 09 Jun 2009 Akiko\r
+ REASON: - adjusted includes for new buildsystem\r
+ - clean ups\r
*/\r
\r
#include "main.h"\r
\r
-#include "item.h"\r
-#include "container.h"\r
+#include "include/item.h"\r
+#include "include/container.h"\r
\r
/* --- PContainerEntry class --- */\r
\r
if ( IsSlotAllowed( nSlotId ) )\r
{\r
for ( u8 i = mContContent->size(); i <= nSlotId; ++i ) // Extend as needed\r
- mContContent->push_back( NULL );\r
+ mContContent->push_back( static_cast<PContainerEntry*>(NULL) );\r
if ( mContContent->at( nSlotId ) )\r
{\r
Console->Print( RED, BLACK, "[Warning] PContainer::AddEntry: Target entry already %d in use !!!", nSlotId );\r
if ( FindValid2DPos( tEntry ) )\r
{\r
for ( u8 i = mContContent->size(); i <= nSlotId; ++i ) // Extend as needed\r
- mContContent->push_back( NULL );\r
+ mContContent->push_back( static_cast<PContainerEntry *>(NULL) );\r
if ( mContContent->at( nSlotId ) )\r
{\r
Console->Print( RED, BLACK, "[Warning] PContainer2DWorkaround::AddEntry: Target entry already %d in use !!!", nSlotId );\r
+++ /dev/null
-#
-# TinNS per-directory Makefile
-#
-# Adapted by Hammag from the Makefile system for Linux kernel.
-#
-# 14 Sep 2000, Christoph Hellwig <hch@infradead.org>
-# Rewritten to use lists instead of if-statements.
-#
-
-######################################################
-# Target for this directory and its sub-dirs
-######################################################
-# Case 1 : target is an executable named as defined
-#B_TARGET := gameserver
-
-# Case 2 : target is a TinNS lib name
-# (use short name, as in -l linker option)
-#L_TARGET := tinns
-
-# Case 3 (usual): objects shall be made available to the parent dir
-# The following line will set that automatically
-# (Should match dir name + .o suffix)
-O_TARGET := $(addsuffix .o,$(notdir $(shell /bin/pwd)))
-# Manualy define this only if you need to force the compiled obj name
-#O_TARGET := game.o
-
-
-######################################################
-# Local flags
-######################################################
-# local dir CXX Flags
-EXTRA_CXXFLAGS := -I/usr/include/mysql -I$(TOPDIR)/game/include
-
-# per-object CXX Flags
-#CXXFLAGS_funcdef2.o := -g
-
-# local dir Linker Flags (for intermediate .o linking)
-#EXTRA_LDFLAGS :=
-
-# any tinns Lib used (short name, as in -l linker option)
-LINK_TINNSLIBS := tinns
-
-# local dir Linker Flags (for final executable linking)
-#EXTRA_LINKFLAGS := -lrt -lpthread -lz -lm -lcrypt -L"/usr/lib/mysql" -lmysqlclient
-
-
-#####################################################
-# Subdirectories
-#####################################################
-#subdir-y := def
-#subdir-$(CONFIG_GAMEMONKEY) += gamemonkey
-
-
-#####################################################
-#***************************************************#
-# No further config should be needed after this line
-#***************************************************#
-ifdef TOPDIR
-
-# build list of objects ib loca ldir
-obj-y := $(patsubst %.cpp,%.o,$(wildcard *.cpp))
-# add final object from each subdir
-obj-y += $(join $(subdir-y),$(subdir-y:%=/%.o))
-
-include $(TOPDIR)/Rules.make
-
-else #TOPDIR undef, Makefile called from non-top dir
-
-# Memorize the first calling dir in case we wanted to
-# lauch local actions from top Makefile
- ifndef FIRSTDIR
- FIRSTDIR :=$(CURDIR)
- export FIRSTDIR
- endif
-
-uptoparent :
- $(MAKE) -C .. $(MAKECMDGOALS)
-
-.DEFAULT :
- $(MAKE) -C .. $(MAKECMDGOALS)
-
-endif #TOPDIR
-
\r
MODIFIED: 30 Aug 2006 Hammag\r
REASON: - created\r
-\r
+ MODIFIED: 09 Jun 2009 Akiko\r
+ REASON: - adjusted includes for new buildsystem\r
*/\r
\r
+\r
#ifndef MAIN_H\r
#define MAIN_H\r
\r
//#include "version.h"\r
\r
//basic includes\r
-#include "external.h"\r
+#include "include/external.h"\r
\r
//tinns includes\r
-#include "types.h"\r
-#include "config.h"\r
+#include "include/types.h"\r
+#include "common/config.h"\r
\r
-#include "console.h"\r
-#include "misc.h"\r
+#include "common/console.h"\r
+#include "common/misc.h"\r
\r
-#include "netcode.h"\r
+#include "common/netcode.h"\r
\r
-#include "globals.h"\r
-\r
-#include "msgdecoder.h"\r
+#include "include/msgdecoder.h"\r
#include "udpanalyser.h"\r
\r
+\r
/*\r
#include "../gamemonkey/gmMachine.h"\r
#include "../gamemonkey/gmCall.h"\r
*/\r
-#include "filesystem.h"\r
+\r
+#include "common/filesystem.h"\r
\r
// MySQL Support // shouldn't be needed as DB-objects access class should do that\r
-#include "mysql.h"\r
-#include "sql.h"\r
-\r
-#include "skill.h"\r
-\r
-#include "chars.h"\r
-#include "accounts.h"\r
-#include "defs.h"\r
-#include "client.h"\r
-#include "server.h"\r
-#include "misc.h"\r
-#include "gameserver.h"\r
-#include "globals.h"\r
-#include "zoning.h"\r
-#include "item.h"\r
-#include "inventory.h"\r
-\r
-#include "chat.h"\r
-#include "commands.h"\r
-#include "clientmanager.h"\r
-#include "msgbuilder.h"\r
-#include "worldactors.h"\r
-#include "npc.h"
-#include "outpost.h"
-#include "multipart.h"\r
-#include "terminal.h"\r
-\r
-using namespace std;\r
+#ifdef MYSQL_INC_DIR\r
+#include <mysql/mysql.h>\r
+#else\r
+#include <mysql.h>\r
+#endif\r
+\r
+#include "include/sql.h"\r
+\r
+#include "include/skill.h"\r
+\r
+#include "include/chars.h"\r
+#include "include/accounts.h"\r
+#include "include/defs.h"\r
+#include "include/client.h"\r
+#include "include/server.h"\r
+#include "include/gameserver.h"\r
+#include "include/globals.h"\r
+#include "include/zoning.h"\r
+#include "include/item.h"\r
+#include "include/inventory.h"\r
+\r
+#include "include/chat.h"\r
+#include "include/commands.h"\r
+#include "include/clientmanager.h"\r
+#include "include/msgbuilder.h"\r
+#include "include/worldactors.h"\r
+#include "include/npc.h"\r
+#include "include/outpost.h"\r
+#include "include/multipart.h"\r
+#include "include/terminal.h"\r
\r
#endif\r
\r
02110-1301, USA.\r
*/\r
\r
+\r
+\r
/*\r
\r
msgdecoder.cpp - top class for NC messages decoding\r
\r
CREATION: 23 Aug 2006 Hammag\r
\r
- MODIFIED:\r
- REASON: -\r
-\r
+ MODIFIED: 09 Jun 2009 Akiko\r
+ REASON: - adjusted includes for new buildsystem\r
*/\r
\r
+\r
#include "main.h"\r
-#include "msgdecoder.h"\r
\r
+#include "include/msgdecoder.h"\r
#include "udp_0x13.h"\r
\r
\r
if ( ! mDecodeData->mHandling0x13Sub ) // First decoding pass
{
-//Console->Print(" --- New 0x13 msg");
-//TmpMsg->Dump();
+ //Console->Print(" --- New 0x13 msg");
+ //TmpMsg->Dump();
( *TmpMsg ) >> ( mDecodeData->mClientState->UDP.mSequence ); // "LastPacket"
( *TmpMsg ) >> ( mDecodeData->mClientState->UDP.mServerPacketNum ); //PID
mDecodeData->Sub0x13StartNext = 0;
- }
+ }
if ( TmpMsg->EOM() )
- {
+ {
Console->Print( RED, BLACK, "PUdp0x13::Analyse(): Emptied 0x13 msg handling !!!" );
mDecodeData->mState = DECODE_FINISHED;
mDecodeData->mHandling0x13Sub = false;
nextAnalyser = this;
mDecodeData->Sub0x13Start = mDecodeData->Sub0x13StartNext = 0;
- }
- else
- {
+ }
+ else
+ {
if ( mDecodeData->mHandling0x13Sub && mDecodeData->Sub0x13StartNext )
{
TmpMsg->SetNextByteOffset( mDecodeData->Sub0x13StartNext );
PSeq = *(u16*)&Buf[Offset+2];*/
//Console->Print("0x13 Type: %d", MsgType);
switch ( MsgType )
- {
+ {
case 0x03:
{
mDecodeData->mName << "/0x03";
break;
}
}
- break;
+ break;
}
case 0x0b: // Ping
{
nextAnalyser = new PUdpPing( mDecodeData );
- break;
+ break;
}
case 0x0c: // Baseline
{
nextAnalyser = new PUdpSync2( mDecodeData );
- break;
+ break;
}
case 0x1f:
mDecodeData->mUnknownType = MsgType;
mDecodeData->mTraceUnknownMsg = true;
}
- break;
+ break;
}
case 0x20: // Char move
{
nextAnalyser = new PUdpCharPosUpdate( mDecodeData );
- break;
+ break;
}
case 0x27: // Sitting object info request
{
nextAnalyser = new PUdpRequestVhcInfo( mDecodeData );
- break;
- }
+ break;
+ }
case 0x2a: // "Packet0"
{
}
case 0x2d: // sent when targeting another char
- {
+ {
nextAnalyser = new PUdpCharTargeting( mDecodeData );
break;
- }
+ }
case 0x32: // Vhc move
- {
+ {
mDecodeData->mName << "/0x32";
u8 MsgSubType = TmpMsg->U8Data( TmpMsg->GetNextByteOffset() + 4 );
switch ( MsgSubType )
}
}
break;
- }
+ }
default:
- {
+ {
mDecodeData->mUnknownType = MsgType;
- break;
- }
+ break;
+ }
}
if ( ! nextAnalyser )
nextAnalyser = new PUdpMsgUnknown( mDecodeData );
}
- }
+ }
return nextAnalyser;
}
{\r
case 0x00:\r
{\r
- nextAnalyser = new PUdpHeldItemBasicAction( mDecodeData );\r
+ nextAnalyser = new PUdpHeldItemBasicAction( mDecodeData );\r
break;\r
}\r
case 0x01:\r
{\r
- nextAnalyser = new PUdpHeldItemAimedAction( mDecodeData );\r
+ nextAnalyser = new PUdpHeldItemAimedAction( mDecodeData );\r
break;\r
}\r
case 0x02:\r
nextAnalyser = new PUdpItemSlotUse( mDecodeData );\r
break;\r
}\r
- case 0x20: // Use item for hacking, launcher, "launcher" spell\r
+ case 0x20: // Use item for hacking, launcher, "launcher" spell\r
{\r
- nextAnalyser = new PUdpHeldItemLaunchingAction( mDecodeData );\r
+ nextAnalyser = new PUdpHeldItemLaunchingAction( mDecodeData );\r
break;\r
}\r
case 0x22:\r
mDecodeData->mName << "/0x18";\r
switch ( mDecodeData->mMessage->U8Data( mDecodeData->Sub0x13Start + 9 ) )\r
{\r
- case 0x01: // Use backpack item\r
+ case 0x01: // Use inventory item\r
{\r
nextAnalyser = new PUdpItemUse( mDecodeData );\r
break;\r
/*\r
- TinNS (TinNS is not a Neocron Server)\r
- Copyright (C) 2005 Linux Addicted Community\r
- maintainer Akiko <akiko@gmx.org>\r
-\r
- This program is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU General Public License\r
- as published by the Free Software Foundation; either version 2\r
- of the License, or (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
- 02110-1301, USA.\r
+ TinNS (TinNS is not a Neocron Server)\r
+ Copyright (C) 2005 Linux Addicted Community\r
+ maintainer Akiko <akiko@gmx.org>\r
+\r
+ This program is free software; you can redistribute it and/or\r
+ modify it under the terms of the GNU General Public License\r
+ as published by the Free Software Foundation; either version 2\r
+ of the License, or (at your option) any later version.\r
+\r
+ This program is distributed in the hope that it will be useful,\r
+ but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ GNU General Public License for more details.\r
+\r
+ You should have received a copy of the GNU General Public License\r
+ along with this program; if not, write to the Free Software\r
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
+ 02110-1301, USA.\r
*/\r
\r
/*\r
+ udp_charmove.cpp - decoder classes for UDP char movement messages\r
\r
- udp_charmove.cpp - decoder classes for UDP char movement messages\r
-\r
- CREATION: 5 Sep 2006 Hammag\r
-\r
- MODIFIED:\r
- REASON: -\r
+ CREATION: 5 Sep 2006 Hammag\r
\r
+ MODIFIED: 10 Jun 2009 Akiko\r
+ REASON: - adjusted includes for new buildsystem\r
*/\r
\r
#include "main.h"\r
+\r
#include "udp_charmove.h"\r
\r
-#include "worlds.h"\r
-#include "vehicle.h"\r
-#include "subway.h"\r
+#include "include/worlds.h"\r
+#include "include/vehicle.h"\r
+#include "include/subway.h"\r
+\r
\r
#define JUMPHEIGHT 160\r
\r
\r
CREATION: 5 Sep 2006 Hammag\r
\r
- MODIFIED:\r
- REASON: -\r
-\r
+ MODIFIED: 09 Jun 2009 Akiko\r
+ REASON: - adjusted includes for new buildsystem\r
*/\r
\r
#ifndef UDPCHARMOVE_H\r
#define UDPCHARMOVE_H\r
\r
-#include "msgdecoder.h"\r
+#include "include/msgdecoder.h"\r
#include "udpanalyser.h"\r
\r
class PUdpCharPosUpdate : public PUdpMsgAnalyser\r
02110-1301, USA.\r
*/\r
\r
-/*\r
\r
+\r
+/*\r
udp_entityposreq.cpp - decoder classes for UDP entity position request messages\r
\r
CREATION: 8 jun 2007 Hammag\r
\r
- MODIFIED:\r
- REASON: -\r
-\r
+ MODIFIED: 10 Jun 2009 Akiko\r
+ REASON: - adjusted includes for new buildsystem\r
*/\r
\r
+\r
#include "main.h"\r
+\r
#include "udp_entityposreq.h"\r
\r
-#include "worlds.h"\r
+#include "include/worlds.h"\r
+\r
\r
PUdpEntityPosRequest::PUdpEntityPosRequest(PMsgDecodeData* nDecodeData) : PUdpMsgAnalyser(nDecodeData)\r
{\r
/*
- TinNS (TinNS is not a Neocron Server)
- Copyright (C) 2005 Linux Addicted Community
- maintainer Akiko <akiko@gmx.org>
-
- 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 (at your option) 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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
+ TinNS (TinNS is not a Neocron Server)
+ Copyright (C) 2005 Linux Addicted Community
+ maintainer Akiko <akiko@gmx.org>
+
+ 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 (at your option) 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, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
*/
-/*
- udp_hack.cpp - decoder classes for UDP hacking related messages
- CREATION: 30 Dec 2006 Namikon
+/*
+ udp_hack.cpp - decoder classes for UDP hacking related messages
- MODIFIED:
- REASON: -
+ CREATION: 30 Dec 2006 Namikon
+ MODIFIED: 10 Jun 2009 Akiko
+ REASON: - adjusted includes for new buildsystem
*/
+
#include "main.h"
+
#include "udp_hack.h"
-#include "worlds.h"
-#include "furnituretemplate.h"
-#include "doortemplate.h"
+
+#include "include/worlds.h"
+#include "include/furnituretemplate.h"
+#include "include/doortemplate.h"
/**** PUdpHackSuccess ****/
#include "main.h"
#include "udp_helditemaction.h"
-#include "worlds.h"
-#include "furnituretemplate.h"
+#include "include/worlds.h"
+#include "include/furnituretemplate.h"
/**** PUdpHeldItemBasicAction ****/
{
PClient* nClient = mDecodeData->mClient;
//PChar* tChar = nClient->GetChar();
- nClient->testval8 ^= ( 1 << mAddonIdx ); // Toggle state // Using testval8 for testing only!!!
+ nClient->testval8 ^= (1 << mAddonIdx); // Toggle state // Using testval8 for testing only!!!
- PMessage* tmpMsg = MsgBuilder->BuildHeldItemAddonActivationMsg( nClient, nClient->testval8 ); // For testing only!!!
+ PMessage* tmpMsg = MsgBuilder->BuildHeldItemAddonActivationMsg( nClient, nClient->testval8); // For testing only!!!
ClientManager->UDPBroadcast( tmpMsg, nClient );
if ( gDevDebug )
#ifndef HELDITEMACTION_H
#define HELDITEMACTION_H
-
class PUdpHeldItemBasicAction : public PUdpMsgAnalyser
{
public:
class PUdpHeldItemAimedAction : public PUdpMsgAnalyser
{
+
private:
u16 mWeaponId;
u32 mTargetRawItemID;
bool DoAction();
};
+
class PUdpItemAddonActivation : public PUdpMsgAnalyser
{
private:
/*
- TinNS (TinNS is not a Neocron Server)
- Copyright (C) 2005 Linux Addicted Community
- maintainer Akiko <akiko@gmx.org>
-
- 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 (at your option) 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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
+ TinNS (TinNS is not a Neocron Server)
+ Copyright (C) 2005 Linux Addicted Community
+ maintainer Akiko <akiko@gmx.org>
+
+ 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 (at your option) 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, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
*/
-/*
- udp_itemmanualreload.cpp - decoder classes for UDP item manual reload messages
- CREATION: 9 May 2009 Hammag
+/*
+ udp_itemmanualreload.cpp - decoder classes for UDP item manual reload messages
- MODIFIED:
- REASON: -
+ CREATION: 9 May 2009 Hammag
+ MODIFIED: 10 Jun 2009 Akiko
+ REASON: - adjusted includes for new buildsystem
*/
+
#include "main.h"
+
#include "udp_itemmanualreload.h"
-#include "container.h"
+
+#include "include/container.h"
+
/**** PUdpItemManualReload ****/
/*\r
- TinNS (TinNS is not a Neocron Server)\r
- Copyright (C) 2005 Linux Addicted Community\r
- maintainer Akiko <akiko@gmx.org>\r
-\r
- This program is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU General Public License\r
- as published by the Free Software Foundation; either version 2\r
- of the License, or (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
- 02110-1301, USA.\r
+ TinNS (TinNS is not a Neocron Server)\r
+ Copyright (C) 2005 Linux Addicted Community\r
+ maintainer Akiko <akiko@gmx.org>\r
+\r
+ This program is free software; you can redistribute it and/or\r
+ modify it under the terms of the GNU General Public License\r
+ as published by the Free Software Foundation; either version 2\r
+ of the License, or (at your option) any later version.\r
+\r
+ This program is distributed in the hope that it will be useful,\r
+ but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ GNU General Public License for more details.\r
+\r
+ You should have received a copy of the GNU General Public License\r
+ along with this program; if not, write to the Free Software\r
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
+ 02110-1301, USA.\r
*/\r
\r
-/*\r
\r
- udp_itemmove.cpp - decoder classes for UDP item move related messages\r
\r
- CREATION: 30 Dec 2006 Namikon\r
+/*\r
+ udp_itemmove.cpp - decoder classes for UDP item move related messages\r
\r
- MODIFIED: 28 Aug 2007 Hammag\r
- REASON: Moved decoding part from DoAction() to Analyse(), use natural decode methods\r
+ CREATION: 30 Dec 2006 Namikon\r
\r
+ MODIFIED: 28 Aug 2007 Hammag\r
+ REASON: - Moved decoding part from DoAction() to Analyse(), use natural decode methods\r
+ MODIFIED: 10 Jun 2009 Akiko\r
+ REASON: - adjusted includes for new buildsystem\r
*/\r
\r
+\r
#include "main.h"\r
+\r
#include "udp_itemmove.h"\r
-#include "chars.h"\r
-#include "inventory.h"\r
-#include "container.h"\r
+\r
+#include "include/chars.h"\r
+#include "include/inventory.h"\r
+#include "include/container.h"\r
+\r
\r
/**** PUdpItemMove ****/\r
\r
-/*\r
- TinNS (TinNS is not a Neocron Server)\r
- Copyright (C) 2005 Linux Addicted Community\r
- maintainer Akiko <akiko@gmx.org>\r
-\r
- This program is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU General Public License\r
- as published by the Free Software Foundation; either version 2\r
- of the License, or (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
- 02110-1301, USA.\r
-*/\r
-\r
-/*\r
-\r
- udp_npcdialog.cpp - decoder classes for UDP NPC Dialog-Messages\r
-\r
- CREATION: 13 Oct 2009 Namikon\r
-\r
- MODIFIED:\r
- REASON: -\r
-\r
-*/\r
-\r
-#include "main.h"\r
-#include "udp_npcdialog.h"\r
-\r
-/**** PUdpNPCDialogClose ****/\r
-\r
-PUdpNPCDialogClose::PUdpNPCDialogClose( PMsgDecodeData* nDecodeData ) : PUdpMsgAnalyser( nDecodeData )\r
-{\r
- nDecodeData->mName << "/0x19";\r
-}\r
-\r
-PUdpMsgAnalyser* PUdpNPCDialogClose::Analyse()\r
-{\r
- mDecodeData->mName << "=NPC Dialog closed";\r
-\r
- mPlayerID = mDecodeData->mMessage->U16Data( mDecodeData->Sub0x13Start + 5 );\r
- mNPCID = mDecodeData->mMessage->U32Data( mDecodeData->Sub0x13Start + 8 );\r
-\r
- mDecodeData->mState = DECODE_ACTION_READY | DECODE_FINISHED;\r
- return this;\r
-}\r
-\r
-bool PUdpNPCDialogClose::DoAction()\r
-{\r
- if ( mDecodeData->mState & DECODE_ACTION_READY )\r
- {\r
- if (gDevDebug)\r
- Console->Print( "%s PUdpNPCDialogClose: Client %d closed dialog with NPC %d", Console->ColorText( CYAN, BLACK, "[DEBUG]" ), mPlayerID, mNPCID );\r
-\r
- // Set DialogNPC for player to 0\r
- mDecodeData->mClient->GetChar()->SetDialogNPC(0);\r
- if (gDevDebug) Console->Print("[DEBUG PUdpNPCDialogClose::DoAction] New DialogPartner for Client %d is now %u", mPlayerID, mDecodeData->mClient->GetChar()->GetDialogNPC());\r
-\r
- mDecodeData->mState = DECODE_ACTION_DONE | DECODE_FINISHED;\r
- return true;\r
- }\r
- else\r
- return false;\r
-}\r
-/**** PUdpNPCDialogAction ****/\r
-\r
-PUdpNPCDialogAction::PUdpNPCDialogAction( PMsgDecodeData* nDecodeData ) : PUdpMsgAnalyser( nDecodeData )\r
-{\r
- nDecodeData->mName << "/0x1a";\r
-}\r
-\r
-PUdpMsgAnalyser* PUdpNPCDialogAction::Analyse()\r
-{\r
- mDecodeData->mName << "=NPC Dialog action";\r
-\r
- mPlayerID = mDecodeData->mMessage->U16Data( mDecodeData->Sub0x13Start + 5 );\r
- mAnswerNr = mDecodeData->mMessage->U8Data( mDecodeData->Sub0x13Start + 8 );\r
-\r
- mDecodeData->mState = DECODE_ACTION_READY | DECODE_FINISHED;\r
- return this;\r
-}\r
-\r
-bool PUdpNPCDialogAction::DoAction()\r
-{\r
- if ( mDecodeData->mState & DECODE_ACTION_READY )\r
- {\r
- if (gDevDebug)\r
- Console->Print( "%s PUdpNPCDialogAction: Client %d selected dialog answer %d", Console->ColorText( CYAN, BLACK, "[DEBUG]" ), mPlayerID, mAnswerNr );\r
-\r
- PClient* nClient = mDecodeData->mClient;\r
- PChar* tChar = nClient->GetChar();\r
- bool tSuccess = false;\r
-\r
- // First check if client has an NPC to talk to set (just to be sure)\r
- if (tChar->GetDialogNPC() != 0)\r
- {\r
- // Player has an NPC to talk to. Next, get the NPC instance\r
- PNPC* targetNPC = 0;\r
- PNPCWorld* currentNPCWorld = NPCManager->GetWorld( tChar->GetLocation() );\r
- if ( currentNPCWorld )\r
- {\r
- //Console->Print(">>> Searching NPC");\r
- targetNPC = currentNPCWorld->GetNPC( tChar->GetDialogNPC() );\r
- if ( targetNPC )\r
- {\r
- Console->Print( "%s Player talks to NPC %u, answer %d", Console->ColorText( CYAN, BLACK, "[DEBUG]" ), tChar->GetDialogNPC(), mAnswerNr );\r
- // Continue conversation with given answer. Current node is stored in tChar* class, and NPC handles next steps\r
- // also sends out the required packet\r
- targetNPC->DoConversation(nClient, mAnswerNr);\r
- tSuccess = true;\r
- }\r
- }\r
- }\r
- else\r
- {\r
- Console->Print( "%s Dialog request received, but player has no active NPC dialog set, dropping", Console->ColorText( RED, BLACK, "[ERROR]" ));\r
- tSuccess = true;\r
- }\r
- if(tSuccess == false)\r
- {\r
- Console->Print( "%s Player talks to NPC %u, but npc isnt active anymore. Resetting dialog state for client", Console->ColorText( YELLOW, BLACK, "[NOTICE]" ), tChar->GetDialogNPC() );\r
- tChar->SetDialogNode(0);\r
- tChar->SetDialogNPC(0);\r
- }\r
-\r
- mDecodeData->mState = DECODE_ACTION_DONE | DECODE_FINISHED;\r
- return true;\r
- }\r
- else\r
- return false;\r
-}\r
-\r
+/*
+ TinNS (TinNS is not a Neocron Server)
+ Copyright (C) 2005 Linux Addicted Community
+ maintainer Akiko <akiko@gmx.org>
+
+ 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 (at your option) 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, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
+*/
+
+/*
+
+ udp_npcdialog.cpp - decoder classes for UDP NPC Dialog-Messages
+
+ CREATION: 13 Oct 2009 Namikon
+
+ MODIFIED:
+ REASON: -
+
+*/
+
+#include "main.h"
+#include "udp_npcdialog.h"
+
+/**** PUdpNPCDialogClose ****/
+
+PUdpNPCDialogClose::PUdpNPCDialogClose( PMsgDecodeData* nDecodeData ) : PUdpMsgAnalyser( nDecodeData )
+{
+ nDecodeData->mName << "/0x19";
+}
+
+PUdpMsgAnalyser* PUdpNPCDialogClose::Analyse()
+{
+ mDecodeData->mName << "=NPC Dialog closed";
+
+ mPlayerID = mDecodeData->mMessage->U16Data( mDecodeData->Sub0x13Start + 5 );
+ mNPCID = mDecodeData->mMessage->U32Data( mDecodeData->Sub0x13Start + 8 );
+
+ mDecodeData->mState = DECODE_ACTION_READY | DECODE_FINISHED;
+ return this;
+}
+
+bool PUdpNPCDialogClose::DoAction()
+{
+ if ( mDecodeData->mState & DECODE_ACTION_READY )
+ {
+ if (gDevDebug)
+ Console->Print( "%s PUdpNPCDialogClose: Client %d closed dialog with NPC %d", Console->ColorText( CYAN, BLACK, "[DEBUG]" ), mPlayerID, mNPCID );
+
+ // Set DialogNPC for player to 0
+ mDecodeData->mClient->GetChar()->SetDialogNPC(0);
+ if (gDevDebug) Console->Print("[DEBUG PUdpNPCDialogClose::DoAction] New DialogPartner for Client %d is now %u", mPlayerID, mDecodeData->mClient->GetChar()->GetDialogNPC());
+
+ mDecodeData->mState = DECODE_ACTION_DONE | DECODE_FINISHED;
+ return true;
+ }
+ else
+ return false;
+}
+/**** PUdpNPCDialogAction ****/
+
+PUdpNPCDialogAction::PUdpNPCDialogAction( PMsgDecodeData* nDecodeData ) : PUdpMsgAnalyser( nDecodeData )
+{
+ nDecodeData->mName << "/0x1a";
+}
+
+PUdpMsgAnalyser* PUdpNPCDialogAction::Analyse()
+{
+ mDecodeData->mName << "=NPC Dialog action";
+
+ mPlayerID = mDecodeData->mMessage->U16Data( mDecodeData->Sub0x13Start + 5 );
+ mAnswerNr = mDecodeData->mMessage->U8Data( mDecodeData->Sub0x13Start + 8 );
+
+ mDecodeData->mState = DECODE_ACTION_READY | DECODE_FINISHED;
+ return this;
+}
+
+bool PUdpNPCDialogAction::DoAction()
+{
+ if ( mDecodeData->mState & DECODE_ACTION_READY )
+ {
+ if (gDevDebug)
+ Console->Print( "%s PUdpNPCDialogAction: Client %d selected dialog answer %d", Console->ColorText( CYAN, BLACK, "[DEBUG]" ), mPlayerID, mAnswerNr );
+
+ PClient* nClient = mDecodeData->mClient;
+ PChar* tChar = nClient->GetChar();
+ bool tSuccess = false;
+
+ // First check if client has an NPC to talk to set (just to be sure)
+ if (tChar->GetDialogNPC() != 0)
+ {
+ // Player has an NPC to talk to. Next, get the NPC instance
+ PNPC* targetNPC = 0;
+ PNPCWorld* currentNPCWorld = NPCManager->GetWorld( tChar->GetLocation() );
+ if ( currentNPCWorld )
+ {
+ //Console->Print(">>> Searching NPC");
+ targetNPC = currentNPCWorld->GetNPC( tChar->GetDialogNPC() );
+ if ( targetNPC )
+ {
+ Console->Print( "%s Player talks to NPC %u, answer %d", Console->ColorText( CYAN, BLACK, "[DEBUG]" ), tChar->GetDialogNPC(), mAnswerNr );
+ // Continue conversation with given answer. Current node is stored in tChar* class, and NPC handles next steps
+ // also sends out the required packet
+ targetNPC->DoConversation(nClient, mAnswerNr);
+ tSuccess = true;
+ }
+ }
+ }
+ else
+ {
+ Console->Print( "%s Dialog request received, but player has no active NPC dialog set, dropping", Console->ColorText( RED, BLACK, "[ERROR]" ));
+ tSuccess = true;
+ }
+ if(tSuccess == false)
+ {
+ Console->Print( "%s Player talks to NPC %u, but npc isnt active anymore. Resetting dialog state for client", Console->ColorText( YELLOW, BLACK, "[NOTICE]" ), tChar->GetDialogNPC() );
+ tChar->SetDialogNode(0);
+ tChar->SetDialogNPC(0);
+ }
+
+ mDecodeData->mState = DECODE_ACTION_DONE | DECODE_FINISHED;
+ return true;
+ }
+ else
+ return false;
+}
-/*\r
- TinNS (TinNS is not a Neocron Server)\r
- Copyright (C) 2005 Linux Addicted Community\r
- maintainer Akiko <akiko@gmx.org>\r
-\r
- This program is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU General Public License\r
- as published by the Free Software Foundation; either version 2\r
- of the License, or (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
- 02110-1301, USA.\r
-*/\r
-\r
-/*\r
-\r
- udp_npcdialog.h - decoder classes for UDP NPC Dialog-Messages\r
-\r
- CREATION: 13 Oct 2009 Namikon\r
-\r
- MODIFIED:\r
- REASON: -\r
-\r
-*/\r
-\r
-#ifndef UDPNPCDIALOG_H\r
-#define UDPNPCDIALOG_H\r
-\r
-class PUdpNPCDialogClose : public PUdpMsgAnalyser\r
-{\r
- private:\r
- u16 mPlayerID;\r
- u32 mNPCID;\r
-\r
- public:\r
- PUdpNPCDialogClose( PMsgDecodeData* nDecodeData );\r
- //~PUdpNPCDialogClose();\r
- PUdpMsgAnalyser* Analyse();\r
- bool DoAction();\r
-};\r
-\r
-class PUdpNPCDialogAction : public PUdpMsgAnalyser\r
-{\r
- private:\r
- u16 mPlayerID;\r
- u8 mAnswerNr;\r
-\r
- public:\r
- PUdpNPCDialogAction( PMsgDecodeData* nDecodeData );\r
- //~PUdpNPCDialogAction();\r
- PUdpMsgAnalyser* Analyse();\r
- bool DoAction();\r
-};\r
-\r
-#endif\r
+/*
+ TinNS (TinNS is not a Neocron Server)
+ Copyright (C) 2005 Linux Addicted Community
+ maintainer Akiko <akiko@gmx.org>
+
+ 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 (at your option) 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, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
+*/
+
+/*
+
+ udp_npcdialog.h - decoder classes for UDP NPC Dialog-Messages
+
+ CREATION: 13 Oct 2009 Namikon
+
+ MODIFIED:
+ REASON: -
+
+*/
+
+#ifndef UDPNPCDIALOG_H
+#define UDPNPCDIALOG_H
+
+class PUdpNPCDialogClose : public PUdpMsgAnalyser
+{
+ private:
+ u16 mPlayerID;
+ u32 mNPCID;
+
+ public:
+ PUdpNPCDialogClose( PMsgDecodeData* nDecodeData );
+ //~PUdpNPCDialogClose();
+ PUdpMsgAnalyser* Analyse();
+ bool DoAction();
+};
+
+class PUdpNPCDialogAction : public PUdpMsgAnalyser
+{
+ private:
+ u16 mPlayerID;
+ u8 mAnswerNr;
+
+ public:
+ PUdpNPCDialogAction( PMsgDecodeData* nDecodeData );
+ //~PUdpNPCDialogAction();
+ PUdpMsgAnalyser* Analyse();
+ bool DoAction();
+};
+
+#endif
{
if ( mDecodeData->mState & DECODE_ACTION_READY )
{
- // if(gDevDebug)
+ // if(gDevDebug)
// Console->Print( "%s PUdpPing: Client timestamp %d (0x%08x)", Console->ColorText( CYAN, BLACK, "[DEBUG]" ), mClientTime, mClientTime );
PMessage* tmpMsg = MsgBuilder->BuildPingMsg( mDecodeData->mClient, mClientTime );
\r
public:\r
PUdpPing( PMsgDecodeData* nDecodeData );\r
-\r
PUdpMsgAnalyser* Analyse();\r
bool DoAction();\r
};\r
/*
- TinNS (TinNS is not a Neocron Server)
- Copyright (C) 2005 Linux Addicted Community
- maintainer Akiko <akiko@gmx.org>
-
- 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 (at your option) 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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
+ TinNS (TinNS is not a Neocron Server)
+ Copyright (C) 2005 Linux Addicted Community
+ maintainer Akiko <akiko@gmx.org>
+
+ 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 (at your option) 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, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
*/
+
+
/*
+ udp_popupresponse.cpp - decoder classes for some UDP Popup response messages
- udp_popupresponse.cpp - decoder classes for some UDP Popup response messages
+ CREATION: 14 Apr 2009 Hammag
- CREATION: 14 Apr 2009 Hammag
+ MODIFIED: 10 Jun 2009 Akiko
+ REASON: - adjusted includes for new buildsystem
*/
+
#include "main.h"
+
#include "udp_popupresponse.h"
-#include "vhcaccessrequest.h"
-#include "worlds.h"
#include "udp_vhc.h"
+#include "include/vhcaccessrequest.h"
+#include "include/worlds.h"
+
/**** PUdp0x1f ****/
/*
- TinNS (TinNS is not a Neocron Server)
- Copyright (C) 2005 Linux Addicted Community
- maintainer Akiko <akiko@gmx.org>
-
- 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 (at your option) 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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
+ TinNS (TinNS is not a Neocron Server)
+ Copyright (C) 2005 Linux Addicted Community
+ maintainer Akiko <akiko@gmx.org>
+
+ 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 (at your option) 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, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
*/
-/*
- udp_quickaccessbelt.cpp - decoder classes for UDP Quickaccessbelt related messages
- CREATION: 30 Dec 2006 Namikon
+/*
+ udp_quickaccessbelt.cpp - decoder classes for UDP Quickaccessbelt related messages
- MODIFIED: 1 Sept 2007 Hammage
- REASON: Put analysis code in Analyse() and change to use new item management methods
+ CREATION: 30 Dec 2006 Namikon
+ MODIFIED: 01 Sep 2007 Hammag
+ REASON: - Put analysis code in Analyse() and change to use new item management methods
+ MODIFIED: 10 Jun 2009 Akiko
+ REASON: - adjusted includes for new buildsystem
*/
+
#include "main.h"
+
#include "udp_quickaccessbelt.h"
-#include "container.h"
-#include "inventory.h"
+
+#include "include/container.h"
+#include "include/inventory.h"
+
/**** PUdpItemSlotUse ****/
{
mDecodeData->mName << "/0x01=Clan Long Name";
break;
- }\r
- case 3:\r
- {\r
- mDecodeData->mName << "/0x03=NPC Script";\r
- break;\r
+ }
+ case 3:
+ {
+ mDecodeData->mName << "/0x03=NPC Script";
+ break;
}
case 4:
{
case 1: //Clan Long Name
Console->Print("Client %d : Clan Long Name Request for ClanID %i", mDecodeData->mClient->GetID(), mInfoId);
snprintf (query, 255, "SELECT cl_name FROM clans WHERE cl_id = %i", mInfoId);
- break;\r
- case 3: // NPC Script\r
- Console->Print("Client %d:: Requested LUA script for NPC %i", mDecodeData->mClient->GetID(), mInfoId);\r
- snprintf (query, 255, "SELECT npc_customscript FROM npc_spawns WHERE npc_id = %i", mInfoId);\r
+ break;
+ case 3: // NPC Script
+ Console->Print("Client %d:: Requested LUA script for NPC %i", mDecodeData->mClient->GetID(), mInfoId);
+ snprintf (query, 255, "SELECT npc_customscript FROM npc_spawns WHERE npc_id = %i", mInfoId);
break;
case 4: //Clan Short name
Console->Print("Client %d : Clan Short Name Request for ClanID %i", mDecodeData->mClient->GetID(), mInfoId);
{
MySQL->FreeGameSQLResult(result);
}
-\r
- // Special case for NPC Scripts. We have only the NAME of the script in "Answer"\r
- // We need to load the filecontents first; Also, the reply msg is different\r
- // from normal reqinfo messages\r
- if(mRequestType == 3)\r
- {\r
- u32 tFileLen = 0;\r
- PFile* fLua = NULL;\r
- fLua = Filesystem->Open( "", (char*)Answer, Config->GetOption( "nc_data_path" ) );\r
- std::string tLUAScript = "";\r
- if(fLua)\r
- {\r
- tFileLen = fLua->GetSize();\r
- char* t_content = new char[tFileLen+1];\r
- memset(t_content, '\0', tFileLen+1);\r
-\r
- fLua->Read( t_content, tFileLen );\r
- fLua = NULL;\r
-\r
- Filesystem->Close( fLua );\r
- tLUAScript = t_content; // APPEND the script to our existing lua headerfile\r
- delete t_content;\r
- if (gDevDebug) Console->Print( "%s [PUdpReqInfo::DoAction()] Loaded LUA Script %s", Console->ColorText( GREEN, BLACK, "[SUCCESS]" ), (char*)Answer );\r
- }\r
- else\r
- {\r
- Console->Print( "%s [PUdpReqInfo::DoAction()] Unable to load LUA Script %s", Console->ColorText( RED, BLACK, "[ERROR]" ), (char*)Answer );\r
- return false;\r
- }\r
- PMessage* tmpMsg = MsgBuilder->BuildReqNPCScriptAnswerMsg( mInfoId, &tLUAScript );\r
- mDecodeData->mClient->FragmentAndSendUDPMessage(tmpMsg, 0x06);\r
- return true;\r
- }\r
-
- PMessage* tmpMsg = MsgBuilder->BuildReqInfoAnswerMsg(mDecodeData->mClient, mRequestType, mInfoId, Answer, len);\r
- mDecodeData->mClient->SendUDPMessage(tmpMsg);\r
+
+ // Special case for NPC Scripts. We have only the NAME of the script in "Answer"
+ // We need to load the filecontents first; Also, the reply msg is different
+ // from normal reqinfo messages
+ if(mRequestType == 3)
+ {
+ u32 tFileLen = 0;
+ PFile* fLua = NULL;
+ fLua = Filesystem->Open( "", (char*)Answer, Config->GetOption( "nc_data_path" ) );
+ std::string tLUAScript = "";
+ if(fLua)
+ {
+ tFileLen = fLua->GetSize();
+ char* t_content = new char[tFileLen+1];
+ memset(t_content, '\0', tFileLen+1);
+
+ fLua->Read( t_content, tFileLen );
+ fLua = NULL;
+
+ Filesystem->Close( fLua );
+ tLUAScript = t_content; // APPEND the script to our existing lua headerfile
+ delete t_content;
+ if (gDevDebug) Console->Print( "%s [PUdpReqInfo::DoAction()] Loaded LUA Script %s", Console->ColorText( GREEN, BLACK, "[SUCCESS]" ), (char*)Answer );
+ }
+ else
+ {
+ Console->Print( "%s [PUdpReqInfo::DoAction()] Unable to load LUA Script %s", Console->ColorText( RED, BLACK, "[ERROR]" ), (char*)Answer );
+ return false;
+ }
+ PMessage* tmpMsg = MsgBuilder->BuildReqNPCScriptAnswerMsg( mInfoId, &tLUAScript );
+ mDecodeData->mClient->FragmentAndSendUDPMessage(tmpMsg, 0x06);
+ return true;
+ }
mDecodeData->mState = DECODE_ACTION_DONE | DECODE_FINISHED;
return (query[0]);
/*
udp_subskill.h - decoder classes for UDP subskill increasing messages
-
+
CREATION: 15 Sep 2006 Hammag
MODIFIED:
- REASON: -
+ REASON: -
*/
PUdpSubskillInc::PUdpSubskillInc(PMsgDecodeData* nDecodeData) : PUdpMsgAnalyser(nDecodeData)
{
- nDecodeData->mName << "/0x04";
-}
+ nDecodeData->mName << "/0x04";
+}
PUdpMsgAnalyser* PUdpSubskillInc::Analyse()
{
- mDecodeData->mName << "=Subskill increase request";
- SubskillID = mDecodeData->mMessage->U16Data(mDecodeData->Sub0x13Start+9);
-
- mDecodeData->mState = DECODE_ACTION_READY | DECODE_FINISHED;
+ mDecodeData->mName << "=Subskill increase request";
+ SubskillID = mDecodeData->mMessage->U16Data(mDecodeData->Sub0x13Start+9);
- return this;
+ mDecodeData->mState = DECODE_ACTION_READY | DECODE_FINISHED;
+
+ return this;
}
bool PUdpSubskillInc::DoAction()
/*
- TinNS (TinNS is not a Neocron Server)
- Copyright (C) 2005 Linux Addicted Community
- maintainer Akiko <akiko@gmx.org>
-
- 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 (at your option) 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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
+ TinNS (TinNS is not a Neocron Server)
+ Copyright (C) 2005 Linux Addicted Community
+ maintainer Akiko <akiko@gmx.org>
+
+ 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 (at your option) 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, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
*/
-/*
- udp_sync.cpp - decoder classes for UDP Sync messages
- CREATION: 30 Aug 2006 Hammag
+/*
+ udp_sync.cpp - decoder classes for UDP Sync messages
+
+ CREATION: 30 Aug 2006 Hammag
- MODIFIED:
- REASON: -
+ MODIFIED: 10 Jun 2009 Akiko
+ REASON: - adjusted includes for new buildsystem
- TODO : put chunking code from PUdpSync2::DoAction() in a SendChunkedMessqage(PClient* nClient, PMessage* nMessage, u8 nChunkSize = 220)
+ TODO:
+ - put chunking code from PUdpSync2::DoAction() in a SendChunkedMessqage(PClient* nClient, PMessage* nMessage, u8 nChunkSize = 220)
*/
+
#include "main.h"
+
#include "udp_sync.h"
-#include "worlds.h"
-#include "vehicle.h"
+
+#include "include/worlds.h"
+#include "include/vehicle.h"
+
/**** PUdpSync0 ****/
/*\r
- TinNS (TinNS is not a Neocron Server)\r
- Copyright (C) 2005 Linux Addicted Community\r
- maintainer Akiko <akiko@gmx.org>\r
-\r
- This program is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU General Public License\r
- as published by the Free Software Foundation; either version 2\r
- of the License, or (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
- 02110-1301, USA.\r
+ TinNS (TinNS is not a Neocron Server)\r
+ Copyright (C) 2005 Linux Addicted Community\r
+ maintainer Akiko <akiko@gmx.org>\r
+\r
+ This program is free software; you can redistribute it and/or\r
+ modify it under the terms of the GNU General Public License\r
+ as published by the Free Software Foundation; either version 2\r
+ of the License, or (at your option) any later version.\r
+\r
+ This program is distributed in the hope that it will be useful,\r
+ but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ GNU General Public License for more details.\r
+\r
+ You should have received a copy of the GNU General Public License\r
+ along with this program; if not, write to the Free Software\r
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
+ 02110-1301, USA.\r
*/\r
\r
-/*\r
\r
- udp_terminal.cpp - decoder classes for UDP terminal related messages\r
\r
- CREATION: 8 Jan 2007 Namikon\r
+/*\r
+ udp_terminal.cpp - decoder classes for UDP terminal related messages\r
\r
- MODIFIED:\r
- REASON: -\r
+ CREATION: 08 Jan 2007 Namikon\r
\r
+ MODIFIED: 10 Jun 2009 Akiko\r
+ REASON: - adjusted includes for new buildsystem\r
*/\r
\r
+\r
#include "main.h"\r
+\r
#include "udp_terminal.h"\r
-#include "terminal.h"\r
-#include "vehicle.h"\r
#include "udp_charmove.h"\r
-#include "worlds.h"\r
-#include "furnituretemplate.h"\r
-#include <math.h>\r
+\r
+#include "include/terminal.h"\r
+#include "include/vehicle.h"\r
+#include "include/worlds.h"\r
+#include "include/furnituretemplate.h"\r
+\r
+#include <cmath>\r
\r
/*******************************************************************************************/\r
/**** PUdpReceiveDB ****/\r
if ( gDevDebug )\r
{\r
Console->Print( "%s ReceiveDB request from client", Console->ColorText( CYAN, BLACK, "[DEBUG]" ) );\r
- Console->Print( "%s Open Terminal - Terminal session %04x (?) - Unknown1 %04x - DBId %04x - Unknown2 %02x", Console->ColorText( CYAN, BLACK, "[DEBUG]" ), mTerminalSessionId, mUnknown1, mDBId, mUnknown2 );\r
+ Console->Print( "%s Open Terminal - Terminal session %04x (?) - Unknown1 %04x - DBId %04x - Unknown2 %02x", Console->ColorText( CYAN, BLACK, "[DEBUG]" ), mTerminalSessionId, mUnknown1, mDBId, mUnknown2 );\r
Console->Print( "%s Command: '%s'", Console->ColorText( CYAN, BLACK, "[DEBUG]" ), mCommandName.c_str() );\r
for ( u8 i = 0; i < mOptionsCount; ++i )\r
Console->Print( "%s Option %d: '%s'", Console->ColorText( CYAN, BLACK, "[DEBUG]" ), i, mOptions[i].c_str() );\r
\r
bool PUdpUpdateDB::DoAction()\r
{\r
- if ( gDevDebug )
- {
- Console->Print( "%s UpdateDB request from client", Console->ColorText( CYAN, BLACK, "[DEBUG]" ) );
- Console->Print( "%s Open Terminal - Terminal session %04x (?)", Console->ColorText( CYAN, BLACK, "[DEBUG]" ), mTerminalSessionId );
- Console->Print( "%s Command: '%s'", Console->ColorText( CYAN, BLACK, "[DEBUG]" ), mCommandName.c_str() );
- for ( u8 i = 0; i < mOptionsCount; ++i )
- Console->Print( "%s Option %d: '%s'", Console->ColorText( CYAN, BLACK, "[DEBUG]" ), i, mOptions[i].c_str() );
+ if ( gDevDebug )\r
+ {\r
+ Console->Print( "%s UpdateDB request from client", Console->ColorText( CYAN, BLACK, "[DEBUG]" ) );\r
+ Console->Print( "%s Open Terminal - Terminal session %04x (?)", Console->ColorText( CYAN, BLACK, "[DEBUG]" ), mTerminalSessionId );\r
+ Console->Print( "%s Command: '%s'", Console->ColorText( CYAN, BLACK, "[DEBUG]" ), mCommandName.c_str() );\r
+ for ( u8 i = 0; i < mOptionsCount; ++i )\r
+ Console->Print( "%s Option %d: '%s'", Console->ColorText( CYAN, BLACK, "[DEBUG]" ), i, mOptions[i].c_str() );\r
}\r
bool Result = false;\r
- Result = Terminal->HandleUpdateDB(mDecodeData->mClient, mTerminalSessionId, &mCommandName, mOptions, mOptionsCount, mDBId, mUnknown2);
+ Result = Terminal->HandleUpdateDB(mDecodeData->mClient, mTerminalSessionId, &mCommandName, mOptions, mOptionsCount, mDBId, mUnknown2);\r
\r
if ( !Result )\r
- {
+ {\r
Console->Print( "%s PUdpUpdateDB - Error or unknown command %s", Console->ColorText( RED, BLACK, "[WARNING]" ), mCommandName.c_str() );\r
for ( u8 i = 0; i < mOptionsCount; ++i )\r
- Console->Print( "%s Option %d: '%s'", Console->ColorText( RED, BLACK, "[NOTICE]" ), i, mOptions[i].c_str() );
+ Console->Print( "%s Option %d: '%s'", Console->ColorText( RED, BLACK, "[NOTICE]" ), i, mOptions[i].c_str() );\r
}\r
mDecodeData->mState = DECODE_ACTION_DONE | DECODE_FINISHED;\r
return true;\r
( *TmpMsg ) >> Unknown3; // constant ? => Size of Options!\r
( *TmpMsg ) >> mCommandName; // null terminated string\r
\r
-\r
while (( TmpMsg->GetNextByteOffset() < mDecodeData->Sub0x13StartNext ) && ( mOptionsCount < mMaxOptions ) )\r
{\r
( *TmpMsg ) >> OptionSize;\r
std::string mCommandName;\r
std::string mOptions[mMaxOptions];\r
u8 mOptionsCount;\r
-\r
+ \r
u16 mUnknown1;\r
u8 mUnknown2;\r
u16 mDBId;\r
-\r
+ \r
bool ActionVehicleListing();\r
bool ActionVehicleControl();\r
-\r
+ \r
public:\r
PUdpReceiveDB(PMsgDecodeData* nDecodeData);\r
//~PUdpReceiveDB();\r
u16 mUnknown1;\r
u8 mUnknown2;\r
u16 mDBId;\r
+\r
public:\r
PUdpTryAccessDB(PMsgDecodeData* nDecodeData);\r
//~PUdpTryAccessDB();\r
private:\r
static const u8 mMaxOptions = 5; // Largest: politics\transcomment.tsc(36):\r
u16 mTerminalSessionId;\r
- u16 mDBId;\r
+ u16 mDBId;\r
std::string mDBCommandName;\r
std::string mCommandName;\r
std::string mOptions[mMaxOptions];\r
bool ActionSpawnVehicle();\r
bool ActionRepairVehicle();\r
bool ActionDismissVehicle();\r
-\r
+ \r
public:\r
PUdpQueryDB(PMsgDecodeData* nDecodeData);\r
//~PUdpQueryDB();\r
{\r
private:\r
u16 mTerminalSessionId;\r
-\r
+ \r
public:\r
PUdpTeminal0x1f(PMsgDecodeData* nDecodeData);\r
//~PUdpTeminal0x1f();\r
/*\r
- TinNS (TinNS is not a Neocron Server)\r
- Copyright (C) 2005 Linux Addicted Community\r
- maintainer Akiko <akiko@gmx.org>\r
-\r
- This program is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU General Public License\r
- as published by the Free Software Foundation; either version 2\r
- of the License, or (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
- 02110-1301, USA.\r
+ TinNS (TinNS is not a Neocron Server)\r
+ Copyright (C) 2005 Linux Addicted Community\r
+ maintainer Akiko <akiko@gmx.org>\r
+\r
+ This program is free software; you can redistribute it and/or\r
+ modify it under the terms of the GNU General Public License\r
+ as published by the Free Software Foundation; either version 2\r
+ of the License, or (at your option) any later version.\r
+\r
+ This program is distributed in the hope that it will be useful,\r
+ but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ GNU General Public License for more details.\r
+\r
+ You should have received a copy of the GNU General Public License\r
+ along with this program; if not, write to the Free Software\r
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
+ 02110-1301, USA.\r
*/\r
\r
-/*\r
\r
- udp_useobject.cpp - decoder classes for object use related messages\r
\r
- CREATION: 17 Sep 2006 Hammag\r
+/*\r
+ udp_useobject.cpp - decoder classes for object use related messages\r
\r
- MODIFIED:\r
- REASON: -\r
+ CREATION: 17 Sep 2006 Hammag\r
\r
- TODO: use only RawObjectIDs to avoid complication & errors\r
+ MODIFIED: 10 Jun 2009 Akiko\r
+ REASON: - adjusted includes for new buildsystem\r
\r
+ TODO:\r
+ - use only RawObjectIDs to avoid complication & errors\r
*/\r
\r
+\r
#include "main.h"\r
+\r
#include "udp_useobject.h"\r
-#include "worlds.h"\r
-#include "furnituretemplate.h"\r
-#include "doortemplate.h"\r
-#include "appartements.h"\r
-#include "container.h"\r
-#include "subway.h"\r
-#include "vhcaccessrequest.h"\r
#include "udp_vhc.h"\r
\r
+#include "include/worlds.h"\r
+#include "include/furnituretemplate.h"\r
+#include "include/doortemplate.h"\r
+#include "include/appartements.h"\r
+#include "include/container.h"\r
+#include "include/subway.h"\r
+#include "include/vhcaccessrequest.h"\r
+\r
+\r
u32 gVhcId = 0x3ff;\r
\r
/**** PUdpVhcMove ****/\r
}\r
\r
if ( !( mDecodeData->mState & DECODE_ACTION_DONE ) ) // not a vhc nor a pc\r
- {
- //Console->Print(">>> Searching world");\r
+ {\r
+ //Console->Print(">>> Searching world");\r
// Is it a NPC ?\r
PNPC* targetNPC = 0;\r
PNPCWorld* currentNPCWorld = NPCManager->GetWorld( nChar->GetLocation() );\r
if ( currentNPCWorld )\r
- {
+ {\r
//Console->Print(">>> Searching NPC (SQL Version)");\r
- targetNPC = currentNPCWorld->GetNPC( mRawItemID );
- if(!targetNPC)
- {
- //Console->Print(">>> Searching NPC (DEF Version)");
- // Note to myself: This is UGLY!!!! and BAD!!! but it works for now. CHANGE THIS!
- targetNPC = currentNPCWorld->GetNPC( mRawItemID - 255 );
+ targetNPC = currentNPCWorld->GetNPC( mRawItemID );\r
+ if(!targetNPC)\r
+ {\r
+ //Console->Print(">>> Searching NPC (DEF Version)");\r
+ // Note to myself: This is UGLY!!!! and BAD!!! but it works for now. CHANGE THIS!\r
+ targetNPC = currentNPCWorld->GetNPC( mRawItemID - 255 );\r
}\r
}\r
if ( targetNPC )\r
- {
+ {\r
/*if(gDevDebug)*/\r
Console->Print( "%s Player talks to NPC %d", Console->ColorText( CYAN, BLACK, "[DEBUG]" ), mRawItemID );\r
//if(gDevDebug) tContainer->Dump();\r
\r
- // Well its not "start a conversation" its more "User clicked NPC, do anything with it (Trade, script,...)
+ // Well its not "start a conversation" its more "User clicked NPC, do anything with it (Trade, script,...)\r
targetNPC->StartConversation(nClient);\r
\r
//tmpMsg = MsgBuilder->BuildTraderItemListMsg( nClient, mRawItemID );\r
/*\r
- TinNS (TinNS is not a Neocron Server)\r
- Copyright (C) 2005 Linux Addicted Community\r
- maintainer Akiko <akiko@gmx.org>\r
-\r
- This program is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU General Public License\r
- as published by the Free Software Foundation; either version 2\r
- of the License, or (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
- 02110-1301, USA.\r
+ TinNS (TinNS is not a Neocron Server)\r
+ Copyright (C) 2005 Linux Addicted Community\r
+ maintainer Akiko <akiko@gmx.org>\r
+\r
+ This program is free software; you can redistribute it and/or\r
+ modify it under the terms of the GNU General Public License\r
+ as published by the Free Software Foundation; either version 2\r
+ of the License, or (at your option) any later version.\r
+\r
+ This program is distributed in the hope that it will be useful,\r
+ but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ GNU General Public License for more details.\r
+\r
+ You should have received a copy of the GNU General Public License\r
+ along with this program; if not, write to the Free Software\r
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
+ 02110-1301, USA.\r
*/\r
\r
-/*\r
\r
- udp_vhc.h - decoder classes for UDP vehicle related messages\r
\r
- CREATION: 5 Sep 2006 Hammag\r
+/*\r
+ udp_vhc.h - decoder classes for UDP vehicle related messages\r
\r
- MODIFIED:\r
- REASON: -\r
+ CREATION: 05 Sep 2006 Hammag\r
\r
+ MODIFIED: 10 Jun 2009 Akiko\r
+ REASON: - adjusted includes for new buildsystem\r
*/\r
\r
+\r
#include "main.h"\r
-#include "worlds.h"\r
-#include "vehicle.h"\r
+\r
#include "udp_vhc.h"\r
-#include "subway.h"\r
+\r
+#include "include/worlds.h"\r
+#include "include/vehicle.h"\r
+#include "include/subway.h"\r
+\r
\r
/**** PUdpVhcMove ****/\r
\r
}
PUdpMsgAnalyser* PWorldIDInfoReq::Analyse()
-{\r
+{
PMessage* tmpMsg = mDecodeData->mMessage;
- mDecodeData->mName << "=WorldID Info Req.";\r
-\r
- tmpMsg->SetNextByteOffset(mDecodeData->Sub0x13Start + 5);\r
- (*tmpMsg) >> mInfoId;\r
+ mDecodeData->mName << "=WorldID Info Req.";
+
+ tmpMsg->SetNextByteOffset(mDecodeData->Sub0x13Start + 5);
+ (*tmpMsg) >> mInfoId;
mDecodeData->mState = DECODE_ACTION_READY | DECODE_FINISHED;
return this;
}
bool PWorldIDInfoReq::DoAction()
-{\r
- PNPC* targetNPC = NULL;\r
-\r
- PNPCWorld* currentNPCWorld = NPCManager->GetWorld( mDecodeData->mClient->GetChar()->GetLocation() );\r
- if ( currentNPCWorld )\r
- {\r
- targetNPC = currentNPCWorld->GetNPC( mInfoId );\r
- if(!targetNPC)\r
- {\r
- // Search for DEF version of NPC (remember, def IDs are on 255 offset!\r
- // Note to myself: This is UGLY!!!! and BAD!!! but it works for now. CHANGE THIS!\r
- targetNPC = currentNPCWorld->GetNPC( mInfoId - 255 );\r
- }\r
- }\r
- if (!targetNPC)\r
- {\r
- // No NPC, skipping\r
- return true;\r
- }\r
-\r
+{
+ PNPC* targetNPC = NULL;
+
+ PNPCWorld* currentNPCWorld = NPCManager->GetWorld( mDecodeData->mClient->GetChar()->GetLocation() );
+ if ( currentNPCWorld )
+ {
+ targetNPC = currentNPCWorld->GetNPC( mInfoId );
+ if(!targetNPC)
+ {
+ // Search for DEF version of NPC (remember, def IDs are on 255 offset!
+ // Note to myself: This is UGLY!!!! and BAD!!! but it works for now. CHANGE THIS!
+ targetNPC = currentNPCWorld->GetNPC( mInfoId - 255 );
+ }
+ }
+ if (!targetNPC)
+ {
+ // No NPC, skipping
+ return true;
+ }
+
currentNPCWorld->SendSingleNPCInfo(mDecodeData->mClient, targetNPC);
// TODO: Handle client request here!
// Note: It *seems* that the client sends this "eek, giev info about ID xxx"
#define UDPWORLDIDINFO_H
class PWorldIDInfoReq : public PUdpMsgAnalyser
-{\r
- u32 mInfoId;\r
+{
+ u32 mInfoId;
public:
PWorldIDInfoReq(PMsgDecodeData* nDecodeData);
/*
- TinNS (TinNS is not a Neocron Server)
- Copyright (C) 2005 Linux Addicted Community
- maintainer Akiko <akiko@gmx.org>
-
- 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 (at your option) 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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
+ TinNS (TinNS is not a Neocron Server)
+ Copyright (C) 2005 Linux Addicted Community
+ maintainer Akiko <akiko@gmx.org>
+
+ 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 (at your option) 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, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
*/
-/*
- udp_zoning.cpp - decoder classes for UDP Zoning messages
- CREATION: 6 Sep 2006 Hammag
+/*
+ udp_zoning.cpp - decoder classes for UDP Zoning messages
- MODIFIED: 15 Dec 2006 Hammag
- REASON: - added PUdpEndOfZoning management class
+ CREATION: 06 Sep 2006 Hammag
+ MODIFIED: 15 Dec 2006 Hammag
+ REASON: - added PUdpEndOfZoning management class
+ MODIFIED: 10 Jun 2009 Akiko
+ REASON: - adjusted includes for new buildsystem
*/
+
#include "main.h"
-#include "udp_zoning.h"
+#include "udp_zoning.h"
#include "udp_sync.h"
-#include "worlds.h"
-#include "appartements.h"
+
+#include "include/worlds.h"
+#include "include/appartements.h"
+
/**** PUdpZoning1 ****/
+++ /dev/null
-#
-# TinNS per-directory Makefile
-#
-# Adapted by Hammag from the Makefile system for Linux kernel.
-#
-# 14 Sep 2000, Christoph Hellwig <hch@infradead.org>
-# Rewritten to use lists instead of if-statements.
-#
-
-######################################################
-# Target for this directory and its sub-dirs
-######################################################
-# Case 1 : target is an executable named as defined
-#B_TARGET := gameserver
-
-# Case 2 : target is a TinNS lib name
-# (use short name, as in -l linker option)
-#L_TARGET := tinns
-
-# Case 3 (usual): objects shall be made available to the parent dir
-# The following line will set that automatically
-# (Should match dir name + .o suffix)
-O_TARGET := $(addsuffix .o,$(notdir $(shell /bin/pwd)))
-# Manualy define this only if you need to force the compiled obj name
-#O_TARGET := game.o
-
-
-######################################################
-# Local flags
-######################################################
-# local dir CXX Flags
-EXTRA_CXXFLAGS := -I$(TOPDIR)/game/include
-
-# per-object CXX Flags
-#CXXFLAGS_funcdef2.o := -g
-
-# local dir Linker Flags (for intermediate .o linking)
-#EXTRA_LDFLAGS :=
-
-# any tinns Lib used (short name, as in -l linker option)
-LINK_TINNSLIBS := tinns
-
-# local dir Linker Flags (for final executable linking)
-#EXTRA_LINKFLAGS := -lrt -lpthread -lz -lm -lcrypt -L"/usr/lib/mysql" -lmysqlclient
-
-
-#####################################################
-# Subdirectories
-#####################################################
-#subdir-y := def
-#subdir-$(CONFIG_GAMEMONKEY) += gamemonkey
-
-
-#####################################################
-#***************************************************#
-# No further config should be needed after this line
-#***************************************************#
-ifdef TOPDIR
-
-# build list of objects ib loca ldir
-obj-y := $(patsubst %.cpp,%.o,$(wildcard *.cpp))
-# add final object from each subdir
-obj-y += $(join $(subdir-y),$(subdir-y:%=/%.o))
-
-include $(TOPDIR)/Rules.make
-
-else #TOPDIR undef, Makefile called from non-top dir
-
-# Memorize the first calling dir in case we wanted to
-# lauch local actions from top Makefile
- ifndef FIRSTDIR
- FIRSTDIR :=$(CURDIR)
- export FIRSTDIR
- endif
-
-uptoparent :
- $(MAKE) -C .. $(MAKECMDGOALS)
-
-.DEFAULT :
- $(MAKE) -C .. $(MAKECMDGOALS)
-
-endif #TOPDIR
-
/*
- TinNS (TinNS is not a Neocron Server)
- Copyright (C) 2005 Linux Addicted Community
- maintainer Akiko <akiko@gmx.org>
-
- 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 (at your option) 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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
+ TinNS (TinNS is not a Neocron Server)
+ Copyright (C) 2005 Linux Addicted Community
+ maintainer Akiko <akiko@gmx.org>
+
+ 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 (at your option) 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, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
*/
+
+
/*
- def_actionmod.cpp
+ def_actionmod.cpp
- CREATED: 04 Apr 2009 Hammag
+ CREATED: 04 Apr 2009 Hammag
+
+ MODIFIED: 10 Jun 2009 Akiko
+ REASON: - adjusted includes for new buildsystem
*/
+
#include "main.h"
-#include "def_actionmod.h"
+
+#include "include/def_actionmod.h"
+
PDefActionMod::PDefActionMod()
{
/*
- TinNS (TinNS is not a Neocron Server)
- Copyright (C) 2005 Linux Addicted Community
- maintainer Akiko <akiko@gmx.org>
-
- 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 (at your option) 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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
+ TinNS (TinNS is not a Neocron Server)
+ Copyright (C) 2005 Linux Addicted Community
+ maintainer Akiko <akiko@gmx.org>
+
+ 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 (at your option) 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, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
*/
+
+
/*
- def_ammo.cpp
+ def_ammo.cpp
- CREATED: 04 Apr 2009 Hammag
+ CREATED: 04 Apr 2009 Hammag
+
+ MODIFIED: 10 Jun 2009 Akiko
+ REASON: - adjusted includes for new buildsystem
*/
+
#include "main.h"
-#include "def_ammo.h"
+
+#include "include/def_ammo.h"
+
PDefAmmo::PDefAmmo()
{
/*
- TinNS (TinNS is not a Neocron Server)
- Copyright (C) 2005 Linux Addicted Community
- maintainer Akiko <akiko@gmx.org>
-
- 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 (at your option) 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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
+ TinNS (TinNS is not a Neocron Server)
+ Copyright (C) 2005 Linux Addicted Community
+ maintainer Akiko <akiko@gmx.org>
+
+ 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 (at your option) 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, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
*/
+
+
/*
- def_blueprintpieces.cpp
+ def_blueprintpieces.cpp
- CREATED: 04 Apr 2009 Hammag
+ CREATED: 04 Apr 2009 Hammag
+
+ MODIFIED: 10 Jun 2009 Akiko
+ REASON: - adjusted includes for new buildsystem
*/
+
#include "main.h"
-#include "def_blueprintpieces.h"
+
+#include "include/def_blueprintpieces.h"
+
PDefBlueprintPieces::PDefBlueprintPieces()
{
/*
- TinNS (TinNS is not a Neocron Server)
- Copyright (C) 2005 Linux Addicted Community
- maintainer Akiko <akiko@gmx.org>
-
- 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 (at your option) 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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
+ TinNS (TinNS is not a Neocron Server)
+ Copyright (C) 2005 Linux Addicted Community
+ maintainer Akiko <akiko@gmx.org>
+
+ 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 (at your option) 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, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
*/
/*
- def_charaction.cpp
+ def_charaction.cpp
+
+ CREATED: 04 Apr 2009 Hammag
- CREATED: 04 Apr 2009 Hammag
+ MODIFIED: 10 Jun 2009 Akiko
+ REASON: - adjusted includes for new buildsystem
*/
+
#include "main.h"
-#include "def_charaction.h"
+
+#include "include/def_charaction.h"
+
PDefCharAction::PDefCharAction()
{
/*
- TinNS (TinNS is not a Neocron Server)
- Copyright (C) 2005 Linux Addicted Community
- maintainer Akiko <akiko@gmx.org>
-
- 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 (at your option) 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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
+ TinNS (TinNS is not a Neocron Server)
+ Copyright (C) 2005 Linux Addicted Community
+ maintainer Akiko <akiko@gmx.org>
+
+ 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 (at your option) 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, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
*/
+
+
/*
- def_damage.cpp
+ def_damage.cpp
- CREATED: 04 Apr 2009 Hammag
+ CREATED: 04 Apr 2009 Hammag
+
+ MODIFIED: 10 Jun 2009 Akiko
+ REASON: - adjusted includes for new buildsystem
*/
+
#include "main.h"
-#include "def_damage.h"
+
+#include "include/def_damage.h"
+
PDefDamage::PDefDamage()
{
/*
- TinNS (TinNS is not a Neocron Server)
- Copyright (C) 2005 Linux Addicted Community
- maintainer Akiko <akiko@gmx.org>
-
- 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 (at your option) 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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
+ TinNS (TinNS is not a Neocron Server)
+ Copyright (C) 2005 Linux Addicted Community
+ maintainer Akiko <akiko@gmx.org>
+
+ 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 (at your option) 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, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
*/
+
+
/*
- def_drug.cpp
+ def_drug.cpp
- CREATED: 04 Apr 2009 Hammag
+ CREATED: 04 Apr 2009 Hammag
+
+ MODIFIED: 10 Jun 2009 Akiko
+ REASON: - adjusted includes for new buildsystem
*/
+
#include "main.h"
-#include "def_drugs.h"
+
+#include "include/def_drugs.h"
+
PDefDrug::PDefDrug()
{
int Idx=0;\r
for(PTokenList::iterator i=Tokens->begin(); i!=Tokens->end(); i++, Idx++)\r
{\r
- // setfracc 19 "Monster" -1024 0 0 -1024 -1024 -1024 -1\r
+ // setfracc 19 "Monster" -1024 0 0 -1024 -1024 -1024 -1\r
switch(Idx)\r
{\r
case 0 : // setfrac\r
case 3 :\r
mStartValue = atol(i->c_str()); break;\r
\r
- case 4 :\r
+ case 4:\r
mAffected = atol(i->c_str())!=0; break;\r
\r
- case 5 :\r
+ case 5:\r
mSL = atol(i->c_str()); break;\r
\r
default :\r
/*
- TinNS (TinNS is not a Neocron Server)
- Copyright (C) 2005 Linux Addicted Community
- maintainer Akiko <akiko@gmx.org>
+ TinNS (TinNS is not a Neocron Server)
+ Copyright (C) 2005 Linux Addicted Community
+ maintainer Akiko <akiko@gmx.org>
- 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 (at your option) any later version.
+ 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 (at your option) 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.
+ 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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
*/
+
+
/*
- def_implants.cpp
+ def_implants.cpp
+
+ CREATED: 29 Apr 2009 Hammag
- CREATED: 29 Apr 2009 Hammag
+ MODIFIED: 10 Jun 2009 Akiko
+ REASON: - adjusted includes for new buildsystem
*/
+
#include "main.h"
-#include "def_implants.h"
+
+#include "include/def_implants.h"
+
bool PDefImplant::LoadFromDef( PTokenList *Tokens )
{
/*
- TinNS (TinNS is not a Neocron Server)
- Copyright (C) 2005 Linux Addicted Community
- maintainer Akiko <akiko@gmx.org>
-
- 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 (at your option) 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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
+ TinNS (TinNS is not a Neocron Server)
+ Copyright (C) 2005 Linux Addicted Community
+ maintainer Akiko <akiko@gmx.org>
+
+ 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 (at your option) 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, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
*/
+
+
/*
- def_itemcontainer.cpp
+ def_itemcontainer.cpp
- CREATED: 04 Apr 2009 Hammag
+ CREATED: 04 Apr 2009 Hammag
+
+ MODIFIED: 10 Jun 2009 Akiko
+ REASON: - adjusted includes for new buildsystem
*/
+
#include "main.h"
-#include "def_itemcontainer.h"
+
+#include "include/def_itemcontainer.h"
+
PDefItemContainer::PDefItemContainer()
{
/*
- TinNS (TinNS is not a Neocron Server)
- Copyright (C) 2005 Linux Addicted Community
- maintainer Akiko <akiko@gmx.org>
-
- 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 (at your option) 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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
+ TinNS (TinNS is not a Neocron Server)
+ Copyright (C) 2005 Linux Addicted Community
+ maintainer Akiko <akiko@gmx.org>
+
+ 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 (at your option) 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, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
*/
+
+
/*
- def_itemmod.cpp
+ def_itemmod.cpp
- CREATED: 04 Avr 2009 Hammag
+ CREATED: 04 Apr 2009 Hammag
+
+ MODIFIED: 10 Jun 2009 Akiko
+ REASON: - adjusted includes for new buildsystem
*/
+
#include "main.h"
-#include "def_itemmod.h"
+
+#include "include/def_itemmod.h"
+
PDefItemMod::PDefItemMod()
{
/*
- TinNS (TinNS is not a Neocron Server)
- Copyright (C) 2005 Linux Addicted Community
- maintainer Akiko <akiko@gmx.org>
-
- 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 (at your option) 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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
+ TinNS (TinNS is not a Neocron Server)
+ Copyright (C) 2005 Linux Addicted Community
+ maintainer Akiko <akiko@gmx.org>
+
+ 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 (at your option) 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, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
*/
+
+
/*
- def_itemres.cpp
+ def_itemres.cpp
- CREATED: 04 Apr 2009 Hammag
+ CREATED: 04 Apr 2009 Hammag
+
+ MODIFIED: 10 Jun 2009 Akiko
+ REASON: - adjusted includes for new buildsystem
*/
+
#include "main.h"
-#include "def_itemres.h"
+
+#include "include/def_itemres.h"
+
PDefItemRestriction::PDefItemRestriction()
{
/*
- TinNS (TinNS is not a Neocron Server)
- Copyright (C) 2005 Linux Addicted Community
- maintainer Akiko <akiko@gmx.org>
-
- 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 (at your option) 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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
+ TinNS (TinNS is not a Neocron Server)
+ Copyright (C) 2005 Linux Addicted Community
+ maintainer Akiko <akiko@gmx.org>
+
+ 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 (at your option) 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, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
*/
+
+
/*
- def_mission.cpp
+ def_mission.cpp
- CREATED: 04 Apr 2009 Hammag
+ CREATED: 04 Apr 2009 Hammag
+
+ MODIFIED: 10 Jun 2009 Akiko
+ REASON: - adjusted includes for new buildsystem
*/
+
#include "main.h"
-#include "def_mission.h"
+
+#include "include/def_mission.h"
+
PDefMission::PDefMission()
{
/*
- TinNS (TinNS is not a Neocron Server)
- Copyright (C) 2005 Linux Addicted Community
- maintainer Akiko <akiko@gmx.org>
-
- 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 (at your option) 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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
+ TinNS (TinNS is not a Neocron Server)
+ Copyright (C) 2005 Linux Addicted Community
+ maintainer Akiko <akiko@gmx.org>
+
+ 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 (at your option) 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, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
*/
+
+
/*
- def_npc.cpp
+ def_npc.cpp
+
+ CREATED: 04 Apr 2009 Hammag
- CREATED: 04 Apr 2009 Hammag
+ MODIFIED: 10 Jun 2009 Akiko
+ REASON: - adjusted includes for new buildsystem
*/
+
#include "main.h"
-#include "def_npc.h"
+
+#include "include/def_npc.h"
+
PDefNpc::PDefNpc()
{
case 9 :
mWeaponId = atoi( i->c_str() ); break;
case 10 :
- mDialogScript = *i;\r
- CleanUpString(&mDialogScript);\r
- break;
+ mDialogScript = *i;
+ CleanUpString(&mDialogScript);
+ break;
case 11 :
mCombat = atoi( i->c_str() ); break;
case 12 :
case 17 :
mSkillScale = atof( i->c_str() ); break;
case 18 :
- mStandardScript = *i;\r
- CleanUpString(&mStandardScript);\r
- break;
+ mStandardScript = *i;
+ CleanUpString(&mStandardScript);
+ break;
case 19 :
- mStandardParameter = *i;\r
- CleanUpString(&mStandardParameter);\r
- break;
+ mStandardParameter = *i;
+ CleanUpString(&mStandardParameter);
+ break;
case 20 :
mMass = atoi( i->c_str() ); break;
case 24 :
}
return ((Idx >= 20));
-}\r
+}
/*
- TinNS (TinNS is not a Neocron Server)
- Copyright (C) 2005 Linux Addicted Community
- maintainer Akiko <akiko@gmx.org>
-
- 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 (at your option) 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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
+ TinNS (TinNS is not a Neocron Server)
+ Copyright (C) 2005 Linux Addicted Community
+ maintainer Akiko <akiko@gmx.org>
+
+ 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 (at your option) 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, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
*/
+
+
/*
- def_npcarmor.cpp
+ def_npcarmor.cpp
- CREATED: 04 Apr 2009 Hammag
+ CREATED: 04 Apr 2009 Hammag
+
+ MODIFIED: 10 Jun 2009 Akiko
+ REASON: - adjusted includes for new buildsystem
*/
+
#include "main.h"
-#include "def_npcarmor.h"
+
+#include "include/def_npcarmor.h"
+
PDefNpcArmor::PDefNpcArmor()
{
/*
- TinNS (TinNS is not a Neocron Server)
- Copyright (C) 2005 Linux Addicted Community
- maintainer Akiko <akiko@gmx.org>
-
- 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 (at your option) 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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
+ TinNS (TinNS is not a Neocron Server)
+ Copyright (C) 2005 Linux Addicted Community
+ maintainer Akiko <akiko@gmx.org>
+
+ 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 (at your option) 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, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
*/
+
+
/*
- def_npcgroupspawn.cpp
+ def_npcgroupspawn.cpp
- CREATED: 04 Apr 2009 Hammag
+ CREATED: 04 Apr 2009 Hammag
+
+ MODIFIED: 10 Jun 2009 Akiko
+ REASON: - adjusted includes for new buildsystem
*/
+
#include "main.h"
-#include "def_npcgroupspawn.h"
+
+#include "include/def_npcgroupspawn.h"
+
PDefNpcGroupSpawn::PDefNpcGroupSpawn()
{
/*
- TinNS (TinNS is not a Neocron Server)
- Copyright (C) 2005 Linux Addicted Community
- maintainer Akiko <akiko@gmx.org>
-
- 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 (at your option) 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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
+ TinNS (TinNS is not a Neocron Server)
+ Copyright (C) 2005 Linux Addicted Community
+ maintainer Akiko <akiko@gmx.org>
+
+ 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 (at your option) 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, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
*/
+
+
/*
- def_outposts.cpp
+ def_outposts.cpp
- CREATED: 04 Apr 2009 Hammag
+ CREATED: 04 Apr 2009 Hammag
+
+ MODIFIED: 10 Jun 2009 Akiko
+ REASON: - adjusted includes for new buildsystem
*/
+
#include "main.h"
-#include "def_outposts.h"
+
+#include "include/def_outposts.h"
+
PDefOutpost::PDefOutpost()
{
/*
- TinNS (TinNS is not a Neocron Server)
- Copyright (C) 2005 Linux Addicted Community
- maintainer Akiko <akiko@gmx.org>
-
- 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 (at your option) 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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
+ TinNS (TinNS is not a Neocron Server)
+ Copyright (C) 2005 Linux Addicted Community
+ maintainer Akiko <akiko@gmx.org>
+
+ 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 (at your option) 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, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
*/
+
+
/*
- def_recycles.cpp
+ def_recycles.cpp
- CREATED: 04 Apr 2009 Hammag
+ CREATED: 04 Apr 2009 Hammag
+
+ MODIFIED: 10 Jun 2009 Akiko
+ REASON: - adjusted includes for new buildsystem
*/
+
#include "main.h"
-#include "def_recycles.h"
+
+#include "include/def_recycles.h"
+
PDefRecycle::PDefRecycle()
{
-/*\r
- TinNS (TinNS is not a Neocron Server)\r
- Copyright (C) 2005 Linux Addicted Community\r
- maintainer Akiko <akiko@gmx.org>\r
-\r
- This program is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU General Public License\r
- as published by the Free Software Foundation; either version 2\r
- of the License, or (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
- 02110-1301, USA.\r
-*/\r
-\r
-\r
-/*\r
- def_scripts.cpp\r
-\r
- CREATED: 12 Oct 2009 Namikon\r
-*/\r
-\r
-#include "main.h"\r
-\r
-\r
-PDefScripts::PDefScripts()\r
-{\r
- mIdentifier = "";\r
- mLuaFile = "";\r
-}\r
-\r
-bool PDefScripts::LoadFromDef( PTokenList *Tokens )\r
-{\r
- int Idx = 0;\r
- for ( PTokenList::iterator i = Tokens->begin(); i != Tokens->end(); i++, Idx++ )\r
- {\r
- switch ( Idx )\r
- {\r
- case 0 : // setentry\r
- continue;\r
- case 1 : // index\r
- mIndex = atoi(i->c_str()); break;\r
- case 2 :\r
- mIdentifier = *i;\r
- CleanUpString(&mIdentifier);\r
- break;\r
- case 3 :\r
- mLuaFile = *i;\r
- CleanUpString(&mLuaFile);\r
- break;\r
- case 4 :\r
- mScriptHeader = *i;\r
- CleanUpString(&mScriptHeader);\r
- break;\r
- continue;\r
- }\r
- }\r
-\r
- return true;\r
-}\r
-\r
-/*\r
-bool PDefScriptsMap::Load(const char* nName, const char* nFilename)\r
-{\r
- mName = nName;\r
- if(mName.empty())\r
- {\r
- Console->Print( "%s Defs name not defined", Console->ColorText( RED, BLACK, "[ERROR]" ) );\r
- return (false);\r
- }\r
-\r
- if(! *nFilename)\r
- {\r
- Console->Print( "%s Filename not defined for %s defs", Console->ColorText( RED, BLACK, "[ERROR]" ), mName.c_str() );\r
- return (false);\r
- }\r
-\r
- PDefParser parser;\r
- int nDefs = 0, nErrors = 0, nDup = 0;\r
-\r
- if ( parser.Parse( nFilename ) )\r
- {\r
- const PDefTokenList &t = parser.GetTokens();\r
-\r
- for ( PDefTokenList::const_iterator i = t.begin(); i != t.end(); i++ )\r
- {\r
- PDefScripts *it = new PDefScripts();\r
- bool loadfail = !it->LoadFromDef( *i ), insertfail = false;\r
-\r
- if ( !loadfail )\r
- insertfail = !mDefs.insert( std::make_pair( it->GetIndex(), it ) ).second;\r
- if ( loadfail || insertfail )\r
- {\r
- if ( insertfail )\r
- {\r
- ++nDup;\r
- if ( gDevDebug ) Console->Print( "%s ini error (new duplicate id %i discarded)", mName.c_str(), it->GetIndex(), it->GetName().c_str() );\r
- }\r
- else\r
- {\r
- Console->Print( "%s ini load error @ %i", mName.c_str(), nDefs + nErrors );\r
- ++nErrors;\r
- }\r
- delete it;\r
- }\r
- else\r
- ++nDefs;\r
- }\r
- }\r
- else\r
- {\r
- Console->Print( "%s Error loading %s ini defs", Console->ColorText( RED, BLACK, "[ERROR]" ), mName.c_str() );\r
- return ( false );\r
- }\r
-\r
- if ( nErrors > 0 )\r
- Console->Print( "%s Loaded %i %s ini defs, %i error(s).", Console->ColorText( RED, BLACK, "[ERROR]" ), nDefs, mName.c_str(), nErrors );\r
- else\r
- Console->Print( "%s Loaded %i %s ini defs, %i error(s).", Console->ColorText( GREEN, BLACK, "[Success]" ), nDefs, mName.c_str(), nErrors );\r
-\r
- if ( nDup )\r
- Console->Print( "%s %d duplicate entries ignored in %s ini defs.", Console->ColorText( YELLOW, BLACK, "[Notice]" ), nDup, mName.c_str() );\r
-\r
- return ( true );\r
-}\r
-*/\r
+/*
+ TinNS (TinNS is not a Neocron Server)
+ Copyright (C) 2005 Linux Addicted Community
+ maintainer Akiko <akiko@gmx.org>
+
+ 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 (at your option) 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, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
+*/
+
+
+/*
+ def_scripts.cpp
+
+ CREATED: 12 Oct 2009 Namikon
+*/
+
+#include "main.h"
+
+
+PDefScripts::PDefScripts()
+{
+ mIdentifier = "";
+ mLuaFile = "";
+}
+
+bool PDefScripts::LoadFromDef( PTokenList *Tokens )
+{
+ int Idx = 0;
+ for ( PTokenList::iterator i = Tokens->begin(); i != Tokens->end(); i++, Idx++ )
+ {
+ switch ( Idx )
+ {
+ case 0 : // setentry
+ continue;
+ case 1 : // index
+ mIndex = atoi(i->c_str()); break;
+ case 2 :
+ mIdentifier = *i;
+ CleanUpString(&mIdentifier);
+ break;
+ case 3 :
+ mLuaFile = *i;
+ CleanUpString(&mLuaFile);
+ break;
+ case 4 :
+ mScriptHeader = *i;
+ CleanUpString(&mScriptHeader);
+ break;
+ continue;
+ }
+ }
+
+ return true;
+}
+
+/*
+bool PDefScriptsMap::Load(const char* nName, const char* nFilename)
+{
+ mName = nName;
+ if(mName.empty())
+ {
+ Console->Print( "%s Defs name not defined", Console->ColorText( RED, BLACK, "[ERROR]" ) );
+ return (false);
+ }
+
+ if(! *nFilename)
+ {
+ Console->Print( "%s Filename not defined for %s defs", Console->ColorText( RED, BLACK, "[ERROR]" ), mName.c_str() );
+ return (false);
+ }
+
+ PDefParser parser;
+ int nDefs = 0, nErrors = 0, nDup = 0;
+
+ if ( parser.Parse( nFilename ) )
+ {
+ const PDefTokenList &t = parser.GetTokens();
+
+ for ( PDefTokenList::const_iterator i = t.begin(); i != t.end(); i++ )
+ {
+ PDefScripts *it = new PDefScripts();
+ bool loadfail = !it->LoadFromDef( *i ), insertfail = false;
+
+ if ( !loadfail )
+ insertfail = !mDefs.insert( std::make_pair( it->GetIndex(), it ) ).second;
+ if ( loadfail || insertfail )
+ {
+ if ( insertfail )
+ {
+ ++nDup;
+ if ( gDevDebug ) Console->Print( "%s ini error (new duplicate id %i discarded)", mName.c_str(), it->GetIndex(), it->GetName().c_str() );
+ }
+ else
+ {
+ Console->Print( "%s ini load error @ %i", mName.c_str(), nDefs + nErrors );
+ ++nErrors;
+ }
+ delete it;
+ }
+ else
+ ++nDefs;
+ }
+ }
+ else
+ {
+ Console->Print( "%s Error loading %s ini defs", Console->ColorText( RED, BLACK, "[ERROR]" ), mName.c_str() );
+ return ( false );
+ }
+
+ if ( nErrors > 0 )
+ Console->Print( "%s Loaded %i %s ini defs, %i error(s).", Console->ColorText( RED, BLACK, "[ERROR]" ), nDefs, mName.c_str(), nErrors );
+ else
+ Console->Print( "%s Loaded %i %s ini defs, %i error(s).", Console->ColorText( GREEN, BLACK, "[Success]" ), nDefs, mName.c_str(), nErrors );
+
+ if ( nDup )
+ Console->Print( "%s %d duplicate entries ignored in %s ini defs.", Console->ColorText( YELLOW, BLACK, "[Notice]" ), nDup, mName.c_str() );
+
+ return ( true );
+}
+*/
/*
- TinNS (TinNS is not a Neocron Server)
- Copyright (C) 2005 Linux Addicted Community
- maintainer Akiko <akiko@gmx.org>
-
- 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 (at your option) 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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
+ TinNS (TinNS is not a Neocron Server)
+ Copyright (C) 2005 Linux Addicted Community
+ maintainer Akiko <akiko@gmx.org>
+
+ 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 (at your option) 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, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
*/
+
+
/*
- def_shots.cpp
+ def_shots.cpp
- CREATED: 04 Apr 2009 Hammag
+ CREATED: 04 Apr 2009 Hammag
+
+ MODIFIED: 10 Jun 2009 Akiko
+ REASON: - adjusted includes for new buildsystem
*/
+
#include "main.h"
-#include "def_shots.h"
+
+#include "include/def_shots.h"
+
PDefShot::PDefShot()
{ }
/*
- TinNS (TinNS is not a Neocron Server)
- Copyright (C) 2005 Linux Addicted Community
- maintainer Akiko <akiko@gmx.org>
-
- 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 (at your option) 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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
+ TinNS (TinNS is not a Neocron Server)
+ Copyright (C) 2005 Linux Addicted Community
+ maintainer Akiko <akiko@gmx.org>
+
+ 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 (at your option) 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, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
*/
+
+
/*
- def_trader.cpp
+ def_trader.cpp
- CREATED: 04 Apr 2009 Hammag
+ CREATED: 04 Apr 2009 Hammag
+
+ MODIFIED: 10 Jun 2009 Akiko
+ REASON: - adjusted includes for new buildsystem
*/
+
#include "main.h"
-#include "def_trader.h"
+
+#include "include/def_trader.h"
+
PDefTrader::PDefTrader()
{
{
if(Idx & 1)
{
- if(i->find_first_of('/') == string::npos) // Take care of the "1/5" format
+ if(i->find_first_of('/') == std::string::npos) // Take care of the "1/5" format
{
mItemPriceScale[int((Idx - 6) / 2)] = atof( i->c_str() );
}
/*
- TinNS (TinNS is not a Neocron Server)
- Copyright (C) 2005 Linux Addicted Community
- maintainer Akiko <akiko@gmx.org>
-
- 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 (at your option) 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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
+ TinNS (TinNS is not a Neocron Server)
+ Copyright (C) 2005 Linux Addicted Community
+ maintainer Akiko <akiko@gmx.org>
+
+ 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 (at your option) 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, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
*/
+
+
/*
- def_vehicles.cpp
+ def_vehicles.cpp
- CREATED: 04 Apr 2009 Hammag
+ CREATED: 04 Apr 2009 Hammag
+
+ MODIFIED: 10 Jun 2009 Akiko
+ REASON: - adjusted includes for new buildsystem
*/
+
#include "main.h"
-#include "def_vehicles.h"
+
+#include "include/def_vehicles.h"
+
PDefVhc::PDefVhc()
{
/*
- TinNS (TinNS is not a Neocron Server)
- Copyright (C) 2005 Linux Addicted Community
- maintainer Akiko <akiko@gmx.org>
-
- 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 (at your option) 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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
+ TinNS (TinNS is not a Neocron Server)
+ Copyright (C) 2005 Linux Addicted Community
+ maintainer Akiko <akiko@gmx.org>
+
+ 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 (at your option) 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, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
*/
+
+
/*
- def_vehiclesits.cpp
+ def_vehiclesits.cpp
- CREATED: 04 Apr 2009 Hammag
+ CREATED: 04 Apr 2009 Hammag
+
+ MODIFIED: 10 Jun 2009 Akiko
+ REASON: - adjusted includes for new buildsystem
*/
+
#include "main.h"
-#include "def_vehiclesits.h"
+
+#include "include/def_vehiclesits.h"
+
PDefVhcSeat::PDefVhcSeat()
{
/*
- TinNS (TinNS is not a Neocron Server)
- Copyright (C) 2005 Linux Addicted Community
- maintainer Akiko <akiko@gmx.org>
-
- 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 (at your option) 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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
+ TinNS (TinNS is not a Neocron Server)
+ Copyright (C) 2005 Linux Addicted Community
+ maintainer Akiko <akiko@gmx.org>
+
+ 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 (at your option) 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, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
*/
+
/*
- def_weapons.cpp
+ def_weapons.cpp
- CREATED: 29 Mar 2009 Hammag
+ CREATED: 29 Mar 2009 Hammag
+
+ MODIFIED: 10 Jun 2009 Akiko
+ REASON: - adjusted includes for new buildsystem
*/
+
#include "main.h"
-#include "def_weapons.h"
+
+#include "include/def_weapons.h"
+
PDefWeapon::PDefWeapon()
{
/*
- TinNS (TinNS is not a Neocron Server)
- Copyright (C) 2005 Linux Addicted Community
- maintainer Akiko <akiko@gmx.org>
-
- 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 (at your option) 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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
+ TinNS (TinNS is not a Neocron Server)
+ Copyright (C) 2005 Linux Addicted Community
+ maintainer Akiko <akiko@gmx.org>
+
+ 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 (at your option) 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, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
*/
+
+
/*
- def_weather.cpp
+ def_weather.cpp
- CREATED: 04 Apr 2009 Hammag
+ CREATED: 04 Apr 2009 Hammag
+
+ MODIFIED: 10 Jun 2009 Akiko
+ REASON: - adjusted includes for new buildsystem
*/
+
#include "main.h"
-#include "def_weather.h"
+
+#include "include/def_weather.h"
+
PDefWeather::PDefWeather()
{
Res |= mWorldsDefs.Load ("Worldinfo", "defs/worldinfo.def");\r
Res |= mWorldFilesDefs.Load ("World files", "worlds/worlds.ini");\r
Res |= mWorldModelsDefs.Load ("World models", "defs/worldmodel.def");\r
-\r
Res |= mScriptDefs.Load ("Script defs", "defs/scripts.def");\r
\r
return ( Res );\r
REASON: - created \r
MODIFIED: 21 Sep 2006 Hammag\r
REASON: - added def_worldmodels related stuff \r
- MODIFIED: 22 Sep 2006 Hammag\r
+ MODIFIED: 22 Sep 2006 Hammag\r
REASON: - added def_appartements related stuff\r
- - added def_appplaces related stuff\r
- - added def_respawn related stuff\r
+ - added def_appplaces related stuff\r
+ - added def_respawn related stuff\r
MODIFIED: 28 Sep 2006 Hammag\r
REASON: - added def_worldfile (worlds.ini) related stuff \r
- \r
+ MODIFIED: 10 Jun 2009 Akiko \r
+ REASON: - adjusted includes for new buildsystem\r
*/\r
\r
#ifndef MAIN_H\r
//#include "version.h"\r
\r
//basic includes\r
-#include "external.h"\r
+#include "include/external.h"\r
\r
//tinns includes\r
-#include "types.h"\r
-#include "config.h"\r
+#include "include/types.h"\r
+#include "common/config.h"\r
\r
-#include "console.h"\r
-#include "misc.h"\r
+#include "common/console.h"\r
+#include "common/misc.h"\r
\r
-#include "globals.h"\r
+#include "include/globals.h"\r
\r
-#include "filesystem.h"\r
-#include "defparser.h"\r
-#include "defs.h"\r
+#include "common/filesystem.h"\r
+#include "include/defparser.h"\r
+#include "include/defs.h"\r
\r
\r
// The following defines are NOT used anymore\r
#define DEF_VEHICLESEATS "defs/vehiclesits.def"\r
#define WRLD_WORLDFILE "worlds/worlds.ini"\r
\r
-using namespace std;\r
-\r
#endif\r
\r
-/*
- TinNS (TinNS is not a Neocron Server)
- Copyright (C) 2005 Linux Addicted Community
- maintainer Akiko <akiko@gmx.org>
-
- 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 (at your option) 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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
-*/
-
-
-
-/*
- world_datparser.h
- Class to parse .dat world files
-
- MODIFIED: 29 Sep 2006 Hammag
- REASON: - Creation
-
-MODIFIED: 21 Jun 2009 Namikon
-REASON: - Added NPC Template stuff
- - reformatted for better reading
-
-*/
-
-#include "main.h"
-
-#include "world_datparser.h"
-#include "world_datstruct.h"
-
-#include "worlddatatemplate.h"
-#include "furnituretemplate.h"
-#include "doortemplate.h"
-#include "npctemplate.h"
-
-#include <math.h>
-
-const u16 nonDiscardUseFlags = ufTouchable | ufUsable | ufChair | ufToolTarget ; // furniture always to keep even if function type = 0
-
-PWorldDatParser::PWorldDatParser()
-{
- f = NULL;
-}
-
-PWorldDatParser::~PWorldDatParser()
-{
-
-}
-
-int PWorldDatParser::LoadDatFile( const std::string& nFilename, PWorldDataTemplate* nWorld, const bool nDiscardPassiveObjects, const bool nTestAccesOnly )
-{
- PWorldFileHeader FileHeader;
- PSectionHeader SectionHeader;
- PSec2ElemHeader Sec2ElemHeader;
-
- u32 FileLen;
- u32 NextSectionOffset = 0;
- u32 NextElementOffset;
- bool ProcessOK;
-
- mWorld = nWorld;
- mDiscardPassiveObjects = nDiscardPassiveObjects;
-
- if ( mNCDataPath == "" )
- {
- mNCDataPath = Config->GetOption( "nc_data_path" );
- }
-
- if ( gDevDebug )
- Console->Print( "Reading file %s/%s", mNCDataPath.c_str(), nFilename.c_str() );
- f = Filesystem->Open( "", nFilename.c_str(), mNCDataPath );
-
- if ( nTestAccesOnly )
- {
- ProcessOK = ( bool )f;
- Filesystem->Close( f );
- return ( ProcessOK ? 0 : -1 );
- }
-
- if ( f )
- {
- FileLen = f->GetSize();
-
- // Section 1
- if (gDevDebug)
- Console->Print( "Reading file header (section 1) ... " );
- f->Read( &FileHeader, sizeof( PWorldFileHeader ) );
- if (( FileHeader.mHeaderSize != 0x00000008 )
- || ( FileHeader.mHeaderSig != 0x000fcfcf )
- || ( FileHeader.mSection != 0x00000001 ) )
- {
- if (gDevDebug)
- Console->Print( "Read header: %08x / %08x / %08x", FileHeader.mHeaderSize, FileHeader.mHeaderSig, FileHeader.mSection);
- Filesystem->Close( f );
- return -2;
- }
- NextSectionOffset += FileHeader.mHeaderSize + 4;
-
- // Other Sections
- // Header
- while ( ! f->Eof() )
- {
- f->Seek( NextSectionOffset ); // Make sure we are at the computed offset
- if (gDevDebug)
- Console->Print( "Reading next section header ... " );
- if (( u32 )( f->Read( &SectionHeader, sizeof( PSectionHeader ) ) ) < sizeof( PSectionHeader ) )
- {
- Filesystem->Close( f );
- return -3;
- }
-
- if (( SectionHeader.mHeaderSize != 0x0000000c ) || ( SectionHeader.mHeaderSig != 0x0000ffcf ) )
- {
- Filesystem->Close( f );
- return -2;
- }
-
- if ( SectionHeader.mSection == 0 )
- {
- if (gDevDebug)
- Console->Print( "Ending section reached" );
- break;
- }
-
- NextElementOffset = NextSectionOffset + SectionHeader.mHeaderSize + 4;
- NextSectionOffset = NextElementOffset + SectionHeader.mDataSize;
- if (gDevDebug)
- Console->Print( "Processing section %d (size %d)", SectionHeader.mSection, SectionHeader.mDataSize );
-
- if ( SectionHeader.mSection == 2 )
- {
- //int cnt=0;
- if ( gDevDebug )
- Console->Print( "Element Type 3 size: %d or %d", sizeof( PSec2ElemType3a ), sizeof( PSec2ElemType3a ) + sizeof( PSec2ElemType3b ) );
- while ( NextElementOffset < NextSectionOffset )
- {
- f->Seek( NextElementOffset ); // Make sure we are at the computed offset
-
- //if ( gDevDebug )
- // Console->Print( "Reading next element header ... " );
- if (( u32 )( f->Read( &Sec2ElemHeader, sizeof( PSec2ElemHeader ) ) ) < sizeof( PSec2ElemHeader ) )
- {
- Filesystem->Close( f );
- return -3;
- }
- if (( Sec2ElemHeader.mHeaderSize != 0x0000000c ) || ( Sec2ElemHeader.mHeaderSig != 0x0ffefef1 ) )
- {
- Filesystem->Close( f );
- return -2;
- }
- NextElementOffset += ( Sec2ElemHeader.mHeaderSize + 4 + Sec2ElemHeader.mDataSize );
- //if (gDevDebug) Console->Print("Found element %d of type %d, size %d", ++cnt, Sec2ElemHeader.mElementType, Sec2ElemHeader.mDataSize);
- switch ( Sec2ElemHeader.mElementType )
- {
- case 1000003:
- {
- ProcessOK = ProcessSec2ElemType3( Sec2ElemHeader.mDataSize );
- break;
- }
- case 1000005:
- {
- ProcessOK = ProcessSec2ElemType5( Sec2ElemHeader.mDataSize );
- break;
- }
- case 1000006:
- {
- ProcessOK = ProcessSec2NPCEntry( Sec2ElemHeader.mDataSize );
- break;
- }
- default:
- {
- if (gDevDebug) Console->Print( "Ignoring SectionID %d, not supportet yet", Sec2ElemHeader.mElementType );
- ProcessOK = true;
- break;
- }
- }
-
- if ( !ProcessOK )
- return -4;
- }
- }
- else
- {
- if ( gDevDebug )
- Console->Print( "Section %d ignored", SectionHeader.mSection );
- continue;
- }
-
- }
-
- Filesystem->Close( f );
- }
- else
- {
- return -1;
- }
-
- return 0;
-}
-
-bool PWorldDatParser::ProcessSec2ElemType3( u32 nSize ) // furniture
-{
- PSec2ElemType3a DataA;
- PSec2ElemType3b DataB;
- const PDefWorldModel* nWorldModel;
- std::string nName;
- const u32 sza = sizeof( PSec2ElemType3a );
- const u32 szb = sizeof( PSec2ElemType3a ) + sizeof( PSec2ElemType3b );
-
- if (( nSize != szb ) && ( nSize != sza ) )
- {
- Console->Print( RED, BLACK, "[ERROR] Wrong size for Sec2ElemType3 (%d read vs %d or %d needed", nSize, sza, szb );
- return false;
- }
- if (( u32 )( f->Read( &DataA, sza ) ) < sza )
- {
- Console->Print( RED, BLACK, "[ERROR] Unexpected end of file in Sec2ElemType3a" );
- return false;
- }
- if ( nSize == szb )
- {
- if (( u32 )( f->Read( &DataB, sizeof( PSec2ElemType3b ) ) ) < sizeof( PSec2ElemType3b ) )
- {
- Console->Print( RED, BLACK, "[ERROR] Unexpected end of file in Sec2ElemType3b" );
- return false;
- }
- }
- else
- {
- DataB.mBoxLowerY = DataB.mBoxLowerZ = DataB.mBoxLowerX = 0;
- DataB.mBoxUpperY = DataB.mBoxUpperZ = DataB.mBoxUpperX = 0;
- }
-
- if ( DataA.mWorldmodelID )
- {
- nWorldModel = GameDefs->WorldModels()->GetDef( DataA.mWorldmodelID );
- if ( nWorldModel )
- nName = nWorldModel->GetName();
- else
- nName = "UNKNOWN";
- }
- else
- {
- nName = "PASSIVE";
- nWorldModel = NULL;
- }
-
- /* if (gDevDebug) {
- Console->Print("-------------------------------------------------------");
- Console->Print("%s (%d) : ID %d", nName.c_str(), DataA.mWorldmodelID, DataA.mObjectID);
- if (!nWorldModel) Console->Print("y:%f z:%f x:%f model %d", DataA.mPosY , DataA.mPosZ, DataA.mPosX, DataA.mModelID);
- Console->Print("Scale:%f Uk2:0x%08x Uk3:0x%08x", DataA.mScale, DataA.mUnknown2, DataA.mUnknown3);
- Console->Print("Uk4:0x%08x Uk5:0x%04x", DataA.mUnknown4, DataA.mUnknown5);
- //Console->Print("Ly:%f Lz:%f Lx:%f", DataB.mBoxLowerY, DataB.mBoxLowerZ, DataB.mBoxLowerX);
- //Console->Print("Uy:%f Uz:%f Ux:%f", DataB.mBoxUpperY, DataB.mBoxUpperZ, DataB.mBoxUpperX);
- }*/
-
- if (( !nWorldModel || ( !nWorldModel->GetFunctionType() && !( nWorldModel->GetUseFlags() & nonDiscardUseFlags ) ) ) && mDiscardPassiveObjects )
- {
- //if ( gDevDebug )
- // Console->Print( "Discarded" );
- return true;
- }
-
- PFurnitureItemTemplate* nItem = new PFurnitureItemTemplate;
- nItem->mObjectID = DataA.mObjectID;
-
- // The commented out values are not loaded from dat file atm because they are not used yet.
- nItem->mPosY = DataA.mPosY; // float pos values are kept 0-centered
- nItem->mPosZ = DataA.mPosZ;
- nItem->mPosX = DataA.mPosX;
-// nItem->mRotY = DataA.mRotY;
- nItem->mRotZ = DataA.mRotZ;
-// nItem->mRotX = DataA.mRotX;
-// nItem->mScale = DataA.mScale;
-// nItem->mUnknown2 = DataA.mUnknown2;
- nItem->mModelID = DataA.mModelID;
-// nItem->mUnknown3 = DataA.mUnknown3;
-// nItem->mUnknown4 = DataA.mUnknown4;
- nItem->mWorldmodelID = DataA.mWorldmodelID;
-// nItem->mUnknown5 = DataA.mUnknown5;
-
-// nItem->mBoxLowerY = DataB.mBoxLowerY;
-// nItem->mBoxLowerZ = DataB.mBoxLowerZ;
-// nItem->mBoxLowerX = DataB.mBoxLowerX;
-// nItem->mBoxUpperY = DataB.mBoxUpperY;
-// nItem->mBoxUpperZ = DataB.mBoxUpperZ;
-// nItem->mBoxUpperX = DataB.mBoxUpperX;
-
- nItem->mDefWorldModel = nWorldModel;
- /*u16 func=nWorldModel->GetFunctionType();
- if((func==18) || (func==20) || (func==29))
- Console->Print("gate model: %d", DataA.mWorldmodelID);*/
-
- float Angle = ( 180 + DataA.mRotZ ) * 3.14159 / 180;
- float Radius = abs(( int )(( DataB.mBoxUpperX - DataB.mBoxLowerX ) / 2 ) );
- if ( Radius == 0 )
- {
- Radius = 10;
- }
- Radius *= DataA.mScale;
- Radius += 5;
-
- // int pos values are change to match char pos scale (32000 centered)
- nItem->mFrontPosY = ( u16 )( 32000 + DataA.mPosY + Radius * sinf( Angle ) );
- nItem->mFrontPosZ = ( u16 )( 32000 + DataA.mPosZ );
- nItem->mFrontPosX = ( u16 )( 32000 + DataA.mPosX + Radius * cosf( Angle ) );
- nItem->mFrontLR = ( u8 )( 0.5 * ( DataA.mRotZ + ( DataA.mRotZ < 0 ? 360 : 0 ) ) );
-
- mWorld->AddFurnitureItem( nItem );
-
- return true;
-}
-
-bool PWorldDatParser::ProcessSec2ElemType5( u32 nSize ) // doors
-{
- PSec2ElemType5Start Data;
- char StringData[64];
-
- const PDefWorldModel* nWorldModel;
- std::string nName;
- char* ActorString;
- char* ParamString;
-
- const u32 sza = sizeof( PSec2ElemType5Start );
-
- if (( nSize < sza ) )
- {
- Console->Print( RED, BLACK, "[ERROR] Wrong size for Sec2ElemType5 (%d read vs %d needed", nSize, sza );
- return false;
- }
- if (( u32 )( f->Read( &Data, sza ) ) < sza )
- {
- Console->Print( RED, BLACK, "[ERROR] Unexpected end of file in Sec2ElemType5start" );
- return false;
- }
- u32 szb = Data.mActorStringSize + Data.mParamStringSize;
-
- if ( nSize != ( sza + szb ) )
- {
- Console->Print( RED, BLACK, "[ERROR] Wrong size for Sec2ElemType5 (%d read vs %d needed", nSize, sza + szb );
- return false;
- }
- else
- {
- if ( szb > 64 )
- {
- Console->Print( RED, BLACK, "[Warning] String data too long in Sec2ElemType5 End String. End will be ignored" );
- szb = 64;
- }
- if (( u32 )( f->Read( StringData, szb ) ) < szb )
- {
- Console->Print( RED, BLACK, "[ERROR] Unexpected end of file in Sec2ElemType5 End Strings" );
- return false;
- }
- }
-
- if ( Data.mWorldmodelID )
- {
- nWorldModel = GameDefs->WorldModels()->GetDef( Data.mWorldmodelID );
- if ( nWorldModel )
- nName = nWorldModel->GetName();
- else
- nName = "UNKNOWN";
- }
- else
- {
- nName = "PASSIVE";
- nWorldModel = NULL;
- }
-
- StringData[Data.mActorStringSize - 1] = 0;
- ActorString = StringData;
- StringData[szb - 1] = 0;
- ParamString = StringData + Data.mActorStringSize;
- /*
- if ( gDevDebug )
- {
- Console->Print( "-------------------------------------------------------" );
- Console->Print( "Door %s (%d) : ID %d", nName.c_str(), Data.mWorldmodelID, Data.mDoorID );
- Console->Print( "y:%f z:%f x:%f", Data.mPosY , Data.mPosZ, Data.mPosX );
- Console->Print( "Uk1:0x%04x Uk1bis:0x%04x Uk5:0x%04x", Data.mUnknown1, Data.mUnknown1bis, Data.mUnknown5 );
- Console->Print( "Type=%s Param=%s", ActorString, ParamString );
- }
- */
-// Let's keep knowledge of doors even without models !
- /* if ((!nWorldModel || (!nWorldModel->GetFunctionType() && !(nWorldModel->GetUseFlags() & nonDiscardUseFlags))) && mDiscardPassiveObjects)
- {
- if (gDevDebug) Console->Print("Discarded");
- if (gDevDebug)
- {
- Console->Print("Door %s (%d) : ID %d", nName.c_str(), Data.mWorldmodelID, Data.mDoorID);
- Console->Print("Type=%s Param=%s", ActorString, ParamString);
- }
- return true;
- }*/
-
- PDoorTemplate* nDoor = new PDoorTemplate;
- nDoor->mDoorID = Data.mDoorID;
-
- //nDoor->mUnknown1 = Data.mUnknown1; //18 00
- //nDoor->mUnknown1bis = Data.mUnknown1bis; //00 00 ? varies
- nDoor->mPosY = Data.mPosY;
- nDoor->mPosZ = Data.mPosZ;
- nDoor->mPosX = Data.mPosX;
- //nDoor->mUnknown5 = Data.mUnknown5; //00 00 ? second byte varies
- nDoor->mWorldmodelID = Data.mWorldmodelID; //door type from worldmodel.def
- nDoor->mDefWorldModel = nWorldModel;
-
- nDoor->SetDoorTypeName( ActorString );
- nDoor->SetDoorParameters( ParamString );
-
- mWorld->AddDoor( nDoor );
-
- return true;
-}
-
-bool PWorldDatParser::ProcessSec2NPCEntry( u32 nSize )
-{
- PSec2NPC_EntryPart1 tNPCPartA;
- PSec2NPC_EntryPart2 tNPCPartB;
- string tActorName;
- string tAngle;
- char tStrBuffer[64];
-
- u32 tSizeOfA = sizeof(tNPCPartA);
- u32 tSizeOfB = sizeof(tNPCPartB);
-
- // Are we able to read enough bytes from the file? means: CAN we safely read our entire struct from the file?
- if ( nSize < tSizeOfA )
- {
- Console->Print( RED, BLACK, "[ERROR] Wrong size for PSec2NPC_EntryPart1 (%d read vs %d needed", nSize, tSizeOfA );
- return false;
- }
- // yes we can! So read it now. If we reach EOF, break
- if (( u32 )( f->Read( &tNPCPartA, tSizeOfA ) ) < tSizeOfA )
- {
- Console->Print( RED, BLACK, "[ERROR] Unexpected end of file in ProcessSec2NPCEntry" );
- return false;
- }
- // Now we have the header. lets check if we have some waypoints for this NPC
- // Size of entire NPC entry in file
- u32 tCompleteNPCSize = tSizeOfA + tNPCPartA.mActorStringSize + tNPCPartA.mAngleStringSize;
- if ( tNPCPartA.mHasAdditionalCoords > 0 )
- {
- // It has additional coords, add 'em
- tCompleteNPCSize += tSizeOfB*tNPCPartA.mHasAdditionalCoords;
- }
-
- // Do a last check if we're on the correct size
- if ( nSize != tCompleteNPCSize )
- {
- Console->Print( RED, BLACK, "[ERROR] Wrong size for PSec2NPC_Entry (%d available vs %d expected", nSize, tCompleteNPCSize );
- Console->Print( RED, BLACK, "NPC ID was: %d", tNPCPartA.mNpcID);
- return false;
- }
- // We are. Continue reading!
- // Assign the 2 strings and watch out for EOF!
- memset(tStrBuffer, 0, 64);
- if (( u32 )( f->Read( tStrBuffer, tNPCPartA.mActorStringSize ) ) < tNPCPartA.mActorStringSize )
- {
- Console->Print( RED, BLACK, "[ERROR] Unexpected end of file in ProcessSec2NPCEntry mActorStringSize" );
- return false;
- }
- tActorName = tStrBuffer;
-
- memset(tStrBuffer, 0, 64);
- if (( u32 )( f->Read( tStrBuffer, tNPCPartA.mAngleStringSize ) ) < tNPCPartA.mAngleStringSize )
- {
- Console->Print( RED, BLACK, "[ERROR] Unexpected end of file in ProcessSec2NPCEntry mAngleStringSize" );
- return false;
- }
- tAngle = tStrBuffer;
-
- // We're done. Now create new NPC entry
- PNPCTemplate* tNPC = new PNPCTemplate;
-
- // and assing all that stuff
- tNPC->SetUnknown1(tNPCPartA.mUnknown1);
- tNPC->SetPosX(tNPCPartA.mPosX);
- tNPC->SetPosY(tNPCPartA.mPosY);
- tNPC->SetPosZ(tNPCPartA.mPosZ);
- tNPC->SetNPCTypeID(tNPCPartA.mNPCTypeID);
- tNPC->SetActorStrSize(tNPCPartA.mActorStringSize);
- tNPC->SetAngleStrSize(tNPCPartA.mAngleStringSize);
- tNPC->SetNpcID(tNPCPartA.mNpcID);
- tNPC->SetUnknown2a(tNPCPartA.mUnknown2a);
- tNPC->SetUnknown2b(tNPCPartA.mUnknown2b);
- tNPC->SetUnknown2c(tNPCPartA.mUnknown2c);
- tNPC->SetTradeID/*SetUnknown3*/(tNPCPartA.mTradeID/*mUnknown3*/);
- tNPC->SetUnknown4(tNPCPartA.mUnknown4);
-
- tNPC->SetActorName(tActorName);
- tNPC->SetAngle(tAngle);
-
- // Read additional Waypoints if available
- u8 tCurrWayP = 0;
- if ( tNPCPartA.mHasAdditionalCoords > 0 )
- {
- while ( tCurrWayP < tNPCPartA.mHasAdditionalCoords )
- {
- memset(&tNPCPartB, 0, tSizeOfB);
- if (( u32 )( f->Read( &tNPCPartB, tSizeOfB ) ) < tSizeOfB )
- {
- Console->Print( RED, BLACK, "[ERROR] Unexpected end of file in ProcessSec2NPCEntry while reading WayPoints" );
- return false;
- }
- tNPC->AddWayPoint(tNPCPartB.mPosX, tNPCPartB.mPosY, tNPCPartB.mPosZ, tCurrWayP);
- tCurrWayP++;
- }
- }
-
- if (gDevDebug) Console->Print("Added NPC ID %d", tNPCPartA.mNpcID);
-
- mWorld->AddNPC(tNPC);
- return true;
-}
+/*\r
+ TinNS (TinNS is not a Neocron Server)\r
+ Copyright (C) 2005 Linux Addicted Community\r
+ maintainer Akiko <akiko@gmx.org>\r
+\r
+ This program is free software; you can redistribute it and/or\r
+ modify it under the terms of the GNU General Public License\r
+ as published by the Free Software Foundation; either version 2\r
+ of the License, or (at your option) any later version.\r
+\r
+ This program is distributed in the hope that it will be useful,\r
+ but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ GNU General Public License for more details.\r
+\r
+ You should have received a copy of the GNU General Public License\r
+ along with this program; if not, write to the Free Software\r
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
+ 02110-1301, USA.\r
+*/\r
+\r
+\r
+\r
+/*\r
+ world_datparser.h\r
+ Class to parse .dat world files\r
+\r
+ MODIFIED: 29 Sep 2006 Hammag\r
+ REASON: - Creation\r
+\r
+MODIFIED: 21 Jun 2009 Namikon\r
+REASON: - Added NPC Template stuff\r
+ - reformatted for better reading\r
+\r
+*/\r
+\r
+#include "main.h"\r
+\r
+#include "include/world_datparser.h"\r
+#include "def/world_datstruct.h"\r
+\r
+#include "include/worlddatatemplate.h"\r
+#include "include/furnituretemplate.h"\r
+#include "include/doortemplate.h"\r
+#include "include/npctemplate.h"\r
+\r
+#include <math.h>\r
+\r
+const u16 nonDiscardUseFlags = ufTouchable | ufUsable | ufChair | ufToolTarget ; // furniture always to keep even if function type = 0\r
+\r
+PWorldDatParser::PWorldDatParser()\r
+{\r
+ f = NULL;\r
+}\r
+\r
+PWorldDatParser::~PWorldDatParser()\r
+{\r
+\r
+}\r
+\r
+int PWorldDatParser::LoadDatFile( const std::string& nFilename, PWorldDataTemplate* nWorld, const bool nDiscardPassiveObjects, const bool nTestAccesOnly )\r
+{\r
+ PWorldFileHeader FileHeader;\r
+ PSectionHeader SectionHeader;\r
+ PSec2ElemHeader Sec2ElemHeader;\r
+\r
+ u32 FileLen;\r
+ u32 NextSectionOffset = 0;\r
+ u32 NextElementOffset;\r
+ bool ProcessOK;\r
+\r
+ mWorld = nWorld;\r
+ mDiscardPassiveObjects = nDiscardPassiveObjects;\r
+\r
+ if ( mNCDataPath == "" )\r
+ {\r
+ mNCDataPath = Config->GetOption( "nc_data_path" );\r
+ }\r
+\r
+ if ( gDevDebug )\r
+ Console->Print( "Reading file %s/%s", mNCDataPath.c_str(), nFilename.c_str() );\r
+ f = Filesystem->Open( "", nFilename.c_str(), mNCDataPath );\r
+\r
+ if ( nTestAccesOnly )\r
+ {\r
+ ProcessOK = ( bool )f;\r
+ Filesystem->Close( f );\r
+ return ( ProcessOK ? 0 : -1 );\r
+ }\r
+\r
+ if ( f )\r
+ {\r
+ FileLen = f->GetSize();\r
+\r
+ // Section 1\r
+ if (gDevDebug)\r
+ Console->Print( "Reading file header (section 1) ... " );\r
+ f->Read( &FileHeader, sizeof( PWorldFileHeader ) );\r
+ if (( FileHeader.mHeaderSize != 0x00000008 )\r
+ || ( FileHeader.mHeaderSig != 0x000fcfcf )\r
+ || ( FileHeader.mSection != 0x00000001 ) )\r
+ {\r
+ if (gDevDebug)\r
+ Console->Print( "Read header: %08x / %08x / %08x", FileHeader.mHeaderSize, FileHeader.mHeaderSig, FileHeader.mSection);\r
+ Filesystem->Close( f );\r
+ return -2;\r
+ }\r
+ NextSectionOffset += FileHeader.mHeaderSize + 4;\r
+\r
+ // Other Sections\r
+ // Header\r
+ while ( ! f->Eof() )\r
+ {\r
+ f->Seek( NextSectionOffset ); // Make sure we are at the computed offset\r
+ if (gDevDebug)\r
+ Console->Print( "Reading next section header ... " );\r
+ if (( u32 )( f->Read( &SectionHeader, sizeof( PSectionHeader ) ) ) < sizeof( PSectionHeader ) )\r
+ {\r
+ Filesystem->Close( f );\r
+ return -3;\r
+ }\r
+\r
+ if (( SectionHeader.mHeaderSize != 0x0000000c ) || ( SectionHeader.mHeaderSig != 0x0000ffcf ) )\r
+ {\r
+ Filesystem->Close( f );\r
+ return -2;\r
+ }\r
+\r
+ if ( SectionHeader.mSection == 0 )\r
+ {\r
+ if (gDevDebug)\r
+ Console->Print( "Ending section reached" );\r
+ break;\r
+ }\r
+\r
+ NextElementOffset = NextSectionOffset + SectionHeader.mHeaderSize + 4;\r
+ NextSectionOffset = NextElementOffset + SectionHeader.mDataSize;\r
+ if (gDevDebug)\r
+ Console->Print( "Processing section %d (size %d)", SectionHeader.mSection, SectionHeader.mDataSize );\r
+\r
+ if ( SectionHeader.mSection == 2 )\r
+ {\r
+ //int cnt=0;\r
+ if ( gDevDebug )\r
+ Console->Print( "Element Type 3 size: %d or %d", sizeof( PSec2ElemType3a ), sizeof( PSec2ElemType3a ) + sizeof( PSec2ElemType3b ) );\r
+ while ( NextElementOffset < NextSectionOffset )\r
+ {\r
+ f->Seek( NextElementOffset ); // Make sure we are at the computed offset\r
+\r
+ //if ( gDevDebug )\r
+ // Console->Print( "Reading next element header ... " );\r
+ if (( u32 )( f->Read( &Sec2ElemHeader, sizeof( PSec2ElemHeader ) ) ) < sizeof( PSec2ElemHeader ) )\r
+ {\r
+ Filesystem->Close( f );\r
+ return -3;\r
+ }\r
+ if (( Sec2ElemHeader.mHeaderSize != 0x0000000c ) || ( Sec2ElemHeader.mHeaderSig != 0x0ffefef1 ) )\r
+ {\r
+ Filesystem->Close( f );\r
+ return -2;\r
+ }\r
+ NextElementOffset += ( Sec2ElemHeader.mHeaderSize + 4 + Sec2ElemHeader.mDataSize );\r
+ //if (gDevDebug) Console->Print("Found element %d of type %d, size %d", ++cnt, Sec2ElemHeader.mElementType, Sec2ElemHeader.mDataSize);\r
+ switch ( Sec2ElemHeader.mElementType )\r
+ {\r
+ case 1000003:\r
+ {\r
+ ProcessOK = ProcessSec2ElemType3( Sec2ElemHeader.mDataSize );\r
+ break;\r
+ }\r
+ case 1000005:\r
+ {\r
+ ProcessOK = ProcessSec2ElemType5( Sec2ElemHeader.mDataSize );\r
+ break;\r
+ }\r
+ case 1000006:\r
+ {\r
+ ProcessOK = ProcessSec2NPCEntry( Sec2ElemHeader.mDataSize );\r
+ break;\r
+ }\r
+ default:\r
+ {\r
+ if (gDevDebug) Console->Print( "Ignoring SectionID %d, not supportet yet", Sec2ElemHeader.mElementType );\r
+ ProcessOK = true;\r
+ break;\r
+ }\r
+ }\r
+\r
+ if ( !ProcessOK )\r
+ return -4;\r
+ }\r
+ }\r
+ else\r
+ {\r
+ if ( gDevDebug )\r
+ Console->Print( "Section %d ignored", SectionHeader.mSection );\r
+ continue;\r
+ }\r
+\r
+ }\r
+\r
+ Filesystem->Close( f );\r
+ }\r
+ else\r
+ {\r
+ return -1;\r
+ }\r
+\r
+ return 0;\r
+}\r
+\r
+bool PWorldDatParser::ProcessSec2ElemType3( u32 nSize ) // furniture\r
+{\r
+ PSec2ElemType3a DataA;\r
+ PSec2ElemType3b DataB;\r
+ const PDefWorldModel* nWorldModel;\r
+ std::string nName;\r
+ const u32 sza = sizeof( PSec2ElemType3a );\r
+ const u32 szb = sizeof( PSec2ElemType3a ) + sizeof( PSec2ElemType3b );\r
+\r
+ if (( nSize != szb ) && ( nSize != sza ) )\r
+ {\r
+ Console->Print( RED, BLACK, "[ERROR] Wrong size for Sec2ElemType3 (%d read vs %d or %d needed", nSize, sza, szb );\r
+ return false;\r
+ }\r
+ if (( u32 )( f->Read( &DataA, sza ) ) < sza )\r
+ {\r
+ Console->Print( RED, BLACK, "[ERROR] Unexpected end of file in Sec2ElemType3a" );\r
+ return false;\r
+ }\r
+ if ( nSize == szb )\r
+ {\r
+ if (( u32 )( f->Read( &DataB, sizeof( PSec2ElemType3b ) ) ) < sizeof( PSec2ElemType3b ) )\r
+ {\r
+ Console->Print( RED, BLACK, "[ERROR] Unexpected end of file in Sec2ElemType3b" );\r
+ return false;\r
+ }\r
+ }\r
+ else\r
+ {\r
+ DataB.mBoxLowerY = DataB.mBoxLowerZ = DataB.mBoxLowerX = 0;\r
+ DataB.mBoxUpperY = DataB.mBoxUpperZ = DataB.mBoxUpperX = 0;\r
+ }\r
+\r
+ if ( DataA.mWorldmodelID )\r
+ {\r
+ nWorldModel = GameDefs->WorldModels()->GetDef( DataA.mWorldmodelID );\r
+ if ( nWorldModel )\r
+ nName = nWorldModel->GetName();\r
+ else\r
+ nName = "UNKNOWN";\r
+ }\r
+ else\r
+ {\r
+ nName = "PASSIVE";\r
+ nWorldModel = NULL;\r
+ }\r
+\r
+ /* if (gDevDebug) {\r
+ Console->Print("-------------------------------------------------------");\r
+ Console->Print("%s (%d) : ID %d", nName.c_str(), DataA.mWorldmodelID, DataA.mObjectID);\r
+ if (!nWorldModel) Console->Print("y:%f z:%f x:%f model %d", DataA.mPosY , DataA.mPosZ, DataA.mPosX, DataA.mModelID);\r
+ Console->Print("Scale:%f Uk2:0x%08x Uk3:0x%08x", DataA.mScale, DataA.mUnknown2, DataA.mUnknown3);\r
+ Console->Print("Uk4:0x%08x Uk5:0x%04x", DataA.mUnknown4, DataA.mUnknown5);\r
+ //Console->Print("Ly:%f Lz:%f Lx:%f", DataB.mBoxLowerY, DataB.mBoxLowerZ, DataB.mBoxLowerX);\r
+ //Console->Print("Uy:%f Uz:%f Ux:%f", DataB.mBoxUpperY, DataB.mBoxUpperZ, DataB.mBoxUpperX);\r
+ }*/\r
+\r
+ if (( !nWorldModel || ( !nWorldModel->GetFunctionType() && !( nWorldModel->GetUseFlags() & nonDiscardUseFlags ) ) ) && mDiscardPassiveObjects )\r
+ {\r
+ //if ( gDevDebug )\r
+ // Console->Print( "Discarded" );\r
+ return true;\r
+ }\r
+\r
+ PFurnitureItemTemplate* nItem = new PFurnitureItemTemplate;\r
+ nItem->mObjectID = DataA.mObjectID;\r
+\r
+ // The commented out values are not loaded from dat file atm because they are not used yet.\r
+ nItem->mPosY = DataA.mPosY; // float pos values are kept 0-centered\r
+ nItem->mPosZ = DataA.mPosZ;\r
+ nItem->mPosX = DataA.mPosX;\r
+// nItem->mRotY = DataA.mRotY;\r
+ nItem->mRotZ = DataA.mRotZ;\r
+// nItem->mRotX = DataA.mRotX;\r
+// nItem->mScale = DataA.mScale;\r
+// nItem->mUnknown2 = DataA.mUnknown2;\r
+ nItem->mModelID = DataA.mModelID;\r
+// nItem->mUnknown3 = DataA.mUnknown3;\r
+// nItem->mUnknown4 = DataA.mUnknown4;\r
+ nItem->mWorldmodelID = DataA.mWorldmodelID;\r
+// nItem->mUnknown5 = DataA.mUnknown5;\r
+\r
+// nItem->mBoxLowerY = DataB.mBoxLowerY;\r
+// nItem->mBoxLowerZ = DataB.mBoxLowerZ;\r
+// nItem->mBoxLowerX = DataB.mBoxLowerX;\r
+// nItem->mBoxUpperY = DataB.mBoxUpperY;\r
+// nItem->mBoxUpperZ = DataB.mBoxUpperZ;\r
+// nItem->mBoxUpperX = DataB.mBoxUpperX;\r
+\r
+ nItem->mDefWorldModel = nWorldModel;\r
+ /*u16 func=nWorldModel->GetFunctionType();\r
+ if((func==18) || (func==20) || (func==29))\r
+ Console->Print("gate model: %d", DataA.mWorldmodelID);*/\r
+\r
+ float Angle = ( 180 + DataA.mRotZ ) * 3.14159 / 180;\r
+ float Radius = abs(( int )(( DataB.mBoxUpperX - DataB.mBoxLowerX ) / 2 ) );\r
+ if ( Radius == 0 )\r
+ {\r
+ Radius = 10;\r
+ }\r
+ Radius *= DataA.mScale;\r
+ Radius += 5;\r
+\r
+ // int pos values are change to match char pos scale (32000 centered)\r
+ nItem->mFrontPosY = ( u16 )( 32000 + DataA.mPosY + Radius * sinf( Angle ) );\r
+ nItem->mFrontPosZ = ( u16 )( 32000 + DataA.mPosZ );\r
+ nItem->mFrontPosX = ( u16 )( 32000 + DataA.mPosX + Radius * cosf( Angle ) );\r
+ nItem->mFrontLR = ( u8 )( 0.5 * ( DataA.mRotZ + ( DataA.mRotZ < 0 ? 360 : 0 ) ) );\r
+\r
+ mWorld->AddFurnitureItem( nItem );\r
+\r
+ return true;\r
+}\r
+\r
+bool PWorldDatParser::ProcessSec2ElemType5( u32 nSize ) // doors\r
+{\r
+ PSec2ElemType5Start Data;\r
+ char StringData[64];\r
+\r
+ const PDefWorldModel* nWorldModel;\r
+ std::string nName;\r
+ char* ActorString;\r
+ char* ParamString;\r
+\r
+ const u32 sza = sizeof( PSec2ElemType5Start );\r
+\r
+ if (( nSize < sza ) )\r
+ {\r
+ Console->Print( RED, BLACK, "[ERROR] Wrong size for Sec2ElemType5 (%d read vs %d needed", nSize, sza );\r
+ return false;\r
+ }\r
+ if (( u32 )( f->Read( &Data, sza ) ) < sza )\r
+ {\r
+ Console->Print( RED, BLACK, "[ERROR] Unexpected end of file in Sec2ElemType5start" );\r
+ return false;\r
+ }\r
+ u32 szb = Data.mActorStringSize + Data.mParamStringSize;\r
+\r
+ if ( nSize != ( sza + szb ) )\r
+ {\r
+ Console->Print( RED, BLACK, "[ERROR] Wrong size for Sec2ElemType5 (%d read vs %d needed", nSize, sza + szb );\r
+ return false;\r
+ }\r
+ else\r
+ {\r
+ if ( szb > 64 )\r
+ {\r
+ Console->Print( RED, BLACK, "[Warning] String data too long in Sec2ElemType5 End String. End will be ignored" );\r
+ szb = 64;\r
+ }\r
+ if (( u32 )( f->Read( StringData, szb ) ) < szb )\r
+ {\r
+ Console->Print( RED, BLACK, "[ERROR] Unexpected end of file in Sec2ElemType5 End Strings" );\r
+ return false;\r
+ }\r
+ }\r
+\r
+ if ( Data.mWorldmodelID )\r
+ {\r
+ nWorldModel = GameDefs->WorldModels()->GetDef( Data.mWorldmodelID );\r
+ if ( nWorldModel )\r
+ nName = nWorldModel->GetName();\r
+ else\r
+ nName = "UNKNOWN";\r
+ }\r
+ else\r
+ {\r
+ nName = "PASSIVE";\r
+ nWorldModel = NULL;\r
+ }\r
+\r
+ StringData[Data.mActorStringSize - 1] = 0;\r
+ ActorString = StringData;\r
+ StringData[szb - 1] = 0;\r
+ ParamString = StringData + Data.mActorStringSize;\r
+ /*\r
+ if ( gDevDebug )\r
+ {\r
+ Console->Print( "-------------------------------------------------------" );\r
+ Console->Print( "Door %s (%d) : ID %d", nName.c_str(), Data.mWorldmodelID, Data.mDoorID );\r
+ Console->Print( "y:%f z:%f x:%f", Data.mPosY , Data.mPosZ, Data.mPosX );\r
+ Console->Print( "Uk1:0x%04x Uk1bis:0x%04x Uk5:0x%04x", Data.mUnknown1, Data.mUnknown1bis, Data.mUnknown5 );\r
+ Console->Print( "Type=%s Param=%s", ActorString, ParamString );\r
+ }\r
+ */\r
+// Let's keep knowledge of doors even without models !\r
+ /* if ((!nWorldModel || (!nWorldModel->GetFunctionType() && !(nWorldModel->GetUseFlags() & nonDiscardUseFlags))) && mDiscardPassiveObjects)\r
+ {\r
+ if (gDevDebug) Console->Print("Discarded");\r
+ if (gDevDebug)\r
+ {\r
+ Console->Print("Door %s (%d) : ID %d", nName.c_str(), Data.mWorldmodelID, Data.mDoorID);\r
+ Console->Print("Type=%s Param=%s", ActorString, ParamString);\r
+ }\r
+ return true;\r
+ }*/\r
+\r
+ PDoorTemplate* nDoor = new PDoorTemplate;\r
+ nDoor->mDoorID = Data.mDoorID;\r
+\r
+ //nDoor->mUnknown1 = Data.mUnknown1; //18 00\r
+ //nDoor->mUnknown1bis = Data.mUnknown1bis; //00 00 ? varies\r
+ nDoor->mPosY = Data.mPosY;\r
+ nDoor->mPosZ = Data.mPosZ;\r
+ nDoor->mPosX = Data.mPosX;\r
+ //nDoor->mUnknown5 = Data.mUnknown5; //00 00 ? second byte varies\r
+ nDoor->mWorldmodelID = Data.mWorldmodelID; //door type from worldmodel.def\r
+ nDoor->mDefWorldModel = nWorldModel;\r
+\r
+ nDoor->SetDoorTypeName( ActorString );\r
+ nDoor->SetDoorParameters( ParamString );\r
+\r
+ mWorld->AddDoor( nDoor );\r
+\r
+ return true;\r
+}\r
+\r
+bool PWorldDatParser::ProcessSec2NPCEntry( u32 nSize )\r
+{\r
+ PSec2NPC_EntryPart1 tNPCPartA;\r
+ PSec2NPC_EntryPart2 tNPCPartB;\r
+ std::string tActorName;\r
+ std::string tAngle;\r
+ char tStrBuffer[64];\r
+\r
+ u32 tSizeOfA = sizeof(tNPCPartA);\r
+ u32 tSizeOfB = sizeof(tNPCPartB);\r
+\r
+ // Are we able to read enough bytes from the file? means: CAN we safely read our entire struct from the file?\r
+ if ( nSize < tSizeOfA )\r
+ {\r
+ Console->Print( RED, BLACK, "[ERROR] Wrong size for PSec2NPC_EntryPart1 (%d read vs %d needed", nSize, tSizeOfA );\r
+ return false;\r
+ }\r
+ // yes we can! So read it now. If we reach EOF, break\r
+ if (( u32 )( f->Read( &tNPCPartA, tSizeOfA ) ) < tSizeOfA )\r
+ {\r
+ Console->Print( RED, BLACK, "[ERROR] Unexpected end of file in ProcessSec2NPCEntry" );\r
+ return false;\r
+ }\r
+ // Now we have the header. lets check if we have some waypoints for this NPC\r
+ // Size of entire NPC entry in file\r
+ u32 tCompleteNPCSize = tSizeOfA + tNPCPartA.mActorStringSize + tNPCPartA.mAngleStringSize;\r
+ if ( tNPCPartA.mHasAdditionalCoords > 0 )\r
+ {\r
+ // It has additional coords, add 'em\r
+ tCompleteNPCSize += tSizeOfB*tNPCPartA.mHasAdditionalCoords;\r
+ }\r
+\r
+ // Do a last check if we're on the correct size\r
+ if ( nSize != tCompleteNPCSize )\r
+ {\r
+ Console->Print( RED, BLACK, "[ERROR] Wrong size for PSec2NPC_Entry (%d available vs %d expected", nSize, tCompleteNPCSize );\r
+ Console->Print( RED, BLACK, "NPC ID was: %d", tNPCPartA.mNpcID);\r
+ return false;\r
+ }\r
+ // We are. Continue reading!\r
+ // Assign the 2 strings and watch out for EOF!\r
+ memset(tStrBuffer, 0, 64);\r
+ if (( u32 )( f->Read( tStrBuffer, tNPCPartA.mActorStringSize ) ) < tNPCPartA.mActorStringSize )\r
+ {\r
+ Console->Print( RED, BLACK, "[ERROR] Unexpected end of file in ProcessSec2NPCEntry mActorStringSize" );\r
+ return false;\r
+ }\r
+ tActorName = tStrBuffer;\r
+\r
+ memset(tStrBuffer, 0, 64);\r
+ if (( u32 )( f->Read( tStrBuffer, tNPCPartA.mAngleStringSize ) ) < tNPCPartA.mAngleStringSize )\r
+ {\r
+ Console->Print( RED, BLACK, "[ERROR] Unexpected end of file in ProcessSec2NPCEntry mAngleStringSize" );\r
+ return false;\r
+ }\r
+ tAngle = tStrBuffer;\r
+\r
+ // We're done. Now create new NPC entry\r
+ PNPCTemplate* tNPC = new PNPCTemplate;\r
+\r
+ // and assing all that stuff\r
+ tNPC->SetUnknown1(tNPCPartA.mUnknown1);\r
+ tNPC->SetPosX(tNPCPartA.mPosX);\r
+ tNPC->SetPosY(tNPCPartA.mPosY);\r
+ tNPC->SetPosZ(tNPCPartA.mPosZ);\r
+ tNPC->SetNPCTypeID(tNPCPartA.mNPCTypeID);\r
+ tNPC->SetActorStrSize(tNPCPartA.mActorStringSize);\r
+ tNPC->SetAngleStrSize(tNPCPartA.mAngleStringSize);\r
+ tNPC->SetNpcID(tNPCPartA.mNpcID);\r
+ tNPC->SetUnknown2a(tNPCPartA.mUnknown2a);\r
+ tNPC->SetUnknown2b(tNPCPartA.mUnknown2b);\r
+ tNPC->SetUnknown2c(tNPCPartA.mUnknown2c);\r
+ tNPC->SetTradeID/*SetUnknown3*/(tNPCPartA.mTradeID/*mUnknown3*/);\r
+ tNPC->SetUnknown4(tNPCPartA.mUnknown4);\r
+\r
+ tNPC->SetActorName(tActorName);\r
+ tNPC->SetAngle(tAngle);\r
+\r
+ // Read additional Waypoints if available\r
+ u8 tCurrWayP = 0;\r
+ if ( tNPCPartA.mHasAdditionalCoords > 0 )\r
+ {\r
+ while ( tCurrWayP < tNPCPartA.mHasAdditionalCoords )\r
+ {\r
+ memset(&tNPCPartB, 0, tSizeOfB);\r
+ if (( u32 )( f->Read( &tNPCPartB, tSizeOfB ) ) < tSizeOfB )\r
+ {\r
+ Console->Print( RED, BLACK, "[ERROR] Unexpected end of file in ProcessSec2NPCEntry while reading WayPoints" );\r
+ return false;\r
+ }\r
+ tNPC->AddWayPoint(tNPCPartB.mPosX, tNPCPartB.mPosY, tNPCPartB.mPosZ, tCurrWayP);\r
+ tCurrWayP++;\r
+ }\r
+ }\r
+\r
+ if (gDevDebug) Console->Print("Added NPC ID %d", tNPCPartA.mNpcID);\r
+\r
+ mWorld->AddNPC(tNPC);\r
+ return true;\r
+}\r
-/*
- TinNS (TinNS is not a Neocron Server)
- Copyright (C) 2005 Linux Addicted Community
- maintainer Akiko <akiko@gmx.org>
-
- 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 (at your option) 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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
-*/
-
-
-/*
- world_datstruct.h
- .dat world files internal structures
-
- MODIFIED: 29 Sep 2006 Hammag
- REASON: - Creation
-*/
-
-#ifndef WORLD_DATSTRUCT_H
-#define WORLD_DATSTRUCT_H
-
-struct PWorldFileHeader
-{
- u32 mHeaderSize; // must be 08 00 00 00, = header size after this field
- u32 mHeaderSig; // must be CF CF 0F 00
- u32 mSection; // must be 01 00 00 00
-};
-
-struct PSectionHeader
-{
- u32 mHeaderSize; // must be 0C 00 00 00
- u32 mHeaderSig; // must be CF FF 00 00
- u32 mSection; // 00 00 00 00 means end
- u32 mDataSize;
-};
-
-struct PSec2ElemHeader
-{
- u32 mHeaderSize; // must be 0C 00 00 00
- u32 mHeaderSig; // must be F1 FE FE 0F
- u32 mElementType; // 1000003, 1000005 or 1000014
- u32 mDataSize;
-};
-
-struct PSec2ElemType3a //static object ?
-{
- f32 mPosY; //= u16 PosY - 32000
- f32 mPosZ;
- f32 mPosX;
- f32 mRotY;
- f32 mRotZ;
- f32 mRotX;
- f32 mScale; //00 00 80 3F ? = float(1.000000) !!! => scale factor ?????
- u32 mUnknown2; //01 00 00 00 ?
- u16 mModelID; // points to models.ini
- u32 mUnknown3; //00 00 00 00 ?
- u32 mUnknown4; //00 00 00 00 ?
- u16 mWorldmodelID; // points to worldmodel.def
- u16 mUnknown5; //12 00 ?
- u32 mObjectID;
-};
-struct PSec2ElemType3b //this part is optional
-{
- f32 mBoxLowerY; //Bounding box, for useflag "64 - selfconstructing colisionbox"
- f32 mBoxLowerZ; // s32 or u32 ?
- f32 mBoxLowerX;
- f32 mBoxUpperY;
- f32 mBoxUpperZ;
- f32 mBoxUpperX;
-};
-
-struct PSec2ElemType5Start //door
-{
- u16 mUnknown1; //18 00
- u16 mUnknown1bis; //00 00 ? varies
- f32 mPosY;
- f32 mPosZ;
- f32 mPosX;
- u8 mActorStringSize; //string size with ending 0
- u8 mParamStringSize; //string size with ending 0
- u16 mUnknown5; //00 00 ? second byte varies
- u16 mDoorID; // but what is the link with ObjectID sent in Use message (can't find the base offset .. or 0x80 for doors ???)
- u16 mWorldmodelID; //door type from worldmodel.def
-};
-//Actor As String //null terminated string
-//Params As String //null terminated string - for DDOOR, 2nd param is the ID of the other (half)door (*)
-//param1 = 2 => simple lateral move ?, 3 => door frontal+lateral move (as at Typherra memorial) ?
-//last param = 0/1 for lateral move direction ? no ...
-//(*) here is the bug(?) that makes open only one half of a double door
-
-/*
-struct PSec2ElemType6Start //npc
-{
- u16 mUnknown1; //20 00 ?
- u16 mUnknown2; //12 00 ?
- f32 mPosY;
- f32 mPosZ;
- f32 mPosX;
- u32 mNPCTypeID; //npc type in npc.def
- u8 mActorStringSize; //string size with ending 0
- u8 mParamStringSize; //string size with ending 0
- u16 mNpcID; // kind of ?
- u32 mUnknown3; //01 00 00 00 ?
- u16 mUnknown4; //00 00 ?
- u16 mUnknown5; //04 00 ?
-};
- //Actor As String //null terminated string
- //Params As String //null terminated string - Seem to be the facing angle in degres
-struct PSec2ElemType6End
-{
- f32 mPosY2; //second position for movement ?
- f32 mPosZ2; //
- f32 mPosX2; //
-};
-*/
-struct PSec2NPC_EntryPart1
-{
- u32 mUnknown1; // Is always 0x20001200, in every log. maybe header for NPCs?
- f32 mPosY;
- f32 mPosZ;
- f32 mPosX;
- u32 mNPCTypeID; //npc type in npc.def
- u8 mActorStringSize; //string size with ending 0
- u8 mAngleStringSize; //string size with ending 0
- u16 mNpcID;
- u8 mHasAdditionalCoords;
- u8 mUnknown2a;
- u8 mUnknown2b;
- u8 mUnknown2c;
- u16 mTradeID; //mUnknown3; //00 00 ?
- u16 mUnknown4; //04 00 ?
-};
-
-// u8 mActorName[mActorStringSize];
-// u8 mAngle[mAngleStringSize];
-
-struct PSec2NPC_EntryPart2 // Waypoints! or something like that...
-{
- f32 mPosY;
- f32 mPosZ;
- f32 mPosX;
-};
-
-
-// u16 mStrSize; //non-zero terminated string size
-// Name As String //non-zero terminated string
-struct PSec2ElemType15End //area definition/sound ?
-{
- f32 mUnknown1;
- f32 mUnknown2;
- f32 mUnknown3;
- f32 mUnknown4;
- f32 mUnknown5;
-};
-
-#endif
-
+/*\r
+ TinNS (TinNS is not a Neocron Server)\r
+ Copyright (C) 2005 Linux Addicted Community\r
+ maintainer Akiko <akiko@gmx.org>\r
+\r
+ This program is free software; you can redistribute it and/or\r
+ modify it under the terms of the GNU General Public License\r
+ as published by the Free Software Foundation; either version 2\r
+ of the License, or (at your option) any later version.\r
+\r
+ This program is distributed in the hope that it will be useful,\r
+ but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ GNU General Public License for more details.\r
+\r
+ You should have received a copy of the GNU General Public License\r
+ along with this program; if not, write to the Free Software\r
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
+ 02110-1301, USA.\r
+*/\r
+\r
+\r
+/*\r
+ world_datstruct.h\r
+ .dat world files internal structures\r
+\r
+ MODIFIED: 29 Sep 2006 Hammag\r
+ REASON: - Creation\r
+*/\r
+\r
+#ifndef WORLD_DATSTRUCT_H\r
+#define WORLD_DATSTRUCT_H\r
+\r
+struct PWorldFileHeader\r
+{\r
+ u32 mHeaderSize; // must be 08 00 00 00, = header size after this field\r
+ u32 mHeaderSig; // must be CF CF 0F 00\r
+ u32 mSection; // must be 01 00 00 00\r
+};\r
+\r
+struct PSectionHeader\r
+{\r
+ u32 mHeaderSize; // must be 0C 00 00 00\r
+ u32 mHeaderSig; // must be CF FF 00 00\r
+ u32 mSection; // 00 00 00 00 means end\r
+ u32 mDataSize;\r
+};\r
+\r
+struct PSec2ElemHeader\r
+{\r
+ u32 mHeaderSize; // must be 0C 00 00 00\r
+ u32 mHeaderSig; // must be F1 FE FE 0F\r
+ u32 mElementType; // 1000003, 1000005 or 1000014\r
+ u32 mDataSize;\r
+};\r
+\r
+struct PSec2ElemType3a //static object ?\r
+{\r
+ f32 mPosY; //= u16 PosY - 32000\r
+ f32 mPosZ;\r
+ f32 mPosX;\r
+ f32 mRotY;\r
+ f32 mRotZ;\r
+ f32 mRotX;\r
+ f32 mScale; //00 00 80 3F ? = float(1.000000) !!! => scale factor ?????\r
+ u32 mUnknown2; //01 00 00 00 ?\r
+ u16 mModelID; // points to models.ini\r
+ u32 mUnknown3; //00 00 00 00 ?\r
+ u32 mUnknown4; //00 00 00 00 ?\r
+ u16 mWorldmodelID; // points to worldmodel.def\r
+ u16 mUnknown5; //12 00 ?\r
+ u32 mObjectID;\r
+};\r
+struct PSec2ElemType3b //this part is optional\r
+{\r
+ f32 mBoxLowerY; //Bounding box, for useflag "64 - selfconstructing colisionbox"\r
+ f32 mBoxLowerZ; // s32 or u32 ?\r
+ f32 mBoxLowerX;\r
+ f32 mBoxUpperY;\r
+ f32 mBoxUpperZ;\r
+ f32 mBoxUpperX;\r
+};\r
+\r
+struct PSec2ElemType5Start //door\r
+{\r
+ u16 mUnknown1; //18 00\r
+ u16 mUnknown1bis; //00 00 ? varies\r
+ f32 mPosY;\r
+ f32 mPosZ;\r
+ f32 mPosX;\r
+ u8 mActorStringSize; //string size with ending 0\r
+ u8 mParamStringSize; //string size with ending 0\r
+ u16 mUnknown5; //00 00 ? second byte varies\r
+ u16 mDoorID; // but what is the link with ObjectID sent in Use message (can't find the base offset .. or 0x80 for doors ???)\r
+ u16 mWorldmodelID; //door type from worldmodel.def\r
+};\r
+//Actor As String //null terminated string\r
+//Params As String //null terminated string - for DDOOR, 2nd param is the ID of the other (half)door (*)\r
+//param1 = 2 => simple lateral move ?, 3 => door frontal+lateral move (as at Typherra memorial) ?\r
+//last param = 0/1 for lateral move direction ? no ...\r
+//(*) here is the bug(?) that makes open only one half of a double door\r
+\r
+/*\r
+struct PSec2ElemType6Start //npc\r
+{\r
+ u16 mUnknown1; //20 00 ?\r
+ u16 mUnknown2; //12 00 ?\r
+ f32 mPosY;\r
+ f32 mPosZ;\r
+ f32 mPosX;\r
+ u32 mNPCTypeID; //npc type in npc.def\r
+ u8 mActorStringSize; //string size with ending 0\r
+ u8 mParamStringSize; //string size with ending 0\r
+ u16 mNpcID; // kind of ?\r
+ u32 mUnknown3; //01 00 00 00 ?\r
+ u16 mUnknown4; //00 00 ?\r
+ u16 mUnknown5; //04 00 ?\r
+};\r
+ //Actor As String //null terminated string\r
+ //Params As String //null terminated string - Seem to be the facing angle in degres\r
+struct PSec2ElemType6End\r
+{\r
+ f32 mPosY2; //second position for movement ?\r
+ f32 mPosZ2; //\r
+ f32 mPosX2; //\r
+};\r
+*/\r
+struct PSec2NPC_EntryPart1\r
+{\r
+ u32 mUnknown1; // Is always 0x20001200, in every log. maybe header for NPCs?\r
+ f32 mPosY;\r
+ f32 mPosZ;\r
+ f32 mPosX;\r
+ u32 mNPCTypeID; //npc type in npc.def\r
+ u8 mActorStringSize; //string size with ending 0\r
+ u8 mAngleStringSize; //string size with ending 0\r
+ u16 mNpcID;\r
+ u8 mHasAdditionalCoords;\r
+ u8 mUnknown2a;\r
+ u8 mUnknown2b;\r
+ u8 mUnknown2c;\r
+ u16 mTradeID; //mUnknown3; //00 00 ?\r
+ u16 mUnknown4; //04 00 ?\r
+};\r
+\r
+// u8 mActorName[mActorStringSize];\r
+// u8 mAngle[mAngleStringSize];\r
+\r
+struct PSec2NPC_EntryPart2 // Waypoints! or something like that...\r
+{\r
+ f32 mPosY;\r
+ f32 mPosZ;\r
+ f32 mPosX;\r
+};\r
+\r
+\r
+// u16 mStrSize; //non-zero terminated string size\r
+// Name As String //non-zero terminated string\r
+struct PSec2ElemType15End //area definition/sound ?\r
+{\r
+ f32 mUnknown1;\r
+ f32 mUnknown2;\r
+ f32 mUnknown3;\r
+ f32 mUnknown4;\r
+ f32 mUnknown5;\r
+};\r
+\r
+#endif\r
\r
MODIFIED: 05 Nov 2006 Hammag\r
REASON: - creation\r
+ MODIFIED: 09 Jun 2009 Akiko\r
+ REASON: - adjusted includes for new buildsystem\r
\r
TODO: - mem corruption occurs if mDoorParameters[] is given a size of 6, and that 6 max param can be accepted\r
This bug occurs in world 105. Reason not found yet :-x\r
\r
\r
#include "main.h"\r
-#include "doortemplate.h"\r
+\r
+#include "include/doortemplate.h"\r
\r
PDoorTemplate::PDoorTemplate()\r
{\r
\r
\r
/*\r
- furnituretemplate.cpp - world furniture template class\r
+ furnituretemplate.cpp - world furniture template class\r
\r
MODIFIED: 04 Oct 2006 Hammag\r
REASON: - creation\r
- \r
+ MODIFIED: 09 Jun 2009 Akiko\r
+ REASON: - adjusted includes for new buildsystem\r
*/\r
\r
\r
#include "main.h"\r
-#include "furnituretemplate.h"\r
+\r
+#include "include/furnituretemplate.h"\r
\r
PFurnitureItemTemplate::PFurnitureItemTemplate()\r
{\r
+++ /dev/null
-#
-# TinNS per-directory Makefile
-#
-# Adapted by Hammag from the Makefile system for Linux kernel.
-#
-# 14 Sep 2000, Christoph Hellwig <hch@infradead.org>
-# Rewritten to use lists instead of if-statements.
-#
-
-######################################################
-# Target for this directory and its sub-dirs
-######################################################
-# Case 1 : target is an executable named as defined
-#B_TARGET := gameserver
-
-# Case 2 : target is a TinNS lib name
-# (use short name, as in -l linker option)
-#L_TARGET := tinns
-
-# Case 3 (usual): objects shall be made available to the parent dir
-# The following line will set that automatically
-# (Should match dir name + .o suffix)
-O_TARGET := $(addsuffix .o,$(notdir $(shell /bin/pwd)))
-# Manualy define this only if you need to force the compiled obj name
-#O_TARGET := game.o
-
-
-######################################################
-# Local flags
-######################################################
-# local dir CXX Flags
-EXTRA_CXXFLAGS := -I/usr/include/mysql -I$(TOPDIR)/game/include
-
-# per-object CXX Flags
-#CXXFLAGS_funcdef2.o := -g
-
-# local dir Linker Flags (for intermediate .o linking)
-#EXTRA_LDFLAGS :=
-
-# any tinns Lib used (short name, as in -l linker option)
-LINK_TINNSLIBS := tinns
-
-# local dir Linker Flags (for final executable linking)
-#EXTRA_LINKFLAGS := -lrt -lpthread -lz -lm -lcrypt -L"/usr/lib/mysql" -lmysqlclient
-
-
-#####################################################
-# Subdirectories
-#####################################################
-#subdir-y := def
-#subdir-$(CONFIG_GAMEMONKEY) += gamemonkey
-
-
-#####################################################
-#***************************************************#
-# No further config should be needed after this line
-#***************************************************#
-ifdef TOPDIR
-
-# build list of objects ib loca ldir
-obj-y := $(patsubst %.cpp,%.o,$(wildcard *.cpp))
-# add final object from each subdir
-obj-y += $(join $(subdir-y),$(subdir-y:%=/%.o))
-
-include $(TOPDIR)/Rules.make
-
-else #TOPDIR undef, Makefile called from non-top dir
-
-# Memorize the first calling dir in case we wanted to
-# lauch local actions from top Makefile
- ifndef FIRSTDIR
- FIRSTDIR :=$(CURDIR)
- export FIRSTDIR
- endif
-
-uptoparent :
- $(MAKE) -C .. $(MAKECMDGOALS)
-
-.DEFAULT :
- $(MAKE) -C .. $(MAKECMDGOALS)
-
-endif #TOPDIR
-
{
u32 cashtoadd = 0;
bool SyntaxError = false;
- if (ArgC < 1)
+ if(ArgC < 1)
{
SyntaxError = true;
}
- if (IsArgNumeric(1) == false)
+ if(IsArgNumeric(1) == false)
{
SyntaxError = true;
}
{
cashtoadd = (u32)GetArgInt(1);
}
- if (cashtoadd == 0)
- {
+ if(cashtoadd == 0)
SyntaxError = true;
- }
- if (SyntaxError == true)
+ if(SyntaxError == true)
{
Chat->send(source, CHAT_DIRECT, "Usage", "@givemoney <amount> [<charID or nickname>]");
return;
}
- if (ArgC == 2)
+ if(ArgC == 2)
{
- if (IsArgNumeric(2) == true)
+ if(IsArgNumeric(2) == true)
{
target = GetClientByID(GetArgInt(2));
}
GetArgText(2, tmp_destNick, 50);
target = GetClientByNick(tmp_destNick);
}
- if (target == NULL)
+ if(target == NULL)
{
Chat->send(source, CHAT_DIRECT, "System", "No such player");
return;
}
- if (source->GetAccountLevel() <= target->GetAccountLevel())
+ if(source->GetAccountLevel() <= target->GetAccountLevel())
{
char tmpMsg[200];
snprintf(tmpMsg, 199, "Cant manipulate %s's credits, target level is higher or equal to yours!", Chars->GetChar(target->GetCharID())->GetName().c_str());
\r
MODIFIED: 30 Aug 2006 Hammag\r
REASON: - created\r
-\r
+ MODIFIED: 10 Jun 2009 Akiko\r
+ REASON: - adjusted includes for new buildsystem\r
*/\r
\r
#ifndef MAIN_H\r
//#include "version.h"\r
\r
//basic includes\r
-#include "external.h"\r
+#include "include/external.h"\r
\r
//tinns includes\r
-#include "types.h"\r
-#include "config.h"\r
+#include "include/types.h"\r
+#include "common/config.h"\r
\r
-#include "console.h"\r
-#include "misc.h"\r
+#include "common/console.h"\r
+#include "common/misc.h"\r
\r
-#include "netcode.h"\r
+#include "common/netcode.h"\r
\r
-#include "globals.h"\r
+#include "include/globals.h"\r
\r
/*\r
#include "../gamemonkey/gmMachine.h"\r
*/\r
\r
// MySQL Support // shouldn't be needed as DB-objects access class should do that\r
-#include "mysql.h"\r
-#include "sql.h"\r
-\r
-#include "filesystem.h"\r
-#include "defparser.h"\r
-\r
-#include "skill.h"\r
-\r
-#include "chars.h"\r
-#include "accounts.h"\r
-#include "defs.h"\r
-#include "client.h"\r
-#include "server.h"\r
-#include "misc.h"\r
-#include "gameserver.h"\r
-#include "zoning.h"\r
-#include "item.h"\r
-#include "inventory.h"\r
-\r
-#include "chat.h"\r
-#include "commands.h"\r
-#include "clientmanager.h"\r
-#include "msgbuilder.h"\r
-#include "worlds.h"\r
-#include "worldactors.h"\r
-#include "npc.h"\r
-\r
-using namespace std;\r
+#ifdef MYSQL_INC_DIR\r
+#include <mysql/mysql.h>\r
+#else\r
+#include <mysql.h>\r
+#endif\r
+\r
+#include "include/sql.h"\r
+\r
+#include "common/filesystem.h"\r
+#include "include/defparser.h"\r
+\r
+#include "include/skill.h"\r
+\r
+#include "include/chars.h"\r
+#include "include/accounts.h"\r
+#include "include/defs.h"\r
+#include "include/client.h"\r
+#include "include/server.h"\r
+#include "include/gameserver.h"\r
+#include "include/zoning.h"\r
+#include "include/item.h"\r
+#include "include/inventory.h"\r
+\r
+#include "include/chat.h"\r
+#include "include/commands.h"\r
+#include "include/clientmanager.h"\r
+#include "include/msgbuilder.h"\r
+#include "include/worlds.h"\r
+#include "include/worldactors.h"\r
+#include "include/npc.h"\r
\r
#endif\r
\r
-/*\r
- TinNS (TinNS is not a Neocron Server)\r
- Copyright (C) 2005 Linux Addicted Community\r
- maintainer Akiko <akiko@gmx.org>\r
-\r
- This program is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU General Public License\r
- as published by the Free Software Foundation; either version 2\r
- of the License, or (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
- 02110-1301, USA.\r
-*/\r
-#include "main.h"\r
-\r
-void PCommands::doNPC()\r
-{\r
- bool SyntaxError = false;\r
- if(ArgC < 2)\r
- {\r
- SyntaxError = true;\r
- }\r
-\r
- if(SyntaxError == true)\r
- {\r
- Chat->send(source, CHAT_DIRECT, "Usage", "@npc <what> [<worldID>]");\r
- Chat->send(source, CHAT_DIRECT, "Usage", " <what> can be:");\r
- Chat->send(source, CHAT_DIRECT, "lua <id> 1/0", "Enables/Disables scripts");\r
- Chat->send(source, CHAT_DIRECT, "reloadlua <id>", "Reloads LUA script");\r
- Chat->send(source, CHAT_DIRECT, "spawn <id> [<name>]", "Spawns an NPC");\r
- Chat->send(source, CHAT_DIRECT, "remove <id>", "Removes an NPC");\r
- Chat->send(source, CHAT_DIRECT, "help <cmd>", "Displays detailed help for any command");\r
-\r
- /* more to add here... spawn, remove, ... */\r
- return;\r
- }\r
- // Get subcommand\r
- char tmp_npccommand[50];\r
- GetArgText(1, tmp_npccommand, 50);\r
-\r
- // Dont search for NPC ID when commands HELP and SPAWN are used\r
- PNPC* targetNPC = NULL;\r
- PNPCWorld* currentNPCWorld = NULL;\r
- if(strncmp(tmp_npccommand, "spawn", 5) != 0 && strncmp(tmp_npccommand, "help", 4) != 0)\r
- {\r
- currentNPCWorld = NPCManager->GetWorld( source->GetChar()->GetLocation() );\r
- if ( currentNPCWorld )\r
- {\r
- targetNPC = currentNPCWorld->GetNPC( GetArgInt(2) );\r
- if(!targetNPC)\r
- {\r
- // Search for DEF version of NPC (remember, def IDs are on 255 offset!\r
- // Note to myself: This is UGLY!!!! and BAD!!! but it works for now. CHANGE THIS!\r
- targetNPC = currentNPCWorld->GetNPC( GetArgInt(1) - 255 );\r
- }\r
- }\r
- if (!targetNPC)\r
- {\r
- Chat->send(source, CHAT_DIRECT, "System", "Invalid NPC ID");\r
- return;\r
- }\r
- }\r
-\r
- if(strncmp(tmp_npccommand, "help", 4) == 0)\r
- {\r
- char tmp_help[50];\r
- GetArgText(2, tmp_help, 50);\r
-\r
- if(strncmp(tmp_help, "reloadlua", 9) == 0)\r
- {\r
- Chat->send(source, CHAT_DIRECT, "reloadlua", "Forces the server to reload any LUA script attached to the NPC");\r
- return;\r
- }\r
- else if(strncmp(tmp_help, "spawn", 5) == 0)\r
- {\r
- Chat->send(source, CHAT_DIRECT, "spawn", "Spawns an NPC on your current location");\r
- Chat->send(source, CHAT_DIRECT, "Params", "<spawnID> - See npc.def");\r
- Chat->send(source, CHAT_DIRECT, "Params", "[<Name>] - Optional name for NPC");\r
- return;\r
- }\r
- else if(strncmp(tmp_help, "remove", 6) == 0)\r
- {\r
- Chat->send(source, CHAT_DIRECT, "remove", "Removes an NPC");\r
- Chat->send(source, CHAT_DIRECT, "Params", "<worldID> - Use @debug it to get ID");\r
- Chat->send(source, CHAT_DIRECT, "Params", "[keep] - Dont delete NPC from SQL");\r
- return;\r
- }\r
- else if(strncmp(tmp_help, "help", 4) == 0)\r
- {\r
- Chat->send(source, CHAT_DIRECT, "help", "Yes... help...");\r
- return;\r
- }\r
- else\r
- {\r
- Chat->send(source, CHAT_DIRECT, "help", "No such command");\r
- return;\r
- }\r
- }\r
- else if(strncmp(tmp_npccommand, "spawn", 5) == 0)\r
- {\r
-// ------------------------------\r
- PNPCWorld* tNPCWorld = NPCManager->GetWorld( source->GetChar()->GetLocation() );\r
- if (!tNPCWorld)\r
- {\r
- Chat->send(source, CHAT_DIRECT, "System", "Error NPC World is inactive");\r
- Console->Print("%s Error NPC World is inactive but players are there!", Console->ColorText(RED,BLACK, "[PANIC]"));\r
- return;\r
- }\r
- // Get requested spawn ID from Input\r
- // @npc spawn 12\r
- int tSpawnID = GetArgInt(2);\r
- // Check if ID is valid\r
- const PDefNpc* t_defNpc = GameDefs->Npcs()->GetDef(tSpawnID);\r
- if(!t_defNpc)\r
- {\r
- Chat->send(source, CHAT_DIRECT, "System", "Invalid SpawnID");\r
- return;\r
- }\r
- char tCustomName[80];\r
- tCustomName[0] = '\0';\r
- if(ArgC == 3)\r
- GetArgText(3, tCustomName, 80);\r
-\r
- u16 tNPCPosX = source->GetChar()->Coords.mX + 768;\r
- u16 tNPCPosY = source->GetChar()->Coords.mY + 768;\r
- u16 tNPCPosZ = source->GetChar()->Coords.mZ + 768;\r
- u32 tLocation = source->GetChar()->GetLocation();\r
-\r
- u8 tAngle = source->GetChar()->Coords.mLR;\r
- string tNPCAngle = Ssprintf( "%d", tAngle );\r
-\r
- string tNPCScript = t_defNpc->GetStandardScript();\r
- u32 tNPCHealth = t_defNpc->GetHealth() * NPC_HEALTHFACTOR;\r
-\r
- /*-------------------------------------------------------*/\r
- // Get the highest NPC Id for current zone\r
- /*-------------------------------------------------------*/\r
- MYSQL_RES *result = NULL;\r
- char tSql[100];\r
- snprintf(tSql, 100, "SELECT IFNULL(MAX(npc_worldid)+1,0) FROM npc_spawns WHERE npc_location = %d", tLocation);\r
- result = MySQL->GameResQuery(tSql);\r
- if(!result)\r
- {\r
- Chat->send(source, CHAT_DIRECT, "System", "Error on DB insert, NPC not added");\r
- MySQL->ShowGameSQLError();\r
- return;\r
- }\r
-\r
- int tNewWorldID = atoi(mysql_fetch_row(result)[0]);\r
-\r
- if(tNewWorldID == 0)\r
- tNewWorldID = NEW_NPC_ZONEID_START;\r
-\r
- /*-------------------------------------------------------*/\r
- // Insert NPC into DB\r
- /*-------------------------------------------------------*/\r
- char tSql2[500];\r
- snprintf(tSql2, 500, "INSERT INTO npc_spawns (npc_worldid, npc_nameid, npc_typeid, npc_name, npc_location, npc_x, npc_y, npc_z, npc_angle, npc_clothing, npc_loot, npc_unknown, npc_trader, npc_customname) VALUES (%d, %d, %d, \"%s\", %d, %d, %d, %d, %d, %d, %d, %d, %d, \"%s\")",\r
- tNewWorldID, tSpawnID, GetRandom(65000, 1000), tNPCScript.c_str(), tLocation, tNPCPosX, tNPCPosY, tNPCPosZ, atoi(tNPCAngle.c_str()),\r
- GetRandom(65000, 1000), t_defNpc->GetLoot(), tNPCHealth, 0, tCustomName);\r
-\r
- if(MySQL->GameQuery(tSql2))\r
- {\r
- Chat->send(source, CHAT_DIRECT, "System", "Error on DB insert, NPC not added");\r
- MySQL->ShowGameSQLError();\r
- return;\r
- }\r
- /*-------------------------------------------------------*/\r
- // Grab last insert ID to tell NPCWorld later\r
- /*-------------------------------------------------------*/\r
- int tNPC_SQLID = MySQL->GetLastGameInsertId();\r
- if(tNPC_SQLID == 0)\r
- {\r
- Chat->send(source, CHAT_DIRECT, "System", "Error on DB insert, please check your DB");\r
- Console->Print("%s LastInsertID is 0 without SQL Error after query", Console->ColorText(RED,BLACK, "[PANIC]"));\r
- return;\r
- }\r
- /*-------------------------------------------------------*/\r
- // Tell NPCWorld to load NPC with given SQL\r
- /*-------------------------------------------------------*/\r
- tNPCWorld->AddNPC(tNPC_SQLID, tNewWorldID);\r
-\r
- char retMsg[100];\r
- snprintf(retMsg, 100, "NPC spawned. WorldID: %d", tNewWorldID);\r
- Chat->send(source, CHAT_DIRECT, "System", retMsg);\r
- return;\r
-// ------------------------------\r
- }\r
- else if(strncmp(tmp_npccommand, "remove", 6) == 0 && targetNPC && currentNPCWorld)\r
- {\r
- char tmp_option[50];\r
- if(ArgC == 3)\r
- GetArgText(3, tmp_option, 50);\r
-\r
- if(strncmp(tmp_option, "keep", 4) != 0)\r
- {\r
- if(targetNPC->IsSQLNPC() == true)\r
- {\r
- char sql[100];\r
- char sql2[100];\r
- snprintf(sql, 100, "DELETE FROM npc_spawns WHERE npc_id = %d", targetNPC->GetNPCSQLID());\r
- snprintf(sql2, 100, "DELETE FROM npc_shop WHERE c_npc_id = %d and c_zoneid = %d", targetNPC->GetNPCID(), source->GetChar()->GetLocation());\r
- if(MySQL->GameQuery(sql))\r
- {\r
- Chat->send(source, CHAT_DIRECT, "System", "Unable to remove NPC from SQL");\r
- Console->Print("%s Unable to remove NPC from SQL", Console->ColorText(RED, BLACK, "[Error]"));\r
- MySQL->ShowGameSQLError();\r
- }\r
- if(MySQL->GameQuery(sql2))\r
- {\r
- Chat->send(source, CHAT_DIRECT, "System", "Unable to remove NPC Shop settings from SQL");\r
- Console->Print("%s Unable to remove NPC shop settings from SQL", Console->ColorText(RED, BLACK, "[Error]"));\r
- MySQL->ShowGameSQLError();\r
- }\r
- }\r
- }\r
- Chat->send(source, CHAT_DIRECT, "System", "Removing NPC...");\r
- currentNPCWorld->DelNPC(targetNPC->GetNPCID());\r
- return;\r
- }\r
- else if(strncmp(tmp_npccommand, "reloadlua", 9) == 0 && targetNPC)\r
- {\r
- if(targetNPC->ReloadLUAScript() == true)\r
- {\r
- Chat->send(source, CHAT_DIRECT, "System", "LUA script reload successfull");\r
- return;\r
- }\r
- else\r
- {\r
- Chat->send(source, CHAT_DIRECT, "System", "LUA script reload failed");\r
- return;\r
- }\r
- }\r
- else if(strncmp(tmp_npccommand, "lua", 3) == 0 && targetNPC)\r
- {\r
- if(ArgC < 3)\r
- {\r
- Chat->send(source, CHAT_DIRECT, "Syntax", "@npc <id> lua 1/0");\r
- return;\r
- }\r
- if(IsArgNumeric(3) == false)\r
- {\r
- Chat->send(source, CHAT_DIRECT, "Syntax", "@npc <id> lua 1/0");\r
- return;\r
- }\r
-\r
- int tVal = GetArgInt(3);\r
- targetNPC->SetScripting(tVal);\r
-\r
-\r
- if(targetNPC->IsSQLNPC() == true)\r
- {\r
- char sql[100];\r
- snprintf(sql, 100, "UPDATE npc_spawns SET npc_scripting = %d WHERE npc_id = %d", tVal, targetNPC->GetNPCSQLID());\r
- if(MySQL->GameQuery(sql))\r
- {\r
- Chat->send(source, CHAT_DIRECT, "System", "Unable to set scripting value in SQL");\r
- Console->Print("%s Unable to set scripting value in SQL", Console->ColorText(RED, BLACK, "[Error]"));\r
- MySQL->ShowGameSQLError();\r
- }\r
- }\r
-\r
- if(tVal == 1)\r
- Chat->send(source, CHAT_DIRECT, "System", "LUA scripting is now enabled");\r
- else\r
- Chat->send(source, CHAT_DIRECT, "Syntax", "LUA scripting is now disabled");\r
-\r
- return;\r
- }\r
- else\r
- {\r
- char buff[100];\r
- snprintf(buff, 100, "Unknown command: '%s'", tmp_npccommand);\r
- Chat->send(source, CHAT_DIRECT, "System", buff);\r
- return;\r
- }\r
-}\r
+/*
+ TinNS (TinNS is not a Neocron Server)
+ Copyright (C) 2005 Linux Addicted Community
+ maintainer Akiko <akiko@gmx.org>
+
+ 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 (at your option) 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, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
+*/
+#include "main.h"
+
+void PCommands::doNPC()
+{
+ bool SyntaxError = false;
+ if(ArgC < 2)
+ {
+ SyntaxError = true;
+ }
+
+ if(SyntaxError == true)
+ {
+ Chat->send(source, CHAT_DIRECT, "Usage", "@npc <what> [<worldID>]");
+ Chat->send(source, CHAT_DIRECT, "Usage", " <what> can be:");
+ Chat->send(source, CHAT_DIRECT, "lua <id> 1/0", "Enables/Disables scripts");
+ Chat->send(source, CHAT_DIRECT, "reloadlua <id>", "Reloads LUA script");
+ Chat->send(source, CHAT_DIRECT, "spawn <id> [<name>]", "Spawns an NPC");
+ Chat->send(source, CHAT_DIRECT, "remove <id>", "Removes an NPC");
+ Chat->send(source, CHAT_DIRECT, "help <cmd>", "Displays detailed help for any command");
+
+ /* more to add here... spawn, remove, ... */
+ return;
+ }
+ // Get subcommand
+ char tmp_npccommand[50];
+ GetArgText(1, tmp_npccommand, 50);
+
+ // Dont search for NPC ID when commands HELP and SPAWN are used
+ PNPC* targetNPC = NULL;
+ PNPCWorld* currentNPCWorld = NULL;
+ if(strncmp(tmp_npccommand, "spawn", 5) != 0 && strncmp(tmp_npccommand, "help", 4) != 0)
+ {
+ currentNPCWorld = NPCManager->GetWorld( source->GetChar()->GetLocation() );
+ if ( currentNPCWorld )
+ {
+ targetNPC = currentNPCWorld->GetNPC( GetArgInt(2) );
+ if(!targetNPC)
+ {
+ // Search for DEF version of NPC (remember, def IDs are on 255 offset!
+ // Note to myself: This is UGLY!!!! and BAD!!! but it works for now. CHANGE THIS!
+ targetNPC = currentNPCWorld->GetNPC( GetArgInt(1) - 255 );
+ }
+ }
+ if (!targetNPC)
+ {
+ Chat->send(source, CHAT_DIRECT, "System", "Invalid NPC ID");
+ return;
+ }
+ }
+
+ if(strncmp(tmp_npccommand, "help", 4) == 0)
+ {
+ char tmp_help[50];
+ GetArgText(2, tmp_help, 50);
+
+ if(strncmp(tmp_help, "reloadlua", 9) == 0)
+ {
+ Chat->send(source, CHAT_DIRECT, "reloadlua", "Forces the server to reload any LUA script attached to the NPC");
+ return;
+ }
+ else if(strncmp(tmp_help, "spawn", 5) == 0)
+ {
+ Chat->send(source, CHAT_DIRECT, "spawn", "Spawns an NPC on your current location");
+ Chat->send(source, CHAT_DIRECT, "Params", "<spawnID> - See npc.def");
+ Chat->send(source, CHAT_DIRECT, "Params", "[<Name>] - Optional name for NPC");
+ return;
+ }
+ else if(strncmp(tmp_help, "remove", 6) == 0)
+ {
+ Chat->send(source, CHAT_DIRECT, "remove", "Removes an NPC");
+ Chat->send(source, CHAT_DIRECT, "Params", "<worldID> - Use @debug it to get ID");
+ Chat->send(source, CHAT_DIRECT, "Params", "[keep] - Dont delete NPC from SQL");
+ return;
+ }
+ else if(strncmp(tmp_help, "help", 4) == 0)
+ {
+ Chat->send(source, CHAT_DIRECT, "help", "Yes... help...");
+ return;
+ }
+ else
+ {
+ Chat->send(source, CHAT_DIRECT, "help", "No such command");
+ return;
+ }
+ }
+ else if(strncmp(tmp_npccommand, "spawn", 5) == 0)
+ {
+// ------------------------------
+ PNPCWorld* tNPCWorld = NPCManager->GetWorld( source->GetChar()->GetLocation() );
+ if (!tNPCWorld)
+ {
+ Chat->send(source, CHAT_DIRECT, "System", "Error NPC World is inactive");
+ Console->Print("%s Error NPC World is inactive but players are there!", Console->ColorText(RED,BLACK, "[PANIC]"));
+ return;
+ }
+ // Get requested spawn ID from Input
+ // @npc spawn 12
+ int tSpawnID = GetArgInt(2);
+ // Check if ID is valid
+ const PDefNpc* t_defNpc = GameDefs->Npcs()->GetDef(tSpawnID);
+ if(!t_defNpc)
+ {
+ Chat->send(source, CHAT_DIRECT, "System", "Invalid SpawnID");
+ return;
+ }
+ char tCustomName[80];
+ tCustomName[0] = '\0';
+ if(ArgC == 3)
+ GetArgText(3, tCustomName, 80);
+
+ u16 tNPCPosX = source->GetChar()->Coords.mX + 768;
+ u16 tNPCPosY = source->GetChar()->Coords.mY + 768;
+ u16 tNPCPosZ = source->GetChar()->Coords.mZ + 768;
+ u32 tLocation = source->GetChar()->GetLocation();
+
+ u8 tAngle = source->GetChar()->Coords.mLR;
+ std::string tNPCAngle = Ssprintf( "%d", tAngle );
+
+ std::string tNPCScript = t_defNpc->GetStandardScript();
+ u32 tNPCHealth = t_defNpc->GetHealth() * NPC_HEALTHFACTOR;
+
+ /*-------------------------------------------------------*/
+ // Get the highest NPC Id for current zone
+ /*-------------------------------------------------------*/
+ MYSQL_RES *result = NULL;
+ char tSql[100];
+ snprintf(tSql, 100, "SELECT IFNULL(MAX(npc_worldid)+1,0) FROM npc_spawns WHERE npc_location = %d", tLocation);
+ result = MySQL->GameResQuery(tSql);
+ if(!result)
+ {
+ Chat->send(source, CHAT_DIRECT, "System", "Error on DB insert, NPC not added");
+ MySQL->ShowGameSQLError();
+ return;
+ }
+
+ int tNewWorldID = atoi(mysql_fetch_row(result)[0]);
+
+ if(tNewWorldID == 0)
+ tNewWorldID = NEW_NPC_ZONEID_START;
+
+ /*-------------------------------------------------------*/
+ // Insert NPC into DB
+ /*-------------------------------------------------------*/
+ char tSql2[500];
+ snprintf(tSql2, 500, "INSERT INTO npc_spawns (npc_worldid, npc_nameid, npc_typeid, npc_name, npc_location, npc_x, npc_y, npc_z, npc_angle, npc_clothing, npc_loot, npc_unknown, npc_trader, npc_customname) VALUES (%d, %d, %d, \"%s\", %d, %d, %d, %d, %d, %d, %d, %d, %d, \"%s\")",
+ tNewWorldID, tSpawnID, GetRandom(65000, 1000), tNPCScript.c_str(), tLocation, tNPCPosX, tNPCPosY, tNPCPosZ, atoi(tNPCAngle.c_str()),
+ GetRandom(65000, 1000), t_defNpc->GetLoot(), tNPCHealth, 0, tCustomName);
+
+ if(MySQL->GameQuery(tSql2))
+ {
+ Chat->send(source, CHAT_DIRECT, "System", "Error on DB insert, NPC not added");
+ MySQL->ShowGameSQLError();
+ return;
+ }
+ /*-------------------------------------------------------*/
+ // Grab last insert ID to tell NPCWorld later
+ /*-------------------------------------------------------*/
+ int tNPC_SQLID = MySQL->GetLastGameInsertId();
+ if(tNPC_SQLID == 0)
+ {
+ Chat->send(source, CHAT_DIRECT, "System", "Error on DB insert, please check your DB");
+ Console->Print("%s LastInsertID is 0 without SQL Error after query", Console->ColorText(RED,BLACK, "[PANIC]"));
+ return;
+ }
+ /*-------------------------------------------------------*/
+ // Tell NPCWorld to load NPC with given SQL
+ /*-------------------------------------------------------*/
+ tNPCWorld->AddNPC(tNPC_SQLID, tNewWorldID);
+
+ char retMsg[100];
+ snprintf(retMsg, 100, "NPC spawned. WorldID: %d", tNewWorldID);
+ Chat->send(source, CHAT_DIRECT, "System", retMsg);
+ return;
+// ------------------------------
+ }
+ else if(strncmp(tmp_npccommand, "remove", 6) == 0 && targetNPC && currentNPCWorld)
+ {
+ char tmp_option[50];
+ if(ArgC == 3)
+ GetArgText(3, tmp_option, 50);
+
+ if(strncmp(tmp_option, "keep", 4) != 0)
+ {
+ if(targetNPC->IsSQLNPC() == true)
+ {
+ char sql[100];
+ char sql2[100];
+ snprintf(sql, 100, "DELETE FROM npc_spawns WHERE npc_id = %d", targetNPC->GetNPCSQLID());
+ snprintf(sql2, 100, "DELETE FROM npc_shop WHERE c_npc_id = %d and c_zoneid = %d", targetNPC->GetNPCID(), source->GetChar()->GetLocation());
+ if(MySQL->GameQuery(sql))
+ {
+ Chat->send(source, CHAT_DIRECT, "System", "Unable to remove NPC from SQL");
+ Console->Print("%s Unable to remove NPC from SQL", Console->ColorText(RED, BLACK, "[Error]"));
+ MySQL->ShowGameSQLError();
+ }
+ if(MySQL->GameQuery(sql2))
+ {
+ Chat->send(source, CHAT_DIRECT, "System", "Unable to remove NPC Shop settings from SQL");
+ Console->Print("%s Unable to remove NPC shop settings from SQL", Console->ColorText(RED, BLACK, "[Error]"));
+ MySQL->ShowGameSQLError();
+ }
+ }
+ }
+ Chat->send(source, CHAT_DIRECT, "System", "Removing NPC...");
+ currentNPCWorld->DelNPC(targetNPC->GetNPCID());
+ return;
+ }
+ else if(strncmp(tmp_npccommand, "reloadlua", 9) == 0 && targetNPC)
+ {
+ if(targetNPC->ReloadLUAScript() == true)
+ {
+ Chat->send(source, CHAT_DIRECT, "System", "LUA script reload successfull");
+ return;
+ }
+ else
+ {
+ Chat->send(source, CHAT_DIRECT, "System", "LUA script reload failed");
+ return;
+ }
+ }
+ else if(strncmp(tmp_npccommand, "lua", 3) == 0 && targetNPC)
+ {
+ if(ArgC < 3)
+ {
+ Chat->send(source, CHAT_DIRECT, "Syntax", "@npc <id> lua 1/0");
+ return;
+ }
+ if(IsArgNumeric(3) == false)
+ {
+ Chat->send(source, CHAT_DIRECT, "Syntax", "@npc <id> lua 1/0");
+ return;
+ }
+
+ int tVal = GetArgInt(3);
+ targetNPC->SetScripting(tVal);
+
+
+ if(targetNPC->IsSQLNPC() == true)
+ {
+ char sql[100];
+ snprintf(sql, 100, "UPDATE npc_spawns SET npc_scripting = %d WHERE npc_id = %d", tVal, targetNPC->GetNPCSQLID());
+ if(MySQL->GameQuery(sql))
+ {
+ Chat->send(source, CHAT_DIRECT, "System", "Unable to set scripting value in SQL");
+ Console->Print("%s Unable to set scripting value in SQL", Console->ColorText(RED, BLACK, "[Error]"));
+ MySQL->ShowGameSQLError();
+ }
+ }
+
+ if(tVal == 1)
+ Chat->send(source, CHAT_DIRECT, "System", "LUA scripting is now enabled");
+ else
+ Chat->send(source, CHAT_DIRECT, "Syntax", "LUA scripting is now disabled");
+
+ return;
+ }
+ else
+ {
+ char buff[100];
+ snprintf(buff, 100, "Unknown command: '%s'", tmp_npccommand);
+ Chat->send(source, CHAT_DIRECT, "System", buff);
+ return;
+ }
+}
-/*\r
- TinNS (TinNS is not a Neocron Server)\r
- Copyright (C) 2005 Linux Addicted Community\r
- maintainer Akiko <akiko@gmx.org>\r
-\r
- This program is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU General Public License\r
- as published by the Free Software Foundation; either version 2\r
- of the License, or (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
- 02110-1301, USA.\r
-*/\r
-#include "main.h"\r
-\r
-void PCommands::doNPC_Shop()\r
-{\r
- bool SyntaxError = false;\r
- if(ArgC < 2)\r
- {\r
- SyntaxError = true;\r
- }\r
-\r
- if(IsArgNumeric(1) == true)\r
- {\r
- target = GetClientByID(GetArgInt(1));\r
- }\r
- else\r
- {\r
- SyntaxError = true;\r
- }\r
-\r
- if(SyntaxError == true)\r
- {\r
- Chat->send(source, CHAT_DIRECT, "Usage", "@npcshop <worldID> <what>");\r
- Chat->send(source, CHAT_DIRECT, "Usage", " <what> can be:");\r
- Chat->send(source, CHAT_DIRECT, "setquality <1-255>", "Sets itemquality in shop");\r
- Chat->send(source, CHAT_DIRECT, "additem <id> <price>", "Adds item <ID> with <Price>");\r
- Chat->send(source, CHAT_DIRECT, "delitem <id>", "Removes item <ID>");\r
- Chat->send(source, CHAT_DIRECT, "setdefshop <id>", "ID from trader.def; Use 0 to unset");\r
- Chat->send(source, CHAT_DIRECT, "reload", "Reloads shop list");\r
- Chat->send(source, CHAT_DIRECT, "remove", "Disables the shop");\r
- Chat->send(source, CHAT_DIRECT, "setallbuyer", "Makes NPC an allbuyer (Yo's)");\r
-\r
- /* more to add here... spawn, remove, ... */\r
- return;\r
- }\r
-\r
- PNPC* targetNPC = NULL;\r
- PNPCWorld* currentNPCWorld = NPCManager->GetWorld( source->GetChar()->GetLocation() );\r
- if ( currentNPCWorld )\r
- {\r
- targetNPC = currentNPCWorld->GetNPC( GetArgInt(1) );\r
- if(!targetNPC)\r
- {\r
- // Search for DEF version of NPC (remember, def IDs are on 255 offset!\r
- // Note to myself: This is UGLY!!!! and BAD!!! but it works for now. CHANGE THIS!\r
- targetNPC = currentNPCWorld->GetNPC( GetArgInt(1) - 255 );\r
- }\r
- }\r
- if (!targetNPC)\r
- {\r
- Chat->send(source, CHAT_DIRECT, "System", "Invalid NPC ID");\r
- return;\r
- }\r
-\r
- // Get subcommand\r
- char tmp_npccommand[50];\r
- GetArgText(2, tmp_npccommand, 50);\r
-\r
- if(strncmp(tmp_npccommand, "setallbuyer", 11) == 0)\r
- {\r
- int tItemID = -1;\r
- int tPrice = 0;\r
- int tNPCID = targetNPC->GetNPCID();\r
- int tZoneID = source->GetChar()->GetLocation();\r
-\r
- char sqlq[200];\r
- snprintf(sqlq, 200, "INSERT INTO npc_shop (`c_npc_id`, `c_zoneid`, `c_itemid`, `c_itemprice`) VALUES (%d, %d, %d, %d)", tNPCID, tZoneID, tItemID, tPrice);\r
- if(MySQL->GameQuery(sqlq))\r
- {\r
- Chat->send(source, CHAT_DIRECT, "System", "Error on DB insert, nothing changed");\r
- }\r
- else\r
- {\r
- Chat->send(source, CHAT_DIRECT, "System", "NPC is now an allbuyer");\r
- }\r
- return;\r
-\r
- }\r
- else if(strncmp(tmp_npccommand, "additem", 7) == 0)\r
- {\r
- int tItemID = GetArgInt(3);\r
- int tPrice = GetArgInt(4);\r
- int tNPCID = targetNPC->GetNPCID();\r
- int tZoneID = source->GetChar()->GetLocation();\r
- const PDefItems* t_item = GameDefs->Items()->GetDef(tItemID);\r
- if(!t_item)\r
- {\r
- Chat->send(source, CHAT_DIRECT, "System", "Invalid ItemID");\r
- return;\r
- }\r
- char sqlq[200];\r
- snprintf(sqlq, 200, "INSERT INTO npc_shop (`c_npc_id`, `c_zoneid`, `c_itemid`, `c_itemprice`) VALUES (%d, %d, %d, %d)", tNPCID, tZoneID, tItemID, tPrice);\r
- if(MySQL->GameQuery(sqlq))\r
- {\r
- Chat->send(source, CHAT_DIRECT, "System", "Error on DB insert, item not added");\r
- }\r
- else\r
- {\r
- Chat->send(source, CHAT_DIRECT, "System", "Item added to shop");\r
- }\r
- return;\r
- }\r
- else if(strncmp(tmp_npccommand, "delitem", 7) == 0)\r
- {\r
- int tItemID = GetArgInt(3);\r
- int tNPCID = targetNPC->GetNPCID();\r
- int tZoneID = source->GetChar()->GetLocation();\r
- char sqlq[200];\r
- snprintf(sqlq, 200, "DELETE FROM npc_shop WHERE `c_npc_id` = %d and `c_zoneid` = %d and `c_itemid` = %d LIMIT 1", tNPCID, tZoneID, tItemID);\r
- if(MySQL->GameQuery(sqlq))\r
- {\r
- Chat->send(source, CHAT_DIRECT, "System", "Error on DB update, item not removed");\r
- }\r
- else\r
- {\r
- Chat->send(source, CHAT_DIRECT, "System", "Item removed from shop");\r
- }\r
- return;\r
- }\r
- else if(strncmp(tmp_npccommand, "setdefshop", 10) == 0)\r
- {\r
- int tNewTraderDef = GetArgInt(3);\r
- const PDefTrader* nTraderDef = GameDefs->Traders()->GetDef(tNewTraderDef);\r
-\r
- // Valid trader definition?\r
- if(!nTraderDef)\r
- {\r
- Chat->send(source, CHAT_DIRECT, "System", "Invalid Traderdef ID");\r
- return;\r
- }\r
-\r
- char sqlq[200];\r
- char sqlq2[200];\r
- bool success = false;\r
- snprintf(sqlq, 200, "UPDATE npc_spawns SET `npc_trader` = %d WHERE `npc_id` = %d", tNewTraderDef, targetNPC->GetNPCSQLID());\r
- if(!MySQL->GameQuery(sqlq))\r
- {\r
- snprintf(sqlq2, 200, "UPDATE npc_spawns SET `npc_trader` = 0 WHERE `npc_id` = %d", targetNPC->GetNPCSQLID());\r
- if(!MySQL->GameQuery(sqlq2))\r
- success = true;\r
- }\r
-\r
- if(success == true)\r
- {\r
- // Set new trader and remove existing shoplist\r
- targetNPC->SetTrader(tNewTraderDef);\r
- targetNPC->ReloadShopList();\r
- Chat->send(source, CHAT_DIRECT, "System", "NPC acts now as defined TraderShop");\r
- }\r
- else\r
- {\r
- Chat->send(source, CHAT_DIRECT, "System", "Error while removing shop");\r
- }\r
-\r
-\r
- return;\r
- }\r
- else if(strncmp(tmp_npccommand, "remove", 6) == 0)\r
- {\r
- int tZoneID = source->GetChar()->GetLocation();\r
- int tNPCID = targetNPC->GetNPCID();\r
- char sqlq[200];\r
- bool success = false;\r
- snprintf(sqlq, 200, "DELETE FROM npc_shop WHERE `c_npc_id` = %d and `c_zoneid` = %d", tNPCID, tZoneID);\r
- if(MySQL->GameQuery(sqlq))\r
- {\r
- snprintf(sqlq, 200, "UPDATE npc_spawns SET `npc_trader` = 0 WHERE `npc_id` = %d", targetNPC->GetNPCSQLID());\r
- if(MySQL->GameQuery(sqlq))\r
- success = false;\r
- else\r
- success = true;\r
- }\r
- if(success == true)\r
- {\r
- // Remove shoplist\r
- targetNPC->ReloadShopList();\r
- Chat->send(source, CHAT_DIRECT, "System", "Shop removed from NPC");\r
- }\r
- else\r
- {\r
- Chat->send(source, CHAT_DIRECT, "System", "Error while removing shop");\r
- }\r
-\r
-\r
- return;\r
- }\r
- else if(strncmp(tmp_npccommand, "reload", 6) == 0)\r
- {\r
- if(targetNPC->ReloadShopList() == true)\r
- {\r
- Chat->send(source, CHAT_DIRECT, "System", "Shoplist reload successfull");\r
- return;\r
- }\r
- else\r
- {\r
- Chat->send(source, CHAT_DIRECT, "System", "Shoplist reload failed");\r
- return;\r
- }\r
- }\r
- else if(strncmp(tmp_npccommand, "setquality", 10) == 0)\r
- {\r
- u8 tNewLv = (u8)GetArgInt(3);\r
- if(targetNPC->IsSQLNPC() == true)\r
- {\r
- char sqlq[200];\r
- snprintf(sqlq, 200, "UPDATE npc_spawns SET `npc_shop_quality` = %d WHERE `npc_id` = %d", tNewLv, targetNPC->GetNPCSQLID());\r
- if(MySQL->GameQuery(sqlq))\r
- {\r
- Chat->send(source, CHAT_DIRECT, "System", "Error while updating SQL. New quality will be lost on reload");\r
- }\r
- }\r
-\r
- if(targetNPC->SetShopQuality(tNewLv) == true)\r
- {\r
- char tBuff[100];\r
- snprintf(tBuff, 100, "Itemquality of this NPC is now %u", tNewLv);\r
- Chat->send(source, CHAT_DIRECT, "System", tBuff);\r
- return;\r
- }\r
- else\r
- {\r
- Chat->send(source, CHAT_DIRECT, "System", "Cannot set ItemQuality. (Make sure you entered 1-255 and NPC is loaded from SQL)");\r
- return;\r
- }\r
- }\r
- else\r
- {\r
- char buff[100];\r
- snprintf(buff, 100, "Unknown command: '%s'", tmp_npccommand);\r
- Chat->send(source, CHAT_DIRECT, "System", buff);\r
- return;\r
- }\r
-}\r
+/*
+ TinNS (TinNS is not a Neocron Server)
+ Copyright (C) 2005 Linux Addicted Community
+ maintainer Akiko <akiko@gmx.org>
+
+ 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 (at your option) 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, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
+*/
+#include "main.h"
+
+void PCommands::doNPC_Shop()
+{
+ bool SyntaxError = false;
+ if(ArgC < 2)
+ {
+ SyntaxError = true;
+ }
+
+ if(IsArgNumeric(1) == true)
+ {
+ target = GetClientByID(GetArgInt(1));
+ }
+ else
+ {
+ SyntaxError = true;
+ }
+
+ if(SyntaxError == true)
+ {
+ Chat->send(source, CHAT_DIRECT, "Usage", "@npcshop <worldID> <what>");
+ Chat->send(source, CHAT_DIRECT, "Usage", " <what> can be:");
+ Chat->send(source, CHAT_DIRECT, "setquality <1-255>", "Sets itemquality in shop");
+ Chat->send(source, CHAT_DIRECT, "additem <id> <price>", "Adds item <ID> with <Price>");
+ Chat->send(source, CHAT_DIRECT, "delitem <id>", "Removes item <ID>");
+ Chat->send(source, CHAT_DIRECT, "setdefshop <id>", "ID from trader.def; Use 0 to unset");
+ Chat->send(source, CHAT_DIRECT, "reload", "Reloads shop list");
+ Chat->send(source, CHAT_DIRECT, "remove", "Disables the shop");
+ Chat->send(source, CHAT_DIRECT, "setallbuyer", "Makes NPC an allbuyer (Yo's)");
+
+ /* more to add here... spawn, remove, ... */
+ return;
+ }
+
+ PNPC* targetNPC = NULL;
+ PNPCWorld* currentNPCWorld = NPCManager->GetWorld( source->GetChar()->GetLocation() );
+ if ( currentNPCWorld )
+ {
+ targetNPC = currentNPCWorld->GetNPC( GetArgInt(1) );
+ if(!targetNPC)
+ {
+ // Search for DEF version of NPC (remember, def IDs are on 255 offset!
+ // Note to myself: This is UGLY!!!! and BAD!!! but it works for now. CHANGE THIS!
+ targetNPC = currentNPCWorld->GetNPC( GetArgInt(1) - 255 );
+ }
+ }
+ if (!targetNPC)
+ {
+ Chat->send(source, CHAT_DIRECT, "System", "Invalid NPC ID");
+ return;
+ }
+
+ // Get subcommand
+ char tmp_npccommand[50];
+ GetArgText(2, tmp_npccommand, 50);
+
+ if(strncmp(tmp_npccommand, "setallbuyer", 11) == 0)
+ {
+ int tItemID = -1;
+ int tPrice = 0;
+ int tNPCID = targetNPC->GetNPCID();
+ int tZoneID = source->GetChar()->GetLocation();
+
+ char sqlq[200];
+ snprintf(sqlq, 200, "INSERT INTO npc_shop (`c_npc_id`, `c_zoneid`, `c_itemid`, `c_itemprice`) VALUES (%d, %d, %d, %d)", tNPCID, tZoneID, tItemID, tPrice);
+ if(MySQL->GameQuery(sqlq))
+ {
+ Chat->send(source, CHAT_DIRECT, "System", "Error on DB insert, nothing changed");
+ }
+ else
+ {
+ Chat->send(source, CHAT_DIRECT, "System", "NPC is now an allbuyer");
+ }
+ return;
+
+ }
+ else if(strncmp(tmp_npccommand, "additem", 7) == 0)
+ {
+ int tItemID = GetArgInt(3);
+ int tPrice = GetArgInt(4);
+ int tNPCID = targetNPC->GetNPCID();
+ int tZoneID = source->GetChar()->GetLocation();
+ const PDefItems* t_item = GameDefs->Items()->GetDef(tItemID);
+ if(!t_item)
+ {
+ Chat->send(source, CHAT_DIRECT, "System", "Invalid ItemID");
+ return;
+ }
+ char sqlq[200];
+ snprintf(sqlq, 200, "INSERT INTO npc_shop (`c_npc_id`, `c_zoneid`, `c_itemid`, `c_itemprice`) VALUES (%d, %d, %d, %d)", tNPCID, tZoneID, tItemID, tPrice);
+ if(MySQL->GameQuery(sqlq))
+ {
+ Chat->send(source, CHAT_DIRECT, "System", "Error on DB insert, item not added");
+ }
+ else
+ {
+ Chat->send(source, CHAT_DIRECT, "System", "Item added to shop");
+ }
+ return;
+ }
+ else if(strncmp(tmp_npccommand, "delitem", 7) == 0)
+ {
+ int tItemID = GetArgInt(3);
+ int tNPCID = targetNPC->GetNPCID();
+ int tZoneID = source->GetChar()->GetLocation();
+ char sqlq[200];
+ snprintf(sqlq, 200, "DELETE FROM npc_shop WHERE `c_npc_id` = %d and `c_zoneid` = %d and `c_itemid` = %d LIMIT 1", tNPCID, tZoneID, tItemID);
+ if(MySQL->GameQuery(sqlq))
+ {
+ Chat->send(source, CHAT_DIRECT, "System", "Error on DB update, item not removed");
+ }
+ else
+ {
+ Chat->send(source, CHAT_DIRECT, "System", "Item removed from shop");
+ }
+ return;
+ }
+ else if(strncmp(tmp_npccommand, "setdefshop", 10) == 0)
+ {
+ int tNewTraderDef = GetArgInt(3);
+ const PDefTrader* nTraderDef = GameDefs->Traders()->GetDef(tNewTraderDef);
+
+ // Valid trader definition?
+ if(!nTraderDef)
+ {
+ Chat->send(source, CHAT_DIRECT, "System", "Invalid Traderdef ID");
+ return;
+ }
+
+ char sqlq[200];
+ char sqlq2[200];
+ bool success = false;
+ snprintf(sqlq, 200, "UPDATE npc_spawns SET `npc_trader` = %d WHERE `npc_id` = %d", tNewTraderDef, targetNPC->GetNPCSQLID());
+ if(!MySQL->GameQuery(sqlq))
+ {
+ snprintf(sqlq2, 200, "UPDATE npc_spawns SET `npc_trader` = 0 WHERE `npc_id` = %d", targetNPC->GetNPCSQLID());
+ if(!MySQL->GameQuery(sqlq2))
+ success = true;
+ }
+
+ if(success == true)
+ {
+ // Set new trader and remove existing shoplist
+ targetNPC->SetTrader(tNewTraderDef);
+ targetNPC->ReloadShopList();
+ Chat->send(source, CHAT_DIRECT, "System", "NPC acts now as defined TraderShop");
+ }
+ else
+ {
+ Chat->send(source, CHAT_DIRECT, "System", "Error while removing shop");
+ }
+
+
+ return;
+ }
+ else if(strncmp(tmp_npccommand, "remove", 6) == 0)
+ {
+ int tZoneID = source->GetChar()->GetLocation();
+ int tNPCID = targetNPC->GetNPCID();
+ char sqlq[200];
+ bool success = false;
+ snprintf(sqlq, 200, "DELETE FROM npc_shop WHERE `c_npc_id` = %d and `c_zoneid` = %d", tNPCID, tZoneID);
+ if(MySQL->GameQuery(sqlq))
+ {
+ snprintf(sqlq, 200, "UPDATE npc_spawns SET `npc_trader` = 0 WHERE `npc_id` = %d", targetNPC->GetNPCSQLID());
+ if(MySQL->GameQuery(sqlq))
+ success = false;
+ else
+ success = true;
+ }
+ if(success == true)
+ {
+ // Remove shoplist
+ targetNPC->ReloadShopList();
+ Chat->send(source, CHAT_DIRECT, "System", "Shop removed from NPC");
+ }
+ else
+ {
+ Chat->send(source, CHAT_DIRECT, "System", "Error while removing shop");
+ }
+
+
+ return;
+ }
+ else if(strncmp(tmp_npccommand, "reload", 6) == 0)
+ {
+ if(targetNPC->ReloadShopList() == true)
+ {
+ Chat->send(source, CHAT_DIRECT, "System", "Shoplist reload successfull");
+ return;
+ }
+ else
+ {
+ Chat->send(source, CHAT_DIRECT, "System", "Shoplist reload failed");
+ return;
+ }
+ }
+ else if(strncmp(tmp_npccommand, "setquality", 10) == 0)
+ {
+ u8 tNewLv = (u8)GetArgInt(3);
+ if(targetNPC->IsSQLNPC() == true)
+ {
+ char sqlq[200];
+ snprintf(sqlq, 200, "UPDATE npc_spawns SET `npc_shop_quality` = %d WHERE `npc_id` = %d", tNewLv, targetNPC->GetNPCSQLID());
+ if(MySQL->GameQuery(sqlq))
+ {
+ Chat->send(source, CHAT_DIRECT, "System", "Error while updating SQL. New quality will be lost on reload");
+ }
+ }
+
+ if(targetNPC->SetShopQuality(tNewLv) == true)
+ {
+ char tBuff[100];
+ snprintf(tBuff, 100, "Itemquality of this NPC is now %u", tNewLv);
+ Chat->send(source, CHAT_DIRECT, "System", tBuff);
+ return;
+ }
+ else
+ {
+ Chat->send(source, CHAT_DIRECT, "System", "Cannot set ItemQuality. (Make sure you entered 1-255 and NPC is loaded from SQL)");
+ return;
+ }
+ }
+ else
+ {
+ char buff[100];
+ snprintf(buff, 100, "Unknown command: '%s'", tmp_npccommand);
+ Chat->send(source, CHAT_DIRECT, "System", buff);
+ return;
+ }
+}
return;\r
}\r
\r
- ifstream::pos_type size;\r
+ std::ifstream::pos_type size;\r
char *buffer;\r
\r
- ifstream hexdump (file_to_send, ios::in|ios::binary|ios::ate);\r
+ std::ifstream hexdump (file_to_send, std::ios::in | std::ios::binary | std::ios::ate);\r
if (hexdump.is_open())\r
{\r
if (gDevDebug) Console->Print("IngameCommand: Sending packet file %s", file_to_send);\r
\r
size = hexdump.tellg();\r
buffer = new char [size];\r
- hexdump.seekg (0, ios::beg);\r
+ hexdump.seekg (0, std::ios::beg);\r
\r
hexdump.read (buffer, size);\r
hexdump.close();\r
-/*
- TinNS (TinNS is not a Neocron Server)
- Copyright (C) 2005 Linux Addicted Community
- maintainer Akiko <akiko@gmx.org>
-
- 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 (at your option) 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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
-*/
-#include "main.h"
-
-void PCommands::doCmdsetlevel()
-{
- int destLevel = 0;
- bool SyntaxError = false;
- if (ArgC < 2)
- {
- SyntaxError = true;
- }
-
- if (IsArgNumeric(2) == false)
- {
- SyntaxError = true;
- }
- else
- {
- destLevel = GetArgInt(2);
- }
-
- if (SyntaxError == true)
- {
- Chat->send(source, CHAT_DIRECT, "Usage", "@setlevel <charID or nickname> <newlevel 1-99>");
- return;
- }
-
- if (IsArgNumeric(1) == true)
- {
- target = GetClientByID(GetArgInt(1));
- }
- else
- {
- char tmp_destNick[50];
- GetArgText(1, tmp_destNick, 50);
- target = GetClientByNick(tmp_destNick);
- }
-
- if (target == NULL) // If victim isnt found, return error
- {
- Chat->send(source, CHAT_DIRECT, "System", "No such player");
- return;
- }
- if (source->GetAccountLevel() <= target->GetAccountLevel())
- {
- char tmpMsg[200];
- snprintf(tmpMsg, 199, "Cant set new level for %s, target level is higher or equal to yours!", Chars->GetChar(target->GetCharID())->GetName().c_str());
- tmpMsg[199] = '\0';
- Chat->send(source, CHAT_DIRECT, "System", tmpMsg);
- return;
- }
-
- PAccount Acc(target->GetAccountID());
- Acc.SetLevel(destLevel);
- Acc.Save();
- source->RefreshAccountInfo(&Acc);
-
- char tmpMsg[60], tmpMsg2[60];
- snprintf(tmpMsg, 59, "Set level for player %s to %d", Chars->GetChar(target->GetCharID())->GetName().c_str(), destLevel);
- snprintf(tmpMsg2, 59, "**POOF** Your new accesslevel is now %d", destLevel);
-
- tmpMsg[59] = '\0';
- tmpMsg2[59] = '\0';
-
- Chat->send(source, CHAT_DIRECT, "System", tmpMsg);
- Chat->send(target, CHAT_DIRECT, "System", tmpMsg2);
-}
+/*\r
+ TinNS (TinNS is not a Neocron Server)\r
+ Copyright (C) 2005 Linux Addicted Community\r
+ maintainer Akiko <akiko@gmx.org>\r
+\r
+ This program is free software; you can redistribute it and/or\r
+ modify it under the terms of the GNU General Public License\r
+ as published by the Free Software Foundation; either version 2\r
+ of the License, or (at your option) any later version.\r
+\r
+ This program is distributed in the hope that it will be useful,\r
+ but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ GNU General Public License for more details.\r
+\r
+ You should have received a copy of the GNU General Public License\r
+ along with this program; if not, write to the Free Software\r
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
+ 02110-1301, USA.\r
+*/\r
+#include "main.h"\r
+\r
+void PCommands::doCmdsetlevel()\r
+{\r
+ int destLevel = 0;\r
+ bool SyntaxError = false;\r
+ if (ArgC < 2)\r
+ {\r
+ SyntaxError = true;\r
+ }\r
+\r
+ if (IsArgNumeric(2) == false)\r
+ {\r
+ SyntaxError = true;\r
+ }\r
+ else\r
+ {\r
+ destLevel = GetArgInt(2);\r
+ }\r
+\r
+ if (SyntaxError == true)\r
+ {\r
+ Chat->send(source, CHAT_DIRECT, "Usage", "@setlevel <charID or nickname> <newlevel 1-99>");\r
+ return;\r
+ }\r
+\r
+ if (IsArgNumeric(1) == true)\r
+ {\r
+ target = GetClientByID(GetArgInt(1));\r
+ }\r
+ else\r
+ {\r
+ char tmp_destNick[50];\r
+ GetArgText(1, tmp_destNick, 50);\r
+ target = GetClientByNick(tmp_destNick);\r
+ }\r
+\r
+ if (target == NULL) // If victim isnt found, return error\r
+ {\r
+ Chat->send(source, CHAT_DIRECT, "System", "No such player");\r
+ return;\r
+ }\r
+ if (source->GetAccountLevel() <= target->GetAccountLevel())\r
+ {\r
+ char tmpMsg[200];\r
+ snprintf(tmpMsg, 199, "Cant set new level for %s, target level is higher or equal to yours!", Chars->GetChar(target->GetCharID())->GetName().c_str());\r
+ tmpMsg[199] = '\0';\r
+ Chat->send(source, CHAT_DIRECT, "System", tmpMsg);\r
+ return;\r
+ }\r
+\r
+ PAccount Acc(target->GetAccountID());\r
+ Acc.SetLevel(destLevel);\r
+ Acc.Save();\r
+ source->RefreshAccountInfo(&Acc);\r
+\r
+ char tmpMsg[60], tmpMsg2[60];\r
+ snprintf(tmpMsg, 59, "Set level for player %s to %d", Chars->GetChar(target->GetCharID())->GetName().c_str(), destLevel);\r
+ snprintf(tmpMsg2, 59, "**POOF** Your new accesslevel is now %d", destLevel);\r
+\r
+ tmpMsg[59] = '\0';\r
+ tmpMsg2[59] = '\0';\r
+\r
+ Chat->send(source, CHAT_DIRECT, "System", tmpMsg);\r
+ Chat->send(target, CHAT_DIRECT, "System", tmpMsg2);\r
+}\r
/*
- TinNS (TinNS is not a Neocron Server)
- Copyright (C) 2005 Linux Addicted Community
- maintainer Akiko <akiko@gmx.org>
+ TinNS (TinNS is not a Neocron Server)
+ Copyright (C) 2005 Linux Addicted Community
+ maintainer Akiko <akiko@gmx.org>
- 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 (at your option) any later version.
+ 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 (at your option) 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.
+ 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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
*/
#include "main.h"
/*
- TinNS (TinNS is not a Neocron Server)
- Copyright (C) 2005 Linux Addicted Community
- maintainer Akiko <akiko@gmx.org>
-
- 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 (at your option) 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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
+ TinNS (TinNS is not a Neocron Server)
+ Copyright (C) 2005 Linux Addicted Community
+ maintainer Akiko <akiko@gmx.org>
+
+ 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 (at your option) 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, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
*/
#include "main.h"
/*\r
- TinNS (TinNS is not a Neocron Server)\r
- Copyright (C) 2005 Linux Addicted Community\r
-\r
- This program is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU General Public License\r
- as published by the Free Software Foundation; either version 2\r
- of the License, or (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
- 02110-1301, USA.\r
+ TinNS (TinNS is not a Neocron Server)\r
+ Copyright (C) 2005 Linux Addicted Community\r
+\r
+ This program is free software; you can redistribute it and/or\r
+ modify it under the terms of the GNU General Public License\r
+ as published by the Free Software Foundation; either version 2\r
+ of the License, or (at your option) any later version.\r
+\r
+ This program is distributed in the hope that it will be useful,\r
+ but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ GNU General Public License for more details.\r
+\r
+ You should have received a copy of the GNU General Public License\r
+ along with this program; if not, write to the Free Software\r
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
+ 02110-1301, USA.\r
*/\r
\r
\r
\r
/*\r
-\r
- gameserver.cpp - main file of the gameserver\r
-\r
- MODIFIED: 31 Aug 2005 Akiko\r
- REASON: - added modifications by "Sting" to get a running gameserver again\r
- - added this header\r
- MODIFIED: 28 Sep 2005 Akiko\r
- REASON: - define for game server port\r
- MODIFIED: 29 Sep 2005 Sting (modified by Akiko)\r
- REASON: - configurable UDP port for testing\r
- - tidied up/corrected packet sent with most character stats (character now has monk stats for testing)\r
- MODIFIED: 27 Nov 2005 Akiko\r
- REASON: - added Namikons fix (IPStringToDWord)\r
- - added bluehrs packet fix\r
- MODIFIED: 17 Dec 2005 bakkdoor\r
- REASON: - Due the new structure for chatsystem, changed\r
- HandleGameChat(Client, Packet);\r
- to\r
- Chat->HandleGameChat(Client, Packet);\r
- - Also added ClientManager->addClientToList and ClientManager->deleteClientFromList()\r
- (check Update() & FinalizeClient())\r
- MODIFIED: 18 Dec 2005 Namikon\r
- REASON: - Fixed several small issues in the main-packet if-clause (sizeof(<char>), etc)\r
- MODIFIED: 21 Dec 2005 Namikon\r
- REASON: - Fixed zoning (for now). The basic packet is broken somehow, still working on that\r
- MODIFIED: 25 Dec 2005 Namikon\r
- REASON: - Basepacket 1 and 2 fixed. (Thanks to MaxxJag!)\r
- Zoning still works, same goes for skills/factions.\r
- Not sure about quickbelt and inventory, but it seems to be ok\r
- MODIFIED: 26 Dec 2005 Namikon\r
- REASON: - Added doors\r
- - Added support for Worlditem usage (Gogo/Genrep/Appitem/...)\r
- MODIFIED: 01 Jan 2006 Namikon\r
- REASON: - Changed FmtTxt() to sprintf(). It does... uhm, the same :D\r
- - Added SetOnlineStatus to do instand updates when char is logging in\r
- MODIFIED: 02 Jan 2006 Namikon\r
- REASON: - Added debug output function\r
- MODIFIED: 06 Jan 2006 Namikon\r
- REASON: - Added color to console outputs\r
- MODIFIED: 01 Jul 2006 hammag\r
- REASON: - added set timeout to 10 msec (for ReadSetTCP select) in Start()\r
- to avoid useless 100% CPU use\r
- MODIFIED: 30 Jul 2006 hammag\r
- REASON: - Fixed 0x13 0x03 0x1F message filters to enable other char than ID 1 to play ... :P\r
- MODIFIED: 12 Aug 2006 hammag\r
- REASON: - Fixed BuildCharPosUpdateMsg() to send correct characters orientation to other characters\r
- MODIFIED: 26 Aug 2006 hammag\r
- REASON: - removed use of GAME_PORT define as this info is available in Config object with a default value\r
- MODIFIED: 17 Sep 2006 hammag\r
- REASON: - Moved all UDP message management code to decoder classes\r
- - Removed corresponding code from gameserver.cpp & .h\r
-\r
- MODIFIED: 03 Oct 2006 hammag\r
- REASON: - Added some more DB cleanup when a char is deleted (still incomplete and will later be done in PChar::SQLDelete() )\r
- MODIFIED: 10 Dec 2006 Namikon\r
- REASON: - Added new variable "mServerStartupTime". Holds the unix timestamp uppon startup. Required for @uptime\r
- and other time-based stuff\r
-\r
- TODO:\r
- - Deny login if char is already online (More information about the login procedure is necessary to do that)\r
- - Take main loop timeout setting from config file\r
- - Add Regex control to new char name validation\r
- - Add Check of Char offline (and unloaded) before deleting (from the char choosing i/f) if multiple login allowed for the same account\r
- - Check if adding to Client to Client manager shouldn't be done only one UDP connection done ?\r
+ gameserver.cpp - main file of the gameserver\r
+\r
+ MODIFIED: 31 Aug 2005 Akiko\r
+ REASON: - added modifications by "Sting" to get a running gameserver again\r
+ - added this header\r
+ MODIFIED: 28 Sep 2005 Akiko\r
+ REASON: - define for game server port\r
+ MODIFIED: 29 Sep 2005 Sting (modified by Akiko)\r
+ REASON: - configurable UDP port for testing\r
+ - tidied up/corrected packet sent with most character stats (character now has monk stats for testing)\r
+ MODIFIED: 27 Nov 2005 Akiko\r
+ REASON: - added Namikons fix (IPStringToDWord)\r
+ - added bluehrs packet fix\r
+ MODIFIED: 17 Dec 2005 bakkdoor\r
+ REASON: - Due the new structure for chatsystem, changed HandleGameChat(Client, Packet);\r
+ to Chat->HandleGameChat(Client, Packet);\r
+ - Also added ClientManager->addClientToList and ClientManager->deleteClientFromList()\r
+ (check Update() & FinalizeClient())\r
+ MODIFIED: 18 Dec 2005 Namikon\r
+ REASON: - Fixed several small issues in the main-packet if-clause (sizeof(<char>), etc)\r
+ MODIFIED: 21 Dec 2005 Namikon\r
+ REASON: - Fixed zoning (for now). The basic packet is broken somehow, still working on that\r
+ MODIFIED: 25 Dec 2005 Namikon\r
+ REASON: - Basepacket 1 and 2 fixed. (Thanks to MaxxJag!)\r
+ - Zoning still works, same goes for skills/factions.\r
+ - Not sure about quickbelt and inventory, but it seems to be ok\r
+ MODIFIED: 26 Dec 2005 Namikon\r
+ REASON: - Added doors\r
+ - Added support for Worlditem usage (Gogo/Genrep/Appitem/...)\r
+ MODIFIED: 01 Jan 2006 Namikon\r
+ REASON: - Changed FmtTxt() to sprintf(). It does... uhm, the same :D\r
+ - Added SetOnlineStatus to do instand updates when char is logging in\r
+ MODIFIED: 02 Jan 2006 Namikon\r
+ REASON: - Added debug output function\r
+ MODIFIED: 06 Jan 2006 Namikon\r
+ REASON: - Added color to console outputs\r
+ MODIFIED: 01 Jul 2006 hammag\r
+ REASON: - added set timeout to 10 msec (for ReadSetTCP select) in Start() to avoid useless 100% CPU use\r
+ MODIFIED: 30 Jul 2006 hammag\r
+ REASON: - Fixed 0x13 0x03 0x1F message filters to enable other char than ID 1 to play ... :P\r
+ MODIFIED: 12 Aug 2006 hammag\r
+ REASON: - Fixed BuildCharPosUpdateMsg() to send correct characters orientation to other characters\r
+ MODIFIED: 26 Aug 2006 hammag\r
+ REASON: - removed use of GAME_PORT define as this info is available in Config object with a default value\r
+ MODIFIED: 17 Sep 2006 hammag\r
+ REASON: - Moved all UDP message management code to decoder classes\r
+ - Removed corresponding code from gameserver.cpp & .h\r
+ MODIFIED: 03 Oct 2006 hammag\r
+ REASON: - Added some more DB cleanup when a char is deleted (still incomplete and will later be done in PChar::SQLDelete() )\r
+ MODIFIED: 10 Dec 2006 Namikon\r
+ REASON: - Added new variable "mServerStartupTime". Holds the unix timestamp uppon startup. Required for @uptime\r
+ and other time-based stuff\r
+ MODIFIED: 09 Jun 2009 Akiko\r
+ REASON: - adjusted includes for new buildsystem\r
+ - clean ups\r
+\r
+ TODO:\r
+ - Deny login if char is already online (More information about the login procedure is necessary to do that)\r
+ - Take main loop timeout setting from config file\r
+ - Add Regex control to new char name validation\r
+ - Add Check of Char offline (and unloaded) before deleting (from the char choosing i/f) if multiple login\r
+ allowed for the same account\r
+ - Check if adding to Client to Client manager shouldn't be done only one UDP connection done ?\r
=> Risk of sending UDP chat on non-socket ????\r
*/\r
\r
\r
#include "main.h"\r
\r
-#include "msgdecoder.h"\r
-#include "msgbuilder.h"\r
-#include "appartements.h"\r
+#include "include/msgdecoder.h"\r
+#include "include/msgbuilder.h"\r
+#include "include/appartements.h"\r
\r
\r
PGameServer::PGameServer()\r
/*\r
- TinNS (TinNS is not a Neocron Server)\r
- Copyright (C) 2005 Linux Addicted Community\r
-\r
- This program is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU General Public License\r
- as published by the Free Software Foundation; either version 2\r
- of the License, or (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
- 02110-1301, USA.\r
+ TinNS (TinNS is not a Neocron Server)\r
+ Copyright (C) 2005 Linux Addicted Community\r
+\r
+ This program is free software; you can redistribute it and/or\r
+ modify it under the terms of the GNU General Public License\r
+ as published by the Free Software Foundation; either version 2\r
+ of the License, or (at your option) any later version.\r
+\r
+ This program is distributed in the hope that it will be useful,\r
+ but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ GNU General Public License for more details.\r
+\r
+ You should have received a copy of the GNU General Public License\r
+ along with this program; if not, write to the Free Software\r
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
+ 02110-1301, USA.\r
*/\r
\r
\r
\r
/*\r
- genreplist.cpp - classe for character genrep list\r
-\r
- MODIFIED: 20 Sep 2006 Hammag\r
- REASON: - creation\r
+ genreplist.cpp - classe for character genrep list\r
\r
+ MODIFIED: 20 Sep 2006 Hammag\r
+ REASON: - creation\r
+ MODIFIED: 09 Jun 2009 Akiko\r
+ REASON: - adjusted includes for new buildsystem\r
+ - clean ups\r
*/\r
\r
#include "main.h"\r
-#include "genreplist.h"\r
+\r
+#include "include/genreplist.h"\r
\r
PGenrepList::PGenrepList(u32 nOwnerCharID)\r
{\r
/*\r
- TinNS (TinNS is not a Neocron Server)\r
- Copyright (C) 2005 Linux Addicted Community\r
- maintainer Akiko <akiko@gmx.org>\r
-\r
- This program is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU General Public License\r
- as published by the Free Software Foundation; either version 2\r
- of the License, or (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
- 02110-1301, USA.\r
+ TinNS (TinNS is not a Neocron Server)\r
+ Copyright (C) 2005 Linux Addicted Community\r
+ maintainer Akiko <akiko@gmx.org>\r
+\r
+ This program is free software; you can redistribute it and/or\r
+ modify it under the terms of the GNU General Public License\r
+ as published by the Free Software Foundation; either version 2\r
+ of the License, or (at your option) any later version.\r
+\r
+ This program is distributed in the hope that it will be useful,\r
+ but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ GNU General Public License for more details.\r
+\r
+ You should have received a copy of the GNU General Public License\r
+ along with this program; if not, write to the Free Software\r
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
+ 02110-1301, USA.\r
*/\r
\r
/*\r
- globals.cpp\r
-\r
- MODIFIED: 12 September 2005 Akiko\r
- REASON: - exchanged Pretender strings by TinNS\r
- MODIFIED: 16 Dec 2005 bakkdoor\r
- REASON: - Added global ClientManager and Chat Interface\r
- MODIFIED: 22 Dec 2005 Namikon\r
- REASON: - Added GPL\r
- MODIFIED: 25 Dec 2005 Namikon\r
- REASON: - Added MySQL Support\r
- - Fixed ShutdownTinns (Wont cause segmentation fault anymore)\r
- MODIFIED: 06 Jan 2006 Namikon\r
- REASON: - Added color to console outputs\r
- - Added shiny and colored copyright box :D\r
- MODIFIED: 22 Jul 2006 Hammag\r
- REASON: - Added Server NOT NULL check to avoid segfault when shuting down during startup\r
- MODIFIED: 27 Aug 2006 Hammag\r
- REASON: - Implemented shared Config class use and config template to load conf.\r
- Added gameserver configtemplate.h include,\r
- Added new required parameters to Config->LoadOptions()\r
- MODIFIED: 02 Oct 2006 Hammag\r
- REASON: - Added gDevDebug global flag to control development debug outputs (flagged messaged, dump-flagged messes, dev console->print)\r
-\r
- TODO: - Get logfile name from config file\r
+ globals.cpp\r
+\r
+ MODIFIED: 12 September 2005 Akiko\r
+ REASON: - exchanged Pretender strings by TinNS\r
+ MODIFIED: 16 Dec 2005 bakkdoor\r
+ REASON: - Added global ClientManager and Chat Interface\r
+ MODIFIED: 22 Dec 2005 Namikon\r
+ REASON: - Added GPL\r
+ MODIFIED: 25 Dec 2005 Namikon\r
+ REASON: - Added MySQL Support\r
+ - Fixed ShutdownTinns (Wont cause segmentation fault anymore)\r
+ MODIFIED: 06 Jan 2006 Namikon\r
+ REASON: - Added color to console outputs\r
+ - Added shiny and colored copyright box :D\r
+ MODIFIED: 22 Jul 2006 Hammag\r
+ REASON: - Added Server NOT NULL check to avoid segfault when shuting down during startup\r
+ MODIFIED: 27 Aug 2006 Hammag\r
+ REASON: - Implemented shared Config class use and config template to load conf.\r
+ - Added gameserver configtemplate.h include,\r
+ - Added new required parameters to Config->LoadOptions()\r
+ MODIFIED: 02 Oct 2006 Hammag\r
+ REASON: - Added gDevDebug global flag to control development debug outputs (flagged messaged,\r
+ dump-flagged messes, dev console->print)\r
+ MODIFIED: 09 Jun 2009 Akiko\r
+ REASON: - adjusted includes for buildsystem\r
+ - clean ups\r
+\r
+ TODO: - Get logfile name from config file\r
*/\r
\r
+\r
#include "main.h"\r
+\r
#include "configtemplate.h"\r
-#include "isc.h"\r
+#include "include/isc.h"\r
+\r
+#include "include/msgbuilder.h"\r
+#include "include/worlds.h"\r
+#include "include/appartements.h"\r
+#include "include/npc.h"\r
+#include "include/subway.h"\r
+#include "include/terminal.h"\r
+\r
+#include "include/version.h"\r
\r
-#include "msgbuilder.h"\r
-#include "worlds.h"\r
-#include "appartements.h"\r
-#include "npc.h"\r
-#include "subway.h"\r
-#include "terminal.h"\r
\r
-#include "version.h"\r
const char ServerVersion[] = TINNS_GAME_VERSION;\r
const char SVNRevision[] = TINNS_SVN_REVISION;\r
\r
PNPCManager* NPCManager = 0;\r
PSubway* Subway = 0;\r
PTerminal* Terminal = 0;\r
-PLuaEngine* LuaEngine = 0;
-POutpost* Outposts = 0;
+PLuaEngine* LuaEngine = 0;\r
+POutpost* Outposts = 0;\r
PMultiPart* MultiPartHandler = 0;\r
\r
//multi-user chat implementation\r
Worlds->LoadWorlds();\r
\r
WorldActors = new PWorldActors();\r
- LuaEngine = new PLuaEngine();\r
+ LuaEngine = new PLuaEngine();\r
\r
NPCManager = new PNPCManager();\r
Appartements = new PAppartements;\r
Console->Print("%s Could not creat password_filter PCRE '%s'", Console->ColorText(RED, BLACK, "[Error]"), Config->GetOption("password_filter").c_str());\r
return false;\r
}\r
-\r
+ \r
if (!PChar::SetCharnameRegexFilter(Config->GetOption("charname_filter").c_str()))\r
{\r
Console->Print("%s Could not creat charname_filter PCRE '%s'", Console->ColorText(RED, BLACK, "[Error]"), Config->GetOption("charname_filter").c_str());\r
return false;\r
}\r
Chars = new PChars();\r
-\r
+ \r
ServerSock = new ServerSocket();\r
Server = new PServer();\r
GameServer = new PGameServer();\r
\r
ISC = new PISC();\r
Terminal = new PTerminal();\r
-
- Outposts = new POutpost();
-
- MultiPartHandler = new PMultiPart();
+\r
+ Outposts = new POutpost();\r
+\r
+ MultiPartHandler = new PMultiPart();\r
\r
return true;\r
}\r
\r
void Shutdown()\r
-{
- if(MultiPartHandler)
- delete MultiPartHandler;
- if(Outposts)
+{\r
+ if(MultiPartHandler)\r
+ delete MultiPartHandler;\r
+ if(Outposts)\r
delete Outposts;\r
if(LuaEngine)\r
delete LuaEngine;\r
REASON: - Added bool var for ingame debug outputs for administrators\r
MODIFIED: 06 Jan 2005 Namikon\r
REASON: - Added SetBannedStatus(<unix timestamp>) to ban/unban an account (use SetBannedStatus(0) to unban a player)\r
+ MODIFIED: 09 Jun 2009 Akiko\r
+ REASON: - adjusted includes for new buildsystem\r
*/\r
\r
#ifndef ACCOUNTS_H\r
#pragma once\r
#endif\r
\r
-#include "regex++.h"\r
+#include "common/regex++.h"\r
\r
/*\r
0 = unregistered user\r
#define PAL_UNREGPLAYER 0\r
#define PAL_REGPLAYER 1\r
#define PAL_VOLUNTEER 30 // Special Rank: 50/50\r
-#define PAL_GM 50 // Special Rank: 120/120\r
-#define PAL_ADMIN 100 // Special Rank: 127/127\r
+#define PAL_GM 50 // Special Rank: 120/120\r
+#define PAL_ADMIN 100 // Special Rank: 127/127\r
\r
// Max number of char slots per account\r
#define MAX_CHARS_PER_ACCOUNT 4\r
PAS_ONLINE = 1,\r
PAS_BANNED = 2\r
};\r
-\r
+ \r
class PAccount\r
{\r
private :\r
a_status,\r
a_bandate\r
};\r
-\r
+ \r
// static members\r
static RegEx* mUsernameRegexFilter;\r
static RegEx* mPasswordRegexFilter;\r
-\r
+ \r
// instance members\r
u32 mID;\r
std::string mName;\r
\r
bool LoadFromQuery(char* query);\r
bool DecodePassword(const u8* PasswordData, int PassLen, const u8 *Key, char* ClearPassword);\r
-\r
+ \r
public :\r
PAccount();\r
PAccount(const u32 AccountId);\r
PAccount(const char *Username);\r
-\r
+ \r
static bool SetUsernameRegexFilter(const char* RegexStr);\r
static bool SetPasswordRegexFilter(const char* RegexStr);\r
static bool IsUsernameWellFormed(const char *Username);\r
static bool IsPasswordWellFormed(const char *Password);\r
-\r
+ \r
inline u32 GetID() const { return mID; }\r
bool SetName(const std::string &Pass);\r
inline const std::string &GetName() const { return mName; }\r
\r
bool Authenticate(const u8* PasswordData, int PassLen, const u8 *Key);\r
bool Authenticate(const char *Password) const;\r
-\r
+ \r
bool Create();\r
bool Save(bool CreateMode = false);\r
\r
/*\r
- TinNS (TinNS is not a Neocron Server)\r
- Copyright (C) 2005 Linux Addicted Community\r
- maintainer Akiko <akiko@gmx.org>\r
-\r
- This program is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU General Public License\r
- as published by the Free Software Foundation; either version 2\r
- of the License, or (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
- 02110-1301, USA.\r
+ TinNS (TinNS is not a Neocron Server)\r
+ Copyright (C) 2005 Linux Addicted Community\r
+ maintainer Akiko <akiko@gmx.org>\r
+\r
+ This program is free software; you can redistribute it and/or\r
+ modify it under the terms of the GNU General Public License\r
+ as published by the Free Software Foundation; either version 2\r
+ of the License, or (at your option) any later version.\r
+\r
+ This program is distributed in the hope that it will be useful,\r
+ but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ GNU General Public License for more details.\r
+\r
+ You should have received a copy of the GNU General Public License\r
+ along with this program; if not, write to the Free Software\r
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
+ 02110-1301, USA.\r
*/\r
\r
\r
\r
/*\r
- chars.h - this is the main file with the main function\r
-\r
- Authors:\r
- - Namikon\r
-\r
- MODIFIED: 22 Dec 2005 Namikon\r
- REASON: - Added GPL\r
- MODIFIED: 01 Jan 2006 Namikon\r
- REASON: - Added SQLLoad() function to PChar and PChars\r
- - Added enum for charlist SQL Database\r
- - Added IsOnline var and inline func for Onlinestatus of char\r
- MODIFIED: 26 Jul 2006 Namikon\r
- REASON: - Added Health/MaxHealth, idem for Mana & Stamin\r
- TODO: - fix real current Health vs MaxHealth, also in char load/save\r
-\r
- MODIFIED: 03 Oct 2006 Hammag\r
- REASON: - PChar::CreateNewChar() and moved effective char creation from PChars to PChar\r
- - added PChar::SQLDelete()\r
- This method is put here because we want the char to be loaded when deleted from DB to avoid\r
- any player to use it at the same time.\r
- - added use of auto_save_period config option in PChars::update()\r
-\r
+ chars.h - this is the main file with the main function\r
+\r
+ Authors:\r
+ - Namikon\r
+ - Akiko\r
+\r
+ MODIFIED: 22 Dec 2005 Namikon\r
+ REASON: - Added GPL\r
+ MODIFIED: 01 Jan 2006 Namikon\r
+ REASON: - Added SQLLoad() function to PChar and PChars\r
+ - Added enum for charlist SQL Database\r
+ - Added IsOnline var and inline func for Onlinestatus of char\r
+ MODIFIED: 26 Jul 2006 Namikon\r
+ REASON: - Added Health/MaxHealth, idem for Mana & Stamin\r
+ TODO: - fix real current Health vs MaxHealth, also in char load/save\r
+\r
+ MODIFIED: 03 Oct 2006 Hammag\r
+ REASON: - PChar::CreateNewChar() and moved effective char creation from PChars to PChar\r
+ - added PChar::SQLDelete()\r
+ This method is put here because we want the char to be loaded when deleted from DB to avoid\r
+ any player to use it at the same time.\r
+ - added use of auto_save_period config option in PChars::update()\r
+ MODIFIED: 09 Jun 2009 Akiko\r
+ REASON: - adjusted includes for new build system\r
+ - clean ups\r
*/\r
\r
#ifndef CHARS_H\r
#include "inventory.h"\r
#include "buddylist.h"\r
#include "genreplist.h"\r
-#include "regex++.h"\r
+#include "common/regex++.h"\r
class PVhcAccessRequestList;\r
\r
enum PSeatType\r
//inline PCharCoordinates() { mX = mY = mZ = mUD = mLR = mAct = mUnknown = mJumpingState = 0;}\r
void SetPosition( u16 nY, u16 nZ, u16 nX, u8 nUD = 0x80, u8 nLR = 0 );\r
void SetInterpolate( PCharCoordinates& Pos1, PCharCoordinates& Pos2, f32 nCoef );\r
-\r
+ \r
//Temp\r
u16 minPos[3];\r
u16 maxPos[3];\r
private :\r
// static members\r
static RegEx* mCharnameRegexFilter;\r
-
+\r
// instance members\r
u32 mID;\r
u32 mAccount;\r
\r
u16 mLookingAt; // Zone charID of currently targeted player\r
std::time_t mLookAtTimestamp; // Lifetimer of lookat var\r
- u32 mLastUsedWorldObjectId; // Last world object clicked on
-
- u8 mClanLevel; // 1-15
+ u32 mLastUsedWorldObjectId; // Last world object clicked on\r
+\r
+ u8 mClanLevel; // 1-15\r
u16 mClanID;\r
\r
bool mIsOnline;\r
\r
inline u32 GetCash() const { return mCash; }\r
u32 SetCash( u32 nCash ); // Does return the new cashvalue, NO udpmessage is sent out!!\r
- u32 AddCash( u32 nAmount );\r
- u32 TakeCash( u32 nAmount );\r
+ u32 AddCash( u32 nAmount );\r
+ u32 TakeCash( u32 nAmount );\r
\r
inline u32 GetBaseApartment() const { return mPrimaryApt; }\r
\r
\r
inline void SetDialogNode( u16 nNode ) { mCurrentDialogNode = nNode; };\r
inline u16 GetDialogNode() const { return mCurrentDialogNode; };\r
-
- inline u8 GetClanLevel() const { return mClanLevel; };
- inline u16 GetClan() const { return mClanID; };
+\r
+ inline u8 GetClanLevel() const { return mClanLevel; };\r
+ inline u16 GetClan() const { return mClanID; };\r
void LoadClanLevel();\r
\r
inline s8 GetSoullight() const { return mSoullight; }\r
void doCmdeditactor();
void doCmdweather();
void doCmdSetMainSkill();
- void doCmdSetSubSkill();\r
- void doNPC();\r
+ void doCmdSetSubSkill();
+ void doNPC();
void doNPC_Shop();
void doCmdtest();
\r
/*\r
container.h - base classe for containers\r
-\r
+ \r
\r
MODIFIED: 28 Jul 2008 Hammag\r
REASON: - creation\r
friend class PContainer;\r
friend class PContainer2D;\r
friend class PMsgBuilder;\r
-\r
+ \r
friend class PContainer2DWorkaround;\r
-\r
+ \r
private:\r
enum {\r
i_invid = 0,\r
i_x,\r
i_y,\r
i_itemid,\r
- //i_type,
- i_flag,\r
- i_qty,
- i_sqty,\r
+ //i_type,\r
+ i_flag,\r
+ i_qty,\r
+ i_sqty,\r
i_curdur,\r
i_dmg,\r
i_freq,\r
i_hand,\r
i_rng,\r
- i_maxdur,
- i_slots,
- i_slt1,
- i_slt2,
- i_slt3,
- i_slt4,
- i_slt5,
- i_atype,
- i_conatin
+ i_maxdur,\r
+ i_slots,\r
+ i_slt1,\r
+ i_slt2,\r
+ i_slt3,\r
+ i_slt4,\r
+ i_slt5,\r
+ i_atype,\r
+ i_conatin\r
};\r
-\r
+ \r
PItem* mItem;\r
u8 mPosX;\r
u8 mPosY;\r
\r
PContainerEntry(PItem* nItem, u8 X, u8 Y, u32 nInvID = 0, bool SetDirty = true);\r
PContainerEntry(MYSQL_ROW row);\r
-\r
+ \r
bool SQLSave(u32 CharID, u32 InvLoc);\r
bool SQLDelete();\r
-\r
+ \r
inline void Set2DPos(u8 nPosX, u8 nPosY) { mDirtyFlag = mDirtyFlag || (mPosX != nPosX) || (mPosY != nPosY) ; mPosX = nPosX; mPosY = nPosY; }\r
-\r
+ \r
public:\r
~PContainerEntry();\r
-\r
+ \r
inline void Get2DPos(u8* oPosX, u8* oPosY) { *oPosX = mPosX; *oPosY = mPosY; }\r
};\r
\r
\r
\r
class PContainer // Holes allowed, no autofind free slots\r
-{\r
+{ \r
protected:\r
u8 mMaxSlots;\r
std::vector< PContainerEntry* >* mContContent;\r
u32 mInvLoc;\r
u32 mExclusiveUseCharID;\r
bool mDirtyFlag;\r
-\r
+ \r
inline bool IsSlotAllowed(u8 nSlotId) { return ((nSlotId < CONTAINER_MAX_SIZE) && (!mMaxSlots || (nSlotId < mMaxSlots))); }\r
virtual bool AddEntry(PContainerEntry* NewEntry, u8 nSlotId = 0);\r
virtual PContainerEntry* RemoveEntry(u8 nSlotId);\r
virtual bool GetFreeSlot(u8* nSlotId);\r
void Compact(u8 startSlotId = 0);\r
-\r
+ \r
public:\r
PContainer(u8 nMaxSlots = 0);\r
virtual ~PContainer();\r
\r
inline void SetInfo(u32 CharID, u32 InvLoc) { mCharID = CharID; mInvLoc = InvLoc; }\r
inline u32 GetOwnerId() { return mCharID; }\r
-\r
+ \r
inline bool IsDirty() { return mDirtyFlag; }\r
inline void SetDirty() { mDirtyFlag = true; }\r
-\r
+ \r
bool StartUse(u32 nExclusiveUseCharID = 0);\r
virtual bool EndUse(u32 nExclusiveUseCharID = 0);\r
\r
bool SQLLoad();\r
bool SQLSave();\r
-\r
+ \r
bool IsSlotFree(u8 nSlotId);\r
virtual bool AddItem(PItem* NewItem, u32 nInvID = 0, u8 nPosX = 0, u8 nPosY = 0, bool SetDirty = true);\r
-\r
+ \r
virtual bool MoveItem(u8 srcSlotId, u8 nCount, u8 dstSlotId);\r
bool MoveItem(u8 srcSlotId, u8 nCount, PContainer* dstContainer, u8 dstSlotId = 0, u8 nPosX = 0, u8 nPosY = 0);\r
virtual void SetEntryPosXY(PContainerEntry* nEntry, u8 nSlotId, u8 nPosX = 0, u8 nPosY = 0);\r
\r
virtual u8 RandomFill(u8 nItemCount = 0, int nItemContainerDefIndex = -1);\r
-\r
+ \r
PContainerEntry* GetEntry(u8 nSlotId);\r
std::vector< PContainerEntry* >* GetEntries();\r
PItem* GetItem(u8 nSlotId);\r
-\r
+ \r
virtual void Dump();\r
};\r
\r
\r
class PContainerWithHoles : public PContainer // Holes allowed, no autofind free slots\r
-{\r
+{ \r
public:\r
PContainerWithHoles(u8 nMaxSlots = 0) : PContainer(nMaxSlots){ nMaxSlots = nMaxSlots; }\r
virtual ~PContainerWithHoles() {}\r
protected:\r
virtual PContainerEntry* RemoveEntry(u8 nSlotId);\r
virtual bool GetFreeSlot(u8* nSlotId);\r
-\r
+ \r
public:\r
PContainerAutoCompact(u8 nMaxSlots = 0) : PContainer(nMaxSlots){ nMaxSlots = nMaxSlots; }\r
virtual ~PContainerAutoCompact() {}\r
-\r
- virtual bool MoveItem(u8 srcSlotId, u8 nCount, u8 dstSlotId);\r
+ \r
+ virtual bool MoveItem(u8 srcSlotId, u8 nCount, u8 dstSlotId); \r
};\r
\r
\r
class PContainer2D : public PContainerAutoCompact // + slotId not used, non-significant XY used (no XY check yet)\r
-{\r
+{ \r
public:\r
PContainer2D(u8 nMaxSlots = 0) : PContainerAutoCompact(nMaxSlots){ nMaxSlots = nMaxSlots; }\r
virtual ~PContainer2D() {}\r
u8 mMaxCols;\r
u8 mMaxRows;\r
u8 mRows;\r
-\r
+ \r
void AddRow();\r
-\r
+ \r
inline bool Is2DPosAllowed(u8 PosX, u8 PosY, u8 SizeX, u8 SizeY)\r
{\r
return ((PosX < mMaxCols-SizeX+1) && (PosY < mMaxRows-SizeY+1));\r
}\r
bool Is2DFree(u8 PosX, u8 PosY, u8 SizeX, u8 SizeY);\r
bool FindValid2DPos(PContainerEntry* nEntry);\r
-\r
+ \r
\r
protected:\r
bool AddEntry(PContainerEntry* NewEntry, u8 nSlotId = 0);\r
PContainerEntry* RemoveEntry(u8 nSlotId);\r
bool GetFreeSlot(u8* nSlotId);\r
-\r
+ \r
public:\r
PContainer2DWorkaround(u8 nMaxSlots = 0);\r
~PContainer2DWorkaround();\r
-\r
+ \r
bool MoveItem(u8 srcSlotId, u8 nCount, u8 dstSlotId);\r
-\r
+ \r
void Set2DPosMax(u8 MaxPosX, u8 MaxPosY = 254) { mMaxCols = MaxPosX; mMaxRows = MaxPosY; }\r
void SetEntryPosXY(PContainerEntry* nEntry, u8 nSlotId, u8 nPosX = 0, u8 nPosY = 0);\r
void SetUsed(PContainerEntry* nEntry, bool Value = true);\r
{\r
protected:\r
virtual bool GetFreeSlot(u8* nSlotId);\r
-\r
+ \r
public:\r
PContainerAutoFindFree(u8 nMaxSlots = 0) : PContainerWithHoles(nMaxSlots){ nMaxSlots = nMaxSlots; }\r
virtual ~PContainerAutoFindFree() {}\r
};\r
\r
class PContainerAutoCompactOnClose : public PContainerAutoFindFree // No holes kept after EndUse, automatic find first free slots (no control on insertion slot)\r
-{\r
+{ \r
public:\r
PContainerAutoCompactOnClose(u8 nMaxSlots = 0) : PContainerAutoFindFree(nMaxSlots){ nMaxSlots = nMaxSlots; }\r
virtual ~PContainerAutoCompactOnClose() {}\r
\r
virtual bool EndUse(u32 nExclusiveUseCharID = 0);\r
-};\r
+}; \r
\r
#endif\r
{
protected :
//int mIndex;
- int mType;
- //int mUseSound;
- int mDuration;
- int mChangeNum;
+ int mType;
+ //int mUseSound;
+ int mDuration;
+ int mChangeNum;
int mChangeType[8]; // 1: bonus, 2:malus, ... other ?
float mChangeScale[8];
- int mChangeTarget[8];
+ int mChangeTarget[8];
public :
PDefDrug();
bool LoadFromDef( PTokenList *Tokens );
inline int GetType() const { return mType; }
- inline int GetDuration() const { return mDuration; }
+ inline int GetDuration() const { return mDuration; }
inline int GetChangeNum() const { return mChangeNum; }
inline int GetChangeType( int nIdx ) const { return ((( nIdx >= 0 ) && ( nIdx < mChangeNum ) ) ? mChangeType[nIdx] : 0 ) ; }
inline float GetChangeScale( int nIdx ) const { return ((( nIdx >= 0 ) && ( nIdx < mChangeNum ) ) ? mChangeScale[nIdx] : 0 ) ; }
\r
MODIFIED: 25 Dec 2005 Namikon\r
REASON: - Added GPL\r
-\r
+ \r
MODIFIED: 10 Jul Hammag\r
REASON: - Full Item Def implementation\r
*/\r
// int mBmNum; // used IG for inventory display\r
// int mmBmNumIndex; // used IG for inventory display\r
int mSizeX;\r
- int mSizeY;\r
+ int mSizeY; \r
// int mSmallbmnum; // used IG for inventory display\r
float mWeight;\r
int mStackable;\r
float mFillWeight;\r
int mQualifier;\r
int mGfxMods;\r
- int mItemGroupID;\r
+ int mItemGroupID; \r
int mTextDescID;\r
int mBasePrice;\r
int mTechlevel;\r
inline float GetFillWeight() const { return mFillWeight; }\r
inline int GetQualifier() const { return mQualifier; }\r
inline int GetGfxMods() const { return mGfxMods; }\r
- inline int GetItemGroupID() const { return mItemGroupID; }\r
+ inline int GetItemGroupID() const { return mItemGroupID; } \r
inline int GetTextDescID() const { return mTextDescID; }\r
inline int GetBasePrice() const { return mBasePrice; }\r
inline int GetTechlevel() const { return mTechlevel; }\r
const PDefItems* GetDefBySeqIndex( int nSeqIndex ) const;\r
int GetRandomItemIdFromGroup( int nGroupId ) const;\r
\r
- inline std::map<int, PDefItems*>::const_iterator ConstIteratorBegin() const { return mDefs.begin(); }\r
- inline std::map<int, PDefItems*>::const_iterator ConstIteratorEnd() const { return mDefs.end(); }\r
+ inline std::map<int, PDefItems*>::const_iterator ConstIteratorBegin() const { return mDefs.begin(); }\r
+ inline std::map<int, PDefItems*>::const_iterator ConstIteratorEnd() const { return mDefs.end(); }\r
};\r
\r
#endif\r
float mModelScaling; // 0 - 0.9
int mMoneyLoose; // 0 - 190
float mSkillScale; // 0 - 120
- std::string mStandardScript;
+ std::string mStandardScript;
std::string mStandardParameter;
int mMass; // 1 - 10000
//int mStartHour; // not used
//int mEndHour; // not used
//std::string mTempScript; // not used
int mFlags; // values: 513, 259, 256, 128, 64, 48, 35, 34, 33, 32, 2, 1, 0
-\r
+
public :
PDefNpc();
//~PDefNpc();
-/*\r
- TinNS (TinNS is not a Neocron Server)\r
- Copyright (C) 2005 Linux Addicted Community\r
- maintainer Akiko <akiko@gmx.org>\r
-\r
- This program is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU General Public License\r
- as published by the Free Software Foundation; either version 2\r
- of the License, or (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
- 02110-1301, USA.\r
-*/\r
-\r
-\r
-\r
-/*\r
- def_scripts.h\r
-\r
- CREATED: 12 Oct 2009 Namikon\r
-*/\r
-\r
-#ifndef DEF_SCRIPTS_H\r
-#define DEF_SCRIPTS_H\r
-\r
-#include "def.h"\r
-\r
-class PDefScripts : public PDef\r
-{\r
- private :\r
- //int mIndex;\r
- std::string mIdentifier;\r
- std::string mLuaFile;\r
- std::string mScriptHeader;\r
-\r
- public :\r
- PDefScripts();\r
- //~PDefWeapon();\r
-\r
- bool LoadFromDef( PTokenList *Tokens );\r
-\r
- inline const std::string &GetIdentifier() const { return mIdentifier; }\r
- inline const std::string &GetLuaFile() const { return mLuaFile; }\r
- inline const std::string &GetScriptHeader() const { return mScriptHeader; }\r
-};\r
-\r
-class PDefScriptsMap : public PDefMap<PDefScripts>\r
-{\r
- public:\r
- //bool Load(const char* nName, const char* nFilename);\r
- inline std::map<int, PDefScripts*>::const_iterator ConstIteratorBegin() const { return mDefs.begin(); }\r
- inline std::map<int, PDefScripts*>::const_iterator ConstIteratorEnd() const { return mDefs.end(); }\r
-};\r
-\r
-#endif\r
+/*
+ TinNS (TinNS is not a Neocron Server)
+ Copyright (C) 2005 Linux Addicted Community
+ maintainer Akiko <akiko@gmx.org>
+
+ 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 (at your option) 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, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
+*/
+
+
+
+/*
+ def_scripts.h
+
+ CREATED: 12 Oct 2009 Namikon
+*/
+
+#ifndef DEF_SCRIPTS_H
+#define DEF_SCRIPTS_H
+
+#include "def.h"
+
+class PDefScripts : public PDef
+{
+ private :
+ //int mIndex;
+ std::string mIdentifier;
+ std::string mLuaFile;
+ std::string mScriptHeader;
+
+ public :
+ PDefScripts();
+ //~PDefWeapon();
+
+ bool LoadFromDef( PTokenList *Tokens );
+
+ inline const std::string &GetIdentifier() const { return mIdentifier; }
+ inline const std::string &GetLuaFile() const { return mLuaFile; }
+ inline const std::string &GetScriptHeader() const { return mScriptHeader; }
+};
+
+class PDefScriptsMap : public PDefMap<PDefScripts>
+{
+ public:
+ //bool Load(const char* nName, const char* nFilename);
+ inline std::map<int, PDefScripts*>::const_iterator ConstIteratorBegin() const { return mDefs.begin(); }
+ inline std::map<int, PDefScripts*>::const_iterator ConstIteratorEnd() const { return mDefs.end(); }
+};
+
+#endif
\r
/*\r
defs.h - include file for all def_* files related stuff used by all modules\r
-\r
+ \r
MODIFIED: 21 Sep 2006 Hammag\r
REASON: - created\r
-\r
+ \r
*/\r
\r
#ifndef DEFS_H\r
#include "def_worlds.h"\r
#include "def_worldfile.h"\r
#include "def_worldmodels.h"\r
-\r
#include "def_scripts.h"\r
\r
#include "gamedefs.h"\r
\r
-using namespace std;\r
-\r
#endif\r
\r
PDefWorldsMap mWorldsDefs;\r
PDefWorldFilesMap mWorldFilesDefs;\r
PDefWorldModelsMap mWorldModelsDefs;\r
-\r
PDefScriptsMap mScriptDefs;\r
// ___Add new entries here___\r
\r
inline const PDefWorldsMap* Worlds() const { return &mWorldsDefs; }\r
inline const PDefWorldFilesMap* WorldFiles() const { return &mWorldFilesDefs; }\r
inline const PDefWorldModelsMap* WorldModels() const { return &mWorldModelsDefs; }\r
-\r
inline const PDefScriptsMap* Scripts() const { return &mScriptDefs; }\r
// ___Add new entries here___\r
\r
extern class PNPCManager* NPCManager;\r
extern class PChat *Chat;\r
extern class PCommands *GameCommands;\r
-
-extern class POutpost *Outposts;
-extern class PMultiPart *MultiPartHandler;
+\r
+extern class POutpost *Outposts;\r
+extern class PMultiPart *MultiPartHandler;\r
\r
// Development debug output control\r
extern bool gDevDebug;\r
-/*\r
-TinNS (TinNS is not a Neocron Server)\r
-Copyright (C) 2005 Linux Addicted Community\r
-maintainer Akiko <akiko@gmx.org>\r
-\r
-This program is free software; you can redistribute it and/or\r
-modify it under the terms of the GNU General Public License\r
-as published by the Free Software Foundation; either version 2\r
-of the License, or (at your option) any later version.\r
-\r
-This program is distributed in the hope that it will be useful,\r
-but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-GNU General Public License for more details.\r
-\r
-You should have received a copy of the GNU General Public License\r
-along with this program; if not, write to the Free Software\r
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
-02110-1301, USA.\r
-*/\r
-\r
-/*\r
-\r
-lua_engine.h - TinNS Lua engine for processing NPC scripts\r
-\r
-CREATION: 13 Oct 2009 Namikon\r
-\r
-*/\r
-\r
-#ifndef PLUA_H\r
-#define PLUA_H\r
-\r
-extern "C" {\r
- #include <lua.h>\r
- #include <lauxlib.h>\r
- #include <lualib.h>\r
-}\r
-\r
-#define PLUAENGINE_DEFAULT 0\r
-#define PLUAENGINE_GETANSWER 4096\r
-#define PLUAENGINE_EXECUTENODE 8192\r
-\r
-class PLuaEngine\r
-{\r
- private:\r
- PClient* mTargetClient;\r
-\r
- bool mRunning;\r
- lua_State *mLua;\r
-\r
- std::vector<int> mReturnValues;\r
-\r
-\r
- // Return Values\r
- int mReturn_INT;\r
-// std::string mReturn_STR;\r
- // add more if needed...\r
-\r
- void CleanUp();\r
- bool ExecuteScript(std::string nLUAScript, int nNode, int nDialogClass = 0);\r
-\r
- public:\r
- PLuaEngine();\r
- ~PLuaEngine();\r
-\r
- // To check if LUA Script has syntax errors or whatever\r
- bool CheckLUAFile(std::string nLUAScript);\r
- void AddScriptResult(int nResult);\r
- void ProcessDialogScript(PClient* nClient, std::string mLUAFile, int nAnswer);\r
- inline PClient* GetBoundClient() { return mTargetClient; };\r
-\r
- inline void SetReturnINT(int nValue) { mReturn_INT = nValue; };\r
- // inline void SetReturnSTR(std::string nValue) { mReturn_STR = nValue; };\r
-};\r
-\r
-\r
-#endif\r
+/*
+TinNS (TinNS is not a Neocron Server)
+Copyright (C) 2005 Linux Addicted Community
+maintainer Akiko <akiko@gmx.org>
+
+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 (at your option) 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, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA.
+*/
+
+/*
+
+lua_engine.h - TinNS Lua engine for processing NPC scripts
+
+CREATION: 13 Oct 2009 Namikon
+
+*/
+
+#ifndef PLUA_H
+#define PLUA_H
+
+extern "C" {
+ #include <lua.h>
+ #include <lauxlib.h>
+ #include <lualib.h>
+}
+
+#define PLUAENGINE_DEFAULT 0
+#define PLUAENGINE_GETANSWER 4096
+#define PLUAENGINE_EXECUTENODE 8192
+
+class PLuaEngine
+{
+ private:
+ PClient* mTargetClient;
+
+ bool mRunning;
+ lua_State *mLua;
+
+ std::vector<int> mReturnValues;
+
+
+ // Return Values
+ int mReturn_INT;
+// std::string mReturn_STR;
+ // add more if needed...
+
+ void CleanUp();
+ bool ExecuteScript(std::string nLUAScript, int nNode, int nDialogClass = 0);
+
+ public:
+ PLuaEngine();
+ ~PLuaEngine();
+
+ // To check if LUA Script has syntax errors or whatever
+ bool CheckLUAFile(std::string nLUAScript);
+ void AddScriptResult(int nResult);
+ void ProcessDialogScript(PClient* nClient, std::string mLUAFile, int nAnswer);
+ inline PClient* GetBoundClient() { return mTargetClient; };
+
+ inline void SetReturnINT(int nValue) { mReturn_INT = nValue; };
+ // inline void SetReturnSTR(std::string nValue) { mReturn_STR = nValue; };
+};
+
+
+#endif
// Temp. NPC update message for testing
PMessage* BuildNpcDeathMsg( PClient* nClient, u32 nNpcId, u8 unknown1 = 0x4a, u8 npcAction = 0x1e );
- PMessage* BuildNPCMassInfoMsg( u32 nWorldID, u16 nTypeID, u16 nClothing, u16 nNameID, u16 nPosY, u16 nPosZ, u16 nPosX, u16 nHealth, u16 nTraderID, string* nAngleStr, string* nNpcName, string* nCustomName);\r
+ PMessage* BuildNPCMassInfoMsg( u32 nWorldID, u16 nTypeID, u16 nClothing, u16 nNameID, u16 nPosY, u16 nPosZ, u16 nPosX, u16 nHealth, u16 nTraderID, std::string *nAngleStr, std::string *nNpcName, std::string *nCustomName);\r
PMessage* BuildNPCMassAliveMsg( u32 nWorldID, u16 nX, u16 nY, u16 nZ, u8 nActionStatus, u8 nHealth, u8 nAction );\r
PMessage* BuildNPCMassUpdateMsg( u32 nWorldID, u16 nX, u16 nY, u16 nZ, u8 nActionStatus, u8 nHealth, u16 nTarget, u8 nAction );\r
// Moved here since its a zone broadcast!\r
PMessage* BuildTryAccessAnswerMsg(PClient* nClient, char *nArea, bool nAllowed);\r
PMessage* BuildReceiveDBAnswerMsg( PClient* nClient, PMessage* nResultBuffer, std::string* nCommandName, u16 nNumRows, u16 nNumFields);\r
PMessage* BuildYouGotEmailsMsg( PClient* nClient, u8 nMailCount );\r
-\r
- PMessage* BuildNPCStartDialogMsg( PClient* nClient, u32 nNPCWorldID, string* nDialogScript );\r
+ \r
+ PMessage* BuildNPCStartDialogMsg( PClient* nClient, u32 nNPCWorldID, std::string *nDialogScript );\r
PMessage* BuildNPCDialogReplyMsg( PClient* nClient, u16 nNextNode, std::vector<int>*nResultBuffer);\r
- PMessage* BuildReqNPCScriptAnswerMsg( u32 nInfoId, string* nNPCScript );\r
+ PMessage* BuildReqNPCScriptAnswerMsg( u32 nInfoId, std::string *nNPCScript );\r
PMessage* BuildNPCShoppingListMsg( PClient* nClient, PMessage* nContentList, int nWorldID, u8 nItemQuality);\r
PMessage* BuildNPCBeginAllBuyerTradeMsg( PClient* nClient, int nWorldID );\r
-\r
- PMessage* BuildNPCSingleInfoMsg( PClient* nClient, u32 nWorldID, u16 nTypeID, u16 nClothing, u16 nNameID, u16 nPosY, u16 nPosZ, u16 nPosX, u16 nHealth, u16 nTraderID, string* nAngleStr, string* nNpcName, string* nCustomName);\r
+ \r
+ PMessage* BuildNPCSingleInfoMsg( PClient* nClient, u32 nWorldID, u16 nTypeID, u16 nClothing, u16 nNameID, u16 nPosY, u16 nPosZ, u16 nPosX, u16 nHealth, u16 nTraderID, std::string *nAngleStr, std::string *nNpcName, std::string *nCustomName);\r
PMessage* BuildNPCSingleAliveMsg( PClient* nClient, u32 nWorldID, u16 nX, u16 nY, u16 nZ, u8 nActionStatus, u8 nHealth, u8 nAction );\r
PMessage* BuildNPCSingleUpdateMsg( PClient* nClient, u32 nWorldID, u16 nX, u16 nY, u16 nZ, u8 nActionStatus, u8 nHealth, u16 nTarget, u8 nAction );\r
-\r
+ \r
// NEW for testing. Combined update message\r
PMessage* BuildNPCUpdateMsg(u32 nWorldID, u16 nPosY, u16 nPosZ, u16 nPosX, u8 nActionBM, u16 nHealth, u8 nWeaponState, u8 nUnknown, u32 nTargetID = 0);\r
-\r
+ \r
PMessage* BuildReqInfoAnswerMsg( PClient* nClient, u16 nReqType, u32 nInfoId, void* nResponse, u16 nResponseLength );
PMessage* BuildPacket0Msg( PClient* nClient );
PMessage* smChunk;
} s_MessageChunk;
-typedef vector<s_MessageChunk> vecMsgChunk; // The vector of an specific multipart sequence, containing all chunks
+typedef std::vector<s_MessageChunk> vecMsgChunk; // The vector of an specific multipart sequence, containing all chunks
typedef struct
{
time_t smTimeStamp; // To keep track of sequence's lifetimer
PClient *smClient; // Required to call terminal class
} s_SequenceEntry;
-typedef map<u8, s_SequenceEntry> PMultipartMap; // Map of all vectors, indexed by sequencenumber <u8>
+typedef std::map<u8, s_SequenceEntry> PMultipartMap; // Map of all vectors, indexed by sequencenumber <u8>
class PMultiPart
void AddMultiPartChunk(PClient *nClient, PMessage *nChunk, u16 nChunkNumber, u16 nChunkTotal, u8 nSequence);
};
-#endif
\ No newline at end of file
+#endif
#ifndef NPC_H
#define NPC_H
-\r
+ \r
// Healthfactor for NPCs (see old npc.def)\r
#define NPC_HEALTHFACTOR 15\r
-\r
+ \r
// Minimum time in seconds that has to pass before an NPC\r
// gets his heartbeat send\r
#define NPC_HEARTBEAT_MIN 5\r
// Maximum time in seconds that is allowed to pass without\r
// an NPC heartbeat\r
#define NPC_HEARTBEAT_MAX 20\r
-\r
+ \r
// If no custom NPC is set in this Zone, what ID to start with?\r
#define NEW_NPC_ZONEID_START 1000\r
// How many seconds have to pass until we need an NPC "keepalive" packet?
#define NPC_ALIVE_MSG 15
-\r
+ \r
// How often a NPC should check if an enemy is nearby?\r
#define NPC_ENEMYCHECK 5\r
-\r
+ \r
#define NPC_ACTIONSTATE_SITGND 0x00\r
#define NPC_ACTIONSTATE_ATTACK 0x01\r
//#define NPC_ACTIONSTATE_? 0x02\r
#define NPC_ACTIONSTATE_PASSIVE 0x20\r
#define NPC_ACTIONSTATE_IDLE 0x40\r
#define NPC_ACTIONSTATE_DEATH 0x80\r
-\r
+ \r
#define NPC_SHOOT_IDLE 15\r
#define NPC_SHOOT_SINGLE 16\r
#define NPC_SHOOT_AUTO1 17\r
#define NPC_SHOOT_AUTO2 18\r
-\r
+ \r
class PNPC;
class PNPCWorld;
typedef std::map<u32, PNPC*> PNPCMap;
typedef std::map<u32, PNPCWorld*> PNPCWorldMap;
-\r
+ \r
typedef struct
{
u16 ItemID;\r
u32 Price;
} stShopListEntry;
-\r
+ \r
class PNPC
{
private:
npc_shop_quality,\r
npc_scripting
};
-\r
+ \r
std::time_t mNextUpdate; // Timestamp for next heartbeat\r
std::time_t mNextEnemyCheck; // Timestamp for next enemycheck\r
inline void PushUpdateTimer() { mNextUpdate = std::time(NULL) + GetRandom(NPC_HEARTBEAT_MAX, NPC_HEARTBEAT_MIN); };\r
u16 mTrader;\r
u8 mItemQuality; // Used for Shopping stuff\r
u8 mUnknown;\r
-\r
+ \r
std::string mDialogScript;\r
std::string mLUAFile; // Load File; Preloaded uppon NPC creation\r
-\r
+ \r
std::vector<stShopListEntry> mVectItemsInShop; // We need to keep track of the itemorder for shopping\r
void AddToVectorList(u16 nItemID, u32 nPrice);\r
inline const stShopListEntry* GetItemNum(u32 nIdx) const { if(nIdx > mVectItemsInShop.size()) { return NULL; } else { return &mVectItemsInShop[nIdx]; }};\r
-\r
+ \r
bool mScripting; // Manual override to disable scripting for an NPC TRUE: Scripts will be executed FALSE: Scripts will be ignored\r
std::string mName;
// WorldID Fix 10.10.2009
bool mFromDEF; // to differ DEF NPCs from SQL NPCs
bool mSuccess; // NPC load successfull?\r
-\r
+ \r
- u8 mAction; // Current action\r
+ u8 mAction; // Current action\r
inline u8 GetActionStatus() const { return mAction; };\r
// 00000001 ( 1) 0x01: Attack-Mode (Depends on WeaponStatus)\r
// 00000010 ( 2) 0x02: ?\r
// 00100000 ( 32) 0x20: Passive-Mode (Depends on WeaponStatus. Difference between 0x01: NPC does NOT open fire)\r
// 01000000 ( 64) 0x40: Idle\r
// 10000000 (128) 0x80: Die\r
-\r
+ \r
u8 mWeaponStatus;\r
inline u8 GetWeaponStatus() const { return mWeaponStatus; };\r
// 00001111 (15) 0x0F: Follow given target with eyes / Put weapon away if pulled\r
// 00010000 (16) 0x10: Pull weapon if not pulled / If pulled, attack\r
// 00010001 (17) 0x11: Pull weapon and attack\r
-\r
+ \r
bool SQL_Load();
bool DEF_Load(u32 nWorldID);
-\r
- PNPC( int nSQLID );\r
+ \r
+ PNPC( int nSQLID );\r
PNPC( int nDEFID, u32 nWorldID );\r
- ~PNPC();\r
-\r
+ ~PNPC();\r
+ \r
void InitVars();\r
void ContentListAddItem(PMessage* nContentList, u16 nItemID, u32 nBasePrice = 0, bool nAddToList = true);\r
void ContentListAddItemGroup(PMessage* nContentList, u32 nItemGroupID);\r
void StartDialog( PClient* nClient/*, string &nDialogscript */);\r
-\r
+ \r
bool DoSQLShoppingList( PClient* nClient, PMessage* nContentList );\r
bool HasSQLShoppingList( PClient* nClient );\r
bool IsAllbuyer( PClient* nClient );\r
bool LoadLUAScript();\r
-\r
+ \r
inline u32 GetRealWorldID() { if(mFromDEF == true) return mWorldID+255; else return mWorldID; };
public:
friend class PNPCWorld;
-\r
+ \r
inline void StopAttack() { mDirty = true; mAction = NPC_ACTIONSTATE_IDLE; mWeaponStatus = NPC_SHOOT_IDLE; };\r
inline void Attack( PClient* nClient, u8 nType = NPC_SHOOT_SINGLE, u8 nUnknown = 90 ) { Attack(nClient->GetChar()->GetID(), nType, nUnknown); };\r
void Attack( u32 nWorldID, u8 nType = NPC_SHOOT_SINGLE, u8 nUnknown = 90 );\r
-\r
+ \r
inline void Move( u16 nNewX, u16 nNewY, u16 nNewZ )
{
mPosX = nNewX;
void Update(); // Check respawn timer
void StartConversation( PClient* nClient );\r
void DoConversation( PClient* nClient, u8 nAnswer ) ;\r
-\r
+ \r
// GameCommands\r
bool ReloadLUAScript();\r
bool ReloadShopList();\r
bool LoadNPCfromSQL();
bool LoadNPCfromDEF();\r
-\r
+ \r
void BroadcastNewNPC(PNPC* nNpc);\r
void CheckForEnemies(PNPC* nNPC);
public:
friend class PNPCManager;
- PNPC* GetNPC( u32 nNPCID );\r
-\r
+ PNPC* GetNPC( u32 nNPCID );\r
+ \r
// Functions to add/remove an NPC while server is running\r
void SendSingleNPCInfo( PClient* nClient, PNPC* nNpc ); // Send\r
bool AddNPC(u32 nSQL_ID, u32 nRaw_ID); // Load single SQL NPC from given SQL ID\r
u8 mUnknown2c;
u16 mTradeID; //mUnknown3; //00 00 ?
u16 mUnknown4; //04 00 ?
- string mActorName;
- string mAngle;
+ std::string mActorName;
+ std::string mAngle;
/* // Not sure about that. Commented out until someone finds out how to deal with those "extra" informations
f32 mWaypoint1_Y;
{
return mUnknown4;
};
- inline string GetActorName() const
+ inline std::string GetActorName() const
{
return mActorName;
};
- inline string GetAngle() const
+ inline std::string GetAngle() const
{
return mAngle;
};
{
mUnknown4 = nValue;
};
- inline void SetActorName( string nValue )
+ inline void SetActorName( std::string nValue )
{
mActorName = nValue;
};
- inline void SetAngle( string nValue )
+ inline void SetAngle( std::string nValue )
{
mAngle = nValue;
};
int mResultFields;\r
void EraseVars();\r
\r
- char mConPrefix[50];
-
+ char mConPrefix[50];\r
+\r
inline bool ChkOpt(u8 nNumOptions, u8 nReqOpt) { if(nNumOptions < nReqOpt) return false; else return true; };\r
- bool DoStockXCheck(PClient* nClient, int nAmountEntered, int nNewAmount);
+ bool DoStockXCheck(PClient* nClient, int nAmountEntered, int nNewAmount);\r
\r
public:\r
PTerminal();\r
//~PTerminal();\r
-\r
// Check accesslevel of Player for various Terminal actions\r
bool CheckAccess(PClient* nClient, char *nArea, u16 nCmdNr, char *nOption1, char *nOption2, char *nOption3);\r
u8 GetNewEmailCount(PClient* nClient, bool nNoticeClient = true);\r
-/*
- TinNS (TinNS is not a Neocron Server)
- Copyright (C) 2005 Linux Addicted Community
- maintainer Akiko <akiko@gmx.org>
-
- 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 (at your option) 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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
-*/
-
-
-
-/*
- world_datparser.h
- Class to parse .dat world files
-
- MODIFIED: 29 Sep 2006 Hammag
- REASON: - Creation
-*/
-
-#ifndef WORLD_DATPARSER_H
-#define WORLD_DATPARSER_H
-
-class PFile;
-class PWorldDataTemplate;
-
-class PWorldDatParser
-{
-private :
- PFile* f;
- std::string mNCDataPath;
-
- PWorldDataTemplate* mWorld;
- bool mDiscardPassiveObjects;
-
- bool ProcessSec2ElemType3(u32 nSize);
- bool ProcessSec2ElemType5(u32 nSize);
- bool ProcessSec2NPCEntry(u32 nSize);
-
-public :
- PWorldDatParser();
- ~PWorldDatParser();
-
- int LoadDatFile(const std::string& nFilename, PWorldDataTemplate* nWorld, const bool nDiscardPassiveObjects = true, const bool nTestAccesOnly = false);
-
-};
-
-#endif
-
+/*\r
+ TinNS (TinNS is not a Neocron Server)\r
+ Copyright (C) 2005 Linux Addicted Community\r
+ maintainer Akiko <akiko@gmx.org>\r
+\r
+ This program is free software; you can redistribute it and/or\r
+ modify it under the terms of the GNU General Public License\r
+ as published by the Free Software Foundation; either version 2\r
+ of the License, or (at your option) any later version.\r
+\r
+ This program is distributed in the hope that it will be useful,\r
+ but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ GNU General Public License for more details.\r
+\r
+ You should have received a copy of the GNU General Public License\r
+ along with this program; if not, write to the Free Software\r
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
+ 02110-1301, USA.\r
+*/\r
+\r
+\r
+\r
+/*\r
+ world_datparser.h\r
+ Class to parse .dat world files\r
+\r
+ MODIFIED: 29 Sep 2006 Hammag\r
+ REASON: - Creation\r
+*/\r
+\r
+#ifndef WORLD_DATPARSER_H\r
+#define WORLD_DATPARSER_H\r
+\r
+class PFile;\r
+class PWorldDataTemplate;\r
+\r
+class PWorldDatParser\r
+{\r
+private :\r
+ PFile* f;\r
+ std::string mNCDataPath;\r
+\r
+ PWorldDataTemplate* mWorld;\r
+ bool mDiscardPassiveObjects;\r
+\r
+ bool ProcessSec2ElemType3(u32 nSize);\r
+ bool ProcessSec2ElemType5(u32 nSize);\r
+ bool ProcessSec2NPCEntry(u32 nSize);\r
+\r
+public :\r
+ PWorldDatParser();\r
+ ~PWorldDatParser();\r
+\r
+ int LoadDatFile(const std::string& nFilename, PWorldDataTemplate* nWorld, const bool nDiscardPassiveObjects = true, const bool nTestAccesOnly = false);\r
+\r
+};\r
+\r
+#endif\r
-/*
- TinNS (TinNS is not a Neocron Server)
- Copyright (C) 2005 Linux Addicted Community
-
- 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 (at your option) 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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
-*/
-
-
-/*
- worlddatatemplate.cpp - world data template (from worlds .dat files) class
-
- MODIFIED: 04 Oct 2006 Hammag
- REASON: - creation
-
- MODIFIED: 21 Jun 2009 Namikon
- REASON: - Added NPC Template stuff
-
-*/
-
-
-#ifndef WORLDDATATEMPLATE_H
-#define WORLDDATATEMPLATE_H
-
-#define WORLDDATATEMPLATE_MAXPOSITEMS 11
-
-class PFurnitureItemTemplate;
-typedef std::map<u32, PFurnitureItemTemplate*> PFurnitureItemsMap;
-
-class PDoorTemplate;
-typedef std::map<u32, PDoorTemplate*> PDoorsMap;
-
-class PNPCTemplate;
-typedef std::map<u32, PNPCTemplate*> PNPCsMap;
-
-class PWorldDataTemplate
-{
-private:
- std::string mName; // (datfile) relative path+filename without leading ./ or ./worlds/ nor .dat extension
- std::string mBspName; // (bsp file) relative path+filename without leading ./ or ./worlds/ nor .bsp extension
- PFurnitureItemsMap mFurnitureItems;
- PDoorsMap mDoors;
- PNPCsMap mNPCs;
- PFurnitureItemTemplate* mPositionItems[WORLDDATATEMPLATE_MAXPOSITEMS];
-
- int mUseCount;
-
- void DatFileDataCleanup();
- void SetLinkedObjects(); // This method implements some workarouds for some world objects on which we lack info.
-
-public:
- PWorldDataTemplate();
- ~PWorldDataTemplate();
-
- bool LoadDatFile(const std::string& WorldTemplateName, const std::string& nFilename, const bool nTestAccesOnly = false);
- inline const std::string& GetName()
- {
- return mName;
- }
- inline const std::string& GetBspName()
- {
- return mBspName;
- }
-
- inline void IncreaseUseCount()
- {
- ++mUseCount;
- }
- inline int DecreaseUseCount()
- {
- return (mUseCount ? --mUseCount : 0);
- }
- inline int GetUseCount()
- {
- return mUseCount;
- }
-
- u32 AddFurnitureItem(PFurnitureItemTemplate* nItem);
- const PFurnitureItemTemplate* GetFurnitureItem(u32 ItemID);
- bool getPositionItemPosition(u8 PosID, f32* pX, f32* pY, f32* pZ);
-
- u32 AddDoor(PDoorTemplate* nDoor);
- const PDoorTemplate* GetDoor(u32 DoorID);
-
- u32 AddNPC(PNPCTemplate* nNPC);
-
- // External functions for NPCManager
- const PNPCTemplate* GetNPC(u32 NPCID);
- inline const PNPCsMap *GetNPCMap() const
- {
- return &mNPCs;
- }; // called by class PNPCWorld to get all NPCs for this world
-};
-
-#endif
+/*\r
+ TinNS (TinNS is not a Neocron Server)\r
+ Copyright (C) 2005 Linux Addicted Community\r
+\r
+ This program is free software; you can redistribute it and/or\r
+ modify it under the terms of the GNU General Public License\r
+ as published by the Free Software Foundation; either version 2\r
+ of the License, or (at your option) any later version.\r
+\r
+ This program is distributed in the hope that it will be useful,\r
+ but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ GNU General Public License for more details.\r
+\r
+ You should have received a copy of the GNU General Public License\r
+ along with this program; if not, write to the Free Software\r
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
+ 02110-1301, USA.\r
+*/\r
+\r
+\r
+/*\r
+ worlddatatemplate.cpp - world data template (from worlds .dat files) class\r
+\r
+ MODIFIED: 04 Oct 2006 Hammag\r
+ REASON: - creation\r
+\r
+ MODIFIED: 21 Jun 2009 Namikon\r
+ REASON: - Added NPC Template stuff\r
+\r
+*/\r
+\r
+\r
+#ifndef WORLDDATATEMPLATE_H\r
+#define WORLDDATATEMPLATE_H\r
+\r
+#define WORLDDATATEMPLATE_MAXPOSITEMS 11\r
+\r
+class PFurnitureItemTemplate;\r
+typedef std::map<u32, PFurnitureItemTemplate*> PFurnitureItemsMap;\r
+\r
+class PDoorTemplate;\r
+typedef std::map<u32, PDoorTemplate*> PDoorsMap;\r
+\r
+class PNPCTemplate;\r
+typedef std::map<u32, PNPCTemplate*> PNPCsMap;\r
+\r
+class PWorldDataTemplate\r
+{\r
+private:\r
+ std::string mName; // (datfile) relative path+filename without leading ./ or ./worlds/ nor .dat extension\r
+ std::string mBspName; // (bsp file) relative path+filename without leading ./ or ./worlds/ nor .bsp extension\r
+ PFurnitureItemsMap mFurnitureItems;\r
+ PDoorsMap mDoors;\r
+ PNPCsMap mNPCs;\r
+ PFurnitureItemTemplate* mPositionItems[WORLDDATATEMPLATE_MAXPOSITEMS];\r
+\r
+ int mUseCount;\r
+\r
+ void DatFileDataCleanup();\r
+ void SetLinkedObjects(); // This method implements some workarouds for some world objects on which we lack info.\r
+\r
+public:\r
+ PWorldDataTemplate();\r
+ ~PWorldDataTemplate();\r
+\r
+ bool LoadDatFile(const std::string& WorldTemplateName, const std::string& nFilename, const bool nTestAccesOnly = false);\r
+ inline const std::string& GetName()\r
+ {\r
+ return mName;\r
+ }\r
+ inline const std::string& GetBspName()\r
+ {\r
+ return mBspName;\r
+ }\r
+\r
+ inline void IncreaseUseCount()\r
+ {\r
+ ++mUseCount;\r
+ }\r
+ inline int DecreaseUseCount()\r
+ {\r
+ return (mUseCount ? --mUseCount : 0);\r
+ }\r
+ inline int GetUseCount()\r
+ {\r
+ return mUseCount;\r
+ }\r
+\r
+ u32 AddFurnitureItem(PFurnitureItemTemplate* nItem);\r
+ const PFurnitureItemTemplate* GetFurnitureItem(u32 ItemID);\r
+ bool getPositionItemPosition(u8 PosID, f32* pX, f32* pY, f32* pZ);\r
+\r
+ u32 AddDoor(PDoorTemplate* nDoor);\r
+ const PDoorTemplate* GetDoor(u32 DoorID);\r
+\r
+ u32 AddNPC(PNPCTemplate* nNPC);\r
+\r
+ // External functions for NPCManager\r
+ const PNPCTemplate* GetNPC(u32 NPCID);\r
+ inline const PNPCsMap *GetNPCMap() const\r
+ {\r
+ return &mNPCs;\r
+ }; // called by class PNPCWorld to get all NPCs for this world\r
+};\r
+\r
+#endif\r
/*\r
- TinNS (TinNS is not a Neocron Server)\r
- Copyright (C) 2005 Linux Addicted Community\r
-\r
- This program is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU General Public License\r
- as published by the Free Software Foundation; either version 2\r
- of the License, or (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
- 02110-1301, USA.\r
+ TinNS (TinNS is not a Neocron Server)\r
+ Copyright (C) 2005 Linux Addicted Community\r
+\r
+ This program is free software; you can redistribute it and/or\r
+ modify it under the terms of the GNU General Public License\r
+ as published by the Free Software Foundation; either version 2\r
+ of the License, or (at your option) any later version.\r
+\r
+ This program is distributed in the hope that it will be useful,\r
+ but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ GNU General Public License for more details.\r
+\r
+ You should have received a copy of the GNU General Public License\r
+ along with this program; if not, write to the Free Software\r
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
+ 02110-1301, USA.\r
*/\r
\r
\r
\r
/*\r
- inventory.cpp - classes for inventories\r
- (inventory, belt, armor, implants, gogo, processor(?), maybe other containers(?) )\r
-\r
- MODIFIED: 10 Jul 2006 Hammag\r
- REASON: - creation : Quick and dirty main inventory (backpack) management\r
-\r
-\r
+ inventory.cpp - classes for inventories\r
+ (inventory, belt, armor, implants, gogo, processor(?), maybe other containers(?) )\r
+\r
+ MODIFIED: 10 Jul 2006 Hammag\r
+ REASON: - creation : Quick and dirty main inventory (backpack) management\r
+ MODIFIED: 09 Jun 2009 Akiko\r
+ REASON: - adjusted includes for new buildsystem\r
+ - clean ups\r
*/\r
\r
+\r
#include "main.h"\r
-#include "inventory.h"\r
-#include "container.h"\r
+\r
+#include "include/inventory.h"\r
+#include "include/container.h"\r
\r
\r
/* --- PInventory class --- */\r
*/\r
\r
/*\r
- isc.cpp\r
+ isc.cpp\r
\r
- MODIFIED: Unknown date / Namikon\r
- REASON: - initial release by Namikon\r
+ MODIFIED: Unknown date / Namikon\r
+ REASON: - initial release by Namikon\r
MODIFIED: 13 Oct 2006 Hammag\r
REASON: - Implemented MySQL isc method\r
+ MODIFIED: 09 Jun 2009 Akiko\r
+ REASON: - adjusted includes for new buildsystem\r
\r
- TODO:\r
- - implement ISC protocol\r
+ TODO:\r
+ - implement ISC protocol\r
*/\r
\r
#include "main.h"\r
\r
-#include "isc.h"\r
+#include "include/isc.h"\r
\r
PISC::PISC()\r
{\r
\r
\r
/*\r
- item.cpp - item class\r
+ item.cpp - item class\r
\r
MODIFIED: 11 Jul 2006 Hammag\r
REASON: - creation\r
- \r
+ MODIFIED: 09 Jun 2009 Akiko\r
+ REASON: - adjusted includes for new buildsystem\r
*/\r
\r
+\r
#include "main.h"\r
\r
-#include "item.h"\r
-#include "gamedefs.h"\r
-#include "def_items.h"\r
+#include "include/item.h"\r
+#include "include/gamedefs.h"\r
+#include "include/def_items.h"\r
+\r
\r
PItem::PItem(u32 ItemID, u8 nStackSize, u8 CurDur, u8 MaxDur, u8 Dmg, u8 Freq, u8 Hand, u8 Rng)\r
{\r
u8 retreivedItems = 0;\r
if (mStackable)\r
{\r
- retreivedItems = min(mStackSize, ItemNb);\r
+ retreivedItems = std::min(mStackSize, ItemNb);\r
mStackSize -= retreivedItems;\r
}\r
return retreivedItems; \r
-/*\r
-TinNS (TinNS is not a Neocron Server)\r
-Copyright (C) 2005 Linux Addicted Community\r
-maintainer Akiko <akiko@gmx.org>\r
-\r
-This program is free software; you can redistribute it and/or\r
-modify it under the terms of the GNU General Public License\r
-as published by the Free Software Foundation; either version 2\r
-of the License, or (at your option) any later version.\r
-\r
-This program is distributed in the hope that it will be useful,\r
-but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-GNU General Public License for more details.\r
-\r
-You should have received a copy of the GNU General Public License\r
-along with this program; if not, write to the Free Software\r
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
-02110-1301, USA.\r
-*/\r
-\r
-/*\r
-\r
-lua_engine.cpp - TinNS Lua engine for processing NPC scripts\r
-\r
-CREATION: 13 Oct 2009 Namikon\r
-\r
-*/\r
-\r
-#include "main.h"\r
-#include "msgbuilder.h"\r
-\r
-// ******************************************************************\r
-// ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION\r
-// ******************************************************************\r
-/*\r
- This function is the CALLBACK function for Neocron lua scripts.\r
- Every command inside any .lua file will result in a call to\r
- SendScriptMsg(xx), which ends up here.\r
-\r
- For currently known callbacks, look in the docs/ folder,\r
- file lua_callbacks.xls. It also contains the status and\r
- all parameters with return values that are required to handle\r
- script requests. If you're extending this function,\r
- please note it in the xls file!\r
-*/\r
-// ******************************************************************\r
-int npcscript_callback(lua_State *nLua)\r
-{\r
- PClient* tClient = LuaEngine->GetBoundClient();\r
- if(tClient == NULL)\r
- {\r
- Console->Print("%s [npcscript_callback] No client is set, unable to process actions!", Console->ColorText(RED, BLACK, "[Error]"));\r
- return 0;\r
- }\r
-\r
- // Get dialogclass and ScriptMsg from LUA call\r
- std::string tScriptMsg = lua_tostring(nLua, 1);\r
- int tDialogClass = lua_tointeger(nLua, 2);\r
-\r
- // Only execute any commands (getmoney, takemoney, etc) when we're told to do so!\r
- bool tExecCommands = false;\r
- if((tDialogClass&PLUAENGINE_EXECUTENODE) == PLUAENGINE_EXECUTENODE)\r
- {\r
- tExecCommands = true;\r
- }\r
-\r
- // Check which ScriptMsg we have\r
- if(tScriptMsg == "setanswer")\r
- {\r
- // its an setanswer\r
- // see if we're requested to return the node for any special answer number\r
- if((tDialogClass&PLUAENGINE_GETANSWER) == PLUAENGINE_GETANSWER)\r
- {\r
- // looks like that. Get the answernumber to check for and answernumber from lua\r
- int tAnswerNr = tDialogClass - PLUAENGINE_GETANSWER;\r
- int tLuaAnswerNr = lua_tointeger(nLua, 3);\r
-\r
- // Now check answernumber, and if positive, set the returnvalue in LuaEngine\r
- if(tAnswerNr == tLuaAnswerNr)\r
- {\r
- LuaEngine->SetReturnINT(lua_tointeger(nLua, 5));\r
- // We're done here; exit function\r
- return 1;\r
- }\r
- }\r
- }\r
- else if(tScriptMsg == "givemoney" && tExecCommands == true)\r
- // Give the player money\r
- // Script syntax: GIVEMONEY(amount)\r
- // Return Values: None\r
- {\r
- int tAmount = lua_tointeger(nLua, 3);\r
-\r
- /*int tNewMoneyValue = */tClient->GetChar()->AddCash(tAmount);\r
-\r
- // This issnt required, since the client adds the money already. It\r
- // isnt added twice, but you get the message twice and thats confusing :)\r
- //PMessage* tmpMsg = MsgBuilder->BuildCharMoneyUpdateMsg(tClient, tNewMoneyValue);\r
- //tClient->SendUDPMessage(tmpMsg);\r
-\r
- if (gDevDebug) Console->Print("GIVEMONEY from script; Added %d credits", tAmount);\r
- }\r
- else if(tScriptMsg == "takemoney" && tExecCommands == true)\r
- // Takes away money from player\r
- // Script syntax: TAKEMONEY(amount)\r
- // Return Values: 1 (Success) 0 (Failed)\r
- {\r
- int tAmount = lua_tointeger(nLua, 3);\r
- if (gDevDebug) Console->Print("TAKEMONEY from script");\r
-\r
- if(tClient->GetChar()->GetCash() < (u32)tAmount)\r
- {\r
- // Cannot take cash, player has less than amount required\r
- LuaEngine->AddScriptResult(0);\r
- if (gDevDebug) Console->Print("..FAILED player has not enough money (-%d)", tAmount);\r
- }\r
- else\r
- {\r
- // TakeMOney successfull. Reduce players credits and send money update\r
- int tNewMoneyValue = tClient->GetChar()->TakeCash(tAmount);\r
- PMessage* tmpMsg = MsgBuilder->BuildCharMoneyUpdateMsg(tClient, tNewMoneyValue);\r
- tClient->SendUDPMessage(tmpMsg);\r
-\r
- // TakeMoney successfull. Return 1\r
- LuaEngine->AddScriptResult(1);\r
- if (gDevDebug) Console->Print("..SUCCESS player had enough (-%d)", tAmount);\r
- }\r
- }\r
- else if(tScriptMsg == "rand" && tExecCommands == true)\r
- // Generate random number from 0 to tRange\r
- // Script syntax: RAND(range)\r
- // Return Values: 0 to range\r
- {\r
- int tRange = lua_tointeger(nLua, 3);\r
-\r
- int tRandomVal = GetRandom(tRange, 0);\r
- LuaEngine->AddScriptResult(tRandomVal);\r
- if (gDevDebug) Console->Print("RAND(%d) from script. Result: %d", tRange, tRandomVal);\r
- }\r
- else if(tScriptMsg == "takeitem" && tExecCommands == true)\r
- // Takes away an item from players inventory\r
- // Script syntax: TAKEITEM(itemID)\r
- // Return Values: 1 (Success) 0 (Failed)\r
- {\r
- int tItemID = lua_tointeger(nLua, 3);\r
- // Check if player has item ID tItemID and take it away\r
- // No clean way to take item away yet, fake answer until then.\r
- int tRes = GetRandom (1, 0);\r
- LuaEngine->AddScriptResult(tRes); // TakeItem was SUCCESSFULL\r
-\r
- if (gDevDebug) Console->Print("TAKEITEM(%d) from script. Random result: %d", tItemID, tRes);\r
- }\r
- else if(tScriptMsg == "giveitem" && tExecCommands == true)\r
- // Give an item to player, with given quality\r
- // Script syntax: GIVEITEM(itemID)\r
- // Return Values: None\r
- {\r
- int tItemID = lua_tointeger(nLua, 3);\r
- int tQuality = lua_tointeger(nLua, 4);\r
- // Give item tItemID in quality tQuality to player\r
-\r
- PItem* NewItem = new PItem( tItemID );\r
- if ( NewItem->GetItemID() )\r
- {\r
- NewItem->MakeItemStandard( tQuality, tQuality ); // Set Quality of item to tQuality\r
- tClient->GetChar()->GetInventory()->AddItem( NewItem );\r
- // TODO: Find a way to refresh inventory\r
- if (gDevDebug) Console->Print("GIVEITEM(%d,%d) from script. Result: %d", tItemID, tQuality);\r
- }\r
- else\r
- {\r
- // Error, invalid ItemID in script..?\r
- if (gDevDebug) Console->Print("GIVEITEM(%d,%d) from script. Fail: Unknown itemID", tItemID, tQuality);\r
-\r
- // Do nothing\r
- }\r
- }\r
- return 1;\r
-}\r
-// *************************************************************\r
-bool PLuaEngine::CheckLUAFile(std::string nLUAScript)\r
-{\r
- luaL_openlibs(mLua);\r
- if (luaL_loadstring(mLua, nLUAScript.c_str()) || lua_pcall(mLua, 0, 0, 0)) {\r
- Console->Print("[PLuaEngine::CheckLUAFile] Error in LUA Script: %s", lua_tostring(mLua, -1));\r
- return false;\r
- }\r
-\r
- // Check if we have the 2 main functions present\r
- lua_getglobal(mLua, "lSendAction");\r
- if(!lua_isfunction(mLua,-1))\r
- {\r
- Console->Print("[PLuaEngine::CheckLUAFile] LUA Script is missing function \"lSendAction)\"");\r
- lua_pop(mLua,1);\r
- return false;\r
- }\r
- // Check if we have the 2 main functions present\r
- lua_getglobal(mLua, "SetResult");\r
- if(!lua_isfunction(mLua,-1))\r
- {\r
- Console->Print("[PLuaEngine::CheckLUAFile] LUA Script is missing function \"SetResult)\"");\r
- lua_pop(mLua,1);\r
- return false;\r
- }\r
-\r
- // LUA File is ok\r
- return true;\r
-}\r
-\r
-void PLuaEngine::ProcessDialogScript(PClient* nClient, std::string nLUAFile, int nAnswer)\r
-{\r
- mTargetClient = nClient;\r
- PChar* tChar = nClient->GetChar();\r
-\r
- // Get current node ID the player is on\r
- u16 tNodeID = tChar->GetDialogNode();\r
-\r
- // First, get the new node ID based on the answer the client gave us. DO NOT execute any commands from\r
- // Script yet. Resulting node is in mReturn_INT\r
- ExecuteScript(nLUAFile, tNodeID, nAnswer + PLUAENGINE_GETANSWER);\r
-\r
- //int tNextNode = LuaEngine->GetNextNodeFromAnswer(nLUAFile, tNodeID, nAnswer);\r
- // Now execute target Node. Process all requests by Script, and tell client the results (if any)\r
- if(LuaEngine->ExecuteScript(nLUAFile, mReturn_INT, PLUAENGINE_EXECUTENODE) == false)\r
- {\r
- Console->Print("ERROR while processing LUA Script, skip");\r
- return;\r
- }\r
- else\r
- {\r
- // Set the new node in client\r
- tChar->SetDialogNode((u16)mReturn_INT);\r
- // Now send the new node (together with the answer-buffer) to the client.\r
- // After this packet hits the client, it will show the given node\r
- PMessage* tmpMsg = MsgBuilder->BuildNPCDialogReplyMsg(nClient, tChar->GetDialogNode(), &mReturnValues);\r
- nClient->SendUDPMessage(tmpMsg);\r
- }\r
-\r
- // Cleanup everything\r
- mTargetClient = NULL;\r
- CleanUp();\r
-}\r
-\r
-void PLuaEngine::AddScriptResult(int nResult)\r
-{\r
- if(!mRunning)\r
- {\r
- Console->Print("%s [PLuaEngine::AddScriptResult] Trying to set lua result while no lua script is running", Console->ColorText(YELLOW, BLACK, "[Warning]"));\r
- return;\r
- }\r
-\r
- // Insert new returnvalue to buffer\r
- mReturnValues.push_back(nResult);\r
-\r
- // Push result back to LUA Script\r
- lua_getglobal(mLua, "SetResult");\r
- lua_pushnumber(mLua, nResult); // newstate\r
-\r
- if (lua_pcall(mLua, 1, 0, 0) != 0)\r
- {\r
- Console->Print("%s [npcscript_callback] Unable to return result '%s'", Console->ColorText(RED, BLACK, "[Error]"), lua_tostring(mLua, -1));\r
- }\r
-}\r
-\r
-PLuaEngine::PLuaEngine()\r
-{\r
- mLua = lua_open();\r
- mRunning = false;\r
-}\r
-\r
-void PLuaEngine::CleanUp()\r
-{\r
- // CleanUp vars, empty vectors, etc\r
- mRunning = false;\r
- mReturnValues.erase(mReturnValues.begin(), mReturnValues.end());\r
-}\r
-\r
-PLuaEngine::~PLuaEngine()\r
-{\r
- lua_close(mLua);\r
-}\r
-\r
-bool PLuaEngine::ExecuteScript(std::string nLUAScript, int nNode, int nDialogClass)\r
-{\r
- // Make sure we have an bound client to work with\r
- if(mTargetClient == NULL)\r
- {\r
- Console->Print("%s [PLuaEngine::ExecuteScript] No Client has been bound. Cannot run lua script", Console->ColorText(RED, BLACK, "[Error]"));\r
- return false;\r
- }\r
-\r
- // Open LUA libs\r
- luaL_openlibs(mLua);\r
-\r
- // Try to load script and check for syntax errors\r
- if (luaL_loadstring(mLua, nLUAScript.c_str()) || lua_pcall(mLua, 0, 0, 0)) {\r
- Console->Print("%s [PLuaEngine::ExecuteScript] Unable to execute lua script: '%s'", Console->ColorText(RED, BLACK, "[Error]"), lua_tostring(mLua, -1));\r
- return false;\r
- }\r
-\r
- // Register callback function for NPC Script actions\r
- lua_register(mLua, "SendScriptMsg", npcscript_callback);\r
-\r
- // Get handle for lua main() function\r
- lua_getglobal(mLua, "lSendAction");\r
-\r
- // Error if function isnt found\r
- if(!lua_isfunction(mLua,-1))\r
- {\r
- Console->Print("%s [PLuaEngine::ExecuteScript] Unable to execute lua script; Script has no entry function (lSendAction)", Console->ColorText(RED, BLACK, "[Error]"));\r
- lua_pop(mLua,1);\r
- return false;\r
- }\r
- // Push our vars to the script\r
- // DialogClass is a loopback value for our callback function, to detect different\r
- // script runs (with or without execution of command)\r
- lua_pushnumber(mLua, nDialogClass);\r
- lua_pushnumber(mLua, nNode);\r
-\r
- /*\r
- run LUA Script (2 arguments, 0 result, 0 errorhandler)\r
- Only allow callback actions while lua is running (mRunning = true)\r
- */\r
-\r
- mRunning = true;\r
- int tLuaResult = lua_pcall(mLua, 2, 0, 0);\r
- mRunning = false;\r
-\r
- if (tLuaResult != 0)\r
- {\r
- Console->Print("%s [PLuaEngine::ExecuteScript] Unable to execute lua script: '%s'", Console->ColorText(RED, BLACK, "[Error]"), lua_tostring(mLua, -1));\r
- return false;\r
- }\r
-\r
- return true;\r
-}\r
+/*
+TinNS (TinNS is not a Neocron Server)
+Copyright (C) 2005 Linux Addicted Community
+maintainer Akiko <akiko@gmx.org>
+
+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 (at your option) 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, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA.
+*/
+
+/*
+
+lua_engine.cpp - TinNS Lua engine for processing NPC scripts
+
+CREATION: 13 Oct 2009 Namikon
+
+*/
+
+#include "main.h"
+#include "include/msgbuilder.h"
+
+// ******************************************************************
+// ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION
+// ******************************************************************
+/*
+ This function is the CALLBACK function for Neocron lua scripts.
+ Every command inside any .lua file will result in a call to
+ SendScriptMsg(xx), which ends up here.
+
+ For currently known callbacks, look in the docs/ folder,
+ file lua_callbacks.xls. It also contains the status and
+ all parameters with return values that are required to handle
+ script requests. If you're extending this function,
+ please note it in the xls file!
+*/
+// ******************************************************************
+int npcscript_callback(lua_State *nLua)
+{
+ PClient* tClient = LuaEngine->GetBoundClient();
+ if(tClient == NULL)
+ {
+ Console->Print("%s [npcscript_callback] No client is set, unable to process actions!", Console->ColorText(RED, BLACK, "[Error]"));
+ return 0;
+ }
+
+ // Get dialogclass and ScriptMsg from LUA call
+ std::string tScriptMsg = lua_tostring(nLua, 1);
+ int tDialogClass = lua_tointeger(nLua, 2);
+
+ // Only execute any commands (getmoney, takemoney, etc) when we're told to do so!
+ bool tExecCommands = false;
+ if((tDialogClass&PLUAENGINE_EXECUTENODE) == PLUAENGINE_EXECUTENODE)
+ {
+ tExecCommands = true;
+ }
+
+ // Check which ScriptMsg we have
+ if(tScriptMsg == "setanswer")
+ {
+ // its an setanswer
+ // see if we're requested to return the node for any special answer number
+ if((tDialogClass&PLUAENGINE_GETANSWER) == PLUAENGINE_GETANSWER)
+ {
+ // looks like that. Get the answernumber to check for and answernumber from lua
+ int tAnswerNr = tDialogClass - PLUAENGINE_GETANSWER;
+ int tLuaAnswerNr = lua_tointeger(nLua, 3);
+
+ // Now check answernumber, and if positive, set the returnvalue in LuaEngine
+ if(tAnswerNr == tLuaAnswerNr)
+ {
+ LuaEngine->SetReturnINT(lua_tointeger(nLua, 5));
+ // We're done here; exit function
+ return 1;
+ }
+ }
+ }
+ else if(tScriptMsg == "givemoney" && tExecCommands == true)
+ // Give the player money
+ // Script syntax: GIVEMONEY(amount)
+ // Return Values: None
+ {
+ int tAmount = lua_tointeger(nLua, 3);
+
+ /*int tNewMoneyValue = */tClient->GetChar()->AddCash(tAmount);
+
+ // This issnt required, since the client adds the money already. It
+ // isnt added twice, but you get the message twice and thats confusing :)
+ //PMessage* tmpMsg = MsgBuilder->BuildCharMoneyUpdateMsg(tClient, tNewMoneyValue);
+ //tClient->SendUDPMessage(tmpMsg);
+
+ if (gDevDebug) Console->Print("GIVEMONEY from script; Added %d credits", tAmount);
+ }
+ else if(tScriptMsg == "takemoney" && tExecCommands == true)
+ // Takes away money from player
+ // Script syntax: TAKEMONEY(amount)
+ // Return Values: 1 (Success) 0 (Failed)
+ {
+ int tAmount = lua_tointeger(nLua, 3);
+ if (gDevDebug) Console->Print("TAKEMONEY from script");
+
+ if(tClient->GetChar()->GetCash() < (u32)tAmount)
+ {
+ // Cannot take cash, player has less than amount required
+ LuaEngine->AddScriptResult(0);
+ if (gDevDebug) Console->Print("..FAILED player has not enough money (-%d)", tAmount);
+ }
+ else
+ {
+ // TakeMOney successfull. Reduce players credits and send money update
+ int tNewMoneyValue = tClient->GetChar()->TakeCash(tAmount);
+ PMessage* tmpMsg = MsgBuilder->BuildCharMoneyUpdateMsg(tClient, tNewMoneyValue);
+ tClient->SendUDPMessage(tmpMsg);
+
+ // TakeMoney successfull. Return 1
+ LuaEngine->AddScriptResult(1);
+ if (gDevDebug) Console->Print("..SUCCESS player had enough (-%d)", tAmount);
+ }
+ }
+ else if(tScriptMsg == "rand" && tExecCommands == true)
+ // Generate random number from 0 to tRange
+ // Script syntax: RAND(range)
+ // Return Values: 0 to range
+ {
+ int tRange = lua_tointeger(nLua, 3);
+
+ int tRandomVal = GetRandom(tRange, 0);
+ LuaEngine->AddScriptResult(tRandomVal);
+ if (gDevDebug) Console->Print("RAND(%d) from script. Result: %d", tRange, tRandomVal);
+ }
+ else if(tScriptMsg == "takeitem" && tExecCommands == true)
+ // Takes away an item from players inventory
+ // Script syntax: TAKEITEM(itemID)
+ // Return Values: 1 (Success) 0 (Failed)
+ {
+ int tItemID = lua_tointeger(nLua, 3);
+ // Check if player has item ID tItemID and take it away
+ // No clean way to take item away yet, fake answer until then.
+ int tRes = GetRandom (1, 0);
+ LuaEngine->AddScriptResult(tRes); // TakeItem was SUCCESSFULL
+
+ if (gDevDebug) Console->Print("TAKEITEM(%d) from script. Random result: %d", tItemID, tRes);
+ }
+ else if(tScriptMsg == "giveitem" && tExecCommands == true)
+ // Give an item to player, with given quality
+ // Script syntax: GIVEITEM(itemID)
+ // Return Values: None
+ {
+ int tItemID = lua_tointeger(nLua, 3);
+ int tQuality = lua_tointeger(nLua, 4);
+ // Give item tItemID in quality tQuality to player
+
+ PItem* NewItem = new PItem( tItemID );
+ if ( NewItem->GetItemID() )
+ {
+ NewItem->MakeItemStandard( tQuality, tQuality ); // Set Quality of item to tQuality
+ tClient->GetChar()->GetInventory()->AddItem( NewItem );
+ // TODO: Find a way to refresh inventory
+ if (gDevDebug) Console->Print("GIVEITEM(%d,%d) from script. Result: %d", tItemID, tQuality);
+ }
+ else
+ {
+ // Error, invalid ItemID in script..?
+ if (gDevDebug) Console->Print("GIVEITEM(%d,%d) from script. Fail: Unknown itemID", tItemID, tQuality);
+
+ // Do nothing
+ }
+ }
+ return 1;
+}
+// *************************************************************
+bool PLuaEngine::CheckLUAFile(std::string nLUAScript)
+{
+ luaL_openlibs(mLua);
+ if (luaL_loadstring(mLua, nLUAScript.c_str()) || lua_pcall(mLua, 0, 0, 0)) {
+ Console->Print("[PLuaEngine::CheckLUAFile] Error in LUA Script: %s", lua_tostring(mLua, -1));
+ return false;
+ }
+
+ // Check if we have the 2 main functions present
+ lua_getglobal(mLua, "lSendAction");
+ if(!lua_isfunction(mLua,-1))
+ {
+ Console->Print("[PLuaEngine::CheckLUAFile] LUA Script is missing function \"lSendAction)\"");
+ lua_pop(mLua,1);
+ return false;
+ }
+ // Check if we have the 2 main functions present
+ lua_getglobal(mLua, "SetResult");
+ if(!lua_isfunction(mLua,-1))
+ {
+ Console->Print("[PLuaEngine::CheckLUAFile] LUA Script is missing function \"SetResult)\"");
+ lua_pop(mLua,1);
+ return false;
+ }
+
+ // LUA File is ok
+ return true;
+}
+
+void PLuaEngine::ProcessDialogScript(PClient* nClient, std::string nLUAFile, int nAnswer)
+{
+ mTargetClient = nClient;
+ PChar* tChar = nClient->GetChar();
+
+ // Get current node ID the player is on
+ u16 tNodeID = tChar->GetDialogNode();
+
+ // First, get the new node ID based on the answer the client gave us. DO NOT execute any commands from
+ // Script yet. Resulting node is in mReturn_INT
+ ExecuteScript(nLUAFile, tNodeID, nAnswer + PLUAENGINE_GETANSWER);
+
+ //int tNextNode = LuaEngine->GetNextNodeFromAnswer(nLUAFile, tNodeID, nAnswer);
+ // Now execute target Node. Process all requests by Script, and tell client the results (if any)
+ if(LuaEngine->ExecuteScript(nLUAFile, mReturn_INT, PLUAENGINE_EXECUTENODE) == false)
+ {
+ Console->Print("ERROR while processing LUA Script, skip");
+ return;
+ }
+ else
+ {
+ // Set the new node in client
+ tChar->SetDialogNode((u16)mReturn_INT);
+ // Now send the new node (together with the answer-buffer) to the client.
+ // After this packet hits the client, it will show the given node
+ PMessage* tmpMsg = MsgBuilder->BuildNPCDialogReplyMsg(nClient, tChar->GetDialogNode(), &mReturnValues);
+ nClient->SendUDPMessage(tmpMsg);
+ }
+
+ // Cleanup everything
+ mTargetClient = NULL;
+ CleanUp();
+}
+
+void PLuaEngine::AddScriptResult(int nResult)
+{
+ if(!mRunning)
+ {
+ Console->Print("%s [PLuaEngine::AddScriptResult] Trying to set lua result while no lua script is running", Console->ColorText(YELLOW, BLACK, "[Warning]"));
+ return;
+ }
+
+ // Insert new returnvalue to buffer
+ mReturnValues.push_back(nResult);
+
+ // Push result back to LUA Script
+ lua_getglobal(mLua, "SetResult");
+ lua_pushnumber(mLua, nResult); // newstate
+
+ if (lua_pcall(mLua, 1, 0, 0) != 0)
+ {
+ Console->Print("%s [npcscript_callback] Unable to return result '%s'", Console->ColorText(RED, BLACK, "[Error]"), lua_tostring(mLua, -1));
+ }
+}
+
+PLuaEngine::PLuaEngine()
+{
+ // New lua function
+ mLua = luaL_newstate();
+ mRunning = false;
+}
+
+void PLuaEngine::CleanUp()
+{
+ // CleanUp vars, empty vectors, etc
+ mRunning = false;
+ mReturnValues.erase(mReturnValues.begin(), mReturnValues.end());
+}
+
+PLuaEngine::~PLuaEngine()
+{
+ lua_close(mLua);
+}
+
+bool PLuaEngine::ExecuteScript(std::string nLUAScript, int nNode, int nDialogClass)
+{
+ // Make sure we have an bound client to work with
+ if(mTargetClient == NULL)
+ {
+ Console->Print("%s [PLuaEngine::ExecuteScript] No Client has been bound. Cannot run lua script", Console->ColorText(RED, BLACK, "[Error]"));
+ return false;
+ }
+
+ // Open LUA libs
+ luaL_openlibs(mLua);
+
+ // Try to load script and check for syntax errors
+ if (luaL_loadstring(mLua, nLUAScript.c_str()) || lua_pcall(mLua, 0, 0, 0)) {
+ Console->Print("%s [PLuaEngine::ExecuteScript] Unable to execute lua script: '%s'", Console->ColorText(RED, BLACK, "[Error]"), lua_tostring(mLua, -1));
+ return false;
+ }
+
+ // Register callback function for NPC Script actions
+ lua_register(mLua, "SendScriptMsg", npcscript_callback);
+
+ // Get handle for lua main() function
+ lua_getglobal(mLua, "lSendAction");
+
+ // Error if function isnt found
+ if(!lua_isfunction(mLua,-1))
+ {
+ Console->Print("%s [PLuaEngine::ExecuteScript] Unable to execute lua script; Script has no entry function (lSendAction)", Console->ColorText(RED, BLACK, "[Error]"));
+ lua_pop(mLua,1);
+ return false;
+ }
+ // Push our vars to the script
+ // DialogClass is a loopback value for our callback function, to detect different
+ // script runs (with or without execution of command)
+ lua_pushnumber(mLua, nDialogClass);
+ lua_pushnumber(mLua, nNode);
+
+ /*
+ run LUA Script (2 arguments, 0 result, 0 errorhandler)
+ Only allow callback actions while lua is running (mRunning = true)
+ */
+
+ mRunning = true;
+ int tLuaResult = lua_pcall(mLua, 2, 0, 0);
+ mRunning = false;
+
+ if (tLuaResult != 0)
+ {
+ Console->Print("%s [PLuaEngine::ExecuteScript] Unable to execute lua script: '%s'", Console->ColorText(RED, BLACK, "[Error]"), lua_tostring(mLua, -1));
+ return false;
+ }
+
+ return true;
+}
-/*\r
- TinNS (TinNS is not a Neocron Server)\r
- Copyright (C) 2005 Linux Addicted Community\r
- maintainer Akiko <akiko@gmx.org>\r
-\r
- This program is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU General Public License\r
- as published by the Free Software Foundation; either version 2\r
- of the License, or (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
- 02110-1301, USA.\r
-*/\r
-\r
-\r
-\r
-/*\r
- main.cpp - this is the main file with the main function\r
-\r
- MODIFIED: 12 Sep 2005 Akiko\r
- REASON: - removed some of the Windows specific code\r
- - replaced SleepEx method by the Linux equivalent\r
- MODIFIED: 26 Sep 2005 Akiko\r
- REASON: - added GPL\r
- MODIFIED: 23 Dec 2005 bakkdoor\r
- REASON: - Added <csignal> & signalHandler -> catch strg-c and shutdown nicely\r
- MODIFIED: 25 Dec 2005 Namikon\r
- REASON: - Fixed shutdown procedure, wont cause segfault anymore\r
- MODIFIED: 06 Jan 2006 Namikon\r
- REASON: - Added color to console outputs\r
- MODIFIED: 01 Jul 2006 Hammag\r
- REASON: - commented out sched_yield() in main loop, as it is\r
- not needed anymore with a right timeout for ReadSetTCP select\r
- MODIFIED: 26 Jul 2006 Hammag\r
- REASON: - added memory leak check in the main loop for unreleased DB Ressources and messages\r
-\r
-*/\r
-\r
-#include "main.h"\r
-\r
-#include "worlddatatemplate.h" // temp\r
-#include "worlds.h" // temp\r
-\r
-#include "isc.h"\r
-\r
-// for handling strg-c signal to shutdown in correct way\r
-void signal_handler(int signal)\r
-{\r
- if (signal == SIGINT)\r
- {\r
- //cout << "Shutting down TinNS" << endl;\r
-\r
- //exit(0);\r
- Shutdown();\r
- }\r
- else\r
- {\r
- psignal(signal, "Unkown signal: ");\r
- }\r
-}\r
-\r
-int main()\r
-{\r
- // Connect signal with handlerfunction\r
- signal(SIGINT, signal_handler); // TODO: change for sigaction()\r
-\r
-\r
- if(!InitTinNS())\r
- {\r
- if(Console)\r
- Console->Print("%s Aborting startup.", Console->ColorText(RED, BLACK, "[Fatal]"));\r
- Shutdown(); // exits with 0 ...\r
- }\r
-\r
- //RemoteConsole->Start();\r
- GameServer->Start();\r
- //GameServer->SetGameTime(0);\r
- ISC->Start();\r
-\r
- Console->Print("Gameserver is now %s. Waiting for clients...", Console->ColorText(GREEN, BLACK, "Online"));\r
-\r
- while(1)\r
- {\r
- ServerSock->update();\r
- NPCManager->Update();\r
- Server->Update();\r
- Chars->Update();\r
- GameServer->Update();\r
- PMessage::CheckMsgCount(); // Memory leak check\r
- MySQL->Update(); // Memory leak check and MySQL keepalive\r
- ISC->Update();\r
+/*
+ TinNS (TinNS is not a Neocron Server)
+ Copyright (C) 2005 Linux Addicted Community
+ maintainer Akiko <akiko@gmx.org>
+
+ 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 (at your option) 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, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
+*/
+
+
+
+/*
+ main.cpp - this is the main file with the main function
+
+ MODIFIED: 12 Sep 2005 Akiko
+ REASON: - removed some of the Windows specific code
+ - replaced SleepEx method by the Linux equivalent
+ MODIFIED: 26 Sep 2005 Akiko
+ REASON: - added GPL
+ MODIFIED: 23 Dec 2005 bakkdoor
+ REASON: - Added <csignal> & signalHandler -> catch strg-c and shutdown nicely
+ MODIFIED: 25 Dec 2005 Namikon
+ REASON: - Fixed shutdown procedure, wont cause segfault anymore
+ MODIFIED: 06 Jan 2006 Namikon
+ REASON: - Added color to console outputs
+ MODIFIED: 01 Jul 2006 Hammag
+ REASON: - commented out sched_yield() in main loop, as it is
+ not needed anymore with a right timeout for ReadSetTCP select
+ MODIFIED: 26 Jul 2006 Hammag
+ REASON: - added memory leak check in the main loop for unreleased DB Ressources and messages
+ MODIFIED: 09 Jun 2009 Akiko
+ REASON: - adjusted includes for new buildsystem
+ - cleanups
+ - dos linefeeds -> unix linefeeds
+*/
+
+
+#include "main.h"
+
+#include "include/worlddatatemplate.h" // temp
+#include "include/worlds.h" // temp
+
+#include "include/isc.h"
+
+
+// for handling strg-c signal to shutdown in correct way
+void signal_handler(int signal)
+{
+ if (signal == SIGINT)
+ {
+ //cout << "Shutting down TinNS" << endl;
+
+ //exit(0);
+ Shutdown();
+ }
+ else
+ {
+ psignal(signal, "Unkown signal: ");
+ }
+}
+
+int main()
+{
+ // Connect signal with handlerfunction
+ signal(SIGINT, signal_handler); // TODO: change for sigaction()
+
+
+ if(!InitTinNS())
+ {
+ if(Console)
+ Console->Print("%s Aborting startup.", Console->ColorText(RED, BLACK, "[Fatal]"));
+ Shutdown(); // exits with 0 ...
+ }
+
+ //RemoteConsole->Start();
+ GameServer->Start();
+ //GameServer->SetGameTime(0);
+ ISC->Start();
+
+ Console->Print("Gameserver is now %s. Waiting for clients...", Console->ColorText(GREEN, BLACK, "Online"));
+
+
+ while(1)
+ {
+ ServerSock->update();
+ NPCManager->Update();
+ Server->Update();
+ Chars->Update();
+ GameServer->Update();
+ PMessage::CheckMsgCount(); // Memory leak check
+ MySQL->Update(); // Memory leak check and MySQL keepalive
+ ISC->Update();
Console->Update();
- MultiPartHandler->Update();\r
- }\r
-\r
- return 0;\r
-}\r
+ MultiPartHandler->Update();
+ }
+
+ return 0;
+}
REASON: - commented out mutex.h, thread.h, semaphore.h\r
MODIFIED: 22 Dec 2005 Namikon/bakkdoor\r
REASON: - Added commands.h, skill.h, clientmanager.h\r
- MODIFIED: 23 Dec 2005 bakkdoor\r
+ MODIFIED: 23 Dec 2005 bakkdoor\r
REASON: - Added <csignal> for main.cpp -> catch strg-c and shutdown nicely\r
- MODIFIED: 25 Dec 2005 Namikon\r
+ MODIFIED: 25 Dec 2005 Namikon\r
REASON: - Added mysql.h, sql.h for MySQL support\r
- MODIFIED: 01 Jan 2006 Namikon\r
+ MODIFIED: 01 Jan 2006 Namikon\r
REASON: - Moved skill.h before chars.h (char.h needs skill.h now)\r
- MODIFIED: 30 May 2006 Namikon\r
+ MODIFIED: 30 May 2006 Namikon\r
REASON: - Removed all useless includes to complete the server splitup; Also renamed tinns.h to main.h\r
- MODIFIED: 6 Jul 2006 Hammag\r
- REASON: - moved include "types.h" before include "../netcode/main.h" to permit compile\r
- MODIFIED: 10 Jul 2006 Hammag\r
- REASON: - added inventory.h\r
- REASON: - added item.h\r
- MODIFIED: 26 Jul 2006 Hammag\r
- REASON: - removed #define GAME_PORT which is not used anymore (now in config file)\r
-\r
+ MODIFIED: 6 Jul 2006 Hammag\r
+ REASON: - moved include "types.h" before include "../netcode/main.h" to permit compile\r
+ MODIFIED: 10 Jul 2006 Hammag\r
+ REASON: - added inventory.h\r
+ REASON: - added item.h\r
+ MODIFIED: 26 Jul 2006 Hammag\r
+ REASON: - removed #define GAME_PORT which is not used anymore (now in config file)\r
+ MODIFIED: 09 Jun 2009 Akiko\r
+ REASON: - adjusted includes for new buildsystem\r
+ - cleaned up a bit\r
*/\r
\r
#ifndef MAIN_H\r
//#include "version.h"\r
\r
//basic includes\r
-#include "external.h"\r
+#include "include/external.h"\r
\r
//tinns includes\r
-#include "types.h"\r
-#include "netcode.h"\r
+#include "include/types.h"\r
+#include "common/netcode.h"\r
/*\r
#include "../gamemonkey/gmMachine.h"\r
#include "../gamemonkey/gmCall.h"\r
*/\r
-#include "console.h"\r
+#include "common/console.h"\r
+#include "common/misc.h"\r
\r
// MySQL Support\r
-#include "mysql.h"\r
-#include "sql.h"\r
-\r
-#include "config.h"\r
-#include "filesystem.h"\r
-#include "defparser.h"\r
-\r
-\r
-#include "skill.h"\r
-#include "chars.h"\r
-#include "accounts.h"\r
-#include "client.h"\r
-#include "server.h"\r
-#include "misc.h"\r
-#include "gameserver.h"\r
-#include "globals.h"\r
-#include "defs.h"\r
-#include "zoning.h"\r
-#include "item.h"\r
-#include "inventory.h"\r
-#include "worldactors.h"\r
-#include "npc.h"\r
-#include "outpost.h"
-#include "multipart.h"
-#include "terminal.h"\r
-
-#include "lua_engine.h"\r
-#include "chat.h"\r
-#include "commands.h"\r
-#include "clientmanager.h"\r
-\r
-using namespace std;\r
+#ifdef MYSQL_INC_DIR\r
+#include <mysql/mysql.h>\r
+#else\r
+#include <mysql.h>\r
+#endif\r
+\r
+#include "include/sql.h"\r
+\r
+#include "common/config.h"\r
+#include "common/filesystem.h"\r
+#include "include/defparser.h"\r
+\r
+#include "include/skill.h"\r
+#include "include/chars.h"\r
+#include "include/accounts.h"\r
+#include "include/client.h"\r
+#include "include/server.h"\r
+#include "include/gameserver.h"\r
+#include "include/globals.h"\r
+#include "include/defs.h"\r
+#include "include/zoning.h"\r
+#include "include/item.h"\r
+#include "include/inventory.h"\r
+#include "include/worldactors.h"\r
+#include "include/npc.h"\r
+#include "include/outpost.h"\r
+#include "include/multipart.h"\r
+#include "include/terminal.h"\r
+\r
+#include "include/lua_engine.h"\r
+#include "include/chat.h"\r
+#include "include/commands.h"\r
+#include "include/clientmanager.h"\r
\r
#endif\r
\r
*/
#include "main.h"
-#include "msgbuilder.h"
+#include "include/msgbuilder.h"
-#include "worlds.h"
-#include "appartements.h"
-#include "vehicle.h"
-#include "subway.h"
-#include "item.h"
-#include "container.h"
+#include "include/worlds.h"
+#include "include/appartements.h"
+#include "include/vehicle.h"
+#include "include/subway.h"
+#include "include/item.h"
+#include "include/container.h"
PMessage* PMsgBuilder::BuildOutpostClanInfoMsg( PClient* nClient, u32 nClanID, u8 nFaction )
{
return tmpMsg;
}
-PMessage* PMsgBuilder::BuildReqNPCScriptAnswerMsg( u32 nInfoId, string* nNPCScript )\r
-{\r
+PMessage* PMsgBuilder::BuildReqNPCScriptAnswerMsg( u32 nInfoId, std::string *nNPCScript )\r
+ {\r
PMessage* tmpMsg;\r
-\r
+ \r
tmpMsg = new PMessage();\r
-\r
+ \r
*tmpMsg << ( u8 )0x19;\r
*tmpMsg << ( u16 )0x0006; // InfoQuery\r
*tmpMsg << ( u16 )0x0003; // NPC Script\r
*tmpMsg << ( u32 )nInfoId;\r
*tmpMsg << nNPCScript->c_str();\r
-\r
+ \r
return tmpMsg;\r
-\r
-}\r
-\r
+ \r
+ }\r
+ \r
PMessage* PMsgBuilder::BuildYouGotEmailsMsg( PClient* nClient, u8 nMailCount )\r
-{\r
+ {\r
PMessage* tmpMsg = new PMessage();\r
nClient->IncreaseUDP_ID();\r
-\r
+ \r
*tmpMsg << ( u8 )0x13;\r
*tmpMsg << ( u16 )nClient->GetUDP_ID();\r
*tmpMsg << ( u16 )nClient->GetSessionID();\r
*tmpMsg << ( u8 )0x00;\r
*tmpMsg << ( u8 )0x00;\r
*tmpMsg << ( u8 )nMailCount;\r
-\r
+ \r
return tmpMsg;\r
-}\r
-\r
-PMessage* PMsgBuilder::BuildReceiveDBAnswerMsg( PClient* nClient, PMessage* nResultBuffer, std::string* nCommandName, u16 nNumRows, u16 nNumFields)\r
-{\r
+ }\r
+ \r
+PMessage* PMsgBuilder::BuildReceiveDBAnswerMsg( PClient* nClient, PMessage* nResultBuffer, std::string *nCommandName, u16 nNumRows, u16 nNumFields)\r
+ {\r
PMessage* tmpMsg = new PMessage();\r
/* nClient->IncreaseUDP_ID();\r
-\r
+ \r
*tmpMsg << ( u8 )0x13;\r
*tmpMsg << ( u16 )0x0000;\r
*tmpMsg << ( u16 )0x0000;\r
*tmpMsg << ( u8 )0x01;\r
else\r
*tmpMsg << ( u8 )0x00;\r
-\r
- *tmpMsg << ( u8 )0x00;\r
- *tmpMsg << ( u8 )0x00;\r
+ \r
+ *tmpMsg << ( u8 )0x00;\r
+ *tmpMsg << ( u8 )0x00;\r
*tmpMsg << *nCommandName;\r
( *tmpMsg )[5] = ( u8 )( tmpMsg->GetSize() - 6 );\r
-\r
+ \r
// 2nd message\r
*tmpMsg << ( u16 )(13 + nCommandName->length() + nResultBuffer->GetSize()); // ??\r
-*/\r
+ */\r
nClient->IncreaseUDP_ID();\r
-\r
+ \r
*tmpMsg << ( u8 )0x13;\r
*tmpMsg << ( u16 )nClient->GetUDP_ID();\r
*tmpMsg << ( u16 )nClient->GetSessionID();\r
*tmpMsg << ( u16 )nNumFields;\r
*tmpMsg << *nCommandName;\r
*tmpMsg << *nResultBuffer;\r
-\r
+ \r
( *tmpMsg )[5] = ( u8 )( tmpMsg->GetSize() - 6 );\r
-\r
-\r
+ \r
+ \r
return tmpMsg;\r
//len = (unsigned int)strlen(DB);\r
//SendBuffer[0] = 0x13;\r
// SendBuffer[15] = 0x00;\r
// strcpy (SendBuffer+16, DB);\r
// plen = 17+len;\r
-\r
+ \r
// SendBuffer[plen] = 13+len+slen;\r
// SendBuffer[plen+1] = 0x03;\r
// Network_IncrementUDP (ClientNum);\r
// //Fieldnum is defined in each DB below\r
// strcpy (SendBuffer+plen+12, DB);\r
// plen += 13+len;\r
-\r
+ \r
// for (i=0;i<slen;i++)\r
// SendBuffer[plen+i] = TempBuffer[i];\r
-\r
-\r
-}\r
-\r
-\r
+ \r
+ \r
+ }\r
+ \r
+ \r
PMessage* PMsgBuilder::BuildTryAccessAnswerMsg(PClient* nClient, char *nArea, bool nAllowed)\r
-{\r
+ {\r
PMessage* tmpMsg = new PMessage();\r
//u8 i = (u8)strlen(nArea);\r
-\r
+ \r
nClient->IncreaseUDP_ID();\r
-\r
+ \r
*tmpMsg << (u8)0x13;\r
*tmpMsg << (u16)nClient->GetUDP_ID();\r
*tmpMsg << (u16)nClient->GetSessionID();\r
*tmpMsg << (u8)0x2b;\r
*tmpMsg << (u8)0x1a;\r
*tmpMsg << (u16)(strlen(nArea)+1);\r
-\r
+ \r
if(nAllowed)\r
*tmpMsg << (u8)0x01;\r
else\r
*tmpMsg << (u8)0x00;\r
-\r
+ \r
*tmpMsg << (u8)0x00;\r
*tmpMsg << (u8)0x00;\r
*tmpMsg << nArea;\r
-\r
+ \r
( *tmpMsg )[5] = ( u8 )( tmpMsg->GetSize() - 6 );\r
return tmpMsg;\r
-}\r
+ }\r
PMessage* PMsgBuilder::BuildReqInfoAnswerMsg( PClient* nClient, u16 nReqType, u32 nInfoId, void* nResponse, u16 nResponseLength )
{
return tmpMsg;
}
-PMessage* PMsgBuilder::BuildSendZoneTCPMsg( u32 nLocation, std::string* nWorldName )
+PMessage* PMsgBuilder::BuildSendZoneTCPMsg( u32 nLocation, std::string *nWorldName )
{
PMessage* tmpMsg = new PMessage( 14 + nWorldName->size() );
return tmpMsg;
}
-*/\r
+ */\r
// NPC Dialog. Start dialog with NPC\r
-PMessage* PMsgBuilder::BuildNPCStartDialogMsg( PClient* nClient, u32 nNPCWorldID, string* nDialogScript )\r
-{\r
+PMessage* PMsgBuilder::BuildNPCStartDialogMsg( PClient* nClient, u32 nNPCWorldID, std::string *nDialogScript )\r
+ {\r
PMessage* tmpMsg = new PMessage();\r
nClient->IncreaseUDP_ID();\r
-\r
-\r
+ \r
+ \r
*tmpMsg << ( u8 )0x13;\r
*tmpMsg << ( u16 ) 0x0000; // UDP Placeholder\r
*tmpMsg << ( u16 ) 0x0000; // UDP Placeholder\r
*tmpMsg << ( u16 )nClient->GetLocalID();\r
*tmpMsg << ( u8 )0x18;\r
*tmpMsg << ( u32 ) nNPCWorldID;\r
-\r
+ \r
// Todo: is this correct? random u32 value??\r
*tmpMsg << ( u16 ) GetRandom( 65535, 4369 );\r
*tmpMsg << ( u16 ) GetRandom( 65535, 4369 );\r
*tmpMsg << ( u32 ) 0x0000;\r
*tmpMsg << nDialogScript->c_str();\r
( *tmpMsg )[5] = ( u8 )( tmpMsg->GetSize() - 6 );\r
-\r
+ \r
nClient->IncreaseUDP_ID();\r
-\r
+ \r
*tmpMsg << ( u8 )0x0a;\r
*tmpMsg << ( u8 )0x03;\r
*tmpMsg << ( u16 )nClient->GetUDP_ID();\r
*tmpMsg << ( u8 )0x00;\r
*tmpMsg << ( u8 )0x00;\r
*tmpMsg << ( u8 )0x00;\r
-\r
+ \r
tmpMsg->U16Data( 1 ) = nClient->GetUDP_ID();\r
tmpMsg->U16Data( 3 ) = nClient->GetSessionID();\r
-\r
+ \r
return tmpMsg;\r
-}\r
+ }\r
// NPC Dialog. Send next node number in lua script to client\r
PMessage* PMsgBuilder::BuildNPCDialogReplyMsg( PClient* nClient, u16 nNextNode, std::vector<int>*nResultBuffer)\r
-{\r
+ {\r
PMessage* tmpMsg = new PMessage();\r
-\r
+ \r
nClient->IncreaseUDP_ID();\r
-\r
+ \r
*tmpMsg << ( u8 )0x13;\r
*tmpMsg << ( u16 )nClient->GetUDP_ID();;\r
*tmpMsg << ( u16 )nClient->GetSessionID();;\r
*tmpMsg << ( u8 )0x00; // SubMessage length;\r
-\r
+ \r
*tmpMsg << ( u8 )0x03;\r
*tmpMsg << ( u16 )nClient->GetUDP_ID();;\r
*tmpMsg << ( u8 )0x1f;\r
*tmpMsg << ( u16 )nNextNode;\r
//*tmpMsg << ( u8 )nNumResults;\r
*tmpMsg << ( u8 )nResultBuffer->size();\r
-\r
+ \r
std::vector<int>::const_iterator it;\r
-\r
+ \r
for(it = nResultBuffer->begin(); it != nResultBuffer->end(); it++)\r
- {\r
+ {\r
*tmpMsg << ( f32 )*(it);\r
- }\r
-\r
+ }\r
+ \r
( *tmpMsg )[5] = ( u8 )( tmpMsg->GetSize() - 6 );\r
-\r
+ \r
return tmpMsg;\r
-}\r
+ }\r
+
PMessage* PMsgBuilder::BuildNPCBeginAllBuyerTradeMsg( PClient* nClient, int nWorldID )\r
-{\r
+ {\r
PMessage* tmpMsg = new PMessage();\r
nClient->IncreaseUDP_ID();\r
-\r
+ \r
*tmpMsg << ( u8 )0x13;\r
*tmpMsg << ( u16 )nClient->GetUDP_ID();\r
*tmpMsg << ( u16 )nClient->GetSessionID();\r
*tmpMsg << ( u32 ) nWorldID;\r
*tmpMsg << ( u8 )0x01; // Traders inventory\r
*tmpMsg << ( u16 )0xFFFF; // Traders inventory\r
-\r
+ \r
( *tmpMsg )[5] = ( u8 )( tmpMsg->GetSize() - 6 );\r
-\r
+ \r
return tmpMsg;\r
-}\r
-\r
+ }\r
+ \r
PMessage* PMsgBuilder::BuildNPCShoppingListMsg( PClient* nClient, PMessage* nContentList, int nWorldID, u8 nItemQuality)\r
-{\r
+ {\r
PMessage* tmpMsg = new PMessage();\r
nClient->IncreaseUDP_ID();\r
-\r
+ \r
*tmpMsg << ( u8 )0x13;\r
*tmpMsg << ( u16 )nClient->GetUDP_ID();\r
*tmpMsg << ( u16 )nClient->GetSessionID();\r
*tmpMsg << ( u16 )( nContentList->GetSize() / 6 ); // List entries\r
*tmpMsg << ( u8 )nItemQuality; // Items quality\r
*tmpMsg << *nContentList;\r
-\r
+ \r
( *tmpMsg )[5] = ( u8 )( tmpMsg->GetSize() - 6 );\r
-\r
+ \r
return tmpMsg;\r
-}\r
-\r
+ }\r
+ \r
// ==========================\r
PMessage* PMsgBuilder::BuildNPCSingleInfoMsg( PClient* nClient, u32 nWorldID, u16 nTypeID, u16 nClothing,\r
u16 nNameID, u16 nPosY, u16 nPosZ, u16 nPosX, u16 nUnknown,\r
-u16 nTraderID, string* nAngleStr, string* nNpcName, string* nCustomName)\r
+u16 nTraderID, std::string *nAngleStr, std::string *nNpcName, std::string *nCustomName)\r
// Initial NPC Packet that defines how the NPC look, etc\r
-{\r
+ {\r
// u8 tMsgLen = 29 + nNpcName->size() + nAngleStr->size() + nCustomName->size();\r
-\r
+ \r
PMessage* tmpMsg = new PMessage();\r
nClient->IncreaseUDP_ID();\r
-\r
+ \r
*tmpMsg << ( u8 )0x13; // Begin UDP message\r
*tmpMsg << ( u16 )nClient->GetUDP_ID();\r
*tmpMsg << ( u16 )nClient->GetSessionID();\r
*tmpMsg << ( u8 )0x00;\r
- *tmpMsg << ( u8 )0x03;\r
- *tmpMsg << ( u16 )nClient->GetUDP_ID();\r
- *tmpMsg << ( u8 )0x28;\r
- *tmpMsg << ( u8 )0x00;\r
+ *tmpMsg << ( u8 )0x03;\r
+ *tmpMsg << ( u16 )nClient->GetUDP_ID();\r
+ *tmpMsg << ( u8 )0x28;\r
+ *tmpMsg << ( u8 )0x00;\r
*tmpMsg << ( u8 )0x01;\r
*tmpMsg << ( u32 )nWorldID;\r
*tmpMsg << ( u16 )nTypeID;\r
*tmpMsg << ( u16 )nPosY;\r
*tmpMsg << ( u16 )nPosZ;\r
*tmpMsg << ( u16 )nPosX;\r
- *tmpMsg << ( u8 )0x00;\r
+ *tmpMsg << ( u8 )0x00;\r
*tmpMsg << ( u16 )nUnknown;\r
*tmpMsg << ( u16 )nTraderID;\r
*tmpMsg << nNpcName->c_str();\r
*tmpMsg << nAngleStr->c_str();\r
if(nCustomName->length() > 1)\r
*tmpMsg << nCustomName->c_str();\r
-\r
+ \r
(*tmpMsg)[5] = (u8)(tmpMsg->GetSize() - 6);\r
return tmpMsg;\r
-}\r
-\r
+ }\r
+ \r
PMessage* PMsgBuilder::BuildNPCMassInfoMsg( u32 nWorldID, u16 nTypeID, u16 nClothing,\r
u16 nNameID, u16 nPosY, u16 nPosZ, u16 nPosX, u16 nHealth,\r
-u16 nTraderID, string* nAngleStr, string* nNpcName, string* nCustomName)\r
+u16 nTraderID, std::string *nAngleStr, std::string *nNpcName, std::string *nCustomName)\r
// Initial NPC Packet that defines how the NPC look, etc\r
-{\r
+ {\r
// u8 tMsgLen = 29 + nNpcName->size() + nAngleStr->size() + nCustomName->size();\r
-\r
+ \r
PMessage* tmpMsg = new PMessage();\r
-\r
+ \r
*tmpMsg << ( u8 )0x13; // Begin UDP message\r
*tmpMsg << ( u16 )0x0000;\r
*tmpMsg << ( u16 )0x0000;\r
*tmpMsg << nAngleStr->c_str();\r
if(nCustomName->length() > 1)\r
*tmpMsg << nCustomName->c_str();\r
-\r
+ \r
(*tmpMsg)[5] = (u8)(tmpMsg->GetSize() - 6);\r
- return tmpMsg;\r
-}\r
-\r
+ return tmpMsg;\r
+ }\r
+ \r
// **************\r
PMessage* PMsgBuilder::BuildNPCUpdateMsg(u32 nWorldID, u16 nPosY, u16 nPosZ, u16 nPosX, u8 nActionBM, u16 nHealth, u8 nWeaponState, u8 nUnknown, u32 nTargetID)\r
-{\r
+ {\r
PMessage* tmpMsg = new PMessage();\r
-\r
+ \r
*tmpMsg << ( u8 )0x13;\r
*tmpMsg << ( u16 )0x0000;\r
*tmpMsg << ( u16 )0x0000;\r
*tmpMsg << ( u32 )nTargetID; // WorldID of NPCs target (if any)\r
*tmpMsg << ( u8 )nUnknown;\r
*tmpMsg << ( u8 )nWeaponState;\r
-\r
+ \r
(*tmpMsg)[5] = (u8)(tmpMsg->GetSize() - 6);\r
-\r
+ \r
return tmpMsg;\r
-}\r
+ }\r
// **************\r
-\r
+ \r
PMessage* PMsgBuilder::BuildNPCSingleAliveMsg( PClient* nClient, u32 nWorldID, u16 nX, u16 nY, u16 nZ, u8 nActionStatus, u8 nHealth, u8 nAction )\r
-{\r
+ {\r
PMessage* tmpMsg = new PMessage();\r
-\r
+ \r
*tmpMsg << ( u8 )0x13; // Begin UDP message\r
*tmpMsg << ( u16 )nClient->GetUDP_ID();\r
*tmpMsg << ( u16 )nClient->GetSessionID();\r
*tmpMsg << ( u8 )nHealth;\r
*tmpMsg << ( u8 )0x00;\r
*tmpMsg << ( u8 )nAction;\r
-\r
+ \r
return tmpMsg;\r
-}\r
-\r
+ }\r
+ \r
PMessage* PMsgBuilder::BuildNPCMassAliveMsg( u32 nWorldID, u16 nX, u16 nY, u16 nZ, u8 nActionStatus, u8 nHealth, u8 nAction )\r
-{\r
+ {\r
PMessage* tmpMsg = new PMessage();\r
-\r
+ \r
*tmpMsg << ( u8 )0x13; // Begin UDP message\r
*tmpMsg << ( u16 )0x0000;\r
*tmpMsg << ( u16 )0x0000;\r
*tmpMsg << ( u8 )nHealth;\r
*tmpMsg << ( u8 )0x00;\r
*tmpMsg << ( u8 )nAction;\r
-\r
+ \r
return tmpMsg;\r
-}\r
-\r
+ }\r
+ \r
PMessage* PMsgBuilder::BuildNPCMassUpdateMsg( u32 nWorldID, u16 nX, u16 nY, u16 nZ, u8 nActionStatus, u8 nHealth, u16 nTarget, u8 nAction )\r
-{\r
+ {\r
PMessage* tmpMsg = new PMessage();\r
-\r
+ \r
*tmpMsg << ( u8 )0x13; // Begin UDP message\r
- *tmpMsg << ( u16 )0x0000;\r
+ *tmpMsg << ( u16 )0x0000;\r
*tmpMsg << ( u16 )0x0000;\r
*tmpMsg << ( u8 )0x15; // Message length\r
*tmpMsg << ( u8 )0x1b;\r
*tmpMsg << ( u8 )0x00; // ?\r
*tmpMsg << ( u8 )0x00; // ?\r
*tmpMsg << ( u8 )nAction;\r
-\r
+ \r
return tmpMsg;\r
-}\r
-\r
+ }\r
+ \r
// ==========================\r
-\r
+ \r
PMessage* PMsgBuilder::BuildNPCSingleUpdateMsg( PClient* nClient, u32 nWorldID, u16 nX, u16 nY, u16 nZ, u8 nActionStatus, u8 nHealth, u16 nTarget, u8 nAction )\r
-{\r
+ {\r
PMessage* tmpMsg = new PMessage();\r
-\r
+ \r
*tmpMsg << ( u8 )0x13; // Begin UDP message\r
*tmpMsg << ( u16 )nClient->GetUDP_ID();\r
*tmpMsg << ( u16 )nClient->GetSessionID();\r
*tmpMsg << ( u8 )0x00; // ?\r
*tmpMsg << ( u8 )0x00; // ?\r
*tmpMsg << ( u8 )nAction;\r
-\r
+ \r
return tmpMsg;\r
-}\r
+ }\r
// ==========================\r
PMessage* PMsgBuilder::BuildSubskillIncMsg( PClient* nClient, u8 nSubskill, u16 nSkillPoints )
{
return tmpMsg;
}
-PMessage* PMsgBuilder::BuildDBRequestStatusMsg( PClient* nClient, std::string* nCommandName, u8 nStatus, u16 nErrCode )
+PMessage* PMsgBuilder::BuildDBRequestStatusMsg( PClient* nClient, std::string *nCommandName, u8 nStatus, u16 nErrCode )
{
PMessage* tmpMsg = new PMessage( 32 );
nClient->IncreaseUDP_ID();
return tmpMsg;
}
-PMessage* PMsgBuilder::BuildDBAnswerMsg( PClient* nClient, std::string* nCommandName, std::string* nAnswerData, u16 nRows, u16 nCols )
+PMessage* PMsgBuilder::BuildDBAnswerMsg( PClient* nClient, std::string *nCommandName, std::string *nAnswerData, u16 nRows, u16 nCols )
{
u8 i, j, k;
PMessage* tmpMsg = new PMessage( 32 );
( *tmpMsg )[5] = ( u8 )( tmpMsg->GetSize() - 6 );
return tmpMsg;
-}\r
-\r
+ }\r
+ \r
/*
void Cmd_GiveItem (int ItemId, int Amount, int ClientNum)
tSeq.smClient = nClient;
// Finally, push that into our map
- MsgMap.insert(make_pair(nSequence, tSeq));
+ MsgMap.insert(std::make_pair(nSequence, tSeq));
}
}
-/*
+ /*
TinNS (TinNS is not a Neocron Server)
Copyright (C) 2005 Linux Addicted Community
maintainer Akiko <akiko@gmx.org>
-
+
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 (at your option) 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, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
-*/
-
-/*
-
+ */
+
+ /*
+
npc.cpp - Management class for NPC worldactors
-
+
CREATION: 04 Jan 2007 Namikon
-
+
MODIFIED: 28 Apr 2009 Hammag
REASON: changed worlds/zones Id from u16 (wrong !!!) to u32
-
-*/
+
+ */
#include "main.h"
-#include "npc.h"
-#include "worlds.h"
-#include "npctemplate.h"
-#include "worlddatatemplate.h"\r
-#include "msgbuilder.h"\r
-
-///***********************************************************************
+#include "include/npc.h"
+#include "include/worlds.h"
+#include "include/npctemplate.h"
+#include "include/worlddatatemplate.h"\r
+#include "include/msgbuilder.h"\r
+
+ ///***********************************************************************
\r
// Reload LUA script while running, in case we modified it and dont want to restart the entire server\r
bool PNPC::ReloadLUAScript()\r
// Reload it\r
return LoadLUAScript();\r
}\r
-
+
bool PNPC::DEF_Load(u32 nWorldID)
-{
+ {
if ( gDevDebug ) Console->Print( "[DEBUG] Now loading NPC data for NPC id %d from DEF", mWorldID );
const PNPCTemplate* t_defNPC = Worlds->GetWorld(nWorldID)->GetNPCTemplate(mWorldID);
-
+
mNameID = (u16)t_defNPC->GetNPCTypeID(); // 16 or 32??\r
const PDefNpc* t_NpcTypeDef = GameDefs->Npcs()->GetDef(mNameID);\r
if(!t_NpcTypeDef)\r
Console->Print("%s [PNPC::DEF_Load()] Unknown NPC Type %d in .dat file found", Console->ColorText(RED,BLACK, "[Error]"), mNameID);\r
return false;\r
}
-
+
// TODO: Find out what exactly these TypeID and ClothingID values do and where they are generated/read\r
// Possible (working) solution: Random seed for name generation that happens clientside
mTypeID = GetRandom(32767, 1);
mClothing = GetRandom(32767, 1);
// -------------
-
+
mPosX = t_defNPC->GetPosX()+32768;
mPosY = t_defNPC->GetPosY()+32768;
mPosZ = t_defNPC->GetPosZ()+32768;
mFaction = t_NpcTypeDef->GetFaction();
// WorldID Fix 10.10.2009
mFromDEF = true;
-
+
mName = t_defNPC->GetActorName();
\r
\r
if ( gDevDebug ) Console->Print( "ANG:%d HITPOINTS:%d TRADE:%d LOOT:%d NAME:%s CNAME:%s CUSTOMSCRIPT:%s", mAngle, mHealth, mTrader, mLoot, mName.c_str(), mCustomName.c_str(), mCustomLua.c_str() );\r
if ( gDevDebug ) Console->Print( "DIALOGSCR:%s", mDialogScript.c_str() );
return true;
-}
+ }
\r
bool PNPC::SQL_Load()\r
{\r
if(t_npc->GetDialogScript().length() > 3)\r
{\r
size_t tfound;\r
- string t_dialogscript = t_npc->GetDialogScript();\r
- string t_replacechr ("\"");\r
+ std::string t_dialogscript = t_npc->GetDialogScript();\r
+ std::string t_replacechr ("\"");\r
\r
tfound = t_dialogscript.find(t_replacechr);\r
- while(tfound != string::npos)\r
+ while(tfound != std::string::npos)\r
{\r
t_dialogscript.replace(tfound, 1, " ");\r
tfound = t_dialogscript.find( t_replacechr, tfound +1 );\r
{\r
u32 tFileLen = 0;\r
PFile* fLua = NULL;\r
- string tLuaFile = "";\r
- string tHDRFile = "";\r
+ std::string tLuaFile = "";\r
+ std::string tHDRFile = "";\r
\r
// Load LUA script and include the correct header file\r
// based in mDialogScript\r
return false;\r
}\r
}\r
-
-void PNPC::Die()
-{
+
+ void PNPC::Die()
+ {
if ( gDevDebug ) Console->Print( "[DEBUG] NPC dying now" );
mHealth = 0;
mAction = NPC_ACTIONSTATE_DEATH;
mRespawn = std::time( NULL ) + NPC_RESPAWN_AFTER;
mDirty = true;
-}
-
-void PNPC::Update()
+ }
+
+ void PNPC::Update()
{\r
// Has to be changed for mobs later
if ( std::time( NULL ) >= mRespawn && (mAction&NPC_ACTIONSTATE_DEATH) )
}
\r
void PNPC::InitVars()
-{
+ {
mID = 0;
mWorldID = 0;
mNameID = 0;
// Note: this is for regular heartbeats only. If npc is dirty,\r
// an update is sent anyway\r
mNextUpdate = std::time(NULL) + GetRandom(30, 10);
-}
+ }
\r
void PNPC::Attack( u32 nWorldID, u8 nType, u8 nUnknown )\r
{\r
mWeaponStatus = nType;\r
mUnknown = nUnknown;\r
}\r
-
-PNPC::PNPC( int nSQLID )
-{
+
+ PNPC::PNPC( int nSQLID )
+ {
InitVars();
//if(gDevDebug) Console->Print("[DEBUG] New NPC instance created. ID is %d", nSQLID);
mID = nSQLID;
else
mSuccess = true;
}
-
+
PNPC::PNPC( int nDEFID, u32 nWorldID )
{
InitVars();
mSuccess = false;
else
mSuccess = true;
-}
-
-PNPC::~PNPC()
-{
+ }
+
+ PNPC::~PNPC()
+ {
//if(gDevDebug) Console->Print("[DEBUG] NPC ID %d terminated", mID);
-}
+ }
/*
-u8 PNPC::GetActionStatus()
-{
+ u8 PNPC::GetActionStatus()
+ {
if ( mDeath == true )
{
return 128; // 128 triggers "death" animation
{
return 3; // 3 is the value found in many packets. However, no idea what this does
}
-}
+ }
*/
-///***********************************************************************
-///***********************************************************************
+ ///***********************************************************************
+ ///***********************************************************************
\r
// Broadcast a single NPC\r
void PNPCWorld::BroadcastNewNPC(PNPC* nNpc)\r
nClient->SendUDPMessage( tmpMsg );\r
return;\r
}\r
-
-void PNPCWorld::MSG_SendNPCs( PClient* nClient )
+
+ void PNPCWorld::MSG_SendNPCs( PClient* nClient )
{\r
PNPC* nNpc = NULL;\r
for ( PNPCMap::iterator it = mNPCs.begin(); it != mNPCs.end(); it++ )\r
}
bool PNPCWorld::LoadNPCfromSQL()
-{
+ {
// Load NPC defs from MySQL
MYSQL_RES *result = NULL;
MYSQL_ROW row;
char query[100];
-
+
snprintf( query, 100, "SELECT * FROM `npc_spawns` WHERE `npc_location` = %d", mWorldID );
//if(gDevDebug) Console->Print("[DEBUG] Query is: %s", query);
result = MySQL->GameResQuery( query );
if ( result == NULL )
- {
+ {
Console->Print( RED, BLACK, "PNPCWorld::PNPCWorld could not load NPC definition" );
Console->Print( "Query was:" );
Console->Print( "%s", query );
MySQL->ShowGameSQLError();
return false;
- }
+ }
if ( mysql_num_rows( result ) == 0 ) // No NPCs found
- {
+ {
MySQL->FreeGameSQLResult( result );
//if(gDevDebug) Console->Print("[NPC] No NPCs for this world found");
return true;
- }
+ }
//if(gDevDebug) Console->Print("[DEBUG] Found NPCs, now adding!");
PNPC* tmpNpc = NULL;
u32 tRawID = 0;
int tSQLID = 0;
while (( row = mysql_fetch_row( result ) ) )
- {
+ {
tRawID = atoi( row[PNPC::npc_worldid] );
tSQLID = atoi( row[PNPC::npc_id] );
tmpNpc = new PNPC( tSQLID );
//if(gDevDebug) Console->Print("[DEBUG] NPC init failed, removing link");
delete tmpNpc;
}
- }
+ }
if ( gDevDebug ) Console->Print( "[DEBUG] NPC Load from MySQL done" );
MySQL->FreeGameSQLResult( result );
return true;
-}
-
+ }
+
bool PNPCWorld::LoadNPCfromDEF()
-{
+ {
const PNPCsMap* tNPCmap = Worlds->GetWorld(mWorldID)->GetNPCMap(); // Get the NPC Map for this world
-
+
PNPC* tmpNpc = NULL;
u32 tDEFID = 0;
-
+
for ( PNPCsMap::const_iterator i = tNPCmap->begin(); i != tNPCmap->end(); i++ )
- {
+ {
// call PNPC with NPC ID and WorldID
tDEFID = i->first;
tmpNpc = new PNPC( tDEFID, mWorldID );
if ( tmpNpc->mSuccess == true )
- {
+ {
mNPCs.insert( std::make_pair( tDEFID, tmpNpc ) );
tmpNpc = NULL;
- }
- else
- {
+ }
+ else
+ {
delete tmpNpc;
- }
- }
+ }
+ }
if ( gDevDebug ) Console->Print( "[DEBUG] NPC Load from .def done" );
return true;
-}
-
-PNPCWorld::PNPCWorld( u32 nWorldID )
-{
+ }
+
+ PNPCWorld::PNPCWorld( u32 nWorldID )
+ {
//if(gDevDebug) Console->Print("[DEBUG] New world got initialized! Now starting to add NPCs. (WorldID %d)", nWorldID);
-
+
// Assign WorldValues now
mCreation = std::time( NULL );
mWorldID = nWorldID;
mLastAliveMsg = 0;
LoadNPCfromSQL();
LoadNPCfromDEF();
-}
-
-PNPCWorld::~PNPCWorld()
-{
+ }
+
+ PNPCWorld::~PNPCWorld()
+ {
if ( gDevDebug ) Console->Print( "[DEBUG] Erasing all NPCs" );
// Erase all NPCs
- for ( PNPCMap::iterator it = mNPCs.begin(); it != mNPCs.end(); it++ )
- {
+ for ( PNPCMap::iterator it = mNPCs.begin(); it != mNPCs.end(); it++ )
+ {
delete it->second;
mNPCs.erase( it );
- }
+ }
}\r
\r
void PNPCWorld::Update() // v2; New send function\r
}\r
\r
return;\r
-}
+ }
+
/*\r
void PNPCWorld::Update()
{\r
return;\r
}
*/\r
-PNPC* PNPCWorld::GetNPC( u32 nNPCID )
-{
+ PNPC* PNPCWorld::GetNPC( u32 nNPCID )
+ {
if ( gDevDebug ) Console->Print( "[DEBUG] Searching for NPC %d in list", nNPCID );
PNPCMap::const_iterator it = mNPCs.find( nNPCID );
if ( it == mNPCs.end() ) // only if client not found in list
return NULL;
else
return it->second;
-}
-
-///***********************************************************************
-///***********************************************************************
-
-PNPCManager::PNPCManager()
-{
+ }
+
+ ///***********************************************************************
+
+ PNPCManager::PNPCManager()
+ {
if ( gDevDebug ) Console->Print( "[DEBUG] NPCManager wakeup!" );
// Nothing yet
-}
-
-PNPCManager::~PNPCManager()
-{
+ }
+
+ PNPCManager::~PNPCManager()
+ {
if ( gDevDebug ) Console->Print( "[DEBUG] NPCManager shutdown" );
for ( PNPCWorldMap::iterator it = mWorlds.begin(); it != mWorlds.end(); it++ )
{
delete it->second;
mWorlds.erase( it );
}
-}
-
-void PNPCManager::InitPlayer( PClient* nClient )
-{
+ }
+
+ void PNPCManager::InitPlayer( PClient* nClient )
+ {
if ( gDevDebug ) Console->Print( "[DEBUG] Player entered zone, doing init" );
// Ok, player entered zone. First, get zone!
u32 nZone = nClient->GetChar()->GetLocation();
if ( gDevDebug ) Console->Print( "[DEBUG] Now searching for zone %d in list", nZone );
// Search worldmanager for this zone
PNPCWorld* tmpWorld = GetWorld( nZone );
-
+
if ( tmpWorld != NULL )
- {
+ {
if ( gDevDebug ) Console->Print( "[DEBUG] World found, poking MSG_SendNPCs" );
// World found? Fine. Then poke the class to send its content to the client
tmpWorld->MSG_SendNPCs( nClient );
- }
+ }
else
{
if ( gDevDebug ) Console->Print( "[DEBUG] World not found, creating...." );
tmpWorld->MSG_SendNPCs( nClient );
//tmpWorld->MSG_SendAlive( nClient ); // Force instand-update of NPCs for this client
}
-}
-
-PNPCWorld* PNPCManager::InitWorld( u32 nWorldID )
-{
+ }
+
+ PNPCWorld* PNPCManager::InitWorld( u32 nWorldID )
+ {
if ( gDevDebug ) Console->Print( "[DEBUG] InitWorld triggered: ID %d", nWorldID );
PNPCWorld* tmpWorld = NULL;
tmpWorld = new PNPCWorld( nWorldID );
if ( gDevDebug ) Console->Print( "[DEBUG] Failed to init world. Returning NULL" );
return NULL;
}
-}
-
-void PNPCManager::Update()
-{
+ }
+
+ void PNPCManager::Update()
+ {
static std::time_t lastdebug = std::time( NULL );
// Loop all worlds
-// if(lastdebug < std::time(NULL))
-// if(gDevDebug) Console->Print("[DEBUG] WorldLoop still running...");
-
+ // if(lastdebug < std::time(NULL))
+ // if(gDevDebug) Console->Print("[DEBUG] WorldLoop still running...");
+
for ( PNPCWorldMap::iterator it = mWorlds.begin(); it != mWorlds.end(); it++ )
- {
+ {
// Make sure target still exists
if ( it->second )
{
{
//if(lastdebug < std::time(NULL))
// if(gDevDebug) Console->Print("[DEBUG] World not in use. Checking lifetimer...");
-
+
if (( tWorld->mCreation + ZONE_RESET_AFTER ) <= std::time( NULL ) )
//if(tWorld->mCreation <= std::time(NULL))
{
// if(gDevDebug) Console->Print("[DEBUG] World still within ZONE_RESET timeout");
}
}
- }
- }
+ }
+ }
if ( lastdebug < std::time( NULL ) )
{
lastdebug = std::time( NULL ) + 3;
//if(gDevDebug) Console->Print("[DEBUG] next updateloopmsg in 3 seconds");
}
-}
-
-PNPCWorld* PNPCManager::GetWorld( u32 nWorldID )
-{
+ }
+
+ PNPCWorld* PNPCManager::GetWorld( u32 nWorldID )
+ {
if ( gDevDebug ) Console->Print( "[DEBUG] Trying to get instance for worldid %d", nWorldID );
PNPCWorldMap::const_iterator it = mWorlds.find( nWorldID );
if ( it == mWorlds.end() )
if ( gDevDebug ) Console->Print( "[DEBUG] Found. Returning address" );
return it->second;
}
-}
+ }
-#include "main.h"\r
-#include "npc.h"\r
-\r
-// First try of an "AI" :P\r
-void PNPCWorld::CheckForEnemies(PNPC* nNPC)\r
-{\r
- //return;\r
- std::time_t tNow = time(NULL);\r
- // Is it time for next enemy check?\r
-\r
- // Temp: Skip that for IDs below 1000\r
- if(nNPC->GetRealWorldID() < 1000)\r
- return;\r
- // -------------\r
-\r
- if(tNow > nNPC->mNextEnemyCheck)\r
- {\r
- //Console->Print("[NPC AI] Checking enemy status for NPC %d", nNPC->GetRealWorldID());\r
- nNPC->mNextEnemyCheck = time(NULL) + NPC_ENEMYCHECK;\r
- // Loop all NPCs in my world\r
-\r
- // tNearestEnemy[0] = WorldID | tNearestEnemy[1] = Distance to us\r
- u32 tNearestEnemy[2] = {0,0};\r
-\r
- for ( PNPCMap::iterator it = mNPCs.begin(); it != mNPCs.end(); it++ )\r
- {\r
- if(it->second)\r
- {\r
- PNPC* tNPC = it->second;\r
- // Is target = me?\r
- if(tNPC->GetRealWorldID() == nNPC->GetRealWorldID())\r
- continue;\r
-\r
- u16 tDistance = DistanceApprox(nNPC->mPosX, nNPC->mPosY, nNPC->mPosZ, tNPC->mPosX, tNPC->mPosY, tNPC->mPosZ);\r
-\r
- // Is NPC infight?\r
- if(nNPC->GetActionStatus() == NPC_ACTIONSTATE_ATTACK)\r
- {\r
- // If not infight with current target, skip here\r
- if(nNPC->mTarget != tNPC->GetRealWorldID())\r
- continue;\r
-\r
- // He IS with target infight. Check range\r
- if(tDistance > 1500)\r
- nNPC->StopAttack(); // Enemy ran away :( cancel fight\r
- else\r
- {\r
- //nNPC->Attack(tNPC->GetRealWorldID());\r
- continue; // Enemy is still in range, good! keep attacking him\r
- }\r
-\r
- }\r
- // Ok, NPC is not infight, so lets check if current iterator target is in range\r
- if(tDistance > 800)\r
- continue; // No, he's not\r
-\r
- // He is! Look closer at him. Get Faction standing\r
- int tFactionMe = nNPC->mFaction;\r
- int tFactionHim = tNPC->mFaction;\r
- //Console->Print("[NPC AI] Checking InRange NPC %d; MyFac: %d HisFac: %d", tNPC->GetRealWorldID(), tFactionMe, tFactionHim);\r
-\r
- // Hey, we're friends :)\r
- if(tFactionMe == tFactionHim)\r
- continue;\r
-\r
- const PDefFaction* tFaction = NULL;\r
- int tStanding = 0;\r
- // Always check higher faction against lower faction\r
- if(tFactionMe > tFactionHim)\r
- {\r
- tFaction = GameDefs->Factions()->GetDef(tFactionMe);\r
- if(!tFaction)\r
- {\r
- Console->Print("Unknown faction: %d", tFactionMe);\r
- continue;\r
- }\r
- tStanding = tFaction->GetRelation(tFactionHim);\r
- }\r
- else\r
- {\r
- tFaction = GameDefs->Factions()->GetDef(tFactionHim);\r
- if(!tFaction)\r
- {\r
- Console->Print("Unknown faction: %d", tFactionHim);\r
- continue;\r
- }\r
- tStanding = tFaction->GetRelation(tFactionMe);\r
- }\r
- // Enemies? omg! Check distance!\r
- if(tStanding < 0)\r
- {\r
- if(tNearestEnemy[1] > tDistance || tNearestEnemy[0] == 0)\r
- {\r
- // This enemy is even closer than the stored one, or we dont have any enemy yet\r
- tNearestEnemy[0] = tNPC->GetRealWorldID();\r
- tNearestEnemy[1] = tDistance;\r
- Console->Print("NPC ID %d (Distance %d) is an Faction enemy, Standing: %d. Remembering him!", tNearestEnemy[0], tNearestEnemy[1], tStanding);\r
- }\r
- }\r
- }\r
- }\r
- if(tNearestEnemy[0] > 0)\r
- {\r
- Console->Print("NPC ID %d now attacking NPC ID %d", nNPC->GetRealWorldID(), tNearestEnemy[0]);\r
- nNPC->Attack(tNearestEnemy[0]);\r
- }\r
- }\r
-}\r
+#include "main.h"
+#include "include/npc.h"
+
+// First try of an "AI" :P
+void PNPCWorld::CheckForEnemies(PNPC* nNPC)
+{
+ //return;
+ std::time_t tNow = time(NULL);
+ // Is it time for next enemy check?
+
+ // Temp: Skip that for IDs below 1000
+ if(nNPC->GetRealWorldID() < 1000)
+ return;
+ // -------------
+
+ if(tNow > nNPC->mNextEnemyCheck)
+ {
+ //Console->Print("[NPC AI] Checking enemy status for NPC %d", nNPC->GetRealWorldID());
+ nNPC->mNextEnemyCheck = time(NULL) + NPC_ENEMYCHECK;
+ // Loop all NPCs in my world
+
+ // tNearestEnemy[0] = WorldID | tNearestEnemy[1] = Distance to us
+ u32 tNearestEnemy[2] = {0,0};
+
+ for ( PNPCMap::iterator it = mNPCs.begin(); it != mNPCs.end(); it++ )
+ {
+ if(it->second)
+ {
+ PNPC* tNPC = it->second;
+ // Is target = me?
+ if(tNPC->GetRealWorldID() == nNPC->GetRealWorldID())
+ continue;
+
+ u16 tDistance = DistanceApprox(nNPC->mPosX, nNPC->mPosY, nNPC->mPosZ, tNPC->mPosX, tNPC->mPosY, tNPC->mPosZ);
+
+ // Is NPC infight?
+ if(nNPC->GetActionStatus() == NPC_ACTIONSTATE_ATTACK)
+ {
+ // If not infight with current target, skip here
+ if(nNPC->mTarget != tNPC->GetRealWorldID())
+ continue;
+
+ // He IS with target infight. Check range
+ if(tDistance > 1500)
+ nNPC->StopAttack(); // Enemy ran away :( cancel fight
+ else
+ {
+ //nNPC->Attack(tNPC->GetRealWorldID());
+ continue; // Enemy is still in range, good! keep attacking him
+ }
+
+ }
+ // Ok, NPC is not infight, so lets check if current iterator target is in range
+ if(tDistance > 800)
+ continue; // No, he's not
+
+ // He is! Look closer at him. Get Faction standing
+ int tFactionMe = nNPC->mFaction;
+ int tFactionHim = tNPC->mFaction;
+ //Console->Print("[NPC AI] Checking InRange NPC %d; MyFac: %d HisFac: %d", tNPC->GetRealWorldID(), tFactionMe, tFactionHim);
+
+ // Hey, we're friends :)
+ if(tFactionMe == tFactionHim)
+ continue;
+
+ const PDefFaction* tFaction = NULL;
+ int tStanding = 0;
+ // Always check higher faction against lower faction
+ if(tFactionMe > tFactionHim)
+ {
+ tFaction = GameDefs->Factions()->GetDef(tFactionMe);
+ if(!tFaction)
+ {
+ Console->Print("Unknown faction: %d", tFactionMe);
+ continue;
+ }
+ tStanding = tFaction->GetRelation(tFactionHim);
+ }
+ else
+ {
+ tFaction = GameDefs->Factions()->GetDef(tFactionHim);
+ if(!tFaction)
+ {
+ Console->Print("Unknown faction: %d", tFactionHim);
+ continue;
+ }
+ tStanding = tFaction->GetRelation(tFactionMe);
+ }
+ // Enemies? omg! Check distance!
+ if(tStanding < 0)
+ {
+ if(tNearestEnemy[1] > tDistance || tNearestEnemy[0] == 0)
+ {
+ // This enemy is even closer than the stored one, or we dont have any enemy yet
+ tNearestEnemy[0] = tNPC->GetRealWorldID();
+ tNearestEnemy[1] = tDistance;
+ Console->Print("NPC ID %d (Distance %d) is an Faction enemy, Standing: %d. Remembering him!", tNearestEnemy[0], tNearestEnemy[1], tStanding);
+ }
+ }
+ }
+ }
+ if(tNearestEnemy[0] > 0)
+ {
+ Console->Print("NPC ID %d now attacking NPC ID %d", nNPC->GetRealWorldID(), tNearestEnemy[0]);
+ nNPC->Attack(tNearestEnemy[0]);
+ }
+ }
+}
-/*\r
-TinNS (TinNS is not a Neocron Server)\r
-Copyright (C) 2005 Linux Addicted Community\r
-maintainer Akiko <akiko@gmx.org>\r
-\r
-This program is free software; you can redistribute it and/or\r
-modify it under the terms of the GNU General Public License\r
-as published by the Free Software Foundation; either version 2\r
-of the License, or (at your option) any later version.\r
-\r
-This program is distributed in the hope that it will be useful,\r
-but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-GNU General Public License for more details.\r
-\r
-You should have received a copy of the GNU General Public License\r
-along with this program; if not, write to the Free Software\r
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
-02110-1301, USA.\r
-*/\r
-\r
-/*\r
-\r
-npc_conversation.cpp - Split up file for NPC conversations (Trade and QuestStuff)\r
-\r
-CREATION: 11 Oct 2009 Namikon\r
-\r
-*/\r
-\r
-#include "main.h"\r
-#include "npc.h"\r
-#include "worlds.h"\r
-#include "npctemplate.h"\r
-#include "worlddatatemplate.h"\r
-#include "msgbuilder.h"\r
-\r
-///***********************************************************************\r
-\r
-bool PNPC::SetShopQuality(u8 nNewVal)\r
-{\r
- // Ignore that setting if NPC is loaded from .def\r
- if(mFromDEF == true)\r
- return false;\r
-\r
- if(nNewVal == 0)\r
- return false;\r
-\r
- mItemQuality = nNewVal;\r
- return true;\r
-}\r
-\r
-bool PNPC::ReloadShopList()\r
-{\r
- // Shop list will be reloaded uppon next click\r
- mVectItemsInShop.erase(mVectItemsInShop.begin(), mVectItemsInShop.end());\r
- return true;\r
-}\r
-\r
-void PNPC::AddToVectorList(u16 nItemID, u32 nPrice)\r
-{\r
- stShopListEntry tEntry;\r
- tEntry.ItemID = nItemID;\r
- tEntry.Price = nPrice;\r
- Console->Print("New item in buffer: %d price %d", tEntry.ItemID, tEntry.Price);\r
- mVectItemsInShop.push_back(tEntry);\r
-}\r
-\r
-void PNPC::ContentListAddItem(PMessage* nContentList, u16 nItemID, u32 nBasePrice, bool nAddToList)\r
-{\r
- // Items with baseprice = 0 are ignored!\r
- if(nBasePrice == 0)\r
- return;\r
-\r
- // Modify baseprice with Config value\r
- f32 tPerCent = Config->GetOptionInt("item_price");\r
- tPerCent = tPerCent / 100;\r
- u32 tPrice = nBasePrice * tPerCent;\r
- *nContentList << ( u16 ) nItemID;\r
- *nContentList << ( u32 )( tPrice );\r
-\r
- if(nAddToList)\r
- AddToVectorList(nItemID, tPrice);\r
-\r
- if (gDevDebug) Console->Print("[PNPC::ContentListAddItem] Adding item: ID: %d Price: %u", nItemID, tPrice);\r
-}\r
-\r
-void PNPC::ContentListAddItemGroup(PMessage* nContentList, u32 nItemGroupID)\r
-{\r
- const PDefItems* tDefItems = NULL;\r
- std::map<int, PDefItems*>::const_iterator itStart = GameDefs->Items()->ConstIteratorBegin();\r
- std::map<int, PDefItems*>::const_iterator itEnd = GameDefs->Items()->ConstIteratorEnd();\r
- for ( std::map<int, PDefItems*>::const_iterator i = itStart; i != itEnd; i++ )\r
- {\r
- tDefItems = i->second;\r
- if((u32)tDefItems->GetItemGroupID() == nItemGroupID)\r
- {\r
- // Pricing: Use Baseprice\r
- // If Baseprice is 0, use Quality * Techlevel * 2\r
- u32 tPrice = tDefItems->GetBasePrice();\r
- if(tPrice == 0)\r
- {\r
- tPrice = tDefItems->GetTechlevel() * mItemQuality * 2;\r
- }\r
-\r
- ContentListAddItem(nContentList, i->first, tPrice);\r
- }\r
- }\r
-}\r
-\r
-bool PNPC::DoSQLShoppingList( PClient* nClient, PMessage* nContentList )\r
-{\r
- MYSQL_RES *result = NULL;\r
- MYSQL_ROW row;\r
- char query[100];\r
-\r
- snprintf( query, 100, "SELECT * FROM `npc_shop` WHERE `c_npc_id` = %d AND `c_zoneid` = %d", mWorldID, nClient->GetChar()->GetLocation());\r
- if (gDevDebug) Console->Print( "[PNPC::DoSQLShoppingList] Executing query %s", query );\r
- result = MySQL->GameResQuery( query );\r
- if ( result == NULL )\r
- {\r
- Console->Print( YELLOW, BLACK, "[PNPC::DoSQLShoppingList] could not load shoplist from SQL" );\r
- Console->Print( "Query was:" );\r
- Console->Print( "%s", query );\r
- MySQL->ShowGameSQLError();\r
- return false;\r
- }\r
- if ( mysql_num_rows( result ) == 0 )\r
- {\r
- if (gDevDebug) Console->Print( YELLOW, BLACK, "[PNPC::DoSQLShoppingList] No items found in SQL for NPC %d", mWorldID);\r
- MySQL->FreeGameSQLResult( result );\r
- return false;\r
- }\r
-\r
- f32 tPerCent = Config->GetOptionInt("item_price");\r
- tPerCent = tPerCent / 100;\r
-\r
- while((row = mysql_fetch_row(result)))\r
- {\r
- const PDefItems* t_item = GameDefs->Items()->GetDef(atoi( row[2] ));\r
- if(t_item)\r
- {\r
- // Pricing: If no value in DB is set, use Baseprice\r
- // If Baseprice is 0, use Quality * Techlevel * 2\r
- u32 tPrice = atoi(row[3]);\r
- if(tPrice == 0)\r
- {\r
- tPrice = t_item->GetBasePrice();\r
- if(tPrice == 0)\r
- {\r
- tPrice = t_item->GetTechlevel() * mItemQuality * 2;\r
- }\r
- }\r
-\r
- // Modify price as told in config\r
- tPrice = tPrice * tPerCent;\r
- u16 tItemID = atoi(row[2]);\r
-\r
- *nContentList << ( u16 ) tItemID;\r
- *nContentList << ( u32 ) tPrice;\r
-\r
- // Store item position in list for later trade stuff\r
- AddToVectorList(tItemID, tPrice);\r
-\r
- if (gDevDebug) Console->Print("Adding item: ID: %d Price: %d", tItemID, tPrice);\r
- }\r
- }\r
- MySQL->FreeGameSQLResult( result );\r
- return true;\r
-}\r
-\r
-bool PNPC::IsAllbuyer( PClient* nClient )\r
-{\r
- MYSQL_RES *result = NULL;\r
- char query[100];\r
-\r
- snprintf( query, 100, "SELECT * FROM `npc_shop` WHERE `c_npc_id` = %d AND `c_zoneid` = %d and `c_itemid` = -1", mWorldID, nClient->GetChar()->GetLocation());\r
- Console->Print( "[PNPC::IsAllbuyer] Executing query %s", query );\r
- result = MySQL->GameResQuery( query );\r
- if ( result == NULL )\r
- {\r
- Console->Print( YELLOW, BLACK, "[PNPC::IsAllbuyer] could not check if npc is allbuyer" );\r
- Console->Print( "Query was:" );\r
- Console->Print( "%s", query );\r
- MySQL->ShowGameSQLError();\r
- return false;\r
- }\r
- int count = mysql_num_rows(result);\r
- MySQL->FreeGameSQLResult( result );\r
- if(count > 0)\r
- return true;\r
- else\r
- return false;\r
-}\r
-\r
-bool PNPC::HasSQLShoppingList( PClient* nClient )\r
-{\r
- MYSQL_RES *result = NULL;\r
- char query[100];\r
-\r
- snprintf( query, 100, "SELECT * FROM `npc_shop` WHERE `c_npc_id` = %d AND `c_zoneid` = %d", mWorldID, nClient->GetChar()->GetLocation());\r
- Console->Print( "[PNPC::HasSQLShoppingList] Executing query %s", query );\r
- result = MySQL->GameResQuery( query );\r
- if ( result == NULL )\r
- {\r
- Console->Print( YELLOW, BLACK, "[PNPC::HasSQLShoppingList] could not load shoplist from SQL" );\r
- Console->Print( "Query was:" );\r
- Console->Print( "%s", query );\r
- MySQL->ShowGameSQLError();\r
- return false;\r
- }\r
- int count = mysql_num_rows(result);\r
- MySQL->FreeGameSQLResult( result );\r
- if(count > 0)\r
- return true;\r
- else\r
- return false;\r
-}\r
-\r
-void PNPC::StartDialog( PClient* nClient/*, string &nDialogscript*/ )\r
-{\r
- std::string t_ScriptName = "";\r
- if(mFromDEF == false && mCustomLua.length() > 1)\r
- {\r
- char tmpnum[11];\r
- snprintf(tmpnum, 11, "%d", mID);\r
- t_ScriptName = tmpnum;\r
- }\r
- else\r
- {\r
- t_ScriptName = mDialogScript;\r
- }\r
-\r
- u32 tWorldID = GetRealWorldID();\r
- // Starts dialog with NPC\r
- // First, set required values in client's char\r
- nClient->GetChar()->SetDialogNPC(mWorldID);\r
- nClient->GetChar()->SetDialogNode(0);\r
-\r
- // Second generate start-dialog message\r
- PMessage* tmpMsg = MsgBuilder->BuildNPCStartDialogMsg(nClient, tWorldID, &t_ScriptName);\r
- nClient->SendUDPMessage(tmpMsg);\r
-\r
- Console->Print("[PNPC::StartDialog] Sending NPC DialogStart for Script %s", t_ScriptName.c_str());\r
- return;\r
-}\r
-\r
-void PNPC::StartConversation( PClient* nClient )\r
-{\r
- // Set Offset to mWorldID\r
- // .def NPCs need this offset in order to work\r
- u32 tRealID = GetRealWorldID();\r
-\r
- // Check if NPC has script for talking\r
- // OR\r
- // Check if NPC is from SQL and has a custom LUA script stored in DB\r
- if(mScripting == true)\r
- {\r
- if(mDialogScript.length() > 0 || (mFromDEF == false && mCustomLua.length() > 1))\r
- {\r
- StartDialog(nClient);\r
- return;\r
- }\r
- }\r
-\r
- // Check if NPC has a TradeID\r
- Console->Print("[DEBUG] NPC WorldID %u NPC TraderDefID %u", tRealID, mTrader);\r
- if(IsAllbuyer(nClient) == true)\r
- {\r
- PMessage* tmpMsg = MsgBuilder->BuildNPCBeginAllBuyerTradeMsg(nClient, tRealID);\r
- nClient->SendUDPMessage(tmpMsg);\r
-\r
- return;\r
- }\r
-\r
- if(mTrader > 0)\r
- {\r
- // NPC is a trader. Fetch trader template from def\r
- const PDefTrader* nTraderDef = GameDefs->Traders()->GetDef(mTrader);\r
-\r
- // Is the NPC a trading one? (Def-defined)\r
- if(nTraderDef)\r
- {\r
- // Preparing ItemList for shopping\r
- PMessage* ContentList = new PMessage();\r
-\r
- // Check if we already have our Vector filled with itemIDs\r
- if(mVectItemsInShop.size() > 0)\r
- {\r
- Console->Print("Using Vector shopping list");\r
- vector <stShopListEntry>::iterator it;\r
- for(it = mVectItemsInShop.begin(); it < mVectItemsInShop.end(); it++)\r
- ContentListAddItem(ContentList, (*it).ItemID, (*it).Price, false);\r
- }\r
- else\r
- {\r
- int t_ItemGroupID = nTraderDef->GetType();\r
- int t_CurrItem = 0;\r
- int t_DefItemEnt = nTraderDef->GetItemId(t_CurrItem);\r
- while(t_DefItemEnt != 0)\r
- {\r
- // Loop through all item(groups) in trader.def\r
- if(t_DefItemEnt < 0)\r
- {\r
- // We got a ItemGroup\r
- ContentListAddItemGroup(ContentList, (t_DefItemEnt * -1));\r
- }\r
- else\r
- {\r
- // We got a normal Item\r
- ContentListAddItem(ContentList, t_DefItemEnt, 0, nTraderDef->GetQuality());\r
- }\r
-\r
- t_DefItemEnt = nTraderDef->GetItemId(++t_CurrItem);\r
- }\r
- if (gDevDebug) Console->Print("[PNPC::StartConversation] TraderTemplate: %d, Type: %d", mTrader, t_ItemGroupID);\r
- }\r
-\r
-\r
- // Step 2: Send Packet to start trade\r
- PMessage* tmpMsg = MsgBuilder->BuildNPCShoppingListMsg(nClient, ContentList, tRealID, nTraderDef->GetQuality());\r
- nClient->FragmentAndSendUDPMessage(tmpMsg, 0xac);\r
-\r
- delete ContentList;\r
- }\r
- else\r
- {\r
- Console->Print( YELLOW, BLACK, "[PNPC::StartConversation] unknown/invalid traderID ignoring traderequest" );\r
- return;\r
- }\r
- }\r
- // Not a regular trader? Check if we have some SQL Based shopping list\r
- else if(HasSQLShoppingList(nClient) == true)\r
- {\r
- PMessage* ContentList = new PMessage();\r
- if(DoSQLShoppingList(nClient, ContentList) == true)\r
- {\r
- PMessage* tmpMsg = MsgBuilder->BuildNPCShoppingListMsg(nClient, ContentList, tRealID, mItemQuality);\r
- nClient->FragmentAndSendUDPMessage(tmpMsg, 0xac);\r
-\r
- delete ContentList;\r
- }\r
- else\r
- {\r
- Console->Print( RED, BLACK, "[PNPC::StartConversation] Failed to generate SQL Shopping list" );\r
- delete ContentList;\r
- }\r
- return;\r
- }\r
- else\r
- {\r
- // No script found? No shopping list? Well, then this NPC looks.. inactive :)\r
- if (gDevDebug) Console->Print("[PNPC::StartConversation] Inactive NPC");\r
- return;\r
- }\r
-}\r
-\r
-\r
-// DoConversation:\r
-// nClient : The client which startet the conversation / is doing it right now\r
-// nAnswer: the Answer the player clicked\r
-void PNPC::DoConversation( PClient* nClient, u8 nAnswer )\r
-{\r
- // LUA Engine v3: Let the LuaEngine handle everything!\r
- LuaEngine->ProcessDialogScript(nClient, mLUAFile, nAnswer);\r
-\r
- return;\r
-}\r
+/*
+TinNS (TinNS is not a Neocron Server)
+Copyright (C) 2005 Linux Addicted Community
+maintainer Akiko <akiko@gmx.org>
+
+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 (at your option) 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, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA.
+*/
+
+/*
+
+npc_conversation.cpp - Split up file for NPC conversations (Trade and QuestStuff)
+
+CREATION: 11 Oct 2009 Namikon
+
+*/
+
+#include "main.h"
+#include "include/npc.h"
+#include "include/worlds.h"
+#include "include/npctemplate.h"
+#include "include/worlddatatemplate.h"
+#include "include/msgbuilder.h"
+
+///***********************************************************************
+
+bool PNPC::SetShopQuality(u8 nNewVal)
+{
+ // Ignore that setting if NPC is loaded from .def
+ if(mFromDEF == true)
+ return false;
+
+ if(nNewVal == 0)
+ return false;
+
+ mItemQuality = nNewVal;
+ return true;
+}
+
+bool PNPC::ReloadShopList()
+{
+ // Shop list will be reloaded uppon next click
+ mVectItemsInShop.erase(mVectItemsInShop.begin(), mVectItemsInShop.end());
+ return true;
+}
+
+void PNPC::AddToVectorList(u16 nItemID, u32 nPrice)
+{
+ stShopListEntry tEntry;
+ tEntry.ItemID = nItemID;
+ tEntry.Price = nPrice;
+ Console->Print("New item in buffer: %d price %d", tEntry.ItemID, tEntry.Price);
+ mVectItemsInShop.push_back(tEntry);
+}
+
+void PNPC::ContentListAddItem(PMessage* nContentList, u16 nItemID, u32 nBasePrice, bool nAddToList)
+{
+ // Items with baseprice = 0 are ignored!
+ if(nBasePrice == 0)
+ return;
+
+ // Modify baseprice with Config value
+ f32 tPerCent = Config->GetOptionInt("item_price");
+ tPerCent = tPerCent / 100;
+ u32 tPrice = nBasePrice * tPerCent;
+ *nContentList << ( u16 ) nItemID;
+ *nContentList << ( u32 )( tPrice );
+
+ if(nAddToList)
+ AddToVectorList(nItemID, tPrice);
+
+ if (gDevDebug) Console->Print("[PNPC::ContentListAddItem] Adding item: ID: %d Price: %u", nItemID, tPrice);
+}
+
+void PNPC::ContentListAddItemGroup(PMessage* nContentList, u32 nItemGroupID)
+{
+ const PDefItems* tDefItems = NULL;
+ std::map<int, PDefItems*>::const_iterator itStart = GameDefs->Items()->ConstIteratorBegin();
+ std::map<int, PDefItems*>::const_iterator itEnd = GameDefs->Items()->ConstIteratorEnd();
+ for ( std::map<int, PDefItems*>::const_iterator i = itStart; i != itEnd; i++ )
+ {
+ tDefItems = i->second;
+ if((u32)tDefItems->GetItemGroupID() == nItemGroupID)
+ {
+ // Pricing: Use Baseprice
+ // If Baseprice is 0, use Quality * Techlevel * 2
+ u32 tPrice = tDefItems->GetBasePrice();
+ if(tPrice == 0)
+ {
+ tPrice = tDefItems->GetTechlevel() * mItemQuality * 2;
+ }
+
+ ContentListAddItem(nContentList, i->first, tPrice);
+ }
+ }
+}
+
+bool PNPC::DoSQLShoppingList( PClient* nClient, PMessage* nContentList )
+{
+ MYSQL_RES *result = NULL;
+ MYSQL_ROW row;
+ char query[100];
+
+ snprintf( query, 100, "SELECT * FROM `npc_shop` WHERE `c_npc_id` = %d AND `c_zoneid` = %d", mWorldID, nClient->GetChar()->GetLocation());
+ if (gDevDebug) Console->Print( "[PNPC::DoSQLShoppingList] Executing query %s", query );
+ result = MySQL->GameResQuery( query );
+ if ( result == NULL )
+ {
+ Console->Print( YELLOW, BLACK, "[PNPC::DoSQLShoppingList] could not load shoplist from SQL" );
+ Console->Print( "Query was:" );
+ Console->Print( "%s", query );
+ MySQL->ShowGameSQLError();
+ return false;
+ }
+ if ( mysql_num_rows( result ) == 0 )
+ {
+ if (gDevDebug) Console->Print( YELLOW, BLACK, "[PNPC::DoSQLShoppingList] No items found in SQL for NPC %d", mWorldID);
+ MySQL->FreeGameSQLResult( result );
+ return false;
+ }
+
+ f32 tPerCent = Config->GetOptionInt("item_price");
+ tPerCent = tPerCent / 100;
+
+ while((row = mysql_fetch_row(result)))
+ {
+ const PDefItems* t_item = GameDefs->Items()->GetDef(atoi( row[2] ));
+ if(t_item)
+ {
+ // Pricing: If no value in DB is set, use Baseprice
+ // If Baseprice is 0, use Quality * Techlevel * 2
+ u32 tPrice = atoi(row[3]);
+ if(tPrice == 0)
+ {
+ tPrice = t_item->GetBasePrice();
+ if(tPrice == 0)
+ {
+ tPrice = t_item->GetTechlevel() * mItemQuality * 2;
+ }
+ }
+
+ // Modify price as told in config
+ tPrice = tPrice * tPerCent;
+ u16 tItemID = atoi(row[2]);
+
+ *nContentList << ( u16 ) tItemID;
+ *nContentList << ( u32 ) tPrice;
+
+ // Store item position in list for later trade stuff
+ AddToVectorList(tItemID, tPrice);
+
+ if (gDevDebug) Console->Print("Adding item: ID: %d Price: %d", tItemID, tPrice);
+ }
+ }
+ MySQL->FreeGameSQLResult( result );
+ return true;
+}
+
+bool PNPC::IsAllbuyer( PClient* nClient )
+{
+ MYSQL_RES *result = NULL;
+ char query[100];
+
+ snprintf( query, 100, "SELECT * FROM `npc_shop` WHERE `c_npc_id` = %d AND `c_zoneid` = %d and `c_itemid` = -1", mWorldID, nClient->GetChar()->GetLocation());
+ Console->Print( "[PNPC::IsAllbuyer] Executing query %s", query );
+ result = MySQL->GameResQuery( query );
+ if ( result == NULL )
+ {
+ Console->Print( YELLOW, BLACK, "[PNPC::IsAllbuyer] could not check if npc is allbuyer" );
+ Console->Print( "Query was:" );
+ Console->Print( "%s", query );
+ MySQL->ShowGameSQLError();
+ return false;
+ }
+ int count = mysql_num_rows(result);
+ MySQL->FreeGameSQLResult( result );
+ if(count > 0)
+ return true;
+ else
+ return false;
+}
+
+bool PNPC::HasSQLShoppingList( PClient* nClient )
+{
+ MYSQL_RES *result = NULL;
+ char query[100];
+
+ snprintf( query, 100, "SELECT * FROM `npc_shop` WHERE `c_npc_id` = %d AND `c_zoneid` = %d", mWorldID, nClient->GetChar()->GetLocation());
+ Console->Print( "[PNPC::HasSQLShoppingList] Executing query %s", query );
+ result = MySQL->GameResQuery( query );
+ if ( result == NULL )
+ {
+ Console->Print( YELLOW, BLACK, "[PNPC::HasSQLShoppingList] could not load shoplist from SQL" );
+ Console->Print( "Query was:" );
+ Console->Print( "%s", query );
+ MySQL->ShowGameSQLError();
+ return false;
+ }
+ int count = mysql_num_rows(result);
+ MySQL->FreeGameSQLResult( result );
+ if(count > 0)
+ return true;
+ else
+ return false;
+}
+
+void PNPC::StartDialog( PClient* nClient/*, string &nDialogscript*/ )
+{
+ std::string t_ScriptName = "";
+ if(mFromDEF == false && mCustomLua.length() > 1)
+ {
+ char tmpnum[11];
+ snprintf(tmpnum, 11, "%d", mID);
+ t_ScriptName = tmpnum;
+ }
+ else
+ {
+ t_ScriptName = mDialogScript;
+ }
+
+ u32 tWorldID = GetRealWorldID();
+ // Starts dialog with NPC
+ // First, set required values in client's char
+ nClient->GetChar()->SetDialogNPC(mWorldID);
+ nClient->GetChar()->SetDialogNode(0);
+
+ // Second generate start-dialog message
+ PMessage* tmpMsg = MsgBuilder->BuildNPCStartDialogMsg(nClient, tWorldID, &t_ScriptName);
+ nClient->SendUDPMessage(tmpMsg);
+
+ Console->Print("[PNPC::StartDialog] Sending NPC DialogStart for Script %s", t_ScriptName.c_str());
+ return;
+}
+
+void PNPC::StartConversation( PClient* nClient )
+{
+ // Set Offset to mWorldID
+ // .def NPCs need this offset in order to work
+ u32 tRealID = GetRealWorldID();
+
+ // Check if NPC has script for talking
+ // OR
+ // Check if NPC is from SQL and has a custom LUA script stored in DB
+ if(mScripting == true)
+ {
+ if(mDialogScript.length() > 0 || (mFromDEF == false && mCustomLua.length() > 1))
+ {
+ StartDialog(nClient);
+ return;
+ }
+ }
+
+ // Check if NPC has a TradeID
+ Console->Print("[DEBUG] NPC WorldID %u NPC TraderDefID %u", tRealID, mTrader);
+ if(IsAllbuyer(nClient) == true)
+ {
+ PMessage* tmpMsg = MsgBuilder->BuildNPCBeginAllBuyerTradeMsg(nClient, tRealID);
+ nClient->SendUDPMessage(tmpMsg);
+
+ return;
+ }
+
+ if(mTrader > 0)
+ {
+ // NPC is a trader. Fetch trader template from def
+ const PDefTrader* nTraderDef = GameDefs->Traders()->GetDef(mTrader);
+
+ // Is the NPC a trading one? (Def-defined)
+ if(nTraderDef)
+ {
+ // Preparing ItemList for shopping
+ PMessage* ContentList = new PMessage();
+
+ // Check if we already have our Vector filled with itemIDs
+ if(mVectItemsInShop.size() > 0)
+ {
+ Console->Print("Using Vector shopping list");
+ std::vector<stShopListEntry>::iterator it;
+ for(it = mVectItemsInShop.begin(); it < mVectItemsInShop.end(); it++)
+ ContentListAddItem(ContentList, (*it).ItemID, (*it).Price, false);
+ }
+ else
+ {
+ int t_ItemGroupID = nTraderDef->GetType();
+ int t_CurrItem = 0;
+ int t_DefItemEnt = nTraderDef->GetItemId(t_CurrItem);
+ while(t_DefItemEnt != 0)
+ {
+ // Loop through all item(groups) in trader.def
+ if(t_DefItemEnt < 0)
+ {
+ // We got a ItemGroup
+ ContentListAddItemGroup(ContentList, (t_DefItemEnt * -1));
+ }
+ else
+ {
+ // We got a normal Item
+ ContentListAddItem(ContentList, t_DefItemEnt, 0, nTraderDef->GetQuality());
+ }
+
+ t_DefItemEnt = nTraderDef->GetItemId(++t_CurrItem);
+ }
+ if (gDevDebug) Console->Print("[PNPC::StartConversation] TraderTemplate: %d, Type: %d", mTrader, t_ItemGroupID);
+ }
+
+
+ // Step 2: Send Packet to start trade
+ PMessage* tmpMsg = MsgBuilder->BuildNPCShoppingListMsg(nClient, ContentList, tRealID, nTraderDef->GetQuality());
+ nClient->FragmentAndSendUDPMessage(tmpMsg, 0xac);
+
+ delete ContentList;
+ }
+ else
+ {
+ Console->Print( YELLOW, BLACK, "[PNPC::StartConversation] unknown/invalid traderID ignoring traderequest" );
+ return;
+ }
+ }
+ // Not a regular trader? Check if we have some SQL Based shopping list
+ else if(HasSQLShoppingList(nClient) == true)
+ {
+ PMessage* ContentList = new PMessage();
+ if(DoSQLShoppingList(nClient, ContentList) == true)
+ {
+ PMessage* tmpMsg = MsgBuilder->BuildNPCShoppingListMsg(nClient, ContentList, tRealID, mItemQuality);
+ nClient->FragmentAndSendUDPMessage(tmpMsg, 0xac);
+
+ delete ContentList;
+ }
+ else
+ {
+ Console->Print( RED, BLACK, "[PNPC::StartConversation] Failed to generate SQL Shopping list" );
+ delete ContentList;
+ }
+ return;
+ }
+ else
+ {
+ // No script found? No shopping list? Well, then this NPC looks.. inactive :)
+ if (gDevDebug) Console->Print("[PNPC::StartConversation] Inactive NPC");
+ return;
+ }
+}
+
+
+// DoConversation:
+// nClient : The client which startet the conversation / is doing it right now
+// nAnswer: the Answer the player clicked
+void PNPC::DoConversation( PClient* nClient, u8 nAnswer )
+{
+ // LUA Engine v3: Let the LuaEngine handle everything!
+ LuaEngine->ProcessDialogScript(nClient, mLUAFile, nAnswer);
+
+ return;
+}
/*
- TinNS (TinNS is not a Neocron Server)
- Copyright (C) 2005 Linux Addicted Community
+ TinNS (TinNS is not a Neocron Server)
+ Copyright (C) 2005 Linux Addicted Community
- 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 (at your option) any later version.
+ 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 (at your option) 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.
+ 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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
*/
#include "main.h"
-#include "npctemplate.h"
+#include "include/npctemplate.h"
PNPCTemplate::PNPCTemplate()
{
*/
#include "main.h"
-#include "msgbuilder.h"
+#include "include/msgbuilder.h"
POutpost::POutpost()
{
{\r
nLength = tMax;\r
}\r
-\r
+ \r
return mysql_real_escape_string(game_dbHandle, dText, nText, nLength);\r
}\r
\r
\r
\r
/*\r
- subway.h - subway class\r
+ subway.h - subway class\r
\r
MODIFIED: 9 Nov 2007 Hammag\r
REASON: - creation\r
- \r
+ MODIFIED: 09 Jun 2009 Akiko\r
+ REASON: - adjusted includes for new buildsystem\r
*/\r
\r
/*\r
\r
*/\r
\r
+\r
#include "main.h"\r
-#include "subway.h"\r
-#include "chars.h" // for PCharCoordinates only\r
+\r
+#include "include/subway.h"\r
+#include "include/chars.h" // for PCharCoordinates only\r
+\r
\r
// Determines relative position of cabs, but how ???\r
const u16 PSubway::mSubwayInitData [] = {0x4396, 0x4387, 0x4370, 0x4352, 0x4334, 0x4316, 0x42f0, 0x42b4, 0x4270, 0x41f0, 0x0000};\r
MODIFIED: 08 Jan 2007 Namikon
REASON: - Created
-
+ MODIFIED: 09 Jun 2009 Akiko
+ REASON: - adjusted includes for new buildsystem
*/
+
#include "main.h"
-#include "terminal.h"\r
-#include "msgbuilder.h"
-\r
-\r
-PTerminal::PTerminal()\r
-{\r
- snprintf(mConPrefix, 50, "[PConsole]");\r
- EraseVars();\r
-}\r
-\r
-void PTerminal::EraseVars()\r
-{\r
- memset(mSQLQuery, '\0', 500);\r
- mResultFields = 0;\r
-}\r
+#include "include/terminal.h"
+#include "include/msgbuilder.h"
+
+
+PTerminal::PTerminal()
+{
+ snprintf(mConPrefix, 50, "[PConsole]");
+ EraseVars();
+}
+
+void PTerminal::EraseVars()
+{
+ memset(mSQLQuery, '\0', 500);
+ mResultFields = 0;
+}
u8 PTerminal::GetNewEmailCount(PClient* nClient, bool nNoticeClient)
{
row = mysql_fetch_row(result);
u8 tRetVal = (u8)atoi(row[0]);
MySQL->FreeGameSQLResult(result);
-\r
- if(nNoticeClient)\r
+
+ if(nNoticeClient)
{
- PMessage* tmpMsg = MsgBuilder->BuildYouGotEmailsMsg(nClient, tRetVal);\r
- nClient->SendUDPMessage(tmpMsg);\r
+ PMessage* tmpMsg = MsgBuilder->BuildYouGotEmailsMsg(nClient, tRetVal);
+ nClient->SendUDPMessage(tmpMsg);
}
+
return tRetVal;
}
-/*\r
- TinNS (TinNS is not a Neocron Server)\r
- Copyright (C) 2005 Linux Addicted Community\r
- maintainer Akiko <akiko@gmx.org>\r
-\r
- This program is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU General Public License\r
- as published by the Free Software Foundation; either version 2\r
- of the License, or (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
- 02110-1301, USA.\r
-*/\r
-\r
-\r
-\r
-/*\r
- terminal_querydb.cpp - Management class for Terminal actions (Citycom, keys, vehicledepot, ...)\r
- > Sub-File for terminal "ReceiveDB" command\r
-\r
- MODIFIED: 18 Oct 2009 Namikon\r
- REASON: - Created\r
-\r
-*/\r
-\r
-#include "main.h"\r
-#include "terminal.h"\r
-#include "msgbuilder.h"\r
-\r
-\r
-bool PTerminal::HandleQueryDB(PClient* nClient, std::string *nDBCommandName, std::string *nCommandName, std::string *nOptions, u8 nNumOptions)\r
-{\r
+/*
+ TinNS (TinNS is not a Neocron Server)
+ Copyright (C) 2005 Linux Addicted Community
+ maintainer Akiko <akiko@gmx.org>
+
+ 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 (at your option) 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, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
+*/
+
+
+
+/*
+ terminal_querydb.cpp - Management class for Terminal actions (Citycom, keys, vehicledepot, ...)
+ > Sub-File for terminal "ReceiveDB" command
+
+ MODIFIED: 18 Oct 2009 Namikon
+ REASON: - Created
+
+*/
+
+#include "main.h"
+#include "include/terminal.h"
+#include "include/msgbuilder.h"
+
+
+bool PTerminal::HandleQueryDB(PClient* nClient, std::string *nDBCommandName, std::string *nCommandName, std::string *nOptions, u8 nNumOptions)
+{
EraseVars();
- bool tOk = false;\r
-\r
- if(!strcmp(nDBCommandName->c_str(), "ACM"))\r
- {\r
- Console->Print("%s [PTerminal::HandleQueryDB] Nothing to do; Function not written yet: %s", Console->ColorText(YELLOW,BLACK,"Notice"), nDBCommandName->c_str());\r
- }\r
- else if(!strcmp(nDBCommandName->c_str(), "CHANGELEADER"))\r
- {\r
- Console->Print("%s [PTerminal::HandleQueryDB] Nothing to do; Function not written yet: %s", Console->ColorText(YELLOW,BLACK,"Notice"), nDBCommandName->c_str());\r
- }\r
- else if(!strcmp(nDBCommandName->c_str(), "CHANGERANK"))\r
- {\r
- Console->Print("%s [PTerminal::HandleQueryDB] Nothing to do; Function not written yet: %s", Console->ColorText(YELLOW,BLACK,"Notice"), nDBCommandName->c_str());\r
- }\r
- else if(!strcmp(nDBCommandName->c_str(), "CHECKRUNNER"))\r
- {\r
- Console->Print("%s [PTerminal::HandleQueryDB] Nothing to do; Function not written yet: %s", Console->ColorText(YELLOW,BLACK,"Notice"), nDBCommandName->c_str());\r
- }\r
- else if(!strcmp(nDBCommandName->c_str(), "CSM"))\r
- {\r
- Console->Print("%s [PTerminal::HandleQueryDB] Nothing to do; Function not written yet: %s", Console->ColorText(YELLOW,BLACK,"Notice"), nDBCommandName->c_str());\r
- }\r
- else if(!strcmp(nDBCommandName->c_str(), "DELETECLAN"))\r
- {\r
- Console->Print("%s [PTerminal::HandleQueryDB] Nothing to do; Function not written yet: %s", Console->ColorText(YELLOW,BLACK,"Notice"), nDBCommandName->c_str());\r
- }\r
- else if(!strcmp(nDBCommandName->c_str(), "DISMISSMEMBER"))\r
- {\r
- Console->Print("%s [PTerminal::HandleQueryDB] Nothing to do; Function not written yet: %s", Console->ColorText(YELLOW,BLACK,"Notice"), nDBCommandName->c_str());\r
- }\r
- else if(!strcmp(nDBCommandName->c_str(), "DISMISSVEHICLE"))\r
- {\r
- Console->Print("%s [PTerminal::HandleQueryDB] Nothing to do; Function not written yet: %s", Console->ColorText(YELLOW,BLACK,"Notice"), nDBCommandName->c_str());\r
- }\r
- else if(!strcmp(nDBCommandName->c_str(), "GIVEMONEY"))\r
- {\r
- Console->Print("%s [PTerminal::HandleQueryDB] Nothing to do; Function not written yet: %s", Console->ColorText(YELLOW,BLACK,"Notice"), nDBCommandName->c_str());\r
- }\r
- else if(!strcmp(nDBCommandName->c_str(), "JOINCLAN"))\r
- {\r
- Console->Print("%s [PTerminal::HandleQueryDB] Nothing to do; Function not written yet: %s", Console->ColorText(YELLOW,BLACK,"Notice"), nDBCommandName->c_str());\r
- }\r
- else if(!strcmp(nDBCommandName->c_str(), "KICKPLAYER"))\r
- {\r
- Console->Print("%s [PTerminal::HandleQueryDB] Nothing to do; Function not written yet: %s", Console->ColorText(YELLOW,BLACK,"Notice"), nDBCommandName->c_str());\r
- }\r
- else if(!strcmp(nDBCommandName->c_str(), "QUITCLAN"))\r
- {\r
- Console->Print("%s [PTerminal::HandleQueryDB] Nothing to do; Function not written yet: %s", Console->ColorText(YELLOW,BLACK,"Notice"), nDBCommandName->c_str());\r
- }\r
- else if(!strcmp(nDBCommandName->c_str(), "REPAIRVEHICLE"))\r
- {\r
- Console->Print("%s [PTerminal::HandleQueryDB] Nothing to do; Function not written yet: %s", Console->ColorText(YELLOW,BLACK,"Notice"), nDBCommandName->c_str());\r
- }\r
- else if(!strcmp(nDBCommandName->c_str(), "SPAWNVEHICLE"))\r
- {\r
- Console->Print("%s [PTerminal::HandleQueryDB] Nothing to do; Function not written yet: %s", Console->ColorText(YELLOW,BLACK,"Notice"), nDBCommandName->c_str());\r
- }\r
- else if(!strcmp(nDBCommandName->c_str(), "TAKEFACTIONMONEY"))\r
- {\r
- Console->Print("%s [PTerminal::HandleQueryDB] Nothing to do; Function not written yet: %s", Console->ColorText(YELLOW,BLACK,"Notice"), nDBCommandName->c_str());\r
- }\r
- else if(!strcmp(nDBCommandName->c_str(), "TAKEMONEY"))\r
- {\r
- Console->Print("%s [PTerminal::HandleQueryDB] Nothing to do; Function not written yet: %s", Console->ColorText(YELLOW,BLACK,"Notice"), nDBCommandName->c_str());\r
- }\r
- else if(!strcmp(nDBCommandName->c_str(), "TRADESTOCKX"))\r
- {\r
- Console->Print("%s [PTerminal::HandleQueryDB] Nothing to do; Function not written yet: %s", Console->ColorText(YELLOW,BLACK,"Notice"), nDBCommandName->c_str());\r
- }\r
- else if(!strcmp(nDBCommandName->c_str(), "WARPPLAYER"))\r
- {\r
- Console->Print("%s [PTerminal::HandleQueryDB] Nothing to do; Function not written yet: %s", Console->ColorText(YELLOW,BLACK,"Notice"), nDBCommandName->c_str());\r
- }\r
- else if(!strcmp(nDBCommandName->c_str(), "WARPPLAYERTOWORLD"))\r
- {\r
- Console->Print("%s [PTerminal::HandleQueryDB] Nothing to do; Function not written yet: %s", Console->ColorText(YELLOW,BLACK,"Notice"), nDBCommandName->c_str());\r
- }\r
- else\r
- {\r
- // Ok this REALLY should'nt happen.. But who knows..?\r
- Console->Print("%s [PTerminal::HandleQueryDB] Unknown ServerMessage: %s", Console->ColorText(RED,BLACK,"Error"), nDBCommandName->c_str());\r
- return false;\r
- }\r
-\r
- return tOk;\r
-}\r
+ bool tOk = false;
+
+ if(!strcmp(nDBCommandName->c_str(), "ACM"))
+ {
+ Console->Print("%s [PTerminal::HandleQueryDB] Nothing to do; Function not written yet: %s", Console->ColorText(YELLOW,BLACK,"Notice"), nDBCommandName->c_str());
+ }
+ else if(!strcmp(nDBCommandName->c_str(), "CHANGELEADER"))
+ {
+ Console->Print("%s [PTerminal::HandleQueryDB] Nothing to do; Function not written yet: %s", Console->ColorText(YELLOW,BLACK,"Notice"), nDBCommandName->c_str());
+ }
+ else if(!strcmp(nDBCommandName->c_str(), "CHANGERANK"))
+ {
+ Console->Print("%s [PTerminal::HandleQueryDB] Nothing to do; Function not written yet: %s", Console->ColorText(YELLOW,BLACK,"Notice"), nDBCommandName->c_str());
+ }
+ else if(!strcmp(nDBCommandName->c_str(), "CHECKRUNNER"))
+ {
+ Console->Print("%s [PTerminal::HandleQueryDB] Nothing to do; Function not written yet: %s", Console->ColorText(YELLOW,BLACK,"Notice"), nDBCommandName->c_str());
+ }
+ else if(!strcmp(nDBCommandName->c_str(), "CSM"))
+ {
+ Console->Print("%s [PTerminal::HandleQueryDB] Nothing to do; Function not written yet: %s", Console->ColorText(YELLOW,BLACK,"Notice"), nDBCommandName->c_str());
+ }
+ else if(!strcmp(nDBCommandName->c_str(), "DELETECLAN"))
+ {
+ Console->Print("%s [PTerminal::HandleQueryDB] Nothing to do; Function not written yet: %s", Console->ColorText(YELLOW,BLACK,"Notice"), nDBCommandName->c_str());
+ }
+ else if(!strcmp(nDBCommandName->c_str(), "DISMISSMEMBER"))
+ {
+ Console->Print("%s [PTerminal::HandleQueryDB] Nothing to do; Function not written yet: %s", Console->ColorText(YELLOW,BLACK,"Notice"), nDBCommandName->c_str());
+ }
+ else if(!strcmp(nDBCommandName->c_str(), "DISMISSVEHICLE"))
+ {
+ Console->Print("%s [PTerminal::HandleQueryDB] Nothing to do; Function not written yet: %s", Console->ColorText(YELLOW,BLACK,"Notice"), nDBCommandName->c_str());
+ }
+ else if(!strcmp(nDBCommandName->c_str(), "GIVEMONEY"))
+ {
+ Console->Print("%s [PTerminal::HandleQueryDB] Nothing to do; Function not written yet: %s", Console->ColorText(YELLOW,BLACK,"Notice"), nDBCommandName->c_str());
+ }
+ else if(!strcmp(nDBCommandName->c_str(), "JOINCLAN"))
+ {
+ Console->Print("%s [PTerminal::HandleQueryDB] Nothing to do; Function not written yet: %s", Console->ColorText(YELLOW,BLACK,"Notice"), nDBCommandName->c_str());
+ }
+ else if(!strcmp(nDBCommandName->c_str(), "KICKPLAYER"))
+ {
+ Console->Print("%s [PTerminal::HandleQueryDB] Nothing to do; Function not written yet: %s", Console->ColorText(YELLOW,BLACK,"Notice"), nDBCommandName->c_str());
+ }
+ else if(!strcmp(nDBCommandName->c_str(), "QUITCLAN"))
+ {
+ Console->Print("%s [PTerminal::HandleQueryDB] Nothing to do; Function not written yet: %s", Console->ColorText(YELLOW,BLACK,"Notice"), nDBCommandName->c_str());
+ }
+ else if(!strcmp(nDBCommandName->c_str(), "REPAIRVEHICLE"))
+ {
+ Console->Print("%s [PTerminal::HandleQueryDB] Nothing to do; Function not written yet: %s", Console->ColorText(YELLOW,BLACK,"Notice"), nDBCommandName->c_str());
+ }
+ else if(!strcmp(nDBCommandName->c_str(), "SPAWNVEHICLE"))
+ {
+ Console->Print("%s [PTerminal::HandleQueryDB] Nothing to do; Function not written yet: %s", Console->ColorText(YELLOW,BLACK,"Notice"), nDBCommandName->c_str());
+ }
+ else if(!strcmp(nDBCommandName->c_str(), "TAKEFACTIONMONEY"))
+ {
+ Console->Print("%s [PTerminal::HandleQueryDB] Nothing to do; Function not written yet: %s", Console->ColorText(YELLOW,BLACK,"Notice"), nDBCommandName->c_str());
+ }
+ else if(!strcmp(nDBCommandName->c_str(), "TAKEMONEY"))
+ {
+ Console->Print("%s [PTerminal::HandleQueryDB] Nothing to do; Function not written yet: %s", Console->ColorText(YELLOW,BLACK,"Notice"), nDBCommandName->c_str());
+ }
+ else if(!strcmp(nDBCommandName->c_str(), "TRADESTOCKX"))
+ {
+ Console->Print("%s [PTerminal::HandleQueryDB] Nothing to do; Function not written yet: %s", Console->ColorText(YELLOW,BLACK,"Notice"), nDBCommandName->c_str());
+ }
+ else if(!strcmp(nDBCommandName->c_str(), "WARPPLAYER"))
+ {
+ Console->Print("%s [PTerminal::HandleQueryDB] Nothing to do; Function not written yet: %s", Console->ColorText(YELLOW,BLACK,"Notice"), nDBCommandName->c_str());
+ }
+ else if(!strcmp(nDBCommandName->c_str(), "WARPPLAYERTOWORLD"))
+ {
+ Console->Print("%s [PTerminal::HandleQueryDB] Nothing to do; Function not written yet: %s", Console->ColorText(YELLOW,BLACK,"Notice"), nDBCommandName->c_str());
+ }
+ else
+ {
+ // Ok this REALLY should'nt happen.. But who knows..?
+ Console->Print("%s [PTerminal::HandleQueryDB] Unknown ServerMessage: %s", Console->ColorText(RED,BLACK,"Error"), nDBCommandName->c_str());
+ return false;
+ }
+
+ return tOk;
+}
\r
/*\r
terminal_receivedb.cpp - Management class for Terminal actions (Citycom, keys, vehicledepot, ...)\r
- > Sub-File for terminal "ReceiveDB" command\r
+ Sub-File for terminal "ReceiveDB" command\r
\r
MODIFIED: 12 Jan 2007 Namikon\r
REASON: - Created\r
-\r
+ MODIFIED: 09 Jun 2009 Akiko\r
+ REASON: - adjusted includes for new buildsystem\r
*/\r
\r
+\r
#include "main.h"\r
-#include "terminal.h"\r
-#include "msgbuilder.h"\r
+\r
+#include "include/terminal.h"\r
+#include "include/msgbuilder.h"\r
\r
bool PTerminal::HandleReceiveDB(PClient* nClient, u16 mTerminalSessionId, std::string *nCommandName, std::string *nOptions, u8 nNumOptions, u16 nDBID, u8 nUnknown)\r
{\r
- EraseVars();
- int nAccessLevel = nClient->GetAccountLevel();
+ EraseVars();\r
+ int nAccessLevel = nClient->GetAccountLevel();\r
//Console->Print("DBID: %d", nDBID);\r
\r
switch (nDBID)\r
{\r
case 8:\r
- if(!ChkOpt(nNumOptions, 2)) break;
- mResultFields = 6;
- if(!strncmp(nOptions[0].c_str(), "date", 4))
- //snprintf (mSQLQuery, 500, "SELECT nc_id, nc_icon, nc_datetime, c_name, nc_name, nc_approved FROM `neochronicle` INNER JOIN characters ON (nc_author = c_id) ORDER BY nc_datetime DESC LIMIT %d, %d", atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));
- snprintf (mSQLQuery, 500, "SELECT nc_id, nc_icon, nc_datetime, nc_author, nc_name, nc_approved FROM `neochronicle` ORDER BY nc_datetime DESC LIMIT %d, %d", atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));
- else
- //snprintf (mSQLQuery, 500, "SELECT nc_id, nc_icon, nc_datetime, c_name, nc_name, nc_approved FROM `neochronicle` INNER JOIN characters ON (nc_author = c_id) ORDER BY nc_datetime DESC LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()));
- snprintf (mSQLQuery, 500, "SELECT nc_id, nc_icon, nc_datetime, nc_author, nc_name, nc_approved FROM `neochronicle` ORDER BY nc_datetime DESC LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()));
-
+ if(!ChkOpt(nNumOptions, 2)) break;\r
+ mResultFields = 6;\r
+ if(!strncmp(nOptions[0].c_str(), "date", 4))\r
+ //snprintf (mSQLQuery, 500, "SELECT nc_id, nc_icon, nc_datetime, c_name, nc_name, nc_approved FROM `neochronicle` INNER JOIN characters ON (nc_author = c_id) ORDER BY nc_datetime DESC LIMIT %d, %d", atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));\r
+ snprintf (mSQLQuery, 500, "SELECT nc_id, nc_icon, nc_datetime, nc_author, nc_name, nc_approved FROM `neochronicle` ORDER BY nc_datetime DESC LIMIT %d, %d", atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));\r
+ else\r
+ //snprintf (mSQLQuery, 500, "SELECT nc_id, nc_icon, nc_datetime, c_name, nc_name, nc_approved FROM `neochronicle` INNER JOIN characters ON (nc_author = c_id) ORDER BY nc_datetime DESC LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()));\r
+ snprintf (mSQLQuery, 500, "SELECT nc_id, nc_icon, nc_datetime, nc_author, nc_name, nc_approved FROM `neochronicle` ORDER BY nc_datetime DESC LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()));\r
+\r
break;\r
case 9:\r
- if(!ChkOpt(nNumOptions, 2)) break;
- mResultFields = 6;
- if(!strncmp(nOptions[0].c_str(), "date", 4))
- //snprintf (mSQLQuery, 500, "SELECT nc_id, nc_icon, nc_datetime, c_name, nc_name, nc_approved FROM `neochronicle` INNER JOIN characters ON (nc_author = c_id) WHERE nc_approved = 1 ORDER BY nc_datetime DESC LIMIT %d, %d", atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));
- snprintf (mSQLQuery, 500, "SELECT nc_id, nc_icon, nc_datetime, nc_author, nc_name, nc_approved FROM `neochronicle` WHERE nc_approved = 1 ORDER BY nc_datetime DESC LIMIT %d, %d", atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));
- else
- //snprintf (mSQLQuery, 500, "SELECT nc_id, nc_icon, nc_datetime, c_name, nc_name, nc_approved FROM `neochronicle` INNER JOIN characters ON (nc_author = c_id) WHERE nc_approved = 1 ORDER BY nc_datetime DESC LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()));
- snprintf (mSQLQuery, 500, "SELECT nc_id, nc_icon, nc_datetime, nc_author, nc_name, nc_approved FROM `neochronicle` WHERE nc_approved = 1 ORDER BY nc_datetime DESC LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()));
-
- break;
+ if(!ChkOpt(nNumOptions, 2)) break;\r
+ mResultFields = 6;\r
+ if(!strncmp(nOptions[0].c_str(), "date", 4))\r
+ //snprintf (mSQLQuery, 500, "SELECT nc_id, nc_icon, nc_datetime, c_name, nc_name, nc_approved FROM `neochronicle` INNER JOIN characters ON (nc_author = c_id) WHERE nc_approved = 1 ORDER BY nc_datetime DESC LIMIT %d, %d", atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));\r
+ snprintf (mSQLQuery, 500, "SELECT nc_id, nc_icon, nc_datetime, nc_author, nc_name, nc_approved FROM `neochronicle` WHERE nc_approved = 1 ORDER BY nc_datetime DESC LIMIT %d, %d", atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));\r
+ else\r
+ //snprintf (mSQLQuery, 500, "SELECT nc_id, nc_icon, nc_datetime, c_name, nc_name, nc_approved FROM `neochronicle` INNER JOIN characters ON (nc_author = c_id) WHERE nc_approved = 1 ORDER BY nc_datetime DESC LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()));\r
+ snprintf (mSQLQuery, 500, "SELECT nc_id, nc_icon, nc_datetime, nc_author, nc_name, nc_approved FROM `neochronicle` WHERE nc_approved = 1 ORDER BY nc_datetime DESC LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()));\r
+\r
+ break;\r
case 10:\r
- if(!ChkOpt(nNumOptions, 2)) break;
- mResultFields = 6;
- if(!strncmp(nOptions[0].c_str(), "date", 4))
- //snprintf (mSQLQuery, 500, "SELECT nc_id, nc_icon, nc_datetime, c_name, nc_name, nc_approved FROM `neochronicle` INNER JOIN characters ON (nc_author = c_id) WHERE nc_approved = 0 ORDER BY nc_datetime DESC LIMIT %d, %d", atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));
- snprintf (mSQLQuery, 500, "SELECT nc_id, nc_icon, nc_datetime, nc_author, nc_name, nc_approved FROM `neochronicle` WHERE nc_approved = 0 ORDER BY nc_datetime DESC LIMIT %d, %d", atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));
- else
- //snprintf (mSQLQuery, 500, "SELECT nc_id, nc_icon, nc_datetime, c_name, nc_name, nc_approved FROM `neochronicle` INNER JOIN characters ON (nc_author = c_id) WHERE nc_approved = 0 ORDER BY nc_datetime DESC LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()));
- snprintf (mSQLQuery, 500, "SELECT nc_id, nc_icon, nc_datetime, nc_author, nc_name, nc_approved FROM `neochronicle` WHERE nc_approved = 0 ORDER BY nc_datetime DESC LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()));
-
- break;
- case 11:
+ if(!ChkOpt(nNumOptions, 2)) break;\r
+ mResultFields = 6;\r
+ if(!strncmp(nOptions[0].c_str(), "date", 4))\r
+ //snprintf (mSQLQuery, 500, "SELECT nc_id, nc_icon, nc_datetime, c_name, nc_name, nc_approved FROM `neochronicle` INNER JOIN characters ON (nc_author = c_id) WHERE nc_approved = 0 ORDER BY nc_datetime DESC LIMIT %d, %d", atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));\r
+ snprintf (mSQLQuery, 500, "SELECT nc_id, nc_icon, nc_datetime, nc_author, nc_name, nc_approved FROM `neochronicle` WHERE nc_approved = 0 ORDER BY nc_datetime DESC LIMIT %d, %d", atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));\r
+ else\r
+ //snprintf (mSQLQuery, 500, "SELECT nc_id, nc_icon, nc_datetime, c_name, nc_name, nc_approved FROM `neochronicle` INNER JOIN characters ON (nc_author = c_id) WHERE nc_approved = 0 ORDER BY nc_datetime DESC LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()));\r
+ snprintf (mSQLQuery, 500, "SELECT nc_id, nc_icon, nc_datetime, nc_author, nc_name, nc_approved FROM `neochronicle` WHERE nc_approved = 0 ORDER BY nc_datetime DESC LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()));\r
+\r
+ break;\r
+ case 11:\r
if(!ChkOpt(nNumOptions, 1)) break;\r
- mResultFields = 6;
- //snprintf (mSQLQuery, 500, "SELECT nc_id, nc_icon, nc_datetime, c_name, nc_name, nc_content FROM `neochronicle` INNER JOIN characters ON (nc_author = c_id) WHERE nc_id = %d", atoi(nOptions[0].c_str()));
- snprintf (mSQLQuery, 500, "SELECT nc_id, nc_icon, nc_datetime, nc_author, nc_name, nc_content FROM `neochronicle` WHERE nc_id = %d", atoi(nOptions[0].c_str()));
- //snprintf (mSQLQuery, 500, "SELECT na_id, \'\', na_datetime, na_author, na_name, na_content FROM `neocron articles` WHERE na_approval = 1 AND na_id = %d", atoi(nOptions[0].c_str()));
+ mResultFields = 6;\r
+ //snprintf (mSQLQuery, 500, "SELECT nc_id, nc_icon, nc_datetime, c_name, nc_name, nc_content FROM `neochronicle` INNER JOIN characters ON (nc_author = c_id) WHERE nc_id = %d", atoi(nOptions[0].c_str()));\r
+ snprintf (mSQLQuery, 500, "SELECT nc_id, nc_icon, nc_datetime, nc_author, nc_name, nc_content FROM `neochronicle` WHERE nc_id = %d", atoi(nOptions[0].c_str()));\r
+ //snprintf (mSQLQuery, 500, "SELECT na_id, \'\', na_datetime, na_author, na_name, na_content FROM `neocron articles` WHERE na_approval = 1 AND na_id = %d", atoi(nOptions[0].c_str()));\r
\r
break;\r
- case 14:
- // 0: ID 1: Short 2: Clanname 3: FactionID 4: Faction Symp
- if(!ChkOpt(nNumOptions, 3)) break;
- mResultFields = 6; // TODO: replace 0 with average faction sympathy
+ case 14:\r
+ // 0: ID 1: Short 2: Clanname 3: FactionID 4: Faction Symp\r
+ if(!ChkOpt(nNumOptions, 3)) break;\r
+ mResultFields = 6; // TODO: replace 0 with average faction sympathy\r
snprintf (mSQLQuery, 500, "SELECT cl_id, cl_shortdesc, cl_name, cl_faction, \"0\", \"0\" FROM `clans` WHERE cl_name LIKE \"%%%s%%\" LIMIT %d, %d", nOptions[0].c_str(), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));\r
\r
break;\r
- case 16:
+ case 16:\r
if(!ChkOpt(nNumOptions, 3)) break;\r
- if (!strcmp (nOptions[0].c_str(), "Neocronicle"))
- {
- mResultFields = 5;
- snprintf (mSQLQuery, 500, "SELECT na_id, \'0\', na_datetime, na_author, na_name FROM `neocron articles` WHERE na_approval = 1 LIMIT %s, %s", nOptions[1].c_str(), nOptions[2].c_str());
- }
- else
- {
- mResultFields = 7;
- snprintf (mSQLQuery, 500, "SELECT na_id, \'0\', na_datetime, na_author, na_name, na_approval, \"0\" FROM `neocron articles` LIMIT %s, %s", nOptions[1].c_str(), nOptions[2].c_str());
+ if (!strcmp (nOptions[0].c_str(), "Neocronicle"))\r
+ {\r
+ mResultFields = 5;\r
+ snprintf (mSQLQuery, 500, "SELECT na_id, \'0\', na_datetime, na_author, na_name FROM `neocron articles` WHERE na_approval = 1 LIMIT %s, %s", nOptions[1].c_str(), nOptions[2].c_str());\r
+ }\r
+ else\r
+ {\r
+ mResultFields = 7;\r
+ snprintf (mSQLQuery, 500, "SELECT na_id, \'0\', na_datetime, na_author, na_name, na_approval, \"0\" FROM `neocron articles` LIMIT %s, %s", nOptions[1].c_str(), nOptions[2].c_str());\r
}\r
-
- break;\r
- case 18:
- if(!ChkOpt(nNumOptions, 1)) break;
- mResultFields = 1;
- snprintf (mSQLQuery, 500, "SELECT c_name FROM characters WHERE c_id = %d", atoi(nOptions[0].c_str()));
-\r
- break;\r
- case 20:
- case 21:
- // Select either c_"name" or c_"minsympathy". Names taken from option, saves if/else
- if(!ChkOpt(nNumOptions, 2)) break;
- mResultFields = 1;
- snprintf (mSQLQuery, 500, "SELECT `cl_%s` FROM `clans` WHERE `cl_id` = %d", nOptions[0].c_str(), atoi(nOptions[1].c_str()));
-
- break;
+\r
+ break;\r
+ case 18:\r
+ if(!ChkOpt(nNumOptions, 1)) break;\r
+ mResultFields = 1;\r
+ snprintf (mSQLQuery, 500, "SELECT c_name FROM characters WHERE c_id = %d", atoi(nOptions[0].c_str()));\r
+\r
+ break;\r
+ case 20:\r
+ case 21:\r
+ // Select either c_"name" or c_"minsympathy". Names taken from option, saves if/else\r
+ if(!ChkOpt(nNumOptions, 2)) break;\r
+ mResultFields = 1;\r
+ snprintf (mSQLQuery, 500, "SELECT `cl_%s` FROM `clans` WHERE `cl_id` = %d", nOptions[0].c_str(), atoi(nOptions[1].c_str()));\r
+\r
+ break;\r
case 25:\r
- if(!ChkOpt(nNumOptions, 4)) break;
- mResultFields = 6; // TODO: replace 0 with average faction sympathy
- snprintf (mSQLQuery, 500, "SELECT cl_id, cl_shortdesc, cl_name, cl_faction, \"0\", \"0\" FROM clans WHERE cl_name > \"%s\" AND cl_name <=\"%s\" LIMIT %d, %d", nOptions[0].c_str(), nOptions[1].c_str(), atoi(nOptions[2].c_str()), atoi(nOptions[3].c_str()));
-
+ if(!ChkOpt(nNumOptions, 4)) break;\r
+ mResultFields = 6; // TODO: replace 0 with average faction sympathy\r
+ snprintf (mSQLQuery, 500, "SELECT cl_id, cl_shortdesc, cl_name, cl_faction, \"0\", \"0\" FROM clans WHERE cl_name > \"%s\" AND cl_name <=\"%s\" LIMIT %d, %d", nOptions[0].c_str(), nOptions[1].c_str(), atoi(nOptions[2].c_str()), atoi(nOptions[3].c_str()));\r
+\r
break;\r
case 26:\r
- // 0: short 1: name 2: money 3: faction 4: fac symp 5: symp_to_join 6: cappid
- if(!ChkOpt(nNumOptions, 1)) break;
- mResultFields = 6;
- snprintf (mSQLQuery, 500, "SELECT cl_shortdesc, cl_name, cl_money, cl_faction, \"0\", cl_minsympathy, cl_appid FROM `clans` WHERE `cl_id` = %d", atoi(nOptions[0].c_str()));
-
- break;\r
- case 27:
- if(!ChkOpt(nNumOptions, 1)) break;
+ // 0: short 1: name 2: money 3: faction 4: fac symp 5: symp_to_join 6: cappid\r
+ if(!ChkOpt(nNumOptions, 1)) break;\r
+ mResultFields = 6;\r
+ snprintf (mSQLQuery, 500, "SELECT cl_shortdesc, cl_name, cl_money, cl_faction, \"0\", cl_minsympathy, cl_appid FROM `clans` WHERE `cl_id` = %d", atoi(nOptions[0].c_str()));\r
+\r
+ break;\r
+ case 27:\r
+ if(!ChkOpt(nNumOptions, 1)) break;\r
mResultFields = 5;\r
- snprintf (mSQLQuery, 500, "SELECT cl_id, cl_shortdesc, cl_description, count(DISTINCT o_outnum), count(DISTINCT c_id) FROM outposts INNER JOIN clans ON (o_clan = cl_id) INNER JOIN characters ON (c_clan = clans.cl_id) WHERE (cl_id = %d) GROUP BY cl_id", atoi(nOptions[0].c_str()));
-
+ snprintf (mSQLQuery, 500, "SELECT cl_id, cl_shortdesc, cl_description, count(DISTINCT o_outnum), count(DISTINCT c_id) FROM outposts INNER JOIN clans ON (o_clan = cl_id) INNER JOIN characters ON (c_clan = clans.cl_id) WHERE (cl_id = %d) GROUP BY cl_id", atoi(nOptions[0].c_str()));\r
+\r
break;\r
- case 28:
+ case 28:\r
// Faction missions? Never seen them even in NC2...\r
Console->Print("%s [Pterminal::HandleReceiveDB] QueryID %d has not been written yet; Factionmissions..? Never seen them", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);\r
break;\r
Console->Print("%s [Pterminal::HandleReceiveDB] QueryID %d Ordercol was missing. Its: [%s]", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID, nOptions[0].c_str());\r
break;\r
case 34:\r
- // Name, Add. Info, Profession, Description, Overal Ranking, Soullight, Money, Runner Kills, Creature Kills
- // Note: Add. Info is autogenerated clientside!
- if(!ChkOpt(nNumOptions, 1)) break;
- mResultFields = 8;
- snprintf (mSQLQuery, 500, "SELECT c_name, c_profession, \"0\", \"1\", \"127\", c_cash, \"0\", \"0\" FROM characters WHERE c_id = %d", atoi(nOptions[0].c_str()));
+ // Name, Add. Info, Profession, Description, Overal Ranking, Soullight, Money, Runner Kills, Creature Kills\r
+ // Note: Add. Info is autogenerated clientside!\r
+ if(!ChkOpt(nNumOptions, 1)) break;\r
+ mResultFields = 8;\r
+ snprintf (mSQLQuery, 500, "SELECT c_name, c_profession, \"0\", \"1\", \"127\", c_cash, \"0\", \"0\" FROM characters WHERE c_id = %d", atoi(nOptions[0].c_str()));\r
\r
break;\r
- case 38:
+ case 38:\r
// Faction missions? Never seen them even in NC2...\r
Console->Print("%s [Pterminal::HandleReceiveDB] QueryID %d has not been written yet; Factionmissions..? Never seen them", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);\r
break;\r
- case 39:
+ case 39:\r
// 0:id 1:name 2:clan 3:fac.symp\r
- if(!ChkOpt(nNumOptions, 1)) break;
- mResultFields = 4;
- snprintf (mSQLQuery, 500, "SELECT c_id, c_name, c_clan, \"75\" FROM characters WHERE c_name LIKE \"%s\"", nOptions[0].c_str());
-
+ if(!ChkOpt(nNumOptions, 1)) break;\r
+ mResultFields = 4;\r
+ snprintf (mSQLQuery, 500, "SELECT c_id, c_name, c_clan, \"75\" FROM characters WHERE c_name LIKE \"%s\"", nOptions[0].c_str());\r
+\r
break;\r
case 41:\r
- if(!ChkOpt(nNumOptions, 3)) break;
- mResultFields = 5;
- snprintf (mSQLQuery, 500, "SELECT o_outnum, o_outnum, \"0\", \"0\", \"0\" FROM outposts WHERE o_clan = %d LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));
-
- break;
- case 46:
- // charid, charname, charclanlevel, clanlevelname, charfactionsymp, char online
- if(!ChkOpt(nNumOptions, 4)) break;
- mResultFields = 6;
- snprintf (mSQLQuery, 500, "SELECT c_id, c_name, cll_level, cll_desc, \"0\", c_online FROM clanlevels INNER JOIN characters ON (cll_charid = c_id) WHERE (cll_clanid = %d) AND (cll_level >= %d) LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()), atoi(nOptions[3].c_str()));
-
- break;
- case 47:
- if(!ChkOpt(nNumOptions, 5)) break;
- mResultFields = 6;
- snprintf (mSQLQuery, 500, "SELECT c_id, c_name, 0, cll_desc, 0, c_online FROM characters INNER JOIN clanlevels ON (c_id = cll_charid) WHERE cll_level >= %d AND cll_level <= %d AND c_clan = %d ORDER BY cll_level DESC LIMIT %d, %d", atoi(nOptions[2].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[0].c_str()), atoi(nOptions[3].c_str()), atoi(nOptions[4].c_str()));
-
- break;
+ if(!ChkOpt(nNumOptions, 3)) break;\r
+ mResultFields = 5;\r
+ snprintf (mSQLQuery, 500, "SELECT o_outnum, o_outnum, \"0\", \"0\", \"0\" FROM outposts WHERE o_clan = %d LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));\r
+\r
+ break;\r
+ case 46:\r
+ // charid, charname, charclanlevel, clanlevelname, charfactionsymp, char online\r
+ if(!ChkOpt(nNumOptions, 4)) break;\r
+ mResultFields = 6;\r
+ snprintf (mSQLQuery, 500, "SELECT c_id, c_name, cll_level, cll_desc, \"0\", c_online FROM clanlevels INNER JOIN characters ON (cll_charid = c_id) WHERE (cll_clanid = %d) AND (cll_level >= %d) LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()), atoi(nOptions[3].c_str()));\r
+\r
+ break;\r
+ case 47:\r
+ if(!ChkOpt(nNumOptions, 5)) break;\r
+ mResultFields = 6;\r
+ snprintf (mSQLQuery, 500, "SELECT c_id, c_name, 0, cll_desc, 0, c_online FROM characters INNER JOIN clanlevels ON (c_id = cll_charid) WHERE cll_level >= %d AND cll_level <= %d AND c_clan = %d ORDER BY cll_level DESC LIMIT %d, %d", atoi(nOptions[2].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[0].c_str()), atoi(nOptions[3].c_str()), atoi(nOptions[4].c_str()));\r
+\r
+ break;\r
case 48:\r
- if(!ChkOpt(nNumOptions, 2)) break;
- mResultFields = 2;
- snprintf (mSQLQuery, 500, "SELECT cll_desc, cll_level FROM clanlevels WHERE cll_clanid = %d AND cll_level = %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()));
-
- break;
+ if(!ChkOpt(nNumOptions, 2)) break;\r
+ mResultFields = 2;\r
+ snprintf (mSQLQuery, 500, "SELECT cll_desc, cll_level FROM clanlevels WHERE cll_clanid = %d AND cll_level = %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()));\r
+\r
+ break;\r
case 49:\r
- if(!ChkOpt(nNumOptions, 1)) break;
- mResultFields = 2;
- snprintf (mSQLQuery, 500, "SELECT c_id, c_name FROM characters WHERE c_id = %d", atoi(nOptions[0].c_str()));
-
- break;
- case 50:
if(!ChkOpt(nNumOptions, 1)) break;\r
- mResultFields = 2; //Fieldnum
- snprintf (mSQLQuery, 500, "SELECT f_showname, f_name FROM forums WHERE f_area = %d", atoi(nOptions[0].c_str()));
+ mResultFields = 2;\r
+ snprintf (mSQLQuery, 500, "SELECT c_id, c_name FROM characters WHERE c_id = %d", atoi(nOptions[0].c_str()));\r
+\r
+ break;\r
+ case 50:\r
+ if(!ChkOpt(nNumOptions, 1)) break;\r
+ mResultFields = 2; //Fieldnum\r
+ snprintf (mSQLQuery, 500, "SELECT f_showname, f_name FROM forums WHERE f_area = %d", atoi(nOptions[0].c_str()));\r
\r
break;\r
- case 51:
+ case 51:\r
if(!ChkOpt(nNumOptions, 9)) break;\r
- mResultFields = 4;
- snprintf (mSQLQuery, 500, "SELECT fp_id, fp_name, c_name, fp_datetime FROM `forum_posts`, forums, characters WHERE fp_forumid = f_id AND c_id = fp_fromid AND f_name = \'%s\' AND fp_replyid = 0 LIMIT %d, %d", nOptions[0].c_str(), atoi(nOptions[7].c_str()), atoi(nOptions[8].c_str()));
+ mResultFields = 4;\r
+ snprintf (mSQLQuery, 500, "SELECT fp_id, fp_name, c_name, fp_datetime FROM `forum_posts`, forums, characters WHERE fp_forumid = f_id AND c_id = fp_fromid AND f_name = \'%s\' AND fp_replyid = 0 LIMIT %d, %d", nOptions[0].c_str(), atoi(nOptions[7].c_str()), atoi(nOptions[8].c_str()));\r
\r
break;\r
- case 52:
+ case 52:\r
if(!ChkOpt(nNumOptions, 3)) break;\r
- mResultFields = 4;
- snprintf (mSQLQuery, 500, "SELECT c_name, fp_name, fp_datetime, fp_content FROM forum_posts INNER JOIN forums ON (fp_forumid = f_id) INNER JOIN characters ON (fp_fromid = c_id) WHERE (f_name = \"%s\") AND (fp_id = %d OR fp_replyid = %d)", nOptions[0].c_str(), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));
-
- break;\r
- case 54:
- // id, name, rank, rankname, f.symp
- if(!ChkOpt(nNumOptions, 1)) break;
- mResultFields = 5;
- snprintf (mSQLQuery, 500, "SELECT c_id, c_name, cll_level, cll_desc, 0 FROM clanlevels INNER JOIN characters ON (cll_charid = c_id) WHERE (c_id = %d)", atoi(nOptions[0].c_str()));
-
- break;\r
- case 60: // Query for OutPost state. Result is <outpost ID> <clan ID>
+ mResultFields = 4;\r
+ snprintf (mSQLQuery, 500, "SELECT c_name, fp_name, fp_datetime, fp_content FROM forum_posts INNER JOIN forums ON (fp_forumid = f_id) INNER JOIN characters ON (fp_fromid = c_id) WHERE (f_name = \"%s\") AND (fp_id = %d OR fp_replyid = %d)", nOptions[0].c_str(), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));\r
+\r
+ break;\r
+ case 54:\r
+ // id, name, rank, rankname, f.symp\r
+ if(!ChkOpt(nNumOptions, 1)) break;\r
+ mResultFields = 5;\r
+ snprintf (mSQLQuery, 500, "SELECT c_id, c_name, cll_level, cll_desc, 0 FROM clanlevels INNER JOIN characters ON (cll_charid = c_id) WHERE (c_id = %d)", atoi(nOptions[0].c_str()));\r
+\r
+ break;\r
+ case 60: // Query for OutPost state. Result is <outpost ID> <clan ID>\r
if(!ChkOpt(nNumOptions, 2)) break;\r
- mResultFields = 2;
- snprintf (mSQLQuery, 500, "SELECT o_outnum, o_clan FROM outposts LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()));
-
- break;
+ mResultFields = 2;\r
+ snprintf (mSQLQuery, 500, "SELECT o_outnum, o_clan FROM outposts LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()));\r
+\r
+ break;\r
case 61: // It should display the clanname, but it doesnt. seems to be clientside bug\r
- if(!ChkOpt(nNumOptions, 1)) break;
- mResultFields = 4;
- snprintf (mSQLQuery, 500, "SELECT o_outnum, o_clan, o_clan, o_security FROM outposts WHERE o_outnum = %d", atoi(nOptions[0].c_str()));
-
- break;
- case 75:
- if(!ChkOpt(nNumOptions, 3)) break;
- mResultFields = 2;
+ if(!ChkOpt(nNumOptions, 1)) break;\r
+ mResultFields = 4;\r
+ snprintf (mSQLQuery, 500, "SELECT o_outnum, o_clan, o_clan, o_security FROM outposts WHERE o_outnum = %d", atoi(nOptions[0].c_str()));\r
+\r
+ break;\r
+ case 75:\r
+ if(!ChkOpt(nNumOptions, 3)) break;\r
+ mResultFields = 2;\r
snprintf (mSQLQuery, 500, "SELECT cll_desc, cll_level FROM clanlevels WHERE cll_clanid = %d ORDER BY cll_level DESC LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));\r
\r
break;\r
- case 76:
- if(!ChkOpt(nNumOptions, 2)) break;
- mResultFields = 1;
- snprintf (mSQLQuery, 500, "SELECT count(c_id) FROM clanlevels INNER JOIN characters ON (cll_charid = c_id) WHERE (cll_clanid = %d AND cll_desc = \"%s\")", atoi(nOptions[0].c_str()),nOptions[1].c_str());
-
+ case 76:\r
+ if(!ChkOpt(nNumOptions, 2)) break;\r
+ mResultFields = 1;\r
+ snprintf (mSQLQuery, 500, "SELECT count(c_id) FROM clanlevels INNER JOIN characters ON (cll_charid = c_id) WHERE (cll_clanid = %d AND cll_desc = \"%s\")", atoi(nOptions[0].c_str()),nOptions[1].c_str());\r
+\r
break;\r
- case 85:
- if(!ChkOpt(nNumOptions, 4)) break;
- mResultFields = 6; // No idea why this Fac.Symp is that high... 1000000 is 100 ingame. But only for this query
- snprintf (mSQLQuery, 500, "SELECT c_id, c_name, cll_level, cll_desc, 1000000, c_online FROM clanlevels INNER JOIN characters ON (cll_charid = c_id) WHERE (c_online = %d OR c_online = 1) AND c_clan = %d LIMIT %d, %d", atoi(nOptions[1].c_str()), atoi(nOptions[0].c_str()), atoi(nOptions[2].c_str()), atoi(nOptions[3].c_str()));
-
+ case 85:\r
+ if(!ChkOpt(nNumOptions, 4)) break;\r
+ mResultFields = 6; // No idea why this Fac.Symp is that high... 1000000 is 100 ingame. But only for this query\r
+ snprintf (mSQLQuery, 500, "SELECT c_id, c_name, cll_level, cll_desc, 1000000, c_online FROM clanlevels INNER JOIN characters ON (cll_charid = c_id) WHERE (c_online = %d OR c_online = 1) AND c_clan = %d LIMIT %d, %d", atoi(nOptions[1].c_str()), atoi(nOptions[0].c_str()), atoi(nOptions[2].c_str()), atoi(nOptions[3].c_str()));\r
+\r
break;\r
case 86:\r
- if(!ChkOpt(nNumOptions, 3)) break;
- mResultFields = 4;
- if(!strncmp(nOptions[1].c_str(), "date", 4))
- snprintf (mSQLQuery, 500, "SELECT mt_id, mt_amount, mt_date, c_name FROM moneytransactions INNER JOIN characters ON (mt_player = c_id) WHERE mt_clanid = %d LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[2].c_str()), atoi(nOptions[3].c_str()));
- else
- snprintf (mSQLQuery, 500, "SELECT mt_id, mt_amount, mt_date, c_name FROM moneytransactions INNER JOIN characters ON (mt_player = c_id) WHERE mt_clanid = %d LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));
-
- break;
+ if(!ChkOpt(nNumOptions, 3)) break;\r
+ mResultFields = 4;\r
+ if(!strncmp(nOptions[1].c_str(), "date", 4))\r
+ snprintf (mSQLQuery, 500, "SELECT mt_id, mt_amount, mt_date, c_name FROM moneytransactions INNER JOIN characters ON (mt_player = c_id) WHERE mt_clanid = %d LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[2].c_str()), atoi(nOptions[3].c_str()));\r
+ else\r
+ snprintf (mSQLQuery, 500, "SELECT mt_id, mt_amount, mt_date, c_name FROM moneytransactions INNER JOIN characters ON (mt_player = c_id) WHERE mt_clanid = %d LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));\r
+\r
+ break;\r
case 87:\r
- if(!ChkOpt(nNumOptions, 1)) break;
- mResultFields = 4;
- snprintf (mSQLQuery, 500, "SELECT c_name, mt_date, mt_amount, mt_comment FROM moneytransactions INNER JOIN characters ON (mt_player = c_id) WHERE mt_id = %d", atoi(nOptions[0].c_str()));
-
- break;
- case 92:
if(!ChkOpt(nNumOptions, 1)) break;\r
- // Location of player
- mResultFields = 1;
- snprintf (mSQLQuery, 500, "SELECT c_location FROM characters WHERE c_id = %d", atoi(nOptions[0].c_str()));
-
+ mResultFields = 4;\r
+ snprintf (mSQLQuery, 500, "SELECT c_name, mt_date, mt_amount, mt_comment FROM moneytransactions INNER JOIN characters ON (mt_player = c_id) WHERE mt_id = %d", atoi(nOptions[0].c_str()));\r
+\r
+ break;\r
+ case 92:\r
+ if(!ChkOpt(nNumOptions, 1)) break;\r
+ // Location of player\r
+ mResultFields = 1;\r
+ snprintf (mSQLQuery, 500, "SELECT c_location FROM characters WHERE c_id = %d", atoi(nOptions[0].c_str()));\r
+\r
break;\r
- case 93:
+ case 93:\r
if(!ChkOpt(nNumOptions, 1)) break;\r
- // Name, Add. Info, Profession, Description
- // Note: Add. Info is autogenerated clientside!
- mResultFields = 3;
+ // Name, Add. Info, Profession, Description\r
+ // Note: Add. Info is autogenerated clientside!\r
+ mResultFields = 3;\r
snprintf (mSQLQuery, 500, "SELECT c_name, c_profession, \"0\" FROM characters WHERE c_id = %d", atoi(nOptions[0].c_str()));\r
-
+\r
break;\r
case 96:\r
- if(!ChkOpt(nNumOptions, 1)) break;
- mResultFields = 1;
- snprintf (mSQLQuery, 500, "SELECT f_showname FROM forums WHERE f_name = \"%s\"", nOptions[0].c_str());
-
- break;
- case 98:
+ if(!ChkOpt(nNumOptions, 1)) break;\r
+ mResultFields = 1;\r
+ snprintf (mSQLQuery, 500, "SELECT f_showname FROM forums WHERE f_name = \"%s\"", nOptions[0].c_str());\r
+\r
+ break;\r
+ case 98:\r
// ID, Name, Online, 0, Soullight\r
- if(!ChkOpt(nNumOptions, 4)) break;
- mResultFields = 5;
- snprintf (mSQLQuery, 500, "SELECT c_id, c_name, c_online, \"0\", c_soullight FROM characters WHERE c_online = %d AND c_soullight <= -%d LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()), atoi(nOptions[3].c_str()));
- break;
- case 99:
- // Terrorist info
+ if(!ChkOpt(nNumOptions, 4)) break;\r
+ mResultFields = 5;\r
+ snprintf (mSQLQuery, 500, "SELECT c_id, c_name, c_online, \"0\", c_soullight FROM characters WHERE c_online = %d AND c_soullight <= -%d LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()), atoi(nOptions[3].c_str()));\r
+ break;\r
+ case 99:\r
+ // Terrorist info\r
// id, name, faction, clan, clanlevel, location\r
- if(!ChkOpt(nNumOptions, 2)) break;
- mResultFields = 6;
- snprintf (mSQLQuery, 500, "SELECT c_id, c_name, c_faction, c_clan, cll_level, c_location FROM clanlevels INNER JOIN characters ON (cll_charid = c_id) WHERE (c_id = %d AND c_soullight <= -%d)", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()));
-
+ if(!ChkOpt(nNumOptions, 2)) break;\r
+ mResultFields = 6;\r
+ snprintf (mSQLQuery, 500, "SELECT c_id, c_name, c_faction, c_clan, cll_level, c_location FROM clanlevels INNER JOIN characters ON (cll_charid = c_id) WHERE (c_id = %d AND c_soullight <= -%d)", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()));\r
+\r
break;\r
case 108:\r
- if(!ChkOpt(nNumOptions, 1)) break;
- mResultFields = 1;
- snprintf (mSQLQuery, 500, "SELECT cl_name FROM clans WHERE cl_id = %d", atoi(nOptions[0].c_str()));
-
- break;
+ if(!ChkOpt(nNumOptions, 1)) break;\r
+ mResultFields = 1;\r
+ snprintf (mSQLQuery, 500, "SELECT cl_name FROM clans WHERE cl_id = %d", atoi(nOptions[0].c_str()));\r
+\r
+ break;\r
case 109:\r
- if(!ChkOpt(nNumOptions, 1)) break;
- // The only case where KK used an DBId twice for completely different things...
- if(nNumOptions < 3)
- {
- mResultFields = 5;
- snprintf (mSQLQuery, 500, "SELECT c_id, c_name, c_clan, cll_level, cll_desc FROM characters INNER JOIN clanlevels ON (cll_charid = c_id AND cll_clanid = c_clan) WHERE c_id = %d", atoi(nOptions[0].c_str()));
- }
- else if(nNumOptions == 3)
- {
- mResultFields = 2;
- snprintf (mSQLQuery, 500, "SELECT c_id, apt_location FROM apartments INNER JOIN characters ON (apt_owner = c_id) WHERE (c_id = %d) LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));
- }
-
- break;
+ if(!ChkOpt(nNumOptions, 1)) break;\r
+ // The only case where KK used an DBId twice for completely different things...\r
+ if(nNumOptions < 3)\r
+ {\r
+ mResultFields = 5;\r
+ snprintf (mSQLQuery, 500, "SELECT c_id, c_name, c_clan, cll_level, cll_desc FROM characters INNER JOIN clanlevels ON (cll_charid = c_id AND cll_clanid = c_clan) WHERE c_id = %d", atoi(nOptions[0].c_str()));\r
+ }\r
+ else if(nNumOptions == 3)\r
+ {\r
+ mResultFields = 2;\r
+ snprintf (mSQLQuery, 500, "SELECT c_id, apt_location FROM apartments INNER JOIN characters ON (apt_owner = c_id) WHERE (c_id = %d) LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));\r
+ }\r
+\r
+ break;\r
case 116:\r
- if(!ChkOpt(nNumOptions, 3)) break;
- mResultFields = 1;
- snprintf (mSQLQuery, 500, "SELECT wr_id FROM worlds WHERE wr_group = %d LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));
-
- break;
- case 125:
+ if(!ChkOpt(nNumOptions, 3)) break;\r
+ mResultFields = 1;\r
+ snprintf (mSQLQuery, 500, "SELECT wr_id FROM worlds WHERE wr_group = %d LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));\r
+\r
+ break;\r
+ case 125:\r
// Return position in Helpqueue. todo yet... for now its 255, we're always busy! =)\r
- //if(!ChkOpt(nNumOptions, 3)) break;
- mResultFields = 1;
- snprintf (mSQLQuery, 500, "SELECT 255");
-
- break;
+ //if(!ChkOpt(nNumOptions, 3)) break;\r
+ mResultFields = 1;\r
+ snprintf (mSQLQuery, 500, "SELECT 255");\r
+\r
+ break;\r
case 126:\r
- // Return position in Helpqueue. todo yet... for now its 255, we're always busy! =)
- // This is with Datecheck, somehow..
- //if(!ChkOpt(nNumOptions, 3)) break;
- mResultFields = 1;
- snprintf (mSQLQuery, 500, "SELECT 255");
-
+ // Return position in Helpqueue. todo yet... for now its 255, we're always busy! =)\r
+ // This is with Datecheck, somehow..\r
+ //if(!ChkOpt(nNumOptions, 3)) break;\r
+ mResultFields = 1;\r
+ snprintf (mSQLQuery, 500, "SELECT 255");\r
+\r
break;\r
case 127:\r
- if(!ChkOpt(nNumOptions, 1)) break;
- mResultFields = 2;
- snprintf (mSQLQuery, 500, "SELECT c_name, apt_location FROM apartments INNER JOIN characters ON (apt_owner = c_id) WHERE (c_id = %d)", atoi(nOptions[0].c_str()));
+ if(!ChkOpt(nNumOptions, 1)) break;\r
+ mResultFields = 2;\r
+ snprintf (mSQLQuery, 500, "SELECT c_name, apt_location FROM apartments INNER JOIN characters ON (apt_owner = c_id) WHERE (c_id = %d)", atoi(nOptions[0].c_str()));\r
\r
break;\r
case 128:\r
- if(!ChkOpt(nNumOptions, 1)) break;
- mResultFields = 1;
- snprintf (mSQLQuery, 500, "SELECT su_id FROM support WHERE su_supporterid = %d AND su_finished = 0", atoi(nOptions[0].c_str()));
-
+ if(!ChkOpt(nNumOptions, 1)) break;\r
+ mResultFields = 1;\r
+ snprintf (mSQLQuery, 500, "SELECT su_id FROM support WHERE su_supporterid = %d AND su_finished = 0", atoi(nOptions[0].c_str()));\r
+\r
case 131:\r
- mResultFields = 6;
- //snprintf(mSQLQuery, 500, "SELECT br_id, br_type, c_online, c_name, br_location, br_datetime FROM `bug report`, characters WHERE c_id = br_fromid AND br_status = %d LIMIT %d, %d",
- // atoi(nOptions[0].c_str())+atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()), atoi(nOptions[3].c_str()));
- snprintf(mSQLQuery, 500, "SELECT su_id, su_type, 0, c_name, su_worldid, su_datetime FROM support INNER JOIN characters ON (su_player = c_id) WHERE su_inwork = %d AND su_finished = %d LIMIT %d, %d",
- atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()), atoi(nOptions[3].c_str()));
-\r
- break;\r
- case 132:
- // reqid, runnerid, runnername, 0, date/time, type, 0, in work, finished, desc
- if(!ChkOpt(nNumOptions, 1)) break;
- mResultFields = 10;
- //snprintf(mSQLQuery, 500, "SELECT br_id, br_fromid, c_name, \"0\", br_datetime, br_type, \"0\", br_status, br_status, br_desc FROM `bug report` INNER JOIN characters ON (br_fromid = c_id) WHERE br_id = %d", atoi(nOptions[0].c_str()));
- snprintf(mSQLQuery, 500, "SELECT su_id, su_player, c_name, 0, su_datetime, su_type, su_supporterid, su_inwork, su_finished, su_desc FROM support INNER JOIN characters ON (su_player = c_id) WHERE su_id = %d", atoi(nOptions[0].c_str()));
-
- break;\r
- case 134:
- if(!ChkOpt(nNumOptions, 1)) break;
- mResultFields = 1;
- snprintf(mSQLQuery, 500, "SELECT br_id FROM bug_report WHERE br_fromid = %d", atoi(nOptions[0].c_str()));
-
- break;\r
- case 136:
+ mResultFields = 6;\r
+ //snprintf(mSQLQuery, 500, "SELECT br_id, br_type, c_online, c_name, br_location, br_datetime FROM `bug report`, characters WHERE c_id = br_fromid AND br_status = %d LIMIT %d, %d",\r
+ // atoi(nOptions[0].c_str())+atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()), atoi(nOptions[3].c_str()));\r
+ snprintf(mSQLQuery, 500, "SELECT su_id, su_type, 0, c_name, su_worldid, su_datetime FROM support INNER JOIN characters ON (su_player = c_id) WHERE su_inwork = %d AND su_finished = %d LIMIT %d, %d",\r
+ atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()), atoi(nOptions[3].c_str()));\r
+\r
+ break;\r
+ case 132:\r
+ // reqid, runnerid, runnername, 0, date/time, type, 0, in work, finished, desc\r
if(!ChkOpt(nNumOptions, 1)) break;\r
- mResultFields = 1;
+ mResultFields = 10;\r
+ //snprintf(mSQLQuery, 500, "SELECT br_id, br_fromid, c_name, \"0\", br_datetime, br_type, \"0\", br_status, br_status, br_desc FROM `bug report` INNER JOIN characters ON (br_fromid = c_id) WHERE br_id = %d", atoi(nOptions[0].c_str()));\r
+ snprintf(mSQLQuery, 500, "SELECT su_id, su_player, c_name, 0, su_datetime, su_type, su_supporterid, su_inwork, su_finished, su_desc FROM support INNER JOIN characters ON (su_player = c_id) WHERE su_id = %d", atoi(nOptions[0].c_str()));\r
+\r
+ break;\r
+ case 134:\r
+ if(!ChkOpt(nNumOptions, 1)) break;\r
+ mResultFields = 1;\r
+ snprintf(mSQLQuery, 500, "SELECT br_id FROM bug_report WHERE br_fromid = %d", atoi(nOptions[0].c_str()));\r
+\r
+ break;\r
+ case 136:\r
+ if(!ChkOpt(nNumOptions, 1)) break;\r
+ mResultFields = 1;\r
snprintf (mSQLQuery, 500, "SELECT c_name FROM characters WHERE c_id = %d", atoi(nOptions[0].c_str()));\r
break;\r
- case 137:
- if(!ChkOpt(nNumOptions, 1)) break;
+ case 137:\r
+ if(!ChkOpt(nNumOptions, 1)) break;\r
// runnerid, runnername, location, online\r
- mResultFields = 4;
- snprintf (mSQLQuery, 500, "SELECT c_id, c_name, c_location, c_online FROM characters WHERE c_name = \"%s\"", nOptions[0].c_str());
+ mResultFields = 4;\r
+ snprintf (mSQLQuery, 500, "SELECT c_id, c_name, c_location, c_online FROM characters WHERE c_name = \"%s\"", nOptions[0].c_str());\r
break;\r
case 138:\r
- if(!ChkOpt(nNumOptions, 1)) break;
- // runnerid, runnername, location, online
- mResultFields = 6;
- snprintf (mSQLQuery, 500, "SELECT br_type, br_location, br_datetime, br_supid, br_status, br_desc FROM bug_report WHERE br_id = %d", atoi(nOptions[0].c_str()));
- break;\r
- case 143:
- if(!ChkOpt(nNumOptions, 1)) break;
- // runnerid, runnername, location, online
- mResultFields = 6;
- snprintf (mSQLQuery, 500, "SELECT a.a_id, a.a_username, b.c_id, 0, b.c_location, b.c_online FROM `%s`.accounts AS a, `%s`.characters AS b WHERE b.c_name = \"%s\" AND a.a_id = b.a_id",
- Config->GetOption("info_sql_database").c_str(), Config->GetOption("game_sql_database").c_str(), nOptions[0].c_str());
- break;
+ if(!ChkOpt(nNumOptions, 1)) break;\r
+ // runnerid, runnername, location, online\r
+ mResultFields = 6;\r
+ snprintf (mSQLQuery, 500, "SELECT br_type, br_location, br_datetime, br_supid, br_status, br_desc FROM bug_report WHERE br_id = %d", atoi(nOptions[0].c_str()));\r
+ break;\r
+ case 143:\r
+ if(!ChkOpt(nNumOptions, 1)) break;\r
+ // runnerid, runnername, location, online\r
+ mResultFields = 6;\r
+ snprintf (mSQLQuery, 500, "SELECT a.a_id, a.a_username, b.c_id, 0, b.c_location, b.c_online FROM `%s`.accounts AS a, `%s`.characters AS b WHERE b.c_name = \"%s\" AND a.a_id = b.a_id",\r
+ Config->GetOption("info_sql_database").c_str(), Config->GetOption("game_sql_database").c_str(), nOptions[0].c_str());\r
+ break;\r
case 144:\r
- mResultFields = 2; // Replace "1" with Online/Offline!
- snprintf (mSQLQuery, 500, "SELECT c_location, c_online FROM characters WHERE c_id = %d", atoi(nOptions[0].c_str()));
+ mResultFields = 2; // Replace "1" with Online/Offline!\r
+ snprintf (mSQLQuery, 500, "SELECT c_location, c_online FROM characters WHERE c_id = %d", atoi(nOptions[0].c_str()));\r
\r
break;\r
case 145:\r
- mResultFields = 1;
- snprintf (mSQLQuery, 500, "SELECT a_email FROM `%s`.accounts WHERE a_id = %d", Config->GetOption("info_sql_database").c_str(), atoi(nOptions[0].c_str()));
+ mResultFields = 1;\r
+ snprintf (mSQLQuery, 500, "SELECT a_email FROM `%s`.accounts WHERE a_id = %d", Config->GetOption("info_sql_database").c_str(), atoi(nOptions[0].c_str()));\r
\r
break;\r
case 146:\r
- mResultFields = 4;
- // Too bad we named the row different...
- char tSortRow[10];
- if(!strncmp(nOptions[1].c_str(), "world", 5))
- strcpy(tSortRow, "location");
- else
- strcpy(tSortRow, "name");
- snprintf (mSQLQuery, 500, "SELECT c_id, c_name, c_location, c_online FROM characters WHERE c_name LIKE \"%s\" ORDER BY `c_%s` LIMIT %d, %d", nOptions[0].c_str(), tSortRow, atoi(nOptions[2].c_str()), atoi(nOptions[3].c_str()));
-
- break;\r
- case 147:
+ mResultFields = 4;\r
+ // Too bad we named the row different...\r
+ char tSortRow[10];\r
+ if(!strncmp(nOptions[1].c_str(), "world", 5))\r
+ strcpy(tSortRow, "location");\r
+ else\r
+ strcpy(tSortRow, "name");\r
+ snprintf (mSQLQuery, 500, "SELECT c_id, c_name, c_location, c_online FROM characters WHERE c_name LIKE \"%s\" ORDER BY `c_%s` LIMIT %d, %d", nOptions[0].c_str(), tSortRow, atoi(nOptions[2].c_str()), atoi(nOptions[3].c_str()));\r
+\r
+ break;\r
+ case 147:\r
mResultFields = 4;\r
snprintf (mSQLQuery, 500, "SELECT c_id, c_name, c_location, c_online FROM characters WHERE c_online = %d ORDER BY `c_%s` LIMIT %d, %d", atoi(nOptions[0].c_str()), nOptions[1].c_str(), atoi(nOptions[2].c_str()), atoi(nOptions[3].c_str()));\r
-
+\r
break;\r
- case 148:
+ case 148:\r
if(!ChkOpt(nNumOptions, 1)) break;\r
- mResultFields = 5;
- snprintf (mSQLQuery, 500, "SELECT c_id, c_name, \"0\", \"0\", c_id FROM clans INNER JOIN characters ON (cl_leader = c_id) WHERE (cl_id = %d)", atoi(nOptions[0].c_str()));
-
+ mResultFields = 5;\r
+ snprintf (mSQLQuery, 500, "SELECT c_id, c_name, \"0\", \"0\", c_id FROM clans INNER JOIN characters ON (cl_leader = c_id) WHERE (cl_id = %d)", atoi(nOptions[0].c_str()));\r
+\r
break;\r
- case 150:
+ case 150:\r
// Mission stuff. Will be added later!\r
Console->Print("%s [Pterminal::HandleReceiveDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);\r
break;\r
- case 151:
+ case 151:\r
// Mission stuff. Will be added later!\r
Console->Print("%s [Pterminal::HandleReceiveDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);\r
break;\r
case 153:\r
- // Mission stuff. Will be added later!
+ // Mission stuff. Will be added later!\r
Console->Print("%s [Pterminal::HandleReceiveDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);\r
break;\r
case 154:\r
- // Mission stuff. Will be added later!
+ // Mission stuff. Will be added later!\r
Console->Print("%s [Pterminal::HandleReceiveDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);\r
break;\r
case 155:\r
- // Mission stuff. Will be added later!
+ // Mission stuff. Will be added later!\r
Console->Print("%s [Pterminal::HandleReceiveDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);\r
break;\r
case 156:\r
- // Mission stuff. Will be added later!
+ // Mission stuff. Will be added later!\r
Console->Print("%s [Pterminal::HandleReceiveDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);\r
break;\r
case 157:\r
- // Mission stuff. Will be added later!
+ // Mission stuff. Will be added later!\r
Console->Print("%s [Pterminal::HandleReceiveDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);\r
break;\r
case 158:\r
- // Mission stuff. Will be added later!
+ // Mission stuff. Will be added later!\r
Console->Print("%s [Pterminal::HandleReceiveDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);\r
break;\r
- case 175:
- if(!ChkOpt(nNumOptions, 2)) break;
- mResultFields = 4;
- snprintf (mSQLQuery, 500, "SELECT br_id, br_type, br_title, br_datetime FROM bug_report LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()));
-
- break;\r
- case 176:
- if(!ChkOpt(nNumOptions, 1)) break;
- mResultFields = 8;
- snprintf (mSQLQuery, 500, "SELECT br_type, br_status, br_title, br_desc, 0, br_datetime, br_location, br_fromid FROM bug_report WHERE br_id = %d", atoi(nOptions[0].c_str()));
-
- break;
+ case 175:\r
+ if(!ChkOpt(nNumOptions, 2)) break;\r
+ mResultFields = 4;\r
+ snprintf (mSQLQuery, 500, "SELECT br_id, br_type, br_title, br_datetime FROM bug_report LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()));\r
+\r
+ break;\r
+ case 176:\r
+ if(!ChkOpt(nNumOptions, 1)) break;\r
+ mResultFields = 8;\r
+ snprintf (mSQLQuery, 500, "SELECT br_type, br_status, br_title, br_desc, 0, br_datetime, br_location, br_fromid FROM bug_report WHERE br_id = %d", atoi(nOptions[0].c_str()));\r
+\r
+ break;\r
case 181:\r
- if(!ChkOpt(nNumOptions, 1)) break;
- mResultFields = 3;
- snprintf (mSQLQuery, 500, "SELECT c_name, apt_location, apt_password FROM apartments INNER JOIN characters ON (c_id = apt_owner) WHERE apt_id = %d", atoi(nOptions[0].c_str()));
-
+ if(!ChkOpt(nNumOptions, 1)) break;\r
+ mResultFields = 3;\r
+ snprintf (mSQLQuery, 500, "SELECT c_name, apt_location, apt_password FROM apartments INNER JOIN characters ON (c_id = apt_owner) WHERE apt_id = %d", atoi(nOptions[0].c_str()));\r
+\r
break;\r
case 183:\r
- if(!ChkOpt(nNumOptions, 1)) break;
- mResultFields = 6;
- snprintf (mSQLQuery, 500, "SELECT cl_id, cl_name, (SELECT count(*) FROM characters WHERE c_clan = %d), c_name, apt_id, apt_location FROM clans INNER JOIN apartments ON (cl_appid = apt_id) INNER JOIN characters ON (c_clan = cl_id) AND (apt_owner = c_id) WHERE (cl_id = %d) GROUP BY c_id", atoi(nOptions[0].c_str()), atoi(nOptions[0].c_str()));
-
- break;
+ if(!ChkOpt(nNumOptions, 1)) break;\r
+ mResultFields = 6;\r
+ snprintf (mSQLQuery, 500, "SELECT cl_id, cl_name, (SELECT count(*) FROM characters WHERE c_clan = %d), c_name, apt_id, apt_location FROM clans INNER JOIN apartments ON (cl_appid = apt_id) INNER JOIN characters ON (c_clan = cl_id) AND (apt_owner = c_id) WHERE (cl_id = %d) GROUP BY c_id", atoi(nOptions[0].c_str()), atoi(nOptions[0].c_str()));\r
+\r
+ break;\r
case 186:\r
- mResultFields = 1;
- snprintf (mSQLQuery, 500, "SELECT c_id FROM characters WHERE c_name = \"%s\"", nOptions[0].c_str());
+ mResultFields = 1;\r
+ snprintf (mSQLQuery, 500, "SELECT c_id FROM characters WHERE c_name = \"%s\"", nOptions[0].c_str());\r
\r
break;\r
case 220:\r
- mResultFields = 4; //Fieldnum
- snprintf (mSQLQuery, 500, "SELECT v_id, v_type, v_status, v_condition FROM vehicles WHERE v_owner = %i LIMIT %i, %i", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));
+ mResultFields = 4; //Fieldnum\r
+ snprintf (mSQLQuery, 500, "SELECT v_id, v_type, v_status, v_condition FROM vehicles WHERE v_owner = %i LIMIT %i, %i", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));\r
\r
break;\r
case 221:\r
- //VehicleControl order. "VehicleControl", "Type", "Status", "Condition", "Repairprice?"
- mResultFields = 4; //Fieldnum
- snprintf (mSQLQuery, 500, "SELECT v_type, v_status, v_condition, \"0\" FROM vehicles WHERE v_id = %s", nOptions[0].c_str());
+ //VehicleControl order. "VehicleControl", "Type", "Status", "Condition", "Repairprice?"\r
+ mResultFields = 4; //Fieldnum\r
+ snprintf (mSQLQuery, 500, "SELECT v_type, v_status, v_condition, \"0\" FROM vehicles WHERE v_id = %s", nOptions[0].c_str());\r
\r
break;\r
- case 225:
+ case 225:\r
// Statistics. Maybe later...\r
Console->Print("%s [Pterminal::HandleReceiveDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);\r
break;\r
- case 226:
+ case 226:\r
// Statistics. Maybe later...\r
Console->Print("%s [Pterminal::HandleReceiveDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);\r
break;\r
case 230:\r
- mResultFields = 4;
- snprintf (mSQLQuery, 500, "SELECT st_id, st_factid, st_curval, st_curval-st_oldval FROM stockx");
-\r
- break;\r
- case 231:
- if(!ChkOpt(nNumOptions, 1)) break;
- mResultFields = 4;
- snprintf (mSQLQuery, 500, "SELECT st_id, st_factid, st_curval, (st_curval - st_oldval) FROM stockx WHERE (st_id = %d)", atoi(nOptions[0].c_str()));
-
- break;
- case 232:
- if(!ChkOpt(nNumOptions, 3)) break;
- mResultFields = 5;
- snprintf (mSQLQuery, 500, "SELECT sxd_id, st_factid, st_curval, sxd_amount, (sxd_amount * st_curval) FROM stockx_depots INNER JOIN stockx ON (sxd_st_id = st_id) WHERE (sxd_playerid = %d) LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));
-
+ mResultFields = 4;\r
+ snprintf (mSQLQuery, 500, "SELECT st_id, st_factid, st_curval, st_curval-st_oldval FROM stockx");\r
+\r
+ break;\r
+ case 231:\r
+ if(!ChkOpt(nNumOptions, 1)) break;\r
+ mResultFields = 4;\r
+ snprintf (mSQLQuery, 500, "SELECT st_id, st_factid, st_curval, (st_curval - st_oldval) FROM stockx WHERE (st_id = %d)", atoi(nOptions[0].c_str()));\r
+\r
+ break;\r
+ case 232:\r
+ if(!ChkOpt(nNumOptions, 3)) break;\r
+ mResultFields = 5;\r
+ snprintf (mSQLQuery, 500, "SELECT sxd_id, st_factid, st_curval, sxd_amount, (sxd_amount * st_curval) FROM stockx_depots INNER JOIN stockx ON (sxd_st_id = st_id) WHERE (sxd_playerid = %d) LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));\r
+\r
break;\r
case 233:\r
- if(!ChkOpt(nNumOptions, 1)) break;
- mResultFields = 7;
- snprintf (mSQLQuery, 500, "SELECT st_factid, sxd_amount, (st_curval - st_oldval), st_curval, sxd_paid, (sxd_amount * st_curval), ((sxd_amount * st_curval) - sxd_paid) FROM stockx_depots INNER JOIN stockx ON (sxd_st_id = st_id) where sxd_id = %d", atoi(nOptions[0].c_str()));
-
- break;
+ if(!ChkOpt(nNumOptions, 1)) break;\r
+ mResultFields = 7;\r
+ snprintf (mSQLQuery, 500, "SELECT st_factid, sxd_amount, (st_curval - st_oldval), st_curval, sxd_paid, (sxd_amount * st_curval), ((sxd_amount * st_curval) - sxd_paid) FROM stockx_depots INNER JOIN stockx ON (sxd_st_id = st_id) where sxd_id = %d", atoi(nOptions[0].c_str()));\r
+\r
+ break;\r
case 234:\r
- if(!ChkOpt(nNumOptions, 2)) break;
- mResultFields = 3;
- snprintf (mSQLQuery, 500, "SELECT sxd_id, sxd_amount, sxd_paid FROM stockx_depots INNER JOIN stockx ON (sxd_st_id = st_id) WHERE sxd_playerid = %d AND st_factid = %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()));
-
- break;
- case 250:
+ if(!ChkOpt(nNumOptions, 2)) break;\r
+ mResultFields = 3;\r
+ snprintf (mSQLQuery, 500, "SELECT sxd_id, sxd_amount, sxd_paid FROM stockx_depots INNER JOIN stockx ON (sxd_st_id = st_id) WHERE sxd_playerid = %d AND st_factid = %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()));\r
+\r
+ break;\r
+ case 250:\r
// Influence from CharID? Is stockx gm controlled??\r
Console->Print("%s [Pterminal::HandleReceiveDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);\r
break;\r
- case 251:
+ case 251:\r
// What is this "influence" ? Check this on live servers!\r
Console->Print("%s [Pterminal::HandleReceiveDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);\r
break;\r
- case 260:
- if(!ChkOpt(nNumOptions, 3)) break;
- mResultFields = 2; //Fieldnum
- snprintf (mSQLQuery, 500, "SELECT f_showname, f_name FROM forums WHERE f_area = %d+%d+%d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));
-
+ case 260:\r
+ if(!ChkOpt(nNumOptions, 3)) break;\r
+ mResultFields = 2; //Fieldnum\r
+ snprintf (mSQLQuery, 500, "SELECT f_showname, f_name FROM forums WHERE f_area = %d+%d+%d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));\r
+\r
break;\r
- case 261:
+ case 261:\r
// Maybe even rewrite BB system.. its wrong written anyways....\r
Console->Print("%s [Pterminal::HandleReceiveDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);\r
break;\r
- case 262:
+ case 262:\r
// This is wrong! 262 is the receiveDB request for FACTION threadlist. It should be limitet to that faction then\r
- mResultFields = 4;
- snprintf (mSQLQuery, 500, "SELECT c_name, fp_name, fp_datetime, fp_content FROM `forum_posts`, forums, characters WHERE fp_forumid = f_id AND c_id = fp_fromid AND (fp_id = %s OR fp_replyid = %s)", nOptions[0].c_str(), nOptions[1].c_str());
-
+ mResultFields = 4;\r
+ snprintf (mSQLQuery, 500, "SELECT c_name, fp_name, fp_datetime, fp_content FROM `forum_posts`, forums, characters WHERE fp_forumid = f_id AND c_id = fp_fromid AND (fp_id = %s OR fp_replyid = %s)", nOptions[0].c_str(), nOptions[1].c_str());\r
+\r
//TODO Check this. Same (?) for ID 52,262,267,401 and 411\r
break;\r
- case 266:
- mResultFields = 4;
- snprintf (mSQLQuery, 500, "SELECT fp_id, fp_name, c_name, fp_datetime FROM `forum_posts`, forums, characters WHERE fp_forumid = f_id AND c_id = fp_fromid AND f_name = \'%s\' AND fp_replyid = 0 AND fp_clanid = %d LIMIT %d, %d", nOptions[0].c_str(), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()), atoi(nOptions[3].c_str()));
-
+ case 266:\r
+ mResultFields = 4;\r
+ snprintf (mSQLQuery, 500, "SELECT fp_id, fp_name, c_name, fp_datetime FROM `forum_posts`, forums, characters WHERE fp_forumid = f_id AND c_id = fp_fromid AND f_name = \'%s\' AND fp_replyid = 0 AND fp_clanid = %d LIMIT %d, %d", nOptions[0].c_str(), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()), atoi(nOptions[3].c_str()));\r
+\r
break;\r
- case 267:
- mResultFields = 4;
- snprintf (mSQLQuery, 500, "SELECT c_name, fp_name, fp_datetime, fp_content FROM `forum_posts`, forums, characters WHERE fp_forumid = f_id AND c_id = fp_fromid AND (fp_id = %s OR fp_replyid = %s)", nOptions[0].c_str(), nOptions[1].c_str());
-
+ case 267:\r
+ mResultFields = 4;\r
+ snprintf (mSQLQuery, 500, "SELECT c_name, fp_name, fp_datetime, fp_content FROM `forum_posts`, forums, characters WHERE fp_forumid = f_id AND c_id = fp_fromid AND (fp_id = %s OR fp_replyid = %s)", nOptions[0].c_str(), nOptions[1].c_str());\r
+\r
break;\r
case 270:\r
Console->Print("%s [Pterminal::HandleReceiveDB] QueryID %d Tablename/Name is: [%s] ThreadID is: [%d]", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID, atoi(nOptions[0].c_str()), nOptions[1].c_str());\r
break;\r
- case 360:
- // Gamemaster name (char), Accountname, Location, Online, CharID
+ case 360:\r
+ // Gamemaster name (char), Accountname, Location, Online, CharID\r
+ if(!ChkOpt(nNumOptions, 3)) break;\r
+ mResultFields = 6;\r
+ snprintf (mSQLQuery, 500, "SELECT a.a_id, c.c_id, a.a_username, c.c_name, c.c_online, c.c_location FROM %s.characters AS c, %s.accounts AS a WHERE a.a_priv >= 50 AND c.c_online = %d AND c.a_id = a.a_id ORDER BY c.c_name LIMIT %d, %d",\r
+ Config->GetOption("game_sql_database").c_str(), Config->GetOption("info_sql_database").c_str(), atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));\r
+\r
+ break;\r
+ case 365:\r
+ // ID, short, name faction\r
+ if(!ChkOpt(nNumOptions, 2)) break;\r
+ mResultFields = 4;\r
+ snprintf (mSQLQuery, 500, "SELECT cl_id, cl_shortdesc, cl_name, cl_faction FROM clans LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()));\r
+\r
+ break;\r
+ case 366:\r
+ // ID, short, name faction WHERE clanname = %s\r
+ if(!ChkOpt(nNumOptions, 3)) break;\r
+ mResultFields = 4;\r
+ snprintf (mSQLQuery, 500, "SELECT cl_id, cl_shortdesc, cl_name, cl_faction FROM clans WHERE cl_name LIKE \"%s\" LIMIT %d, %d", nOptions[0].c_str(), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));\r
+\r
+ break;\r
+ case 367:\r
+ if(!ChkOpt(nNumOptions, 1)) break;\r
+ mResultFields = 8;\r
+ snprintf (mSQLQuery, 500, "SELECT cl_id, cl_shortdesc, cl_name, cl_leader, cl_faction, cl_appid, cl_money, (SELECT count(*) FROM characters WHERE c_clan = %d) FROM clans WHERE cl_id = %d", atoi(nOptions[0].c_str()), atoi(nOptions[0].c_str()));\r
+\r
+ break;\r
+ case 368:\r
+ if(!ChkOpt(nNumOptions, 3)) break;\r
+ mResultFields = 2;\r
+ snprintf (mSQLQuery, 500, "SELECT cll_desc, cll_level FROM clanlevels WHERE cll_clanid = %d LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));\r
+\r
+ break;\r
+ case 373:\r
+ if(!ChkOpt(nNumOptions, 2)) break;\r
+ mResultFields = 4;\r
+ snprintf (mSQLQuery, 500, "SELECT apt_id, apt_location, apt_type, apt_password FROM apartments WHERE apt_id = %d AND apt_owner = %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()));\r
+\r
+ break;\r
+ case 375:\r
+ if(!ChkOpt(nNumOptions, 2)) break;\r
+ mResultFields = 4;\r
+ snprintf (mSQLQuery, 500, "SELECT c_id, c_name, c_location, c_online FROM characters LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()));\r
+\r
+ break;\r
+ case 376:\r
if(!ChkOpt(nNumOptions, 3)) break;\r
- mResultFields = 6;
- snprintf (mSQLQuery, 500, "SELECT a.a_id, c.c_id, a.a_username, c.c_name, c.c_online, c.c_location FROM %s.characters AS c, %s.accounts AS a WHERE a.a_priv >= 50 AND c.c_online = %d AND c.a_id = a.a_id ORDER BY c.c_name LIMIT %d, %d",
- Config->GetOption("game_sql_database").c_str(), Config->GetOption("info_sql_database").c_str(), atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));
-
- break;
- case 365:
- // ID, short, name faction
- if(!ChkOpt(nNumOptions, 2)) break;
- mResultFields = 4;
- snprintf (mSQLQuery, 500, "SELECT cl_id, cl_shortdesc, cl_name, cl_faction FROM clans LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()));
-
- break;
- case 366:
- // ID, short, name faction WHERE clanname = %s
- if(!ChkOpt(nNumOptions, 3)) break;
- mResultFields = 4;
- snprintf (mSQLQuery, 500, "SELECT cl_id, cl_shortdesc, cl_name, cl_faction FROM clans WHERE cl_name LIKE \"%s\" LIMIT %d, %d", nOptions[0].c_str(), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));
-
- break;
- case 367:
- if(!ChkOpt(nNumOptions, 1)) break;
- mResultFields = 8;
- snprintf (mSQLQuery, 500, "SELECT cl_id, cl_shortdesc, cl_name, cl_leader, cl_faction, cl_appid, cl_money, (SELECT count(*) FROM characters WHERE c_clan = %d) FROM clans WHERE cl_id = %d", atoi(nOptions[0].c_str()), atoi(nOptions[0].c_str()));
-
- break;
- case 368:
- if(!ChkOpt(nNumOptions, 3)) break;
- mResultFields = 2;
- snprintf (mSQLQuery, 500, "SELECT cll_desc, cll_level FROM clanlevels WHERE cll_clanid = %d LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));
-
- break;
- case 373:
- if(!ChkOpt(nNumOptions, 2)) break;
- mResultFields = 4;
- snprintf (mSQLQuery, 500, "SELECT apt_id, apt_location, apt_type, apt_password FROM apartments WHERE apt_id = %d AND apt_owner = %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()));
-
- break;
- case 375:
- if(!ChkOpt(nNumOptions, 2)) break;
- mResultFields = 4;
- snprintf (mSQLQuery, 500, "SELECT c_id, c_name, c_location, c_online FROM characters LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()));
-
- break;
- case 376:
- if(!ChkOpt(nNumOptions, 3)) break;
- mResultFields = 4;
- snprintf (mSQLQuery, 500, "SELECT c_id, c_name, c_location, c_online FROM characters WHERE c_name LIKE \"%s\" LIMIT %d, %d", nOptions[0].c_str(), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));
-
- break;
- case 377:
- if(!ChkOpt(nNumOptions, 1)) break;
- mResultFields = 1;
- snprintf (mSQLQuery, 500, "SELECT DISTINCT a_id FROM characters WHERE c_id = %d", atoi(nOptions[0].c_str()));
-
- break;
- case 378:
- if(!ChkOpt(nNumOptions, 1)) break;
- mResultFields = 5;
- snprintf (mSQLQuery, 500, "SELECT a_username, a_email, \"Since begin\", \"Never\", FROM_UNIXTIME(a_bandate) FROM `%s`.accounts WHERE a_id = %d", Config->GetOption("info_sql_database").c_str(), atoi(nOptions[0].c_str()));
-
- break;
+ mResultFields = 4;\r
+ snprintf (mSQLQuery, 500, "SELECT c_id, c_name, c_location, c_online FROM characters WHERE c_name LIKE \"%s\" LIMIT %d, %d", nOptions[0].c_str(), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));\r
+\r
+ break;\r
+ case 377:\r
+ if(!ChkOpt(nNumOptions, 1)) break;\r
+ mResultFields = 1;\r
+ snprintf (mSQLQuery, 500, "SELECT DISTINCT a_id FROM characters WHERE c_id = %d", atoi(nOptions[0].c_str()));\r
+\r
+ break;\r
+ case 378:\r
+ if(!ChkOpt(nNumOptions, 1)) break;\r
+ mResultFields = 5;\r
+ snprintf (mSQLQuery, 500, "SELECT a_username, a_email, \"Since begin\", \"Never\", FROM_UNIXTIME(a_bandate) FROM `%s`.accounts WHERE a_id = %d", Config->GetOption("info_sql_database").c_str(), atoi(nOptions[0].c_str()));\r
+\r
+ break;\r
case 379:\r
- if(!ChkOpt(nNumOptions, 1)) break;
- mResultFields = 6;
- snprintf (mSQLQuery, 500, "SELECT c_id, c_name, c_location, c_online, c_clan, cll_level FROM characters INNER JOIN clanlevels ON (cll_charid = c_id) WHERE c_id = %d", atoi(nOptions[0].c_str()));
-
- break;
- case 380: // clean
- if(!ChkOpt(nNumOptions, 2)) break;
- mResultFields = 2;
- snprintf (mSQLQuery, 500, "SELECT cl_name, cll_desc FROM clans INNER JOIN clanlevels ON (cll_clanid = cl_id) WHERE cl_id = %d AND cll_level = %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()));
-
- break;
- case 381:
- if(!ChkOpt(nNumOptions, 3)) break;
- mResultFields = 4;
- snprintf (mSQLQuery, 500, "SELECT c_id, c_name, 0, c_online FROM characters WHERE a_id = %d LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));
-
- break;
- case 384: // clean
- if(!ChkOpt(nNumOptions, 3)) break;
- mResultFields = 4;
- snprintf (mSQLQuery, 500, "SELECT apt_id, apt_location, 0, apt_password FROM apartments WHERE apt_owner = %d LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));
-
- break;
- case 400:
- if(!ChkOpt(nNumOptions, 2)) break;
- mResultFields = 4;
- snprintf (mSQLQuery, 500, "SELECT fp_id, fp_name, c_name, fp_datetime FROM forum_posts INNER JOIN forums ON (fp_forumid = f_id) INNER JOIN characters ON (fp_fromid = c_id) WHERE (f_name = \"%s\") LIMIT %d, %d", nOptions[0].c_str(), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));
-
- break;
- case 401:
- if(!ChkOpt(nNumOptions, 3)) break;
- mResultFields = 4;
- snprintf (mSQLQuery, 500, "SELECT c_name, fp_name, fp_datetime, fp_content FROM forum_posts INNER JOIN forums ON (fp_forumid = f_id) INNER JOIN characters ON (fp_fromid = c_id) WHERE (f_name = \"%s\") AND (fp_id = %d OR fp_replyid = %d)", nOptions[0].c_str(), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));
-
- break;
- case 406:
if(!ChkOpt(nNumOptions, 1)) break;\r
- mResultFields = 1;
- snprintf (mSQLQuery, 500, "SELECT count(fp_id) FROM forum_posts INNER JOIN forums ON (fp_forumid = f_id) WHERE f_name = \"%s\"", nOptions[0].c_str());
-
- break;
- case 410:
- if(!ChkOpt(nNumOptions, 4)) break;
- mResultFields = 4;
- snprintf (mSQLQuery, 500, "SELECT fp_id, fp_name, c_name, fp_datetime FROM forum_posts INNER JOIN forums ON (fp_forumid = f_area) INNER JOIN characters ON (fp_fromid = c_id) WHERE (f_name = \"%s\" AND fp_factionid = %d) LIMIT %d, %d", nOptions[0].c_str(), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()), atoi(nOptions[3].c_str()));
-
- break;
- case 411:
- if(!ChkOpt(nNumOptions, 4)) break;
- mResultFields = 4;
- snprintf (mSQLQuery, 500, "SELECT c_name, fp_name, fp_datetime, fp_content FROM forum_posts INNER JOIN forums ON (fp_forumid = f_area) INNER JOIN characters ON (fp_fromid = c_id) WHERE (f_name = \"%s\") AND (fp_id = %d OR fp_replyid = %d) AND (fp_factionid = %d)", nOptions[0].c_str(), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()), atoi(nOptions[3].c_str()));
-
- break;
-
- case 420:
+ mResultFields = 6;\r
+ snprintf (mSQLQuery, 500, "SELECT c_id, c_name, c_location, c_online, c_clan, cll_level FROM characters INNER JOIN clanlevels ON (cll_charid = c_id) WHERE c_id = %d", atoi(nOptions[0].c_str()));\r
+\r
+ break;\r
+ case 380: // clean\r
+ if(!ChkOpt(nNumOptions, 2)) break;\r
+ mResultFields = 2;\r
+ snprintf (mSQLQuery, 500, "SELECT cl_name, cll_desc FROM clans INNER JOIN clanlevels ON (cll_clanid = cl_id) WHERE cl_id = %d AND cll_level = %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()));\r
+\r
+ break;\r
+ case 381:\r
+ if(!ChkOpt(nNumOptions, 3)) break;\r
+ mResultFields = 4;\r
+ snprintf (mSQLQuery, 500, "SELECT c_id, c_name, 0, c_online FROM characters WHERE a_id = %d LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));\r
+\r
+ break;\r
+ case 384: // clean\r
+ if(!ChkOpt(nNumOptions, 3)) break;\r
+ mResultFields = 4;\r
+ snprintf (mSQLQuery, 500, "SELECT apt_id, apt_location, 0, apt_password FROM apartments WHERE apt_owner = %d LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));\r
+\r
+ break;\r
+ case 400:\r
+ if(!ChkOpt(nNumOptions, 2)) break;\r
+ mResultFields = 4;\r
+ snprintf (mSQLQuery, 500, "SELECT fp_id, fp_name, c_name, fp_datetime FROM forum_posts INNER JOIN forums ON (fp_forumid = f_id) INNER JOIN characters ON (fp_fromid = c_id) WHERE (f_name = \"%s\") LIMIT %d, %d", nOptions[0].c_str(), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));\r
+\r
+ break;\r
+ case 401:\r
+ if(!ChkOpt(nNumOptions, 3)) break;\r
+ mResultFields = 4;\r
+ snprintf (mSQLQuery, 500, "SELECT c_name, fp_name, fp_datetime, fp_content FROM forum_posts INNER JOIN forums ON (fp_forumid = f_id) INNER JOIN characters ON (fp_fromid = c_id) WHERE (f_name = \"%s\") AND (fp_id = %d OR fp_replyid = %d)", nOptions[0].c_str(), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));\r
+\r
+ break;\r
+ case 406:\r
+ if(!ChkOpt(nNumOptions, 1)) break;\r
+ mResultFields = 1;\r
+ snprintf (mSQLQuery, 500, "SELECT count(fp_id) FROM forum_posts INNER JOIN forums ON (fp_forumid = f_id) WHERE f_name = \"%s\"", nOptions[0].c_str());\r
+\r
+ break;\r
+ case 410:\r
+ if(!ChkOpt(nNumOptions, 4)) break;\r
+ mResultFields = 4;\r
+ snprintf (mSQLQuery, 500, "SELECT fp_id, fp_name, c_name, fp_datetime FROM forum_posts INNER JOIN forums ON (fp_forumid = f_area) INNER JOIN characters ON (fp_fromid = c_id) WHERE (f_name = \"%s\" AND fp_factionid = %d) LIMIT %d, %d", nOptions[0].c_str(), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()), atoi(nOptions[3].c_str()));\r
+\r
+ break;\r
+ case 411:\r
+ if(!ChkOpt(nNumOptions, 4)) break;\r
+ mResultFields = 4;\r
+ snprintf (mSQLQuery, 500, "SELECT c_name, fp_name, fp_datetime, fp_content FROM forum_posts INNER JOIN forums ON (fp_forumid = f_area) INNER JOIN characters ON (fp_fromid = c_id) WHERE (f_name = \"%s\") AND (fp_id = %d OR fp_replyid = %d) AND (fp_factionid = %d)", nOptions[0].c_str(), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()), atoi(nOptions[3].c_str()));\r
+\r
+ break;\r
+\r
+ case 420:\r
if(!ChkOpt(nNumOptions, 3)) break;\r
mResultFields = 6;\r
snprintf (mSQLQuery, 500, "SELECT e_id, e_subject, c_name, e_new, e_replied, e_datetime FROM emails, characters WHERE e_fromid = c_id AND e_toid = %i LIMIT %i, %i", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));\r
\r
break;\r
- case 421:
+ case 421:\r
if(!ChkOpt(nNumOptions, 1)) break;\r
- //MailControl order. "MailControl", "Mail ID", "Subject", "From", boolean Replied, "Date/Time", "FromID", "Content"
+ //MailControl order. "MailControl", "Mail ID", "Subject", "From", boolean Replied, "Date/Time", "FromID", "Content"\r
mResultFields = 7;\r
snprintf (mSQLQuery, 500, "SELECT e_id, e_subject, c_name, e_replied, e_datetime, e_fromid, e_body FROM emails, characters WHERE e_fromid = c_id AND e_id = %s", nOptions[0].c_str());\r
\r
- break;
- case 425:
- if(!ChkOpt(nNumOptions, 1)) break;
- //Send mail order. "SendMail", "id"
- mResultFields = 1;
- snprintf (mSQLQuery, 500, "SELECT c_id FROM characters WHERE c_name = \'%s\'", nOptions[0].c_str());
-
- break;
- case 430:
- if(!ChkOpt(nNumOptions, 2)) break;
- mResultFields = 4;
- snprintf (mSQLQuery, 500, "SELECT a.c_id, a.c_conid, b.c_name, a.c_desc FROM contacts as a, characters as b WHERE a.c_conid = b.c_id AND a.c_listid = %s AND c_type = %s", nOptions[0].c_str(), nOptions[1].c_str());
-
- break;\r
- case 431:
- if(!ChkOpt(nNumOptions, 1)) break;
- mResultFields = 4;
- snprintf (mSQLQuery, 500, "SELECT a.c_id, a.c_conid, b.c_name, a.c_desc FROM contacts as a, characters as b WHERE a.c_conid = b.c_id AND a.c_id = %s", nOptions[0].c_str());
-
- break;
- case 435:
- if(!ChkOpt(nNumOptions, 2)) break;
- mResultFields = 1;
- snprintf (mSQLQuery, 500, "SELECT count(*) FROM contacts WHERE c_listid = %s AND c_type = %s", nOptions[0].c_str(), nOptions[1].c_str());
-
- break;
- case 436:
- if(!ChkOpt(nNumOptions, 3)) break;
- mResultFields = 2;
- snprintf (mSQLQuery, 500, "SELECT c_id, c_name FROM characters WHERE c_name LIKE \'%%%s%%\' LIMIT %s, %s", nOptions[0].c_str(), nOptions[1].c_str(), nOptions[2].c_str());
-
- break;
- case 437:
+ break;\r
+ case 425:\r
if(!ChkOpt(nNumOptions, 1)) break;\r
- mResultFields = 1; //Fieldnum
- snprintf (mSQLQuery, 500, "SELECT c_name FROM characters WHERE c_id = %s", nOptions[0].c_str());
-\r
- break;
- case 445:
- if(!ChkOpt(nNumOptions, 4)) break;
- mResultFields = 2;
- snprintf (mSQLQuery, 500, "SELECT nc_id, nc_name FROM neochronicle WHERE nc_lang = %d ORDER BY nc_id DESC LIMIT %d, %d", atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()), atoi(nOptions[3].c_str()));
-
- break;
- case 446:
- if(!ChkOpt(nNumOptions, 1)) break;
- mResultFields = 5;
- snprintf (mSQLQuery, 500, "SELECT nc_id, nc_lang, nc_datetime, nc_name, nc_content FROM neochronicle WHERE nc_id = %d", atoi(nOptions[0].c_str()));
-
- break;\r
- case 453:
- if(!ChkOpt(nNumOptions, 4)) break;
- mResultFields = 5;
- snprintf (mSQLQuery, 500, "SELECT g_id, 0, g_part, g_title, g_language FROM guides WHERE g_chapter = %d AND g_language = %d LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()), atoi(nOptions[3].c_str()));
-
- break;
- case 455:
+ //Send mail order. "SendMail", "id"\r
+ mResultFields = 1;\r
+ snprintf (mSQLQuery, 500, "SELECT c_id FROM characters WHERE c_name = \'%s\'", nOptions[0].c_str());\r
+\r
+ break;\r
+ case 430:\r
+ if(!ChkOpt(nNumOptions, 2)) break;\r
+ mResultFields = 4;\r
+ snprintf (mSQLQuery, 500, "SELECT a.c_id, a.c_conid, b.c_name, a.c_desc FROM contacts as a, characters as b WHERE a.c_conid = b.c_id AND a.c_listid = %s AND c_type = %s", nOptions[0].c_str(), nOptions[1].c_str());\r
+\r
+ break;\r
+ case 431:\r
+ if(!ChkOpt(nNumOptions, 1)) break;\r
+ mResultFields = 4;\r
+ snprintf (mSQLQuery, 500, "SELECT a.c_id, a.c_conid, b.c_name, a.c_desc FROM contacts as a, characters as b WHERE a.c_conid = b.c_id AND a.c_id = %s", nOptions[0].c_str());\r
+\r
+ break;\r
+ case 435:\r
+ if(!ChkOpt(nNumOptions, 2)) break;\r
+ mResultFields = 1;\r
+ snprintf (mSQLQuery, 500, "SELECT count(*) FROM contacts WHERE c_listid = %s AND c_type = %s", nOptions[0].c_str(), nOptions[1].c_str());\r
+\r
+ break;\r
+ case 436:\r
+ if(!ChkOpt(nNumOptions, 3)) break;\r
+ mResultFields = 2;\r
+ snprintf (mSQLQuery, 500, "SELECT c_id, c_name FROM characters WHERE c_name LIKE \'%%%s%%\' LIMIT %s, %s", nOptions[0].c_str(), nOptions[1].c_str(), nOptions[2].c_str());\r
+\r
+ break;\r
+ case 437:\r
+ if(!ChkOpt(nNumOptions, 1)) break;\r
+ mResultFields = 1; //Fieldnum\r
+ snprintf (mSQLQuery, 500, "SELECT c_name FROM characters WHERE c_id = %s", nOptions[0].c_str());\r
+\r
+ break;\r
+ case 445:\r
+ if(!ChkOpt(nNumOptions, 4)) break;\r
+ mResultFields = 2;\r
+ snprintf (mSQLQuery, 500, "SELECT nc_id, nc_name FROM neochronicle WHERE nc_lang = %d ORDER BY nc_id DESC LIMIT %d, %d", atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()), atoi(nOptions[3].c_str()));\r
+\r
+ break;\r
+ case 446:\r
+ if(!ChkOpt(nNumOptions, 1)) break;\r
+ mResultFields = 5;\r
+ snprintf (mSQLQuery, 500, "SELECT nc_id, nc_lang, nc_datetime, nc_name, nc_content FROM neochronicle WHERE nc_id = %d", atoi(nOptions[0].c_str()));\r
+\r
+ break;\r
+ case 453:\r
if(!ChkOpt(nNumOptions, 4)) break;\r
- mResultFields = 3;
- // Opt 2 is Language
- snprintf (mSQLQuery, 500, "SELECT g_id, g_part, g_title FROM guides WHERE g_chapter = %d AND g_language = %d LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()), atoi(nOptions[3].c_str()));
-\r
- break;
- case 456:
- if(!ChkOpt(nNumOptions, 1)) break;
- mResultFields = 4;
- snprintf (mSQLQuery, 500, "SELECT g_id, g_language, g_title, g_content FROM guides WHERE g_id = %d", atoi(nOptions[0].c_str()));
-
- break;
- case 458: // Statisics
- Console->Print("%s [Pterminal::HandleReceiveDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);
- break;
- case 459: // Statisics
- Console->Print("%s [Pterminal::HandleReceiveDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);
- break;
- case 510: // ClanWars: Overview
- if(!ChkOpt(nNumOptions, 3)) break;
- mResultFields = 4;
- snprintf (mSQLQuery, 500, "SELECT cw_id, cl_name, cw_starttime, cw_status FROM clanwars INNER JOIN clans ON (cw_initclan = cl_id) or (cw_enemyclan = cl_id) WHERE (cw_enemyclan = %d OR cw_initclan = %d) AND (cl_id != %d) LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[0].c_str()), atoi(nOptions[0].c_str()), atoi(nOptions[2].c_str()), atoi(nOptions[3].c_str()));
- break;
- case 511: // ClanWars: Selfdeclared wars
- if(!ChkOpt(nNumOptions, 3)) break;
- mResultFields = 4;
- snprintf (mSQLQuery, 500, "SELECT cw_id, cl_name, cw_starttime, cw_status FROM clanwars INNER JOIN clans ON (cw_enemyclan = cl_id) WHERE cw_initclan = %d LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));
- break;
- case 512: // ClanWars: Foreigndeclared wars
- if(!ChkOpt(nNumOptions, 3)) break;
- mResultFields = 4;
- snprintf (mSQLQuery, 500, "SELECT cw_id, cl_name, cw_starttime, cw_status FROM clanwars INNER JOIN clans ON (cw_initclan = cl_id) WHERE cw_enemyclan = %d LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));
- break;
- case 513:
- if(!ChkOpt(nNumOptions, 4)) break;
- mResultFields = 2;
- snprintf (mSQLQuery, 500, "SELECT cl_id, cl_name FROM clans WHERE cl_faction = %d AND cl_id != %d LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()), atoi(nOptions[3].c_str()));
- break;
- case 514:
- if(!ChkOpt(nNumOptions, 1)) break;
- mResultFields = 2;
- snprintf (mSQLQuery, 500, "SELECT cl_id, cl_name FROM clans WHERE cl_id = %d", atoi(nOptions[0].c_str()));
- break;
- case 520:
- if(!ChkOpt(nNumOptions, 1)) break;
- mResultFields = 10;
- snprintf (mSQLQuery, 500, "SELECT cl_faction, cl_shortdesc, cl_name, cl_description, 0, cl_appid, 80, cl_money, (SELECT count(*) FROM outposts WHERE o_clan = %d), (SELECT count(*) FROM characters WHERE c_clan = %d) FROM clans WHERE cl_id = %d", atoi(nOptions[0].c_str()), atoi(nOptions[0].c_str()), atoi(nOptions[0].c_str()));
-
- break;
- case 521:
- if(!ChkOpt(nNumOptions, 4)) break;
- mResultFields = 6;
- snprintf (mSQLQuery, 500, "SELECT c_id, c_name, 0, cll_desc, 0, c_online FROM characters INNER JOIN clanlevels ON (c_id = cll_charid) WHERE c_clan = %d AND cll_level >= %d AND cll_level < 15 LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()), atoi(nOptions[3].c_str()));
-
- break;
- case 522:
- if(!ChkOpt(nNumOptions, 5)) break;
- mResultFields = 6;
- snprintf (mSQLQuery, 500, "SELECT c_id, c_name, 0, cll_desc, 0, c_online FROM characters INNER JOIN clanlevels ON (c_id = cll_charid) WHERE cll_level >= %d AND cll_level <= %d AND c_clan = %d ORDER BY cll_level DESC LIMIT %d, %d", atoi(nOptions[2].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[0].c_str()), atoi(nOptions[3].c_str()), atoi(nOptions[4].c_str()));
-
- break;
- case 523:
- if(!ChkOpt(nNumOptions, 1)) break;
- mResultFields = 5;
- snprintf (mSQLQuery, 500, "SELECT cl_shortdesc, cl_name, cl_leader, cl_description, cl_minsympathy FROM clans WHERE cl_id = %d", atoi(nOptions[0].c_str()));
-
- break;
- case 540:
- if(!ChkOpt(nNumOptions, 3)) break;
- mResultFields = 2;
- snprintf (mSQLQuery, 500, "SELECT apt_id, apt_location FROM apartments WHERE apt_owner = %d LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));
-
- break;
- case 541:
- if(!ChkOpt(nNumOptions, 3)) break;
- mResultFields = 2;
- snprintf (mSQLQuery, 500, "SELECT v_id, v_type FROM vehicles WHERE v_owner = %d LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));
-
- break;
- case 542:
- if(!ChkOpt(nNumOptions, 2)) break;
- mResultFields = 5;
- snprintf (mSQLQuery, 500, "SELECT v_id, v_type, v_world, v_status, v_condition FROM vehicles WHERE v_owner = %d and v_id = %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()));
-
- break;
- case 544:
- if(!ChkOpt(nNumOptions, 4)) break;
- mResultFields = 1;
- snprintf (mSQLQuery, 500, "SELECT count(*) FROM clanwars WHERE (cw_initclan = %d AND cw_enemyclan = %d) OR (cw_enemyclan = %d AND cw_initclan = %d)", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()), atoi(nOptions[3].c_str()));
-
- break;
- case 546:
- if(!ChkOpt(nNumOptions, 1)) break;
- mResultFields = 2;
- snprintf (mSQLQuery, 500, "SELECT cw_starttime, (TO_DAYS(NOW()) - TO_DAYS(cw_starttime)) FROM clanwars WHERE cw_id = %d", atoi(nOptions[0].c_str()));
-
- break;
- case 547:
- if(!ChkOpt(nNumOptions, 1)) break;
- mResultFields = 6;
- snprintf (mSQLQuery, 500, "SELECT cw_initclan, cw_enemyclan, cw_starttime, cw_status, cw_statement_initiator, cw_statement_enemy FROM clanwars WHERE cw_id = %d", atoi(nOptions[0].c_str()));
-
- break;
- case 557:
- Console->Print("%s [Pterminal::HandleReceiveDB] QueryID %d means that you want to edit an DialogScript from the server. This is not supportet yet!", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);
- break;
+ mResultFields = 5;\r
+ snprintf (mSQLQuery, 500, "SELECT g_id, 0, g_part, g_title, g_language FROM guides WHERE g_chapter = %d AND g_language = %d LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()), atoi(nOptions[3].c_str()));\r
+\r
+ break;\r
+ case 455:\r
+ if(!ChkOpt(nNumOptions, 4)) break;\r
+ mResultFields = 3;\r
+ // Opt 2 is Language\r
+ snprintf (mSQLQuery, 500, "SELECT g_id, g_part, g_title FROM guides WHERE g_chapter = %d AND g_language = %d LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()), atoi(nOptions[3].c_str()));\r
+\r
+ break;\r
+ case 456:\r
+ if(!ChkOpt(nNumOptions, 1)) break;\r
+ mResultFields = 4;\r
+ snprintf (mSQLQuery, 500, "SELECT g_id, g_language, g_title, g_content FROM guides WHERE g_id = %d", atoi(nOptions[0].c_str()));\r
+\r
+ break;\r
+ case 458: // Statisics\r
+ Console->Print("%s [Pterminal::HandleReceiveDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);\r
+ break;\r
+ case 459: // Statisics\r
+ Console->Print("%s [Pterminal::HandleReceiveDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);\r
+ break;\r
+ case 510: // ClanWars: Overview\r
+ if(!ChkOpt(nNumOptions, 3)) break;\r
+ mResultFields = 4;\r
+ snprintf (mSQLQuery, 500, "SELECT cw_id, cl_name, cw_starttime, cw_status FROM clanwars INNER JOIN clans ON (cw_initclan = cl_id) or (cw_enemyclan = cl_id) WHERE (cw_enemyclan = %d OR cw_initclan = %d) AND (cl_id != %d) LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[0].c_str()), atoi(nOptions[0].c_str()), atoi(nOptions[2].c_str()), atoi(nOptions[3].c_str()));\r
+ break;\r
+ case 511: // ClanWars: Selfdeclared wars\r
+ if(!ChkOpt(nNumOptions, 3)) break;\r
+ mResultFields = 4;\r
+ snprintf (mSQLQuery, 500, "SELECT cw_id, cl_name, cw_starttime, cw_status FROM clanwars INNER JOIN clans ON (cw_enemyclan = cl_id) WHERE cw_initclan = %d LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));\r
+ break;\r
+ case 512: // ClanWars: Foreigndeclared wars\r
+ if(!ChkOpt(nNumOptions, 3)) break;\r
+ mResultFields = 4;\r
+ snprintf (mSQLQuery, 500, "SELECT cw_id, cl_name, cw_starttime, cw_status FROM clanwars INNER JOIN clans ON (cw_initclan = cl_id) WHERE cw_enemyclan = %d LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));\r
+ break;\r
+ case 513:\r
+ if(!ChkOpt(nNumOptions, 4)) break;\r
+ mResultFields = 2;\r
+ snprintf (mSQLQuery, 500, "SELECT cl_id, cl_name FROM clans WHERE cl_faction = %d AND cl_id != %d LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()), atoi(nOptions[3].c_str()));\r
+ break;\r
+ case 514:\r
+ if(!ChkOpt(nNumOptions, 1)) break;\r
+ mResultFields = 2;\r
+ snprintf (mSQLQuery, 500, "SELECT cl_id, cl_name FROM clans WHERE cl_id = %d", atoi(nOptions[0].c_str()));\r
+ break;\r
+ case 520:\r
+ if(!ChkOpt(nNumOptions, 1)) break;\r
+ mResultFields = 10;\r
+ snprintf (mSQLQuery, 500, "SELECT cl_faction, cl_shortdesc, cl_name, cl_description, 0, cl_appid, 80, cl_money, (SELECT count(*) FROM outposts WHERE o_clan = %d), (SELECT count(*) FROM characters WHERE c_clan = %d) FROM clans WHERE cl_id = %d", atoi(nOptions[0].c_str()), atoi(nOptions[0].c_str()), atoi(nOptions[0].c_str()));\r
+\r
+ break;\r
+ case 521:\r
+ if(!ChkOpt(nNumOptions, 4)) break;\r
+ mResultFields = 6;\r
+ snprintf (mSQLQuery, 500, "SELECT c_id, c_name, 0, cll_desc, 0, c_online FROM characters INNER JOIN clanlevels ON (c_id = cll_charid) WHERE c_clan = %d AND cll_level >= %d AND cll_level < 15 LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()), atoi(nOptions[3].c_str()));\r
+\r
+ break;\r
+ case 522:\r
+ if(!ChkOpt(nNumOptions, 5)) break;\r
+ mResultFields = 6;\r
+ snprintf (mSQLQuery, 500, "SELECT c_id, c_name, 0, cll_desc, 0, c_online FROM characters INNER JOIN clanlevels ON (c_id = cll_charid) WHERE cll_level >= %d AND cll_level <= %d AND c_clan = %d ORDER BY cll_level DESC LIMIT %d, %d", atoi(nOptions[2].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[0].c_str()), atoi(nOptions[3].c_str()), atoi(nOptions[4].c_str()));\r
+\r
+ break;\r
+ case 523:\r
+ if(!ChkOpt(nNumOptions, 1)) break;\r
+ mResultFields = 5;\r
+ snprintf (mSQLQuery, 500, "SELECT cl_shortdesc, cl_name, cl_leader, cl_description, cl_minsympathy FROM clans WHERE cl_id = %d", atoi(nOptions[0].c_str()));\r
+\r
+ break;\r
+ case 540:\r
+ if(!ChkOpt(nNumOptions, 3)) break;\r
+ mResultFields = 2;\r
+ snprintf (mSQLQuery, 500, "SELECT apt_id, apt_location FROM apartments WHERE apt_owner = %d LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));\r
+\r
+ break;\r
+ case 541:\r
+ if(!ChkOpt(nNumOptions, 3)) break;\r
+ mResultFields = 2;\r
+ snprintf (mSQLQuery, 500, "SELECT v_id, v_type FROM vehicles WHERE v_owner = %d LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));\r
+\r
+ break;\r
+ case 542:\r
+ if(!ChkOpt(nNumOptions, 2)) break;\r
+ mResultFields = 5;\r
+ snprintf (mSQLQuery, 500, "SELECT v_id, v_type, v_world, v_status, v_condition FROM vehicles WHERE v_owner = %d and v_id = %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()));\r
+\r
+ break;\r
+ case 544:\r
+ if(!ChkOpt(nNumOptions, 4)) break;\r
+ mResultFields = 1;\r
+ snprintf (mSQLQuery, 500, "SELECT count(*) FROM clanwars WHERE (cw_initclan = %d AND cw_enemyclan = %d) OR (cw_enemyclan = %d AND cw_initclan = %d)", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()), atoi(nOptions[3].c_str()));\r
+\r
+ break;\r
+ case 546:\r
+ if(!ChkOpt(nNumOptions, 1)) break;\r
+ mResultFields = 2;\r
+ snprintf (mSQLQuery, 500, "SELECT cw_starttime, (TO_DAYS(NOW()) - TO_DAYS(cw_starttime)) FROM clanwars WHERE cw_id = %d", atoi(nOptions[0].c_str()));\r
+\r
+ break;\r
+ case 547:\r
+ if(!ChkOpt(nNumOptions, 1)) break;\r
+ mResultFields = 6;\r
+ snprintf (mSQLQuery, 500, "SELECT cw_initclan, cw_enemyclan, cw_starttime, cw_status, cw_statement_initiator, cw_statement_enemy FROM clanwars WHERE cw_id = %d", atoi(nOptions[0].c_str()));\r
+\r
+ break;\r
+ case 557:\r
+ Console->Print("%s [Pterminal::HandleReceiveDB] QueryID %d means that you want to edit an DialogScript from the server. This is not supportet yet!", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);\r
+ break;\r
case 558:\r
- Console->Print("%s [Pterminal::HandleReceiveDB] QueryID %d means that you want to edit an DialogScript from the server. This is not supportet yet!", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);
- break;
- case 562:
- mResultFields = 6;
- snprintf (mSQLQuery, 500, "SELECT cb_inscription FROM datacubes WHERE cb_id = %d", atoi(nOptions[0].c_str()));
-
- break;
- case 569:
+ Console->Print("%s [Pterminal::HandleReceiveDB] QueryID %d means that you want to edit an DialogScript from the server. This is not supportet yet!", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);\r
+ break;\r
+ case 562:\r
+ mResultFields = 6;\r
+ snprintf (mSQLQuery, 500, "SELECT cb_inscription FROM datacubes WHERE cb_id = %d", atoi(nOptions[0].c_str()));\r
+\r
+ break;\r
+ case 569:\r
// Faction representatives. Not stored yet... is it?\r
Console->Print("%s [Pterminal::HandleReceiveDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);\r
- break;
- case 570:
- // Clan representatives. Stored but this query wants votes too... Maybe later
- Console->Print("%s [Pterminal::HandleReceiveDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);
- break;\r
- case 571:
- // Clan representatives. Stored but this query wants votes too... Maybe later
- Console->Print("%s [Pterminal::HandleReceiveDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);
- break;
- case 572:
- // Runner voting. Not stored yet
+ break;\r
+ case 570:\r
+ // Clan representatives. Stored but this query wants votes too... Maybe later\r
+ Console->Print("%s [Pterminal::HandleReceiveDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);\r
+ break;\r
+ case 571:\r
+ // Clan representatives. Stored but this query wants votes too... Maybe later\r
+ Console->Print("%s [Pterminal::HandleReceiveDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);\r
+ break;\r
+ case 572:\r
+ // Runner voting. Not stored yet\r
+ Console->Print("%s [Pterminal::HandleReceiveDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);\r
+ break;\r
+ case 573:\r
+ // Next election date\r
Console->Print("%s [Pterminal::HandleReceiveDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);\r
break;\r
- case 573:
- // Next election date
- Console->Print("%s [Pterminal::HandleReceiveDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);
- break;
- case 574:
- mResultFields = 6;
- snprintf (mSQLQuery, 500, "SELECT count(c_id) FROM characters WHERE c_faction = %d", atoi(nOptions[0].c_str()));
+ case 574:\r
+ mResultFields = 6;\r
+ snprintf (mSQLQuery, 500, "SELECT count(c_id) FROM characters WHERE c_faction = %d", atoi(nOptions[0].c_str()));\r
\r
break;\r
- case 575:
- // Runner satisfaction with faction
- Console->Print("%s [Pterminal::HandleReceiveDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);
- break;
- case 576:
+ case 575:\r
+ // Runner satisfaction with faction\r
+ Console->Print("%s [Pterminal::HandleReceiveDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);\r
+ break;\r
+ case 576:\r
// Check if vote from runner is already stored\r
Console->Print("%s [Pterminal::HandleReceiveDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);\r
break;\r
- case 582:
- // Clan representative details. Faction rank etc... not stored yet
- Console->Print("%s [Pterminal::HandleReceiveDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);
- break;
- case 583:
- // Clan representative details. Faction rank etc... not stored yet
- Console->Print("%s [Pterminal::HandleReceiveDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);
- break;
- case 584:
- // Clan representative details. Faction rank etc... not stored yet
- Console->Print("%s [Pterminal::HandleReceiveDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);
- break;
- case 587:
- // Clan representative stuff again...
- Console->Print("%s [Pterminal::HandleReceiveDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);
- break;
- case 603:
- mResultFields = 1;
- //snprintf (mSQLQuery, 500, "SELECT count(*) FROM `bug report` WHERE br_status = 0");
- snprintf (mSQLQuery, 500, "SELECT count(*) FROM support WHERE su_inwork = 0 AND su_finished = 0");
-
- break;
- case 604:
- mResultFields = 1;
- //snprintf (mSQLQuery, 500, "SELECT count(*) FROM `bug report` WHERE br_status = 1");
- snprintf (mSQLQuery, 500, "SELECT count(*) FROM support WHERE su_inwork = 1 AND su_finished = 0");
-
- break;
- case 605:
- mResultFields = 1;
- //snprintf (mSQLQuery, 500, "SELECT count(*) FROM `bug report` WHERE br_status = 2");
- snprintf (mSQLQuery, 500, "SELECT count(*) FROM support WHERE su_finished = 1");
-
- break;
- case 606:
- mResultFields = 1;
- //snprintf (mSQLQuery, 500, "SELECT count(*) FROM `bug report`");
- snprintf (mSQLQuery, 500, "SELECT count(*) FROM support");
-
- break;\r
- case 607: // Dont know how to select data from sql where no data to JOIN is there anymore :/
- // This should query ID, RunnerID and Date from bug reports where runnerID is unknown
- Console->Print("%s [Pterminal::HandleReceiveDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);
- break;
- case 608:
- mResultFields = 5;
- snprintf (mSQLQuery, 500, "SELECT br_id, br_fromid, br_location, br_status, br_datetime FROM bug_report WHERE br_id = %d", atoi(nOptions[0].c_str()));
-
- break;
+ case 582:\r
+ // Clan representative details. Faction rank etc... not stored yet\r
+ Console->Print("%s [Pterminal::HandleReceiveDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);\r
+ break;\r
+ case 583:\r
+ // Clan representative details. Faction rank etc... not stored yet\r
+ Console->Print("%s [Pterminal::HandleReceiveDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);\r
+ break;\r
+ case 584:\r
+ // Clan representative details. Faction rank etc... not stored yet\r
+ Console->Print("%s [Pterminal::HandleReceiveDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);\r
+ break;\r
+ case 587:\r
+ // Clan representative stuff again...\r
+ Console->Print("%s [Pterminal::HandleReceiveDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);\r
+ break;\r
+ case 603:\r
+ mResultFields = 1;\r
+ //snprintf (mSQLQuery, 500, "SELECT count(*) FROM `bug report` WHERE br_status = 0");\r
+ snprintf (mSQLQuery, 500, "SELECT count(*) FROM support WHERE su_inwork = 0 AND su_finished = 0");\r
+\r
+ break;\r
+ case 604:\r
+ mResultFields = 1;\r
+ //snprintf (mSQLQuery, 500, "SELECT count(*) FROM `bug report` WHERE br_status = 1");\r
+ snprintf (mSQLQuery, 500, "SELECT count(*) FROM support WHERE su_inwork = 1 AND su_finished = 0");\r
+\r
+ break;\r
+ case 605:\r
+ mResultFields = 1;\r
+ //snprintf (mSQLQuery, 500, "SELECT count(*) FROM `bug report` WHERE br_status = 2");\r
+ snprintf (mSQLQuery, 500, "SELECT count(*) FROM support WHERE su_finished = 1");\r
+\r
+ break;\r
+ case 606:\r
+ mResultFields = 1;\r
+ //snprintf (mSQLQuery, 500, "SELECT count(*) FROM `bug report`");\r
+ snprintf (mSQLQuery, 500, "SELECT count(*) FROM support");\r
+\r
+ break;\r
+ case 607: // Dont know how to select data from sql where no data to JOIN is there anymore :/\r
+ // This should query ID, RunnerID and Date from bug reports where runnerID is unknown\r
+ Console->Print("%s [Pterminal::HandleReceiveDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);\r
+ break;\r
+ case 608:\r
+ mResultFields = 5;\r
+ snprintf (mSQLQuery, 500, "SELECT br_id, br_fromid, br_location, br_status, br_datetime FROM bug_report WHERE br_id = %d", atoi(nOptions[0].c_str()));\r
+\r
+ break;\r
case 609:\r
- mResultFields = 1;
- //snprintf (mSQLQuery, 500, "SELECT count(*) FROM `bug report` WHERE br_supid = %s", nOptions[0].c_str());
- snprintf (mSQLQuery, 500, "SELECT count(*) FROM support WHERE su_supporterid = %d", atoi(nOptions[0].c_str()));
+ mResultFields = 1;\r
+ //snprintf (mSQLQuery, 500, "SELECT count(*) FROM `bug report` WHERE br_supid = %s", nOptions[0].c_str());\r
+ snprintf (mSQLQuery, 500, "SELECT count(*) FROM support WHERE su_supporterid = %d", atoi(nOptions[0].c_str()));\r
\r
break;\r
case 610:\r
- mResultFields = 6;
- //snprintf (mSQLQuery, 500, "SELECT br_id, \"0\", c_name, br_location, br_status = 2, br_datetime FROM `bug report`, characters WHERE c_id = br_fromid AND br_supid = %s AND br_status > 0 LIMIT %s, %s", nOptions[0].c_str(), nOptions[1].c_str(), nOptions[2].c_str());
- snprintf (mSQLQuery, 500, "SELECT su_id, su_supporterid, c_name, su_worldid, su_finished, su_datetime FROM support INNER JOIN characters ON (su_supporterid = c_id) WHERE su_supporterid = %d AND su_finished = 1 LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));
-\r
- break;\r
- case 611:// Well, its meant to show date specific stuff. I will rewrite this soon...
- snprintf (mSQLQuery, 500, "SELECT count(*) FROM support WHERE su_supporterid = %d", atoi(nOptions[0].c_str()));
- break;
- case 612:// Well, its meant to show date specific stuff. I will rewrite this soon...
- snprintf (mSQLQuery, 500, "SELECT su_id, su_supporterid, c_name, su_worldid, su_finished, su_datetime FROM support INNER JOIN characters ON (su_supporterid = c_id) WHERE su_supporterid = %d AND su_finished = 1 LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[3].c_str()), atoi(nOptions[4].c_str()));
- break;
- case 625: // Faction council stuff
- Console->Print("%s [Pterminal::HandleReceiveDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);
- break;
- case 626: // Faction council stuff
- Console->Print("%s [Pterminal::HandleReceiveDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);
- break;
- case 627: // Faction council stuff
- Console->Print("%s [Pterminal::HandleReceiveDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);
- break;
- case 628: // Faction council stuff
- Console->Print("%s [Pterminal::HandleReceiveDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);
- break;
- case 629: // Faction council stuff
- Console->Print("%s [Pterminal::HandleReceiveDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);
- break;
+ mResultFields = 6;\r
+ //snprintf (mSQLQuery, 500, "SELECT br_id, \"0\", c_name, br_location, br_status = 2, br_datetime FROM `bug report`, characters WHERE c_id = br_fromid AND br_supid = %s AND br_status > 0 LIMIT %s, %s", nOptions[0].c_str(), nOptions[1].c_str(), nOptions[2].c_str());\r
+ snprintf (mSQLQuery, 500, "SELECT su_id, su_supporterid, c_name, su_worldid, su_finished, su_datetime FROM support INNER JOIN characters ON (su_supporterid = c_id) WHERE su_supporterid = %d AND su_finished = 1 LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));\r
+\r
+ break;\r
+ case 611:// Well, its meant to show date specific stuff. I will rewrite this soon...\r
+ snprintf (mSQLQuery, 500, "SELECT count(*) FROM support WHERE su_supporterid = %d", atoi(nOptions[0].c_str()));\r
+ break;\r
+ case 612:// Well, its meant to show date specific stuff. I will rewrite this soon...\r
+ snprintf (mSQLQuery, 500, "SELECT su_id, su_supporterid, c_name, su_worldid, su_finished, su_datetime FROM support INNER JOIN characters ON (su_supporterid = c_id) WHERE su_supporterid = %d AND su_finished = 1 LIMIT %d, %d", atoi(nOptions[0].c_str()), atoi(nOptions[3].c_str()), atoi(nOptions[4].c_str()));\r
+ break;\r
+ case 625: // Faction council stuff\r
+ Console->Print("%s [Pterminal::HandleReceiveDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);\r
+ break;\r
+ case 626: // Faction council stuff\r
+ Console->Print("%s [Pterminal::HandleReceiveDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);\r
+ break;\r
+ case 627: // Faction council stuff\r
+ Console->Print("%s [Pterminal::HandleReceiveDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);\r
+ break;\r
+ case 628: // Faction council stuff\r
+ Console->Print("%s [Pterminal::HandleReceiveDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);\r
+ break;\r
+ case 629: // Faction council stuff\r
+ Console->Print("%s [Pterminal::HandleReceiveDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);\r
+ break;\r
default:\r
Console->Print("%s [Pterminal::HandleReceiveDB] Unknown QueryID %d", Console->ColorText(RED,BLACK,"Warning"), nDBID);\r
return false;\r
- }
-
- if(strlen(mSQLQuery) == 0)
- return false;
-// ---------------
- MYSQL_RES *result = NULL;
- MYSQL_ROW row;
- int tNumRows = 0;
-
- result = MySQL->GameResQuery(mSQLQuery);
- if (!result)
- {
- Console->Print("Cannot query DB. DBID: %d query was: %s", nDBID, mSQLQuery);
- MySQL->ShowGameSQLError();
- return false;
- }
-
- PMessage* tDBResult = new PMessage();
- tNumRows = mysql_num_rows(result);
-
- // Loop all result rows
- for (int i = 0; i < tNumRows ; i++)
- {
- row = mysql_fetch_row( result ) ;
- // Loop all result fields and push answers into Message
- for (int t = 0; t < mResultFields; t++)
- {
- *tDBResult << ( u16 )(strlen(row[t]) + 1);
- *tDBResult << row[t];
- }
- }
-
- // Build result messages
- char tCmd[100];
- memset(tCmd, '\0', 100);
- strncpy(tCmd, nCommandName->c_str(), 100);
-
- PMessage* tmpMsg_allowed = MsgBuilder->BuildTryAccessAnswerMsg( nClient, tCmd, true );
- PMessage* tmpMsg_result = MsgBuilder->BuildReceiveDBAnswerMsg( nClient, tDBResult, nCommandName, tNumRows, mResultFields);
-
- nClient->SendUDPMessage(tmpMsg_allowed);
- nClient->FragmentAndSendUDPMessage(tmpMsg_result, 0x68);
-
+ }\r
+\r
+ if(strlen(mSQLQuery) == 0)\r
+ return false;\r
+// ---------------\r
+ MYSQL_RES *result = NULL;\r
+ MYSQL_ROW row;\r
+ int tNumRows = 0;\r
+\r
+ result = MySQL->GameResQuery(mSQLQuery);\r
+ if (!result)\r
+ {\r
+ Console->Print("Cannot query DB. DBID: %d query was: %s", nDBID, mSQLQuery);\r
+ MySQL->ShowGameSQLError();\r
+ return false;\r
+ }\r
+\r
+ PMessage* tDBResult = new PMessage();\r
+ tNumRows = mysql_num_rows(result);\r
+\r
+ // Loop all result rows\r
+ for (int i = 0; i < tNumRows ; i++)\r
+ {\r
+ row = mysql_fetch_row( result ) ;\r
+ // Loop all result fields and push answers into Message\r
+ for (int t = 0; t < mResultFields; t++)\r
+ {\r
+ *tDBResult << ( u16 )(strlen(row[t]) + 1);\r
+ *tDBResult << row[t];\r
+ }\r
+ }\r
+\r
+ // Build result messages\r
+ char tCmd[100];\r
+ memset(tCmd, '\0', 100);\r
+ strncpy(tCmd, nCommandName->c_str(), 100);\r
+\r
+ PMessage* tmpMsg_allowed = MsgBuilder->BuildTryAccessAnswerMsg( nClient, tCmd, true );\r
+ PMessage* tmpMsg_result = MsgBuilder->BuildReceiveDBAnswerMsg( nClient, tDBResult, nCommandName, tNumRows, mResultFields);\r
+\r
+ nClient->SendUDPMessage(tmpMsg_allowed);\r
+ nClient->FragmentAndSendUDPMessage(tmpMsg_result, 0x68);\r
+\r
return true;\r
}\r
-/*
+ /*
TinNS (TinNS is not a Neocron Server)
Copyright (C) 2005 Linux Addicted Community
maintainer Akiko <akiko@gmx.org>
-
+
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 (at your option) 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, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
-*/
-
-
-
-/*
+ */
+
+
+
+ /*
terminal_tryaccess.cpp - Management class for Terminal actions (Citycom, keys, vehicledepot, ...)
> Sub-File for terminal "TryAccess" command
-
+
MODIFIED: 12 Jan 2007 Namikon
REASON: - Created
MODIFIED: 20 Oct 2009 Namikon
REASON: - Rewritten
-
-*/
-
+
+ */
+
#include "main.h"
-#include "terminal.h"
-#include "msgbuilder.h"
-
+#include "include/terminal.h"
+#include "include/msgbuilder.h"
+
bool PTerminal::DoStockXCheck(PClient* nClient, int nAmountEntered, int nNewAmount)
-{
+ {
MYSQL_RES *result = NULL;
char qry[100];
int tDepotAmount = 0;
-
+
// First check if we BUY or SELL stockx
snprintf(qry, 100, "SELECT sxd_amount FROM stockx_depots WHERE sxd_playerid = %d", nClient->GetChar()->GetID());
result = MySQL->GameResQuery(qry);
MySQL->ShowGameSQLError();
return false;
}
-
+
if(mysql_num_rows(result) > 0)
tDepotAmount = atoi(mysql_fetch_row(result)[0]);
-
+
MySQL->FreeGameSQLResult(result);
-
+
if(nNewAmount == tDepotAmount) // We are going to SELL stockx
{
if(nAmountEntered > tDepotAmount) // Want to sell more than we have?
{
return false;
}
-
+
// Everything went fine
return true;
-}
-
+ }
+
bool PTerminal::HandleTryAccess(PClient* nClient, u16 mTerminalSessionId, std::string *nCommandName, std::string *nOptions, u8 nNumOptions, u16 nDBID, u8 nUnknown, bool nCheckOnly)
-{
+ {
// Empty buffer
EraseVars();
-
+
// Stop gcc annoying about unused var
u8 dummy2 = nUnknown;
u16 dummy3 = mTerminalSessionId;
dummy3 = dummy2;
-
+
char mSQLQuery[500];
bool tGetResultFromSQL = false;
- bool tAllowed = false;
- int nAccessLevel = nClient->GetAccountLevel();
+ bool tAllowed = false;
+ int nAccessLevel = nClient->GetAccountLevel();
int tCharID = nClient->GetChar()->GetID();
-
+
switch(nDBID)
- {
+ {
case 13: // Access to Neocronicle as GameMaster
- if(nAccessLevel >= PAL_VOLUNTEER)
- tAllowed = true;
+ if(nAccessLevel >= PAL_VOLUNTEER)
+ tAllowed = true;
break;
-
+
case 63: // Access to Outpost security status; ClanLevel >= 3
if(!ChkOpt(nNumOptions, 1)) break;
tGetResultFromSQL = true;
snprintf(mSQLQuery, 500, "SELECT count(*) FROM clanlevels INNER JOIN clans ON (cll_clanid = cl_id) INNER JOIN outposts ON (o_clan = cl_id) WHERE (o_outnum = %d AND cll_charid = %d AND cll_level >= 3)", atoi(nOptions[0].c_str()), tCharID);
break;
-
+
case 64: // Clan: ClanWars
if(!ChkOpt(nNumOptions, 1)) break;
tGetResultFromSQL = true;
snprintf(mSQLQuery, 500, "SELECT count(*) FROM clanlevels INNER JOIN clans ON (cll_clanid = cl_id) WHERE (cl_id = %d AND cll_charid = %d AND cll_level >= 14)", atoi(nOptions[0].c_str()), tCharID);
break;
-
+
case 72: // Clan: AdminMemberAccess & AdminMoneyAccess
if(!ChkOpt(nNumOptions, 1)) break;
tGetResultFromSQL = true;
snprintf(mSQLQuery, 500, "SELECT count(*) FROM clanlevels INNER JOIN clans ON (cll_clanid = cl_id) WHERE (cl_id = %d AND cll_charid = %d AND cll_level >= 9)", atoi(nOptions[0].c_str()), tCharID);
break;
-
+
case 73: // Clan: AdminInviteMember
if(!ChkOpt(nNumOptions, 1)) break;
tGetResultFromSQL = true;
snprintf(mSQLQuery, 500, "SELECT count(*) FROM clanlevels INNER JOIN clans ON (cll_clanid = cl_id) WHERE (cl_id = %d AND cll_charid = %d AND cll_level >= 10)", atoi(nOptions[0].c_str()), tCharID);
break;
-
+
case 74: // Clan: AdminLevelAccess & AdminChangeRank
if(!ChkOpt(nNumOptions, 1)) break;
tGetResultFromSQL = true;
snprintf(mSQLQuery, 500, "SELECT count(*) FROM clanlevels INNER JOIN clans ON (cll_clanid = cl_id) WHERE (cl_id = %d AND cll_charid = %d AND cll_level >= 12)", atoi(nOptions[0].c_str()), tCharID);
break;
-
+
case 88: // Clan: Money transfer Check if Option1 (Entered value) is lower or equal Option2 (Either my money or clan money)
if(!ChkOpt(nNumOptions, 2)) break;
if((atoi(nOptions[0].c_str()) <= atoi(nOptions[1].c_str())) && (atoi(nOptions[0].c_str()) > 0 )) // This is an not-very-well check, we do the real check later when its about to transfer the money!
- tAllowed = true;
+ tAllowed = true;
break;
case 95: // Clan: Check if given TextString is valid (Opt1 = String)
if(!ChkOpt(nNumOptions, 1)) break;
if(atoi(nOptions[0].c_str()) >= 0 && atoi(nOptions[0].c_str()) <= 15)
- tAllowed = true;
+ tAllowed = true;
break;
case 110: // GMTool Access check. If GM, allowed
if(nAccessLevel > PAL_VOLUNTEER)
- tAllowed = true;
+ tAllowed = true;
break;
case 184: // Clan: Delete (Opt1: ClanID Opt2: CharID Opt3: ClanMemberCount) Allow clandelete only when Leader is the only one left
case 202: // CityCom and Check if given ID is > 0
if(!ChkOpt(nNumOptions, 1)) break;
if(atoi(nOptions[0].c_str()) > 0)
- tAllowed = true;
+ tAllowed = true;
break;
case 208: // Clan: AdminDismissMember & ClanAdminAccess & AdminInviteMember // General ClanAdmin access in CityCom
break;
case 315: // Warp players around, from/to GM kick players
- if(nAccessLevel >= PAL_GM)
- tAllowed = true;
+ if(nAccessLevel >= PAL_GM)
+ tAllowed = true;
break;
case 320:
- if(nAccessLevel >= PAL_GM)
- tAllowed = true;
+ if(nAccessLevel >= PAL_GM)
+ tAllowed = true;
break;
case 330:
- if(nAccessLevel >= PAL_GM)
- tAllowed = true;
+ if(nAccessLevel >= PAL_GM)
+ tAllowed = true;
break;
case 340:
- if(nAccessLevel >= PAL_GM)
- tAllowed = true;
+ if(nAccessLevel >= PAL_GM)
+ tAllowed = true;
break;
case 350: // Delete Clans, StockX
break;
case 622: // TakeMoney from Faction wallet. Check if Player is allowed to do this. For now, only GMs may do this
- if(nAccessLevel >= PAL_GM)
- tAllowed = true;
+ if(nAccessLevel >= PAL_GM)
+ tAllowed = true;
break;
case 624: // Same as 622, Take/Give money from/to Faction wallet. GM only
- if(nAccessLevel >= PAL_GM)
- tAllowed = true;
+ if(nAccessLevel >= PAL_GM)
+ tAllowed = true;
break;
default:
Console->Print("%s [PTerminal::TryAccess] Unknown DBID: %d", Console->ColorText(RED,BLACK,"Error"), nDBID);
return false;
- }
+ }
// ----------------
if(tGetResultFromSQL == true)
- {
+ {
MYSQL_RES *result = NULL;
//MYSQL_ROW row;
int tNumRows = 0;
tAllowed = true;
}
MySQL->FreeGameSQLResult(result);
- }
+ }
// ----------------
if (gDevDebug) Console->Print("[PTerminal::TryAccess] DBID is: [%d] LoopBack: [%s] Allowed: [%d]", nDBID, nCommandName->c_str(), tAllowed);
if(!nCheckOnly)
- {
+ {
char tCmd[100];
memset(tCmd, '\0', 100);
strncpy(tCmd, nCommandName->c_str(), 100);
PMessage* tmpMsg = MsgBuilder->BuildTryAccessAnswerMsg(nClient, tCmd, tAllowed);
nClient->SendUDPMessage(tmpMsg);
- }
-
+ }
+
return tAllowed;
-}
+ }
\r
/*\r
terminal_upcatedb.cpp - Management class for Terminal actions (Citycom, keys, vehicledepot, ...)\r
- > Sub-File for terminal "UpdateDB" command\r
+ Sub-File for terminal "UpdateDB" command\r
\r
MODIFIED: 12 Jan 2007 Namikon\r
REASON: - Created\r
-\r
+ MODIFIED: 09 Jun 2009 Akiko\r
+ REASON: - adjusted includes for new buildsystem\r
*/\r
\r
+\r
#include "main.h"\r
-#include "terminal.h"\r
-#include "msgbuilder.h"\r
+#include "include/terminal.h"\r
+#include "include/msgbuilder.h"\r
\r
\r
bool PTerminal::HandleUpdateDB(PClient* nClient, u16 mTerminalSessionId, std::string *nCommandName, std::string *nOptions, u8 nNumOptions, u16 nDBID, u8 nUnknown)\r
{\r
- ostringstream tLongSQL; // omg my eyes... Stringstream is one of the worst inventions ever! Stick with printf syntax!!111
- char tShortSQL[1024]; // Use this for small updates that will not exceed 1kb
- memset(tShortSQL, '\0', 1024);
- bool tSuccess = false;
-
+ std::ostringstream tLongSQL; // omg my eyes... Stringstream is one of the worst inventions ever! Stick with printf syntax!!111\r
+ char tShortSQL[1024]; // Use this for small updates that will not exceed 1kb\r
+ memset(tShortSQL, '\0', 1024);\r
+ bool tSuccess = false;\r
+\r
//Console->Print("UpdateDB ID: %d", nDBID);\r
switch (nDBID)\r
{\r
case 5:\r
- tLongSQL << "INSERT INTO neochronicle (nc_icon, nc_author, nc_datetime, nc_name, nc_content)";
- tLongSQL << " VALUES (" << atoi(nOptions[0].c_str()) << ", \"" << nOptions[1] << "\", \"" << nOptions[2] << "\", \"" << nOptions[3] << "\", \"" << nOptions[4] << "\")";
+ tLongSQL << "INSERT INTO neochronicle (nc_icon, nc_author, nc_datetime, nc_name, nc_content)";\r
+ tLongSQL << " VALUES (" << atoi(nOptions[0].c_str()) << ", \"" << nOptions[1] << "\", \"" << nOptions[2] << "\", \"" << nOptions[3] << "\", \"" << nOptions[4] << "\")";\r
\r
break;\r
case 6:\r
- // UPDATE when Neocronicle DB is changed! author must be CHAR not INT
+ // UPDATE when Neocronicle DB is changed! author must be CHAR not INT\r
break;\r
case 7: // Delete neocronicle\r
snprintf(tShortSQL, 1024, "DELETE FROM neochronicle WHERE nc_id = %d", atoi(nOptions[0].c_str()));\r
case 58:\r
Console->Print("%s [Pterminal::HandleUpdateDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);\r
break;\r
- case 62: // Set new outpost security
+ case 62: // Set new outpost security\r
snprintf(tShortSQL, 1024, "UPDATE outposts SET o_security = %d WHERE o_outnum = %d AND o_clan = %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));\r
break;\r
-
- case 66: // Claninfo stuff that is somehow never used... Print error if it is
- case 67:
- Console->Print("%s [Pterminal::HandleUpdateDB] QueryID %d should never happen. Please contact Linux Addited forums!", Console->ColorText(RED,BLACK,"Notice"), nDBID);
+\r
+ case 66: // Claninfo stuff that is somehow never used... Print error if it is\r
+ case 67:\r
+ Console->Print("%s [Pterminal::HandleUpdateDB] QueryID %d should never happen. Please contact Linux Addited forums!", Console->ColorText(RED,BLACK,"Notice"), nDBID);\r
break;\r
\r
- case 77: // Delete old clanlevel
+ case 77: // Delete old clanlevel\r
snprintf(tShortSQL, 1024, "DELETE FROM clanlevels WHERE cll_clanid = %d AND cll_level = %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()));\r
break;\r
- case 78: // Add new clanlevel
+ case 78: // Add new clanlevel\r
snprintf(tShortSQL, 1024, "INSERT INTO clanlevels (cll_clanid, cll_desc, cll_level) VALUES (%d, \"%s\", %d)", atoi(nOptions[0].c_str()), nOptions[1].c_str(), atoi(nOptions[2].c_str()));\r
break;\r
case 84: // Take/Give money to/from clan\r
- tLongSQL << "INSERT INTO moneytransactions (mt_clanid, mt_player, mt_amount, mt_date, mt_comment) ";
- tLongSQL << "VALUES (" << atoi(nOptions[0].c_str()) << ", " << atoi(nOptions[1].c_str()) << ", " << atoi(nOptions[2].c_str()) << ", \"" << nOptions[3] << "\", \"" << nOptions[4] << "\")";
+ tLongSQL << "INSERT INTO moneytransactions (mt_clanid, mt_player, mt_amount, mt_date, mt_comment) ";\r
+ tLongSQL << "VALUES (" << atoi(nOptions[0].c_str()) << ", " << atoi(nOptions[1].c_str()) << ", " << atoi(nOptions[2].c_str()) << ", \"" << nOptions[3] << "\", \"" << nOptions[4] << "\")";\r
break;\r
- case 94: // Update runner description
+ case 94: // Update runner description\r
snprintf(tShortSQL, 1024, "UPDATE characters SET c_desc = \"%s\" WHERE c_id = %d", nOptions[0].c_str(), atoi(nOptions[1].c_str()));\r
break;\r
- case 97:
- // Just ignore that... KK required some extra updates here
+ case 97:\r
+ // Just ignore that... KK required some extra updates here\r
tSuccess = true;\r
//Console->Print("%s [Pterminal::HandleUpdateDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);\r
break;\r
- case 120: // Create support call
+ case 120: // Create support call\r
snprintf(tShortSQL, 1024, "INSERT INTO support (su_player, su_worldid, su_type, su_desc) VALUES (%d, %d, %d, \"%s\")", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()), nOptions[3].c_str());\r
break;\r
case 121:\r
case 124:\r
snprintf(tShortSQL, 1024, "DELETE FROM support WHERE su_id = %d", atoi(nOptions[0].c_str()));\r
break;\r
- case 133:
+ case 133:\r
tSuccess = true;\r
//Console->Print("%s [Pterminal::HandleUpdateDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);\r
break;\r
- case 139:
+ case 139:\r
snprintf(tShortSQL, 1024, "UPDATE characters SET c_location = %d WHERE c_id = %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()));\r
break;\r
case 142:\r
case 165: // Missions, not yet\r
Console->Print("%s [Pterminal::HandleUpdateDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);\r
break;\r
- case 170: // Enter new bug
+ case 170: // Enter new bug\r
snprintf(tShortSQL, 1024, "INSERT INTO bug_report (br_type, br_status, br_title, br_desc, br_location, br_fromid, br_datetime) VALUES (%d, %d, \"%s\", \"%s\", %d, %d, NOW())", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), nOptions[2].c_str(), nOptions[3].c_str(), atoi(nOptions[4].c_str()), atoi(nOptions[5].c_str()));\r
break;\r
case 172: // Delete bug id %d\r
- snprintf(tShortSQL, 1024, "DELETE FROM bug_report WHERE br_id = %d", atoi(nOptions[0].c_str()));
- break;
+ snprintf(tShortSQL, 1024, "DELETE FROM bug_report WHERE br_id = %d", atoi(nOptions[0].c_str()));\r
+ break;\r
case 180:\r
Console->Print("%s [Pterminal::HandleUpdateDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);\r
break;\r
case 252:\r
Console->Print("%s [Pterminal::HandleUpdateDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);\r
break;\r
- case 263: // Runner writing to Faction Board
+ case 263: // Runner writing to Faction Board\r
snprintf(tShortSQL, 1024, "INSERT INTO forum_posts (fp_forumid, fp_factionid, fp_replyid, fp_fromid, fp_datetime, fp_name, fp_content) VALUES ((SELECT f_area FROM forums WHERE f_name = \"%s\"), %d, %d, %d, \"%s\", \"%s\", \"%s\")", nOptions[0].c_str(), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()), atoi(nOptions[3].c_str()), nOptions[4].c_str(), nOptions[5].c_str(), nOptions[6].c_str());\r
break;\r
case 268: // Runner writing to ClanBoard\r
case 370: // GM ClanRepair\r
snprintf(tShortSQL, 1024, "INSERT INTO clanlevels (cll_clanid, cll_level, cll_desc) VALUES (%d, %d, \"%s\")", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), nOptions[2].c_str());\r
break;\r
- case 385: // Clandelete 1/7 Clanlevels
+ case 385: // Clandelete 1/7 Clanlevels\r
snprintf(tShortSQL, 1024, "DELETE FROM clanlevels WHERE cl_clanid = %d", atoi(nOptions[0].c_str()));\r
break;\r
- case 386: // Clandelete 2/7 Outposts
+ case 386: // Clandelete 2/7 Outposts\r
snprintf(tShortSQL, 1024, "UPDATE outposts SET o_clan = 0 WHERE o_clan = %d", atoi(nOptions[0].c_str()));\r
break;\r
- case 387: // Clandelete 3/7 Free users from clans
+ case 387: // Clandelete 3/7 Free users from clans\r
snprintf(tShortSQL, 1024, "UPDATE characters SET c_clan = 0 WHERE c_clan = %d", atoi(nOptions[0].c_str()));\r
break;\r
- case 388: // Clandelete 4/7 The clan itself
+ case 388: // Clandelete 4/7 The clan itself\r
snprintf(tShortSQL, 1024, "DELETE FROM clans WHERE cl_id = %d", atoi(nOptions[0].c_str()));\r
break;\r
- case 389: // Clandelete 5/7 ?
+ case 389: // Clandelete 5/7 ?\r
tSuccess = true;\r
break;\r
- case 390: // Clandelete 6/7 Clanappartment
+ case 390: // Clandelete 6/7 Clanappartment\r
snprintf(tShortSQL, 1024, "DELETE FROM apartments WHERE apt_id = %d", atoi(nOptions[0].c_str()));\r
break;\r
- case 391: // Clandelete 7/7 ?
+ case 391: // Clandelete 7/7 ?\r
tSuccess = true;\r
break;\r
- case 402: // GM writing to publicforum
+ case 402: // GM writing to publicforum\r
snprintf(tShortSQL, 1024, "INSERT INTO forum_posts (fp_forumid, fp_replyid, fp_fromid, fp_datetime, fp_name, fp_content) VALUES ((SELECT f_area FROM forums WHERE f_name = \"%s\"), %d, %d, \"%s\", \"%s\", \"%s\")", nOptions[0].c_str(), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()), nOptions[3].c_str(), nOptions[4].c_str(), nOptions[5].c_str());\r
break;\r
- case 404: // GM deleting forum entry step 1
+ case 404: // GM deleting forum entry step 1\r
snprintf(tShortSQL, 1024, "DELETE FROM forum_posts WHERE fp_id = %d", atoi(nOptions[0].c_str()));\r
break;\r
- case 405: // GM deleting forum entry step 2
+ case 405: // GM deleting forum entry step 2\r
snprintf(tShortSQL, 1024, "DELETE FROM forum_posts WHERE fp_replyid = %d", atoi(nOptions[0].c_str()));\r
break;\r
case 412: // GM writing to faction forum\r
case 422: // Mark email as replied\r
snprintf(tShortSQL, 1024, "UPDATE emails SET e_replied = 1 WHERE e_id = %d", atoi(nOptions[0].c_str()));\r
break;\r
- case 423: // Write new email
+ case 423: // Write new email\r
snprintf(tShortSQL, 1024, "INSERT INTO emails (e_fromid,e_toid,e_datetime,e_subject,e_body) VALUES (%d, %d, \"%s\", \"%s\", \"%s\")", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), nOptions[2].c_str(), nOptions[3].c_str(), nOptions[4].c_str());\r
break;\r
case 424: // Delete email\r
case 426: // Mark email as read\r
snprintf(tShortSQL, 1024, "UPDATE emails SET e_new = 0 WHERE e_id = %d", atoi(nOptions[0].c_str()));\r
break;\r
- case 432: // Add new contact
- snprintf(tShortSQL, 1024, "INSERT INTO contacts (c_listid,c_conid,c_type,c_desc) VALUES (%d, %d, %d, \"%s\")", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()), nOptions[3].c_str());
+ case 432: // Add new contact\r
+ snprintf(tShortSQL, 1024, "INSERT INTO contacts (c_listid,c_conid,c_type,c_desc) VALUES (%d, %d, %d, \"%s\")", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()), nOptions[3].c_str());\r
break;\r
- case 433: // Edit contact
- snprintf(tShortSQL, 1024, "UPDATE contacts SET c_type = %d, c_desc = \"%s\" WHERE c_id = %d", atoi(nOptions[0].c_str()), nOptions[1].c_str(), atoi(nOptions[2].c_str()));
+ case 433: // Edit contact\r
+ snprintf(tShortSQL, 1024, "UPDATE contacts SET c_type = %d, c_desc = \"%s\" WHERE c_id = %d", atoi(nOptions[0].c_str()), nOptions[1].c_str(), atoi(nOptions[2].c_str()));\r
break;\r
case 434: // Delete contact\r
snprintf(tShortSQL, 1024, "DELETE FROM contacts WHERE c_id = %d", atoi(nOptions[0].c_str()));\r
break;\r
- case 447:
+ case 447:\r
snprintf(tShortSQL, 1024, "INSERT INTO neochronicle (nc_icon, nc_author, nc_datetime, nc_name, nc_content, nc_lang) VALUES (%d, \"%s\", \"%s\", \"%s\", \"%s\", %d)", atoi(nOptions[0].c_str()), nOptions[1].c_str(), nOptions[2].c_str(), nOptions[3].c_str(), nOptions[4].c_str(), atoi(nOptions[5].c_str()));\r
break;\r
- case 450:
+ case 450:\r
snprintf(tShortSQL, 1024, "INSERT INTO guides (g_chapter, g_part, g_title, g_content, g_language) VALUES (%d, %d, \"%s\", \"%s\", %d)", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), nOptions[2].c_str(), nOptions[3].c_str(), atoi(nOptions[4].c_str()));\r
break;\r
case 515: // Create new clanwar\r
case 516:\r
Console->Print("%s [Pterminal::HandleUpdateDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);\r
break;\r
- case 517:
- // Special: Check if Clan of our char is = nOption2
+ case 517:\r
+ // Special: Check if Clan of our char is = nOption2\r
if(nClient->GetChar()->GetClan() == atoi(nOptions[2].c_str()))\r
- snprintf(tShortSQL, 1024, "UPDATE clanwars SET cw_status = %d WHERE cw_id = %d AND cw_initclan = %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));
- // else: SQL Query is empty = failed as result
+ snprintf(tShortSQL, 1024, "UPDATE clanwars SET cw_status = %d WHERE cw_id = %d AND cw_initclan = %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));\r
+ // else: SQL Query is empty = failed as result\r
break;\r
- case 518:
+ case 518:\r
if(nClient->GetChar()->GetClan() == atoi(nOptions[2].c_str()))\r
- snprintf(tShortSQL, 1024, "UPDATE clanwars SET cw_status = %d WHERE cw_id = %d AND cw_enemyclan = %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));
- // else: SQL Query is empty = failed as result
+ snprintf(tShortSQL, 1024, "UPDATE clanwars SET cw_status = %d WHERE cw_id = %d AND cw_enemyclan = %d", atoi(nOptions[0].c_str()), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));\r
+ // else: SQL Query is empty = failed as result\r
break;\r
case 519:\r
Console->Print("%s [Pterminal::HandleUpdateDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);\r
break;\r
case 525: // Update clan short\r
- tLongSQL << "UPDATE clans SET cl_shortdesc = \"" << nOptions[0] << "\" WHERE cl_id = " << atoi(nOptions[1].c_str()) << " AND cl_leader = " << atoi(nOptions[2].c_str());
-
+ tLongSQL << "UPDATE clans SET cl_shortdesc = \"" << nOptions[0] << "\" WHERE cl_id = " << atoi(nOptions[1].c_str()) << " AND cl_leader = " << atoi(nOptions[2].c_str());\r
+\r
break;\r
case 526: // Update clan name\r
- tLongSQL << "UPDATE clans SET cl_name = \"" << nOptions[0] << "\" WHERE cl_id = " << atoi(nOptions[1].c_str()) << " AND cl_leader = " << atoi(nOptions[2].c_str());
-
+ tLongSQL << "UPDATE clans SET cl_name = \"" << nOptions[0] << "\" WHERE cl_id = " << atoi(nOptions[1].c_str()) << " AND cl_leader = " << atoi(nOptions[2].c_str());\r
+\r
break;\r
- case 527: // Update clanapp password
+ case 527: // Update clanapp password\r
//UPDATE apartments SET apt_password = x WHERE apt_owner = x AND apt_id = (SELECT clans.cl_appid WHERE clans.cl_id = x)\r
tLongSQL << "UPDATE apartments SET apt_password = \"" << nOptions[0] << "\" WHERE apt_owner = " << atoi(nOptions[2].c_str()) << " AND apt_id = (SELECT cl_appid FROM clans WHERE cl_id = " << atoi(nOptions[1].c_str()) << ")";\r
break;\r
- case 528:
+ case 528:\r
tLongSQL << "UPDATE clans SET cl_minsympathy = " << atoi(nOptions[0].c_str()) << " WHERE cl_id = " << atoi(nOptions[1].c_str()) << " AND cl_leader = " << atoi(nOptions[2].c_str());\r
break;\r
- case 529:
- tLongSQL << "UPDATE clans SET cl_description = \"" << nOptions[0] << "\" WHERE cl_id = " << atoi(nOptions[1].c_str()) << " AND cl_leader = " << atoi(nOptions[2].c_str());
+ case 529:\r
+ tLongSQL << "UPDATE clans SET cl_description = \"" << nOptions[0] << "\" WHERE cl_id = " << atoi(nOptions[1].c_str()) << " AND cl_leader = " << atoi(nOptions[2].c_str());\r
break;\r
- case 543:
- // Only delete if: option 2 is >= 7 (days); option0 is 5 or 6; option 4 = our clanid
- if(atoi(nOptions[2].c_str()) >= 7)
- if(atoi(nOptions[0].c_str()) == 5 || atoi(nOptions[0].c_str()) == 6)
- if(nClient->GetChar()->GetClan() == atoi(nOptions[4].c_str()))
- snprintf(tShortSQL, 1024, "DELETE FROM clanwars WHERE (cw_status = 5 OR cw_status = 6) AND cw_id = %d AND cw_initclan = %d", atoi(nOptions[3].c_str()), atoi(nOptions[4].c_str()));
+ case 543:\r
+ // Only delete if: option 2 is >= 7 (days); option0 is 5 or 6; option 4 = our clanid\r
+ if(atoi(nOptions[2].c_str()) >= 7)\r
+ if(atoi(nOptions[0].c_str()) == 5 || atoi(nOptions[0].c_str()) == 6)\r
+ if(nClient->GetChar()->GetClan() == atoi(nOptions[4].c_str()))\r
+ snprintf(tShortSQL, 1024, "DELETE FROM clanwars WHERE (cw_status = 5 OR cw_status = 6) AND cw_id = %d AND cw_initclan = %d", atoi(nOptions[3].c_str()), atoi(nOptions[4].c_str()));\r
\r
- //Console->Print("%s", tShortSQL);
+ //Console->Print("%s", tShortSQL);\r
break;\r
- case 548:
- // Check clanmembership
- if(nClient->GetChar()->GetClan() == atoi(nOptions[2].c_str()))
+ case 548:\r
+ // Check clanmembership\r
+ if(nClient->GetChar()->GetClan() == atoi(nOptions[2].c_str()))\r
snprintf(tShortSQL, 1024, "UPDATE clanwars SET cw_statement_initiator = \"%s\" WHERE cw_id = %d AND cw_initclan = %d", nOptions[0].c_str(), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));\r
break;\r
- case 549:
- // Check clanmembership
+ case 549:\r
+ // Check clanmembership\r
if(nClient->GetChar()->GetClan() == atoi(nOptions[2].c_str()))\r
- snprintf(tShortSQL, 1024, "UPDATE clanwars SET cw_statement_enemy = \"%s\" WHERE cw_id = %d AND cw_enemyclan = %d", nOptions[0].c_str(), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));
- break;
+ snprintf(tShortSQL, 1024, "UPDATE clanwars SET cw_statement_enemy = \"%s\" WHERE cw_id = %d AND cw_enemyclan = %d", nOptions[0].c_str(), atoi(nOptions[1].c_str()), atoi(nOptions[2].c_str()));\r
+ break;\r
case 555:\r
Console->Print("%s [Pterminal::HandleUpdateDB] Nothing to do; Function not written yet for QueryID %d", Console->ColorText(YELLOW,BLACK,"Notice"), nDBID);\r
break;\r
Console->Print("%s [Pterminal::HandleUpdateDB] Unknown QueryID %d", Console->ColorText(RED,BLACK,"Warning"), nDBID);\r
return false;\r
}\r
-
-// -------
- if(tLongSQL.str().length() > 0)
- {
- if(MySQL->GameQuery(tLongSQL.str().c_str()))
- {
- Console->Print("Cannot update DB. query was: %s", tLongSQL.str().c_str());
- MySQL->ShowGameSQLError();
- tSuccess = false;
- }
- else
- tSuccess = true;
- }
- else if(strlen(tShortSQL) > 0)
- {
- if(MySQL->GameQuery(tShortSQL))
- {
- Console->Print("Cannot update DB. query was: %s", tShortSQL);
- MySQL->ShowGameSQLError();
- tSuccess = false;
- }
- else
- tSuccess = true;
- }
-
- // Notice client about UpdateDB result
- char tCmd[100];
- memset(tCmd, '\0', 100);
- strncpy(tCmd, nCommandName->c_str(), 100);
-
- PMessage* tmpMsg = MsgBuilder->BuildTryAccessAnswerMsg(nClient, tCmd, tSuccess);
- nClient->SendUDPMessage(tmpMsg);
+\r
+// -------\r
+ if(tLongSQL.str().length() > 0)\r
+ {\r
+ if(MySQL->GameQuery(tLongSQL.str().c_str()))\r
+ {\r
+ Console->Print("Cannot update DB. query was: %s", tLongSQL.str().c_str());\r
+ MySQL->ShowGameSQLError();\r
+ tSuccess = false;\r
+ }\r
+ else\r
+ tSuccess = true;\r
+ }\r
+ else if(strlen(tShortSQL) > 0)\r
+ {\r
+ if(MySQL->GameQuery(tShortSQL))\r
+ {\r
+ Console->Print("Cannot update DB. query was: %s", tShortSQL);\r
+ MySQL->ShowGameSQLError();\r
+ tSuccess = false;\r
+ }\r
+ else\r
+ tSuccess = true;\r
+ }\r
+\r
+ // Notice client about UpdateDB result\r
+ char tCmd[100];\r
+ memset(tCmd, '\0', 100);\r
+ strncpy(tCmd, nCommandName->c_str(), 100);\r
+\r
+ PMessage* tmpMsg = MsgBuilder->BuildTryAccessAnswerMsg(nClient, tCmd, tSuccess);\r
+ nClient->SendUDPMessage(tmpMsg);\r
return true;\r
}\r
/*\r
- TinNS (TinNS is not a Neocron Server)\r
- Copyright (C) 2005 Linux Addicted Community\r
- maintainer Akiko <akiko@gmx.org>\r
-\r
- This program is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU General Public License\r
- as published by the Free Software Foundation; either version 2\r
- of the License, or (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
- 02110-1301, USA.\r
+ TinNS (TinNS is not a Neocron Server)\r
+ Copyright (C) 2005 Linux Addicted Community\r
+ maintainer Akiko <akiko@gmx.org>\r
+\r
+ This program is free software; you can redistribute it and/or\r
+ modify it under the terms of the GNU General Public License\r
+ as published by the Free Software Foundation; either version 2\r
+ of the License, or (at your option) any later version.\r
+\r
+ This program is distributed in the hope that it will be useful,\r
+ but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ GNU General Public License for more details.\r
+\r
+ You should have received a copy of the GNU General Public License\r
+ along with this program; if not, write to the Free Software\r
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
+ 02110-1301, USA.\r
*/\r
\r
\r
\r
/*\r
- vehicle.cpp - Vehicle handling\r
+ vehicle.cpp - Vehicle handling\r
\r
- Authors:\r
- - Namikon\r
+ Authors:\r
+ - Namikon\r
+ - Akiko\r
\r
- MODIFIED: 08 Jan 2006 Namikon\r
- REASON: - initial release by Namikon\r
+ MODIFIED: 08 Jan 2006 Namikon\r
+ REASON: - initial release by Namikon\r
+ MODIFIED: 09 Jun 2009 Akiko\r
+ REASON: - adjusted includes for new buildsystem\r
*/\r
\r
+\r
#include "main.h"\r
-#include "vehicle.h"\r
-#include "worlds.h"\r
+\r
+#include "include/vehicle.h"\r
+#include "include/worlds.h"\r
+\r
\r
// PVhcCoordinates\r
void PVhcCoordinates::SetInterpolate( const PVhcCoordinates& Pos1, const PVhcCoordinates& Pos2, f32 nCoef )\r
}\r
if ( mNextFreeHint == nSize )\r
{\r
- mSpawnedVehicles.push_back( NULL );\r
+ mSpawnedVehicles.push_back( static_cast<PSpawnedVehicle *>(NULL) );\r
}\r
\r
if ( mNextFreeHint < mMaxLocalVhc )\r
/*
- TinNS (TinNS is not a Neocron Server)
- Copyright (C) 2005 Linux Addicted Community
-
- 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 (at your option) 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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
+ TinNS (TinNS is not a Neocron Server)
+ Copyright (C) 2005 Linux Addicted Community
+
+ 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 (at your option) 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, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
*/
-/*
- vhcaccessrequest.cpp - classe for pendinf vhc access requests
- CREATION: 14 Apr 2009 Hammag
+/*
+ vhcaccessrequest.cpp - classe for pendinf vhc access requests
+
+ Authors:
+ - Hammag
+ - Akiko
+ CREATION: 14 Apr 2009 Hammag
+ MODIFIED: 09 Jun 2009 Akiko
+ REASON: - adjusted includes for new buildsystem
*/
+
#include "main.h"
-#include "vhcaccessrequest.h"
+
+#include "include/vhcaccessrequest.h"
+
PVhcAccessRequest::PVhcAccessRequest()
{
/*
- TinNS (TinNS is not a Neocron Server)
- Copyright (C) 2005 Linux Addicted Community
- maintainer Akiko <akiko@gmx.org>
-
- 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 (at your option) 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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
+ TinNS (TinNS is not a Neocron Server)
+ Copyright (C) 2005 Linux Addicted Community
+ maintainer Akiko <akiko@gmx.org>
+
+ 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 (at your option) 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, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
*/
/*
+ worldactors.cpp - Management class for dynamic worldactors
- worldactors.cpp - Management class for dynamic worldactors
-
- CREATION: 02 Jan 2007 Namikon
-
- MODIFIED:
- REASON: -
+ Authors:
+ - Namikon
+ - Akiko
+ CREATION: 02 Jan 2007 Namikon
+ MODIFIED: 09 Jun 2009 Akiko
+ REASON: - adjusted includes for new buildsystem
*/
+
#include "main.h"
-#include "worldactors.h"
-#include "worlds.h"
-#include "msgbuilder.h"
+
+#include "include/worldactors.h"
+#include "include/worlds.h"
+#include "include/msgbuilder.h"
+
PWorldActors::PWorldActors()
{
-/*
- TinNS (TinNS is not a Neocron Server)
- Copyright (C) 2005 Linux Addicted Community
-
- 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 (at your option) 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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
-*/
-
-
-/*
- worlddatatemplate.cpp - world data template (from worlds .dat files) class
-
- MODIFIED: 04 Oct 2006 Hammag
- REASON: - creation
-
- MODIFIED: 21 Jun 2009 Namikon
- REASON: - Added NPC Template stuff
-
-*/
-
-
-#include "main.h"
-
-#include "worlddatatemplate.h"
-#include "world_datparser.h"
-#include "furnituretemplate.h"
-#include "doortemplate.h"
-#include "npctemplate.h"
-
-PWorldDataTemplate::PWorldDataTemplate()
-{
- mUseCount = 0;
- for ( int i = 0; i < WORLDDATATEMPLATE_MAXPOSITEMS; ++i )
- {
- mPositionItems[i] = NULL;
- }
-}
-
-PWorldDataTemplate::~PWorldDataTemplate()
-{
- DatFileDataCleanup();
-}
-
-void PWorldDataTemplate::DatFileDataCleanup()
-{
- for ( PFurnitureItemsMap::iterator i = mFurnitureItems.begin(); i != mFurnitureItems.end(); i++ )
- delete i->second;
- for ( PDoorsMap::iterator i = mDoors.begin(); i != mDoors.end(); i++ )
- delete i->second;
- for ( PNPCsMap::iterator i = mNPCs.begin(); i != mNPCs.end(); i++ )
- delete i->second;
-}
-
-bool PWorldDataTemplate::LoadDatFile( const std::string& WorldTemplateName, const std::string& nFilename, const bool nTestAccesOnly )
-{
- PWorldDatParser WDatLoader;
- int LoadResult;
-
- DatFileDataCleanup();
- if ( gDevDebug ) Console->Print( "%s Loading %s", Console->ColorText( CYAN, BLACK, "[DEBUG]" ), nFilename.c_str() );
- LoadResult = WDatLoader.LoadDatFile( nFilename, this, true, nTestAccesOnly ) ; // We want to discard passive objects for now
- switch ( LoadResult )
- {
- case 0:
- {
- mName = nFilename;
- mBspName = WorldTemplateName;
- if ( !nTestAccesOnly )
- {
- SetLinkedObjects(); // temp until better solution found from .dat & .bsp files
- }
- return true;
- }
-
- case -1:
- {
- if ( !nTestAccesOnly )
- Console->Print( "%s Can't read file %s", Console->ColorText( RED, BLACK, "[ERROR]" ), nFilename.c_str() );
- break;
- }
-
- case - 2:
- {
- Console->Print( "%s Bad data", Console->ColorText( RED, BLACK, "[ERROR]" ) );
- break;
- }
-
- case - 3:
- {
- Console->Print( "%s Unexpected end of file", Console->ColorText( RED, BLACK, "[ERROR]" ) );
- break;
- }
-
- default:
- Console->Print( "%s Unknown error %d", Console->ColorText( RED, BLACK, "[ERROR]" ), LoadResult );
- }
- return false;
-}
-
-u32 PWorldDataTemplate::AddFurnitureItem( PFurnitureItemTemplate* nItem )
-{
- if ( nItem )
- {
- if ( mFurnitureItems.insert( std::make_pair( nItem->GetID(), nItem ) ).second )
- {
- if ( gDevDebug ) Console->Print( "%s Furniture item %d added to world template", Console->ColorText( CYAN, BLACK, "[DEBUG]" ), nItem->GetID() );
-
- if ( nItem->GetFunctionType() == 21 )
- {
- int v = nItem->GetFunctionValue();
- if (( v >= 0 ) && ( v < WORLDDATATEMPLATE_MAXPOSITEMS ) )
- {
- if ( mPositionItems[v] )
- {
- if (( v == WORLDDATATEMPLATE_MAXPOSITEMS - 2 ) && !mPositionItems[v+1] ) // We allow that only for Pos 9 in order not to mess with other pos
- {
- Console->Print( "%s Same position %d for two position items ID %d and %d. Last one will be put on next position.", Console->ColorText( YELLOW, BLACK, "[NOTICE]" ), v, mPositionItems[v]->GetID(), nItem->GetID() );
- ++v;
- }
- else
- {
- Console->Print( "%s Same position %d for two position items ID %d and %d. Only last one kept.", Console->ColorText( YELLOW, BLACK, "[NOTICE]" ), v, mPositionItems[v]->GetID(), nItem->GetID() );
- }
- }
-
- mPositionItems[v] = nItem;
- /*
- Console->Print("Position entity %d (id 0x%x) added to world template", v, nItem->GetID());
- f32 fpX, fpY, fpZ;
- u16 pX, pY, pZ;
- nItem->GetPos(&fpX, &fpY, &fpZ);
- pX = (u16) (fpX + 32000);
- pY = (u16) (fpY + 32000);
- pZ = (u16) (fpZ + 32000);
- Console->Print("Position Y=%f (0x%04x) Z=%f (0x%04x) X=%f (0x%04x)", fpY, pY, fpZ, pZ, fpX, pX);
- */
- }
- else
- {
- Console->Print( "%s Invalid position %d for position item ID %d. Position ignored.", Console->ColorText( YELLOW, BLACK, "[NOTICE]" ), v, nItem->GetID() );
- }
- }
- return nItem->GetID();
- }
- else
- {
- Console->Print( "%s Duplicate furniture item ID %d !!! Not added to world template", Console->ColorText( YELLOW, BLACK, "[NOTICE]" ), nItem->GetID() );
- }
- }
- return 0;
-}
-
-const PFurnitureItemTemplate* PWorldDataTemplate::GetFurnitureItem( u32 ItemID )
-{
- PFurnitureItemsMap::const_iterator it = mFurnitureItems.find( ItemID );
- if ( it == mFurnitureItems.end() )
- return NULL;
- else
- return it->second;
-}
-
-bool PWorldDataTemplate::getPositionItemPosition( u8 PosID, f32* pX, f32* pY, f32* pZ )
-{
- if (( PosID < WORLDDATATEMPLATE_MAXPOSITEMS ) && mPositionItems[PosID] )
- {
- mPositionItems[PosID]->GetPos( pX, pY, pZ ) ;
- return true;
- }
- return false;
-}
-
-u32 PWorldDataTemplate::AddDoor( PDoorTemplate* nDoor )
-{
- if ( nDoor )
- {
- if ( mDoors.insert( std::make_pair( nDoor->GetID(), nDoor ) ).second )
- {
- if ( gDevDebug ) Console->Print( "%s Door %d added to world template", Console->ColorText( CYAN, BLACK, "[DEBUG]" ), nDoor->GetID() );
- return nDoor->GetID();
- }
- else
- {
- Console->Print( "%s Duplicate Door ID %d !!! Not added to world template", Console->ColorText( YELLOW, BLACK, "[NOTICE]" ), nDoor->GetID() );
- }
- }
- return 0;
-}
-
-const PDoorTemplate* PWorldDataTemplate::GetDoor( u32 DoorID )
-{
- PDoorsMap::const_iterator it = mDoors.find( DoorID );
- if ( it == mDoors.end() )
- return NULL;
- else
- return it->second;
-}
-
-
-u32 PWorldDataTemplate::AddNPC( PNPCTemplate* nNPC )
-{
- if ( nNPC )
- {
- if ( mNPCs.insert( std::make_pair( nNPC->GetNpcID(), nNPC ) ).second )
- {
- if ( gDevDebug ) Console->Print( "%s NPC %d added to world template", Console->ColorText( CYAN, BLACK, "[DEBUG]" ), nNPC->GetNpcID() );
- return nNPC->GetNpcID();
- }
- else
- {
- Console->Print( "%s Duplicate NPC ID %d !!! Not added to world template", Console->ColorText( YELLOW, BLACK, "[NOTICE]" ), nNPC->GetNpcID() );
- }
- }
- return 0;
-}
-
-const PNPCTemplate* PWorldDataTemplate::GetNPC( u32 NPCID )
-{
- PNPCsMap::const_iterator it = mNPCs.find( NPCID );
- if ( it == mNPCs.end() )
- return NULL;
- else
- return it->second;
-}
-
-void PWorldDataTemplate::SetLinkedObjects()
-{
- f32 xI, yI, zI;
- f32 xD, yD, zD;
- f32 D2, minD2;
- u32 minObjID;
- u16 fnctType;
- u16 tGROrder = 0;
-
- for ( PFurnitureItemsMap::iterator it = mFurnitureItems.begin(); it != mFurnitureItems.end(); it++ )
- {
- fnctType = it->second->GetFunctionType();
- if (( fnctType == 11 ) || ( fnctType == 12 ) || ( fnctType == 13 ) || ( fnctType == 23 ) ) // if function is apt entry button, door access if, hack button or money button
- {
- it->second->GetPos( &xI, &yI, &zI );
-//Console->Print("Button pos: %0.0f %0.0f %0.0f", xI, yI, zI);
- minD2 = 1e9;
- minObjID = 0;
- for ( PDoorsMap::iterator dit = mDoors.begin(); dit != mDoors.end(); dit++ )
- {
-//Console->Print("%s Found door %d (%s) : %s triggered, %s", Console->ColorText(GREEN, BLACK, "[Debug]"), dit->first, dit->second->GetName().c_str(), (dit->second->IsTriggeredDoor()?"":"not"), (dit->second->IsDoubleDoor()?"double":"single") );
- if ( dit->second->IsTriggeredDoor() )
- {
- dit->second->GetPos( &xD, &yD, &zD );
-//Console->Print("Door pos: %0.0f %0.0f %0.0f", xD, yD, zD);
- D2 = ( xI - xD ) * ( xI - xD ) + ( yI - yD ) * ( yI - yD ) + ( zI - zD ) * ( zI - zD );
-//Console->Print("Dist D2:%0.0f minD2:%0.0f", D2, minD2);
- if ( D2 < minD2 )
- {
- minD2 = D2;
- minObjID = 1 + dit->first;
- }
- }
- }
- if ( minObjID-- )
- {
- it->second->SetLinkedObjectID( minObjID );
- if ( gDevDebug ) Console->Print( "%s Found triggered door %d (%s) for button %d (%s)", Console->ColorText( GREEN, BLACK, "[Debug]" ), minObjID, GetDoor( minObjID )->GetName().c_str(), it->first, it->second->GetName().c_str() );
-
- }
- else
- {
- Console->Print( "%s No triggered door found for button %d (%s) in World data template %s", Console->ColorText( YELLOW, BLACK, "[NOTICE]" ), it->first, it->second->GetName().c_str(), this->GetName().c_str() );
- }
- }
- else if ( fnctType == 6 ) // if function is genrep
- {
- it->second->SetLinkedObjectID( ++tGROrder );
- }
- }
-
-}
+/*\r
+ TinNS (TinNS is not a Neocron Server)\r
+ Copyright (C) 2005 Linux Addicted Community\r
+\r
+ This program is free software; you can redistribute it and/or\r
+ modify it under the terms of the GNU General Public License\r
+ as published by the Free Software Foundation; either version 2\r
+ of the License, or (at your option) any later version.\r
+\r
+ This program is distributed in the hope that it will be useful,\r
+ but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ GNU General Public License for more details.\r
+\r
+ You should have received a copy of the GNU General Public License\r
+ along with this program; if not, write to the Free Software\r
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
+ 02110-1301, USA.\r
+*/\r
+\r
+\r
+/*\r
+ worlddatatemplate.cpp - world data template (from worlds .dat files) class\r
+\r
+ MODIFIED: 04 Oct 2006 Hammag\r
+ REASON: - creation\r
+\r
+ MODIFIED: 21 Jun 2009 Namikon\r
+ REASON: - Added NPC Template stuff\r
+\r
+*/\r
+\r
+\r
+#include "main.h"\r
+\r
+#include "include/worlddatatemplate.h"\r
+#include "include/world_datparser.h"\r
+#include "include/furnituretemplate.h"\r
+#include "include/doortemplate.h"\r
+#include "include/npctemplate.h"\r
+\r
+PWorldDataTemplate::PWorldDataTemplate()\r
+{\r
+ mUseCount = 0;\r
+ for ( int i = 0; i < WORLDDATATEMPLATE_MAXPOSITEMS; ++i )\r
+ {\r
+ mPositionItems[i] = NULL;\r
+ }\r
+}\r
+\r
+PWorldDataTemplate::~PWorldDataTemplate()\r
+{\r
+ DatFileDataCleanup();\r
+}\r
+\r
+void PWorldDataTemplate::DatFileDataCleanup()\r
+{\r
+ for ( PFurnitureItemsMap::iterator i = mFurnitureItems.begin(); i != mFurnitureItems.end(); i++ )\r
+ delete i->second;\r
+ for ( PDoorsMap::iterator i = mDoors.begin(); i != mDoors.end(); i++ )\r
+ delete i->second;\r
+ for ( PNPCsMap::iterator i = mNPCs.begin(); i != mNPCs.end(); i++ )\r
+ delete i->second;\r
+}\r
+\r
+bool PWorldDataTemplate::LoadDatFile( const std::string& WorldTemplateName, const std::string& nFilename, const bool nTestAccesOnly )\r
+{\r
+ PWorldDatParser WDatLoader;\r
+ int LoadResult;\r
+\r
+ DatFileDataCleanup();\r
+ if ( gDevDebug ) Console->Print( "%s Loading %s", Console->ColorText( CYAN, BLACK, "[DEBUG]" ), nFilename.c_str() );\r
+ LoadResult = WDatLoader.LoadDatFile( nFilename, this, true, nTestAccesOnly ) ; // We want to discard passive objects for now\r
+ switch ( LoadResult )\r
+ {\r
+ case 0:\r
+ {\r
+ mName = nFilename;\r
+ mBspName = WorldTemplateName;\r
+ if ( !nTestAccesOnly )\r
+ {\r
+ SetLinkedObjects(); // temp until better solution found from .dat & .bsp files\r
+ }\r
+ return true;\r
+ }\r
+\r
+ case -1:\r
+ {\r
+ if ( !nTestAccesOnly )\r
+ Console->Print( "%s Can't read file %s", Console->ColorText( RED, BLACK, "[ERROR]" ), nFilename.c_str() );\r
+ break;\r
+ }\r
+\r
+ case - 2:\r
+ {\r
+ Console->Print( "%s Bad data", Console->ColorText( RED, BLACK, "[ERROR]" ) );\r
+ break;\r
+ }\r
+\r
+ case - 3:\r
+ {\r
+ Console->Print( "%s Unexpected end of file", Console->ColorText( RED, BLACK, "[ERROR]" ) );\r
+ break;\r
+ }\r
+\r
+ default:\r
+ Console->Print( "%s Unknown error %d", Console->ColorText( RED, BLACK, "[ERROR]" ), LoadResult );\r
+ }\r
+ return false;\r
+}\r
+\r
+u32 PWorldDataTemplate::AddFurnitureItem( PFurnitureItemTemplate* nItem )\r
+{\r
+ if ( nItem )\r
+ {\r
+ if ( mFurnitureItems.insert( std::make_pair( nItem->GetID(), nItem ) ).second )\r
+ {\r
+ if ( gDevDebug ) Console->Print( "%s Furniture item %d added to world template", Console->ColorText( CYAN, BLACK, "[DEBUG]" ), nItem->GetID() );\r
+\r
+ if ( nItem->GetFunctionType() == 21 )\r
+ {\r
+ int v = nItem->GetFunctionValue();\r
+ if (( v >= 0 ) && ( v < WORLDDATATEMPLATE_MAXPOSITEMS ) )\r
+ {\r
+ if ( mPositionItems[v] )\r
+ {\r
+ if (( v == WORLDDATATEMPLATE_MAXPOSITEMS - 2 ) && !mPositionItems[v+1] ) // We allow that only for Pos 9 in order not to mess with other pos\r
+ {\r
+ Console->Print( "%s Same position %d for two position items ID %d and %d. Last one will be put on next position.", Console->ColorText( YELLOW, BLACK, "[NOTICE]" ), v, mPositionItems[v]->GetID(), nItem->GetID() );\r
+ ++v;\r
+ }\r
+ else\r
+ {\r
+ Console->Print( "%s Same position %d for two position items ID %d and %d. Only last one kept.", Console->ColorText( YELLOW, BLACK, "[NOTICE]" ), v, mPositionItems[v]->GetID(), nItem->GetID() );\r
+ }\r
+ }\r
+\r
+ mPositionItems[v] = nItem;\r
+ /*\r
+ Console->Print("Position entity %d (id 0x%x) added to world template", v, nItem->GetID());\r
+ f32 fpX, fpY, fpZ;\r
+ u16 pX, pY, pZ;\r
+ nItem->GetPos(&fpX, &fpY, &fpZ);\r
+ pX = (u16) (fpX + 32000);\r
+ pY = (u16) (fpY + 32000);\r
+ pZ = (u16) (fpZ + 32000);\r
+ Console->Print("Position Y=%f (0x%04x) Z=%f (0x%04x) X=%f (0x%04x)", fpY, pY, fpZ, pZ, fpX, pX);\r
+ */\r
+ }\r
+ else\r
+ {\r
+ Console->Print( "%s Invalid position %d for position item ID %d. Position ignored.", Console->ColorText( YELLOW, BLACK, "[NOTICE]" ), v, nItem->GetID() );\r
+ }\r
+ }\r
+ return nItem->GetID();\r
+ }\r
+ else\r
+ {\r
+ Console->Print( "%s Duplicate furniture item ID %d !!! Not added to world template", Console->ColorText( YELLOW, BLACK, "[NOTICE]" ), nItem->GetID() );\r
+ }\r
+ }\r
+ return 0;\r
+}\r
+\r
+const PFurnitureItemTemplate* PWorldDataTemplate::GetFurnitureItem( u32 ItemID )\r
+{\r
+ PFurnitureItemsMap::const_iterator it = mFurnitureItems.find( ItemID );\r
+ if ( it == mFurnitureItems.end() )\r
+ return NULL;\r
+ else\r
+ return it->second;\r
+}\r
+\r
+bool PWorldDataTemplate::getPositionItemPosition( u8 PosID, f32* pX, f32* pY, f32* pZ )\r
+{\r
+ if (( PosID < WORLDDATATEMPLATE_MAXPOSITEMS ) && mPositionItems[PosID] )\r
+ {\r
+ mPositionItems[PosID]->GetPos( pX, pY, pZ ) ;\r
+ return true;\r
+ }\r
+ return false;\r
+}\r
+\r
+u32 PWorldDataTemplate::AddDoor( PDoorTemplate* nDoor )\r
+{\r
+ if ( nDoor )\r
+ {\r
+ if ( mDoors.insert( std::make_pair( nDoor->GetID(), nDoor ) ).second )\r
+ {\r
+ if ( gDevDebug ) Console->Print( "%s Door %d added to world template", Console->ColorText( CYAN, BLACK, "[DEBUG]" ), nDoor->GetID() );\r
+ return nDoor->GetID();\r
+ }\r
+ else\r
+ {\r
+ Console->Print( "%s Duplicate Door ID %d !!! Not added to world template", Console->ColorText( YELLOW, BLACK, "[NOTICE]" ), nDoor->GetID() );\r
+ }\r
+ }\r
+ return 0;\r
+}\r
+\r
+const PDoorTemplate* PWorldDataTemplate::GetDoor( u32 DoorID )\r
+{\r
+ PDoorsMap::const_iterator it = mDoors.find( DoorID );\r
+ if ( it == mDoors.end() )\r
+ return NULL;\r
+ else\r
+ return it->second;\r
+}\r
+\r
+\r
+u32 PWorldDataTemplate::AddNPC( PNPCTemplate* nNPC )\r
+{\r
+ if ( nNPC )\r
+ {\r
+ if ( mNPCs.insert( std::make_pair( nNPC->GetNpcID(), nNPC ) ).second )\r
+ {\r
+ if ( gDevDebug ) Console->Print( "%s NPC %d added to world template", Console->ColorText( CYAN, BLACK, "[DEBUG]" ), nNPC->GetNpcID() );\r
+ return nNPC->GetNpcID();\r
+ }\r
+ else\r
+ {\r
+ Console->Print( "%s Duplicate NPC ID %d !!! Not added to world template", Console->ColorText( YELLOW, BLACK, "[NOTICE]" ), nNPC->GetNpcID() );\r
+ }\r
+ }\r
+ return 0;\r
+}\r
+\r
+const PNPCTemplate* PWorldDataTemplate::GetNPC( u32 NPCID )\r
+{\r
+ PNPCsMap::const_iterator it = mNPCs.find( NPCID );\r
+ if ( it == mNPCs.end() )\r
+ return NULL;\r
+ else\r
+ return it->second;\r
+}\r
+\r
+void PWorldDataTemplate::SetLinkedObjects()\r
+{\r
+ f32 xI, yI, zI;\r
+ f32 xD, yD, zD;\r
+ f32 D2, minD2;\r
+ u32 minObjID;\r
+ u16 fnctType;\r
+ u16 tGROrder = 0;\r
+\r
+ for ( PFurnitureItemsMap::iterator it = mFurnitureItems.begin(); it != mFurnitureItems.end(); it++ )\r
+ {\r
+ fnctType = it->second->GetFunctionType();\r
+ if (( fnctType == 11 ) || ( fnctType == 12 ) || ( fnctType == 13 ) || ( fnctType == 23 ) ) // if function is apt entry button, door access if, hack button or money button\r
+ {\r
+ it->second->GetPos( &xI, &yI, &zI );\r
+//Console->Print("Button pos: %0.0f %0.0f %0.0f", xI, yI, zI);\r
+ minD2 = 1e9;\r
+ minObjID = 0;\r
+ for ( PDoorsMap::iterator dit = mDoors.begin(); dit != mDoors.end(); dit++ )\r
+ {\r
+//Console->Print("%s Found door %d (%s) : %s triggered, %s", Console->ColorText(GREEN, BLACK, "[Debug]"), dit->first, dit->second->GetName().c_str(), (dit->second->IsTriggeredDoor()?"":"not"), (dit->second->IsDoubleDoor()?"double":"single") );\r
+ if ( dit->second->IsTriggeredDoor() )\r
+ {\r
+ dit->second->GetPos( &xD, &yD, &zD );\r
+//Console->Print("Door pos: %0.0f %0.0f %0.0f", xD, yD, zD);\r
+ D2 = ( xI - xD ) * ( xI - xD ) + ( yI - yD ) * ( yI - yD ) + ( zI - zD ) * ( zI - zD );\r
+//Console->Print("Dist D2:%0.0f minD2:%0.0f", D2, minD2);\r
+ if ( D2 < minD2 )\r
+ {\r
+ minD2 = D2;\r
+ minObjID = 1 + dit->first;\r
+ }\r
+ }\r
+ }\r
+ if ( minObjID-- )\r
+ {\r
+ it->second->SetLinkedObjectID( minObjID );\r
+ if ( gDevDebug ) Console->Print( "%s Found triggered door %d (%s) for button %d (%s)", Console->ColorText( GREEN, BLACK, "[Debug]" ), minObjID, GetDoor( minObjID )->GetName().c_str(), it->first, it->second->GetName().c_str() );\r
+\r
+ }\r
+ else\r
+ {\r
+ Console->Print( "%s No triggered door found for button %d (%s) in World data template %s", Console->ColorText( YELLOW, BLACK, "[NOTICE]" ), it->first, it->second->GetName().c_str(), this->GetName().c_str() );\r
+ }\r
+ }\r
+ else if ( fnctType == 6 ) // if function is genrep\r
+ {\r
+ it->second->SetLinkedObjectID( ++tGROrder );\r
+ }\r
+ }\r
+\r
+}\r
/*\r
- TinNS (TinNS is not a Neocron Server)\r
- Copyright (C) 2005 Linux Addicted Community\r
-\r
- This program is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU General Public License\r
- as published by the Free Software Foundation; either version 2\r
- of the License, or (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
- 02110-1301, USA.\r
+ TinNS (TinNS is not a Neocron Server)\r
+ Copyright (C) 2005 Linux Addicted Community\r
+\r
+ This program is free software; you can redistribute it and/or\r
+ modify it under the terms of the GNU General Public License\r
+ as published by the Free Software Foundation; either version 2\r
+ of the License, or (at your option) any later version.\r
+\r
+ This program is distributed in the hope that it will be useful,\r
+ but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ GNU General Public License for more details.\r
+\r
+ You should have received a copy of the GNU General Public License\r
+ along with this program; if not, write to the Free Software\r
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
+ 02110-1301, USA.\r
*/\r
\r
\r
-/*\r
- worlds.cpp - world class and world map class\r
\r
- MODIFIED: 06 Oct 2006 Hammag\r
- REASON: - creation\r
+/*\r
+ worlds.cpp - world class and world map class\r
\r
+ MODIFIED: 06 Oct 2006 Hammag\r
+ REASON: - creation\r
+ MODIFIED: 09 Jun 2009 Akiko\r
+ REASON: - adjusted includes for new buildsystem\r
*/\r
\r
\r
#include "main.h"\r
\r
-#include "filesystem.h"\r
-#include "def_worlds.h"\r
-#include "gamedefs.h"\r
-#include "furnituretemplate.h"\r
-#include "worlddatatemplate.h"\r
-#include "worlds.h"\r
-#include "appartements.h"\r
-#include "vehicle.h"\r
-\r
+#include "common/filesystem.h"\r
+#include "include/def_worlds.h"\r
+#include "include/gamedefs.h"\r
+#include "include/furnituretemplate.h"\r
+#include "include/worlddatatemplate.h"\r
+#include "include/worlds.h"\r
+#include "include/appartements.h"\r
+#include "include/vehicle.h"\r
\r
#include <set>\r
\r
+\r
/**** PWorld ****/\r
u16 const PWorld::mZoneOutLimitOffset = 0x100;\r
u16 const PWorld::mBottomZoneOutLimit = 0x4800 - PWorld::mZoneOutLimitOffset;\r
\r
Authors:\r
- initial release by unknown person\r
- - Sting <>\r
+ - Sting\r
- Akiko <akiko@gmx.org>\r
- Namikon\r
\r
REASON: - Fixed zoning to / from wastelands to / from city sectors (packet1 was wrong, thanks Maxx!!)\r
MODIFIED: 08 Jan 2006 Namikon\r
REASON: - Added appartment handling\r
- - Fixed minimap\r
+ - Fixed minimap\r
MODIFIED: 17 Jan 2006 Namikon\r
REASON: - File rewritten. Now, only 1 packet is send, like the real servers (that one fixed subway)\r
- - Fixed several worldnames\r
+ - Fixed several worldnames\r
MODIFIED: 26 Jul 2006 Hammag\r
- REASON: - Fixed world 1086 (area mc5) worldname (from NeoX source)\r
+ REASON: - Fixed world 1086 (area mc5) worldname (from NeoX source)\r
\r
MODIFIED: 28 Sep 2006 Hammag\r
- REASON: - Zone filename in now taken from appartments.def (for app zoning) or from worlds.ini (general case)\r
- rather than hardcoded.\r
- \r
+ REASON: - Zone filename in now taken from appartments.def (for app zoning) or from worlds.ini (general case)\r
+ rather than hardcoded.\r
+\r
+ MODIFIED: 09 Jun 2009 Akiko\r
+ REASON: - adjusted includes for new buildsystem\r
+\r
TODO: Put get the fallback world from config\r
Check for file existence before sending info to client to avoid client crash and bad location in char info\r
\r
*/\r
\r
+\r
#include "main.h"\r
\r
-#include "worlds.h"\r
-#include "appartements.h"\r
-#include "msgbuilder.h"\r
+#include "include/worlds.h"\r
+#include "include/appartements.h"\r
+#include "include/msgbuilder.h"\r
+\r
\r
void SendZone(PClient *Client, u32 loc)\r
{\r
+++ /dev/null
-/*\r
- TinNS (TinNS is not a Neocron Server)\r
- Copyright (C) 2005 Linux Addicted Community\r
- maintainer Akiko <akiko@gmx.org>\r
-\r
- This program is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU General Public License\r
- as published by the Free Software Foundation; either version 2\r
- of the License, or (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
- 02110-1301, USA.\r
-*/\r
-\r
-\r
-\r
-/*\r
- config.h\r
-\r
- Authors:\r
- - Akiko\r
- - Namikon\r
- - someone else?\r
-\r
- MODIFIED: Unknown date / Unknown author\r
- REASON: - initial release by unknown\r
- MODIFIED: 23 Dec 2005 Namikon\r
- REASON: - Added GPL\r
- MODIFIED: 07 Jan 2006 Namikon\r
- REASON: - Started to replace XML with CFG files \r
- MODIFIED: 05 Aug 2006 Hammag\r
- REASON: - changed LoadOptions() implementation.\r
- This should make addition of new options really easier, as well as config syntax error tracking\r
- See config.h for info\r
- MODIFIED: 27 Aug 2006 Hammag\r
- REASON: - Modified LoadOption() methode to make it generic,\r
- with an options template and the config file as arguments\r
- - Removed the ConfigTemplate that was used for gameserver only.\r
- - Removed old unused code\r
- MODIFIED: 25 Jun 2007 Hammag\r
- REASON: - Added include support\r
- - Now use PCRE RegEx instead of "strtok", enabling rentrance and removing\r
- potential issues.\r
- - Added GetOption & GetOptionInt with const std::string parameter\r
-*/\r
-\r
-#ifndef CONFIG_H\r
-#define CONFIG_H\r
-\r
-#include "regex++.h"\r
-\r
-class PConfig\r
-{\r
- private :\r
- typedef std::map<std::string, std::string> OptionsMap;\r
- OptionsMap mOptions;\r
- RegEx* mOptValRegEx;\r
- RegEx* mIncludeRegEx;\r
- \r
- bool LoadOptions(const char* nConfigTemplate[][2], const char* nConfigFile, int nDepth);\r
- \r
- public :\r
- PConfig();\r
- ~PConfig();\r
-\r
- inline bool LoadOptions(const char* nConfigTemplate[][2], const char* nConfigFile)\r
- { return LoadOptions(nConfigTemplate, nConfigFile, 0); }\r
- inline const std::string &GetOption(const char *Name) const { return GetOption((std::string) Name); }\r
- const std::string &GetOption(const std::string Name) const;\r
- int GetOptionInt(const char *Name) const { return GetOptionInt((std::string) Name); }\r
- int GetOptionInt(const std::string Name) const;\r
-};\r
-\r
-// Max nested includes\r
-#define CONFIG_MAXDEPTH 4\r
-\r
-/*\r
- The list of valid config options is now set in the array ConfigTemplate\r
- A default value can be set for each option, whiches makes the option optionnal in config file\r
- If no default value is set, the option is mandatory.\r
- Duplicate option entries in config file are also checked, and only the first value is kept\r
- Unkown options are rejected\r
- Duplicates, unkown and default use generate a warning in logs but don't break options loading\r
- Missing mandatory option generate an error in log and break option loading (imediate return false)\r
- \r
- The ConfigTemplate parameter must have the structure shown in the following exemple:\r
-\r
-const char* ConfigTemplate[][2] = {\r
- // {option_name, default_value} if default_value is empty string, it means option is mandatory\r
- // List ends with empty string for option_name\r
- {"info_sql_host", "127.0.0.1"},\r
- {"info_sql_port", "3306"},\r
- {"info_sql_username", ""},\r
- {"info_sql_password", ""},\r
- {"", ""} // do not change this line (end mark)\r
-};\r
-\r
-*/\r
-#endif\r
-\r
+++ /dev/null
-/*\r
- TinNS (TinNS is not a Neocron Server)\r
- Copyright (C) 2005 Linux Addicted Community\r
- maintainer Akiko <akiko@gmx.org>\r
-\r
- This program is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU General Public License\r
- as published by the Free Software Foundation; either version 2\r
- of the License, or (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
- 02110-1301, USA.\r
-*/\r
-\r
-\r
-\r
-/*\r
- connection-cpp.h - a connection class for tcp\r
-\r
- Authors:\r
- - bakkdoor\r
-\r
- MODIFIED: 09 Feb 2006 bakkdoor\r
- REASON: - introduced\r
-\r
- MODIFIED: 25 Jul 2006 hammag\r
- REASON: - changed member data prefix from "m_" to "m" in for homogeneity with the reste of TinNS code\r
- - added private members data mQueueIn and mQueueOut\r
- - added public members methods SendMessage(), GetMessage(), DeleteOutgoingMessages() and modified code accordingly\r
- - removed old read/write member data, and added a compatibility mSendBufferMsg* member\r
- \r
- MODIFIED: 05 Aug 2006 hammag\r
- REASON: - renamed "getLocalAddress()" to "getRemoteAddress()" as it is ... what it does !\r
-\r
- MODIFIED: 26 Aug 2006 hammag\r
- REASON: - moved RECVBUFFERSIZE, SENDBUFFERSIZE, DEFAULT_TIMEOUT decalration & definition\r
- in netcode's main.h (temporarily)\r
- \r
- TODO: - remove old read/write compatibility methods when not needed anymore\r
- - see .cpp for current implementation limits\r
-\r
-*/\r
-\r
-#ifndef CONNECTIONTCP_H\r
-#define CONNECTIONTCP_H\r
-\r
-class ServerSocket;\r
-\r
-class ConnectionTCP\r
-{\r
- private:\r
- int mSockfd;\r
- struct sockaddr_in mRemoteAddr;\r
-\r
-// u8 mReceiveBuffer[RECVBUFFERSIZE];\r
-// u8 mSendBuffer[SENDBUFFERSIZE];\r
-\r
-// int mSendSize;\r
-// int mRecvSize;\r
-// int mRecvRewind;\r
-\r
- std::time_t mLastActive;\r
- std::time_t mTimeOutValue;\r
-\r
- bool mbConnected;\r
-\r
- ServerSocket* mServerSocket; // pointer to the serversocket\r
- \r
- std::queue<PMessage*> mQueueIn;\r
- std::queue<PMessage*> mQueueOut;\r
- \r
- PMessage* mReceiveBufferMsg;\r
- \r
- public:\r
- ConnectionTCP(int sockfd, struct sockaddr_in addr, ServerSocket* server);\r
- ~ConnectionTCP();\r
-\r
- struct sockaddr_in getAddr() { return mRemoteAddr; }\r
- int getSockfd() { return mSockfd; }\r
- char* getRemoteAddress();\r
- \r
- // add pointer to serversocket-instance\r
- void setServer(ServerSocket* server){ if(server) { mServerSocket = server; } }\r
-\r
- bool timeOut() const;\r
- inline time_t GetTimeOutValue() const { return mTimeOutValue; }\r
- inline void SetTimeOutValue(time_t Value) { mTimeOutValue = Value; }\r
-\r
- bool update();\r
- bool isConnected() { return mbConnected; }\r
- \r
- inline void SendMessage(PMessage* nMessage) { mQueueOut.push(nMessage); }\r
- PMessage* GetMessage();\r
- void DeleteOutgoingMessages();\r
- \r
-/**************** Old I/F compatibility stuff ******************/ \r
- private:\r
- PMessage* mSendBufferMsg; // for old I/F compatibility only\r
- \r
- public: \r
- void flushSendBuffer();\r
-\r
- int getRecvBufferSize();\r
- int getSendBufferSize();\r
-\r
- // returns a pointer to the internal receive buffer\r
- // Size contains the number of octets to read (or 0 to read entire buffer)\r
- // number of octets available is returned in Size\r
- const u8* read(int* size);\r
-\r
- int write(const void* data, int size);\r
- int write(u8 data);\r
- int write(u16 data);\r
- int write(u32 data);\r
- int write(float data);\r
- int write(double data);\r
- int write(const char* string);\r
-};\r
-\r
-#endif\r
+++ /dev/null
-/*\r
- TinNS (TinNS is not a Neocron Server)\r
- Copyright (C) 2005 Linux Addicted Community\r
- maintainer Akiko <akiko@gmx.org>\r
-\r
- This program is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU General Public License\r
- as published by the Free Software Foundation; either version 2\r
- of the License, or (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
- 02110-1301, USA.\r
-*/\r
-\r
-\r
-\r
-/*\r
- connection-udp.h - a connection class for udp\r
-\r
- Authors:\r
- - bakkdoor\r
-\r
- MODIFIED: 09 Feb 2006 bakkdoor\r
- REASON: - introduced\r
-\r
- MODIFIED: 01 Jul 2006 hammag\r
- REASON: - added private member m_ServerSocket\r
- and added corresponding parameter in constructor;\r
-\r
- MODIFIED: 24 Jul 2006 hammag\r
- REASON: - changed member data prefix from "m_" to "m" in for homogeneity with the reste of TinNS code\r
- - added private members data mQueueIn and mQueueOut\r
- - added public members methods SendMessage(), GetMessage(), DeleteOutgoingMessages() and modified code accordingly\r
- - removed old read/write member data, and added a compatibility mSendBufferMsg* member\r
-\r
- MODIFIED: 05 Aug 2006 hammag\r
- REASON: - renamed "getLocalAddress()" to "getRemoteAddress()" as it is ... what it does !\r
-\r
- TODO: - remove old read/write compatibility methods when not needed anymore\r
- - see .cpp for current implementation limits\r
-\r
-*/\r
-\r
-#ifndef CONNECTIONUDP_H\r
-#define CONNECTIONUDP_H\r
-#define MAX_RETENTION 20 // How many packets should be stored until we can delete them\r
-#define SESSION_UDP_OFFSET 37917\r
-class ServerSocket;\r
-\r
-class ConnectionUDP\r
-{\r
- private:\r
- int mSockfd;\r
- struct sockaddr_in mRemoteAddr;\r
-\r
-// u8 mReceiveBuffer[RECVBUFFERSIZE];\r
-// u8 mSendBuffer[SENDBUFFERSIZE];\r
-\r
-// int mSendSize;\r
-// int mRecvSize;\r
-// int mRecvRewind;\r
-\r
- std::time_t mLastActive;\r
- std::time_t mTimeOutValue;\r
-\r
- int mPort;\r
- ServerSocket* mServerSocket; // pointer to the serversocket\r
-\r
- std::queue<PMessage*> mQueueIn;\r
- std::queue<PMessage*> mQueueOut;\r
- std::queue<PMessage*> mVIPQueueOut;\r
-\r
- public:\r
- ConnectionUDP(int sockfd, int port, int remoteadress, int remoteport, ServerSocket* server);\r
- ~ConnectionUDP();\r
-\r
- bool update();\r
-\r
- int getPort() { return mPort; }\r
- struct sockaddr_in getAddr() { return mRemoteAddr; }\r
- int getSockfd() { return mSockfd; }\r
- char* getRemoteAddress();\r
-\r
- bool timeOut() const;\r
- inline time_t getTimeOutValue() const { return mTimeOutValue; }\r
- inline void setTimeOutValue(time_t Value) { mTimeOutValue = Value; }\r
-\r
- void SendMessage(PMessage* nMessage, bool nVIP = false);\r
- inline int GetReadyMessagesNumber() { return mQueueIn.size(); }\r
- PMessage* GetMessage(); // returns NULL if no message available\r
- void DeleteOutgoingMessages();\r
-\r
-\r
-/********************* UDP MessageBuffer stuff *********************/\r
- private:\r
- typedef std::map<u16, PMessage*> PMessageMap;\r
- u16 mUDP_ID;\r
- u16 mLastUDPID;\r
- u16 mSessionID;\r
- u16 mTransactionID;\r
- PMessageMap UDPMessages;\r
- PMessageMap::iterator GetMsgListBegin() { return UDPMessages.begin(); }\r
- PMessageMap::iterator GetMsgListEnd() { return UDPMessages.end(); }\r
-\r
- void InsertUDPMessage(PMessage* nMsg); // Save message for possible OOO handling later\r
- void UpdateMessageBuffer(); // Delete old packets, depending on define "MAX_RETENTION"\r
- void ResetMessageBuffer(); // Done when UDP_ID gets set to zero\r
-\r
- public:\r
- void ReSendUDPMessage(u16 nUDP_ID); // OOO happend, resend udp packet with UDP_ID nUDP_ID\r
- inline u16 GetUDP_ID() const { return mUDP_ID; }\r
- inline u16 GetSessionID() const { return SESSION_UDP_OFFSET + mUDP_ID ; }\r
- inline u16 GetTransactionID() {return mTransactionID; }\r
- void SetUDP_ID(u16 id);\r
- inline void IncreaseUDP_ID() { SetUDP_ID(mUDP_ID + 1); }\r
- inline void ResetTransactionID() { mTransactionID = 10170; }\r
-\r
- inline void IncreaseTransactionID(u8 nInc = 1) { mTransactionID += nInc; }\r
-\r
-/**************** Old I/F compatibility stuff ******************/\r
- private:\r
- PMessage* mSendBufferMsg;\r
-\r
- public:\r
- int getRecvBufferSize();\r
- int getSendBufferSize();\r
- void flushSendBuffer();\r
- // returns a pointer to the internal receive buffer\r
- // Size contains the number of octets to read (or 0 to read entire buffer)\r
- // number of octets available is returned in Size\r
- const u8* read(int* size);\r
-\r
- int write(const void* data, int size);\r
- int write(u8 data);\r
- int write(u16 data);\r
- int write(u32 data);\r
- int write(float data);\r
- int write(double data);\r
- int write(const char* string);\r
-\r
-\r
-};\r
-\r
-#endif\r
+++ /dev/null
-/*\r
- TinNS (TinNS is not a Neocron Server)\r
- Copyright (C) 2005 Linux Addicted Community\r
- maintainer Akiko <akiko@gmx.org>\r
-\r
- This program is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU General Public License\r
- as published by the Free Software Foundation; either version 2\r
- of the License, or (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
- 02110-1301, USA.\r
-*/\r
-\r
-\r
-\r
-/*\r
- console.h\r
-\r
- MODIFIED: 25 Dec 2005 Namikon\r
- REASON: - Added GPL\r
- MODIFIED: 06 Jan 2006 Namikon\r
- REASON: - Added Print() function for colored console output\r
- - Added ColorText() to give selectable parts of an output another color\r
- - Added LPrint() to print like eAthena does\r
- Dont forget to use LClose() after using LPrint :)\r
- MODIFIED: 26 Aug 2006 Hammag\r
- REASON: - Added nLogFile as a constructor parameter, to make the class generic \r
- \r
-*/\r
-#ifndef CONSOLE_H\r
-#define CONSOLE_H\r
-\r
-enum COLORS\r
-{\r
- BLACK,\r
- RED,\r
- GREEN,\r
- YELLOW,\r
- BLUE,\r
- MAGENTA,\r
- CYAN,\r
- WHITE\r
-};\r
-\r
-class PConsole\r
-{\r
- private :\r
-\r
- std::ofstream mLogFile;\r
- std::time_t mLastLogTime;\r
- public :\r
- PConsole(const char *nLogFile);\r
- ~PConsole();\r
- void Print(const char *Fmt_, ...);\r
- void Print(COLORS foreground, COLORS background, const char *Fmt_, ...);\r
- char *ColorText(COLORS foreground, COLORS background, const char *Fmt, ...);\r
-\r
- void LPrint(const char *Fmt_, ...);\r
- void LPrint(COLORS foreground, COLORS background, const char *Fmt_, ...);\r
- void LClose();\r
-\r
- void Update();\r
-};\r
-\r
-#endif\r
-\r
#include <netdb.h>\r
#include <fcntl.h>\r
#include <sys/types.h>\r
-#include <algorithm> // std::transform\r
+#include <algorithm>\r
\r
#endif\r
+++ /dev/null
-/*\r
- TinNS (TinNS is not a Neocron Server)\r
- Copyright (C) 2005 Linux Addicted Community\r
- maintainer Akiko <akiko@gmx.org>\r
-\r
- This program is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU General Public License\r
- as published by the Free Software Foundation; either version 2\r
- of the License, or (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
- 02110-1301, USA.\r
-*/\r
-\r
-\r
-\r
-/*\r
- filesystem.h\r
-\r
- MODIFIED: 25 Dec 2005 Namikon\r
- REASON: - Added GPL\r
-\r
- MODIFIED: 08 Oct 2006 Hammag\r
- REASON: - added ClearCache() methode to clear pak cache when .pak access is not used anymore\r
-\r
-*/\r
-\r
-#ifndef FILESYSTEM_H\r
-#define FILESYSTEM_H\r
-\r
-class PFile\r
-{\r
- friend class PFileSystem;\r
- private :\r
- std::vector<u8> mBuffer;\r
- u32 mDataSize;\r
- u32 mDataOffs;\r
- bool ReadData(std::FILE *F, u32 Size);\r
- bool ReadUnpakData(std::FILE *F, u32 Size, u32 UncSize);\r
- public :\r
- PFile();\r
- ~PFile();\r
- inline bool Eof() { return mDataOffs>=mDataSize; }\r
- int Read(void *Dest, u32 DestSize);\r
- void Seek(u32 Offset);\r
- std::string ReadString();\r
- inline u32 GetSize() const { return mDataSize; }\r
-};\r
-\r
-#pragma pack(push, 1)\r
-//#pragma pack(1)\r
-struct PPakHeader\r
-{\r
- int mID;\r
- int mNumFiles;\r
-};\r
-\r
-struct PPakFileHeader\r
-{\r
- int mUnknown0;\r
- int mOffset;\r
- int mCompressedSize;\r
- int mUncompressedSize;\r
- int mNameLen; // including 0\r
- char *mFilename;\r
-};\r
-#pragma pack(pop)\r
-\r
-class PFileSystem\r
-{\r
- private :\r
- typedef std::map<std::string, PPakFileHeader*> PPakFileList;\r
- typedef std::map<std::string, PPakFileList*> PPakFiles;\r
- PPakFiles mPaks;\r
- PPakFileList *CachePak(const std::string &Pak, std::FILE *F);\r
- public :\r
- PFileSystem();\r
- ~PFileSystem();\r
- PFile *Open(const std::string &Package, const char *File, std::string BasePath);\r
- bool Close(PFile *File);\r
- void ClearCache();\r
-};\r
-\r
-#endif\r
-\r
+++ /dev/null
-/*
- TinNS (TinNS is not a Neocron Server)
- Copyright (C) 2005 Linux Addicted Community
- maintainer Akiko <akiko@gmx.org>
-
- 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 (at your option) 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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
-*/
-
-
-
-/*
- message.h - a data message & message pool class for tcp and udp connections (and maybe more later)
-
- Authors:
- - Hammag
-
- MODIFIED: 15 jul 2006 Hammag
- REASON: - Creation
-*/
-#ifndef MESSAGE_H
-#define MESSAGE_H
-
-#define MESSAGE_SIZES_LIST 32, 64, 128, 256, 512, 1024, 4096
-#define MESSAGE_POOL_INIT NULL, NULL, NULL, NULL, NULL, NULL, NULL
-#define MESSAGE_POOL_COUNT_INIT 0, 0, 0, 0, 0, 0, 0
-#define MESSAGE_SIZES_NB 7
-#define MESSAGE_ALLOC_NB 4
-
-struct PMsgData
-{
- PMsgData* mNextMsgData;
- u8* mBuffer; // NB: no need to manage buffer deletion atm, as they will stay until server end
-};
-//NB: putting mPoolId & mMaxSize in PMsgData rather than PMessage would be cleaner, but would put more mem overhead on each buffer
-// Doesn't matter much as PMsgData management is done only through PMessage
-
-class PMessage
-{
- private:
- static const u16 smMsgSizes[MESSAGE_SIZES_NB];
- static PMsgData* smMsgPoolHead[MESSAGE_SIZES_NB];
- static int smMsgPoolCount[MESSAGE_SIZES_NB];
- static int smMsgCount; //Used to trace unreleased messages with CheckMsgCount()
-
- u8 mPoolId;
- u16 mMaxSize;
- PMsgData* mData;
- u16 mUsedSize;
- u16 mNextByteOffset;
-
- void GetMsgBuffer(u16 nRequestedSize = 0); // the requested size is just a hint to avoid internal reaffectation of buffer
- void ReleaseMsgBuffer();
- void CheckAndExtend(u16 nRequestedSize); // This is SIZE checked, not max OFFSET
- inline void UpdateUsedSize() { if (mNextByteOffset > mUsedSize) mUsedSize = mNextByteOffset; }
-
- public:
- static void CheckMsgCount(); //To be used in a place where no new message should remain between calls
-
- PMessage(u16 nRequestedSize = 0); // max size will be extended as needed in later write accesses (up to max configured size)
- PMessage(PMessage& nMessage); // creates a (size optimized, offset reset) copy of nMessage
- inline ~PMessage() { ReleaseMsgBuffer(); --smMsgCount; }
-
- void SetNextByteOffset(u16 nPos);
- inline void IncreaseNextByteOffset(u16 nIncrement) { SetNextByteOffset(mNextByteOffset + nIncrement); }
- inline void SetNextByteAtEnd() { mNextByteOffset = mUsedSize; }
- inline u16 GetNextByteOffset() { return mNextByteOffset; }
- void ForceSize(u16 nUsedSize);
- inline u16 GetSize() { return mUsedSize; }
- inline u16 GetMaxSize() { return mMaxSize; }
- inline bool EOM() {return (mNextByteOffset >= mUsedSize);} // End Of Message
-
- // Writing methods
- u8* GetMessageDataPointer(u16 nUsedSize); // extends buffer as needed by nUsedSize, and sets UsedSize at min nUsedSize
- PMessage& Fill(u8 Value = 0, u16 StartOffset = 0, u16 FillSize = 0); // !!! Does NOT update UsedSize, fills only up to current maxSize
- inline PMessage& Reset() { mNextByteOffset = mUsedSize = 0; return *this; }
- inline PMessage& Clear() { return this->Fill(0).Reset(); }
- PMessage& Write(const void* nData, u16 nLength);
- PMessage& operator << (PMessage& nMessage);
- PMessage& operator << (const char* nString); //for null terminated string ! Copies includes ending \0
- inline PMessage& operator << (std::string& nString) { return (*this << nString.c_str()); }
- PMessage& operator << (u8 nU8);
- inline PMessage& operator << (char nChar) { return (*this << (u8) nChar);}
- PMessage& operator << (u16 nU16);
- PMessage& operator << (u32 nU32);
- PMessage& operator << (f32 nF32);
-
- // Mixt methods
-
- //The next 3 methods do NOT update NextByteOffset, but DO increase message size (UsedSize ans MaxSize) as needed by nOffset.
- u8& U8Data(u16 nOffset);
- u16& U16Data(u16 nOffset);
- u32& U32Data(u16 nOffset);
- f32& F32Data(u16 nOffset);
-
- // *** didn't managed to overload [] operator :-/
- inline u8& operator [] (u16 nOffset) { return U8Data(nOffset); }
- //inline u16& operator [] (u16 nOffset) { return U16Data(nOffset); }
- //u32& operator [] (u16 nOffset);
-
- // Really makes a different message instance, with all data copied (no data shared)
- PMessage& operator = (PMessage& nMessage);
-
- // Reading methods
- // ChunkNumber count from 0, return NULL for empty chunk (ie StartOffset is over UsedSize). NextByteOffset NOT updated
- PMessage* GetChunk(u16 StartOffset, u16 ChunkSize, u16 ChunkNumber = 0);
-
- // Return pointer to the START of message data.
- inline u8 const* GetMessageData() { return mData->mBuffer; }
-
- //Following methods do NOT extend message or Used, and return 0/empty string if over UsedSize
- PMessage& operator >> (std::string& nString); //read up to null or EOM
- PMessage& operator >> (u8& nU8);
- inline PMessage& operator >> (char& nChar) { return (*this >> (u8&) nChar);}
- PMessage& operator >> (u16& nU16);
- PMessage& operator >> (u32& nU32);
- PMessage& operator >> (f32& nF32);
-
- // info/debug methods
- static void ListPools();
- static void DumpPools();
- void Dump();
- void DumpHead(char* nComment = "");
-};
-
-#endif
+++ /dev/null
-/*\r
- TinNS (TinNS is not a Neocron Server)\r
- Copyright (C) 2005 Linux Addicted Community\r
- maintainer Akiko <akiko@gmx.org>\r
-\r
- This program is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU General Public License\r
- as published by the Free Software Foundation; either version 2\r
- of the License, or (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
- 02110-1301, USA.\r
-*/\r
-\r
-\r
-\r
-/*\r
- misc.h\r
-\r
- MODIFIED: 25 Dec 2005 Namikon\r
- REASON: - Added GPL\r
- MODIFIED: 07 Jan 2006 Namikon\r
- REASON: - Added function to trim a string/char\r
- MODIFIED: 27 Aug 2006 Hammag\r
- REASON: - Merged misc function from all 3 servers\r
- MODIFIED: 11 Dec 2006 Hammag\r
- REASON: - Commented out GetSVNRev() that is not used anymore\r
-*/\r
-\r
-#ifndef MISC_H\r
-#define MISC_H\r
-\r
-#ifdef _MSC_VER\r
- #pragma once\r
-#endif\r
-\r
-u32 IPStringToDWord(const char *IP);\r
-char *IPlongToString(const u32 IP);\r
-std::string GetAccessString(int level);\r
-//void GetSVNRev(char *version);\r
-\r
-void PrintPacket(u8 *Packet, int PacketSize);\r
-\r
-// Cleanup for strings read from .def\r
-void CleanUpString(std::string *nString);\r
-void Trim(char *t);\r
-void Trim(std::string *stString);\r
-void RTrim(char *t);\r
-void RTrim(std::string *stString);\r
-void LTrim(char *t);\r
-void LTrim(std::string *stString);\r
-std::string &Ssprintf(const char *fmt, ...);\r
-\r
-u16 DistanceApprox(const u16 x1, const u16 y1, const u16 z1, const u16 x2, const u16 y2, const u16 z2);\r
-f32 Distance(const f32 x1, const f32 y1, const f32 z1, const f32 x2, const f32 y2, const f32 z2);\r
-f32 Distance(const f32 x1, const f32 y1, const f32 x2, const f32 y2); // 2D only version\r
-\r
-void InitRandom(u32 nInitialisationValue);\r
-u16 GetRandom(u16 MaxVal, u16 MinVal = 0); // u16 value between MinVal and MaxVal (inclusive) with max range 32768\r
-f32 GetRandomFloat(); // f32 value between 0 and 1\r
-#endif\r
-\r
+++ /dev/null
-/*\r
- TinNS (TinNS is not a Neocron Server)\r
- Copyright (C) 2005 Linux Addicted Community\r
- maintainer Akiko <akiko@gmx.org>\r
-\r
- This program is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU General Public License\r
- as published by the Free Software Foundation; either version 2\r
- of the License, or (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
- 02110-1301, USA.\r
-*/\r
-\r
-#ifndef NETCODE_H\r
-#define NETCODE_H\r
-\r
-#include <sys/socket.h>\r
-#include <netinet/in.h>\r
-#include <arpa/inet.h>\r
-#include "message.h"\r
-#include "connection-tcp.h"\r
-#include "connection-udp.h"\r
-#include "serversocket.h"\r
-\r
-#endif\r
-\r
+++ /dev/null
-//
-// regex.h 1.0 Copyright (c) 2003 Peter Petersen (pp@on-time.de)
-// Simple C++ wrapper for PCRE
-//
-// This source file is freeware. You may use it for any purpose without
-// restriction except that the copyright notice as the top of this file as
-// well as this paragraph may not be removed or altered.
-//
-// This header file declares class RegEx, a simple and small API wrapper
-// for PCRE.
-//
-// RegEx::RegEx(const char * regex, int options = 0)
-//
-// The constructor's first parameter is the regular expression the
-// created object shall implement. Optional parameter options can be
-// any combination of PCRE options accepted by pcre_compile(). If
-// compiling the regular expression fails, an error message string is
-// thrown as an exception.
-//
-// RegEx::~RegEx()
-//
-// The destructor frees all resources held by the RegEx object.
-//
-// int RegEx::SubStrings(void) const
-//
-// Method SubStrings() returns the number of substrings defined by
-// the regular expression. The match of the entire expression is also
-// considered a substring, so the return value will always be >= 1.
-//
-// bool RegEx::Search(const char * subject, int len = -1, int options = 0)
-//
-// Method Search() applies the regular expression to parameter subject.
-// Optional parameter len can be used to pass the subject's length to
-// Search(). If not specified (or less than 0), strlen() is used
-// internally to determine the length. Parameter options can contain
-// any combination of options PCRE_ANCHORED, PCRE_NOTBOL, PCRE_NOTEOL.
-// PCRE_NOTEMPTY. Search() returns true if a match is found.
-//
-// bool RegEx::SearchAgain(int options = 0)
-//
-// SearchAgain() again applies the regular expression to parameter
-// subject last passed to a successful call of Search(). It returns
-// true if a further match is found. Subsequent calls to SearchAgain()
-// will find all matches in subject. Example:
-//
-// if (Pattern.Search(astring)) {
-// do {
-// printf("%s\n", Pattern.Match());
-// } while (Pattern.SearchAgain());
-// }
-//
-// Parameter options is interpreted as for method Search().
-//
-// const char * RegEx::Match(int i = 1)
-//
-// Method Match() returns a pointer to the matched substring specified
-// with parameter i. Match() may only be called after a successful
-// call to Search() or SearchAgain() and applies to that last
-// Search()/SearchAgain() call. Parameter i must be less than
-// SubStrings(). Match(-1) returns the last searched subject.
-// Match(0) returns the match of the complete regular expression.
-// Match(1) returns $1, etc.
-//
-// See man pcre & man pcrepattern for more info
-
-#ifndef _REGEX_H
-#define _REGEX_H
-
-#include <string.h>
-
-#ifndef _PCRE_H
-#include "pcre.h"
-#endif
-
-class RegEx
-{
- private:
- pcre * re;
- pcre_extra * pe;
- int substrcount;
- int * ovector;
- const char * lastsubject;
- int slen;
- const char * * matchlist;
-
- inline void ClearMatchList(void)
- {
- if (matchlist)
- pcre_free_substring_list(matchlist),
- matchlist = NULL;
- }
-
- public:
- RegEx(const char * regex, int options = 0);
- ~RegEx();
- inline int SubStrings(void) const { return substrcount; }
- bool Search(const char * subject, int len = -1, int options = 0);
- bool SearchAgain(int options = 0);
- const char * Match(int i = 1);
-
-};
-
-#endif // _REGEX_H
+++ /dev/null
-/*\r
- TinNS (TinNS is not a Neocron Server)\r
- Copyright (C) 2005 Linux Addicted Community\r
- maintainer Akiko <akiko@gmx.org>\r
-\r
- This program is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU General Public License\r
- as published by the Free Software Foundation; either version 2\r
- of the License, or (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
- 02110-1301, USA.\r
-*/\r
-\r
-\r
-\r
-/*\r
- serversocket.h - a serversocket class managing all connections (udp/tcp)\r
-\r
- Authors:\r
- - bakkdoor\r
-\r
- MODIFIED: 09 Feb 2006 bakkdoor\r
- REASON: - introduced\r
- \r
- MODIFIED: 01 Jul 2006 hammag\r
- REASON: - added settimeout method\r
- REASON: - added fd_set m_MainSetUDP private member\r
- REASON: - added fd_set m_MainSetGlobal private member (=m_MainSetTCP + m_MainSetUDP)\r
-\r
- MODIFIED: 05 Aug 2006 hammag\r
- REASON: - server UDP port is now taken in the range [gameserver_udpport_min, gameserver_udpport_max] set in config\r
- - removed m_LastUDPPort which is not used anymore (might be used again in futur for faster free udp port allocation)\r
-\r
-*/\r
-\r
-#ifndef SERVERSOCKET_H\r
-#define SERVERSOCKET_H\r
-\r
-//class Connection; // removed... this class doesn't exist\r
-\r
-class ServerSocket\r
-{\r
- private:\r
- fd_set m_MainSetTCP; // master file descriptor list for tcp-connections\r
- fd_set m_ReadSetTCP; // temp file descriptor list for select() for tcp-connections\r
- fd_set m_MainSetUDP; // master file descriptor list for udp-connections\r
- fd_set m_MainSetGlobal; // master file descriptor list for udp+tcp connections\r
-\r
- struct sockaddr_in m_ServerAddr; // server address\r
-\r
- int m_ListenerTCP; // listening socket descriptor\r
-\r
- int m_FdMaxTCP; // highest current file-descriptor (tcp)\r
- int m_FdMaxUDP; // highest current file-descriptor (udp)\r
-\r
- bool m_bNewTCPConnection;\r
-\r
- //int m_LastUDPPort; // not used anymore\r
-\r
- struct timeval m_TimeOut;\r
-\r
- public:\r
- ServerSocket();\r
- ~ServerSocket();\r
-\r
- void settimeout(long timeout_sec, long timeout_usec);\r
- bool open(int port);\r
- void update();\r
- bool newConnection();\r
- ConnectionTCP* getTCPConnection();\r
- ConnectionUDP* getUDPConnection(long remoteadress, int remoteport);\r
-\r
- bool isDataAvailable(int sockfd);\r
-\r
- void delSocketFromSet(int sockfd);\r
-\r
- void closeServer();\r
-};\r
-\r
-#endif\r
#ifndef SVN_REV_DEF
#define SVN_REV_DEF
-#define TINNS_SVN_REVISION "133"
+#define TINNS_SVN_REVISION "AKIKO_CMAKE_R2"
#endif
--- /dev/null
+add_executable (infoserver accounts.cpp client.cpp globals.cpp infoserver.cpp main.cpp server.cpp sql.cpp)
+
+target_link_libraries (infoserver common ${MYSQL_LIBRARY} ${PCRE_LIBRARY})
+++ /dev/null
-#
-# TinNS per-directory Makefile
-#
-# Adapted by Hammag from the Makefile system for Linux kernel.
-#
-# 14 Sep 2000, Christoph Hellwig <hch@infradead.org>
-# Rewritten to use lists instead of if-statements.
-#
-
-######################################################
-# Target for this directory and its sub-dirs
-######################################################
-# Case 1 : target is an executable named as defined
-B_TARGET := infoserver
-
-# Case 2 : target is a TinNS lib name
-# (use short name, as in -l linker option)
-#L_TARGET := tinns
-
-# Case 3 (usual): objects shall be made available to the parent dir
-# The following line will set that automatically
-# (Should match dir name + .o suffix)
-#O_TARGET := $(addsuffix .o,$(notdir $(shell /bin/pwd)))
-# Manualy define this only if you need to force the compiled obj name
-#O_TARGET := game.o
-
-
-######################################################
-# Local flags
-######################################################
-# local dir CXX Flags
-EXTRA_CXXFLAGS := -I/usr/include/mysql
-
-# per-object CXX Flags
-#CXXFLAGS_funcdef2.o := -O0 -ggdb
-
-# local dir Linker Flags (for intermediate .o linking)
-#EXTRA_LDFLAGS :=
-
-# any tinns Lib used (short name, as in -l linker option)
-LINK_TINNSLIBS := tinns
-
-# local dir Linker Flags (for final executable linking)
-#EXTRA_LINKFLAGS := -lpthread -lm -lcrypt -L"/usr/lib/mysql" -lmysqlclient -lz
-EXTRA_LINKFLAGS := -L"/usr/lib/mysql" -lmysqlclient -lz -lpcre
-
-
-#####################################################
-# Subdirectories
-#####################################################
-#subdir-y := def
-#subdir-$(CONFIG_GAMEMONKEY) += gamemonkey
-
-
-#####################################################
-#***************************************************#
-# No further config should be needed after this line
-#***************************************************#
-ifdef TOPDIR
-
-# build list of objects ib loca ldir
-obj-y := $(patsubst %.cpp,%.o,$(wildcard *.cpp))
-# add final object from each subdir
-obj-y += $(join $(subdir-y),$(subdir-y:%=/%.o))
-
-include $(TOPDIR)/Rules.make
-
-else #TOPDIR undef, Makefile called from non-top dir
-
-# Memorize the first calling dir in case we wanted to
-# lauch local actions from top Makefile
- ifndef FIRSTDIR
- FIRSTDIR :=$(CURDIR)
- export FIRSTDIR
- endif
-
-uptoparent :
- $(MAKE) -C .. $(MAKECMDGOALS)
-
-.DEFAULT :
- $(MAKE) -C .. $(MAKECMDGOALS)
-
-endif #TOPDIR
-
REASON: - Changed FmtTxt() to sprintf(). It does... uhm, the same :D\r
MODIFIED: 06 Jan 2006 Namikon\r
REASON: - Removed the old XML loading functions, and changed the SQL ones to work with the Global Neopolis/TinNS Database\r
- - Added SetBannedStatus(<unix timestamp>) to ban/unban an account (use SetBannedStatus(0) to unban a player)\r
+ - Added SetBannedStatus(<unix timestamp>) to ban/unban an account (use SetBannedStatus(0) to unban a player)\r
MODIFIED: 03 Oct 2006 Hammag\r
REASON: - Fixed an issue in PAccount::SetBannedStatus() that was causing the "can't update banned status" error message.\r
MODIFIED: 27 May 2007 Hammag\r
REASON: - Full changes for on-demand account access (no more memory-resident account data)\r
-\r
-\r
- MODIFIED: 2 Feb 2008 Hammag\r
+ \r
+ \r
+ MODIFIED: 02 Feb 2008 Hammag\r
REASON: - Correction of the account creation/update SQL query (thank to drhawk ;) )\r
*/\r
\r
delete mUsernameRegexFilter;\r
mUsernameRegexFilter = NULL;\r
}\r
-\r
+ \r
if(RegexStr)\r
{\r
try {\r
delete mPasswordRegexFilter;\r
mPasswordRegexFilter = NULL;\r
}\r
-\r
+ \r
if(RegexStr)\r
{\r
try {\r
return true;\r
}\r
\r
-/** Instance members **/\r
+/** Instance members **/ \r
PAccount::PAccount()\r
{\r
mID = 0;\r
{\r
MYSQL_ROW row = 0;\r
MYSQL_RES *result = 0;\r
-\r
+ \r
bool FinalResult = false;\r
\r
//result = MySQL->InfoResQuery(query);\r
{\r
Console->Print(YELLOW, BLACK, "Failed to load AccountData from SQL; Nothing to load...");\r
}\r
-\r
+ \r
//MySQL->FreeInfoSQLResult(result);\r
MySQL->FreeSQLResult(result);\r
return FinalResult;\r
bool PAccount::SetPasswordEncoded(const u8* PasswordData, int PassLen, const u8* Key)\r
{\r
char Pass[128];\r
-\r
+ \r
if(DecodePassword(PasswordData, PassLen, Key, Pass))\r
{\r
return SetPassword((std::string)Pass);\r
bool PAccount::DecodePassword(const u8* PasswordData, int PassLen, const u8 *Key, char* ClearPassword)\r
{\r
ClearPassword[0] = 0;\r
-\r
+ \r
if(PassLen < 128)\r
{\r
if(Key[0]>7) // TODO: >7 correct?\r
bool PAccount::Authenticate(const u8* PasswordData, int PassLen, const u8 *Key)\r
{\r
char Pass[128];\r
-\r
+ \r
if(DecodePassword(PasswordData, PassLen, Key, Pass))\r
{\r
return Authenticate(Pass);\r
Console->Print(RED, BLACK, "[Bug]: user %s doesn't exist and was not checked by code !", mName.c_str());\r
return false;\r
}\r
-\r
+ \r
return(mPassword == Password);\r
}\r
\r
char escPassword[256];\r
MySQL->EscapeString(mName.c_str(), escUsername, 256);\r
MySQL->EscapeString(mPassword.c_str(), escPassword, 256);\r
-\r
+ \r
std::string Query;\r
Query = CreateMode ? "INSERT INTO" : "UPDATE";\r
Query += " accounts SET ";\r
Query += Ssprintf(" a_username='%s', a_password = '%s'", escUsername, escPassword);\r
Query += Ssprintf(", a_priv = %d, a_status = %d, a_bandate = %d", mLevel, mStatus, mBannedUntil);\r
if(!CreateMode )\r
- {
- Query += Ssprintf(" a_lastused = NOW()");\r
+ {\r
+ Query += Ssprintf(" a_lastused = NOW()");\r
Query += Ssprintf(" WHERE a_id = %d LIMIT 1", mID);\r
- }
- else
- Query += Ssprintf(" a_creationdate = NOW()");
-\r
+ }\r
+ else\r
+ Query += Ssprintf(" a_creationdate = NOW()");\r
\r
//if(MySQL->InfoQuery(Query.c_str()))\r
if(MySQL->Query(Query.c_str()))\r
std::string PAccount::GetBannedTime() const\r
{\r
const char* unit[5] = {"seconds", "minutes", "hours", "days", "weeks"};\r
-\r
+ \r
std::time_t timediff = mBannedUntil - std::time(NULL);\r
if(timediff <=0)\r
{\r
REASON: - Added bool var for ingame debug outputs for administrators\r
MODIFIED: 06 Jan 2005 Namikon\r
REASON: - Added SetBannedStatus(<unix timestamp>) to ban/unban an account (use SetBannedStatus(0) to unban a player)\r
+ MODIFIED: 10 Jun 2009 Akiko\r
+ REASON: - adjusted includes for new buildsystem\r
*/\r
\r
#ifndef ACCOUNTS_H\r
#pragma once\r
#endif\r
\r
-#include "regex++.h"\r
+#include "common/regex++.h"\r
\r
/*\r
0 = unregistered user\r
PAS_ONLINE = 1,\r
PAS_BANNED = 2\r
};\r
-\r
+ \r
class PAccount\r
{\r
private :\r
a_password,\r
a_priv,\r
a_status,\r
- a_bandate,
- a_emailaddress,
- a_creationdate,
+ a_bandate,\r
+ a_emailaddress,\r
+ a_creationdate,\r
a_lastused\r
};\r
-\r
+ \r
// static members\r
static RegEx* mUsernameRegexFilter;\r
static RegEx* mPasswordRegexFilter;\r
-\r
+ \r
// instance members\r
u32 mID;\r
std::string mName;\r
\r
bool LoadFromQuery(char* query);\r
bool DecodePassword(const u8* PasswordData, int PassLen, const u8 *Key, char* ClearPassword);\r
-\r
+ \r
public :\r
PAccount();\r
PAccount(const u32 AccountId);\r
PAccount(const char *Username);\r
-\r
+ \r
static bool SetUsernameRegexFilter(const char* RegexStr);\r
static bool SetPasswordRegexFilter(const char* RegexStr);\r
static bool IsUsernameWellFormed(const char *Username);\r
static bool IsPasswordWellFormed(const char *Password);\r
-\r
+ \r
inline u32 GetID() const { return mID; }\r
bool SetName(const std::string &Pass);\r
inline const std::string &GetName() const { return mName; }\r
\r
bool Authenticate(const u8* PasswordData, int PassLen, const u8 *Key);\r
bool Authenticate(const char *Password) const;\r
-\r
+ \r
bool Create();\r
bool Save(bool CreateMode = false);\r
\r
{"isc_connect_pw", "changeme"},\r
{"username_filter", "^[a-z][\\w\\-]{2,14}$"},\r
{"password_filter", "^[[:graph:]]{3,15}$"},\r
+ {"sqlite_databasefile", "infoDB.s3db"},\r
+ {"database_type", "sqlite"},\r
+ \r
\r
// For futur use:\r
// {"max_chars_per_account", "4"},\r
02110-1301, USA.\r
*/\r
\r
+\r
+\r
/*\r
- MODIFIED: 27 Aug 2006 Hammag\r
- REASON: - Implemented shared Config class use and config template to load conf.\r
- Added gameserver configtemplate.h include,\r
- Added new required parameters to Config->LoadOptions()\r
- - Added AdditionnalConfigChecks() local function, called after config loading\r
- taken from inital infoserver's PConfig::VerifyValues\r
+ MODIFIED: 27 Aug 2006 Hammag\r
+ REASON: - Implemented shared Config class use and config template to load conf.\r
+ - Added gameserver configtemplate.h include,\r
+ - Added new required parameters to Config->LoadOptions()\r
+ - Added AdditionnalConfigChecks() local function, called after config loading\r
+ taken from inital infoserver's PConfig::VerifyValues\r
+ MODIFIED: 10 Jun 2009 Akiko\r
+ REASON: - adjusted includes for new buildsystem\r
*/\r
\r
+\r
#include "main.h"\r
#include "configtemplate.h"\r
\r
-#include "version.h"\r
+#include "include/version.h"\r
+\r
+\r
const char ServerVersion[] = TINNS_INFO_VERSION;\r
const char SVNRevision[] = TINNS_SVN_REVISION;\r
\r
if(it != Serverlist.end())\r
{\r
strncpy(it->second.mName, row[s_name], MAX_SERVER_NAME_LENGTH);\r
- it->second.mLanIp = IPStringToDWord(row[s_lanaddr]);
- it->second.mWanIp = IPStringToDWord(row[s_wanaddr]);\r
+ it->second.mLanIp = IPStringToDWord(row[s_lanaddr]);\r
+ it->second.mWanIp = IPStringToDWord(row[s_wanaddr]);\r
it->second.mPort = atoi(row[s_port]);\r
it->second.mPlayers = atoi(row[s_players]);\r
/* Prepared for future addon Servers by Accesslevel */\r
{\r
GameServers tmpServer;\r
\r
- strncpy(tmpServer.mName, row[s_name], MAX_SERVER_NAME_LENGTH);
- tmpServer.mLanIp = IPStringToDWord(row[s_lanaddr]);
+ strncpy(tmpServer.mName, row[s_name], MAX_SERVER_NAME_LENGTH);\r
+ tmpServer.mLanIp = IPStringToDWord(row[s_lanaddr]);\r
tmpServer.mWanIp = IPStringToDWord(row[s_wanaddr]);\r
tmpServer.mLasttimestamp = atol(row[s_lastupdate]);\r
tmpServer.mPlayers = atoi(row[s_players]);\r
// -99: General fault. Contact admin\r
ConnectionTCP *Socket = Client->getTCPConn();\r
PAccount* currentAccount = NULL;\r
-\r
+ \r
if(PacketSize > 20 && *(u16*)&Packet[3]==0x8084)\r
{\r
const u8 *Key = &Packet[5]; // password key\r
{\r
delete currentAccount;\r
currentAccount = new PAccount();\r
-\r
+ \r
if(!currentAccount->SetName(UserName)) // !!! len\r
{\r
returnval = -7;\r
{\r
returnval = returnval ? -8 : -6;\r
}\r
-\r
+ \r
if(!returnval)\r
{\r
if(currentAccount->Create())\r
Client->setAccountID(currentAccount->GetID());\r
returnval = 0;\r
}\r
-\r
+ \r
}\r
else\r
{\r
}\r
}\r
}\r
-\r
+ \r
bool Failed = false;\r
if(returnval == 0)\r
{\r
/* Prepared for future addon Servers by Accesslevel */\r
// if(accesslevel >= it->second.mMinLv)\r
// {\r
- /* ------------------------------------------------ */
+ /* ------------------------------------------------ */\r
// Todo: Set correct lan/wan IP here!\r
*(u32*)&SERVERLIST[0] = it->second.mLanIp;\r
*(u16*)&SERVERLIST[4] = it->second.mPort;\r
}\r
else if(it->second.mOnline == false)\r
{\r
- Console->Print("Sending server name: %s ip: %s player: %d port: %d online: no", it->second.mName, IPlongToString(it->second.mLanIp), it->second.mPlayers, it->second.mPort);\r
+ Console->Print("Sending server name: %s ip: %s player: %d port: %d online: no", it->second.mName, IPlongToString(it->second.mLanIp), it->second.mPlayers, it->second.mPort);\r
*(u16*)&SERVERLIST[11] = 0;\r
}\r
Socket->write(SERVERLIST, sizeof(SERVERLIST));\r
struct GameServers\r
{\r
char mName[MAX_SERVER_NAME_LENGTH];\r
- unsigned int mLanIp;
- unsigned int mWanIp;\r
+ unsigned int mLanIp;\r
+ unsigned int mWanIp;\r
short mPort;\r
int mPlayers;\r
bool mOnline;\r
s_wanaddr,\r
s_port,\r
s_players,\r
- s_lastupdate,
- s_lanaddr,\r
+ s_lastupdate,\r
+ s_lanaddr,\r
s_timecheck // computed field, not in table !\r
};\r
//int mNumClients;\r
*/\r
\r
\r
+\r
/*\r
- MODIFIED: 6 Jul 2006 Hammag\r
- REASON: - moved include "types.h" before include "../netcode/main.h" to enable compile\r
- \r
- MODIFIED: 27 Aug 2006 Hammag\r
- REASON: - replaced MAX_INFO_CLIENTS define by config setting\r
- - removed INFO_PORT define not used anymore\r
- \r
+ MODIFIED: 06 Jul 2006 Hammag\r
+ REASON: - moved include "types.h" before include "../netcode/main.h" to enable compile\r
+ MODIFIED: 27 Aug 2006 Hammag\r
+ REASON: - replaced MAX_INFO_CLIENTS define by config setting\r
+ - removed INFO_PORT define not used anymore\r
+ MODIFIED: 10 Jun 2009 Akiko\r
+ REASON: - adjusted includes for new buildsystem\r
*/\r
\r
\r
//#include "version.h"\r
\r
//basic includes\r
-#include "external.h"\r
+#include "include/external.h"\r
\r
//tinns includes\r
-#include "types.h"\r
-#include "netcode.h"\r
+#include "include/types.h"\r
+#include "common/netcode.h"\r
\r
// MySQL Support\r
-#include "mysql.h"\r
+#ifdef MYSQL_INC_DIR\r
+#include <mysql/mysql.h>\r
+#else\r
+#include <mysql.h>\r
+#endif\r
+\r
#include "sql.h"\r
-#include "console.h"\r
-#include "config.h"\r
+#include "common/console.h"\r
+#include "common/config.h"\r
#include "accounts.h"\r
#include "client.h"\r
#include "server.h"\r
#include "infoserver.h"\r
-#include "misc.h"\r
+#include "common/misc.h"\r
#include "globals.h"\r
\r
-\r
-using namespace std;\r
-\r
#endif\r
+++ /dev/null
-#
-# Local Makefile custom options
-# not in SVN !
-#
-# Copy this file as options.local to add you custom complation options
-# so that you don't need to change the main Makefile
-# You can also uncomment some of the lines below that fit you needs
-#
-#DO_DEBUG = y
-#CXXFLAGS += -Werror
-#CXXFLAGS += -march=native
-#CXXFLAGS += -fstack-protector-all
--- /dev/null
+add_executable (patchserver client.cpp globals.cpp patchserver.cpp main.cpp server.cpp)
+
+target_link_libraries (patchserver common ${PCRE_LIBRARY} ${ZLIB_LIBRARY})
+++ /dev/null
-#
-# TinNS per-directory Makefile
-#
-# Adapted by Hammag from the Makefile system for Linux kernel.
-#
-# 14 Sep 2000, Christoph Hellwig <hch@infradead.org>
-# Rewritten to use lists instead of if-statements.
-#
-
-######################################################
-# Target for this directory and its sub-dirs
-######################################################
-# Case 1 : target is an executable named as defined
-B_TARGET := patchserver
-
-# Case 2 : target is a TinNS lib name
-# (use short name, as in -l linker option)
-#L_TARGET := tinns
-
-# Case 3 (usual): objects shall be made available to the parent dir
-# The following line will set that automatically
-# (Should match dir name + .o suffix)
-#O_TARGET := $(addsuffix .o,$(notdir $(shell /bin/pwd)))
-# Manualy define this only if you need to force the compiled obj name
-#O_TARGET := game.o
-
-
-######################################################
-# Local flags
-######################################################
-# local dir CXX Flags
-#EXTRA_CXXFLAGS := -I/usr/include/mysql
-
-# per-object CXX Flags
-#CXXFLAGS_funcdef2.o := -g
-
-# local dir Linker Flags (for intermediate .o linking)
-#EXTRA_LDFLAGS :=
-
-# any tinns Lib used (short name, as in -l linker option)
-LINK_TINNSLIBS := tinns
-
-# local dir Linker Flags (for final executable linking)
-#EXTRA_LINKFLAGS := -lrt -lpthread -lz -lm -lcrypt
-EXTRA_LINKFLAGS := -lz -lpcre
-
-
-#####################################################
-# Subdirectories
-#####################################################
-#subdir-y := def
-#subdir-$(CONFIG_GAMEMONKEY) += gamemonkey
-
-
-#####################################################
-#***************************************************#
-# No further config should be needed after this line
-#***************************************************#
-ifdef TOPDIR
-
-# build list of objects ib loca ldir
-obj-y := $(patsubst %.cpp,%.o,$(wildcard *.cpp))
-# add final object from each subdir
-obj-y += $(join $(subdir-y),$(subdir-y:%=/%.o))
-
-include $(TOPDIR)/Rules.make
-
-else #TOPDIR undef, Makefile called from non-top dir
-
-# Memorize the first calling dir in case we wanted to
-# lauch local actions from top Makefile
- ifndef FIRSTDIR
- FIRSTDIR :=$(CURDIR)
- export FIRSTDIR
- endif
-
-uptoparent :
- $(MAKE) -C .. $(MAKECMDGOALS)
-
-.DEFAULT :
- $(MAKE) -C .. $(MAKECMDGOALS)
-
-endif #TOPDIR
-
02110-1301, USA.\r
*/\r
\r
+\r
+\r
/*\r
+ MODIFIED: 27 Aug 2006 Hammag\r
+ REASON: - Implemented shared Config class use and config template to load conf.\r
+ - Added gameserver configtemplate.h include,\r
+ - Added new required parameters to Config->LoadOptions()\r
+ MODIFIED: 10 Jun 2009 Akiko\r
+ REASON: - adjusted includes for new buildsystem\r
\r
- MODIFIED: 27 Aug 2006 Hammag\r
- REASON: - Implemented shared Config class use and config template to load conf.\r
- Added gameserver configtemplate.h include,\r
- Added new required parameters to Config->LoadOptions()\r
- \r
- TODO: - Get logfile name from config file\r
- \r
+ TODO: - Get logfile name from config file \r
*/\r
+\r
\r
#include "main.h"\r
+\r
#include "configtemplate.h"\r
\r
-#include "version.h"\r
+#include "include/version.h"\r
+\r
+\r
const char ServerVersion[] = TINNS_PATCH_VERSION;\r
const char SVNRevision[] = TINNS_SVN_REVISION;\r
\r
\r
\r
/*\r
- MODIFIED: 6 Jul 2006 Hammag\r
- REASON: - moved include "types.h" before include "../netcode/main.h" to permit compile\r
+ MODIFIED: 06 Jul 2006 Hammag\r
+ REASON: - moved include "types.h" before include "../netcode/main.h" to permit compile\r
+ MODIFIED: 10 Jun 2009 Akiko\r
+ REASON: - adjusted includes for new buildsystem\r
*/\r
\r
#ifndef MAIN_H\r
#define MAX_PATCH_CLIENTS 50\r
\r
//basic includes\r
-#include "external.h"\r
+#include "include/external.h"\r
\r
//tinns includes\r
-#include "types.h"\r
-#include "netcode.h"\r
+#include "include/types.h"\r
+#include "common/netcode.h"\r
\r
-#include "console.h"\r
-#include "config.h"\r
-#include "filesystem.h"\r
+#include "common/console.h"\r
+#include "common/config.h"\r
+#include "common/filesystem.h"\r
#include "client.h"\r
#include "server.h"\r
#include "patchserver.h"\r
-#include "misc.h"\r
+#include "common/misc.h"\r
#include "globals.h"\r
\r
-using namespace std;\r
-\r
#endif\r
\r
\r
u32 PPatchServer::StartPatch(PPatchState *State)\r
{\r
- /*std::*/stringstream path;\r
+ std::stringstream path;\r
char patchname[13];\r
snprintf(patchname, 13, "sp%06d.pat", State->mCurrentPatch);\r
path << Config->GetOption("patches_path") << "/" << patchname << '\0';\r
--- /dev/null
+add_subdirectory (pak_decompress)
+add_subdirectory (vfs_viewer)
+++ /dev/null
-CC=gcc
-CXX=g++
-CFLAGS=-pedantic -Wall
-CXX_FLAGS=$(CFLAGS)
-
-SOURCES=$(wildcard *.cpp)
-OBJECTS=$(patsubst %.cpp,%.o,$(SOURCES))
-
-%.o:%.cpp
- $(CXX) $(CXX_FLAGS) -c $< -o $@
-
-all: getsvnrev
-
-getsvnrev: $(OBJECTS)
- $(CXX) -o $@ $(OBJECTS) -lstdc++ -lz
-
-clean:
- -rm $(OBJECTS) getsvnrev
-
+++ /dev/null
-/*\r
- TinNS (TinNS is not a Neocron Server)\r
- pak_decompress - pak file decompression tool\r
- Copyright (C) 2005 Akiko <akiko@gmx.org>\r
-\r
- This program is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU General Public License\r
- as published by the Free Software Foundation; either version 2\r
- of the License, or (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
- 02110-1301, USA.\r
-*/\r
-\r
-\r
-\r
-/*\r
- getsvnrev - a simple tool to read out actual SVN revision-number\r
-\r
- Why?\r
- Well for example my server doesnt have any SVN libs installed. Therefore,\r
- the getsvnrev script fails. I need this little tool, and maybe someone else too ^^\r
-\r
- Usage: \r
- call getsvnrev either without parameters or with the directory you\r
- want to know the SVN revision.\r
- \r
- Console output:\r
- If no .svn directory is found, the tool returns 0.\r
- Otherwise it will return the SVN revision of the target dir\r
-\r
- MODIFIED: 22 Dec 2006 Namikon\r
- REASON: - started this tool\r
-\r
- TODO:\r
- - Better way to get SVN rev than this (2nd number in file)\r
-*/\r
-\r
-\r
-#include <stdio.h>\r
-#include <iostream>\r
-\r
-using namespace std;\r
-\r
-int main(int argc, char **argv)\r
-{\r
- string targetdir;\r
- FILE *f;\r
-\r
- if(argc == 2)\r
- {\r
- int i = 0;\r
- while(argv[1][i] != '\0') { i++; };\r
- if(argv[1][i-1] == '/')\r
- {\r
- targetdir = strcat(argv[1], ".svn/entries");\r
- }\r
- else\r
- {\r
- targetdir = strcat(argv[1], "/.svn/entries");\r
- }\r
- }\r
- else\r
- {\r
- targetdir = ".svn/entries";\r
- }\r
-\r
-\r
- if ((f = fopen(targetdir.c_str(), "r")) != NULL) {\r
- char line[255];\r
- int rev;\r
- bool firstnrfound = false;\r
- \r
- do\r
- {\r
- fgets (line, 255, f);\r
- rev = atoi(line);\r
- if(rev > 0 && firstnrfound == false)\r
- {\r
- firstnrfound = true;\r
- rev = 0;\r
- }\r
- } while (rev == 0);\r
- \r
- fclose(f);\r
-\r
- cout << rev << endl;\r
- }\r
- else\r
- {\r
- cout << "0" << endl;\r
- }\r
- return(0);\r
-}\r
--- /dev/null
+add_executable (pak_decompress pak_decompress.cpp)
+
+target_link_libraries (pak_decompress ${ZLIB_LIBRARY})
+++ /dev/null
-CC=gcc
-CXX=g++
-CFLAGS=-pedantic -Wall
-CXX_FLAGS=$(CFLAGS)
-
-SOURCES=$(wildcard *.cpp)
-OBJECTS=$(patsubst %.cpp,%.o,$(SOURCES))
-
-%.o:%.cpp
- $(CXX) $(CXX_FLAGS) -c $< -o $@
-
-all: pak_decompress
-
-pak_decompress: $(OBJECTS)
- $(CXX) -o $@ $(OBJECTS) -lstdc++ -lz
-
-clean:
- -rm $(OBJECTS) pak_decompress
MODIFIED: 21 Dec 2006 Namikon\r
REASON: - Added errorcheck for in/output file\r
- Added check for NC and normal zLib files\r
+ MODIFIED: 15 Jun 2009 Akiko\r
+ REASON: - fixed warning\r
\r
TODO: - time needed for decompression\r
- ideas for a compression tool\r
*/\r
\r
-\r
-#include <stdio.h>\r
-#include <fstream>\r
#include <iostream>\r
+#include <fstream>\r
+#include <cstdio>\r
+#include <cstring>\r
+#include <cassert>\r
#include <zlib.h>\r
-#include <assert.h>\r
-#include <string.h>\r
\r
#define CHUNK 262144\r
\r
-using namespace std;\r
-\r
int inf(FILE *source, FILE *dest, bool details)\r
{\r
int ret;\r
check = fgetc(source);\r
if(check == 'x')\r
{\r
- if(details == true) cout << "Found zLibfile" << endl;\r
+ if(details == true) std::cout << "Found zLibfile" << std::endl;\r
fseek(source, 0, SEEK_SET);\r
}\r
else\r
check = fgetc(source);\r
if(check == 'x')\r
{\r
- if(details == true) cout << "Found Neocron file" << endl;\r
+ if(details == true) std::cout << "Found Neocron file" << std::endl;\r
fseek(source, 16, SEEK_SET);\r
}\r
else\r
{\r
- if(details == true) cout << "Error: No compatible file!" << endl;\r
+ if(details == true) std::cout << "Error: No compatible file!" << std::endl;\r
return -3;\r
}\r
}\r
int ret;\r
long inSize;\r
long outSize;\r
- bool details;\r
+ bool details = false;\r
FILE *inFile;\r
FILE *outFile;\r
std::string src;\r
dst = argv[2];\r
}\r
else {\r
- cout << "Usage: pak_decompress source <dest != source> <detailedoutput 1/0>" << std::endl;\r
+ std::cout << "Usage: pak_decompress source <dest != source> <detailedoutput 1/0>" << std::endl;\r
return(0);\r
}\r
if(argc == 4)\r
if(argv[3][0] == '1') details = true;\r
else if(argv[3][0] == '0') details = false;\r
}\r
- else\r
- details = false;\r
\r
inFile = fopen(src.c_str(), "rb");\r
outFile = fopen(dst.c_str(), "wb");\r
\r
if(inFile == NULL)\r
{\r
- cout << "Cannot open InFile" << endl;\r
+ std::cout << "Cannot open InFile" << std::endl;\r
return(-1);\r
}\r
if(outFile == NULL)\r
{\r
- cout << "Cannot open OutFile" << endl;\r
+ std::cout << "Cannot open OutFile" << std::endl;\r
return(-2);\r
}\r
ret = inf(inFile, outFile, details);\r
\r
if(ret == Z_OK && details == true)\r
{\r
- cout << "bytes read: " << inSize << std::endl;\r
- cout << "bytes written: " << outSize << std::endl;\r
- cout << "compression ratio: " << (100-((float)inSize/(float)outSize*100)) << "%" << std::endl;\r
+ std::cout << "bytes read: " << inSize << std::endl;\r
+ std::cout << "bytes written: " << outSize << std::endl;\r
+ std::cout << "compression ratio: " << (100-((float)inSize/(float)outSize*100)) << "%" << std::endl;\r
}\r
else if(ret == Z_OK && details == false)\r
{\r
- cout << "[OK] " << src.c_str() << endl;\r
+ std::cout << "[OK] " << src.c_str() << std::endl;\r
}\r
else if(ret != Z_OK && details == false)\r
{\r
- cout << "[ERROR] " << src.c_str() << endl;\r
+ std::cout << "[ERROR] " << src.c_str() << std::endl;\r
}\r
\r
return(ret);\r
--- /dev/null
+add_executable (vfs_viewer vfs_viewer.c)
+
+target_link_libraries (vfs_viewer ${ZLIB_LIBRARY})
+++ /dev/null
-CC=cc
-CXX=g++
-CFLAGS=-W -Wall -O2
-CXX_FLAGS=$(CFLAGS)
-
-SOURCES=$(wildcard *.c)
-OBJECTS=$(patsubst %.c,%.o,$(SOURCES))
-
-%.o:%.c
- $(CXX) $(CXX_FLAGS) -c $< -o $@
-
-all: vfs_viewer
-
-vfs_viewer: $(OBJECTS)
- $(CXX) -o $@ $(OBJECTS)
-
-clean:
- -rm $(OBJECTS) vfs_viewer