Merged swgmasters/swg-src into master

This commit is contained in:
War Machine
2015-10-20 17:29:49 -07:00
224 changed files with 125950 additions and 132941 deletions
+1
View File
@@ -21,3 +21,4 @@ Open SQL Developer and go to the cluster_list table and change the address to yo
## DMZ or Port Forwarding
Go into your router configuration area and find the DMZ setting. Enable it and point it at the LAN address of the SWG server - you may also be able to simply forward the [SWG ports](ports) to the game server instead, which would be more secure.
+1 -1
View File
@@ -8,7 +8,7 @@ We anons working on this fully support all the SWG emus out there and recognize
## Missing NPCs
As for the missing NPC's, the majority of them are in the sku.0/sys.server/compiled/game/datatables/buildouts _ws.iff files, but so far we have been unable to load them. There is a method to persist them to the database but it has been hit and miss. This method involves attaching the script working.jhaskell_test to a character and using a macro with "/yell persist_obj <oid> /sleep 2; ..." for each oid.
As for the missing NPC's, the majority of them are in the sku.0/sys.server/compiled/game/datatables/buildouts _ws.iff files, but so far we have been unable to load them. There is a method to persist them to the database but it has been hit and miss. This method is documented in the USEFUL_COMMANDS.md file.
## Contact
+3 -2
View File
@@ -9,7 +9,7 @@ Before you do anything, make sure to install sudo if it isn't already, and add y
su #and enter your root password at the prompt
apt-get install sudo
vim /etc/sudoers
visudo
Add the following line anywhere in the file, replacing "user" with your username:
@@ -17,7 +17,6 @@ Add the following line anywhere in the file, replacing "user" with your username
To save, hit the ESC key, then type wq! and hit enter. You may then exit from your root shell.
## Specifications
To run this game in any capacity, you MUST have an Oracle database server setup and configured for remote access.
@@ -55,6 +54,8 @@ Add the following to your ~/.bashrc, replacing "swg" with your database name
Using a 32 bit installation of Ubuntu or Debian Linux, clone this repo and execute the build_linux.sh script from a terminal. While building, if you haven't already, go ahead and setup the database server, as build time is quite long.
If you get errors about a CFLAG, remove the offending cflag from src/CMakeLists.txt and try again. gcc-5.2 is HIGHLY suggested, it builds a much more efficient server and supports all cflags. This is why using Debian Sid is a good option, else you can build gcc yourself or find a PPA to supply it.
## Configuration
Add preload files:
+137 -5
View File
@@ -1,3 +1,140 @@
Small blurb about command syntax:
/command
/command <argument you must specify> <>
/command [optional argument you may not need to specify] []
/command -parameter means you need to actually type -whatever -parameter
/command [TARGET] simply means it must be your current target. [TARGET]
/command <argument | argument2> means there is more than one option. Pick 1. | ARGUMENT |
#Enabling God Mode (Admin)
Note: Your localOptions.cfg file must have "adminGodToAll=1" in the [GameServer] section. Alternatively, if you would only like certain users to have access to the God Mode abilities, you can toggle that bool to 0 in localOptions and instead you will need to edit both the "qa_admin" and "us_admin" .tab files with the account username you'd like to have. Set their GodLevel to 55 for all commands and abilities, and their skill to "admin". Then compile it with the miff.exe tool. It is recommended that once you have compiled this file once, you only make future revisions with TRE Explorer as compiling the .tab document can get complex.
Once you have either globally enabled login or have enabled it for your account, login to the game and type:
/setGodMode
# Turns on God Mode
/setGodMode 50
# If you have adminGodToAll Enabled, do this instead.
/setGodMode off
# Disables the features of God Mode
# Making Admin Commands Work In Your Client
You need to edit your user.cfg file and add the following:
(Note: You only need what's under [ClientGame], the UserInterface modifications just make everything so much easier.
[ClientGame]
0fd345d9 = true
[ClientUserInterface]
debugExamine=1
debugClipboardExamine=1
allowTargetAnything=1
drawNetworkIds=1
0fd345d9 enables the admin commands in your client. Without it your client will not send the commands to the server and will return the "no such command" error.
debugExamine allows you to /examine an object and get the ObjectID, and various other information like it's template.
debugClipboardExamine makes the debug info you get from /examine get placed on your clipboard so you can paste it with Ctrl+v
allowTargetAnything enables the ability to target objects like entire structures or objects you normally cannot to fix issues.
drawNetworkIds puts the ObjectID and NetworkID above every objects name.
# Basic God Mode Commands - Teleportation
/planetWarp <planet>
# Teleports you to the specified planet/terrain.
/planetWarpTarget <planet>
# Teleports your target to the specified planet/terrain.
/teleport <x> <z> <y>
# Teleports you to the specified coordinates on the current terrain.
/teleportTo <player>
# Teleports you to the specified player anywhere in the galaxy.
/teleportTarget <x> <z> <y>
# Teleports your target to the specified coordinates on the current terrain.
/npeGoToMedicalBay
# Teleports your character to the opening medical bay instance (don't do with invulnerable on)
/npeGotoMilleniumFalcon
# Teleports your character to the opening millenium falcon instance.
/npeGoToStationGamma
# Teleports your character to Station Gamma.
/npeGoToTansariiStation
# Teleports your character to Tansarii Station.
# Basic God Mode Commands - Managing Your Character
/invulnerable
# Toggles Invulnerability - Makes your character invulnerable (removes health/action) and you appear as a NPC.
/aiIgnore
# Toggles aiIgnore - Artificial Intelligence ignore you (no aggro).
/setSpeed <speed>
# Changes the speed by which your character negotiates terrain. Recommended that you don't go higher than 5.
/getPlayerId <name>
# Returns the object ID (oid) of your character. This will be used frequently.
/object hide <oid> <bool>
# Hides your character from non God Mode characters. Set bool to 0 for visible and 1 for hidden. Make a macro for 0 and 1. It's easier.
# Basic God Mode Commands - Managing Other Characters
/getAccountInfo <player FIRST name>
# Returns various account information about the specified character including their IP Address. They must be online.
/getStationName <player FIRST name>
# Returns the username of the specified player character. Does not work if player is offline.
/getPlayerId <player FIRST name>
# Returns the object ID (oid) of the specified player character. Does not work if player is offline.
/server getCharacterInfo <oid or player FIRST name>
# Returns Station ID, and Object ID of a character, even when they are offline. Along with other info.
/freezePlayer <player FIRST name>
# Freezes the player preventing them from moving. It's like being rooted.
/unfreezePlayer <player FIRST name>
# Reverses the effects of /freezePlayer
/squelch [TARGET]
# Prevents your target from talking, using mail, spatial, or tells. Must be your TARGET (don't type TARGET)
/unsquelch [TARGET]
# Reverses the effects of /squelch
/csDisconnectPlayer <player>
# Disconnects the specified player.
/kick <player FIRST name>
# Kicks the specified player from the server and returns them to the character screen.
/findPlayer <player name or partial name with *>
# Searches the galaxy for any players with matching names.
/cityInfo
# Displays an SUI window in which you can search and manage cities across the galaxy.
/listGuilds
# Spams your chat box with information on all active guilds of the galaxy.
/credits [-target] <cash | bank> <+|- value>
# Gives you (or optionally your target) the specified (or subtracts the specified) amount of credits from/to the bank or cash.
Attach QATool:
/script attach test.qatool <your network id>
To see what QAtool can do:
/qatool
# Planet Persist
Set your localOptions.cfg to only have 1 persister thread and loadWholePlanets=1. Teleport to the planet you want to persist, attach the QATool, and as god, run
/qatool persistplanet <planetname>
Once you have persisted all planets, shutdown the server and optionally remove the data/sku.0/sys.server/compiled/game/datatables/buildout/<planetname/*_ws.iff but only the ws files. You can then restart the server, optionally turning loadWholePlanet off to make it load faster and use less memory.
# Server Shutdown
/server shutdown 1 1 1 1
# Spawn NPCs In Eisley Cantina
/script attach theme_park.tatooine.mos_eisley.masterspawner 1082874
# Testing
/setgodmode 50
@@ -22,11 +159,6 @@
/object spawn object/tangible/terminal/terminal_character_builder.iff
/object spawn heroic_echo_stormcommando
# Travel
/planetwarp +name
/planetwarp rori
# Beast Master
Isomerase- /object spawn object/tangible/loot/beast/enzyme_1.iff
File diff suppressed because it is too large Load Diff
@@ -1,126 +0,0 @@
spawns name room loc_x loc_y loc_z yaw script mood animation_mood respawn_time spawn_objvar special_room special_room_script room_objvar room_objvar_name room_objvar_value
s s s f f f f s s s i s s s s s s
object/tangible/region/deliver_region_5.iff world 83.9686 52 -5390.23 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 74.6127 52 -5382.24 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 73.2491 52 -5329.48 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 59.0963 52 -5342.29 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 59.0963 52 -5342.29 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 134.8688 52 -5333.14 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 39.6087 52 -5345.06 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 70.2339 52 -5316.54 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 114.6899 52 -5404.19 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 123.408 52 -5377.31 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 150.3829 52 -5327.33 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1283.53 12 -3559.37 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1347.58 12 -3695.99 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1311.62 12 -3674.36 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1358.9 12 -3504.1 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1464.81 12 -3561.05 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1429 12 -3628.03 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1404.76 12 -3636.5 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1320.46 12 -3633.41 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1291.57 12 -3618.78 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1226.87 12 -3628.59 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1213.04 12 -3629.94 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1279.47 12 -3584.64 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1216.2 12 -3549.61 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1200.16 12 -3631.89 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1200.97 12 -3553.44 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1174.92 12 -3635.8 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1162.65 12 -3646.5 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1145.13 12 -3507.53 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1145.53 12 -3656.31 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1157.39 12 -3666.66 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1077.51 12 -3513.92 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1095.68 12 -3640.98 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1085.53 12 -3647.54 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1076.36 12 -3657.52 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1142.24 12 -3672.51 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1066.46 12 -3668.09 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1033.88 12 -3644.68 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1047.35 12 -3665.81 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1106.31 12 -3697.59 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1068.17 12 -3690.99 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1080.55 12 -3696.41 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1060.23 12 -3704.2 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1041.87 12 -3711.58 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1039.09 12 -3723.55 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1026.76 12 -3725.49 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1010.28 12 -3728.59 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1311.62 12 -3674.36 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1347.58 12 -3695.99 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1213.04 12 -3629.94 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1226.87 12 -3628.59 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1200.16 12 -3631.89 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1396.2 10 -3773.33 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1404.76 12 -3636.5 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1320.46 12 -3633.41 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1283.53 12 -3559.37 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1291.57 12 -3618.78 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1429 12 -3628.03 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1279.47 12 -3584.64 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1200.97 12 -3553.44 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1216.2 12 -3549.61 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1174.92 12 -3635.8 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -1358.9 12 -3504.1 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 3650.147 5 -4860.75 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 3529.162 5 -4900.65 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 3513.139 4 -4725.08 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 3540.464 4 -4721.74 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 3559.5 4 -4725.87 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 3458.353 4.0308 -4890.75 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 3526.854 4.4412 -4700.74 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 3563.185 5 -4946.05 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 3379.184 5 -4898.03 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 3496.192 5 -4993.49 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 3364.033 4 -4830.19 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 3422.759 4.996 -4981.25 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 3507.534 5 -5002.63 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 3499.602 5 -5019.9 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 1184.744 7 3106.088 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 1288.864 7 3208.826 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 1389.058 7.5 3162.262 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 1337.266 7 3035.448 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 1342.732 7 3038.586 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 1334.272 7 3040.59 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 1312.961 7 3028.244 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 1332.875 7 3031.912 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 1340.324 7 3068.228 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 1378.896 7 3087.881 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 1294.554 7 3002.802 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 1391.317 7.5 3202.543 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 1169.397 7 3063.847 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 1420.156 7 3089.986 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 1448.696 7 3183.321 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 1450.082 7 3202.922 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 1449.891 7 3138.002 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 1495.581 7 3177.878 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 1448.177 7 2974.111 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 1516.085 7 3164.732 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 1752.626 7 3163.329 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 1609.529 10.9973 3163.55 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 1636.624 7 3124.107 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 1639.177 7 3070.966 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 1619.539 11 3228.906 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 1723.471 7 3130.733 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 3.29 1.1331 -9.58 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 1615.169 7 3313.631 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 1556.48 7 3324.919 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 1302.377 7 3357.338 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -5120.75 75 -6594.69 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -5128.78 75 -6542.42 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -5095.19 75 -6527.76 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -5260.24 75 -6510.64 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -5249.25 75 -6516.55 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -5251.85 75 -6499.93 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -5213.66 75 -6474.22 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -5277.28 75 -6558.48 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -5219.65 75 -6548.3 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -5217.62 75 -6578.64 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -5193.47 75 -6490.09 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world -5176.26 75 -6611.98 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 3857.4 27 2342.4 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 3806 14.1 2359.5 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 3951 54.4 2283.4 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 3779.532 0 2363.1213 systems.missions.dynamic.deliver_npc_spawner
object/tangible/region/deliver_region_5.iff world 3780.4395 0 2363.0085 systems.missions.dynamic.deliver_npc_spawner
@@ -1,33 +0,0 @@
// Filename: construction_player_tcg_relaxation_pool
// Directory: object/building/player/construction
//
// Description:
//
//
// Notes:
//
//
@base object/installation/base/installation_base.iff
@class installation_object_template 0
@class tangible_object_template 0
@class object_template 2
sharedTemplate = "object/building/player/construction/shared_construction_player_tcg_relaxation_pool.iff"
tintIndex = 0
invulnerable = true
maxDecayPoints = 0
currentDecayPoints = 0
// list, of type string
scripts = +[
"structure.temporary_structure" ]
@@ -1,29 +0,0 @@
// Directory: object/tangible/deed/player_house_deed
//
// Description:
//
// Notes:
//
//
// Category: Null
// Sub-Category: Null
// Classification: Null
//
@base object/tangible/deed/base/base_deed.iff
@class tangible_object_template 0
@class object_template 7
sharedTemplate = "object/tangible/deed/player_house_deed/shared_corellia_house_small_style_02_floor_02_deed.iff"
objvars = +[
"player_structure.deed.template" = "object/building/player/player_house_corellia_small_style_02_floorplan_02.iff",
"player_structure.deed.buildtime" = 90,
"player_structure.deed.scene" = "corellia,talus"]
scripts = +[
"item.structure_deed.player_structure_deed"]
@@ -1,29 +0,0 @@
// Directory: object/tangible/deed/player_house_deed
//
// Description:
//
// Notes:
//
//
// Category: Null
// Sub-Category: Null
// Classification: Null
//
@base object/tangible/deed/base/base_deed.iff
@class tangible_object_template 0
@class object_template 7
sharedTemplate = "object/tangible/deed/player_house_deed/shared_item_tcg_loot_reward_series8_bespin_house_deed.iff"
objvars = +[
"player_structure.deed.template" = "object/building/player/player_house_tcg_8_bespin_house.iff",
"player_structure.deed.buildtime" = 90,
"player_structure.deed.scene" = "corellia,talus"]
scripts = +[
"item.structure_deed.player_structure_deed"]
@@ -1,9 +0,0 @@
@base object/tangible/deed/base/base_deed.iff
@class tangible_object_template 0
@class object_template 7
sharedTemplate = "object/tangible/tcg/series1/shared_structure_deed_barn.iff"
@@ -1,9 +0,0 @@
@base object/tangible/deed/base/base_deed.iff
@class tangible_object_template 0
@class object_template 7
sharedTemplate = "object/tangible/tcg/series1/shared_structure_deed_barn.iff"
@@ -1,59 +0,0 @@
package script.spawning.tatooine.mos_eisley;
import script.*;
import script.base_class.*;
import script.combat_engine.*;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector;
import script.base_script;
import script.library.create;
import script.library.ai_lib;
import script.library.performance;
public class mos_eisley_mayor_building extends script.base_script
{
public mos_eisley_mayor_building()
{
}
public int OnInitialize(obj_id self) throws InterruptedException
{
debugServerConsoleMsg(self, "Initialized Mos Eisley Mayor Building Spawner Script");
dictionary params = new dictionary();
messageTo(self, "spawnThings", null, 1, true);
return SCRIPT_CONTINUE;
}
public void spawnEveryone(obj_id self) throws InterruptedException
{
spawnMayor(self);
spawnNewbiePilotHelper(self);
return;
}
public void spawnMayor(obj_id self) throws InterruptedException
{
obj_id room = getCellId(self, "mainroom");
location mayor_loc = new location(0.1f, 2.5f, 7.5f, "tatooine", room);
int mayor_yaw = 180;
obj_id mayor = create.object("mos_eisley_mayor", mayor_loc);
setYaw(mayor, mayor_yaw);
setCreatureStatic(mayor, true);
attachScript(mayor, "conversation.mos_eisley_mayor");
return;
}
public void spawnNewbiePilotHelper(obj_id self) throws InterruptedException
{
obj_id room = getCellId(self, "mainroom");
location pilot_loc = new location(-1.9f, 1.1f, -5.7f, "tatooine", room);
int pilot_yaw = 2;
obj_id pilot = create.object("newbie_pilot_informer", pilot_loc);
setYaw(pilot, pilot_yaw);
setCreatureStatic(pilot, true);
return;
}
public int spawnThings(obj_id self, dictionary params) throws InterruptedException
{
spawnEveryone(self);
return SCRIPT_CONTINUE;
}
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -1,40 +0,0 @@
// Filename:
// Directory: object/building/player/temp_struct
//
// Description:
//
//
// Notes:
//
//
// Category: Null
// Sub-Category: Null
// Classification: Null
//
@base object/tangible/base/shared_tangible_craftable.iff
@class installation_object_template 0
@class tangible_object_template 5
structureFootprintFileName = "footprint/building/player/shared_player_house_tcg_rebel_spire.sfp"
useStructureFootprintOutline = true
targetable = true
@class object_template 6
clearFloraRadius = 15
objectName = "player_structure" "temporary_structure"
detailedDescription = "" ""
lookAtText = "player_structure" "temporary_structure"
snapToTerrain = true
containerType = CT_none
appearanceFilename = "appearance\ply_all_construction_sign.apt"
portalLayoutFilename = ""
gameObjectType = GOT_installation_factory
@@ -1,40 +0,0 @@
// Filename: shared_construction_player_tcg_relaxation_pool.tpf
// Directory: object/building/player/temp_struct
//
// Description:
//
//
// Notes:
//
//
// Category: Null
// Sub-Category: Null
// Classification: Null
//
@base object/tangible/base/shared_tangible_craftable.iff
@class installation_object_template 0
@class tangible_object_template 5
structureFootprintFileName = "footprint/building/player/shared_player_house_tcg_bespin_house.sfp"
useStructureFootprintOutline = true
targetable = true
@class object_template 6
clearFloraRadius = 15
objectName = "player_structure" "temporary_structure"
detailedDescription = "" ""
lookAtText = "player_structure" "temporary_structure"
snapToTerrain = true
containerType = CT_none
appearanceFilename = "appearance\ply_all_construction_sign.apt"
portalLayoutFilename = ""
gameObjectType = GOT_installation_factory
@@ -1,24 +0,0 @@
// This file ws written by the template editor @ 12:13:13 PM - Wed Sep 25 2002
@base object/building/base/shared_base_player_building.iff
@class building_object_template 0
@class tangible_object_template 4
structureFootprintFileName = "footprint/building/player/shared_player_house_atat.sfp"
@class object_template 6
clearFloraRadius = 38
objectName = "player_structure" "player_house_atat_n"
detailedDescription = "player_structure" "player_house_atat_d"
appearanceFilename = ""
portalLayoutFilename = "appearance/ply_all_atat_house.pob"
clientDataFile = "clientdata/building/shared_player_house_atat.cdf"
//noBuildRadius = 48
@@ -1,12 +0,0 @@
@base object/tangible/deed/base/shared_deed_building_base.iff
@class tangible_object_template 6
@class object_template 5
objectName = "deed" "item_tcg_loot_reward_series8_bespin_house_deed"
detailedDescription = "deed_detail" "item_tcg_loot_reward_series8_bespin_house_deed"
appearanceFilename = "appearance/eqp_tool_datapad.apt"
@@ -1,12 +0,0 @@
@base object/tangible/deed/base/shared_deed_building_base.iff
@class tangible_object_template 6
@class object_template 5
objectName = "deed" "generic_house_large_window_s01_deed"
detailedDescription = "deed_detail" "generic_house_large_window_s01_deed"
appearanceFilename = "appearance/eqp_tool_datapad.apt"
+3 -4
View File
@@ -48,10 +48,9 @@ if(WIN32)
elseif(UNIX)
find_package(Curses REQUIRED)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG -DDEBUG_LEVEL=2 -DPRODUCTION=0 -g -pipe -Wall -Wno-unknown-pragmas -Wno-reorder -O0")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DDEBUG_LEVEL=0 -DPRODUCTION=1 -march=native -pipe -mtune=native -O2 -s")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-write-strings")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG -DDEBUG_LEVEL=2 -DPRODUCTION=0 -g -pipe -O0 -Wall -Wno-overloaded-virtual -Wno-missing-braces -Wno-unused-private-field -Wno-format -Wno-unused-but-set-variable -Wno-write-strings -Wno-unknown-pragmas -Wno-uninitialized -Wno-reorder -Wno-unused-const-variable -Wno-unknown-warning-option")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DDEBUG_LEVEL=0 -DPRODUCTION=1 -march=native -pipe -mtune=native -O2 -Wno-overloaded-virtual -Wno-missing-braces -Wno-unused-private-field -Wno-format -Wno-unused-but-set-variable -Wno-write-strings -Wno-unknown-pragmas -Wno-uninitialized -Wno-reorder -Wno-unused-const-variable -Wno-unknown-warning-option")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -D_GLIBCXX_USE_CXX11_ABI=0")
add_definitions(-DLINUX -D_REENTRANT -Dlinux -D_USING_STL -D__STL_NO_BAD_ALLOC -D_GNU_SOURCE -D_XOPEN_SOURCE=500)
endif()
+6
View File
@@ -34,6 +34,12 @@ if(DEFINED ENV{ORACLE_HOME})
find_path(ORACLE_INCLUDE_DIR
NAMES oci.h
PATHS
/usr/include/oracle/12.1/client64
/usr/include/oracle/12.1/client
/usr/lib/oracle/12.1/client64
/usr/share/oracle/12.1/client64
/usr/lib/oracle/12.1/client
/usr/share/oracle/12.1/client
${ORACLE_HOME}/rdbms/public
${ORACLE_HOME}/include
${ORACLE_HOME}/sdk/include # Oracle SDK
@@ -4520,7 +4520,7 @@ static void yy_flex_strncpy (char *,yyconst char *,int );
#endif
#ifdef YY_NEED_STRLEN
static int yy_flex_strlen (yyconst char * );
static int yy_flex_strnlen (yyconst char * );
#endif
#ifndef YY_NO_INPUT
@@ -4726,9 +4726,9 @@ YY_RULE_SETUP
char *s; // allocate space for string and pass the string pointer rather then yytext
count();
s = MIFFallocString(strlen(yytext) + 1);
s = MIFFallocString(strnlen(yytext) + 1);
strcpy(s, yytext+1); /* strip off the double quotes */
s[strlen(yytext+1)-1] = 0; /* strip off the ending double quotes */
s[strnlen(yytext+1)-1] = 0; /* strip off the ending double quotes */
yylval.stype = s;
return(STR_LIT);
}
@@ -4977,7 +4977,7 @@ YY_RULE_SETUP
char *s; // allocate space for string and pass the string pointer rather then yytext
count();
s = MIFFallocString(strlen(yytext) + 1);
s = MIFFallocString(strnlen(yytext) + 1);
strcpy(s, yytext);
yylval.stype = s;
return(IDENTIFIER);
@@ -5915,7 +5915,7 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
{
return yy_scan_bytes(yystr,strlen(yystr) );
return yy_scan_bytes(yystr,strnlen(yystr) );
}
/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
@@ -6126,7 +6126,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
#endif
#ifdef YY_NEED_STRLEN
static int yy_flex_strlen (yyconst char * s )
static int yy_flex_strnlen (yyconst char * s )
{
register int n;
for ( n = 0; s[n]; ++n )
@@ -6219,7 +6219,7 @@ void yyerror(char *err) /* called by yyparse() */
**-------------------------*/
int MIFFYYInput(char *buf,int max_size)
{
int len = strlen(MIFFInputStream);
int len = strnlen(MIFFInputStream);
int n = max_size < len ? max_size : len;
if (n > 0)
{
@@ -39,7 +39,7 @@ int yyparse();
int MIFFYYInput(char *buf,int max_size);
void initParser(void);
void count(void);
void yyerror(char *err);
int yyerror(char *err);
void open_brace(void);
void close_brace(void);
int count_brace(void);
@@ -374,7 +374,7 @@ void initParser(void)
/*-------------------------------------------------**
** generate a dialog box to MFC to report an error **
**-------------------------------------------------*/
void yyerror(char *err) /* called by yyparse() */
int yyerror(char *err) /* called by yyparse() */
{
char myString[256];
@@ -387,7 +387,7 @@ void yyerror(char *err) /* called by yyparse() */
MIFFSetError(); /* set global error flag for shell as well */
yyterminate();
}
return 0;
}
/*-------------------------**
@@ -27,7 +27,7 @@
#include <string.h>
#include <stdlib.h> /* for toupper() */
#include <wchar.h> /* for wide character (16bit) strings */
#include <ctype.h> /* for strtoupper and strtolower */
#include <stdio.h>
/*----------------------------------------------------------------**
@@ -823,7 +823,7 @@ void parseESCstring(char *str, char *targetBuffer, int sizeOfTarget)
sPtr++;
if (numIndex > 3)
{
sprintf(err_msg, "Escape sequence Octal numbers greater then\noctal o400 (256 decimal)! [more then 3 digits]", *sPtr);
sprintf(err_msg, "Escape sequence Octal numbers greater then\noctal o400 (256 decimal)! [more then 3 digits]");
yyerror(err_msg);
exitParser = 1;
}
@@ -841,7 +841,7 @@ void parseESCstring(char *str, char *targetBuffer, int sizeOfTarget)
if (tempNum > 255)
{
sprintf(err_msg, "Escape sequence Octal numbers greater then\noctal o400 (256 decimal)!", tempNum);
sprintf(err_msg, "Escape sequence Octal numbers greater then\noctal o400 (256 decimal)!");
yyerror(err_msg);
exitParser = 1;
}
@@ -865,7 +865,7 @@ void parseESCstring(char *str, char *targetBuffer, int sizeOfTarget)
sPtr++;
if (numIndex > 3)
{
sprintf(err_msg, "Escape sequence HEX numbers greater then 0x100\n(256 decimal)! [more then 3 digits]", *sPtr);
sprintf(err_msg, "Escape sequence HEX numbers greater then 0x100\n(256 decimal)! [more then 3 digits]");
yyerror(err_msg);
exitParser = 1;
}
@@ -883,7 +883,7 @@ void parseESCstring(char *str, char *targetBuffer, int sizeOfTarget)
if (tempNum > 255)
{
sprintf(err_msg, "Escape sequence HEX numbers greater then 0x100\n(256 decimal)!", *sPtr);
sprintf(err_msg, "Escape sequence HEX numbers greater then 0x100\n(256 decimal)!");
yyerror(err_msg);
exitParser = 1;
}
@@ -985,7 +985,7 @@ void addEnumSymbol(char *symString, long value)
if (MAX_SYMCHARS < strlen(symString))
{
/* somebody insane decided to use variable longer then max size! */
sprintf(err_msg, "%s is longer then %d characters! [value: %d]", symString, MAX_SYMCHARS, value);
sprintf(err_msg, "%s is longer then %d characters! [value: %ld]", symString, MAX_SYMCHARS, value);
yyerror(err_msg);
}
else
File diff suppressed because it is too large Load Diff
+18 -18
View File
@@ -1,18 +1,18 @@
add_subdirectory(CentralServer)
add_subdirectory(ChatServer)
add_subdirectory(ConnectionServer)
add_subdirectory(LogServer)
add_subdirectory(LoginServer)
add_subdirectory(MetricsServer)
add_subdirectory(PlanetServer)
add_subdirectory(ServerConsole)
add_subdirectory(TaskManager)
add_subdirectory(TransferServer)
add_subdirectory(CommoditiesServer)
if(NOT WIN32)
add_subdirectory(CustomerServiceServer)
add_subdirectory(LoginPing)
add_subdirectory(StationPlayersCollector)
endif()
add_subdirectory(CentralServer)
add_subdirectory(ChatServer)
add_subdirectory(ConnectionServer)
add_subdirectory(LogServer)
add_subdirectory(LoginServer)
add_subdirectory(MetricsServer)
add_subdirectory(PlanetServer)
add_subdirectory(ServerConsole)
add_subdirectory(TaskManager)
add_subdirectory(TransferServer)
add_subdirectory(CommoditiesServer)
if(NOT WIN32)
add_subdirectory(CustomerServiceServer)
add_subdirectory(LoginPing)
add_subdirectory(StationPlayersCollector)
endif()
@@ -1,194 +1,194 @@
#include "AuctionTransferAPI.h"
#include "AuctionTransferAPICore.h"
#include "Request.h"
#include "Response.h"
#include "zip/GZipHelper.h"
#define DEFAULT_HOST "localhost"
#define DEFAULT_PORT 5901
#define DEFAULT_IDENTIFIER "GAME+UNKNOWN"
//////////////////////////////////////////////////////////////////////////////////////
namespace AuctionTransfer
{
//////////////////////////////////////////////////////////////////////////////////////
AuctionTransferAPI::AuctionTransferAPI(const char *hostName[], const short port[], int count, const char *identifier[], unsigned identifierCount, unsigned reqTimeout, unsigned maxRecvMessageSizeInKB)
{
m_apiCore = new AuctionTransferAPICore(hostName, port, count, this, identifier, identifierCount, reqTimeout, maxRecvMessageSizeInKB);
}
//////////////////////////////////////////////////////////////////////////////////////
AuctionTransferAPI::AuctionTransferAPI(const char *hostNames, const char *identifiers)
{
std::vector<const char *> hostArray;
std::vector<const char *> identifierArray;
std::vector<short> portArray;
char hostConfig[4096];
char identifierConfig[4096];
if (hostNames == NULL)
hostNames = DEFAULT_HOST;
if(identifiers == NULL)
identifiers = DEFAULT_IDENTIFIER;
// parse the hosts and ports out :
strncpy(hostConfig, hostNames, 4096); hostConfig[4095] = 0;
char *ptr;
if ((ptr = strtok(hostConfig, " ")) != 0)
{
do
{
char * host = ptr;
char * portStr = strchr(host, ':');
unsigned short port = DEFAULT_PORT;
if (portStr)
{
*portStr++ = 0;
port = (short)atoi(portStr);
}
if (::strlen(host) && port)
{
hostArray.push_back(host);
portArray.push_back(port);
}
}
while ((ptr = strtok(NULL, " ")) != NULL);
}
strncpy(identifierConfig, identifiers, 4096); identifierConfig[4095] = 0;
// parse the identifiers out
if ((ptr = strtok(identifierConfig, ";")) != 0)
{
do
{
char * identifier = ptr;
if (::strlen(identifier))
{
identifierArray.push_back(identifier);
}
}
while ((ptr = strtok(NULL, ";")) != NULL);
}
if (hostArray.empty())
{
hostArray.push_back(DEFAULT_HOST);
portArray.push_back(DEFAULT_PORT);
}
if(identifierArray.empty())
identifierArray.push_back(DEFAULT_IDENTIFIER);
m_apiCore = new AuctionTransferAPICore(&hostArray[0], &portArray[0], hostArray.size(), this, &identifierArray[0], identifierArray.size());
}
//////////////////////////////////////////////////////////////////////////////////////
AuctionTransferAPI::~AuctionTransferAPI()
{
if( m_apiCore)
delete m_apiCore;
}
//////////////////////////////////////////////////////////////////////////////////////
void AuctionTransferAPI::process()
{
m_apiCore->process();
}
//////////////////////////////////////////////////////////////////////////////////////
// Calls and replies
//////////////////////////////////////////////////////////////////////////////////////
unsigned AuctionTransferAPI::replyReceiveAbortTransaction(unsigned trackingNumber, unsigned responseCode, void *user)
{
ReplyRequest *req = new ReplyRequest( GAME_REPLY_RECEIVE_ABORT, trackingNumber, responseCode );
return m_apiCore->submitRequest( req, new CommonResponse( GAME_REPLY_RECEIVE_ABORT, user ));
}
//////////////////////////////////////////////////////////////////////////////////////
unsigned AuctionTransferAPI::replyReceiveCommitTransaction(unsigned trackingNumber, unsigned responseCode, void *user)
{
ReplyRequest *req = new ReplyRequest( GAME_REPLY_RECEIVE_COMMIT, trackingNumber, responseCode );
return m_apiCore->submitRequest( req, new CommonResponse( GAME_REPLY_RECEIVE_COMMIT, user ));
}
//////////////////////////////////////////////////////////////////////////////////////
unsigned AuctionTransferAPI::replyReceivePrepareTransaction(unsigned trackingNumber, unsigned responseCode, void *user)
{
ReplyRequest *req = new ReplyRequest( GAME_REPLY_RECEIVE_PREPARE_TRANSACTION, trackingNumber, responseCode );
return m_apiCore->submitRequest( req, new CommonResponse( GAME_REPLY_RECEIVE_PREPARE_TRANSACTION, user ));
}
//////////////////////////////////////////////////////////////////////////////////////
unsigned AuctionTransferAPI::sendAbortTransaction(long long transactionID, void *user)
{
CommonRequest *req = new CommonRequest( GAME_REQUEST_SEND_ABORT, 0, transactionID );
return m_apiCore->submitRequest( req, new CommonResponse( GAME_REQUEST_SEND_ABORT, user ));
}
//////////////////////////////////////////////////////////////////////////////////////
unsigned AuctionTransferAPI::sendCommitTransaction(long long transactionID, void *user)
{
CommonRequest *req = new CommonRequest( GAME_REQUEST_SEND_COMMIT, 0, transactionID );
return m_apiCore->submitRequest( req, new CommonResponse( GAME_REQUEST_SEND_COMMIT, user ));
}
//////////////////////////////////////////////////////////////////////////////////////
unsigned AuctionTransferAPI::sendPrepareTransaction(const char *serverIdentifier, long long transactionID, unsigned stationID, unsigned characterID, long long assetID, const char *xmlAsset, void *user, bool compress)
{
RequestTypes requestEnum = GAME_REQUEST_SEND_PREPARE_TRANSACTION;
GenericRequest *req = NULL;
if( compress )
{
requestEnum = GAME_REQUEST_SEND_PREPARE_TRANSACTION_COMPRESSED;
// compress and create the request here
char *data = (char *)xmlAsset;
CA2GZIP zippedData(data, strlen(xmlAsset));
req = new SendPrepareCompressedRequest( requestEnum, 0, serverIdentifier, transactionID, stationID, characterID, assetID, zippedData.pgzip, zippedData.Length );
}
else
{
req = new SendPrepareRequest( requestEnum, 0, serverIdentifier, transactionID, stationID, characterID, assetID, xmlAsset );
}
return m_apiCore->submitRequest( req, new CommonResponse( requestEnum, user ));
}
//////////////////////////////////////////////////////////////////////////////////////
unsigned AuctionTransferAPI::sendPrepareTransactionCompressed (const char *serverIdentifier, long long transactionID, unsigned stationID, unsigned characterID, long long assetID, const unsigned char *zippedXmlAsset, unsigned length, void *user)
{
SendPrepareCompressedRequest *req = new SendPrepareCompressedRequest( GAME_REQUEST_SEND_PREPARE_TRANSACTION_COMPRESSED, 0, serverIdentifier, transactionID, stationID, characterID, assetID, zippedXmlAsset, length );
return m_apiCore->submitRequest( req, new CommonResponse( GAME_REQUEST_SEND_PREPARE_TRANSACTION_COMPRESSED, user ));
}
//////////////////////////////////////////////////////////////////////////////////////
unsigned AuctionTransferAPI::replyReceiveGetCharacterList(unsigned trackingNumber, unsigned responseCode, const Character characters[], unsigned numCharacters, void *user)
{
ReplyGetCharacterListRequest *req = new ReplyGetCharacterListRequest(GAME_REPLY_RECEIVE_GET_CHARACTER_LIST, trackingNumber, responseCode, characters, numCharacters);
return m_apiCore->submitRequest(req, new CommonResponse(GAME_REPLY_RECEIVE_GET_CHARACTER_LIST, user));
}
//////////////////////////////////////////////////////////////////////////////////////
unsigned AuctionTransferAPI::identifyHost( const char *serverID[], unsigned idCount, void *user)
{
IdentifyServerRequest *req = new IdentifyServerRequest(REQUEST_SET_SERVER_LIST, 0, serverID, idCount);
return m_apiCore->submitRequest( req, new CommonResponse(REQUEST_SET_SERVER_LIST, user));
}
//////////////////////////////////////////////////////////////////////////////////////
unsigned AuctionTransferAPI::sendAuditAssetTransfer(const char *gameCode, const char *serverCode, long long inGameAssetID, unsigned stationID, const char *event, const char *message, void *user)
{
SendAuditRequest *req = new SendAuditRequest( GAME_SEND_AUDIT_MESSAGE, 0, gameCode, serverCode, inGameAssetID, stationID, event, message );
return m_apiCore->submitRequest(req, new CommonResponse(GAME_SEND_AUDIT_MESSAGE, user));
}
//////////////////////////////////////////////////////////////////////////////////////
unsigned AuctionTransferAPI::getNewTransactionID(void *user)
{
GetIDRequest *req = new GetIDRequest( GAME_REQUEST_GET_TRANSACTION_ID, 0);
return m_apiCore->submitRequest(req, new GetIDResponse( GAME_REQUEST_GET_TRANSACTION_ID, user));
}
}; // namespace
//////////////////////////////////////////////////////////////////////////////////////
#include "AuctionTransferAPI.h"
#include "AuctionTransferAPICore.h"
#include "Request.h"
#include "Response.h"
#include "zip/GZipHelper.h"
#define DEFAULT_HOST "localhost"
#define DEFAULT_PORT 5901
#define DEFAULT_IDENTIFIER "GAME+UNKNOWN"
//////////////////////////////////////////////////////////////////////////////////////
namespace AuctionTransfer
{
//////////////////////////////////////////////////////////////////////////////////////
AuctionTransferAPI::AuctionTransferAPI(const char *hostName[], const short port[], int count, const char *identifier[], unsigned identifierCount, unsigned reqTimeout, unsigned maxRecvMessageSizeInKB)
{
m_apiCore = new AuctionTransferAPICore(hostName, port, count, this, identifier, identifierCount, reqTimeout, maxRecvMessageSizeInKB);
}
//////////////////////////////////////////////////////////////////////////////////////
AuctionTransferAPI::AuctionTransferAPI(const char *hostNames, const char *identifiers)
{
std::vector<const char *> hostArray;
std::vector<const char *> identifierArray;
std::vector<short> portArray;
char hostConfig[4096];
char identifierConfig[4096];
if (hostNames == NULL)
hostNames = DEFAULT_HOST;
if(identifiers == NULL)
identifiers = DEFAULT_IDENTIFIER;
// parse the hosts and ports out :
strncpy(hostConfig, hostNames, 4096); hostConfig[4095] = 0;
char *ptr;
if ((ptr = strtok(hostConfig, " ")) != 0)
{
do
{
char * host = ptr;
char * portStr = strchr(host, ':');
unsigned short port = DEFAULT_PORT;
if (portStr)
{
*portStr++ = 0;
port = (short)atoi(portStr);
}
if (::strlen(host) && port)
{
hostArray.push_back(host);
portArray.push_back(port);
}
}
while ((ptr = strtok(NULL, " ")) != NULL);
}
strncpy(identifierConfig, identifiers, 4096); identifierConfig[4095] = 0;
// parse the identifiers out
if ((ptr = strtok(identifierConfig, ";")) != 0)
{
do
{
char * identifier = ptr;
if (::strlen(identifier))
{
identifierArray.push_back(identifier);
}
}
while ((ptr = strtok(NULL, ";")) != NULL);
}
if (hostArray.empty())
{
hostArray.push_back(DEFAULT_HOST);
portArray.push_back(DEFAULT_PORT);
}
if(identifierArray.empty())
identifierArray.push_back(DEFAULT_IDENTIFIER);
m_apiCore = new AuctionTransferAPICore(&hostArray[0], &portArray[0], hostArray.size(), this, &identifierArray[0], identifierArray.size());
}
//////////////////////////////////////////////////////////////////////////////////////
AuctionTransferAPI::~AuctionTransferAPI()
{
if( m_apiCore)
delete m_apiCore;
}
//////////////////////////////////////////////////////////////////////////////////////
void AuctionTransferAPI::process()
{
m_apiCore->process();
}
//////////////////////////////////////////////////////////////////////////////////////
// Calls and replies
//////////////////////////////////////////////////////////////////////////////////////
unsigned AuctionTransferAPI::replyReceiveAbortTransaction(unsigned trackingNumber, unsigned responseCode, void *user)
{
ReplyRequest *req = new ReplyRequest( GAME_REPLY_RECEIVE_ABORT, trackingNumber, responseCode );
return m_apiCore->submitRequest( req, new CommonResponse( GAME_REPLY_RECEIVE_ABORT, user ));
}
//////////////////////////////////////////////////////////////////////////////////////
unsigned AuctionTransferAPI::replyReceiveCommitTransaction(unsigned trackingNumber, unsigned responseCode, void *user)
{
ReplyRequest *req = new ReplyRequest( GAME_REPLY_RECEIVE_COMMIT, trackingNumber, responseCode );
return m_apiCore->submitRequest( req, new CommonResponse( GAME_REPLY_RECEIVE_COMMIT, user ));
}
//////////////////////////////////////////////////////////////////////////////////////
unsigned AuctionTransferAPI::replyReceivePrepareTransaction(unsigned trackingNumber, unsigned responseCode, void *user)
{
ReplyRequest *req = new ReplyRequest( GAME_REPLY_RECEIVE_PREPARE_TRANSACTION, trackingNumber, responseCode );
return m_apiCore->submitRequest( req, new CommonResponse( GAME_REPLY_RECEIVE_PREPARE_TRANSACTION, user ));
}
//////////////////////////////////////////////////////////////////////////////////////
unsigned AuctionTransferAPI::sendAbortTransaction(long long transactionID, void *user)
{
CommonRequest *req = new CommonRequest( GAME_REQUEST_SEND_ABORT, 0, transactionID );
return m_apiCore->submitRequest( req, new CommonResponse( GAME_REQUEST_SEND_ABORT, user ));
}
//////////////////////////////////////////////////////////////////////////////////////
unsigned AuctionTransferAPI::sendCommitTransaction(long long transactionID, void *user)
{
CommonRequest *req = new CommonRequest( GAME_REQUEST_SEND_COMMIT, 0, transactionID );
return m_apiCore->submitRequest( req, new CommonResponse( GAME_REQUEST_SEND_COMMIT, user ));
}
//////////////////////////////////////////////////////////////////////////////////////
unsigned AuctionTransferAPI::sendPrepareTransaction(const char *serverIdentifier, long long transactionID, unsigned stationID, unsigned characterID, long long assetID, const char *xmlAsset, void *user, bool compress)
{
RequestTypes requestEnum = GAME_REQUEST_SEND_PREPARE_TRANSACTION;
GenericRequest *req = NULL;
if( compress )
{
requestEnum = GAME_REQUEST_SEND_PREPARE_TRANSACTION_COMPRESSED;
// compress and create the request here
char *data = (char *)xmlAsset;
CA2GZIP zippedData(data, strlen(xmlAsset));
req = new SendPrepareCompressedRequest( requestEnum, 0, serverIdentifier, transactionID, stationID, characterID, assetID, zippedData.pgzip, zippedData.Length );
}
else
{
req = new SendPrepareRequest( requestEnum, 0, serverIdentifier, transactionID, stationID, characterID, assetID, xmlAsset );
}
return m_apiCore->submitRequest( req, new CommonResponse( requestEnum, user ));
}
//////////////////////////////////////////////////////////////////////////////////////
unsigned AuctionTransferAPI::sendPrepareTransactionCompressed (const char *serverIdentifier, long long transactionID, unsigned stationID, unsigned characterID, long long assetID, const unsigned char *zippedXmlAsset, unsigned length, void *user)
{
SendPrepareCompressedRequest *req = new SendPrepareCompressedRequest( GAME_REQUEST_SEND_PREPARE_TRANSACTION_COMPRESSED, 0, serverIdentifier, transactionID, stationID, characterID, assetID, zippedXmlAsset, length );
return m_apiCore->submitRequest( req, new CommonResponse( GAME_REQUEST_SEND_PREPARE_TRANSACTION_COMPRESSED, user ));
}
//////////////////////////////////////////////////////////////////////////////////////
unsigned AuctionTransferAPI::replyReceiveGetCharacterList(unsigned trackingNumber, unsigned responseCode, const Character characters[], unsigned numCharacters, void *user)
{
ReplyGetCharacterListRequest *req = new ReplyGetCharacterListRequest(GAME_REPLY_RECEIVE_GET_CHARACTER_LIST, trackingNumber, responseCode, characters, numCharacters);
return m_apiCore->submitRequest(req, new CommonResponse(GAME_REPLY_RECEIVE_GET_CHARACTER_LIST, user));
}
//////////////////////////////////////////////////////////////////////////////////////
unsigned AuctionTransferAPI::identifyHost( const char *serverID[], unsigned idCount, void *user)
{
IdentifyServerRequest *req = new IdentifyServerRequest(REQUEST_SET_SERVER_LIST, 0, serverID, idCount);
return m_apiCore->submitRequest( req, new CommonResponse(REQUEST_SET_SERVER_LIST, user));
}
//////////////////////////////////////////////////////////////////////////////////////
unsigned AuctionTransferAPI::sendAuditAssetTransfer(const char *gameCode, const char *serverCode, long long inGameAssetID, unsigned stationID, const char *event, const char *message, void *user)
{
SendAuditRequest *req = new SendAuditRequest( GAME_SEND_AUDIT_MESSAGE, 0, gameCode, serverCode, inGameAssetID, stationID, event, message );
return m_apiCore->submitRequest(req, new CommonResponse(GAME_SEND_AUDIT_MESSAGE, user));
}
//////////////////////////////////////////////////////////////////////////////////////
unsigned AuctionTransferAPI::getNewTransactionID(void *user)
{
GetIDRequest *req = new GetIDRequest( GAME_REQUEST_GET_TRANSACTION_ID, 0);
return m_apiCore->submitRequest(req, new GetIDResponse( GAME_REQUEST_GET_TRANSACTION_ID, user));
}
}; // namespace
//////////////////////////////////////////////////////////////////////////////////////
@@ -51,7 +51,7 @@ namespace Base
}
#else
//#pragma message ("--- Packing c style strings ---")
#pragma message ("--- Packing c style strings ---")
void get(ByteStream::ReadIterator & source, std::string & target)
{
target = reinterpret_cast<const char *>(source.getBuffer());
@@ -1,45 +1,45 @@
////////////////////////////////////////
// Types.h
//
// Purpose:
// 1. Define integer types that are unambiguous with respect to size
//
// Revisions:
// 07/10/2001 Created
//
#ifndef BASE_LINUX_TYPES_H
#define BASE_LINUX_TYPES_H
#include <sys/bitypes.h>
#ifdef EXTERNAL_DISTRO
namespace NAMESPACE
{
#endif
namespace Base
{
#ifndef INT32_MAX
#define INT32_MAX 0x7FFFFFFF
#define INT32_MIN 0x80000000
#define UINT32_MAX 0xFFFFFFFF
#endif
typedef signed char int8;
typedef unsigned char uint8;
typedef signed short int16;
typedef unsigned short uint16;
typedef int32_t int32;
typedef u_int32_t uint32;
typedef int64_t int64;
typedef u_int64_t uint64;
}
#ifdef EXTERNAL_DISTRO
};
#endif
#endif // BASE_LINUX_TYPES_H
////////////////////////////////////////
// Types.h
//
// Purpose:
// 1. Define integer types that are unambiguous with respect to size
//
// Revisions:
// 07/10/2001 Created
//
#ifndef BASE_LINUX_TYPES_H
#define BASE_LINUX_TYPES_H
#include <sys/bitypes.h>
#ifdef EXTERNAL_DISTRO
namespace NAMESPACE
{
#endif
namespace Base
{
#ifndef INT32_MAX
#define INT32_MAX 0x7FFFFFFF
#define INT32_MIN 0x80000000
#define UINT32_MAX 0xFFFFFFFF
#endif
typedef signed char int8;
typedef unsigned char uint8;
typedef signed short int16;
typedef unsigned short uint16;
typedef int32_t int32;
typedef u_int32_t uint32;
typedef int64_t int64;
typedef u_int64_t uint64;
}
#ifdef EXTERNAL_DISTRO
};
#endif
#endif // BASE_LINUX_TYPES_H
File diff suppressed because it is too large Load Diff
@@ -1,165 +1,165 @@
// ConfigCentralServer.cpp
// copyright 2000 Verant Interactive
// Author: Justin Randall
//-----------------------------------------------------------------------
#include "FirstCentralServer.h"
#include "serverUtility/ConfigServerUtility.h"
#include "sharedFoundation/ConfigFile.h"
#include "sharedNetwork/SetupSharedNetwork.h"
#include "ConfigCentralServer.h"
//-----------------------------------------------------------------------
ConfigCentralServer::Data * ConfigCentralServer::data = 0;
#define KEY_INT(a,b) (data->a = ConfigFile::getKeyInt("CentralServer", #a, b))
#define KEY_BOOL(a,b) (data->a = ConfigFile::getKeyBool("CentralServer", #a, b))
#define KEY_STRING(a,b) (data->a = ConfigFile::getKeyString("CentralServer", #a, b))
//-----------------------------------------------------------------------
namespace ConfigCentralServerNamespace
{
typedef std::vector<char const *> StringPtrArray;
StringPtrArray ms_startPlanets; // ConfigFile owns the pointer
StringPtrArray ms_startConnectionServer;
}
using namespace ConfigCentralServerNamespace;
// ======================================================================
int ConfigCentralServer::getNumberOfStartPlanets()
{
return static_cast<int>(ms_startPlanets.size());
}
// ----------------------------------------------------------------------
char const * ConfigCentralServer::getStartPlanet(int index)
{
VALIDATE_RANGE_INCLUSIVE_EXCLUSIVE(0, index, getNumberOfStartPlanets());
return ms_startPlanets[static_cast<size_t>(index)];
}
// ----------------------------------------------------------------------
int ConfigCentralServer::getNumberOfStartingConnectionServers()
{
return static_cast<int>(ms_startConnectionServer.size());
}
// ----------------------------------------------------------------------
char const * ConfigCentralServer::getStartingConnectionServer(int index)
{
VALIDATE_RANGE_INCLUSIVE_EXCLUSIVE(0, index, getNumberOfStartingConnectionServers());
return ms_startConnectionServer[static_cast<size_t>(index)];
}
// ----------------------------------------------------------------------
void ConfigCentralServer::install(void)
{
SetupSharedNetwork::SetupData networkSetupData;
SetupSharedNetwork::getDefaultServerSetupData(networkSetupData);
SetupSharedNetwork::install(networkSetupData);
ConfigServerUtility::install();
data = new ConfigCentralServer::Data;
KEY_INT (chatServicePort, 61232);
KEY_INT (connectionServicePort, 0);
KEY_INT (customerServicePort, 61242);
KEY_INT (gameServicePort, 44451);
KEY_STRING (loginServerAddress, "127.0.0.1");
KEY_INT (loginServerPort, 44452);
KEY_STRING (clusterName, "devcluster");
KEY_STRING (startPlanet, "tatooine");
KEY_INT (taskManagerPort, 60001);
KEY_INT (planetServicePort, 44455);
KEY_INT (planetServerRestartDelayTimeSeconds, 60);
KEY_INT (connectionServerRestartDelayTimeSeconds, 60);
KEY_INT (chatServerRestartDelayTimeSeconds, 60);
KEY_INT (updatePlayerCountFrequency, 10);
KEY_BOOL (newbieTutorialEnabled, false);
KEY_STRING (chatServiceBindInterface, "");
KEY_STRING (connectionServiceBindInterface, "");
KEY_STRING (customerServiceBindInterface, "");
KEY_STRING (gameServiceBindInterface, "");
KEY_STRING (loginServiceBindInterface, "");
KEY_STRING (planetServiceBindInterface, "");
KEY_INT (firstPlanetWatcherPort, 60002);
KEY_INT (loginServicePort, 44452);
KEY_BOOL (developmentMode, true);
KEY_BOOL (shouldSleep, true);
KEY_BOOL (startPublic, true);
KEY_INT (consoleServicePort, 61000);
KEY_STRING (consoleServiceBindInterface, "");
KEY_INT (characterCreationTimeout,5*60); // seconds
KEY_STRING (chatServerHost, "local");
KEY_STRING (dbServerHost, "local");
KEY_INT (serverPingTimeout,0); // seconds
KEY_INT (recentLoadingStateSeconds,60*60);
KEY_INT (characterCreationRateLimitSeconds, 0);
KEY_INT (characterCtsCreationRateLimitSeconds, 0);
KEY_STRING (transferServerAddress, "127.0.0.1");
KEY_INT (transferServerPort, 0); // TransferServer listens on 50005, default to "off"
KEY_STRING (stationPlayersCollectorAddress, "127.0.0.1");
KEY_INT (stationPlayersCollectorPort, 0); // StationPlayersCollector listens on 50010, default to "off"
KEY_BOOL (allowZeroConnectionServerPort, true);
KEY_INT (clusterWideDataLockTimeout, 300); // seconds
KEY_STRING (commodityServerServiceBindInterface, "");
KEY_INT (commodityServerServicePort, 44456);
KEY_BOOL (shutdown, false);
KEY_BOOL (validateBuildVersionNumber, false);
KEY_INT (gameServerConnectionPendingAllocatedSizeLimit, 0);
KEY_INT (systemTimeMismatchAlertIntervalSeconds, 1*60*60); // seconds
KEY_INT (ctsDenyLoginThresholdSeconds, 2*60*60); // seconds
KEY_BOOL (auctionEnabled, true);
KEY_STRING (auctionServer, "localhost");
KEY_INT (auctionPort, 5901 );
KEY_STRING (auctionIDPrefix, "SWG+");
KEY_BOOL (disconnectDuplicateConnectionsOnOtherGalaxies, false);
KEY_BOOL (requestDbSaveOnPlanetServerCrash, true);
KEY_INT (maxTimeToWaitForPlanetServerStartSeconds, 5*60); // seconds
int index = 0;
char const * result = 0;
do
{
result = ConfigFile::getKeyString("CentralServer", "startPlanet", index++, 0);
if (result != 0)
{
ms_startPlanets.push_back(result);
}
}
while (result);
index = 0;
result = 0;
do
{
result = ConfigFile::getKeyString("CentralServer", "startConnectionServer", index++, 0);
if (result != 0)
{
ms_startConnectionServer.push_back(result);
}
}
while (result);
}
//-----------------------------------------------------------------------
void ConfigCentralServer::remove(void)
{
delete data;
data = 0;
ConfigServerUtility::remove();
}
//-----------------------------------------------------------------------
// ConfigCentralServer.cpp
// copyright 2000 Verant Interactive
// Author: Justin Randall
//-----------------------------------------------------------------------
#include "FirstCentralServer.h"
#include "serverUtility/ConfigServerUtility.h"
#include "sharedFoundation/ConfigFile.h"
#include "sharedNetwork/SetupSharedNetwork.h"
#include "ConfigCentralServer.h"
//-----------------------------------------------------------------------
ConfigCentralServer::Data * ConfigCentralServer::data = 0;
#define KEY_INT(a,b) (data->a = ConfigFile::getKeyInt("CentralServer", #a, b))
#define KEY_BOOL(a,b) (data->a = ConfigFile::getKeyBool("CentralServer", #a, b))
#define KEY_STRING(a,b) (data->a = ConfigFile::getKeyString("CentralServer", #a, b))
//-----------------------------------------------------------------------
namespace ConfigCentralServerNamespace
{
typedef std::vector<char const *> StringPtrArray;
StringPtrArray ms_startPlanets; // ConfigFile owns the pointer
StringPtrArray ms_startConnectionServer;
}
using namespace ConfigCentralServerNamespace;
// ======================================================================
int ConfigCentralServer::getNumberOfStartPlanets()
{
return static_cast<int>(ms_startPlanets.size());
}
// ----------------------------------------------------------------------
char const * ConfigCentralServer::getStartPlanet(int index)
{
VALIDATE_RANGE_INCLUSIVE_EXCLUSIVE(0, index, getNumberOfStartPlanets());
return ms_startPlanets[static_cast<size_t>(index)];
}
// ----------------------------------------------------------------------
int ConfigCentralServer::getNumberOfStartingConnectionServers()
{
return static_cast<int>(ms_startConnectionServer.size());
}
// ----------------------------------------------------------------------
char const * ConfigCentralServer::getStartingConnectionServer(int index)
{
VALIDATE_RANGE_INCLUSIVE_EXCLUSIVE(0, index, getNumberOfStartingConnectionServers());
return ms_startConnectionServer[static_cast<size_t>(index)];
}
// ----------------------------------------------------------------------
void ConfigCentralServer::install(void)
{
SetupSharedNetwork::SetupData networkSetupData;
SetupSharedNetwork::getDefaultServerSetupData(networkSetupData);
SetupSharedNetwork::install(networkSetupData);
ConfigServerUtility::install();
data = new ConfigCentralServer::Data;
KEY_INT (chatServicePort, 61232);
KEY_INT (connectionServicePort, 0);
KEY_INT (customerServicePort, 61242);
KEY_INT (gameServicePort, 44451);
KEY_STRING (loginServerAddress, "127.0.0.1");
KEY_INT (loginServerPort, 44452);
KEY_STRING (clusterName, "devcluster");
KEY_STRING (startPlanet, "tatooine");
KEY_INT (taskManagerPort, 60001);
KEY_INT (planetServicePort, 44455);
KEY_INT (planetServerRestartDelayTimeSeconds, 60);
KEY_INT (connectionServerRestartDelayTimeSeconds, 60);
KEY_INT (chatServerRestartDelayTimeSeconds, 60);
KEY_INT (updatePlayerCountFrequency, 10);
KEY_BOOL (newbieTutorialEnabled, false);
KEY_STRING (chatServiceBindInterface, "");
KEY_STRING (connectionServiceBindInterface, "");
KEY_STRING (customerServiceBindInterface, "");
KEY_STRING (gameServiceBindInterface, "");
KEY_STRING (loginServiceBindInterface, "");
KEY_STRING (planetServiceBindInterface, "");
KEY_INT (firstPlanetWatcherPort, 60002);
KEY_INT (loginServicePort, 44452);
KEY_BOOL (developmentMode, true);
KEY_BOOL (shouldSleep, true);
KEY_BOOL (startPublic, true);
KEY_INT (consoleServicePort, 61000);
KEY_STRING (consoleServiceBindInterface, "");
KEY_INT (characterCreationTimeout,5*60); // seconds
KEY_STRING (chatServerHost, "local");
KEY_STRING (dbServerHost, "local");
KEY_INT (serverPingTimeout,0); // seconds
KEY_INT (recentLoadingStateSeconds,60*60);
KEY_INT (characterCreationRateLimitSeconds, 0);
KEY_INT (characterCtsCreationRateLimitSeconds, 0);
KEY_STRING (transferServerAddress, "127.0.0.1");
KEY_INT (transferServerPort, 0); // TransferServer listens on 50005, default to "off"
KEY_STRING (stationPlayersCollectorAddress, "127.0.0.1");
KEY_INT (stationPlayersCollectorPort, 0); // StationPlayersCollector listens on 50010, default to "off"
KEY_BOOL (allowZeroConnectionServerPort, true);
KEY_INT (clusterWideDataLockTimeout, 300); // seconds
KEY_STRING (commodityServerServiceBindInterface, "");
KEY_INT (commodityServerServicePort, 44456);
KEY_BOOL (shutdown, false);
KEY_BOOL (validateBuildVersionNumber, false);
KEY_INT (gameServerConnectionPendingAllocatedSizeLimit, 0);
KEY_INT (systemTimeMismatchAlertIntervalSeconds, 1*60*60); // seconds
KEY_INT (ctsDenyLoginThresholdSeconds, 2*60*60); // seconds
KEY_BOOL (auctionEnabled, true);
KEY_STRING (auctionServer, "localhost");
KEY_INT (auctionPort, 5901 );
KEY_STRING (auctionIDPrefix, "SWG+");
KEY_BOOL (disconnectDuplicateConnectionsOnOtherGalaxies, false);
KEY_BOOL (requestDbSaveOnPlanetServerCrash, true);
KEY_INT (maxTimeToWaitForPlanetServerStartSeconds, 5*60); // seconds
int index = 0;
char const * result = 0;
do
{
result = ConfigFile::getKeyString("CentralServer", "startPlanet", index++, 0);
if (result != 0)
{
ms_startPlanets.push_back(result);
}
}
while (result);
index = 0;
result = 0;
do
{
result = ConfigFile::getKeyString("CentralServer", "startConnectionServer", index++, 0);
if (result != 0)
{
ms_startConnectionServer.push_back(result);
}
}
while (result);
}
//-----------------------------------------------------------------------
void ConfigCentralServer::remove(void)
{
delete data;
data = 0;
ConfigServerUtility::remove();
}
//-----------------------------------------------------------------------
@@ -1851,7 +1851,7 @@ void ChatInterface::OnReceiveForcedLogout(const ChatAvatar *oldAvatar)
ChatServer::fileLog(false, "ChatInterface", "OnReceiveForcedLogout() oldAvatar(%s)", ChatServer::getFullChatAvatarName(oldAvatar).c_str());
PROFILER_AUTO_BLOCK_DEFINE("ChatInterface - OnReceiveForcedLogout");
if ((oldAvatar == NULL))
if (oldAvatar == NULL)
{
DEBUG_WARNING(true, ("We received an OnReceiveForcedLogout with a success result code but NULL data. This is an error that the API should never give."));
return;
@@ -2877,7 +2877,7 @@ void ChatInterface::OnReceivePersistentMessage(const ChatAvatar *destAvatar, con
ChatServer::fileLog(false, "ChatInterface", "OnReceivePersistentMessage() destAvatar(%s)", ChatServer::getFullChatAvatarName(destAvatar).c_str());
PROFILER_AUTO_BLOCK_DEFINE("ChatInterface - OnReceivePersistentMessage");
if ((destAvatar == NULL))
if (destAvatar == NULL)
{
DEBUG_WARNING(true, ("We received an OnREceivePersistentMessage with a success result code but NULL data. This is an error that the API should never give."));
return;
@@ -1,148 +1,148 @@
// ConfigChatServer.cpp
// copyright 2000 Verant Interactive
// Author: Justin Randall
//-----------------------------------------------------------------------
#include "FirstChatServer.h"
#include "serverUtility/ConfigServerUtility.h"
#include "sharedFoundation/ConfigFile.h"
#include "sharedNetwork/SetupSharedNetwork.h"
#include "ConfigChatServer.h"
//-----------------------------------------------------------------------
ConfigChatServer::Data * ConfigChatServer::data = 0;
#define KEY_INT(a,b) (data->a = ConfigFile::getKeyInt("ChatServer", #a, b))
#define KEY_STRING(a,b) (data->a = ConfigFile::getKeyString("ChatServer", #a, b))
#define KEY_BOOL(a,b) (data->a = ConfigFile::getKeyBool("ChatServer", #a, b))
//Commented out so lint doesn't whine that we're not using them
//#define KEY_REAL(a,b) (data->a = ConfigFile::getKeyReal("ChatServer", #a, b))
// ======================================================================
namespace ConfigChatServerNamespace
{
typedef std::vector<char const *> StringPtrArray;
StringPtrArray ms_createRoom; // ConfigFile owns the pointer
StringPtrArray ms_voiceGateways;
}
using namespace ConfigChatServerNamespace;
// ======================================================================
int ConfigChatServer::getNumberOfCreateRooms()
{
return static_cast<int>(ms_createRoom.size());
}
// ----------------------------------------------------------------------
char const * ConfigChatServer::getCreateRoom(int index)
{
VALIDATE_RANGE_INCLUSIVE_EXCLUSIVE(0, index, getNumberOfCreateRooms());
return ms_createRoom[static_cast<size_t>(index)];
}
// ----------------------------------------------------------------------
int ConfigChatServer::getNumberOfVoiceChatGateways()
{
return static_cast<int>(ms_voiceGateways.size());
}
// ----------------------------------------------------------------------
char const * ConfigChatServer::getVoiceChatGateway(int index)
{
VALIDATE_RANGE_INCLUSIVE_EXCLUSIVE(0, index, getNumberOfVoiceChatGateways());
return ms_voiceGateways[static_cast<size_t>(index)];
}
void ConfigChatServer::install(void)
{
ConfigServerUtility::install();
SetupSharedNetwork::SetupData networkSetupData;
SetupSharedNetwork::getDefaultServerSetupData(networkSetupData);
SetupSharedNetwork::install(networkSetupData);
data = new ConfigChatServer::Data;
KEY_STRING (backupGatewayServerIP, "localhost");
KEY_INT (backupGatewayServerPort, 15150);
KEY_STRING (clusterName, "devcluster");
KEY_STRING (centralServerAddress, "localhost");
KEY_INT (centralServerPort, 61232);
KEY_STRING (gameCode, "SWG");
KEY_STRING (gatewayServerIP, "localhost");
KEY_INT (gatewayServerPort, 5001);
KEY_INT (roomInactivityTimeout, 60 * 60 * 24 * 3);
KEY_INT (roomUnpopulatedTimeout, 60 * 5);
KEY_STRING (gameServiceBindInterface, "");
KEY_STRING (planetServiceBindInterface, "");
KEY_INT (loginFlowControlRate, 50);
KEY_INT (maxRoomQueriesPerFrame, 5);
KEY_BOOL (loggingEnabled, false);
KEY_STRING (registrarHost, "localhost");
KEY_INT (registrarPort, 5000);
KEY_INT (intervalToSendHeadersToClientSeconds, 1);
KEY_INT (maxHeadersToSendToClientPerInterval, 100);
KEY_INT (chatStatisticsReportIntervalSeconds, 60);
KEY_INT (chatSpamLimiterNumCharacters, 400);
KEY_BOOL (chatSpamLimiterEnabledForFreeTrial, true);
KEY_INT (chatSpamNotifyPlayerWhenLimitedIntervalSeconds, 30); // <= 0 to disable
KEY_BOOL (voiceChatLoggingEnabled, false);
KEY_INT (voiceChatRoomListRefresh, 600000);
int index = 0;
char const * result = 0;
do
{
result = ConfigFile::getKeyString("ChatServer", "createRoom", index++, 0);
if (result != 0)
{
ms_createRoom.push_back(result);
}
}
while (result);
index = 0;
result = 0;
do
{
result = ConfigFile::getKeyString("ChatServer", "voiceChatGateway", index++, 0);
if(result != 0)
{
ms_voiceGateways.push_back(result);
}
} while(result);
if(ms_voiceGateways.empty())
{
static char const * const defaultGateway = "localhost:9102";
ms_voiceGateways.push_back(defaultGateway);
}
}
//-----------------------------------------------------------------------
void ConfigChatServer::remove(void)
{
delete data;
data = 0;
ConfigServerUtility::remove();
}
//-----------------------------------------------------------------------
bool ConfigChatServer::isLoggingEnabled()
{
return data->loggingEnabled;
}
//-----------------------------------------------------------------------
// ConfigChatServer.cpp
// copyright 2000 Verant Interactive
// Author: Justin Randall
//-----------------------------------------------------------------------
#include "FirstChatServer.h"
#include "serverUtility/ConfigServerUtility.h"
#include "sharedFoundation/ConfigFile.h"
#include "sharedNetwork/SetupSharedNetwork.h"
#include "ConfigChatServer.h"
//-----------------------------------------------------------------------
ConfigChatServer::Data * ConfigChatServer::data = 0;
#define KEY_INT(a,b) (data->a = ConfigFile::getKeyInt("ChatServer", #a, b))
#define KEY_STRING(a,b) (data->a = ConfigFile::getKeyString("ChatServer", #a, b))
#define KEY_BOOL(a,b) (data->a = ConfigFile::getKeyBool("ChatServer", #a, b))
//Commented out so lint doesn't whine that we're not using them
//#define KEY_REAL(a,b) (data->a = ConfigFile::getKeyReal("ChatServer", #a, b))
// ======================================================================
namespace ConfigChatServerNamespace
{
typedef std::vector<char const *> StringPtrArray;
StringPtrArray ms_createRoom; // ConfigFile owns the pointer
StringPtrArray ms_voiceGateways;
}
using namespace ConfigChatServerNamespace;
// ======================================================================
int ConfigChatServer::getNumberOfCreateRooms()
{
return static_cast<int>(ms_createRoom.size());
}
// ----------------------------------------------------------------------
char const * ConfigChatServer::getCreateRoom(int index)
{
VALIDATE_RANGE_INCLUSIVE_EXCLUSIVE(0, index, getNumberOfCreateRooms());
return ms_createRoom[static_cast<size_t>(index)];
}
// ----------------------------------------------------------------------
int ConfigChatServer::getNumberOfVoiceChatGateways()
{
return static_cast<int>(ms_voiceGateways.size());
}
// ----------------------------------------------------------------------
char const * ConfigChatServer::getVoiceChatGateway(int index)
{
VALIDATE_RANGE_INCLUSIVE_EXCLUSIVE(0, index, getNumberOfVoiceChatGateways());
return ms_voiceGateways[static_cast<size_t>(index)];
}
void ConfigChatServer::install(void)
{
ConfigServerUtility::install();
SetupSharedNetwork::SetupData networkSetupData;
SetupSharedNetwork::getDefaultServerSetupData(networkSetupData);
SetupSharedNetwork::install(networkSetupData);
data = new ConfigChatServer::Data;
KEY_STRING (backupGatewayServerIP, "localhost");
KEY_INT (backupGatewayServerPort, 15150);
KEY_STRING (clusterName, "devcluster");
KEY_STRING (centralServerAddress, "localhost");
KEY_INT (centralServerPort, 61232);
KEY_STRING (gameCode, "SWG");
KEY_STRING (gatewayServerIP, "localhost");
KEY_INT (gatewayServerPort, 5001);
KEY_INT (roomInactivityTimeout, 60 * 60 * 24 * 3);
KEY_INT (roomUnpopulatedTimeout, 60 * 5);
KEY_STRING (gameServiceBindInterface, "");
KEY_STRING (planetServiceBindInterface, "");
KEY_INT (loginFlowControlRate, 50);
KEY_INT (maxRoomQueriesPerFrame, 5);
KEY_BOOL (loggingEnabled, false);
KEY_STRING (registrarHost, "localhost");
KEY_INT (registrarPort, 5000);
KEY_INT (intervalToSendHeadersToClientSeconds, 1);
KEY_INT (maxHeadersToSendToClientPerInterval, 100);
KEY_INT (chatStatisticsReportIntervalSeconds, 60);
KEY_INT (chatSpamLimiterNumCharacters, 400);
KEY_BOOL (chatSpamLimiterEnabledForFreeTrial, true);
KEY_INT (chatSpamNotifyPlayerWhenLimitedIntervalSeconds, 30); // <= 0 to disable
KEY_BOOL (voiceChatLoggingEnabled, false);
KEY_INT (voiceChatRoomListRefresh, 600000);
int index = 0;
char const * result = 0;
do
{
result = ConfigFile::getKeyString("ChatServer", "createRoom", index++, 0);
if (result != 0)
{
ms_createRoom.push_back(result);
}
}
while (result);
index = 0;
result = 0;
do
{
result = ConfigFile::getKeyString("ChatServer", "voiceChatGateway", index++, 0);
if(result != 0)
{
ms_voiceGateways.push_back(result);
}
} while(result);
if(ms_voiceGateways.empty())
{
static char const * const defaultGateway = "localhost:9102";
ms_voiceGateways.push_back(defaultGateway);
}
}
//-----------------------------------------------------------------------
void ConfigChatServer::remove(void)
{
delete data;
data = 0;
ConfigServerUtility::remove();
}
//-----------------------------------------------------------------------
bool ConfigChatServer::isLoggingEnabled()
{
return data->loggingEnabled;
}
//-----------------------------------------------------------------------
@@ -421,7 +421,7 @@ void ConnectionServerConnection::onReceive(const Archive::ByteStream & message)
NetworkId targetId = message.getKickeeId();
std::string const & targetName = message.getKickeeName();
if(targetId.isValid() ||
!targetName.empty() && (ChatServer::getVoiceChatLoginInfoFromName(targetName, targetId)))
(!targetName.empty() && (ChatServer::getVoiceChatLoginInfoFromName(targetName, targetId))))
{
ChatServer::requestKickPlayerFromChannel(message.getRequester(), targetId, message.getChannelName());
}
File diff suppressed because it is too large Load Diff
@@ -1,72 +1,72 @@
// ======================================================================
//
// ConfigCommodityServer.cpp
// Copyright 2000-01, Sony Online Entertainment Inc., all rights reserved.
// Author: Doug Mellencamp
//
// ======================================================================
//-----------------------------------------------------------------------
#include "FirstCommodityServer.h"
#include "sharedFoundation/ConfigFile.h"
#include "sharedNetwork/SetupSharedNetwork.h"
#include "ConfigCommodityServer.h"
//-----------------------------------------------------------------------
ConfigCommodityServer::Data * ConfigCommodityServer::data = 0;
#define KEY_INT(a,b) (data->a = ConfigFile::getKeyInt("CommodityServer", #a, b))
#define KEY_BOOL(a,b) (data->a = ConfigFile::getKeyBool("CommodityServer", #a, b))
#define KEY_FLOAT(a,b) (data->a = ConfigFile::getKeyFloat("CommodityServer", #a, b))
#define KEY_STRING(a,b) (data->a = ConfigFile::getKeyString("CommodityServer", #a, b))
//-----------------------------------------------------------------------
void ConfigCommodityServer::install(void)
{
SetupSharedNetwork::SetupData networkSetupData;
SetupSharedNetwork::getDefaultServerSetupData(networkSetupData);
data = new ConfigCommodityServer::Data;
KEY_INT (cmServerServiceBindPort, 4069);
KEY_STRING (cmServerServiceBindInterface, "localhost");
KEY_INT (databaseServerPort, 44457); //TODO: confirm port
KEY_STRING (databaseServerAddress, "localhost");
KEY_STRING (dsn,"swodb");
KEY_STRING (databaseUID,"dmellencamp");
KEY_STRING (databasePWD, "compts6m");
KEY_STRING (databaseSchema, "dmellencamp");
KEY_INT (secondsBetweenDBReconnect, 45);
KEY_STRING (databaseProtocol, "OCI");
KEY_BOOL (enableQueryProfile,false);
KEY_BOOL (verboseQueryMode,false);
KEY_BOOL (developmentMode, true);
KEY_INT (databaseThreads, 1);
KEY_INT (databaseCharacterNameSizeLimit, 64);
KEY_INT (databaseItemNameSizeLimit, 256);
KEY_INT (databaseUserDescriptionSizeLimit, 1024);
KEY_INT (databaseOOBDataSizeLimit, 4000);
KEY_BOOL (snapshotDBWrite, true);
KEY_BOOL (showAllDebugInfo, true);
KEY_INT (centralServerPort, 44456);
KEY_STRING (centralServerAddress, "localhost");
KEY_INT (sleepTimePerFrameMs, 1);
KEY_INT (minutesActiveToUnaccessed, 7 * 24 * 60);
KEY_INT (minutesEmptyToEndangered, 7 * 24 * 60);
KEY_INT (minutesUnaccessedToEndangered, 7 * 24 * 60);
KEY_INT (minutesEndangeredToRemoved, 7 * 24 * 60);
KEY_INT (minutesVendorAuctionTimer, 30 * 24 * 60);
KEY_INT (minutesVendorItemTimer, 30 * 24 * 60);
KEY_INT (maxAuctionsPerPage, 100);
}
//-----------------------------------------------------------------------
void ConfigCommodityServer::remove(void)
{
delete data;
data = 0;
}
// ======================================================================
//
// ConfigCommodityServer.cpp
// Copyright 2000-01, Sony Online Entertainment Inc., all rights reserved.
// Author: Doug Mellencamp
//
// ======================================================================
//-----------------------------------------------------------------------
#include "FirstCommodityServer.h"
#include "sharedFoundation/ConfigFile.h"
#include "sharedNetwork/SetupSharedNetwork.h"
#include "ConfigCommodityServer.h"
//-----------------------------------------------------------------------
ConfigCommodityServer::Data * ConfigCommodityServer::data = 0;
#define KEY_INT(a,b) (data->a = ConfigFile::getKeyInt("CommodityServer", #a, b))
#define KEY_BOOL(a,b) (data->a = ConfigFile::getKeyBool("CommodityServer", #a, b))
#define KEY_FLOAT(a,b) (data->a = ConfigFile::getKeyFloat("CommodityServer", #a, b))
#define KEY_STRING(a,b) (data->a = ConfigFile::getKeyString("CommodityServer", #a, b))
//-----------------------------------------------------------------------
void ConfigCommodityServer::install(void)
{
SetupSharedNetwork::SetupData networkSetupData;
SetupSharedNetwork::getDefaultServerSetupData(networkSetupData);
data = new ConfigCommodityServer::Data;
KEY_INT (cmServerServiceBindPort, 4069);
KEY_STRING (cmServerServiceBindInterface, "localhost");
KEY_INT (databaseServerPort, 44457); //TODO: confirm port
KEY_STRING (databaseServerAddress, "localhost");
KEY_STRING (dsn,"swodb");
KEY_STRING (databaseUID,"dmellencamp");
KEY_STRING (databasePWD, "compts6m");
KEY_STRING (databaseSchema, "dmellencamp");
KEY_INT (secondsBetweenDBReconnect, 45);
KEY_STRING (databaseProtocol, "OCI");
KEY_BOOL (enableQueryProfile,false);
KEY_BOOL (verboseQueryMode,false);
KEY_BOOL (developmentMode, true);
KEY_INT (databaseThreads, 1);
KEY_INT (databaseCharacterNameSizeLimit, 64);
KEY_INT (databaseItemNameSizeLimit, 256);
KEY_INT (databaseUserDescriptionSizeLimit, 1024);
KEY_INT (databaseOOBDataSizeLimit, 4000);
KEY_BOOL (snapshotDBWrite, true);
KEY_BOOL (showAllDebugInfo, true);
KEY_INT (centralServerPort, 44456);
KEY_STRING (centralServerAddress, "localhost");
KEY_INT (sleepTimePerFrameMs, 1);
KEY_INT (minutesActiveToUnaccessed, 7 * 24 * 60);
KEY_INT (minutesEmptyToEndangered, 7 * 24 * 60);
KEY_INT (minutesUnaccessedToEndangered, 7 * 24 * 60);
KEY_INT (minutesEndangeredToRemoved, 7 * 24 * 60);
KEY_INT (minutesVendorAuctionTimer, 30 * 24 * 60);
KEY_INT (minutesVendorItemTimer, 30 * 24 * 60);
KEY_INT (maxAuctionsPerPage, 100);
}
//-----------------------------------------------------------------------
void ConfigCommodityServer::remove(void)
{
delete data;
data = 0;
}
File diff suppressed because it is too large Load Diff
@@ -1,166 +1,166 @@
// ConfigConnectionServer.cpp
// copyright 2001 Verant Interactive
//-----------------------------------------------------------------------
#include "FirstConnectionServer.h"
#include "ConfigConnectionServer.h"
#include "SessionApiClient.h"
#include "serverUtility/ConfigServerUtility.h"
#include "sharedFoundation/ConfigFile.h"
#include "sharedGame/PlatformFeatureBits.h"
#include "sharedNetwork/SetupSharedNetwork.h"
//-----------------------------------------------------------------------
ConfigConnectionServer::Data * ConfigConnectionServer::data = 0;
#define KEY_INT(a,b) (data->a = ConfigFile::getKeyInt("ConnectionServer", #a, b))
#define KEY_BOOL(a,b) (data->a = ConfigFile::getKeyBool("ConnectionServer", #a, b))
#define KEY_FLOAT(a,b) (data->a = ConfigFile::getKeyFloat("ConnectionServer", #a, b))
#define KEY_STRING(a,b) (data->a = ConfigFile::getKeyString("ConnectionServer", #a, b))
//-----------------------------------------------------------------------
namespace ConfigConnectionServerNamespace
{
typedef std::vector<char const *> StringPtrArray;
StringPtrArray ms_sessionServer; // ConfigFile owns the pointer
}
using namespace ConfigConnectionServerNamespace;
// ======================================================================
int ConfigConnectionServer::getNumberOfSessionServers()
{
return static_cast<int>(ms_sessionServer.size());
}
// ----------------------------------------------------------------------
char const * ConfigConnectionServer::getSessionServer(int index)
{
VALIDATE_RANGE_INCLUSIVE_EXCLUSIVE(0, index, getNumberOfSessionServers());
return ms_sessionServer[static_cast<size_t>(index)];
}
void ConfigConnectionServer::install(void)
{
ConfigServerUtility::install();
SetupSharedNetwork::SetupData networkSetupData;
SetupSharedNetwork::getDefaultServerSetupData(networkSetupData);
SetupSharedNetwork::install(networkSetupData);
data = new ConfigConnectionServer::Data;
KEY_STRING (centralServerAddress, "localhost");
KEY_INT (centralServerPort, 0);
KEY_STRING (clientServiceBindInterface, "");
KEY_INT (clientServicePortPrivate, 44464);
KEY_INT (clientServicePortPublic, 44463);
KEY_INT (clientOverflowLimit, 1024 * 1024); // 1MB overflow
KEY_INT (gameServicePort, 0);
KEY_INT (pingPort, 0);
KEY_STRING (clusterName, "devcluster");
KEY_INT (maxClients, 200);
KEY_BOOL (spamLimitEnabled, false);
KEY_INT (spamLimitResetTimeMs, 30*1000);
KEY_INT (spamLimitResetScaleFactor, 8);
KEY_INT (spamLimitBytesPerSec, 32000);
KEY_INT (spamLimitPacketsPerSec, 50);
KEY_BOOL (startPublicServer, true);
KEY_BOOL (disableWorldSnapshot, true);
KEY_STRING (gameServiceBindInterface, "");
KEY_STRING (chatServiceBindInterface, "");
KEY_STRING (customerServiceBindInterface, "");
KEY_BOOL (compressClientNetworkTraffic, true);
KEY_INT (crashRecoveryTimeout, 15*1000); // timeout for players to recover from a server crash
KEY_BOOL (shouldSleep, true);
KEY_INT (clientMaxOutstandingPackets, 1000);
KEY_INT (clientMaxRawPacketSize, 500);
KEY_INT (clientMaxConnections, 200);
KEY_INT (clientFragmentSize, 500);
KEY_INT (clientMaxDataHoldTime, 20);
KEY_INT (clientHashTableSize, 200);
KEY_INT (lagReportThreshold, 10000);
KEY_INT (defaultGameFeatures, 0xFFFFFFFF);
KEY_INT (defaultSubscriptionFeatures, 0xFFFFFFFF);
KEY_BOOL (validateStationKey, false);
KEY_STRING (sessionServers, "");
KEY_INT (sessionType, SESSION_TYPE_STARWARS);
KEY_BOOL (disableSessionLogout, false);
KEY_BOOL (sessionRecordPlayTime, true);
KEY_BOOL (disconnectOnInactive, false);
KEY_BOOL (disconnectFreeTrialOnInactive, false);
KEY_STRING (adminAccountDataTable, "datatables/admin/us_admin.iff");
KEY_INT (requiredSubscriptionBits, 0);
KEY_INT (requiredGameBits, 0);
KEY_BOOL (setJtlRetailIfBetaIsSet, false);
KEY_BOOL (validateClientVersion, true);
KEY_BOOL (setEpisode3RetailIfBetaIsSet, false);
KEY_BOOL (setTrialsOfObiwanRetailIfBetaIsSet, false);
KEY_INT (disabledFeatureBits, 0);
KEY_FLOAT (timeBetweenSessionUpdates, 60.0f * 5.0f);
KEY_INT (connectionServerNumber, 0);
KEY_INT (fakeBuddyPoints, 0);
int index = 0;
char const * result = 0;
do
{
result = ConfigFile::getKeyString("ConnectionServer", "sessionServer", index++, 0);
if (result != 0)
{
ms_sessionServer.push_back(result);
}
}
while (result);
}
//-----------------------------------------------------------------------
void ConfigConnectionServer::remove(void)
{
delete data;
data = 0;
ConfigServerUtility::remove();
}
//-----------------------------------------------------------------------
int ConfigConnectionServer::getDisabledFeatureBits()
{
return data->disabledFeatureBits;
}
// ----------------------------------------------------------------------
bool ConfigConnectionServer::getDisconnectOnInactive()
{
return data->disconnectOnInactive;
}
// ----------------------------------------------------------------------
bool ConfigConnectionServer::getDisconnectFreeTrialOnInactive()
{
return data->disconnectFreeTrialOnInactive;
}
// ----------------------------------------------------------------------
int ConfigConnectionServer::getFakeBuddyPoints()
{
return data->fakeBuddyPoints;
}
// ======================================================================
// ConfigConnectionServer.cpp
// copyright 2001 Verant Interactive
//-----------------------------------------------------------------------
#include "FirstConnectionServer.h"
#include "ConfigConnectionServer.h"
#include "SessionApiClient.h"
#include "serverUtility/ConfigServerUtility.h"
#include "sharedFoundation/ConfigFile.h"
#include "sharedGame/PlatformFeatureBits.h"
#include "sharedNetwork/SetupSharedNetwork.h"
//-----------------------------------------------------------------------
ConfigConnectionServer::Data * ConfigConnectionServer::data = 0;
#define KEY_INT(a,b) (data->a = ConfigFile::getKeyInt("ConnectionServer", #a, b))
#define KEY_BOOL(a,b) (data->a = ConfigFile::getKeyBool("ConnectionServer", #a, b))
#define KEY_FLOAT(a,b) (data->a = ConfigFile::getKeyFloat("ConnectionServer", #a, b))
#define KEY_STRING(a,b) (data->a = ConfigFile::getKeyString("ConnectionServer", #a, b))
//-----------------------------------------------------------------------
namespace ConfigConnectionServerNamespace
{
typedef std::vector<char const *> StringPtrArray;
StringPtrArray ms_sessionServer; // ConfigFile owns the pointer
}
using namespace ConfigConnectionServerNamespace;
// ======================================================================
int ConfigConnectionServer::getNumberOfSessionServers()
{
return static_cast<int>(ms_sessionServer.size());
}
// ----------------------------------------------------------------------
char const * ConfigConnectionServer::getSessionServer(int index)
{
VALIDATE_RANGE_INCLUSIVE_EXCLUSIVE(0, index, getNumberOfSessionServers());
return ms_sessionServer[static_cast<size_t>(index)];
}
void ConfigConnectionServer::install(void)
{
ConfigServerUtility::install();
SetupSharedNetwork::SetupData networkSetupData;
SetupSharedNetwork::getDefaultServerSetupData(networkSetupData);
SetupSharedNetwork::install(networkSetupData);
data = new ConfigConnectionServer::Data;
KEY_STRING (centralServerAddress, "localhost");
KEY_INT (centralServerPort, 0);
KEY_STRING (clientServiceBindInterface, "");
KEY_INT (clientServicePortPrivate, 44464);
KEY_INT (clientServicePortPublic, 44463);
KEY_INT (clientOverflowLimit, 1024 * 1024); // 1MB overflow
KEY_INT (gameServicePort, 0);
KEY_INT (pingPort, 0);
KEY_STRING (clusterName, "devcluster");
KEY_INT (maxClients, 200);
KEY_BOOL (spamLimitEnabled, false);
KEY_INT (spamLimitResetTimeMs, 30*1000);
KEY_INT (spamLimitResetScaleFactor, 8);
KEY_INT (spamLimitBytesPerSec, 32000);
KEY_INT (spamLimitPacketsPerSec, 50);
KEY_BOOL (startPublicServer, true);
KEY_BOOL (disableWorldSnapshot, true);
KEY_STRING (gameServiceBindInterface, "");
KEY_STRING (chatServiceBindInterface, "");
KEY_STRING (customerServiceBindInterface, "");
KEY_BOOL (compressClientNetworkTraffic, true);
KEY_INT (crashRecoveryTimeout, 15*1000); // timeout for players to recover from a server crash
KEY_BOOL (shouldSleep, true);
KEY_INT (clientMaxOutstandingPackets, 1000);
KEY_INT (clientMaxRawPacketSize, 500);
KEY_INT (clientMaxConnections, 200);
KEY_INT (clientFragmentSize, 500);
KEY_INT (clientMaxDataHoldTime, 20);
KEY_INT (clientHashTableSize, 200);
KEY_INT (lagReportThreshold, 10000);
KEY_INT (defaultGameFeatures, 0xFFFFFFFF);
KEY_INT (defaultSubscriptionFeatures, 0xFFFFFFFF);
KEY_BOOL (validateStationKey, false);
KEY_STRING (sessionServers, "");
KEY_INT (sessionType, SESSION_TYPE_STARWARS);
KEY_BOOL (disableSessionLogout, false);
KEY_BOOL (sessionRecordPlayTime, true);
KEY_BOOL (disconnectOnInactive, false);
KEY_BOOL (disconnectFreeTrialOnInactive, false);
KEY_STRING (adminAccountDataTable, "datatables/admin/us_admin.iff");
KEY_INT (requiredSubscriptionBits, 0);
KEY_INT (requiredGameBits, 0);
KEY_BOOL (setJtlRetailIfBetaIsSet, false);
KEY_BOOL (validateClientVersion, true);
KEY_BOOL (setEpisode3RetailIfBetaIsSet, false);
KEY_BOOL (setTrialsOfObiwanRetailIfBetaIsSet, false);
KEY_INT (disabledFeatureBits, 0);
KEY_FLOAT (timeBetweenSessionUpdates, 60.0f * 5.0f);
KEY_INT (connectionServerNumber, 0);
KEY_INT (fakeBuddyPoints, 0);
int index = 0;
char const * result = 0;
do
{
result = ConfigFile::getKeyString("ConnectionServer", "sessionServer", index++, 0);
if (result != 0)
{
ms_sessionServer.push_back(result);
}
}
while (result);
}
//-----------------------------------------------------------------------
void ConfigConnectionServer::remove(void)
{
delete data;
data = 0;
ConfigServerUtility::remove();
}
//-----------------------------------------------------------------------
int ConfigConnectionServer::getDisabledFeatureBits()
{
return data->disabledFeatureBits;
}
// ----------------------------------------------------------------------
bool ConfigConnectionServer::getDisconnectOnInactive()
{
return data->disconnectOnInactive;
}
// ----------------------------------------------------------------------
bool ConfigConnectionServer::getDisconnectFreeTrialOnInactive()
{
return data->disconnectFreeTrialOnInactive;
}
// ----------------------------------------------------------------------
int ConfigConnectionServer::getFakeBuddyPoints()
{
return data->fakeBuddyPoints;
}
// ======================================================================
@@ -1,167 +1,167 @@
// ConfigCustomerServiceServer.cpp
// copyright 2000 Verant Interactive
//-----------------------------------------------------------------------
#include "FirstCustomerServiceServer.h"
#include "sharedFoundation/ConfigFile.h"
#include "sharedNetwork/SetupSharedNetwork.h"
#include "ConfigCustomerServiceServer.h"
//-----------------------------------------------------------------------
namespace ConfigCustomerServiceServerNamespace
{
const char * s_clusterName = NULL;
const char * s_centralServerAddress = NULL;
int s_centralServerPort = 0;
const char * s_gameCode = NULL;
const char * s_csServerAddress = NULL;
int s_csServerPort = 0;
int s_maxPacketsPerSecond = 50;
int s_requestTimeoutSeconds = 300;
int s_maxAllowedNumberOfTickets = 1;
int s_gameServicePort = 0;
int s_chatServicePort = 0;
const char* s_chatServiceBindInterface = NULL;
const char* s_gameServiceBindInterface = NULL;
bool s_writeTicketToBugLog = false;
};
using namespace ConfigCustomerServiceServerNamespace;
//-----------------------------------------------------------------------
#define KEY_INT(a,b) (s_ ## a = ConfigFile::getKeyInt("CustomerServiceServer", #a, b))
#define KEY_STRING(a,b) (s_ ## a = ConfigFile::getKeyString("CustomerServiceServer", #a, b))
#define KEY_BOOL(a,b) (s_ ## a = ConfigFile::getKeyBool("CustomerServiceServer", #a, b))
//-----------------------------------------------------------------------
void ConfigCustomerServiceServer::install()
{
SetupSharedNetwork::SetupData networkSetupData;
SetupSharedNetwork::getDefaultServerSetupData(networkSetupData);
SetupSharedNetwork::install(networkSetupData);
KEY_STRING (clusterName, "devcluster");
KEY_STRING (centralServerAddress, "localhost");
KEY_INT (centralServerPort, 61242);
KEY_STRING (gameCode, "SWG");
KEY_STRING (csServerAddress, "localhost");
KEY_INT (csServerPort, 3016);
KEY_INT (maxPacketsPerSecond, 50);
KEY_INT (requestTimeoutSeconds, 300);
KEY_INT (maxAllowedNumberOfTickets, 1);
KEY_INT (gameServicePort, 50010);
KEY_STRING (gameServiceBindInterface, "");
KEY_INT (chatServicePort, 50011);
KEY_STRING (chatServiceBindInterface, "");
KEY_BOOL (writeTicketToBugLog, false);
}
//-----------------------------------------------------------------------
void ConfigCustomerServiceServer::remove()
{
}
//-----------------------------------------------------------------------
int ConfigCustomerServiceServer::getMaxPacketsPerSecond()
{
return s_maxPacketsPerSecond;
}
//-----------------------------------------------------------------------
unsigned int ConfigCustomerServiceServer::getRequestTimeoutSeconds()
{
return static_cast<unsigned int>(s_requestTimeoutSeconds);
}
//-----------------------------------------------------------------------
const char * ConfigCustomerServiceServer::getCustomerServiceServerAddress()
{
return s_csServerAddress;
}
//-----------------------------------------------------------------------
unsigned short ConfigCustomerServiceServer::getCustomerServiceServerPort()
{
return static_cast<unsigned short>(s_csServerPort);
}
//-----------------------------------------------------------------------
const char * ConfigCustomerServiceServer::getCentralServerAddress()
{
return s_centralServerAddress;
}
//-----------------------------------------------------------------------
unsigned short ConfigCustomerServiceServer::getCentralServerPort()
{
return static_cast<unsigned short>(s_centralServerPort);
}
//-----------------------------------------------------------------------
const char * ConfigCustomerServiceServer::getClusterName()
{
return s_clusterName;
}
//-----------------------------------------------------------------------
const char * ConfigCustomerServiceServer::getGameCode()
{
return s_gameCode;
}
//-----------------------------------------------------------------------
int ConfigCustomerServiceServer::getMaxAllowedNumberOfTickets()
{
return s_maxAllowedNumberOfTickets;
}
//-----------------------------------------------------------------------
unsigned short ConfigCustomerServiceServer::getGameServicePort()
{
return static_cast<unsigned short>(s_gameServicePort);
}
//-----------------------------------------------------------------------
unsigned short ConfigCustomerServiceServer::getChatServicePort()
{
return static_cast<unsigned short>(s_chatServicePort);
}
//-----------------------------------------------------------------------
const char* ConfigCustomerServiceServer::getGameServiceBindInterface()
{
return s_gameServiceBindInterface;
}
//-----------------------------------------------------------------------
const char* ConfigCustomerServiceServer::getChatServiceBindInterface()
{
return s_chatServiceBindInterface;
}
//-----------------------------------------------------------------------
bool ConfigCustomerServiceServer::getWriteTicketToBugLog()
{
return s_writeTicketToBugLog;
}
//-----------------------------------------------------------------------
// ConfigCustomerServiceServer.cpp
// copyright 2000 Verant Interactive
//-----------------------------------------------------------------------
#include "FirstCustomerServiceServer.h"
#include "sharedFoundation/ConfigFile.h"
#include "sharedNetwork/SetupSharedNetwork.h"
#include "ConfigCustomerServiceServer.h"
//-----------------------------------------------------------------------
namespace ConfigCustomerServiceServerNamespace
{
const char * s_clusterName = NULL;
const char * s_centralServerAddress = NULL;
int s_centralServerPort = 0;
const char * s_gameCode = NULL;
const char * s_csServerAddress = NULL;
int s_csServerPort = 0;
int s_maxPacketsPerSecond = 50;
int s_requestTimeoutSeconds = 300;
int s_maxAllowedNumberOfTickets = 1;
int s_gameServicePort = 0;
int s_chatServicePort = 0;
const char* s_chatServiceBindInterface = NULL;
const char* s_gameServiceBindInterface = NULL;
bool s_writeTicketToBugLog = false;
};
using namespace ConfigCustomerServiceServerNamespace;
//-----------------------------------------------------------------------
#define KEY_INT(a,b) (s_ ## a = ConfigFile::getKeyInt("CustomerServiceServer", #a, b))
#define KEY_STRING(a,b) (s_ ## a = ConfigFile::getKeyString("CustomerServiceServer", #a, b))
#define KEY_BOOL(a,b) (s_ ## a = ConfigFile::getKeyBool("CustomerServiceServer", #a, b))
//-----------------------------------------------------------------------
void ConfigCustomerServiceServer::install()
{
SetupSharedNetwork::SetupData networkSetupData;
SetupSharedNetwork::getDefaultServerSetupData(networkSetupData);
SetupSharedNetwork::install(networkSetupData);
KEY_STRING (clusterName, "devcluster");
KEY_STRING (centralServerAddress, "localhost");
KEY_INT (centralServerPort, 61242);
KEY_STRING (gameCode, "SWG");
KEY_STRING (csServerAddress, "localhost");
KEY_INT (csServerPort, 3016);
KEY_INT (maxPacketsPerSecond, 50);
KEY_INT (requestTimeoutSeconds, 300);
KEY_INT (maxAllowedNumberOfTickets, 1);
KEY_INT (gameServicePort, 50010);
KEY_STRING (gameServiceBindInterface, "");
KEY_INT (chatServicePort, 50011);
KEY_STRING (chatServiceBindInterface, "");
KEY_BOOL (writeTicketToBugLog, false);
}
//-----------------------------------------------------------------------
void ConfigCustomerServiceServer::remove()
{
}
//-----------------------------------------------------------------------
int ConfigCustomerServiceServer::getMaxPacketsPerSecond()
{
return s_maxPacketsPerSecond;
}
//-----------------------------------------------------------------------
unsigned int ConfigCustomerServiceServer::getRequestTimeoutSeconds()
{
return static_cast<unsigned int>(s_requestTimeoutSeconds);
}
//-----------------------------------------------------------------------
const char * ConfigCustomerServiceServer::getCustomerServiceServerAddress()
{
return s_csServerAddress;
}
//-----------------------------------------------------------------------
unsigned short ConfigCustomerServiceServer::getCustomerServiceServerPort()
{
return static_cast<unsigned short>(s_csServerPort);
}
//-----------------------------------------------------------------------
const char * ConfigCustomerServiceServer::getCentralServerAddress()
{
return s_centralServerAddress;
}
//-----------------------------------------------------------------------
unsigned short ConfigCustomerServiceServer::getCentralServerPort()
{
return static_cast<unsigned short>(s_centralServerPort);
}
//-----------------------------------------------------------------------
const char * ConfigCustomerServiceServer::getClusterName()
{
return s_clusterName;
}
//-----------------------------------------------------------------------
const char * ConfigCustomerServiceServer::getGameCode()
{
return s_gameCode;
}
//-----------------------------------------------------------------------
int ConfigCustomerServiceServer::getMaxAllowedNumberOfTickets()
{
return s_maxAllowedNumberOfTickets;
}
//-----------------------------------------------------------------------
unsigned short ConfigCustomerServiceServer::getGameServicePort()
{
return static_cast<unsigned short>(s_gameServicePort);
}
//-----------------------------------------------------------------------
unsigned short ConfigCustomerServiceServer::getChatServicePort()
{
return static_cast<unsigned short>(s_chatServicePort);
}
//-----------------------------------------------------------------------
const char* ConfigCustomerServiceServer::getGameServiceBindInterface()
{
return s_gameServiceBindInterface;
}
//-----------------------------------------------------------------------
const char* ConfigCustomerServiceServer::getChatServiceBindInterface()
{
return s_chatServiceBindInterface;
}
//-----------------------------------------------------------------------
bool ConfigCustomerServiceServer::getWriteTicketToBugLog()
{
return s_writeTicketToBugLog;
}
//-----------------------------------------------------------------------
@@ -1,55 +1,55 @@
// ======================================================================
//
// ConfigLogServer.cpp
//
// Copyright 2002 Sony Online Entertainment
//
// ======================================================================
#include "FirstLogServer.h"
#include "ConfigLogServer.h"
#include "serverUtility/ConfigServerUtility.h"
#include "sharedFoundation/ConfigFile.h"
#include "sharedNetwork/SetupSharedNetwork.h"
// ======================================================================
ConfigLogServer::Data *ConfigLogServer::data = 0;
#define KEY_INT(a,b) (data->a = ConfigFile::getKeyInt("LogServer", #a, b))
#define KEY_STRING(a,b) (data->a = ConfigFile::getKeyString("LogServer", #a, b))
// ======================================================================
void ConfigLogServer::install()
{
ConfigServerUtility::install();
SetupSharedNetwork::SetupData networkSetupData;
SetupSharedNetwork::getDefaultServerSetupData(networkSetupData);
SetupSharedNetwork::install(networkSetupData);
data = new ConfigLogServer::Data;
KEY_INT (logServicePort, 44467);
KEY_STRING (logServiceBindInterface, "");
KEY_STRING (loggingServerApiAddress, "localhost");
KEY_STRING (loggingServerApiLoginName, "MISCONFIGURED_LOG_SERVER_LOGIN_NAME");
KEY_STRING (loggingServerApiPassword, "pacman");
KEY_STRING (loggingServerApiDefaultDirectory, "swg");
KEY_STRING (clusterName, "MISCONFIGURED_LOG_SERVER");
KEY_INT (logServiceMaxConnections, 150);
KEY_INT (loggingServerApiQueueSize, 4096);
}
// ----------------------------------------------------------------------
void ConfigLogServer::remove()
{
delete data;
data = 0;
ConfigServerUtility::remove();
}
// ======================================================================
// ======================================================================
//
// ConfigLogServer.cpp
//
// Copyright 2002 Sony Online Entertainment
//
// ======================================================================
#include "FirstLogServer.h"
#include "ConfigLogServer.h"
#include "serverUtility/ConfigServerUtility.h"
#include "sharedFoundation/ConfigFile.h"
#include "sharedNetwork/SetupSharedNetwork.h"
// ======================================================================
ConfigLogServer::Data *ConfigLogServer::data = 0;
#define KEY_INT(a,b) (data->a = ConfigFile::getKeyInt("LogServer", #a, b))
#define KEY_STRING(a,b) (data->a = ConfigFile::getKeyString("LogServer", #a, b))
// ======================================================================
void ConfigLogServer::install()
{
ConfigServerUtility::install();
SetupSharedNetwork::SetupData networkSetupData;
SetupSharedNetwork::getDefaultServerSetupData(networkSetupData);
SetupSharedNetwork::install(networkSetupData);
data = new ConfigLogServer::Data;
KEY_INT (logServicePort, 44467);
KEY_STRING (logServiceBindInterface, "");
KEY_STRING (loggingServerApiAddress, "localhost");
KEY_STRING (loggingServerApiLoginName, "MISCONFIGURED_LOG_SERVER_LOGIN_NAME");
KEY_STRING (loggingServerApiPassword, "pacman");
KEY_STRING (loggingServerApiDefaultDirectory, "swg");
KEY_STRING (clusterName, "MISCONFIGURED_LOG_SERVER");
KEY_INT (logServiceMaxConnections, 150);
KEY_INT (loggingServerApiQueueSize, 4096);
}
// ----------------------------------------------------------------------
void ConfigLogServer::remove()
{
delete data;
data = 0;
ConfigServerUtility::remove();
}
// ======================================================================
@@ -1,481 +1,479 @@
// ConfigLoginServer.h
// copyright 2000 Verant Interactive
// Author: Justin Randall
#ifndef _ConfigLoginServer_H
#define _ConfigLoginServer_H
//-----------------------------------------------------------------------
class ConfigLoginServer
{
public:
struct Data
{
int centralServicePort;
int clientServicePort;
int maxClients;
int taskServicePort;
int pingServicePort;
int httpServicePort;
bool validateClientVersion;
bool validateStationKey;
bool doSessionLogin;
bool doConsumption;
const char * sessionServers;
int sessionType;
const char * DSN;
const char * databaseUID;
const char * schemaOwner;
const char * databasePWD;
const char * databaseProtocol;
bool enableQueryProfile;
bool verboseQueryMode;
bool logWorkerThreads;
const char * privateIpMask;
int maxPlayersPerCluster;
int maxCharactersPerCluster;
int maxCharactersPerAccount;
int clientOverflowLimit;
bool developmentMode;
int databaseThreads;
bool compressClientNetworkTraffic;
int metricsListenerPort;
float defaultDBQueueUpdateTimeLimit;
int disconnectSleepTime;
int clusterGroup;
int maxSimultaneousPurgeAccounts;
int purgeSleepTime;
bool enableStructurePurge;
bool enableCharacterPurge;
int updatePurgeAccountListTime;
const char * purgeAccountSourceTable;
const char * adminAccountDataTable;
bool allowSkipTutorialToAll;
bool internalBypassOnlineLimit;
int populationExtremelyHeavyThresholdPercent;
int populationVeryHeavyThresholdPercent;
int populationHeavyThresholdPercent;
int populationMediumThresholdPercent;
int populationLightThresholdPercent;
int csToolPort;
bool requireSecureLoginForCsTool;
bool authentication;
};
static const uint16 getCentralServicePort();
static const uint16 getClientServicePort();
static const int getClientOverflowLimit();
static const uint16 getTaskServicePort();
static const uint16 getPingServicePort();
static const uint16 getHttpServicePort();
static const bool getValidateClientVersion();
static const bool getValidateStationKey();
static const bool getDoSessionLogin();
static const bool getDoConsumption();
static const char * getSessionServers();
static const int getSessionType();
static const int getMaxClients ();
static const char * getPrivateIpMask();
static const char * getDSN();
static const char * getDatabaseUID();
static const char * getSchemaOwner();
static const char * getDatabasePWD();
static const char * getDatabaseProtocol();
static const bool getEnableQueryProfile();
static const bool getVerboseQueryMode();
static const bool getLogWorkerThreads();
static int getMaxPlayersPerCluster();
static int getMaxCharactersPerCluster();
static int getMaxCharactersPerAccount();
//static int getMaxCharactersPerAccountPerCluster();
static const bool getDevelopmentMode();
static int getDatabaseThreads();
static bool getCompressClientNetworkTraffic();
static uint16 getMetricsListenerPort();
static float getDefaultDBQueueUpdateTimeLimit();
static void install ();
static void remove ();
static int getNumberOfSessionServers();
static char const * getSessionServer(int index);
static const int getDisconnectSleepTime (void);
static const int getClusterGroup();
static int getMaxSimultaneousPurgeAccounts();
static int getPurgeSleepTime();
static bool getEnableStructurePurge();
static bool getEnableCharacterPurge();
static int getUpdatePurgeAccountListTime();
static const char * getPurgeAccountSourceTable();
static int getPurgePhaseAdvanceDays(int purgePhase);
static const char * getAdminAccountDataTable();
static bool getAllowSkipTutorialToAll();
static bool getInternalBypassOnlineLimit();
static const int getCSToolPort();
static bool getRequireSecureLoginForCsTool();
static int getPopulationExtremelyHeavyThresholdPercent();
static int getPopulationVeryHeavyThresholdPercent();
static int getPopulationHeavyThresholdPercent();
static int getPopulationMediumThresholdPercent();
static int getPopulationLightThresholdPercent();
static bool getAuthentication();
// has character creation for this cluster been disabled through config option
static bool isCharacterCreationDisabled(std::string const & cluster);
static stdset<std::string>::fwd const & getCharacterCreationDisabledClusterList();
private:
static Data * data;
};
//-----------------------------------------------------------------------
inline const uint16 ConfigLoginServer::getCentralServicePort()
{
return static_cast<const uint16>(data->centralServicePort);
}
//-----------------------------------------------------------------------
inline const uint16 ConfigLoginServer::getHttpServicePort()
{
return static_cast<const uint16>(data->httpServicePort);
}
//-----------------------------------------------------------------------
inline const uint16 ConfigLoginServer::getClientServicePort()
{
return static_cast<const uint16>(data->clientServicePort);
}
//-----------------------------------------------------------------------
inline const int ConfigLoginServer::getClientOverflowLimit()
{
return data->clientOverflowLimit;
}
//-----------------------------------------------------------------------
inline const int ConfigLoginServer::getMaxClients()
{
return data->maxClients;
}
//-----------------------------------------------------------------------
inline const char * ConfigLoginServer::getPrivateIpMask()
{
return data->privateIpMask;
}
//-----------------------------------------------------------------------
inline const uint16 ConfigLoginServer::getTaskServicePort()
{
return static_cast<const uint16>(data->taskServicePort);
}
//-----------------------------------------------------------------------
inline const uint16 ConfigLoginServer::getPingServicePort()
{
return static_cast<const uint16>(data->pingServicePort);
}
// ----------------------------------------------------------------------
inline const bool ConfigLoginServer::getValidateClientVersion()
{
return (data->validateClientVersion);
}
// ----------------------------------------------------------------------
inline const bool ConfigLoginServer::getValidateStationKey()
{
return (data->validateStationKey);
}
// ----------------------------------------------------------------------
inline const bool ConfigLoginServer::getDoSessionLogin()
{
return (data->doSessionLogin);
}
// ----------------------------------------------------------------------
inline const bool ConfigLoginServer::getDoConsumption()
{
return (data->doConsumption);
}
// ----------------------------------------------------------------------
inline const char * ConfigLoginServer::getSessionServers()
{
return (data->sessionServers);
}
//------------------------------------------------------------------------------------------
inline const int ConfigLoginServer::getSessionType()
{
return data->sessionType;
}
// ----------------------------------------------------------------------
inline const char * ConfigLoginServer::getDSN()
{
return (data->DSN);
}
// ----------------------------------------------------------------------
inline const char * ConfigLoginServer::getDatabaseUID()
{
return (data->databaseUID);
}
// ----------------------------------------------------------------------
inline const char * ConfigLoginServer::getDatabasePWD()
{
return (data->databasePWD);
}
// ----------------------------------------------------------------------
inline const char * ConfigLoginServer::getDatabaseProtocol()
{
return (data->databaseProtocol);
}
//-----------------------------------------------------------------------
inline int ConfigLoginServer::getMaxPlayersPerCluster()
{
return (data->maxPlayersPerCluster);
}
// ----------------------------------------------------------------------
inline int ConfigLoginServer::getMaxCharactersPerCluster()
{
return (data->maxCharactersPerCluster);
}
// ----------------------------------------------------------------------
inline int ConfigLoginServer::getMaxCharactersPerAccount()
{
return (data->maxCharactersPerAccount);
}
// ----------------------------------------------------------------------
inline const bool ConfigLoginServer::getEnableQueryProfile()
{
return (data->enableQueryProfile);
}
// ----------------------------------------------------------------------
inline const bool ConfigLoginServer::getVerboseQueryMode()
{
return (data->verboseQueryMode);
}
// ----------------------------------------------------------------------
inline const bool ConfigLoginServer::getLogWorkerThreads()
{
return data->logWorkerThreads;
}
// ----------------------------------------------------------------------
inline const bool ConfigLoginServer::getDevelopmentMode()
{
return (data->developmentMode);
}
// ----------------------------------------------------------------------
inline int ConfigLoginServer::getDatabaseThreads()
{
return (data->databaseThreads);
}
// ----------------------------------------------------------------------
inline bool ConfigLoginServer::getCompressClientNetworkTraffic()
{
return data->compressClientNetworkTraffic;
}
// ----------------------------------------------------------------------
inline uint16 ConfigLoginServer::getMetricsListenerPort()
{
return static_cast<uint16>(data->metricsListenerPort);
}
// ----------------------------------------------------------------------
inline const char *ConfigLoginServer::getSchemaOwner()
{
return data->schemaOwner;
}
// ----------------------------------------------------------------------
inline float ConfigLoginServer::getDefaultDBQueueUpdateTimeLimit()
{
return data->defaultDBQueueUpdateTimeLimit;
}
// ----------------------------------------------------------------------
inline const int ConfigLoginServer::getDisconnectSleepTime(void)
{
return data->disconnectSleepTime;
}
// ----------------------------------------------------------------------
inline const int ConfigLoginServer::getClusterGroup()
{
return data->clusterGroup;
}
// ----------------------------------------------------------------------
inline int ConfigLoginServer::getMaxSimultaneousPurgeAccounts()
{
return data->maxSimultaneousPurgeAccounts;
}
//-----------------------------------------------------------------------
inline int ConfigLoginServer::getPurgeSleepTime()
{
return data->purgeSleepTime;
}
// ----------------------------------------------------------------------
inline bool ConfigLoginServer::getEnableStructurePurge()
{
return data->enableStructurePurge;
}
// ----------------------------------------------------------------------
inline bool ConfigLoginServer::getEnableCharacterPurge()
{
return data->enableCharacterPurge;
}
// ----------------------------------------------------------------------
inline int ConfigLoginServer::getUpdatePurgeAccountListTime()
{
return data->updatePurgeAccountListTime;
}
// ----------------------------------------------------------------------
inline char const * ConfigLoginServer::getPurgeAccountSourceTable()
{
return data->purgeAccountSourceTable;
}
// ----------------------------------------------------------------------
inline const char * ConfigLoginServer::getAdminAccountDataTable()
{
return data->adminAccountDataTable;
}
// ----------------------------------------------------------------------
inline bool ConfigLoginServer::getAllowSkipTutorialToAll()
{
return data->allowSkipTutorialToAll;
}
// ----------------------------------------------------------------------
inline bool ConfigLoginServer::getInternalBypassOnlineLimit()
{
return data->internalBypassOnlineLimit;
}
// ----------------------------------------------------------------------
inline int ConfigLoginServer::getPopulationExtremelyHeavyThresholdPercent()
{
return data->populationExtremelyHeavyThresholdPercent;
}
// ----------------------------------------------------------------------
inline int ConfigLoginServer::getPopulationVeryHeavyThresholdPercent()
{
return data->populationVeryHeavyThresholdPercent;
}
// ----------------------------------------------------------------------
inline int ConfigLoginServer::getPopulationHeavyThresholdPercent()
{
return data->populationHeavyThresholdPercent;
}
// ----------------------------------------------------------------------
inline int ConfigLoginServer::getPopulationMediumThresholdPercent()
{
return data->populationMediumThresholdPercent;
}
// ----------------------------------------------------------------------
inline int ConfigLoginServer::getPopulationLightThresholdPercent()
{
return data->populationLightThresholdPercent;
}
inline bool ConfigLoginServer::getRequireSecureLoginForCsTool()
{
return data->requireSecureLoginForCsTool;
}
inline const int ConfigLoginServer::getCSToolPort()
{
return data->csToolPort;
}
inline bool ConfigLoginServer::getAuthentication()
{
return data->authentication;
}
// ----------------------------------------------------------------------
// ======================================================================
#endif // _ConfigLoginServer_H
// ConfigLoginServer.h
// copyright 2000 Verant Interactive
// Author: Justin Randall
#ifndef _ConfigLoginServer_H
#define _ConfigLoginServer_H
//-----------------------------------------------------------------------
class ConfigLoginServer
{
public:
struct Data
{
int centralServicePort;
int clientServicePort;
int maxClients;
int taskServicePort;
int pingServicePort;
int httpServicePort;
bool validateClientVersion;
bool validateStationKey;
bool doSessionLogin;
bool doConsumption;
const char * sessionServers;
int sessionType;
const char * DSN;
const char * databaseUID;
const char * schemaOwner;
const char * databasePWD;
const char * databaseProtocol;
bool enableQueryProfile;
bool verboseQueryMode;
bool logWorkerThreads;
const char * privateIpMask;
int maxPlayersPerCluster;
int maxCharactersPerCluster;
int maxCharactersPerAccount;
int clientOverflowLimit;
bool developmentMode;
int databaseThreads;
bool compressClientNetworkTraffic;
int metricsListenerPort;
float defaultDBQueueUpdateTimeLimit;
int disconnectSleepTime;
int clusterGroup;
int maxSimultaneousPurgeAccounts;
int purgeSleepTime;
bool enableStructurePurge;
bool enableCharacterPurge;
int updatePurgeAccountListTime;
const char * purgeAccountSourceTable;
const char * adminAccountDataTable;
bool allowSkipTutorialToAll;
bool internalBypassOnlineLimit;
int populationExtremelyHeavyThresholdPercent;
int populationVeryHeavyThresholdPercent;
int populationHeavyThresholdPercent;
int populationMediumThresholdPercent;
int populationLightThresholdPercent;
int csToolPort;
bool requireSecureLoginForCsTool;
bool authentication;
};
static const uint16 getCentralServicePort();
static const uint16 getClientServicePort();
static const int getClientOverflowLimit();
static const uint16 getTaskServicePort();
static const uint16 getPingServicePort();
static const uint16 getHttpServicePort();
static const bool getValidateClientVersion();
static const bool getValidateStationKey();
static const bool getDoSessionLogin();
static const bool getDoConsumption();
static const char * getSessionServers();
static const int getSessionType();
static const int getMaxClients ();
static const char * getPrivateIpMask();
static const char * getDSN();
static const char * getDatabaseUID();
static const char * getSchemaOwner();
static const char * getDatabasePWD();
static const char * getDatabaseProtocol();
static const bool getEnableQueryProfile();
static const bool getVerboseQueryMode();
static const bool getLogWorkerThreads();
static int getMaxPlayersPerCluster();
static int getMaxCharactersPerCluster();
static int getMaxCharactersPerAccount();
//static int getMaxCharactersPerAccountPerCluster();
static const bool getDevelopmentMode();
static int getDatabaseThreads();
static bool getCompressClientNetworkTraffic();
static uint16 getMetricsListenerPort();
static float getDefaultDBQueueUpdateTimeLimit();
static void install ();
static void remove ();
static int getNumberOfSessionServers();
static char const * getSessionServer(int index);
static const int getDisconnectSleepTime (void);
static const int getClusterGroup();
static int getMaxSimultaneousPurgeAccounts();
static int getPurgeSleepTime();
static bool getEnableStructurePurge();
static bool getEnableCharacterPurge();
static int getUpdatePurgeAccountListTime();
static const char * getPurgeAccountSourceTable();
static int getPurgePhaseAdvanceDays(int purgePhase);
static const char * getAdminAccountDataTable();
static bool getAllowSkipTutorialToAll();
static bool getInternalBypassOnlineLimit();
static const int getCSToolPort();
static bool getRequireSecureLoginForCsTool();
static int getPopulationExtremelyHeavyThresholdPercent();
static int getPopulationVeryHeavyThresholdPercent();
static int getPopulationHeavyThresholdPercent();
static int getPopulationMediumThresholdPercent();
static int getPopulationLightThresholdPercent();
static bool getAuthentication();
// has character creation for this cluster been disabled through config option
static bool isCharacterCreationDisabled(std::string const & cluster);
static stdset<std::string>::fwd const & getCharacterCreationDisabledClusterList();
private:
static Data * data;
};
//-----------------------------------------------------------------------
inline const uint16 ConfigLoginServer::getCentralServicePort()
{
return static_cast<const uint16>(data->centralServicePort);
}
//-----------------------------------------------------------------------
inline const uint16 ConfigLoginServer::getHttpServicePort()
{
return static_cast<const uint16>(data->httpServicePort);
}
//-----------------------------------------------------------------------
inline const uint16 ConfigLoginServer::getClientServicePort()
{
return static_cast<const uint16>(data->clientServicePort);
}
//-----------------------------------------------------------------------
inline const int ConfigLoginServer::getClientOverflowLimit()
{
return data->clientOverflowLimit;
}
//-----------------------------------------------------------------------
inline const int ConfigLoginServer::getMaxClients()
{
return data->maxClients;
}
//-----------------------------------------------------------------------
inline const char * ConfigLoginServer::getPrivateIpMask()
{
return data->privateIpMask;
}
//-----------------------------------------------------------------------
inline const uint16 ConfigLoginServer::getTaskServicePort()
{
return static_cast<const uint16>(data->taskServicePort);
}
//-----------------------------------------------------------------------
inline const uint16 ConfigLoginServer::getPingServicePort()
{
return static_cast<const uint16>(data->pingServicePort);
}
// ----------------------------------------------------------------------
inline const bool ConfigLoginServer::getValidateClientVersion()
{
return (data->validateClientVersion);
}
// ----------------------------------------------------------------------
inline const bool ConfigLoginServer::getValidateStationKey()
{
return (data->validateStationKey);
}
// ----------------------------------------------------------------------
inline const bool ConfigLoginServer::getDoSessionLogin()
{
return (data->doSessionLogin);
}
// ----------------------------------------------------------------------
inline const bool ConfigLoginServer::getDoConsumption()
{
return (data->doConsumption);
}
// ----------------------------------------------------------------------
inline const char * ConfigLoginServer::getSessionServers()
{
return (data->sessionServers);
}
//------------------------------------------------------------------------------------------
inline const int ConfigLoginServer::getSessionType()
{
return data->sessionType;
}
// ----------------------------------------------------------------------
inline const char * ConfigLoginServer::getDSN()
{
return (data->DSN);
}
// ----------------------------------------------------------------------
inline const char * ConfigLoginServer::getDatabaseUID()
{
return (data->databaseUID);
}
// ----------------------------------------------------------------------
inline const char * ConfigLoginServer::getDatabasePWD()
{
return (data->databasePWD);
}
// ----------------------------------------------------------------------
inline const char * ConfigLoginServer::getDatabaseProtocol()
{
return (data->databaseProtocol);
}
//-----------------------------------------------------------------------
inline int ConfigLoginServer::getMaxPlayersPerCluster()
{
return (data->maxPlayersPerCluster);
}
// ----------------------------------------------------------------------
inline int ConfigLoginServer::getMaxCharactersPerCluster()
{
return (data->maxCharactersPerCluster);
}
// ----------------------------------------------------------------------
inline int ConfigLoginServer::getMaxCharactersPerAccount()
{
return (data->maxCharactersPerAccount);
}
// ----------------------------------------------------------------------
inline const bool ConfigLoginServer::getEnableQueryProfile()
{
return (data->enableQueryProfile);
}
// ----------------------------------------------------------------------
inline const bool ConfigLoginServer::getVerboseQueryMode()
{
return (data->verboseQueryMode);
}
// ----------------------------------------------------------------------
inline const bool ConfigLoginServer::getLogWorkerThreads()
{
return data->logWorkerThreads;
}
// ----------------------------------------------------------------------
inline const bool ConfigLoginServer::getDevelopmentMode()
{
return (data->developmentMode);
}
// ----------------------------------------------------------------------
inline int ConfigLoginServer::getDatabaseThreads()
{
return (data->databaseThreads);
}
// ----------------------------------------------------------------------
inline bool ConfigLoginServer::getCompressClientNetworkTraffic()
{
return data->compressClientNetworkTraffic;
}
// ----------------------------------------------------------------------
inline uint16 ConfigLoginServer::getMetricsListenerPort()
{
return static_cast<uint16>(data->metricsListenerPort);
}
// ----------------------------------------------------------------------
inline const char *ConfigLoginServer::getSchemaOwner()
{
return data->schemaOwner;
}
// ----------------------------------------------------------------------
inline float ConfigLoginServer::getDefaultDBQueueUpdateTimeLimit()
{
return data->defaultDBQueueUpdateTimeLimit;
}
// ----------------------------------------------------------------------
inline const int ConfigLoginServer::getDisconnectSleepTime(void)
{
return data->disconnectSleepTime;
}
// ----------------------------------------------------------------------
inline const int ConfigLoginServer::getClusterGroup()
{
return data->clusterGroup;
}
// ----------------------------------------------------------------------
inline int ConfigLoginServer::getMaxSimultaneousPurgeAccounts()
{
return data->maxSimultaneousPurgeAccounts;
}
//-----------------------------------------------------------------------
inline int ConfigLoginServer::getPurgeSleepTime()
{
return data->purgeSleepTime;
}
// ----------------------------------------------------------------------
inline bool ConfigLoginServer::getEnableStructurePurge()
{
return data->enableStructurePurge;
}
// ----------------------------------------------------------------------
inline bool ConfigLoginServer::getEnableCharacterPurge()
{
return data->enableCharacterPurge;
}
// ----------------------------------------------------------------------
inline int ConfigLoginServer::getUpdatePurgeAccountListTime()
{
return data->updatePurgeAccountListTime;
}
// ----------------------------------------------------------------------
inline char const * ConfigLoginServer::getPurgeAccountSourceTable()
{
return data->purgeAccountSourceTable;
}
// ----------------------------------------------------------------------
inline const char * ConfigLoginServer::getAdminAccountDataTable()
{
return data->adminAccountDataTable;
}
// ----------------------------------------------------------------------
inline bool ConfigLoginServer::getAllowSkipTutorialToAll()
{
return data->allowSkipTutorialToAll;
}
// ----------------------------------------------------------------------
inline bool ConfigLoginServer::getInternalBypassOnlineLimit()
{
return data->internalBypassOnlineLimit;
}
// ----------------------------------------------------------------------
inline int ConfigLoginServer::getPopulationExtremelyHeavyThresholdPercent()
{
return data->populationExtremelyHeavyThresholdPercent;
}
// ----------------------------------------------------------------------
inline int ConfigLoginServer::getPopulationVeryHeavyThresholdPercent()
{
return data->populationVeryHeavyThresholdPercent;
}
// ----------------------------------------------------------------------
inline int ConfigLoginServer::getPopulationHeavyThresholdPercent()
{
return data->populationHeavyThresholdPercent;
}
// ----------------------------------------------------------------------
inline int ConfigLoginServer::getPopulationMediumThresholdPercent()
{
return data->populationMediumThresholdPercent;
}
// ----------------------------------------------------------------------
inline int ConfigLoginServer::getPopulationLightThresholdPercent()
{
return data->populationLightThresholdPercent;
}
inline bool ConfigLoginServer::getRequireSecureLoginForCsTool()
{
return data->requireSecureLoginForCsTool;
}
inline const int ConfigLoginServer::getCSToolPort()
{
return data->csToolPort;
}
inline bool ConfigLoginServer::getAuthentication()
{
return data->authentication;
}
// ======================================================================
#endif // _ConfigLoginServer_H
@@ -1,96 +1,96 @@
// ======================================================================
//
// LoginServerRemoteDebugSetup.cpp
// copyright 2001 Sony Online Entertainment
//
// ======================================================================
#include "FirstLoginServer.h"
#include "Archive/ByteStream.h"
#include "sharedFoundation/ConfigSharedFoundation.h"
#include "LoginServerRemoteDebugSetup.h"
#include "LoginServerRemoteDebugConnection.h"
#include "sharedDebug/RemoteDebug_inner.h"
#include "sharedNetwork/Connection.h"
#include "sharedNetwork/NetworkSetupData.h"
#include "sharedNetwork/Service.h"
//static definitions
//Network::Address *LoginServerRemoteDebugSetup::ms_remoteDebugService;
bool LoginServerRemoteDebugSetup::ms_installed;
unsigned int LoginServerRemoteDebugSetup::ms_remoteDebugToolChannelID;
Connection *LoginServerRemoteDebugSetup::ms_connection;
Service *LoginServerRemoteDebugSetup::ms_remoteDebugService;
void LoginServerRemoteDebugSetup::install(void)
{
if (ms_installed)
{
//TODO bad
return;
}
if (!ConfigSharedFoundation::getUseRemoteDebug())
return;
NetworkSetupData setup;
setup.port = 4446;
setup.maxConnections = 16;
ms_remoteDebugService = new Service(ConnectionAllocator<LoginServerRemoteDebugConnection>(), setup);
RemoteDebugServer::install(remove, open, close, send, 0);//, receive);
ms_installed = true;
}
void LoginServerRemoteDebugSetup::remove(void)
{
if (!ms_installed)
{
//TODO bad
return;
}
delete ms_remoteDebugService;
RemoteDebugServer::remove();
ms_installed = false;
}
void LoginServerRemoteDebugSetup::open(const char *, uint16)
{
DEBUG_WARNING(true, ("not implemented! Fix ME!"));
/*
//TODO config file this?
//attempt to auto-connect to a localhost client app (if it's auto-listening)
if (ms_remoteDebugService->getHostPort())
Network::connect(ms_connection, "127.0.0.1", port);
else
{
//TODO bad
}
*/
}
void LoginServerRemoteDebugSetup::close(void)
{
if (!ms_installed)
{
//TODO bad
return;
}
}
void LoginServerRemoteDebugSetup::send(void *, uint32)
{
DEBUG_WARNING(true, ("not implemented! Fix ME!"));
/*
if (!ms_installed)
{
//TODO bad
return;
}
//always send on VNL channel 0, send the buffer, it's length, and reliable=1
NOT_NULL(ms_connection);
static Archive::ByteStream bs(reinterpret_cast<unsigned char *>(buffer), bufferLen);
ms_connection->send(bs, true);
*/
}//lint !e818 // parameter bufffer could be declared as pointint to const (but the function prototype beyond this class cannot)
// ======================================================================
//
// LoginServerRemoteDebugSetup.cpp
// copyright 2001 Sony Online Entertainment
//
// ======================================================================
#include "FirstLoginServer.h"
#include "Archive/ByteStream.h"
#include "sharedFoundation/ConfigSharedFoundation.h"
#include "LoginServerRemoteDebugSetup.h"
#include "LoginServerRemoteDebugConnection.h"
#include "sharedDebug/RemoteDebug_inner.h"
#include "sharedNetwork/Connection.h"
#include "sharedNetwork/NetworkSetupData.h"
#include "sharedNetwork/Service.h"
//static definitions
//Network::Address *LoginServerRemoteDebugSetup::ms_remoteDebugService;
bool LoginServerRemoteDebugSetup::ms_installed;
unsigned int LoginServerRemoteDebugSetup::ms_remoteDebugToolChannelID;
Connection *LoginServerRemoteDebugSetup::ms_connection;
Service *LoginServerRemoteDebugSetup::ms_remoteDebugService;
void LoginServerRemoteDebugSetup::install(void)
{
if (ms_installed)
{
//TODO bad
return;
}
if (!ConfigSharedFoundation::getUseRemoteDebug())
return;
NetworkSetupData setup;
setup.port = 4446;
setup.maxConnections = 16;
ms_remoteDebugService = new Service(ConnectionAllocator<LoginServerRemoteDebugConnection>(), setup);
RemoteDebugServer::install(remove, open, close, send, 0);//, receive);
ms_installed = true;
}
void LoginServerRemoteDebugSetup::remove(void)
{
if (!ms_installed)
{
//TODO bad
return;
}
delete ms_remoteDebugService;
RemoteDebugServer::remove();
ms_installed = false;
}
void LoginServerRemoteDebugSetup::open(const char *, uint16)
{
DEBUG_WARNING(true, ("not implemented! Fix ME!"));
/*
//TODO config file this?
//attempt to auto-connect to a localhost client app (if it's auto-listening)
if (ms_remoteDebugService->getHostPort())
Network::connect(ms_connection, "127.0.0.1", port);
else
{
//TODO bad
}
*/
}
void LoginServerRemoteDebugSetup::close(void)
{
if (!ms_installed)
{
//TODO bad
return;
}
}
void LoginServerRemoteDebugSetup::send(void *, uint32)
{
DEBUG_WARNING(true, ("not implemented! Fix ME!"));
/*
if (!ms_installed)
{
//TODO bad
return;
}
//always send on VNL channel 0, send the buffer, it's length, and reliable=1
NOT_NULL(ms_connection);
static Archive::ByteStream bs(reinterpret_cast<unsigned char *>(buffer), bufferLen);
ms_connection->send(bs, true);
*/
}//lint !e818 // parameter bufffer could be declared as pointint to const (but the function prototype beyond this class cannot)
@@ -1,45 +1,45 @@
// ConfigMetricsServer.cpp
// copyright 2000 Verant Interactive
// Author: Justin Randall
//-----------------------------------------------------------------------
#include "FirstMetricsServer.h"
#include "sharedFoundation/ConfigFile.h"
#include "ConfigMetricsServer.h"
//-----------------------------------------------------------------------
ConfigMetricsServer::Data * ConfigMetricsServer::data = 0;
#define KEY_INT(a,b) (data->a = ConfigFile::getKeyInt("MetricsServer", #a, b))
#define KEY_BOOL(a,b) (data->a = ConfigFile::getKeyBool("MetricsServer", #a, b))
#define KEY_REAL(a,b) (data->a = ConfigFile::getKeyReal("MetricsServer", #a, b))
#define KEY_STRING(a,b) (data->a = ConfigFile::getKeyString("MetricsServer", #a, b))
//-----------------------------------------------------------------------
void ConfigMetricsServer::install(void)
{
data = new ConfigMetricsServer::Data;
KEY_STRING(authenticationFileName, "../../exe/shared/metricsAuthentication.cfg");
KEY_STRING(clusterName, "DevCluster");
KEY_INT(metricsListenerPort, 2200);
KEY_INT(metricsServicePort, 44480);
KEY_BOOL(runTestStats, false);
KEY_INT(taskManagerPort, 60001);
KEY_STRING(metricsServiceBindInterface, "");
}
//-----------------------------------------------------------------------
void ConfigMetricsServer::remove(void)
{
delete data;
data = 0;
}
//-----------------------------------------------------------------------
// ConfigMetricsServer.cpp
// copyright 2000 Verant Interactive
// Author: Justin Randall
//-----------------------------------------------------------------------
#include "FirstMetricsServer.h"
#include "sharedFoundation/ConfigFile.h"
#include "ConfigMetricsServer.h"
//-----------------------------------------------------------------------
ConfigMetricsServer::Data * ConfigMetricsServer::data = 0;
#define KEY_INT(a,b) (data->a = ConfigFile::getKeyInt("MetricsServer", #a, b))
#define KEY_BOOL(a,b) (data->a = ConfigFile::getKeyBool("MetricsServer", #a, b))
#define KEY_REAL(a,b) (data->a = ConfigFile::getKeyReal("MetricsServer", #a, b))
#define KEY_STRING(a,b) (data->a = ConfigFile::getKeyString("MetricsServer", #a, b))
//-----------------------------------------------------------------------
void ConfigMetricsServer::install(void)
{
data = new ConfigMetricsServer::Data;
KEY_STRING(authenticationFileName, "../../exe/shared/metricsAuthentication.cfg");
KEY_STRING(clusterName, "DevCluster");
KEY_INT(metricsListenerPort, 2200);
KEY_INT(metricsServicePort, 44480);
KEY_BOOL(runTestStats, false);
KEY_INT(taskManagerPort, 60001);
KEY_STRING(metricsServiceBindInterface, "");
}
//-----------------------------------------------------------------------
void ConfigMetricsServer::remove(void)
{
delete data;
data = 0;
}
//-----------------------------------------------------------------------
@@ -1,97 +1,97 @@
// ======================================================================
//
// ConfigPlanetServer.cpp
// copyright (c) 2001 Sony Online Entertainment
//
// ======================================================================
#include "FirstPlanetServer.h"
#include "ConfigPlanetServer.h"
#include "QuadtreeNode.h"
#include "serverUtility/ConfigServerUtility.h"
#include "sharedFoundation/ConfigFile.h"
#include "sharedFoundation/ExitChain.h"
//-----------------------------------------------------------------------
ConfigPlanetServer::Data * ConfigPlanetServer::data = 0;
#define KEY_INT(a,b) (data->a = ConfigFile::getKeyInt("PlanetServer", #a, b))
#define KEY_BOOL(a,b) (data->a = ConfigFile::getKeyBool("PlanetServer", #a, b))
//#define KEY_FLOAT(a,b) (data->a = ConfigFile::getKeyFloat("PlanetServer", #a, b)) // commented out for Lint. Uncomment if you need this macro again
#define KEY_STRING(a,b) (data->a = ConfigFile::getKeyString("PlanetServer", #a, b))
// ======================================================================
void ConfigPlanetServer::install(void)
{
ConfigServerUtility::install();
ExitChain::add(&remove, "ConfigPlanetServer::remove");
data = new ConfigPlanetServer::Data;
KEY_STRING (centralServerAddress, "localhost");
KEY_INT (centralServerPort, 44455);
KEY_STRING (sceneID, "default");
KEY_INT (gameServicePort, 0);
KEY_INT (taskManagerPort, 60001);
KEY_INT (watcherServicePort, 60002);
KEY_INT (maxWatcherConnections, 1);
KEY_INT (watcherOverflowLimit, 1024 * 1024 * 8); // 8MB overflow for CS PlanetWatcher tool
KEY_BOOL (logObjectLoading, false);
KEY_INT (maxWatcherUpdatesPerMessage,500); // Max object updates to send to the watcher in a single message
KEY_STRING (gameServiceBindInterface, "");
KEY_STRING (watcherServiceBindInterface, "");
KEY_BOOL (loadWholePlanet, false);
KEY_BOOL (loadWholePlanetMultiserver, false);
KEY_BOOL (logPreloading, false);
KEY_INT (numTutorialServers, 1);
KEY_INT (maxInterestRadius, Node::getNodeSize());
KEY_INT (populationCountTime, 60); // seconds
KEY_BOOL (logChunkLoading, false);
KEY_INT (preloadBailoutTime, 0); // seconds
KEY_STRING (preloadDataTableName, "datatables/planet_server/preload_list.iff");
KEY_INT (authTransferSanityCheckTimeMs, 15000);
KEY_INT (gameServerRestartDelayTimeSeconds, 60);
KEY_BOOL (enableContentsChecking, false);
KEY_INT (maxGameServers, 0);
KEY_BOOL (enableStartupCreateProxies, true);
KEY_BOOL (requestDbSaveOnGameServerCrash, true);
KEY_BOOL (gameServerProfiling, false);
KEY_BOOL (gameServerDebugging, false);
KEY_INT (gameServerDebuggingPortBase, 0);
KEY_INT (maxTimeToWaitForGameServerStartSeconds, 5*60); // seconds
}
//-----------------------------------------------------------------------
bool ConfigPlanetServer::getGameServerProfiling()
{
return data->gameServerProfiling;
}
//-----------------------------------------------------------------------
bool ConfigPlanetServer::getGameServerDebugging()
{
return data->gameServerDebugging;
}
//-----------------------------------------------------------------------
void ConfigPlanetServer::remove(void)
{
delete data;
data = 0;
ConfigServerUtility::remove();
}
//-----------------------------------------------------------------------
int ConfigPlanetServer::getGameServerDebuggingPortBase()
{
return data->gameServerDebuggingPortBase;
}
//-----------------------------------------------------------------------
// ======================================================================
//
// ConfigPlanetServer.cpp
// copyright (c) 2001 Sony Online Entertainment
//
// ======================================================================
#include "FirstPlanetServer.h"
#include "ConfigPlanetServer.h"
#include "QuadtreeNode.h"
#include "serverUtility/ConfigServerUtility.h"
#include "sharedFoundation/ConfigFile.h"
#include "sharedFoundation/ExitChain.h"
//-----------------------------------------------------------------------
ConfigPlanetServer::Data * ConfigPlanetServer::data = 0;
#define KEY_INT(a,b) (data->a = ConfigFile::getKeyInt("PlanetServer", #a, b))
#define KEY_BOOL(a,b) (data->a = ConfigFile::getKeyBool("PlanetServer", #a, b))
//#define KEY_FLOAT(a,b) (data->a = ConfigFile::getKeyFloat("PlanetServer", #a, b)) // commented out for Lint. Uncomment if you need this macro again
#define KEY_STRING(a,b) (data->a = ConfigFile::getKeyString("PlanetServer", #a, b))
// ======================================================================
void ConfigPlanetServer::install(void)
{
ConfigServerUtility::install();
ExitChain::add(&remove, "ConfigPlanetServer::remove");
data = new ConfigPlanetServer::Data;
KEY_STRING (centralServerAddress, "localhost");
KEY_INT (centralServerPort, 44455);
KEY_STRING (sceneID, "default");
KEY_INT (gameServicePort, 0);
KEY_INT (taskManagerPort, 60001);
KEY_INT (watcherServicePort, 60002);
KEY_INT (maxWatcherConnections, 1);
KEY_INT (watcherOverflowLimit, 1024 * 1024 * 8); // 8MB overflow for CS PlanetWatcher tool
KEY_BOOL (logObjectLoading, false);
KEY_INT (maxWatcherUpdatesPerMessage,500); // Max object updates to send to the watcher in a single message
KEY_STRING (gameServiceBindInterface, "");
KEY_STRING (watcherServiceBindInterface, "");
KEY_BOOL (loadWholePlanet, false);
KEY_BOOL (loadWholePlanetMultiserver, false);
KEY_BOOL (logPreloading, false);
KEY_INT (numTutorialServers, 1);
KEY_INT (maxInterestRadius, Node::getNodeSize());
KEY_INT (populationCountTime, 60); // seconds
KEY_BOOL (logChunkLoading, false);
KEY_INT (preloadBailoutTime, 0); // seconds
KEY_STRING (preloadDataTableName, "datatables/planet_server/preload_list.iff");
KEY_INT (authTransferSanityCheckTimeMs, 15000);
KEY_INT (gameServerRestartDelayTimeSeconds, 60);
KEY_BOOL (enableContentsChecking, false);
KEY_INT (maxGameServers, 0);
KEY_BOOL (enableStartupCreateProxies, true);
KEY_BOOL (requestDbSaveOnGameServerCrash, true);
KEY_BOOL (gameServerProfiling, false);
KEY_BOOL (gameServerDebugging, false);
KEY_INT (gameServerDebuggingPortBase, 0);
KEY_INT (maxTimeToWaitForGameServerStartSeconds, 5*60); // seconds
}
//-----------------------------------------------------------------------
bool ConfigPlanetServer::getGameServerProfiling()
{
return data->gameServerProfiling;
}
//-----------------------------------------------------------------------
bool ConfigPlanetServer::getGameServerDebugging()
{
return data->gameServerDebugging;
}
//-----------------------------------------------------------------------
void ConfigPlanetServer::remove(void)
{
delete data;
data = 0;
ConfigServerUtility::remove();
}
//-----------------------------------------------------------------------
int ConfigPlanetServer::getGameServerDebuggingPortBase()
{
return data->gameServerDebuggingPortBase;
}
//-----------------------------------------------------------------------
@@ -1,68 +1,68 @@
// ConfigServerConsole.cpp
// Copyright 2000-02, Sony Online Entertainment Inc., all rights reserved.
// Author: Justin Randall
//-----------------------------------------------------------------------
#include "FirstServerConsole.h"
#include "sharedFoundation/ConfigFile.h"
#include "ConfigServerConsole.h"
//-----------------------------------------------------------------------
namespace ConfigServerConsoleNamespace
{
const char * serverAddress;
int serverPort;
}
using namespace ConfigServerConsoleNamespace;
#define KEY_INT(a,b) (a = ConfigFile::getKeyInt("ServerConsole", #a, b))
#define KEY_BOOL(a,b) (a = ConfigFile::getKeyBool("ServerConsole", #a, b))
// #define KEY_REAL(a,b) (data->a = ConfigFile::getKeyReal("LoginServer", #a, b))
#define KEY_STRING(a,b) (a = ConfigFile::getKeyString("ServerConsole", #a, b))
//-----------------------------------------------------------------------
ConfigServerConsole::ConfigServerConsole()
{
}
//-----------------------------------------------------------------------
ConfigServerConsole::~ConfigServerConsole()
{
}
//-----------------------------------------------------------------------
const char * const ConfigServerConsole::getServerAddress()
{
return serverAddress;
}
//-----------------------------------------------------------------------
unsigned short ConfigServerConsole::getServerPort()
{
return static_cast<unsigned short>(serverPort);
}
//-----------------------------------------------------------------------
void ConfigServerConsole::install()
{
KEY_STRING(serverAddress, "127.0.0.1");
KEY_INT(serverPort, 61000);
}
//-----------------------------------------------------------------------
void ConfigServerConsole::remove()
{
}
//-----------------------------------------------------------------------
// ConfigServerConsole.cpp
// Copyright 2000-02, Sony Online Entertainment Inc., all rights reserved.
// Author: Justin Randall
//-----------------------------------------------------------------------
#include "FirstServerConsole.h"
#include "sharedFoundation/ConfigFile.h"
#include "ConfigServerConsole.h"
//-----------------------------------------------------------------------
namespace ConfigServerConsoleNamespace
{
const char * serverAddress;
int serverPort;
}
using namespace ConfigServerConsoleNamespace;
#define KEY_INT(a,b) (a = ConfigFile::getKeyInt("ServerConsole", #a, b))
#define KEY_BOOL(a,b) (a = ConfigFile::getKeyBool("ServerConsole", #a, b))
// #define KEY_REAL(a,b) (data->a = ConfigFile::getKeyReal("LoginServer", #a, b))
#define KEY_STRING(a,b) (a = ConfigFile::getKeyString("ServerConsole", #a, b))
//-----------------------------------------------------------------------
ConfigServerConsole::ConfigServerConsole()
{
}
//-----------------------------------------------------------------------
ConfigServerConsole::~ConfigServerConsole()
{
}
//-----------------------------------------------------------------------
const char * const ConfigServerConsole::getServerAddress()
{
return serverAddress;
}
//-----------------------------------------------------------------------
unsigned short ConfigServerConsole::getServerPort()
{
return static_cast<unsigned short>(serverPort);
}
//-----------------------------------------------------------------------
void ConfigServerConsole::install()
{
KEY_STRING(serverAddress, "127.0.0.1");
KEY_INT(serverPort, 61000);
}
//-----------------------------------------------------------------------
void ConfigServerConsole::remove()
{
}
//-----------------------------------------------------------------------
@@ -1,108 +1,108 @@
// ConfigTaskManager.cpp
// Copyright 2000-01, Sony Online Entertainment Inc., all rights reserved.
// Author: Justin Randall
//-----------------------------------------------------------------------
#include "FirstTaskManager.h"
#include "sharedFoundation/ConfigFile.h"
#include "sharedNetwork/SetupSharedNetwork.h"
#include "ConfigTaskManager.h"
#include <vector>
//-----------------------------------------------------------------------
ConfigTaskManager::Data * ConfigTaskManager::data = 0;
#define KEY_INT(a,b) (data->a = ConfigFile::getKeyInt("TaskManager", #a, b))
#define KEY_BOOL(a,b) (data->a = ConfigFile::getKeyBool("TaskManager", #a, b))
#define KEY_FLOAT(a,b) (data->a = ConfigFile::getKeyFloat("TaskManager", #a, b))
#define KEY_STRING(a,b) (data->a = ConfigFile::getKeyString("TaskManager", #a, b))
//-----------------------------------------------------------------------
namespace ConfigTaskManagerNamespace
{
typedef std::vector<char const *> StringPtrArray;
StringPtrArray ms_environmentVariable; // ConfigFile owns the pointer
}
using namespace ConfigTaskManagerNamespace;
// ======================================================================
int ConfigTaskManager::getNumberOfEnvironmentVariables()
{
return static_cast<int>(ms_environmentVariable.size());
}
// ----------------------------------------------------------------------
char const * ConfigTaskManager::getEnvironmentVariable(int index)
{
VALIDATE_RANGE_INCLUSIVE_EXCLUSIVE(0, index, getNumberOfEnvironmentVariables());
return ms_environmentVariable[static_cast<size_t>(index)];
}
// ----------------------------------------------------------------------
void ConfigTaskManager::install(void)
{
SetupSharedNetwork::SetupData networkSetupData;
SetupSharedNetwork::getDefaultServerSetupData(networkSetupData);
SetupSharedNetwork::install(networkSetupData);
data = new ConfigTaskManager::Data;
KEY_BOOL (autoStart, true);
KEY_STRING (clusterName, "devcluster");
KEY_BOOL (verifyClusterName, false);
KEY_INT (gameServerTimeout, 600);
KEY_STRING (gameServiceBindInterface, "");
KEY_INT (gameServicePort, 60001);
KEY_INT (consoleConnectionPort, 60000);
KEY_STRING (consoleServiceBindInterface, "");
KEY_STRING (loginServerAddress, "localhost");
KEY_INT (loginServerTaskServicePort, 44459);
KEY_FLOAT (maximumLoad, 3.0f);
KEY_FLOAT (loadConnectionServer, 0.5f);
KEY_FLOAT (loadPlanetServer, 0.128f);
KEY_FLOAT (loadGameServer, 1.0f);
KEY_BOOL (publishMode, false);
KEY_STRING (rcFileName, "taskmanager.rc");
KEY_BOOL (restartCentral, false);
KEY_INT (restartDelayCentralServer, 60); // seconds
KEY_INT (restartDelayLogServer, 30);
KEY_INT (restartDelayMetricsServer, 60);
KEY_INT (restartDelayCommoditiesServer, 60);
KEY_INT (restartDelayTransferServer, 30);
KEY_STRING (taskManagerServiceBindInterface, "");
KEY_INT (taskManagerServicePort, 50001);
KEY_INT (maximumClockDriftToleranceSeconds, 10); // seconds
KEY_INT (systemTimeCheckIntervalSeconds, 60); // seconds
KEY_INT (clockDriftFatalIntervalSeconds, 1*60*60); // seconds
int index = 0;
char const * result = 0;
do
{
result = ConfigFile::getKeyString("TaskManager", "environmentVariable", index++, 0);
if (result != 0)
{
ms_environmentVariable.push_back(result);
}
}
while (result);
}
//-----------------------------------------------------------------------
void ConfigTaskManager::remove(void)
{
delete data;
data = 0;
}
//-----------------------------------------------------------------------
// ConfigTaskManager.cpp
// Copyright 2000-01, Sony Online Entertainment Inc., all rights reserved.
// Author: Justin Randall
//-----------------------------------------------------------------------
#include "FirstTaskManager.h"
#include "sharedFoundation/ConfigFile.h"
#include "sharedNetwork/SetupSharedNetwork.h"
#include "ConfigTaskManager.h"
#include <vector>
//-----------------------------------------------------------------------
ConfigTaskManager::Data * ConfigTaskManager::data = 0;
#define KEY_INT(a,b) (data->a = ConfigFile::getKeyInt("TaskManager", #a, b))
#define KEY_BOOL(a,b) (data->a = ConfigFile::getKeyBool("TaskManager", #a, b))
#define KEY_FLOAT(a,b) (data->a = ConfigFile::getKeyFloat("TaskManager", #a, b))
#define KEY_STRING(a,b) (data->a = ConfigFile::getKeyString("TaskManager", #a, b))
//-----------------------------------------------------------------------
namespace ConfigTaskManagerNamespace
{
typedef std::vector<char const *> StringPtrArray;
StringPtrArray ms_environmentVariable; // ConfigFile owns the pointer
}
using namespace ConfigTaskManagerNamespace;
// ======================================================================
int ConfigTaskManager::getNumberOfEnvironmentVariables()
{
return static_cast<int>(ms_environmentVariable.size());
}
// ----------------------------------------------------------------------
char const * ConfigTaskManager::getEnvironmentVariable(int index)
{
VALIDATE_RANGE_INCLUSIVE_EXCLUSIVE(0, index, getNumberOfEnvironmentVariables());
return ms_environmentVariable[static_cast<size_t>(index)];
}
// ----------------------------------------------------------------------
void ConfigTaskManager::install(void)
{
SetupSharedNetwork::SetupData networkSetupData;
SetupSharedNetwork::getDefaultServerSetupData(networkSetupData);
SetupSharedNetwork::install(networkSetupData);
data = new ConfigTaskManager::Data;
KEY_BOOL (autoStart, true);
KEY_STRING (clusterName, "devcluster");
KEY_BOOL (verifyClusterName, false);
KEY_INT (gameServerTimeout, 600);
KEY_STRING (gameServiceBindInterface, "");
KEY_INT (gameServicePort, 60001);
KEY_INT (consoleConnectionPort, 60000);
KEY_STRING (consoleServiceBindInterface, "");
KEY_STRING (loginServerAddress, "localhost");
KEY_INT (loginServerTaskServicePort, 44459);
KEY_FLOAT (maximumLoad, 3.0f);
KEY_FLOAT (loadConnectionServer, 0.5f);
KEY_FLOAT (loadPlanetServer, 0.128f);
KEY_FLOAT (loadGameServer, 1.0f);
KEY_BOOL (publishMode, false);
KEY_STRING (rcFileName, "taskmanager.rc");
KEY_BOOL (restartCentral, false);
KEY_INT (restartDelayCentralServer, 60); // seconds
KEY_INT (restartDelayLogServer, 30);
KEY_INT (restartDelayMetricsServer, 60);
KEY_INT (restartDelayCommoditiesServer, 60);
KEY_INT (restartDelayTransferServer, 30);
KEY_STRING (taskManagerServiceBindInterface, "");
KEY_INT (taskManagerServicePort, 50001);
KEY_INT (maximumClockDriftToleranceSeconds, 10); // seconds
KEY_INT (systemTimeCheckIntervalSeconds, 60); // seconds
KEY_INT (clockDriftFatalIntervalSeconds, 1*60*60); // seconds
int index = 0;
char const * result = 0;
do
{
result = ConfigFile::getKeyString("TaskManager", "environmentVariable", index++, 0);
if (result != 0)
{
ms_environmentVariable.push_back(result);
}
}
while (result);
}
//-----------------------------------------------------------------------
void ConfigTaskManager::remove(void)
{
delete data;
data = 0;
}
//-----------------------------------------------------------------------
@@ -1,137 +1,137 @@
// ConfigTransferServer.cpp
// Copyright 2000-01, Sony Online Entertainment Inc., all rights reserved.
// Author: Justin Randall
//-----------------------------------------------------------------------
#include "FirstTransferServer.h"
#include "sharedFoundation/ConfigFile.h"
#include "sharedNetwork/SetupSharedNetwork.h"
#include "ConfigTransferServer.h"
#include <vector>
//-----------------------------------------------------------------------
ConfigTransferServer::Data * ConfigTransferServer::data = 0;
#define KEY_INT(a,b) (data->a = ConfigFile::getKeyInt("TransferServer", #a, b))
#define KEY_BOOL(a,b) (data->a = ConfigFile::getKeyBool("TransferServer", #a, b))
#define KEY_STRING(a,b) (data->a = ConfigFile::getKeyString("TransferServer", #a, b))
//-----------------------------------------------------------------------
namespace ConfigTransferServerNamespace
{
std::vector<std::string> s_serversAllowedToUploadCharacterData;
std::vector<std::string> s_serversAllowedToDownloadCharacterData;
}
using namespace ConfigTransferServerNamespace;
// ----------------------------------------------------------------------
const std::vector<std::string> & ConfigTransferServer::getServersAllowedToUploadCharacterData()
{
return s_serversAllowedToUploadCharacterData;
}
// ----------------------------------------------------------------------
const std::vector<std::string> & ConfigTransferServer::getServersAllowedToDownloadCharacterData()
{
return s_serversAllowedToDownloadCharacterData;
}
// ----------------------------------------------------------------------
void ConfigTransferServer::install(void)
{
SetupSharedNetwork::SetupData networkSetupData;
SetupSharedNetwork::getDefaultServerSetupData(networkSetupData);
data = new ConfigTransferServer::Data;
KEY_INT (centralServerServiceBindPort, 50005);
KEY_STRING (centralServerServiceBindInterface, "");
KEY_BOOL (allowSameServerTransfers, false);
KEY_BOOL (allowAccountTransfers, true);
KEY_STRING (apiServerHostAddress, "");
KEY_BOOL (transferChatAvatar, false);
int index = 0;
char const * result = 0;
do
{
result = ConfigFile::getKeyString("TransferServer", "serverAllowedToUploadCharacterData", index++, 0);
if (result != 0)
{
s_serversAllowedToUploadCharacterData.push_back(result);
}
}
while (result);
index = 0;
result = 0;
do
{
result = ConfigFile::getKeyString("TransferServer", "serverAllowedToDownloadCharacterData", index++, 0);
if (result != 0)
{
s_serversAllowedToDownloadCharacterData.push_back(result);
}
}
while (result);
}
//-----------------------------------------------------------------------
void ConfigTransferServer::remove(void)
{
delete data;
data = 0;
}
//-----------------------------------------------------------------------
unsigned short ConfigTransferServer::getCentralServerServiceBindPort()
{
return static_cast<unsigned short>(data->centralServerServiceBindPort);
}
//-----------------------------------------------------------------------
const char * ConfigTransferServer::getCentralServerServiceBindInterface()
{
return data->centralServerServiceBindInterface;
}
//-----------------------------------------------------------------------
bool ConfigTransferServer::getAllowSameServerTransfers()
{
return data->allowSameServerTransfers;
}
//-----------------------------------------------------------------------
bool ConfigTransferServer::getAllowAccountTransfers()
{
return data->allowAccountTransfers;
}
//-----------------------------------------------------------------------
const char * ConfigTransferServer::getApiServerHostAddress()
{
return data->apiServerHostAddress;
}
//-----------------------------------------------------------------------
const bool ConfigTransferServer::getTransferChatAvatar()
{
return data->transferChatAvatar;
}
//-----------------------------------------------------------------------
// ConfigTransferServer.cpp
// Copyright 2000-01, Sony Online Entertainment Inc., all rights reserved.
// Author: Justin Randall
//-----------------------------------------------------------------------
#include "FirstTransferServer.h"
#include "sharedFoundation/ConfigFile.h"
#include "sharedNetwork/SetupSharedNetwork.h"
#include "ConfigTransferServer.h"
#include <vector>
//-----------------------------------------------------------------------
ConfigTransferServer::Data * ConfigTransferServer::data = 0;
#define KEY_INT(a,b) (data->a = ConfigFile::getKeyInt("TransferServer", #a, b))
#define KEY_BOOL(a,b) (data->a = ConfigFile::getKeyBool("TransferServer", #a, b))
#define KEY_STRING(a,b) (data->a = ConfigFile::getKeyString("TransferServer", #a, b))
//-----------------------------------------------------------------------
namespace ConfigTransferServerNamespace
{
std::vector<std::string> s_serversAllowedToUploadCharacterData;
std::vector<std::string> s_serversAllowedToDownloadCharacterData;
}
using namespace ConfigTransferServerNamespace;
// ----------------------------------------------------------------------
const std::vector<std::string> & ConfigTransferServer::getServersAllowedToUploadCharacterData()
{
return s_serversAllowedToUploadCharacterData;
}
// ----------------------------------------------------------------------
const std::vector<std::string> & ConfigTransferServer::getServersAllowedToDownloadCharacterData()
{
return s_serversAllowedToDownloadCharacterData;
}
// ----------------------------------------------------------------------
void ConfigTransferServer::install(void)
{
SetupSharedNetwork::SetupData networkSetupData;
SetupSharedNetwork::getDefaultServerSetupData(networkSetupData);
data = new ConfigTransferServer::Data;
KEY_INT (centralServerServiceBindPort, 50005);
KEY_STRING (centralServerServiceBindInterface, "");
KEY_BOOL (allowSameServerTransfers, false);
KEY_BOOL (allowAccountTransfers, true);
KEY_STRING (apiServerHostAddress, "");
KEY_BOOL (transferChatAvatar, false);
int index = 0;
char const * result = 0;
do
{
result = ConfigFile::getKeyString("TransferServer", "serverAllowedToUploadCharacterData", index++, 0);
if (result != 0)
{
s_serversAllowedToUploadCharacterData.push_back(result);
}
}
while (result);
index = 0;
result = 0;
do
{
result = ConfigFile::getKeyString("TransferServer", "serverAllowedToDownloadCharacterData", index++, 0);
if (result != 0)
{
s_serversAllowedToDownloadCharacterData.push_back(result);
}
}
while (result);
}
//-----------------------------------------------------------------------
void ConfigTransferServer::remove(void)
{
delete data;
data = 0;
}
//-----------------------------------------------------------------------
unsigned short ConfigTransferServer::getCentralServerServiceBindPort()
{
return static_cast<unsigned short>(data->centralServerServiceBindPort);
}
//-----------------------------------------------------------------------
const char * ConfigTransferServer::getCentralServerServiceBindInterface()
{
return data->centralServerServiceBindInterface;
}
//-----------------------------------------------------------------------
bool ConfigTransferServer::getAllowSameServerTransfers()
{
return data->allowSameServerTransfers;
}
//-----------------------------------------------------------------------
bool ConfigTransferServer::getAllowAccountTransfers()
{
return data->allowAccountTransfers;
}
//-----------------------------------------------------------------------
const char * ConfigTransferServer::getApiServerHostAddress()
{
return data->apiServerHostAddress;
}
//-----------------------------------------------------------------------
const bool ConfigTransferServer::getTransferChatAvatar()
{
return data->transferChatAvatar;
}
//-----------------------------------------------------------------------
File diff suppressed because it is too large Load Diff
@@ -1,136 +1,136 @@
// ======================================================================
//
// ConfigServerDatabase.cpp
// copyright (c) 2001 Sony Online Entertainment
//
// ======================================================================
#include "serverDatabase/FirstServerDatabase.h"
#include "serverDatabase/ConfigServerDatabase.h"
#include "serverUtility/ConfigServerUtility.h"
#include "sharedFoundation/ConfigFile.h"
#include "sharedFoundation/ExitChain.h"
#include "sharedFoundation/NetworkId.h"
#include <string>
//-------------------------------------------------------------------
ConfigServerDatabase::Data* ConfigServerDatabase::data;
static ConfigServerDatabase::Data staticData;
//-------------------------------------------------------------------
#define KEY_INT(a,b) (data->a = ConfigFile::getKeyInt("dbProcess", #a, b))
#define KEY_BOOL(a,b) (data->a = ConfigFile::getKeyBool("dbProcess", #a, b))
#define KEY_FLOAT(a,b) (data->a = ConfigFile::getKeyFloat("dbProcess", #a, b))
#define KEY_STRING(a,b) (data->a = ConfigFile::getKeyString("dbProcess", #a, b))
//-------------------------------------------------------------------
void ConfigServerDatabase::install(void)
{
ExitChain::add(ConfigServerDatabase::remove,"ConfigServerDatabase::remove");
ConfigServerUtility::install();
data = &staticData;
KEY_INT (objvarNameCleanupTime, 0);
KEY_INT (orphanedObjectCleanupTime, 0);
KEY_INT (marketAttributesCleanupTime, 0);
KEY_INT (messagesCleanupTime, 0);
KEY_INT (brokenObjectCleanupTime, 0);
KEY_INT (vendorObjectCleanupTime, 0);
KEY_STRING (customSQLFilename,"");
KEY_BOOL (enableFixBadCells, false);
KEY_STRING (objectTemplateListUpdateFilename,"");
KEY_STRING (DSN,"gameserver");
KEY_STRING (alternateDSN,"");
KEY_STRING (databaseUID,"gameserver");
KEY_STRING (databasePWD,"gameserver");
KEY_STRING (databaseProtocol,"DEFAULT");
KEY_STRING (centralServerAddress, "localhost");
KEY_INT (centralServerPort, 44451);
KEY_STRING (commoditiesServerAddress, "localhost");
KEY_INT (commoditiesServerPort, 44457); //todo: confirm that this is a good port MSH
KEY_INT (taskManagerPort, 60001);
KEY_INT (expectedDBVersion, 270);
KEY_BOOL (correctDBVersionRequired,true);
KEY_INT (saveFrequencyLimit,10);
KEY_STRING (schemaOwner, "");
KEY_STRING (goldSchemaOwner, "");
KEY_FLOAT (uniqueMessageCacheTimeSec, 30.0f);
KEY_INT (loaderThreads,2);
KEY_INT (persisterThreads,1);
KEY_INT (newCharacterThreads,1);
KEY_INT (characterImmediateDeleteMinutes,120);
KEY_BOOL (logObjectLoading, false);
KEY_BOOL (enableQueryProfile, false);
KEY_BOOL (verboseQueryMode, false);
KEY_BOOL (logWorkerThreads, false);
KEY_STRING (gameServiceBindInterface, "");
KEY_BOOL (reportSaveTimes, false);
KEY_BOOL (shouldSleep, true);
KEY_BOOL (enableLoadLocks, true);
KEY_INT (databaseReconnectTime, 0);
KEY_BOOL (logChunkLoading,false);
KEY_BOOL (useMemoryManagerForOCI,true);
KEY_INT (maxCharactersPerLoadRequest,10);
KEY_INT (maxChunksPerLoadRequest,200);
KEY_FLOAT (maxLoadStartDelay,300.0f);
KEY_INT (maxErrorCountBeforeDisconnect,5);
KEY_INT (maxErrorCountBeforeBailout,15);
KEY_INT (errorSleepTime,5000);
KEY_INT (disconnectSleepTime,30000);
KEY_INT (saveAtModulus,-1);
KEY_INT (saveAtDivisor,10);
KEY_INT (backloggedQueueSize,50);
KEY_INT (backloggedRecoveryQueueSize,25);
KEY_INT (maxTimewarp,data->saveFrequencyLimit * 2 < 600 ? 600 : data->saveFrequencyLimit * 2);
KEY_BOOL (enableObjvarPacking, true);
KEY_INT (prefetchNumRows,0);
KEY_INT (prefetchMemory,0);
KEY_INT (defaultFetchBatchSize,1000);
KEY_INT (queryReportingRate,60);
KEY_INT (enableDatabaseErrorLogging, 0);
KEY_INT (defaultMessageBulkBindSize, 1000);
KEY_BOOL (enableGoldDatabase, false);
KEY_STRING (maxGoldNetworkId, "10000000");
KEY_FLOAT (defaultQueueUpdateTimeLimit, 0.25f);
KEY_BOOL (enableDataCleanup, false);
KEY_INT (defaultLazyDeleteBulkBindSize, 100);
KEY_INT (defaultLazyDeleteSleepTime, 1000);
KEY_INT (writeDelay, 0);
KEY_BOOL (delayUnloadIfObjectStillHasData, true);
KEY_FLOAT (experienceConsolidationTime, 0.0f);
KEY_INT (maxLoaderFinishedTasks, 100);
KEY_FLOAT (reportLongFrameTime, 1.0f);
KEY_BOOL (enableVerboseMessageLogging, false);
KEY_BOOL (profilerExpandAll, true);
KEY_INT (profilerDisplayPercentageMinimum, 0);
KEY_BOOL (fatalOnDataError, false);
KEY_INT (maxUnackedLoadCount, 1000000000); // by default, set to an "unlimited" number, and use maxUnackedLoadCountPerServer as the cap
KEY_INT (maxUnackedLoadCountPerServer, 2);
KEY_INT (auctionLocationLoadBatchSize, 100);
KEY_INT (auctionLoadBatchSize, 100);
KEY_INT (auctionAttributeLoadBatchSize, 100);
KEY_INT (auctionBidLoadBatchSize, 100);
KEY_INT (oldestUnackedLoadAlertThresholdSeconds, 10*60); // seconds
}
//-------------------------------------------------------------------
void ConfigServerDatabase::remove(void)
{
ConfigServerUtility::remove();
}
// ----------------------------------------------------------------------
const NetworkId & ConfigServerDatabase::getMaxGoldNetworkId(void)
{
static const NetworkId theValue(std::string(data->maxGoldNetworkId));
return theValue;
}
// ======================================================================
// ======================================================================
//
// ConfigServerDatabase.cpp
// copyright (c) 2001 Sony Online Entertainment
//
// ======================================================================
#include "serverDatabase/FirstServerDatabase.h"
#include "serverDatabase/ConfigServerDatabase.h"
#include "serverUtility/ConfigServerUtility.h"
#include "sharedFoundation/ConfigFile.h"
#include "sharedFoundation/ExitChain.h"
#include "sharedFoundation/NetworkId.h"
#include <string>
//-------------------------------------------------------------------
ConfigServerDatabase::Data* ConfigServerDatabase::data;
static ConfigServerDatabase::Data staticData;
//-------------------------------------------------------------------
#define KEY_INT(a,b) (data->a = ConfigFile::getKeyInt("dbProcess", #a, b))
#define KEY_BOOL(a,b) (data->a = ConfigFile::getKeyBool("dbProcess", #a, b))
#define KEY_FLOAT(a,b) (data->a = ConfigFile::getKeyFloat("dbProcess", #a, b))
#define KEY_STRING(a,b) (data->a = ConfigFile::getKeyString("dbProcess", #a, b))
//-------------------------------------------------------------------
void ConfigServerDatabase::install(void)
{
ExitChain::add(ConfigServerDatabase::remove,"ConfigServerDatabase::remove");
ConfigServerUtility::install();
data = &staticData;
KEY_INT (objvarNameCleanupTime, 0);
KEY_INT (orphanedObjectCleanupTime, 0);
KEY_INT (marketAttributesCleanupTime, 0);
KEY_INT (messagesCleanupTime, 0);
KEY_INT (brokenObjectCleanupTime, 0);
KEY_INT (vendorObjectCleanupTime, 0);
KEY_STRING (customSQLFilename,"");
KEY_BOOL (enableFixBadCells, false);
KEY_STRING (objectTemplateListUpdateFilename,"");
KEY_STRING (DSN,"gameserver");
KEY_STRING (alternateDSN,"");
KEY_STRING (databaseUID,"gameserver");
KEY_STRING (databasePWD,"gameserver");
KEY_STRING (databaseProtocol,"DEFAULT");
KEY_STRING (centralServerAddress, "localhost");
KEY_INT (centralServerPort, 44451);
KEY_STRING (commoditiesServerAddress, "localhost");
KEY_INT (commoditiesServerPort, 44457); //todo: confirm that this is a good port MSH
KEY_INT (taskManagerPort, 60001);
KEY_INT (expectedDBVersion, 270);
KEY_BOOL (correctDBVersionRequired,true);
KEY_INT (saveFrequencyLimit,10);
KEY_STRING (schemaOwner, "");
KEY_STRING (goldSchemaOwner, "");
KEY_FLOAT (uniqueMessageCacheTimeSec, 30.0f);
KEY_INT (loaderThreads,2);
KEY_INT (persisterThreads,1);
KEY_INT (newCharacterThreads,1);
KEY_INT (characterImmediateDeleteMinutes,120);
KEY_BOOL (logObjectLoading, false);
KEY_BOOL (enableQueryProfile, false);
KEY_BOOL (verboseQueryMode, false);
KEY_BOOL (logWorkerThreads, false);
KEY_STRING (gameServiceBindInterface, "");
KEY_BOOL (reportSaveTimes, false);
KEY_BOOL (shouldSleep, true);
KEY_BOOL (enableLoadLocks, true);
KEY_INT (databaseReconnectTime, 0);
KEY_BOOL (logChunkLoading,false);
KEY_BOOL (useMemoryManagerForOCI,true);
KEY_INT (maxCharactersPerLoadRequest,10);
KEY_INT (maxChunksPerLoadRequest,200);
KEY_FLOAT (maxLoadStartDelay,300.0f);
KEY_INT (maxErrorCountBeforeDisconnect,5);
KEY_INT (maxErrorCountBeforeBailout,15);
KEY_INT (errorSleepTime,5000);
KEY_INT (disconnectSleepTime,30000);
KEY_INT (saveAtModulus,-1);
KEY_INT (saveAtDivisor,10);
KEY_INT (backloggedQueueSize,50);
KEY_INT (backloggedRecoveryQueueSize,25);
KEY_INT (maxTimewarp,data->saveFrequencyLimit * 2 < 600 ? 600 : data->saveFrequencyLimit * 2);
KEY_BOOL (enableObjvarPacking, true);
KEY_INT (prefetchNumRows,0);
KEY_INT (prefetchMemory,0);
KEY_INT (defaultFetchBatchSize,1000);
KEY_INT (queryReportingRate,60);
KEY_INT (enableDatabaseErrorLogging, 0);
KEY_INT (defaultMessageBulkBindSize, 1000);
KEY_BOOL (enableGoldDatabase, false);
KEY_STRING (maxGoldNetworkId, "10000000");
KEY_FLOAT (defaultQueueUpdateTimeLimit, 0.25f);
KEY_BOOL (enableDataCleanup, false);
KEY_INT (defaultLazyDeleteBulkBindSize, 100);
KEY_INT (defaultLazyDeleteSleepTime, 1000);
KEY_INT (writeDelay, 0);
KEY_BOOL (delayUnloadIfObjectStillHasData, true);
KEY_FLOAT (experienceConsolidationTime, 0.0f);
KEY_INT (maxLoaderFinishedTasks, 100);
KEY_FLOAT (reportLongFrameTime, 1.0f);
KEY_BOOL (enableVerboseMessageLogging, false);
KEY_BOOL (profilerExpandAll, true);
KEY_INT (profilerDisplayPercentageMinimum, 0);
KEY_BOOL (fatalOnDataError, false);
KEY_INT (maxUnackedLoadCount, 1000000000); // by default, set to an "unlimited" number, and use maxUnackedLoadCountPerServer as the cap
KEY_INT (maxUnackedLoadCountPerServer, 2);
KEY_INT (auctionLocationLoadBatchSize, 100);
KEY_INT (auctionLoadBatchSize, 100);
KEY_INT (auctionAttributeLoadBatchSize, 100);
KEY_INT (auctionBidLoadBatchSize, 100);
KEY_INT (oldestUnackedLoadAlertThresholdSeconds, 10*60); // seconds
}
//-------------------------------------------------------------------
void ConfigServerDatabase::remove(void)
{
ConfigServerUtility::remove();
}
// ----------------------------------------------------------------------
const NetworkId & ConfigServerDatabase::getMaxGoldNetworkId(void)
{
static const NetworkId theValue(std::string(data->maxGoldNetworkId));
return theValue;
}
// ======================================================================
@@ -193,7 +193,6 @@ DatabaseProcess::~DatabaseProcess()
void DatabaseProcess::run(void)
{
static bool shouldSleep = ConfigServerDatabase::getShouldSleep();
unsigned long startTime;
bool idle=false;
int loopcount=0;
float nextMemoryReportTime=0;
@@ -205,8 +204,6 @@ void DatabaseProcess::run(void)
{
PROFILER_AUTO_BLOCK_DEFINE("main loop");
startTime = Clock::timeMs();
if (!Os::update())
setDone("OS condition (Parent pid change)");
@@ -34,8 +34,8 @@ namespace Archive
class CityInfo
{
friend void Archive::get(ReadIterator & source, CityInfo & target);
friend void Archive::put(ByteStream & target, const CityInfo & source);
friend void Archive::get(Archive::ReadIterator & source, CityInfo & target);
friend void Archive::put(Archive::ByteStream & target, const CityInfo & source);
public:
CityInfo();
@@ -30,8 +30,8 @@ namespace Archive
class CityStructureInfo
{
friend void Archive::get(ReadIterator & source, CityStructureInfo & target);
friend void Archive::put(ByteStream & target, const CityStructureInfo & source);
friend void Archive::get(Archive::ReadIterator & source, CityStructureInfo & target);
friend void Archive::put(Archive::ByteStream & target, const CityStructureInfo & source);
public:
bool operator== (const CityStructureInfo& rhs) const;
File diff suppressed because it is too large Load Diff
@@ -1,193 +1,193 @@
// ======================================================================
//
// ConsoleCommandParserCraft.cpp
// copyright (c) 2001 Sony Online Entertainment
//
// ======================================================================
#include "serverGame/FirstServerGame.h"
#include "serverGame/ConsoleCommandParserCraft.h"
#include "UnicodeUtils.h"
#include "serverGame/ConsoleCommandParserCraftStation.h"
#include "serverGame/CreatureObject.h"
#include "serverGame/GameServer.h"
#include "serverGame/PlayerCreatureController.h"
#include "serverGame/PlayerObject.h"
#include "serverGame/ServerWorld.h"
#include "sharedFoundation/GameControllerMessage.h"
// ======================================================================
static const CommandParser::CmdInfo cmds[] =
{
{"draft", 1, "<number>", "Select a draft schematic to craft with"},
{"fillslot", 3, "<slot #> <slot option #> <ingredient oid>", "Fill a draft schematic slot with an ingredient"},
{"nextstage", 0, "", "Go to the next stage of crafting"},
{"experiment", 3, "<attribute #> <experiment points> <core level>", "Experiment to improve an attribute"},
{"customize", 2, "<custom #> <value>", "Set a customization property"},
{"makeprototype", 1, "<name>", "Create a prototype object"},
{"makeschematic", 1, "<name>", "Create manufacturing schematic"},
{"stop", 0, "", "Stops the current crafting session"},
{"enableSchematicFilter", 0, "", "Enables schematic filtering (god mode only)"},
{"disableSchematicFilter", 0, "", "Disables schematic filtering (god mode only)"},
{"", 0, "", ""} // this must be last
};
//-----------------------------------------------------------------
ConsoleCommandParserCraft::ConsoleCommandParserCraft (void) :
CommandParser ("craft", 0, "...", "Crafting related commands.", 0)
{
createDelegateCommands (cmds);
addSubCommand(new ConsoleCommandParserCraftStation());
}
//-----------------------------------------------------------------
bool ConsoleCommandParserCraft::performParsing (const NetworkId & userId, const StringVector_t & argv, const String_t & originalCommand, String_t & result, const CommandParser * node)
{
NOT_NULL (node);
UNREF(originalCommand);
CreatureObject * creatureObject = safe_cast<CreatureObject *>(ServerWorld::findObjectByNetworkId(userId));
PlayerObject * playerObject = const_cast<PlayerObject *>(PlayerCreatureController::getPlayerObject(creatureObject));
//-----------------------------------------------------------------
if (isAbbrev( argv [0], "draft"))
{
int index = atoi(Unicode::wideToNarrow(argv[1]).c_str()) - 1;
playerObject->selectDraftSchematic(index);
result += getErrorMessage (argv[0], ERR_SUCCESS);
}
//-----------------------------------------------------------------
else if (isAbbrev( argv [0], "fillslot"))
{
int slot(atoi(Unicode::wideToNarrow(argv[1]).c_str()));
int option(atoi(Unicode::wideToNarrow(argv[2]).c_str()));
NetworkId ingredient(Unicode::wideToNarrow(argv[3]));
if (playerObject->fillSlot(slot - 1, option - 1, ingredient))
result += getErrorMessage (argv[0], ERR_SUCCESS);
else
result += getErrorMessage (argv[0], ERR_FILLSLOT_FAIL);
}
//-----------------------------------------------------------------
else if (isAbbrev( argv [0], "nextstage"))
{
if (playerObject->goToNextCraftingStage())
result += getErrorMessage (argv[0], ERR_SUCCESS);
else
result += getErrorMessage (argv[0], ERR_FAIL);
}
//-----------------------------------------------------------------
else if (isAbbrev( argv [0], "experiment"))
{
int attribute(atoi(Unicode::wideToNarrow(argv[1]).c_str()));
int points(atoi(Unicode::wideToNarrow(argv[2]).c_str()));
int core(atoi(Unicode::wideToNarrow(argv[3]).c_str()));
std::vector<MessageQueueCraftExperiment::ExperimentInfo> experiment;
experiment.push_back(MessageQueueCraftExperiment::ExperimentInfo(attribute - 1, points));
if (playerObject->experiment(experiment, points, core))
result += getErrorMessage (argv[0], ERR_SUCCESS);
else
result += getErrorMessage (argv[0], ERR_FILLSLOT_FAIL);
}
//-----------------------------------------------------------------
else if (isAbbrev( argv [0], "customize"))
{
int property(atoi(Unicode::wideToNarrow(argv[1]).c_str()));
int value(atoi(Unicode::wideToNarrow(argv[2]).c_str()));
if (playerObject->customize(property - 1, value))
result += getErrorMessage (argv[0], ERR_SUCCESS);
else
result += getErrorMessage (argv[0], ERR_CUSTOMIZE_FAIL);
}
//-----------------------------------------------------------------
else if (isAbbrev( argv [0], "makeprototype"))
{
std::vector<Crafting::CustomValue> customizations;
if (playerObject->setCustomizationData(argv[1], -1, customizations, 1) ==
Crafting::CE_success && playerObject->createPrototype(true))
{
result += getErrorMessage (argv[0], ERR_SUCCESS);
}
else
result += getErrorMessage (argv[0], ERR_FAIL);
}
//-----------------------------------------------------------------
else if (isAbbrev( argv [0], "makeschematic"))
{
result += getErrorMessage (argv[0], ERR_FAIL);
}
//-----------------------------------------------------------------
else if (isAbbrev( argv [0], "stop"))
{
playerObject->stopCrafting(true);
result += getErrorMessage (argv[0], ERR_SUCCESS);
}
//-----------------------------------------------------------------
else if (isAbbrev( argv [0], "enableSchematicFilter"))
{
if (creatureObject->getClient() == NULL || !creatureObject->getClient()->isGod())
result += getErrorMessage (argv[0], ERR_FAIL);
else
{
creatureObject->enableSchematicFiltering();
result += getErrorMessage (argv[0], ERR_SUCCESS);
}
}
//-----------------------------------------------------------------
else if (isAbbrev( argv [0], "disableSchematicFilter"))
{
if (creatureObject->getClient() == NULL || !creatureObject->getClient()->isGod())
result += getErrorMessage (argv[0], ERR_FAIL);
else
{
creatureObject->disableSchematicFiltering();
result += getErrorMessage (argv[0], ERR_SUCCESS);
}
}
//-----------------------------------------------------------------
else
{
result += getErrorMessage(argv[0], ERR_NO_HANDLER);
}
return true;
}
// ======================================================================
// ======================================================================
//
// ConsoleCommandParserCraft.cpp
// copyright (c) 2001 Sony Online Entertainment
//
// ======================================================================
#include "serverGame/FirstServerGame.h"
#include "serverGame/ConsoleCommandParserCraft.h"
#include "UnicodeUtils.h"
#include "serverGame/ConsoleCommandParserCraftStation.h"
#include "serverGame/CreatureObject.h"
#include "serverGame/GameServer.h"
#include "serverGame/PlayerCreatureController.h"
#include "serverGame/PlayerObject.h"
#include "serverGame/ServerWorld.h"
#include "sharedFoundation/GameControllerMessage.h"
// ======================================================================
static const CommandParser::CmdInfo cmds[] =
{
{"draft", 1, "<number>", "Select a draft schematic to craft with"},
{"fillslot", 3, "<slot #> <slot option #> <ingredient oid>", "Fill a draft schematic slot with an ingredient"},
{"nextstage", 0, "", "Go to the next stage of crafting"},
{"experiment", 3, "<attribute #> <experiment points> <core level>", "Experiment to improve an attribute"},
{"customize", 2, "<custom #> <value>", "Set a customization property"},
{"makeprototype", 1, "<name>", "Create a prototype object"},
{"makeschematic", 1, "<name>", "Create manufacturing schematic"},
{"stop", 0, "", "Stops the current crafting session"},
{"enableSchematicFilter", 0, "", "Enables schematic filtering (god mode only)"},
{"disableSchematicFilter", 0, "", "Disables schematic filtering (god mode only)"},
{"", 0, "", ""} // this must be last
};
//-----------------------------------------------------------------
ConsoleCommandParserCraft::ConsoleCommandParserCraft (void) :
CommandParser ("craft", 0, "...", "Crafting related commands.", 0)
{
createDelegateCommands (cmds);
addSubCommand(new ConsoleCommandParserCraftStation());
}
//-----------------------------------------------------------------
bool ConsoleCommandParserCraft::performParsing (const NetworkId & userId, const StringVector_t & argv, const String_t & originalCommand, String_t & result, const CommandParser * node)
{
NOT_NULL (node);
UNREF(originalCommand);
CreatureObject * creatureObject = safe_cast<CreatureObject *>(ServerWorld::findObjectByNetworkId(userId));
PlayerObject * playerObject = const_cast<PlayerObject *>(PlayerCreatureController::getPlayerObject(creatureObject));
//-----------------------------------------------------------------
if (isAbbrev( argv [0], "draft"))
{
int index = atoi(Unicode::wideToNarrow(argv[1]).c_str()) - 1;
playerObject->selectDraftSchematic(index);
result += getErrorMessage (argv[0], ERR_SUCCESS);
}
//-----------------------------------------------------------------
else if (isAbbrev( argv [0], "fillslot"))
{
int slot(atoi(Unicode::wideToNarrow(argv[1]).c_str()));
int option(atoi(Unicode::wideToNarrow(argv[2]).c_str()));
NetworkId ingredient(Unicode::wideToNarrow(argv[3]));
if (playerObject->fillSlot(slot - 1, option - 1, ingredient))
result += getErrorMessage (argv[0], ERR_SUCCESS);
else
result += getErrorMessage (argv[0], ERR_FILLSLOT_FAIL);
}
//-----------------------------------------------------------------
else if (isAbbrev( argv [0], "nextstage"))
{
if (playerObject->goToNextCraftingStage())
result += getErrorMessage (argv[0], ERR_SUCCESS);
else
result += getErrorMessage (argv[0], ERR_FAIL);
}
//-----------------------------------------------------------------
else if (isAbbrev( argv [0], "experiment"))
{
int attribute(atoi(Unicode::wideToNarrow(argv[1]).c_str()));
int points(atoi(Unicode::wideToNarrow(argv[2]).c_str()));
int core(atoi(Unicode::wideToNarrow(argv[3]).c_str()));
std::vector<MessageQueueCraftExperiment::ExperimentInfo> experiment;
experiment.push_back(MessageQueueCraftExperiment::ExperimentInfo(attribute - 1, points));
if (playerObject->experiment(experiment, points, core))
result += getErrorMessage (argv[0], ERR_SUCCESS);
else
result += getErrorMessage (argv[0], ERR_FILLSLOT_FAIL);
}
//-----------------------------------------------------------------
else if (isAbbrev( argv [0], "customize"))
{
int property(atoi(Unicode::wideToNarrow(argv[1]).c_str()));
int value(atoi(Unicode::wideToNarrow(argv[2]).c_str()));
if (playerObject->customize(property - 1, value))
result += getErrorMessage (argv[0], ERR_SUCCESS);
else
result += getErrorMessage (argv[0], ERR_CUSTOMIZE_FAIL);
}
//-----------------------------------------------------------------
else if (isAbbrev( argv [0], "makeprototype"))
{
std::vector<Crafting::CustomValue> customizations;
if (playerObject->setCustomizationData(argv[1], -1, customizations, 1) ==
Crafting::CE_success && playerObject->createPrototype(true))
{
result += getErrorMessage (argv[0], ERR_SUCCESS);
}
else
result += getErrorMessage (argv[0], ERR_FAIL);
}
//-----------------------------------------------------------------
else if (isAbbrev( argv [0], "makeschematic"))
{
result += getErrorMessage (argv[0], ERR_FAIL);
}
//-----------------------------------------------------------------
else if (isAbbrev( argv [0], "stop"))
{
playerObject->stopCrafting(true);
result += getErrorMessage (argv[0], ERR_SUCCESS);
}
//-----------------------------------------------------------------
else if (isAbbrev( argv [0], "enableSchematicFilter"))
{
if (creatureObject->getClient() == NULL || !creatureObject->getClient()->isGod())
result += getErrorMessage (argv[0], ERR_FAIL);
else
{
creatureObject->enableSchematicFiltering();
result += getErrorMessage (argv[0], ERR_SUCCESS);
}
}
//-----------------------------------------------------------------
else if (isAbbrev( argv [0], "disableSchematicFilter"))
{
if (creatureObject->getClient() == NULL || !creatureObject->getClient()->isGod())
result += getErrorMessage (argv[0], ERR_FAIL);
else
{
creatureObject->disableSchematicFiltering();
result += getErrorMessage (argv[0], ERR_SUCCESS);
}
}
//-----------------------------------------------------------------
else
{
result += getErrorMessage(argv[0], ERR_NO_HANDLER);
}
return true;
}
// ======================================================================
@@ -119,7 +119,8 @@ bool ConsoleCommandParserSpaceAi::performParsing(const NetworkId & userId, const
{
Vector const & position_w = iterTransformList->getPosition_p();
message += formattedString.sprintf("[%d] %.2f, %.2f, %.2f%s", index++, position_w.x, position_w.y, position_w.z, (index < static_cast<int>(transformList.size())) ? "\n" : "");
message += formattedString.sprintf("[%d] %.2f, %.2f, %.2f%s", (index+1), position_w.x, position_w.y, position_w.z, (index < static_cast<int>(transformList.size())) ? "\n" : "");
index++;
}
Chat::sendSystemMessage(*serverObject, Unicode::narrowToWide(message.c_str()), Unicode::emptyString);
@@ -1,130 +1,130 @@
// ======================================================================
//
// ConsoleCommandParserSpawner.cpp
// copyright (c) 2001 Sony Online Entertainment
//
// ======================================================================
#include "serverGame/FirstServerGame.h"
#include "serverGame/ConsoleCommandParserSpawner.h"
#include "UnicodeUtils.h"
#include "serverGame/CreatureObject.h"
#include <cstdio>
#include <unordered_set>
// ======================================================================
namespace
{
namespace CommandNames
{
#define MAKE_COMMAND(a) const char * const a = #a
MAKE_COMMAND(showQueue);
MAKE_COMMAND(showCreatures);
#undef MAKE_COMMAND
}
const CommandParser::CmdInfo cmds[] =
{
{CommandNames::showQueue, 0, "", "Lists players on the spawn queue."},
{CommandNames::showCreatures, 0, "[pc|npc]", "Lists all creatures on the server."},
{"", 0, "", ""} // this must be last
};
}
//-----------------------------------------------------------------
ConsoleCommandParserSpawner::ConsoleCommandParserSpawner (void) :
CommandParser ("Spawner", 0, "...", "Spawner related commands.", 0)
{
createDelegateCommands (cmds);
}
//----------------------------------------------------------------------
bool ConsoleCommandParserSpawner::performParsing (const NetworkId &, const StringVector_t & argv, const String_t & , String_t & result, const CommandParser *)
{
// ----------------------------------------------------------------
if (isCommand (argv[0], CommandNames::showQueue))
{
CreatureObject::showSpawnQueue(result);
return true;
}
else if(isCommand (argv[0], CommandNames::showCreatures))
{
bool npcOnly = false;
bool pcOnly = false;
if(argv.size() >= 2)
{
std::string arg2 = Unicode::wideToNarrow(argv[1]);
if(arg2 == "npc")
{
npcOnly = true;
}
else if(arg2 == "pc")
{
pcOnly = true;
}
}
static const Unicode::String header(Unicode::narrowToWide(std::string("Creature Listing - ID: POS: Auth Server: Template Name\n")));
result += header;
const CreatureObject::AllCreaturesSet & creatureList = CreatureObject::getAllCreatures();
CreatureObject::AllCreaturesSet::const_iterator i;
int count = 0;
for(i = creatureList.begin(); i != creatureList.end(); ++i)
{
const CreatureObject * creature = (*i);
if(creature)
{
if(pcOnly && (!creature->isPlayerControlled()) )
continue;
if(npcOnly && creature->isPlayerControlled())
continue;
std::string creatureEntry = creature->getNetworkId().getValueString();
creatureEntry += ": ";
char locBuffer[32] = {"\0"};
Vector loc = creature->getTransform_o2w().getPosition_p();
snprintf(locBuffer, sizeof(locBuffer), "%.0f, %.0f: ", loc.x, loc.z);
creatureEntry += locBuffer;
snprintf(locBuffer, sizeof(locBuffer), "%lu: ", creature->getAuthServerProcessId());
creatureEntry += locBuffer;
creatureEntry += creature->getObjectTemplateName();
creatureEntry += "\n";
result += Unicode::narrowToWide(creatureEntry);
count++;
}
}
char countBuffer[32] = {"\0"};
snprintf(countBuffer, sizeof(countBuffer), "%d creatures listed: ", count);
result += Unicode::narrowToWide(std::string(countBuffer));
return true;
}
else
{
result += getErrorMessage (argv[0], ERR_NO_HANDLER);
return false;
}
return true;
}
// ======================================================================
// ======================================================================
//
// ConsoleCommandParserSpawner.cpp
// copyright (c) 2001 Sony Online Entertainment
//
// ======================================================================
#include "serverGame/FirstServerGame.h"
#include "serverGame/ConsoleCommandParserSpawner.h"
#include "UnicodeUtils.h"
#include "serverGame/CreatureObject.h"
#include <cstdio>
#include <unordered_set>
// ======================================================================
namespace
{
namespace CommandNames
{
#define MAKE_COMMAND(a) const char * const a = #a
MAKE_COMMAND(showQueue);
MAKE_COMMAND(showCreatures);
#undef MAKE_COMMAND
}
const CommandParser::CmdInfo cmds[] =
{
{CommandNames::showQueue, 0, "", "Lists players on the spawn queue."},
{CommandNames::showCreatures, 0, "[pc|npc]", "Lists all creatures on the server."},
{"", 0, "", ""} // this must be last
};
}
//-----------------------------------------------------------------
ConsoleCommandParserSpawner::ConsoleCommandParserSpawner (void) :
CommandParser ("Spawner", 0, "...", "Spawner related commands.", 0)
{
createDelegateCommands (cmds);
}
//----------------------------------------------------------------------
bool ConsoleCommandParserSpawner::performParsing (const NetworkId &, const StringVector_t & argv, const String_t & , String_t & result, const CommandParser *)
{
// ----------------------------------------------------------------
if (isCommand (argv[0], CommandNames::showQueue))
{
CreatureObject::showSpawnQueue(result);
return true;
}
else if(isCommand (argv[0], CommandNames::showCreatures))
{
bool npcOnly = false;
bool pcOnly = false;
if(argv.size() >= 2)
{
std::string arg2 = Unicode::wideToNarrow(argv[1]);
if(arg2 == "npc")
{
npcOnly = true;
}
else if(arg2 == "pc")
{
pcOnly = true;
}
}
static const Unicode::String header(Unicode::narrowToWide(std::string("Creature Listing - ID: POS: Auth Server: Template Name\n")));
result += header;
const CreatureObject::AllCreaturesSet & creatureList = CreatureObject::getAllCreatures();
CreatureObject::AllCreaturesSet::const_iterator i;
int count = 0;
for(i = creatureList.begin(); i != creatureList.end(); ++i)
{
const CreatureObject * creature = (*i);
if(creature)
{
if(pcOnly && (!creature->isPlayerControlled()) )
continue;
if(npcOnly && creature->isPlayerControlled())
continue;
std::string creatureEntry = creature->getNetworkId().getValueString();
creatureEntry += ": ";
char locBuffer[32] = {"\0"};
Vector loc = creature->getTransform_o2w().getPosition_p();
snprintf(locBuffer, sizeof(locBuffer), "%.0f, %.0f: ", loc.x, loc.z);
creatureEntry += locBuffer;
snprintf(locBuffer, sizeof(locBuffer), "%lu: ", creature->getAuthServerProcessId());
creatureEntry += locBuffer;
creatureEntry += creature->getObjectTemplateName();
creatureEntry += "\n";
result += Unicode::narrowToWide(creatureEntry);
count++;
}
}
char countBuffer[32] = {"\0"};
snprintf(countBuffer, sizeof(countBuffer), "%d creatures listed: ", count);
result += Unicode::narrowToWide(std::string(countBuffer));
return true;
}
else
{
result += getErrorMessage (argv[0], ERR_NO_HANDLER);
return false;
}
return true;
}
// ======================================================================
@@ -1648,7 +1648,7 @@ void AiShipController::sendDebugAiToClients(AiDebugString & aiDebugString)
float const turretMissChance = getTurretMissChance() * 100.0f;
float const turretMissAngleDegrees = convertRadiansToDegrees(getTurretMissAngle());
aiDebugString.addText(formattedString.sprintf("turret miss(%.0f%% @ %.0f°)\n", turretMissChance, turretMissAngleDegrees));
aiDebugString.addText(formattedString.sprintf("turret miss(%.0f%% @ %.0f)\n", turretMissChance, turretMissAngleDegrees));
}
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -280,10 +280,8 @@ void NpcConversation::sendResponses()
*/
const NpcConversation::Response & NpcConversation::getResponse(int index) const
{
const static Response dummy;
if (m_responses->empty())
return dummy;
return m_responses->at(static_cast<size_t>(0));
const int size = static_cast<int>(m_responses->size());
if (index < 0)
@@ -28,11 +28,11 @@ namespace PreloadManagerNameSpace
void loadObjectTemplates()
{
FILE* fp = fopen("objectTemplates.plf","r");
char buf [128];
char buf [256];
if (fp)
{
DEBUG_REPORT_LOG(true, ("Scanning templates"));
char* line = fgets(buf, 128, fp);
char* line = fgets(buf, 256, fp);
while (line)
{
//strip newline
@@ -58,7 +58,7 @@ namespace PreloadManagerNameSpace
objectTemplate->preloadAssets();
}
DEBUG_REPORT_LOG(true, ("."));
line = fgets(buf, 128, fp);
line = fgets(buf, 256, fp);
}
fclose(fp);
DEBUG_REPORT_LOG(true, ("\n"));
@@ -68,11 +68,11 @@ namespace PreloadManagerNameSpace
void loadDataTables()
{
FILE* fp = fopen("datatables.plf","r");
char buf [128];
char buf [256];
if (fp)
{
DEBUG_REPORT_LOG(true, ("Scanning tables"));
char* line = fgets(buf, 128, fp);
char* line = fgets(buf, 256, fp);
while (line)
{
@@ -99,7 +99,7 @@ namespace PreloadManagerNameSpace
UNREF(dt);
#endif
DEBUG_REPORT_LOG(true, ("."));
line = fgets(buf, 128, fp);
line = fgets(buf, 256, fp);
}
fclose(fp);
DEBUG_REPORT_LOG(true, ("\n"));
@@ -199,18 +199,11 @@ void compare_results_int( std::set<TriggerVolume *> &results, std::set<TriggerVo
{
TriggerVolume* volume = *iter;
ServerObject const &volumeOwner = volume->getOwner();
if ( &volumeOwner == NULL )
{
LOG("SphereGrid", ("Ack null owner!"));
}
else
{
const Object* pob = getContainingPobForObjectInWorld(volume->getOwner());
Sphere const &localSphere = volumeOwner.getLocalSphere();
Sphere world(volumeOwner.getTransform_o2w().rotateTranslate_l2p(localSphere.getCenter()), volume->getRadius());
Vector c=world.getCenter();
LOG("SphereGrid",(" (%f %f %f) %f POB = %p DIST=%f",c.x,c.y,c.z,world.getRadius(),pob, c.magnitudeBetween(v) ));
}
const Object* pob = getContainingPobForObjectInWorld(volume->getOwner());
Sphere const &localSphere = volumeOwner.getLocalSphere();
Sphere world(volumeOwner.getTransform_o2w().rotateTranslate_l2p(localSphere.getCenter()), volume->getRadius());
Vector c=world.getCenter();
LOG("SphereGrid",(" (%f %f %f) %f POB = %p DIST=%f",c.x,c.y,c.z,world.getRadius(),pob, c.magnitudeBetween(v) ));
}
LOG("SphereGrid", ("------------------ Grid Results %d ------------------",results2.size()));
@@ -218,18 +211,11 @@ void compare_results_int( std::set<TriggerVolume *> &results, std::set<TriggerVo
{
TriggerVolume* volume = *iter;
ServerObject const &volumeOwner = volume->getOwner();
if ( &volumeOwner == NULL )
{
LOG("SphereGrid", ("shit null owner."));
}
else
{
const Object* pob = getContainingPobForObjectInWorld(volume->getOwner());
Sphere const &localSphere = volumeOwner.getLocalSphere();
Sphere world(volumeOwner.getTransform_o2w().rotateTranslate_l2p(localSphere.getCenter()), volume->getRadius()); // o2p or o2w
Vector c=world.getCenter();
LOG("SphereGrid",(" (%f %f %f) %f POB = %p DIST=%f",c.x,c.y,c.z,world.getRadius(),pob, c.magnitudeBetween(v) ));
}
const Object* pob = getContainingPobForObjectInWorld(volume->getOwner());
Sphere const &localSphere = volumeOwner.getLocalSphere();
Sphere world(volumeOwner.getTransform_o2w().rotateTranslate_l2p(localSphere.getCenter()), volume->getRadius()); // o2p or o2w
Vector c=world.getCenter();
LOG("SphereGrid",(" (%f %f %f) %f POB = %p DIST=%f",c.x,c.y,c.z,world.getRadius(),pob, c.magnitudeBetween(v) ));
}
DEBUG_FATAL(true,("FATAL: SphereGrid failed to match SphereTree result set."));
@@ -48,8 +48,8 @@ namespace CellPermissions
class PermissionObject
{
friend void Archive::get( ReadIterator & source, CellPermissions::PermissionObject & target );
friend void Archive::put( ByteStream & target, const CellPermissions::PermissionObject & source );
friend void Archive::get( Archive::ReadIterator & source, CellPermissions::PermissionObject & target );
friend void Archive::put( Archive::ByteStream & target, const CellPermissions::PermissionObject & source );
friend class ::BuildingObject;
friend class ::CellObject;
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -404,7 +404,7 @@ void IntangibleObject::onPermanentlyDestroyed()
* Persists this object in the database. Will also persist all the objects it
* is keeping track of.
*/
void IntangibleObject::persist()
bool IntangibleObject::persist()
{
if (isAuthoritative() && isTheater())
{
@@ -412,11 +412,11 @@ void IntangibleObject::persist()
{
// we are not finished creating our objects, prevent persistance
WARNING(true, ("IntangibleObject::persist called before all objects created"));
return;
return false;
}
if (isPersisted())
return;
return true;
ServerObject::persist();
@@ -470,9 +470,15 @@ void IntangibleObject::persist()
}
}
return true;
}
else
else {
ServerObject::persist();
return true;
}
return false;
} // IntangibleObject::persist
//------------------------------------------------------------------------------------------
@@ -44,7 +44,7 @@ public:
virtual float alter(float time);
virtual void onPermanentlyDestroyed();
virtual void persist();
virtual bool persist();
virtual bool isVisibleOnClient (const Client & client) const;
virtual void getAttributes (stdvector<std::pair<std::string, Unicode::String> >::fwd &data) const;
virtual bool onContainerAboutToTransfer(ServerObject * destination, ServerObject* transferer);
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -297,7 +297,7 @@ public:
bool isInEndBaselines() const;
bool isNeedingPobFixup() const;
bool permanentlyDestroy (DeleteReasons::Enumerator reason);
virtual void persist ();
virtual bool persist ();
virtual void onRemovingFromWorld ();
virtual void unload ();
void moveToPlayerAndUnload (const NetworkId &player);
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -168,7 +168,7 @@ int ServerCreatureObjectTemplate::getAttributes(Attributes index) const
base = dynamic_cast<const ServerCreatureObjectTemplate *>(m_baseData);
}
DEBUG_FATAL(index < 0 || index >= 6, ("template param index out of range"));
DEBUG_FATAL(static_cast<int>(index) < 0 || static_cast<int>(index) >= 6, ("template param static_cast<int>(index) <out of range"));
if (!m_attributes[index].isLoaded())
{
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL)
@@ -217,7 +217,7 @@ int ServerCreatureObjectTemplate::getAttributesMin(Attributes index) const
base = dynamic_cast<const ServerCreatureObjectTemplate *>(m_baseData);
}
DEBUG_FATAL(index < 0 || index >= 6, ("template param index out of range"));
DEBUG_FATAL(static_cast<int>(index) < 0 || static_cast<int>(index) >= 6, ("template param static_cast<int>(index) <out of range"));
if (!m_attributes[index].isLoaded())
{
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL)
@@ -266,7 +266,7 @@ int ServerCreatureObjectTemplate::getAttributesMax(Attributes index) const
base = dynamic_cast<const ServerCreatureObjectTemplate *>(m_baseData);
}
DEBUG_FATAL(index < 0 || index >= 6, ("template param index out of range"));
DEBUG_FATAL(static_cast<int>(index) < 0 || static_cast<int>(index) >= 6, ("template param static_cast<int>(index) <out of range"));
if (!m_attributes[index].isLoaded())
{
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL)
@@ -315,7 +315,7 @@ int ServerCreatureObjectTemplate::getMinAttributes(Attributes index) const
base = dynamic_cast<const ServerCreatureObjectTemplate *>(m_baseData);
}
DEBUG_FATAL(index < 0 || index >= 6, ("template param index out of range"));
DEBUG_FATAL(static_cast<int>(index) < 0 || static_cast<int>(index) >= 6, ("template param static_cast<int>(index) <out of range"));
if (!m_minAttributes[index].isLoaded())
{
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL)
@@ -364,7 +364,7 @@ int ServerCreatureObjectTemplate::getMinAttributesMin(Attributes index) const
base = dynamic_cast<const ServerCreatureObjectTemplate *>(m_baseData);
}
DEBUG_FATAL(index < 0 || index >= 6, ("template param index out of range"));
DEBUG_FATAL(static_cast<int>(index) < 0 || static_cast<int>(index) >= 6, ("template param static_cast<int>(index) <out of range"));
if (!m_minAttributes[index].isLoaded())
{
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL)
@@ -413,7 +413,7 @@ int ServerCreatureObjectTemplate::getMinAttributesMax(Attributes index) const
base = dynamic_cast<const ServerCreatureObjectTemplate *>(m_baseData);
}
DEBUG_FATAL(index < 0 || index >= 6, ("template param index out of range"));
DEBUG_FATAL(static_cast<int>(index) < 0 || static_cast<int>(index) >= 6, ("template param static_cast<int>(index) <out of range"));
if (!m_minAttributes[index].isLoaded())
{
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL)
@@ -462,7 +462,7 @@ int ServerCreatureObjectTemplate::getMaxAttributes(Attributes index) const
base = dynamic_cast<const ServerCreatureObjectTemplate *>(m_baseData);
}
DEBUG_FATAL(index < 0 || index >= 6, ("template param index out of range"));
DEBUG_FATAL(static_cast<int>(index) < 0 || static_cast<int>(index) >= 6, ("template param static_cast<int>(index) <out of range"));
if (!m_maxAttributes[index].isLoaded())
{
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL)
@@ -511,7 +511,7 @@ int ServerCreatureObjectTemplate::getMaxAttributesMin(Attributes index) const
base = dynamic_cast<const ServerCreatureObjectTemplate *>(m_baseData);
}
DEBUG_FATAL(index < 0 || index >= 6, ("template param index out of range"));
DEBUG_FATAL(static_cast<int>(index) < 0 || static_cast<int>(index) >= 6, ("template param static_cast<int>(index) <out of range"));
if (!m_maxAttributes[index].isLoaded())
{
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL)
@@ -560,7 +560,7 @@ int ServerCreatureObjectTemplate::getMaxAttributesMax(Attributes index) const
base = dynamic_cast<const ServerCreatureObjectTemplate *>(m_baseData);
}
DEBUG_FATAL(index < 0 || index >= 6, ("template param index out of range"));
DEBUG_FATAL(static_cast<int>(index) < 0 || static_cast<int>(index) >= 6, ("template param static_cast<int>(index) <out of range"));
if (!m_maxAttributes[index].isLoaded())
{
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL)
@@ -1395,7 +1395,7 @@ void ServerCreatureObjectTemplate::getAttribMods(AttribMod &data, int index) con
if (m_attribModsAppend && base != NULL)
{
int baseCount = base->getAttribModsCount();
if (index < baseCount)
if (static_cast<int>(index) < baseCount)
{
base->getAttribMods(data, index);
return;
@@ -1403,7 +1403,7 @@ void ServerCreatureObjectTemplate::getAttribMods(AttribMod &data, int index) con
index -= baseCount;
}
DEBUG_FATAL(index < 0 || static_cast<size_t>(index) >= m_attribMods.size(), ("template param index out of range"));
DEBUG_FATAL(static_cast<int>(index) < 0 || static_cast<size_t>(index) >= m_attribMods.size(), ("template param static_cast<int>(index) <out of range"));
const ObjectTemplate * structTemplate = (*m_attribMods[index]).getValue();
NOT_NULL(structTemplate);
const _AttribMod *param = dynamic_cast<const _AttribMod *>(structTemplate);
@@ -1441,7 +1441,7 @@ void ServerCreatureObjectTemplate::getAttribModsMin(AttribMod &data, int index)
if (m_attribModsAppend && base != NULL)
{
int baseCount = base->getAttribModsCount();
if (index < baseCount)
if (static_cast<int>(index) < baseCount)
{
base->getAttribModsMin(data, index);
return;
@@ -1449,7 +1449,7 @@ void ServerCreatureObjectTemplate::getAttribModsMin(AttribMod &data, int index)
index -= baseCount;
}
DEBUG_FATAL(index < 0 || static_cast<size_t>(index) >= m_attribMods.size(), ("template param index out of range"));
DEBUG_FATAL(static_cast<int>(index) < 0 || static_cast<size_t>(index) >= m_attribMods.size(), ("template param static_cast<int>(index) <out of range"));
const ObjectTemplate * structTemplate = (*m_attribMods[index]).getValue();
NOT_NULL(structTemplate);
const _AttribMod *param = dynamic_cast<const _AttribMod *>(structTemplate);
@@ -1487,7 +1487,7 @@ void ServerCreatureObjectTemplate::getAttribModsMax(AttribMod &data, int index)
if (m_attribModsAppend && base != NULL)
{
int baseCount = base->getAttribModsCount();
if (index < baseCount)
if (static_cast<int>(index) < baseCount)
{
base->getAttribModsMax(data, index);
return;
@@ -1495,7 +1495,7 @@ void ServerCreatureObjectTemplate::getAttribModsMax(AttribMod &data, int index)
index -= baseCount;
}
DEBUG_FATAL(index < 0 || static_cast<size_t>(index) >= m_attribMods.size(), ("template param index out of range"));
DEBUG_FATAL(static_cast<int>(index) < 0 || static_cast<size_t>(index) >= m_attribMods.size(), ("template param static_cast<int>(index) <out of range"));
const ObjectTemplate * structTemplate = (*m_attribMods[index]).getValue();
NOT_NULL(structTemplate);
const _AttribMod *param = dynamic_cast<const _AttribMod *>(structTemplate);
@@ -2007,7 +2007,7 @@ float ServerCreatureObjectTemplate::getMaxMentalStates(MentalStates index) const
base = dynamic_cast<const ServerCreatureObjectTemplate *>(m_baseData);
}
DEBUG_FATAL(index < 0 || index >= 4, ("template param index out of range"));
DEBUG_FATAL(static_cast<int>(index) < 0 || static_cast<int>(index) >= 4, ("template param static_cast<int>(index) <out of range"));
if (!m_maxMentalStates[index].isLoaded())
{
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL)
@@ -2056,7 +2056,7 @@ float ServerCreatureObjectTemplate::getMaxMentalStatesMin(MentalStates index) co
base = dynamic_cast<const ServerCreatureObjectTemplate *>(m_baseData);
}
DEBUG_FATAL(index < 0 || index >= 4, ("template param index out of range"));
DEBUG_FATAL(static_cast<int>(index) < 0 || static_cast<int>(index) >= 4, ("template param static_cast<int>(index) <out of range"));
if (!m_maxMentalStates[index].isLoaded())
{
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL)
@@ -2105,7 +2105,7 @@ float ServerCreatureObjectTemplate::getMaxMentalStatesMax(MentalStates index) co
base = dynamic_cast<const ServerCreatureObjectTemplate *>(m_baseData);
}
DEBUG_FATAL(index < 0 || index >= 4, ("template param index out of range"));
DEBUG_FATAL(static_cast<int>(index) < 0 || static_cast<int>(index) >= 4, ("template param static_cast<int>(index) <out of range"));
if (!m_maxMentalStates[index].isLoaded())
{
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL)
@@ -2154,7 +2154,7 @@ float ServerCreatureObjectTemplate::getMentalStatesDecay(MentalStates index) con
base = dynamic_cast<const ServerCreatureObjectTemplate *>(m_baseData);
}
DEBUG_FATAL(index < 0 || index >= 4, ("template param index out of range"));
DEBUG_FATAL(static_cast<int>(index) < 0 || static_cast<int>(index) >= 4, ("template param static_cast<int>(index) <out of range"));
if (!m_mentalStatesDecay[index].isLoaded())
{
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL)
@@ -2203,7 +2203,7 @@ float ServerCreatureObjectTemplate::getMentalStatesDecayMin(MentalStates index)
base = dynamic_cast<const ServerCreatureObjectTemplate *>(m_baseData);
}
DEBUG_FATAL(index < 0 || index >= 4, ("template param index out of range"));
DEBUG_FATAL(static_cast<int>(index) < 0 || static_cast<int>(index) >= 4, ("template param static_cast<int>(index) <out of range"));
if (!m_mentalStatesDecay[index].isLoaded())
{
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL)
@@ -2252,7 +2252,7 @@ float ServerCreatureObjectTemplate::getMentalStatesDecayMax(MentalStates index)
base = dynamic_cast<const ServerCreatureObjectTemplate *>(m_baseData);
}
DEBUG_FATAL(index < 0 || index >= 4, ("template param index out of range"));
DEBUG_FATAL(static_cast<int>(index) < 0 || static_cast<int>(index) >= 4, ("template param static_cast<int>(index) <out of range"));
if (!m_mentalStatesDecay[index].isLoaded())
{
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL)
@@ -124,7 +124,7 @@ Object * ServerTangibleObjectTemplate::createObject(void) const
} // ServerTangibleObjectTemplate::createObject
//@BEGIN TFD
const TriggerVolumeData & ServerTangibleObjectTemplate::getTriggerVolumes(int index) const
const TriggerVolumeData ServerTangibleObjectTemplate::getTriggerVolumes(int index) const
{
const ServerTangibleObjectTemplate * base = NULL;
if (m_baseData != NULL)
@@ -155,7 +155,8 @@ const TriggerVolumeData & ServerTangibleObjectTemplate::getTriggerVolumes(int in
}
DEBUG_FATAL(index < 0 || static_cast<size_t>(index) >= m_triggerVolumes.size(), ("template param index out of range"));
const TriggerVolumeData & value = m_triggerVolumes[index]->getValue();
const TriggerVolumeData value = m_triggerVolumes[index]->getValue();
return value;
} // ServerTangibleObjectTemplate::getTriggerVolumes
@@ -84,7 +84,7 @@ public:
};
public:
const TriggerVolumeData & getTriggerVolumes(int index) const;
const TriggerVolumeData getTriggerVolumes(int index) const;
size_t getTriggerVolumesCount(void) const;
CombatSkeleton getCombatSkeleton(bool testData = false) const;
int getMaxHitPoints(bool testData = false) const;
File diff suppressed because it is too large Load Diff
@@ -1,256 +1,256 @@
//======================================================================
//
// ShipInternalDamageOverTimeManager.cpp
// copyright (c) 2004 Sony Online Entertainment
//
//======================================================================
#include "serverGame/FirstServerGame.h"
#include "serverGame/ShipInternalDamageOverTimeManager.h"
#include "serverGame/ShipInternalDamageOverTime.h"
#include "serverGame/ShipObject.h"
#include "serverScript/GameScriptObject.h"
#include "serverScript/ScriptFunctionTable.h"
#include "serverScript/ScriptParameters.h"
#include "sharedFoundation/ExitChain.h"
#include <algorithm>
#include <vector>
//======================================================================
namespace ShipInternalDamageOverTimeManagerNamespace
{
typedef ShipInternalDamageOverTimeManager::IdotVector IdotVector;
typedef std::pair<ShipInternalDamageOverTime, float> IdotDamage;
typedef stdvector<IdotDamage>::fwd IdotDamageVector;
IdotVector s_idotVector;
IdotVector s_temporaryIdotVector;
IdotDamageVector s_temporaryIdotDamageVector;
float ms_timeSinceUpdate = 0.0f;
float const ms_updateTime = 2.0f;
//----------------------------------------------------------------------
void notifyIdotRemoval(ShipObject & ship, ShipInternalDamageOverTime const & idot)
{
GameScriptObject * const gameScriptObject = ship.getScriptObject();
if (gameScriptObject != NULL)
{
ScriptParams p;
p.addParam(idot.getChassisSlot());
p.addParam(idot.getDamageRate());
p.addParam(idot.getDamageThreshold());
IGNORE_RETURN(gameScriptObject->trigAllScripts(Scripting::TRIG_SHIP_INTERNAL_DAMAGE_OVER_TIME_REMOVED, p));
}
}
//----------------------------------------------------------------------
void notifyIdotDamage(ShipObject & ship, ShipInternalDamageOverTime const & idot, float damageApplied)
{
GameScriptObject * const gameScriptObject = ship.getScriptObject();
if (gameScriptObject != NULL)
{
ScriptParams p;
p.addParam(idot.getChassisSlot());
p.addParam(idot.getDamageRate());
p.addParam(idot.getDamageThreshold());
p.addParam(damageApplied);
IGNORE_RETURN(gameScriptObject->trigAllScripts(Scripting::TRIG_SHIP_DAMAGED_BY_INTERNAL_DAMAGE_OVER_TIME, p));
}
}
}
using namespace ShipInternalDamageOverTimeManagerNamespace;
//----------------------------------------------------------------------
void ShipInternalDamageOverTimeManager::install()
{
ExitChain::add(ShipInternalDamageOverTimeManager::remove, "ShipInternalDamageOverTimeManager::remove");
}
//----------------------------------------------------------------------
void ShipInternalDamageOverTimeManager::remove()
{
s_temporaryIdotVector.clear();
s_idotVector.clear();
}
//----------------------------------------------------------------------
void ShipInternalDamageOverTimeManager::update(float elapsedTime)
{
ms_timeSinceUpdate += elapsedTime;
if (ms_timeSinceUpdate < ms_updateTime)
return;
bool hasExpired = false;
{
s_temporaryIdotDamageVector.clear();
IdotVector::const_iterator const end = s_idotVector.end();
for (IdotVector::const_iterator it = s_idotVector.begin(); it != end; ++it)
{
ShipInternalDamageOverTime const & idot = *it;
float damageApplied = 0.0f;
if (idot.isExpired() || !idot.applyDamage(ms_timeSinceUpdate, damageApplied))
{
idot.setExpired(true);
hasExpired = true;
}
if (damageApplied != 0.0f)
s_temporaryIdotDamageVector.push_back(IdotDamage(idot, damageApplied));
}
}
//-- process queued damage notifications
//-- this is done outside the update loop so that script triggers can be allowed to add/remove idots
{
for (IdotDamageVector::const_iterator it = s_temporaryIdotDamageVector.begin(); it != s_temporaryIdotDamageVector.end(); ++it)
{
IdotDamage const & idotDamage = *it;
ShipInternalDamageOverTime const & idot = idotDamage.first;
float const damageApplied = idotDamage.second;
ShipObject * const shipObject = idot.getShipObject();
if (NULL != shipObject)
notifyIdotDamage(*shipObject, idot, damageApplied);
}
}
//-- process any expired idots
//-- this is done outside the update loop so that script triggers can be allowed to add/remove idots
if (hasExpired)
{
IdotVector::iterator const expired_begin = std::remove_if(s_idotVector.begin(), s_idotVector.end(), ShipInternalDamageOverTime::ExpiredRemoveFunctor());
s_temporaryIdotVector.clear();
s_temporaryIdotVector.insert(s_temporaryIdotVector.end(), expired_begin, s_idotVector.end());
IGNORE_RETURN(s_idotVector.erase(expired_begin, s_idotVector.end()));
{
IdotVector::const_iterator const end = s_temporaryIdotVector.end();
for (IdotVector::const_iterator it = s_temporaryIdotVector.begin(); it != end; ++it)
{
ShipInternalDamageOverTime const & expiredIdot = *it;
ShipObject * const shipObject = expiredIdot.getShipObject();
if (shipObject != NULL)
notifyIdotRemoval(*shipObject, expiredIdot);
}
}
s_temporaryIdotVector.clear();
}
ms_timeSinceUpdate = 0.0f;
}
//----------------------------------------------------------------------
bool ShipInternalDamageOverTimeManager::setEntry(ShipObject const & ship, int chassisSlot, float damageRate, float damageThreshold)
{
ShipInternalDamageOverTime const idot(ship, chassisSlot, damageRate, damageThreshold);
if (!idot.checkValidity())
return false;
IdotVector::iterator const lowerBound = std::lower_bound(s_idotVector.begin(), s_idotVector.end(), idot);
//-- there is no lower bound, just stick it at the end
if (lowerBound == s_idotVector.end())
{
s_idotVector.push_back(idot);
}
else
{
ShipInternalDamageOverTime & lowerBoundIdot = *lowerBound;
//-- the lower bound sorts greater than the new idot, therefore this is a new insertion
if (idot < lowerBoundIdot)
{
IGNORE_RETURN(s_idotVector.insert(lowerBound, idot));
}
else
{
//-- otherwise we are overriding an existing value
lowerBoundIdot.setDamageRate(damageRate);
lowerBoundIdot.setDamageThreshold(damageThreshold);
}
}
return true;
}
//----------------------------------------------------------------------
bool ShipInternalDamageOverTimeManager::removeEntry(ShipObject const & ship, int chassisSlot)
{
ShipInternalDamageOverTime const idot(ship, chassisSlot, 0.0f, 0.0f);
IdotVector::iterator const lowerBound = std::lower_bound(s_idotVector.begin(), s_idotVector.end(), idot);
//-- there is no lower bound, the idot is not in the vector
if (lowerBound == s_idotVector.end())
return false;
ShipInternalDamageOverTime const lowerBoundIdot = *lowerBound;
//-- the lower bound sorts greater than the new idot, therefore this is a new insertion
if (idot < lowerBoundIdot)
return false;
IGNORE_RETURN(s_idotVector.erase(lowerBound));
ShipObject * const shipObject = lowerBoundIdot.getShipObject();
if (shipObject != NULL)
notifyIdotRemoval(*shipObject, lowerBoundIdot);
return true;
}
//----------------------------------------------------------------------
ShipInternalDamageOverTime const * const ShipInternalDamageOverTimeManager::findEntry(ShipObject const & ship, int chassisSlot)
{
ShipInternalDamageOverTime const idot(ship, chassisSlot, 0.0f, 0.0f);
IdotVector::iterator const lowerBound = std::lower_bound(s_idotVector.begin(), s_idotVector.end(), idot);
//-- there is no lower bound, the idot is not in the vector
if (lowerBound == s_idotVector.end())
return NULL;
ShipInternalDamageOverTime & lowerBoundIdot = *lowerBound;
//-- the lower bound sorts greater than the new idot, therefore this is a new insertion
if (idot < lowerBoundIdot)
return NULL;
return &lowerBoundIdot;
}
//----------------------------------------------------------------------
ShipInternalDamageOverTimeManager::IdotVector const & ShipInternalDamageOverTimeManager::getActiveShipInternalDamageOverTime()
{
return s_idotVector;
}
//======================================================================
//======================================================================
//
// ShipInternalDamageOverTimeManager.cpp
// copyright (c) 2004 Sony Online Entertainment
//
//======================================================================
#include "serverGame/FirstServerGame.h"
#include "serverGame/ShipInternalDamageOverTimeManager.h"
#include "serverGame/ShipInternalDamageOverTime.h"
#include "serverGame/ShipObject.h"
#include "serverScript/GameScriptObject.h"
#include "serverScript/ScriptFunctionTable.h"
#include "serverScript/ScriptParameters.h"
#include "sharedFoundation/ExitChain.h"
#include <algorithm>
#include <vector>
//======================================================================
namespace ShipInternalDamageOverTimeManagerNamespace
{
typedef ShipInternalDamageOverTimeManager::IdotVector IdotVector;
typedef std::pair<ShipInternalDamageOverTime, float> IdotDamage;
typedef stdvector<IdotDamage>::fwd IdotDamageVector;
IdotVector s_idotVector;
IdotVector s_temporaryIdotVector;
IdotDamageVector s_temporaryIdotDamageVector;
float ms_timeSinceUpdate = 0.0f;
float const ms_updateTime = 2.0f;
//----------------------------------------------------------------------
void notifyIdotRemoval(ShipObject & ship, ShipInternalDamageOverTime const & idot)
{
GameScriptObject * const gameScriptObject = ship.getScriptObject();
if (gameScriptObject != NULL)
{
ScriptParams p;
p.addParam(idot.getChassisSlot());
p.addParam(idot.getDamageRate());
p.addParam(idot.getDamageThreshold());
IGNORE_RETURN(gameScriptObject->trigAllScripts(Scripting::TRIG_SHIP_INTERNAL_DAMAGE_OVER_TIME_REMOVED, p));
}
}
//----------------------------------------------------------------------
void notifyIdotDamage(ShipObject & ship, ShipInternalDamageOverTime const & idot, float damageApplied)
{
GameScriptObject * const gameScriptObject = ship.getScriptObject();
if (gameScriptObject != NULL)
{
ScriptParams p;
p.addParam(idot.getChassisSlot());
p.addParam(idot.getDamageRate());
p.addParam(idot.getDamageThreshold());
p.addParam(damageApplied);
IGNORE_RETURN(gameScriptObject->trigAllScripts(Scripting::TRIG_SHIP_DAMAGED_BY_INTERNAL_DAMAGE_OVER_TIME, p));
}
}
}
using namespace ShipInternalDamageOverTimeManagerNamespace;
//----------------------------------------------------------------------
void ShipInternalDamageOverTimeManager::install()
{
ExitChain::add(ShipInternalDamageOverTimeManager::remove, "ShipInternalDamageOverTimeManager::remove");
}
//----------------------------------------------------------------------
void ShipInternalDamageOverTimeManager::remove()
{
s_temporaryIdotVector.clear();
s_idotVector.clear();
}
//----------------------------------------------------------------------
void ShipInternalDamageOverTimeManager::update(float elapsedTime)
{
ms_timeSinceUpdate += elapsedTime;
if (ms_timeSinceUpdate < ms_updateTime)
return;
bool hasExpired = false;
{
s_temporaryIdotDamageVector.clear();
IdotVector::const_iterator const end = s_idotVector.end();
for (IdotVector::const_iterator it = s_idotVector.begin(); it != end; ++it)
{
ShipInternalDamageOverTime const & idot = *it;
float damageApplied = 0.0f;
if (idot.isExpired() || !idot.applyDamage(ms_timeSinceUpdate, damageApplied))
{
idot.setExpired(true);
hasExpired = true;
}
if (damageApplied != 0.0f)
s_temporaryIdotDamageVector.push_back(IdotDamage(idot, damageApplied));
}
}
//-- process queued damage notifications
//-- this is done outside the update loop so that script triggers can be allowed to add/remove idots
{
for (IdotDamageVector::const_iterator it = s_temporaryIdotDamageVector.begin(); it != s_temporaryIdotDamageVector.end(); ++it)
{
IdotDamage const & idotDamage = *it;
ShipInternalDamageOverTime const & idot = idotDamage.first;
float const damageApplied = idotDamage.second;
ShipObject * const shipObject = idot.getShipObject();
if (NULL != shipObject)
notifyIdotDamage(*shipObject, idot, damageApplied);
}
}
//-- process any expired idots
//-- this is done outside the update loop so that script triggers can be allowed to add/remove idots
if (hasExpired)
{
IdotVector::iterator const expired_begin = std::remove_if(s_idotVector.begin(), s_idotVector.end(), ShipInternalDamageOverTime::ExpiredRemoveFunctor());
s_temporaryIdotVector.clear();
s_temporaryIdotVector.insert(s_temporaryIdotVector.end(), expired_begin, s_idotVector.end());
IGNORE_RETURN(s_idotVector.erase(expired_begin, s_idotVector.end()));
{
IdotVector::const_iterator const end = s_temporaryIdotVector.end();
for (IdotVector::const_iterator it = s_temporaryIdotVector.begin(); it != end; ++it)
{
ShipInternalDamageOverTime const & expiredIdot = *it;
ShipObject * const shipObject = expiredIdot.getShipObject();
if (shipObject != NULL)
notifyIdotRemoval(*shipObject, expiredIdot);
}
}
s_temporaryIdotVector.clear();
}
ms_timeSinceUpdate = 0.0f;
}
//----------------------------------------------------------------------
bool ShipInternalDamageOverTimeManager::setEntry(ShipObject const & ship, int chassisSlot, float damageRate, float damageThreshold)
{
ShipInternalDamageOverTime const idot(ship, chassisSlot, damageRate, damageThreshold);
if (!idot.checkValidity())
return false;
IdotVector::iterator const lowerBound = std::lower_bound(s_idotVector.begin(), s_idotVector.end(), idot);
//-- there is no lower bound, just stick it at the end
if (lowerBound == s_idotVector.end())
{
s_idotVector.push_back(idot);
}
else
{
ShipInternalDamageOverTime & lowerBoundIdot = *lowerBound;
//-- the lower bound sorts greater than the new idot, therefore this is a new insertion
if (idot < lowerBoundIdot)
{
IGNORE_RETURN(s_idotVector.insert(lowerBound, idot));
}
else
{
//-- otherwise we are overriding an existing value
lowerBoundIdot.setDamageRate(damageRate);
lowerBoundIdot.setDamageThreshold(damageThreshold);
}
}
return true;
}
//----------------------------------------------------------------------
bool ShipInternalDamageOverTimeManager::removeEntry(ShipObject const & ship, int chassisSlot)
{
ShipInternalDamageOverTime const idot(ship, chassisSlot, 0.0f, 0.0f);
IdotVector::iterator const lowerBound = std::lower_bound(s_idotVector.begin(), s_idotVector.end(), idot);
//-- there is no lower bound, the idot is not in the vector
if (lowerBound == s_idotVector.end())
return false;
ShipInternalDamageOverTime const lowerBoundIdot = *lowerBound;
//-- the lower bound sorts greater than the new idot, therefore this is a new insertion
if (idot < lowerBoundIdot)
return false;
IGNORE_RETURN(s_idotVector.erase(lowerBound));
ShipObject * const shipObject = lowerBoundIdot.getShipObject();
if (shipObject != NULL)
notifyIdotRemoval(*shipObject, lowerBoundIdot);
return true;
}
//----------------------------------------------------------------------
ShipInternalDamageOverTime const * const ShipInternalDamageOverTimeManager::findEntry(ShipObject const & ship, int chassisSlot)
{
ShipInternalDamageOverTime const idot(ship, chassisSlot, 0.0f, 0.0f);
IdotVector::iterator const lowerBound = std::lower_bound(s_idotVector.begin(), s_idotVector.end(), idot);
//-- there is no lower bound, the idot is not in the vector
if (lowerBound == s_idotVector.end())
return NULL;
ShipInternalDamageOverTime & lowerBoundIdot = *lowerBound;
//-- the lower bound sorts greater than the new idot, therefore this is a new insertion
if (idot < lowerBoundIdot)
return NULL;
return &lowerBoundIdot;
}
//----------------------------------------------------------------------
ShipInternalDamageOverTimeManager::IdotVector const & ShipInternalDamageOverTimeManager::getActiveShipInternalDamageOverTime()
{
return s_idotVector;
}
//======================================================================
@@ -1,47 +1,47 @@
// ConfigServerMetrics.cpp
// copyright 2000 Verant Interactive
// Author: Justin Randall
//-----------------------------------------------------------------------
#include "serverMetrics/FirstServerMetrics.h"
#include "sharedFoundation/ConfigFile.h"
#include "ConfigServerMetrics.h"
//-----------------------------------------------------------------------
ConfigServerMetrics::Data * ConfigServerMetrics::data = 0;
#define KEY_INT(a,b) (data->a = ConfigFile::getKeyInt("ServerMetrics", #a, b))
#define KEY_BOOL(a,b) (data->a = ConfigFile::getKeyBool("ServerMetrics", #a, b))
#define KEY_REAL(a,b) (data->a = ConfigFile::getKeyReal("ServerMetrics", #a, b))
#define KEY_STRING(a,b) (data->a = ConfigFile::getKeyString("ServerMetrics", #a, b))
//-----------------------------------------------------------------------
void ConfigServerMetrics::install(void)
{
data = new ConfigServerMetrics::Data;
KEY_STRING(metricsServerAddress, "localhost");
data->secondsBetweenUpdates = static_cast<uint16>(ConfigFile::getKeyInt("ServerMetrics", "secondsBetweenUpdates", 5));
data->metricsServerPort = static_cast<uint16>(ConfigFile::getKeyInt("ServerMetrics", "metricsServerPort", 44480));
KEY_STRING(primaryName, "unknownProcess");
KEY_STRING(secondaryName, "");
KEY_INT(frameTimeAveragingSize, 11);
}
//-----------------------------------------------------------------------
void ConfigServerMetrics::remove(void)
{
delete data;
data = 0;
}
//-----------------------------------------------------------------------
// ConfigServerMetrics.cpp
// copyright 2000 Verant Interactive
// Author: Justin Randall
//-----------------------------------------------------------------------
#include "serverMetrics/FirstServerMetrics.h"
#include "sharedFoundation/ConfigFile.h"
#include "ConfigServerMetrics.h"
//-----------------------------------------------------------------------
ConfigServerMetrics::Data * ConfigServerMetrics::data = 0;
#define KEY_INT(a,b) (data->a = ConfigFile::getKeyInt("ServerMetrics", #a, b))
#define KEY_BOOL(a,b) (data->a = ConfigFile::getKeyBool("ServerMetrics", #a, b))
#define KEY_REAL(a,b) (data->a = ConfigFile::getKeyReal("ServerMetrics", #a, b))
#define KEY_STRING(a,b) (data->a = ConfigFile::getKeyString("ServerMetrics", #a, b))
//-----------------------------------------------------------------------
void ConfigServerMetrics::install(void)
{
data = new ConfigServerMetrics::Data;
KEY_STRING(metricsServerAddress, "localhost");
data->secondsBetweenUpdates = static_cast<uint16>(ConfigFile::getKeyInt("ServerMetrics", "secondsBetweenUpdates", 5));
data->metricsServerPort = static_cast<uint16>(ConfigFile::getKeyInt("ServerMetrics", "metricsServerPort", 44480));
KEY_STRING(primaryName, "unknownProcess");
KEY_STRING(secondaryName, "");
KEY_INT(frameTimeAveragingSize, 11);
}
//-----------------------------------------------------------------------
void ConfigServerMetrics::remove(void)
{
delete data;
data = 0;
}
//-----------------------------------------------------------------------
@@ -30,7 +30,7 @@ class AiCreatureStateMessage : public MessageQueue::Data
{
CONTROLLER_MESSAGE_INTERFACE;
friend void Archive::get(ReadIterator & source, AiCreatureStateMessage & target);
friend void Archive::get(Archive::ReadIterator & source, AiCreatureStateMessage & target);
public:
@@ -35,7 +35,7 @@ class AiMovementMessage : public MessageQueue::Data
{
CONTROLLER_MESSAGE_INTERFACE;
friend void Archive::get(ReadIterator & source, AiMovementMessage & target);
friend void Archive::get(Archive::ReadIterator & source, AiMovementMessage & target);
public:
AiMovementMessage();
@@ -1232,7 +1232,7 @@ void JavaLibrary::initializeJavaThread()
}
#ifdef JNI_VERSION_1_4
if (!ms_javaVmType == JV_ibm)
if ((!ms_javaVmType) == JV_ibm)
{
tempOption.optionString = "-Xrs";
options.push_back(tempOption);
@@ -1243,14 +1243,6 @@ void JavaLibrary::initializeJavaThread()
{
tempOption.optionString = "-Xloggc:javagc.log";
options.push_back(tempOption);
// tempOption.optionString = "-Xrunpri";
// options.push_back(tempOption);
// tempOption.optionString = "-Xbootclasspath/a:/home/sjakab/temp/OptimizeitSuiteDemo/lib/oibcp.jar";
// options.push_back(tempOption);
// tempOption.optionString = "-Xboundthreads";
// options.push_back(tempOption);
// tempOption.optionString = "-Xrunhprof:heap=format=b";
// options.push_back(tempOption);
}
#endif
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -1123,8 +1123,11 @@ jboolean JNICALL ScriptMethodsObjectCreateNamespace::persistObject(JNIEnv *env,
ServerObject* object = NULL;
if (!JavaLibrary::getObject(target, object))
return JNI_FALSE;
object->persist();
return JNI_TRUE;
if (object->persist()) {
return JNI_TRUE;
} else {
return JNI_FALSE;
}
} // JavaLibrary::persistObject
/**
@@ -2699,58 +2699,6 @@ namespace
//-----------------------------------------------------------------------
bool DebugDumpCustomVar(JNIEnv *env, LocalRefPtr customVar)
{
NOT_NULL(env);
NOT_NULL(customVar.get());
NOT_NULL(customVar->getValue());
//-- get class for custom_var
const jclass customVarClass = env->FindClass("custom_var");
DEBUG_REPORT_LOG(!customVarClass, ("FindClass() failed for custom_var.\n"));
if (!customVarClass)
return false;
//-- invoke "String getVarName()" method
const jmethodID getVarNameMid = env->GetMethodID(customVarClass, "getVarName", "()Ljava/lang/String;");
DEBUG_REPORT_LOG(!getVarNameMid , ("GetMethodId() failed for getVarName().\n"));
if (!getVarNameMid)
{
env->DeleteLocalRef(customVarClass);
return false;
}
std::string nativeCustomVarName;
JavaStringPtr javaCustomVarName = callStringMethod(*customVar, getVarNameMid);
JavaLibrary::convert(*javaCustomVarName, nativeCustomVarName);
//-- invoke "int getTypeId()" method
const jmethodID getTypeIdMid = env->GetMethodID(customVarClass, "getTypeId", "()I");
DEBUG_REPORT_LOG(!getTypeIdMid, ("GetMethodId() failed for getTypeId().\n"));
if (!getTypeIdMid)
{
env->DeleteLocalRef(customVarClass);
return false;
}
const int nativeCustomVarTypeId = callIntMethod(*customVar, getTypeIdMid);
//-- cleanup
env->DeleteLocalRef(customVarClass);
//-- print results
REPORT_LOG(true, ("<*> <CustomVar varName=[%s] typeId=[%d]\n", nativeCustomVarName.c_str(), nativeCustomVarTypeId));
//-- success
return true;
}
// ----------------------------------------------------------------------
void CustomizationVariableCollector(const std::string &fullVariablePathName, CustomizationVariable *customizationVariable, void *context)
{
//-- validate arguments
@@ -2770,51 +2718,6 @@ namespace
// ----------------------------------------------------------------------
void BasicRangedIntCustomizationVariableCollector(const std::string &fullVariablePathName, CustomizationVariable *customizationVariable, void *context)
{
//-- validate arguments
if (!customizationVariable || !context)
{
DEBUG_FATAL(true, ("programmer error: callback made with NULL arguments.\n"));
return;
}
//-- check if this is a basic ranged int
BasicRangedIntCustomizationVariable *const variable = dynamic_cast<BasicRangedIntCustomizationVariable*>(customizationVariable);
if (!variable)
return;
//-- convert context to customization variable collection
CustomizationVariableIteratorData *const iteratorData = reinterpret_cast<CustomizationVariableIteratorData*>(context);
//-- add CustomizationVariable to the container
iteratorData->m_variableNames.push_back(fullVariablePathName);
iteratorData->m_customizationVariables.push_back(customizationVariable);
}
// ----------------------------------------------------------------------
void PalcolorCustomizationVariableCollector(const std::string &fullVariablePathName, CustomizationVariable *customizationVariable, void *context)
{
//-- validate arguments
if (!customizationVariable || !context)
{
DEBUG_FATAL(true, ("programmer error: callback made with NULL arguments.\n"));
return;
}
//-- check if this is a PaletteColorCustomizationVariable
PaletteColorCustomizationVariable *const variable = dynamic_cast<PaletteColorCustomizationVariable*>(customizationVariable);
if (!variable)
return;
//-- convert context to customization variable collection
CustomizationVariableIteratorData *const iteratorData = reinterpret_cast<CustomizationVariableIteratorData*>(context);
//-- add CustomizationVariable to the container
iteratorData->m_variableNames.push_back(fullVariablePathName);
iteratorData->m_customizationVariables.push_back(customizationVariable);
}
}
// ----------------------------------------------------------------------
File diff suppressed because it is too large Load Diff
@@ -1,203 +1,203 @@
//=======================================================================
//
// ScriptMethodsString.cpp
// Copyright 2000-05, Sony Online Entertainment Inc., all rights reserved.
//
//=======================================================================
#include "serverScript/FirstServerScript.h"
#include "serverScript/JavaLibrary.h"
#include "serverGame/NameManager.h"
#include "sharedGame/TextManager.h"
using namespace JNIWrappersNamespace;
// ======================================================================
// ScriptMethodsStringNamespace
// ======================================================================
namespace ScriptMethodsStringNamespace
{
bool install();
jstring JNICALL getString(JNIEnv *env, jobject self, jobject id);
jobjectArray JNICALL getStrings(JNIEnv *env, jobject self, jobjectArray ids);
jboolean JNICALL isObscene(JNIEnv *env, jobject self, jstring data);
jboolean JNICALL isAppropriateText(JNIEnv *env, jobject self, jstring data);
}
//========================================================================
// install
//========================================================================
bool ScriptMethodsStringNamespace::install()
{
const JNINativeMethod NATIVES[] = {
#define JF(a,b,c) {a,b,(void*)(ScriptMethodsStringNamespace::c)}
JF("getString", "(Lscript/string_id;)Ljava/lang/String;", getString),
JF("getStrings", "([Lscript/string_id;)[Ljava/lang/String;", getStrings),
JF("isObscene", "(Ljava/lang/String;)Z", isObscene),
JF("isAppropriateText", "(Ljava/lang/String;)Z", isAppropriateText),
};
return JavaLibrary::registerNatives(NATIVES, sizeof(NATIVES)/sizeof(NATIVES[0]));
}
//----------------------------------------------------------------------
/**
* Returns the string associated with a stringId.
*
* @param env Java environment
* @param self class calling this function
* @param id the stringId to find
*
* @return the string, or null on error
*/
jstring JNICALL ScriptMethodsStringNamespace::getString(JNIEnv *env, jobject self, jobject id)
{
UNREF(self);
if (id == 0)
{
WARNING(true, ("JavaLibrary::log getString is NULL."));
return 0;
}
// convert the string id to a char string
if (!env->IsInstanceOf(id, JavaLibrary::getClsStringId()))
{
WARNING(true, ("JavaLibrary::log IsInstanceOf failed."));
return 0;
}
// get the table
JavaStringPtr tempString = getStringField(LocalRefParam(id), JavaLibrary::getFidStringIdTable());
std::string table;
if(! JavaLibrary::convert(*tempString, table))
{
WARNING(true, ("JavaLibrary::log failed to get the string table."));
return 0;
}
std::string asciiId;
JavaStringPtr tempAsciiIdString = getStringField(LocalRefParam(id), JavaLibrary::getFidStringIdAsciiId());
if(! JavaLibrary::convert(*tempAsciiIdString, asciiId))
{
WARNING(true, ("JavaLibrary::log failed to get the string asciiId."));
return 0;
}
const StringId stringId(table, asciiId);
Unicode::String localized;
if (stringId.localize(localized))
{
JavaString result(localized);
return result.getReturnValue();
}
#ifdef DEBUG
else
{
WARNING(true, ("JavaLibrary::log failed to localize the stringId(%s, %s)", table.c_str(), asciiId.c_str()));
}
#endif
return 0;
} // JavaLibrary::getString
//----------------------------------------------------------------------
/**
* Returns the strings associated with an array of stringIds.
*
* @param env Java environment
* @param self class calling this function
* @param ids array of stringIds to find
*
* @return an array of strings, or null on error
*/
jobjectArray JNICALL ScriptMethodsStringNamespace::getStrings(JNIEnv *env, jobject self, jobjectArray ids)
{
UNREF(self);
if (ids == 0)
return 0;
if (!env->IsInstanceOf(ids, JavaLibrary::getClsStringIdArray()))
return 0;
jsize count = env->GetArrayLength(ids);
// create the string array to return
LocalObjectArrayRefPtr strings = createNewObjectArray(count, JavaLibrary::getClsString());
if (strings == LocalObjectArrayRef::cms_nullPtr)
return 0;
// fill the array
for (jsize i = 0; i < count; ++i)
{
LocalRefPtr id = getObjectArrayElement(LocalObjectArrayRefParam(ids), i);
setObjectArrayElement(*strings, i, LocalRef(getString(env, self, id->getValue())));
}
return strings->getReturnValue();
} // JavaLibrary::getStrings
//----------------------------------------------------------------------
/**
* Finds if a string is obscene.
*
* @param env Java environment
* @param self class calling this function
* @param data string to test
*
* @return true if the string is obscene, false if not
*/
jboolean JNICALL ScriptMethodsStringNamespace::isObscene(JNIEnv *env, jobject self, jstring data)
{
if (data == 0)
return JNI_FALSE;
JavaStringParam jtext(data);
Unicode::String text;
if (JavaLibrary::convert(jtext, text))
{
return NameManager::getInstance().isNameReserved(text);
}
return JNI_FALSE;
} // JavaLibrary::isObscene
//----------------------------------------------------------------------
/**
* Tests is a string is appropriate, whatever that means.
*
* @param env Java environment
* @param self class calling this function
* @param data string to test
*
* @return true if the string is appropriate, false if not
*/
jboolean JNICALL ScriptMethodsStringNamespace::isAppropriateText(JNIEnv *env, jobject self, jstring data)
{
if (data == 0)
return JNI_FALSE;
JavaStringParam jtext(data);
Unicode::String text;
if (JavaLibrary::convert(jtext, text))
{
return TextManager::isAppropriateText(text);
}
return JNI_FALSE;
} // JavaLibrary::isAppropriateText
//----------------------------------------------------------------------
//=======================================================================
//
// ScriptMethodsString.cpp
// Copyright 2000-05, Sony Online Entertainment Inc., all rights reserved.
//
//=======================================================================
#include "serverScript/FirstServerScript.h"
#include "serverScript/JavaLibrary.h"
#include "serverGame/NameManager.h"
#include "sharedGame/TextManager.h"
using namespace JNIWrappersNamespace;
// ======================================================================
// ScriptMethodsStringNamespace
// ======================================================================
namespace ScriptMethodsStringNamespace
{
bool install();
jstring JNICALL getString(JNIEnv *env, jobject self, jobject id);
jobjectArray JNICALL getStrings(JNIEnv *env, jobject self, jobjectArray ids);
jboolean JNICALL isObscene(JNIEnv *env, jobject self, jstring data);
jboolean JNICALL isAppropriateText(JNIEnv *env, jobject self, jstring data);
}
//========================================================================
// install
//========================================================================
bool ScriptMethodsStringNamespace::install()
{
const JNINativeMethod NATIVES[] = {
#define JF(a,b,c) {a,b,(void*)(ScriptMethodsStringNamespace::c)}
JF("getString", "(Lscript/string_id;)Ljava/lang/String;", getString),
JF("getStrings", "([Lscript/string_id;)[Ljava/lang/String;", getStrings),
JF("isObscene", "(Ljava/lang/String;)Z", isObscene),
JF("isAppropriateText", "(Ljava/lang/String;)Z", isAppropriateText),
};
return JavaLibrary::registerNatives(NATIVES, sizeof(NATIVES)/sizeof(NATIVES[0]));
}
//----------------------------------------------------------------------
/**
* Returns the string associated with a stringId.
*
* @param env Java environment
* @param self class calling this function
* @param id the stringId to find
*
* @return the string, or null on error
*/
jstring JNICALL ScriptMethodsStringNamespace::getString(JNIEnv *env, jobject self, jobject id)
{
UNREF(self);
if (id == 0)
{
WARNING(true, ("JavaLibrary::log getString is NULL."));
return 0;
}
// convert the string id to a char string
if (!env->IsInstanceOf(id, JavaLibrary::getClsStringId()))
{
WARNING(true, ("JavaLibrary::log IsInstanceOf failed."));
return 0;
}
// get the table
JavaStringPtr tempString = getStringField(LocalRefParam(id), JavaLibrary::getFidStringIdTable());
std::string table;
if(! JavaLibrary::convert(*tempString, table))
{
WARNING(true, ("JavaLibrary::log failed to get the string table."));
return 0;
}
std::string asciiId;
JavaStringPtr tempAsciiIdString = getStringField(LocalRefParam(id), JavaLibrary::getFidStringIdAsciiId());
if(! JavaLibrary::convert(*tempAsciiIdString, asciiId))
{
WARNING(true, ("JavaLibrary::log failed to get the string asciiId."));
return 0;
}
const StringId stringId(table, asciiId);
Unicode::String localized;
if (stringId.localize(localized))
{
JavaString result(localized);
return result.getReturnValue();
}
#ifdef DEBUG
else
{
WARNING(true, ("JavaLibrary::log failed to localize the stringId(%s, %s)", table.c_str(), asciiId.c_str()));
}
#endif
return 0;
} // JavaLibrary::getString
//----------------------------------------------------------------------
/**
* Returns the strings associated with an array of stringIds.
*
* @param env Java environment
* @param self class calling this function
* @param ids array of stringIds to find
*
* @return an array of strings, or null on error
*/
jobjectArray JNICALL ScriptMethodsStringNamespace::getStrings(JNIEnv *env, jobject self, jobjectArray ids)
{
UNREF(self);
if (ids == 0)
return 0;
if (!env->IsInstanceOf(ids, JavaLibrary::getClsStringIdArray()))
return 0;
jsize count = env->GetArrayLength(ids);
// create the string array to return
LocalObjectArrayRefPtr strings = createNewObjectArray(count, JavaLibrary::getClsString());
if (strings == LocalObjectArrayRef::cms_nullPtr)
return 0;
// fill the array
for (jsize i = 0; i < count; ++i)
{
LocalRefPtr id = getObjectArrayElement(LocalObjectArrayRefParam(ids), i);
setObjectArrayElement(*strings, i, LocalRef(getString(env, self, id->getValue())));
}
return strings->getReturnValue();
} // JavaLibrary::getStrings
//----------------------------------------------------------------------
/**
* Finds if a string is obscene.
*
* @param env Java environment
* @param self class calling this function
* @param data string to test
*
* @return true if the string is obscene, false if not
*/
jboolean JNICALL ScriptMethodsStringNamespace::isObscene(JNIEnv *env, jobject self, jstring data)
{
if (data == 0)
return JNI_FALSE;
JavaStringParam jtext(data);
Unicode::String text;
if (JavaLibrary::convert(jtext, text))
{
return NameManager::getInstance().isNameReserved(text);
}
return JNI_FALSE;
} // JavaLibrary::isObscene
//----------------------------------------------------------------------
/**
* Tests is a string is appropriate, whatever that means.
*
* @param env Java environment
* @param self class calling this function
* @param data string to test
*
* @return true if the string is appropriate, false if not
*/
jboolean JNICALL ScriptMethodsStringNamespace::isAppropriateText(JNIEnv *env, jobject self, jstring data)
{
if (data == 0)
return JNI_FALSE;
JavaStringParam jtext(data);
Unicode::String text;
if (JavaLibrary::convert(jtext, text))
{
return TextManager::isAppropriateText(text);
}
return JNI_FALSE;
} // JavaLibrary::isAppropriateText
//----------------------------------------------------------------------
@@ -210,7 +210,7 @@ public:
const stdvector<ValueDictionary>::fwd & getValueDictionaryArrayParam(int index) const;
protected:
friend void Archive::get(ReadIterator & source, ScriptParams & target);
friend void Archive::get(Archive::ReadIterator & source, ScriptParams & target);
private:
@@ -39,10 +39,6 @@ if(WIN32)
set(PLATFORM_SOURCES
win32/FirstServerUtility.cpp
)
else()
set(PLATFORM_SOURCES
linux/stlhack.cpp
)
endif()
include_directories(
@@ -70,8 +70,8 @@ class PopulationList
PopulationMapType m_populationMap;
mutable PopulationMapType m_populationCache;
friend void Archive::get(ReadIterator & source, PopulationList & target);
friend void Archive::put(ByteStream & target, const PopulationList & source);
friend void Archive::get(Archive::ReadIterator & source, PopulationList & target);
friend void Archive::put(Archive::ByteStream & target, const PopulationList & source);
};
// ======================================================================
@@ -27,84 +27,6 @@
#include <ctime>
#ifdef _DEBUG
//#define ALWAYS_OVERWRITE // flag to always overwrite previous code
#endif
//==============================================================================
// subclass Perforce API class ClientUser in order to trap errors
//static const int SUBMIT_NO_FILE_ERR = 17; // need to add file before submitting
//
//class MyPerforceUser : public ClientUser
//{
//public:
// MyPerforceUser(void) : ClientUser(), m_errorOccurred(false) {}
// virtual ~MyPerforceUser() {}
// virtual void HandleError( Error *err )
// {
// if (err != NULL && err->Test())
// {
// m_errorOccurred = true;
// m_lastError = err->GetGeneric();
// // test for filtered errors
// for (size_t i = 0; i < m_filteredErrors.size(); ++i)
// {
// if (m_lastError == m_filteredErrors[i])
// return;
// }
// }
// ClientUser::HandleError(err);
// }
//
// bool errorOccurred(void) const
// {
// return m_errorOccurred;
// }
//
// int getLastError(void) const
// {
// return m_lastError;
// }
//
// void clearLastError(void)
// {
// m_errorOccurred = false;
// m_lastError = 0;
// }
//
// void addFilteredError(int error)
// {
// m_filteredErrors.push_back(error);
// }
//
// void clearFilteredErrors(void)
// {
// m_filteredErrors.clear();
// }
//
//private:
// bool m_errorOccurred;
// int m_lastError;
// std::vector<int> m_filteredErrors;
//};
//
//
////==============================================================================
//// subclass of the PerforceAPI StrBuf class, to workaround a bug
//// in the destructor. We can't fix the bug because it's an external library
//class StrBufFixed : public StrBuf
//{
//public:
// ~StrBufFixed()
// {
// delete buffer;
// StringInit();
// }
//};
//==============================================================================
// file variables
@@ -404,8 +404,9 @@ static bool dwarfSearch(char const *dwarfLines, unsigned int linesLength, void c
char const *srcFile = bestUnderSrcFileTable+1;
for (int i = 0; i < bestUnderSrcFileNum; ++i)
{
while (*srcFile++);
while (*srcFile++) {
srcFile += 3;
}
}
retSrcFile = SymbolCache::uniqueString(srcFile);
retSrcLine = bestUnderSrcLine;
File diff suppressed because it is too large Load Diff
@@ -461,7 +461,7 @@ void PixCounter::String::set(const char * format, ...)
char buffer[512];
vsnprintf(buffer, sizeof(buffer), format, va);
buffer[sizeof(buffer-1)] = '\0';
buffer[sizeof(buffer)-1] = '\0';
operator =(buffer);
va_end(va);
File diff suppressed because it is too large Load Diff
@@ -674,7 +674,7 @@ void RemoteDebug::send(MESSAGE_TYPE type, const char* theName)
if (explicitMessageLength != 0)
messageLength = explicitMessageLength;
else if (ms_varArgs_buffer)
else if (strlen(ms_varArgs_buffer) > 0)
{
//only grab buffer sizes if needed
messageLength = strlen(ms_varArgs_buffer)+1;
@@ -688,7 +688,7 @@ void RemoteDebug::send(MESSAGE_TYPE type, const char* theName)
uint32 packetLength = static_cast<uint32>(messageTypeLength + channelNumberLength + messageLengthLength + static_cast<int>(messageLength));
if (ms_varArgs_buffer)
if (strlen(ms_varArgs_buffer) > 0)
{
//copy data into the packet
memcpy(ms_buffer, &messageType, static_cast<uint32>(messageTypeLength));

Some files were not shown because too many files have changed in this diff Show More