This commit is contained in:
Light2
2013-08-15 21:45:59 +02:00
21 changed files with 1431 additions and 502 deletions
+416
View File
@@ -0,0 +1,416 @@
import sys
def addZones(core):
gcwService = core.gcwService
gcwService.addZone('corellia', 'corellia_airspace', 0, 0, 0, 0xEEF42002, 0)
gcwService.addZone('corellia', 'corellia_pve', 0, 0, 0, 0x53645205, 0)
gcwService.addZone('corellia', 'corellia_pvp', 0, 0, 0, 0x53645205, 0)
gcwService.addZone('corellia', 'gcw_region_corellia_1', -5880, 5200, 1500, 0xEEF42002, 0)
gcwService.addZone('corellia', 'gcw_region_corellia_10', -142, -4482, 1750, 0x53645205, 0)
gcwService.addZone('corellia', 'gcw_region_corellia_11', 3338, -5382, 1750, 0xEEF42002, 0)
gcwService.addZone('corellia', 'gcw_region_corellia_12', 6618, -5602, 1382, 0xEEF42002, 0)
gcwService.addZone('corellia', 'gcw_region_corellia_13', 0, 0, 0, 0xEEF42002, 0)
gcwService.addZone('corellia', 'gcw_region_corellia_14', 0, 0, 0, 0x53645205, 0)
gcwService.addZone('corellia', 'gcw_region_corellia_2', -3472, 3228, 1500, 0xEEF42002, 0)
gcwService.addZone('corellia', 'gcw_region_corellia_3', -1032, 5708, 1750, 0xEEF42002, 0)
gcwService.addZone('corellia', 'gcw_region_corellia_4', -302, 2178, 1750, 0xEDF42002, 0)
gcwService.addZone('corellia', 'gcw_region_corellia_5', 2718, 5038, 2000, 0xEDF42002, 0)
gcwService.addZone('corellia', 'gcw_region_corellia_6', -5312, -2232, 2000, 0xEDF42002, 0)
gcwService.addZone('corellia', 'gcw_region_corellia_7', -1592, -1172, 1750, 0xEDF42002, 0)
gcwService.addZone('corellia', 'gcw_region_corellia_8', 2708, -1092, 2500, 0xEDF42002, 0)
gcwService.addZone('corellia', 'gcw_region_corellia_9', -5612, -6472, 1500, 0xEDF42002, 0)
gcwService.addZone('corellia', 'space_corellia_space_pve', 0, 0, 0, 0x52645205, 0)
gcwService.addZone('corellia', 'space_corellia_space_pvp', 0, 0, 0, 0x52645205, 0)
gcwService.addZone('dantooine', 'dantooine_airspace', 0, 0, 0, 0x423F0502, 0)
gcwService.addZone('dantooine', 'dantooine_pve', 0, 0, 0, 0x231E0D05, 0)
gcwService.addZone('dantooine', 'dantooine_pvp', 0, 0, 0, 0x231E0D05, 0)
gcwService.addZone('dantooine', 'gcw_region_dantooine_1', -5320, 4440, 2500, 0x423F0502, 0)
gcwService.addZone('dantooine', 'gcw_region_dantooine_10', 6388, 2248, 1500, 0x423F0502, 0)
gcwService.addZone('dantooine', 'gcw_region_dantooine_11', -5972, -5532, 1750, 0x413F0502, 0)
gcwService.addZone('dantooine', 'gcw_region_dantooine_12', -2692, -6172, 1500, 0x413F0502, 0)
gcwService.addZone('dantooine', 'gcw_region_dantooine_13', 1588, -6552, 1400, 0x413F0502, 0)
gcwService.addZone('dantooine', 'gcw_region_dantooine_14', 4439, -4461, 2011, 0x413F0502, 0)
gcwService.addZone('dantooine', 'gcw_region_dantooine_15', 6839, -2161, 1161, 0x413F0502, 0)
gcwService.addZone('dantooine', 'gcw_region_dantooine_16', 0, 0, 0, 0x413F0502, 0)
gcwService.addZone('dantooine', 'gcw_region_dantooine_17', 0, 0, 0, 0x221E0D05, 0)
gcwService.addZone('dantooine', 'gcw_region_dantooine_2', -932, 5708, 2000, 0x413F0502, 0)
gcwService.addZone('dantooine', 'gcw_region_dantooine_3', -6532, -252, 1468, 0x413F0502, 0)
gcwService.addZone('dantooine', 'gcw_region_dantooine_4', -3352, 628, 1750, 0x413F0502, 0)
gcwService.addZone('dantooine', 'gcw_region_dantooine_5', -522, 2238, 1350, 0x413F0502, 0)
gcwService.addZone('dantooine', 'gcw_region_dantooine_6', 2878, 3678, 2250, 0x413F0502, 0)
gcwService.addZone('dantooine', 'gcw_region_dantooine_7', -4462, -2482, 1500, 0x413F0502, 0)
gcwService.addZone('dantooine', 'gcw_region_dantooine_8', -112, -2652, 2800, 0x413F0502, 0)
gcwService.addZone('dantooine', 'gcw_region_dantooine_9', 4108, -352, 1900, 0x413F0502, 0)
gcwService.addZone('dantooine', 'space_dantooine_space_pve', 0, 0, 0, 0x221E0D05, 0)
gcwService.addZone('dantooine', 'space_dantooine_space_pvp', 0, 0, 0, 0x221E0D05, 0)
gcwService.addZone('dathomir', 'dathomir_airspace', 0, 0, 0, 0x47625602, 0)
gcwService.addZone('dathomir', 'dathomir_pve', 0, 0, 0, 0xB0F5D705, 0)
gcwService.addZone('dathomir', 'dathomir_pvp', 0, 0, 0, 0xB0F5D705, 0)
gcwService.addZone('dathomir', 'gcw_region_dathomir_1', -6400, 940, 1250, 0x47625602, 0)
gcwService.addZone('dathomir', 'gcw_region_dathomir_10', 4458, -942, 1750, 0x47625602, 0)
gcwService.addZone('dathomir', 'gcw_region_dathomir_11', 6918, 838, 1082, 0x47625602, 0)
gcwService.addZone('dathomir', 'gcw_region_dathomir_12', 0, 0, 0, 0xB0F5D705, 0)
gcwService.addZone('dathomir', 'gcw_region_dathomir_13', 0, 0, 0, 0x46625602, 0)
gcwService.addZone('dathomir', 'gcw_region_dathomir_2', -3922, 2698, 1750, 0x46625602, 0)
gcwService.addZone('dathomir', 'gcw_region_dathomir_3', -1432, 4908, 1500, 0x46625602, 0)
gcwService.addZone('dathomir', 'gcw_region_dathomir_4', 1958, 4878, 1500, 0x46625602, 0)
gcwService.addZone('dathomir', 'gcw_region_dathomir_5', -3922, -882, 1750, 0x46625602, 0)
gcwService.addZone('dathomir', 'gcw_region_dathomir_6', 238, 898, 2750, 0x46625602, 0)
gcwService.addZone('dathomir', 'gcw_region_dathomir_7', 4478, 2658, 1750, 0x46625602, 0)
gcwService.addZone('dathomir', 'gcw_region_dathomir_8', -1432, -3102, 1500, 0x46625602, 0)
gcwService.addZone('dathomir', 'gcw_region_dathomir_9', 1958, -3132, 1500, 0x46625602, 0)
gcwService.addZone('dathomir', 'space_dathomir_space_pve', 0, 0, 0, 0xAFF5D705, 0)
gcwService.addZone('dathomir', 'space_dathomir_space_pvp', 0, 0, 0, 0xAFF5D705, 0)
gcwService.addZone('endor', 'endor_airspace', 0, 0, 0, 0x4F80D501, 0)
gcwService.addZone('endor', 'endor_pve', 0, 0, 0, 0xC5C09504, 0)
gcwService.addZone('endor', 'endor_pvp', 0, 0, 0, 0xC5C09504, 0)
gcwService.addZone('endor', 'endor_pvp_battlefield', 0, 0, 0, 0x4F80D501, 0)
gcwService.addZone('endor', 'gcw_region_endor_1', -7100, 7080, 750, 0xC5C09504, 0)
gcwService.addZone('endor', 'gcw_region_endor_10', -6502, -6982, 750, 0xC5C09504, 0)
gcwService.addZone('endor', 'gcw_region_endor_11', -1932, -5432, 2000, 0x4F80D501, 0)
gcwService.addZone('endor', 'gcw_region_endor_12', 1398, -4842, 1250, 0x4F80D501, 0)
gcwService.addZone('endor', 'gcw_region_endor_13', 3368, -3552, 1000, 0x4F80D501, 0)
gcwService.addZone('endor', 'gcw_region_endor_14', 5848, -5352, 2000, 0x4F80D501, 0)
gcwService.addZone('endor', 'gcw_region_endor_15', 0, 0, 0, 0x4F80D501, 0)
gcwService.addZone('endor', 'gcw_region_endor_16', 0, 0, 0, 0xC5C09504, 0)
gcwService.addZone('endor', 'gcw_region_endor_2', -3542, 3258, 2000, 0x4F80D501, 0)
gcwService.addZone('endor', 'gcw_region_endor_3', -882, 1578, 1000, 0x4F80D501, 0)
gcwService.addZone('endor', 'gcw_region_endor_4', 1058, 2918, 1250, 0x4F80D501, 0)
gcwService.addZone('endor', 'gcw_region_endor_5', 4268, 3688, 2000, 0x4F80D501, 0)
gcwService.addZone('endor', 'gcw_region_endor_6', -1812, -1372, 2000, 0x4F80D501, 0)
gcwService.addZone('endor', 'gcw_region_endor_7', 1038, 318, 1250, 0x4F80D501, 0)
gcwService.addZone('endor', 'gcw_region_endor_8', 4268, -352, 2000, 0x4E80D501, 0)
gcwService.addZone('endor', 'gcw_region_endor_9', 1438, -2242, 1250, 0x4E80D501, 0)
gcwService.addZone('endor', 'space_endor_space_pve', 0, 0, 0, 0xC4C09504, 0)
gcwService.addZone('endor', 'space_endor_space_pvp', 0, 0, 0, 0xC4C09504, 0)
gcwService.addZone('galaxy', 'corellia_airspace', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'corellia_pve', 0, 0, 0, 0x93158600, 0)
gcwService.addZone('galaxy', 'corellia_pvp', 0, 0, 0, 0x93158600, 0)
gcwService.addZone('galaxy', 'dantooine_airspace', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'dantooine_pve', 0, 0, 0, 0x93158600, 0)
gcwService.addZone('galaxy', 'dantooine_pvp', 0, 0, 0, 0x93158600, 0)
gcwService.addZone('galaxy', 'dathomir_airspace', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'dathomir_pve', 0, 0, 0, 0x93158600, 0)
gcwService.addZone('galaxy', 'dathomir_pvp', 0, 0, 0, 0x93158600, 0)
gcwService.addZone('galaxy', 'endor_airspace', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'endor_pve', 0, 0, 0, 0x93158600, 0)
gcwService.addZone('galaxy', 'endor_pvp', 0, 0, 0, 0x93158600, 0)
gcwService.addZone('galaxy', 'endor_pvp_battlefield', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_corellia_1', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_corellia_10', 0, 0, 0, 0x93158600, 0)
gcwService.addZone('galaxy', 'gcw_region_corellia_11', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_corellia_12', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_corellia_13', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_corellia_14', 0, 0, 0, 0x93158600, 0)
gcwService.addZone('galaxy', 'gcw_region_corellia_2', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_corellia_3', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_corellia_4', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_corellia_5', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_corellia_6', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_corellia_7', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_corellia_8', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_corellia_9', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_dantooine_1', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_dantooine_10', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_dantooine_11', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_dantooine_12', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_dantooine_13', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_dantooine_14', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_dantooine_15', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_dantooine_16', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_dantooine_17', 0, 0, 0, 0x93158600, 0)
gcwService.addZone('galaxy', 'gcw_region_dantooine_2', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_dantooine_3', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_dantooine_4', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_dantooine_5', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_dantooine_6', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_dantooine_7', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_dantooine_8', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_dantooine_9', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_dathomir_1', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_dathomir_10', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_dathomir_11', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_dathomir_12', 0, 0, 0, 0x93158600, 0)
gcwService.addZone('galaxy', 'gcw_region_dathomir_13', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_dathomir_2', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_dathomir_3', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_dathomir_4', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_dathomir_5', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_dathomir_6', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_dathomir_7', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_dathomir_8', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_dathomir_9', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_endor_1', 0, 0, 0, 0x93158600, 0)
gcwService.addZone('galaxy', 'gcw_region_endor_10', 0, 0, 0, 0x93158600, 0)
gcwService.addZone('galaxy', 'gcw_region_endor_11', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_endor_12', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_endor_13', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_endor_14', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_endor_15', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_endor_16', 0, 0, 0, 0x93158600, 0)
gcwService.addZone('galaxy', 'gcw_region_endor_2', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_endor_3', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_endor_4', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_endor_5', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_endor_6', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_endor_7', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_endor_8', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_endor_9', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_lok_1', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_lok_10', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_lok_11', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_lok_12', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_lok_13', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_lok_14', 0, 0, 0, 0x93158600, 0)
gcwService.addZone('galaxy', 'gcw_region_lok_2', 0, 0, 0, 0x93158600, 0)
gcwService.addZone('galaxy', 'gcw_region_lok_3', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_lok_4', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_lok_5', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_lok_6', 0, 0, 0, 0x3BA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_lok_7', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_lok_8', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_lok_9', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_naboo_1', 0, 0, 0, 0x92158600, 0)
gcwService.addZone('galaxy', 'gcw_region_naboo_10', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_naboo_11', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_naboo_12', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_naboo_13', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_naboo_14', 0, 0, 0, 0x92158600, 0)
gcwService.addZone('galaxy', 'gcw_region_naboo_2', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_naboo_3', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_naboo_4', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_naboo_5', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_naboo_6', 0, 0, 0, 0xE988D600, 0)
gcwService.addZone('galaxy', 'gcw_region_naboo_7', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_naboo_8', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_naboo_9', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_rori_1', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_rori_10', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_rori_11', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_rori_12', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_rori_13', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_rori_2', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_rori_3', 0, 0, 0, 0xE988D600, 0)
gcwService.addZone('galaxy', 'gcw_region_rori_4', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_rori_5', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_rori_6', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_rori_7', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_rori_8', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_rori_9', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_talus_1', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_talus_10', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_talus_11', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_talus_12', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_talus_13', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_talus_14', 0, 0, 0, 0xE988D600, 0)
gcwService.addZone('galaxy', 'gcw_region_talus_15', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_talus_16', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_talus_2', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_talus_3', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_talus_4', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_talus_5', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_talus_6', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_talus_7', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_talus_8', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_talus_9', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_tatooine_1', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_tatooine_10', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_tatooine_11', 0, 0, 0, 0x92158600, 0)
gcwService.addZone('galaxy', 'gcw_region_tatooine_12', 0, 0, 0, 0x92158600, 0)
gcwService.addZone('galaxy', 'gcw_region_tatooine_13', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_tatooine_2', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_tatooine_3', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_tatooine_4', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_tatooine_5', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_tatooine_6', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_tatooine_7', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_tatooine_8', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_tatooine_9', 0, 0, 0, 0xE988D600, 0)
gcwService.addZone('galaxy', 'gcw_region_yavin4_1', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_yavin4_10', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_yavin4_11', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_yavin4_12', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_yavin4_13', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_yavin4_14', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_yavin4_15', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_yavin4_16', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_yavin4_17', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_yavin4_18', 0, 0, 0, 0x92158600, 0)
gcwService.addZone('galaxy', 'gcw_region_yavin4_2', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_yavin4_3', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_yavin4_4', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_yavin4_5', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_yavin4_6', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_yavin4_7', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'gcw_region_yavin4_8', 0, 0, 0, 0x92158600, 0)
gcwService.addZone('galaxy', 'gcw_region_yavin4_9', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'lok_airspace', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'lok_pve', 0, 0, 0, 0x92158600, 0)
gcwService.addZone('galaxy', 'lok_pvp', 0, 0, 0, 0x92158600, 0)
gcwService.addZone('galaxy', 'naboo_airspace', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'naboo_pve', 0, 0, 0, 0x92158600, 0)
gcwService.addZone('galaxy', 'naboo_pvp', 0, 0, 0, 0x92158600, 0)
gcwService.addZone('galaxy', 'rori_airspace', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'rori_pve', 0, 0, 0, 0x92158600, 0)
gcwService.addZone('galaxy', 'rori_pvp', 0, 0, 0, 0x92158600, 0)
gcwService.addZone('galaxy', 'space_corellia_space_pve', 0, 0, 0, 0x92158600, 0)
gcwService.addZone('galaxy', 'space_corellia_space_pvp', 0, 0, 0, 0x92158600, 0)
gcwService.addZone('galaxy', 'space_dantooine_space_pve', 0, 0, 0, 0x92158600, 0)
gcwService.addZone('galaxy', 'space_dantooine_space_pvp', 0, 0, 0, 0x92158600, 0)
gcwService.addZone('galaxy', 'space_dathomir_space_pve', 0, 0, 0, 0x92158600, 0)
gcwService.addZone('galaxy', 'space_dathomir_space_pvp', 0, 0, 0, 0x92158600, 0)
gcwService.addZone('galaxy', 'space_endor_space_pve', 0, 0, 0, 0x92158600, 0)
gcwService.addZone('galaxy', 'space_endor_space_pvp', 0, 0, 0, 0x92158600, 0)
gcwService.addZone('galaxy', 'space_lok_space_pve', 0, 0, 0, 0x92158600, 0)
gcwService.addZone('galaxy', 'space_lok_space_pvp', 0, 0, 0, 0x92158600, 0)
gcwService.addZone('galaxy', 'space_naboo_space_pve', 0, 0, 0, 0x92158600, 0)
gcwService.addZone('galaxy', 'space_naboo_space_pvp', 0, 0, 0, 0x92158600, 0)
gcwService.addZone('galaxy', 'space_tatooine_space_pve', 0, 0, 0, 0x92158600, 0)
gcwService.addZone('galaxy', 'space_tatooine_space_pvp', 0, 0, 0, 0x92158600, 0)
gcwService.addZone('galaxy', 'space_yavin4_space_pve', 0, 0, 0, 0x92158600, 0)
gcwService.addZone('galaxy', 'space_yavin4_space_pvp', 0, 0, 0, 0x92158600, 0)
gcwService.addZone('galaxy', 'talus_airspace', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'talus_pve', 0, 0, 0, 0x92158600, 0)
gcwService.addZone('galaxy', 'talus_pvp', 0, 0, 0, 0x92158600, 0)
gcwService.addZone('galaxy', 'tatooine_airspace', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'tatooine_pve', 0, 0, 0, 0x92158600, 0)
gcwService.addZone('galaxy', 'tatooine_pvp', 0, 0, 0, 0x92158600, 0)
gcwService.addZone('galaxy', 'yavin4_airspace', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('galaxy', 'yavin4_pve', 0, 0, 0, 0x92158600, 0)
gcwService.addZone('galaxy', 'yavin4_pvp', 0, 0, 0, 0x92158600, 0)
gcwService.addZone('galaxy', 'yavin4_pvp_battlefield', 0, 0, 0, 0x3AA23500, 0)
gcwService.addZone('lok', 'gcw_region_lok_1', -4780, 3560, 2000, 0xEEF42002, 0)
gcwService.addZone('lok', 'gcw_region_lok_10', 5268, 588, 2000, 0xEEF42002, 0)
gcwService.addZone('lok', 'gcw_region_lok_11', 1588, -5412, 2000, 0xEEF42002, 0)
gcwService.addZone('lok', 'gcw_region_lok_12', 5188, -3452, 2000, 0xEEF42002, 0)
gcwService.addZone('lok', 'gcw_region_lok_13', 0, 0, 0, 0xEEF42002, 0)
gcwService.addZone('lok', 'gcw_region_lok_14', 0, 0, 0, 0x53645205, 0)
gcwService.addZone('lok', 'gcw_region_lok_2', -1192, 5428, 2000, 0x53645205, 0)
gcwService.addZone('lok', 'gcw_region_lok_3', -4832, -472, 2000, 0xEEF42002, 0)
gcwService.addZone('lok', 'gcw_region_lok_4', -1272, 1408, 2000, 0xEEF42002, 0)
gcwService.addZone('lok', 'gcw_region_lok_5', 2288, 3348, 2000, 0xEEF42002, 0)
gcwService.addZone('lok', 'gcw_region_lok_6', 5948, 5008, 2000, 0xEEF42002, 0)
gcwService.addZone('lok', 'gcw_region_lok_7', -5652, -4732, 2000, 0xEDF42002, 0)
gcwService.addZone('lok', 'gcw_region_lok_8', -1892, -3252, 2000, 0xEDF42002, 0)
gcwService.addZone('lok', 'gcw_region_lok_9', 1728, -1372, 2000, 0xEDF42002, 0)
gcwService.addZone('lok', 'lok_airspace', 0, 0, 0, 0xEDF42002, 0)
gcwService.addZone('lok', 'lok_pve', 0, 0, 0, 0x52645205, 0)
gcwService.addZone('lok', 'lok_pvp', 0, 0, 0, 0x52645205, 0)
gcwService.addZone('lok', 'space_lok_space_pve', 0, 0, 0, 0x52645205, 0)
gcwService.addZone('lok', 'space_lok_space_pvp', 0, 0, 0, 0x52645205, 0)
gcwService.addZone('naboo', 'gcw_region_naboo_1', -5340, 4380, 2250, 0x2A8CCE04, 0)
gcwService.addZone('naboo', 'gcw_region_naboo_10', 1118, -3342, 2250, 0x1138EC01, 0)
gcwService.addZone('naboo', 'gcw_region_naboo_11', 4868, -1852, 1700, 0x1138EC01, 0)
gcwService.addZone('naboo', 'gcw_region_naboo_12', 4638, -5342, 1750, 0x1138EC01, 0)
gcwService.addZone('naboo', 'gcw_region_naboo_13', 0, 0, 0, 0x1138EC01, 0)
gcwService.addZone('naboo', 'gcw_region_naboo_14', 0, 0, 0, 0x2A8CCE04, 0)
gcwService.addZone('naboo', 'gcw_region_naboo_2', -1682, 5658, 1650, 0x1138EC01, 0)
gcwService.addZone('naboo', 'gcw_region_naboo_3', 1978, 6734, 1266, 0x1138EC01, 0)
gcwService.addZone('naboo', 'gcw_region_naboo_4', 5378, 5678, 2000, 0x1038EC01, 0)
gcwService.addZone('naboo', 'gcw_region_naboo_5', -2442, 518, 2250, 0x1038EC01, 0)
gcwService.addZone('naboo', 'gcw_region_naboo_6', 1358, 3018, 2250, 0x42E0B007, 0)
gcwService.addZone('naboo', 'gcw_region_naboo_7', 5358, 1738, 1850, 0x1038EC01, 0)
gcwService.addZone('naboo', 'gcw_region_naboo_8', -4752, -3392, 2000, 0x1038EC01, 0)
gcwService.addZone('naboo', 'gcw_region_naboo_9', -1972, -5612, 1500, 0x1038EC01, 0)
gcwService.addZone('naboo', 'naboo_airspace', 0, 0, 0, 0x1038EC01, 0)
gcwService.addZone('naboo', 'naboo_pve', 0, 0, 0, 0x298CCE04, 0)
gcwService.addZone('naboo', 'naboo_pvp', 0, 0, 0, 0x298CCE04, 0)
gcwService.addZone('naboo', 'space_naboo_space_pve', 0, 0, 0, 0x298CCE04, 0)
gcwService.addZone('naboo', 'space_naboo_space_pvp', 0, 0, 0, 0x298CCE04, 0)
gcwService.addZone('rori', 'gcw_region_naboo_14', 0, 0, 0, 0x231E0D05, 0)
gcwService.addZone('rori', 'gcw_region_rori_1', -4780, 6000, 1900, 0x423F0502, 0)
gcwService.addZone('rori', 'gcw_region_rori_10', 4648, -1852, 1900, 0x423F0502, 0)
gcwService.addZone('rori', 'gcw_region_rori_11', -4772, -5512, 1900, 0x423F0502, 0)
gcwService.addZone('rori', 'gcw_region_rori_12', 5128, -5792, 2000, 0x423F0502, 0)
gcwService.addZone('rori', 'gcw_region_rori_13', 0, 0, 0, 0x413F0502, 0)
gcwService.addZone('rori', 'gcw_region_rori_2', 168, 4588, 3100, 0x413F0502, 0)
gcwService.addZone('rori', 'gcw_region_rori_3', 5088, 5808, 1900, 0x04FD1408, 0)
gcwService.addZone('rori', 'gcw_region_rori_4', -4312, 2188, 1900, 0x413F0502, 0)
gcwService.addZone('rori', 'gcw_region_rori_5', -1522, 198, 1300, 0x413F0502, 0)
gcwService.addZone('rori', 'gcw_region_rori_6', 1378, 138, 1300, 0x413F0502, 0)
gcwService.addZone('rori', 'gcw_region_rori_7', 4508, 2008, 1900, 0x413F0502, 0)
gcwService.addZone('rori', 'gcw_region_rori_8', -4292, -1652, 1900, 0x413F0502, 0)
gcwService.addZone('rori', 'gcw_region_rori_9', 148, -4192, 3100, 0x413F0502, 0)
gcwService.addZone('rori', 'rori_airspace', 0, 0, 0, 0x413F0502, 0)
gcwService.addZone('rori', 'rori_pve', 0, 0, 0, 0x221E0D05, 0)
gcwService.addZone('rori', 'rori_pvp', 0, 0, 0, 0x221E0D05, 0)
gcwService.addZone('rori', 'space_naboo_space_pve', 0, 0, 0, 0x221E0D05, 0)
gcwService.addZone('rori', 'space_naboo_space_pvp', 0, 0, 0, 0x221E0D05, 0)
gcwService.addZone('talus', 'gcw_region_corellia_14', 0, 0, 0, 0xC5C09504, 0)
gcwService.addZone('talus', 'gcw_region_talus_1', -3280, 5480, 1600, 0x4F80D501, 0)
gcwService.addZone('talus', 'gcw_region_talus_10', 528, 508, 1600, 0x4F80D501, 0)
gcwService.addZone('talus', 'gcw_region_talus_11', 3548, -772, 1600, 0x4F80D501, 0)
gcwService.addZone('talus', 'gcw_region_talus_12', 6448, -1992, 1500, 0x4F80D501, 0)
gcwService.addZone('talus', 'gcw_region_talus_13', -2812, -4052, 1600, 0x4F80D501, 0)
gcwService.addZone('talus', 'gcw_region_talus_14', 558, -3002, 1850, 0x3C015607, 0)
gcwService.addZone('talus', 'gcw_region_talus_15', 3968, -3972, 1600, 0x4F80D501, 0)
gcwService.addZone('talus', 'gcw_region_talus_16', 0, 0, 0, 0x4F80D501, 0)
gcwService.addZone('talus', 'gcw_region_talus_2', 468, 5488, 1600, 0x4F80D501, 0)
gcwService.addZone('talus', 'gcw_region_talus_3', 4368, 5488, 1600, 0x4F80D501, 0)
gcwService.addZone('talus', 'gcw_region_talus_4', -5072, 1108, 1600, 0x4F80D501, 0)
gcwService.addZone('talus', 'gcw_region_talus_5', -2112, 2448, 1600, 0x4F80D501, 0)
gcwService.addZone('talus', 'gcw_region_talus_6', 3108, 2488, 1600, 0x4F80D501, 0)
gcwService.addZone('talus', 'gcw_region_talus_7', 6108, 1268, 1600, 0x4F80D501, 0)
gcwService.addZone('talus', 'gcw_region_talus_8', -5432, -2132, 1600, 0x4F80D501, 0)
gcwService.addZone('talus', 'gcw_region_talus_9', -2412, -812, 1600, 0x4F80D501, 0)
gcwService.addZone('talus', 'space_corellia_space_pve', 0, 0, 0, 0xC4C09504, 0)
gcwService.addZone('talus', 'space_corellia_space_pvp', 0, 0, 0, 0xC4C09504, 0)
gcwService.addZone('talus', 'talus_airspace', 0, 0, 0, 0x4E80D501, 0)
gcwService.addZone('talus', 'talus_pve', 0, 0, 0, 0xC4C09504, 0)
gcwService.addZone('talus', 'talus_pvp', 0, 0, 0, 0xC4C09504, 0)
gcwService.addZone('tatooine', 'gcw_region_tatooine_1', -5320, 5200, 2500, 0x56A0FC01, 0)
gcwService.addZone('tatooine', 'gcw_region_tatooine_10', 108, -5332, 1000, 0x56A0FC01, 0)
gcwService.addZone('tatooine', 'gcw_region_tatooine_11', 3460, -4768, 1750, 0xD690F704, 0)
gcwService.addZone('tatooine', 'gcw_region_tatooine_12', 0, 0, 0, 0xD690F704, 0)
gcwService.addZone('tatooine', 'gcw_region_tatooine_13', 0, 0, 0, 0x56A0FC01, 0)
gcwService.addZone('tatooine', 'gcw_region_tatooine_2', -2960, 2200, 1250, 0x56A0FC01, 0)
gcwService.addZone('tatooine', 'gcw_region_tatooine_3', 1480, 3240, 1200, 0x55A0FC01, 0)
gcwService.addZone('tatooine', 'gcw_region_tatooine_4', 3840, 2420, 1200, 0x55A0FC01, 0)
gcwService.addZone('tatooine', 'gcw_region_tatooine_5', -4252, -2112, 2200, 0x55A0FC01, 0)
gcwService.addZone('tatooine', 'gcw_region_tatooine_6', -132, 28, 2200, 0x55A0FC01, 0)
gcwService.addZone('tatooine', 'gcw_region_tatooine_7', 4140, -940, 2100, 0x55A0FC01, 0)
gcwService.addZone('tatooine', 'gcw_region_tatooine_8', -5192, -5952, 1700, 0x55A0FC01, 0)
gcwService.addZone('tatooine', 'gcw_region_tatooine_9', -1232, -3652, 1100, 0x55A0FC01, 0)
gcwService.addZone('tatooine', 'space_tatooine_space_pve', 0, 0, 0, 0xD590F704, 0)
gcwService.addZone('tatooine', 'space_tatooine_space_pvp', 0, 0, 0, 0xD590F704, 0)
gcwService.addZone('tatooine', 'tatooine_airspace', 0, 0, 0, 0x55A0FC01, 0)
gcwService.addZone('tatooine', 'tatooine_pve', 0, 0, 0, 0xD590F704, 0)
gcwService.addZone('tatooine', 'tatooine_pvp', 0, 0, 0, 0xD590F704, 0)
gcwService.addZone('yavin4', 'gcw_region_yavin4_1', -5562, 5578, 2250, 0x3763CE01, 0)
gcwService.addZone('yavin4', 'gcw_region_yavin4_10', -4662, -4082, 2800, 0x3763CE01, 0)
gcwService.addZone('yavin4', 'gcw_region_yavin4_11', -532, -2432, 1500, 0x3763CE01, 0)
gcwService.addZone('yavin4', 'gcw_region_yavin4_12', 3148, -3112, 1900, 0x3763CE01, 0)
gcwService.addZone('yavin4', 'gcw_region_yavin4_13', 6208, -4692, 1500, 0x3763CE01, 0)
gcwService.addZone('yavin4', 'gcw_region_yavin4_14', -2502, -7022, 750, 0x3763CE01, 0)
gcwService.addZone('yavin4', 'gcw_region_yavin4_15', -552, -5512, 1500, 0x3763CE01, 0)
gcwService.addZone('yavin4', 'gcw_region_yavin4_16', 3998, -6242, 1150, 0x3763CE01, 0)
gcwService.addZone('yavin4', 'gcw_region_yavin4_17', 0, 0, 0, 0x3763CE01, 0)
gcwService.addZone('yavin4', 'gcw_region_yavin4_18', 0, 0, 0, 0x08F88304, 0)
gcwService.addZone('yavin4', 'gcw_region_yavin4_2', -2482, 3698, 1300, 0x3663CE01, 0)
gcwService.addZone('yavin4', 'gcw_region_yavin4_3', -312, 4908, 1150, 0x3663CE01, 0)
gcwService.addZone('yavin4', 'gcw_region_yavin4_4', 2618, 2718, 1700, 0x3663CE01, 0)
gcwService.addZone('yavin4', 'gcw_region_yavin4_5', 5168, 5708, 2000, 0x3663CE01, 0)
gcwService.addZone('yavin4', 'gcw_region_yavin4_6', -5142, 1038, 2250, 0x3663CE01, 0)
gcwService.addZone('yavin4', 'gcw_region_yavin4_7', -1352, 1068, 1500, 0x3663CE01, 0)
gcwService.addZone('yavin4', 'gcw_region_yavin4_8', 1198, 158, 1150, 0x07F88304, 0)
gcwService.addZone('yavin4', 'gcw_region_yavin4_9', 5448, 468, 1900, 0x3663CE01, 0)
gcwService.addZone('yavin4', 'space_yavin4_space_pve', 0, 0, 0, 0x07F88304, 0)
gcwService.addZone('yavin4', 'space_yavin4_space_pvp', 0, 0, 0, 0x07F88304, 0)
gcwService.addZone('yavin4', 'yavin4_airspace', 0, 0, 0, 0x3663CE01, 0)
gcwService.addZone('yavin4', 'yavin4_pve', 0, 0, 0, 0x07F88304, 0)
gcwService.addZone('yavin4', 'yavin4_pvp', 0, 0, 0, 0x07F88304, 0)
gcwService.addZone('yavin4', 'yavin4_pvp_battlefield', 0, 0, 0, 0x3663CE01, 0)
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+32
View File
@@ -0,0 +1,32 @@
/*******************************************************************************
* Copyright (c) 2013 <Project SWG>
*
* This File is part of NGECore2.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Using NGEngine to work with NGECore2 is making a combined work based on NGEngine.
* Therefore all terms and conditions of the GNU Lesser General Public License cover the combination.
******************************************************************************/
package resources.common;
import engine.resources.common.CRC;
public class Factions {
public static int Neutral = 0;
public static int Rebel = CRC.StringtoCRC("rebel");
public static int Imperial = CRC.StringtoCRC("imperial");
}
+2 -2
View File
@@ -47,8 +47,8 @@ public class Opcodes {
public static int SuiEventNotification = 0x092D3564;
public static int DeltasMessage = 0x12862153;
public static int ChatAddFriend = 0x6FE7BD90;
public static int GcwRegionsReq = 0x7C8C8E0E; //CRC.StringtoCRC("GcwRegionsReq");
public static int GcwRegionsRsp = 0x8DCAB70C; //CRC.StringtoCRC("GcwRegionsRsp");
public static int GcwRegionsReq = CRC.StringtoCRC("GcwRegionsReq");
public static int GcwRegionsRsp = CRC.StringtoCRC("GcwRegionsRsp");
public static int GcwGroupsRsp = CRC.StringtoCRC("GcwGroupsRsp");
}
+36
View File
@@ -0,0 +1,36 @@
/*******************************************************************************
* Copyright (c) 2013 <Project SWG>
*
* This File is part of NGECore2.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Using NGEngine to work with NGECore2 is making a combined work based on NGEngine.
* Therefore all terms and conditions of the GNU Lesser General Public License cover the combination.
******************************************************************************/
package resources.common;
public class PvpStatus {
public static int Attackable = 1;
public static int Aggressive = 2;
public static int Overt = 4;
public static int TEF = 8;
public static int Player = 16;
public static int Enemy = 32;
public static int GoingOvert = 64;
public static int GoingCombatant = 128;
public static int Dueling = 256;
}
+16 -1
View File
@@ -27,6 +27,8 @@ import java.nio.ByteOrder;
public class StringUtilities {
final protected static char[] hexArray = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
public static String getAsciiString(ByteBuffer buffer) {
return getString(buffer, "US-ASCII");
}
@@ -88,5 +90,18 @@ public class StringUtilities {
return result.array();
}
public static String bytesToHex(byte[] bytes) {
char[] hexChars = new char[bytes.length * 2];
int v;
for ( int j = 0; j < bytes.length; j++ ) {
v = bytes[j] & 0xFF;
hexChars[j * 2] = hexArray[v >>> 4];
hexChars[j * 2 + 1] = hexArray[v & 0x0F];
}
return new String(hexChars);
}
}
@@ -0,0 +1,61 @@
/*******************************************************************************
* Copyright (c) 2013 <Project SWG>
*
* This File is part of NGECore2.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Using NGEngine to work with NGECore2 is making a combined work based on NGEngine.
* Therefore all terms and conditions of the GNU Lesser General Public License cover the combination.
******************************************************************************/
package resources.gcw;
import java.nio.ByteOrder;
import org.apache.mina.core.buffer.IoBuffer;
import resources.objects.ListObject;
public class CurrentServerGCWZoneHistory extends ListObject {
private int lastUpdateTime;
private int percent;
public CurrentServerGCWZoneHistory(CurrentServerGCWZonePercent zone) {
this.percent = zone.getPercent();
this.lastUpdateTime = zone.getLastUpdateTime();
}
public int getLastUpdateTime() {
synchronized(objectMutex) {
return lastUpdateTime;
}
}
public int getPercent() {
synchronized(objectMutex) {
return percent;
}
}
public byte[] getBytes() {
synchronized(objectMutex) {
IoBuffer buffer = bufferPool.allocate((8), false).order(ByteOrder.LITTLE_ENDIAN);
buffer.putInt(lastUpdateTime);
buffer.putInt(percent);
return buffer.array();
}
}
}
@@ -19,61 +19,54 @@
* Using NGEngine to work with NGECore2 is making a combined work based on NGEngine.
* Therefore all terms and conditions of the GNU Lesser General Public License cover the combination.
******************************************************************************/
package resources.objects;
package resources.gcw;
import java.nio.ByteOrder;
import org.apache.mina.core.buffer.IoBuffer;
public class OtherServerGCWZonePercent extends ListObject {
import engine.resources.scene.Point2D;
import resources.objects.ListObject;
public class CurrentServerGCWZonePercent extends ListObject {
private byte unknown1 = 0;
private String server = "SWG";
private String zone = "";
private int lastUpdateTime = ((int) System.currentTimeMillis());
private Point2D position;
private float radius;
private int group;
private float weight;
private int percent = 50;
private int gcwPoints = 0;
public OtherServerGCWZonePercent(String server, String zone) {
this.server = server;
this.zone = zone;
private long lastUpdateTime = System.currentTimeMillis();
public CurrentServerGCWZonePercent(Point2D position, float radius, int group, float weight) {
this.position = position;
this.radius = radius;
this.group = group;
this.weight = weight;
}
public OtherServerGCWZonePercent(String zone) {
this.zone = zone;
}
public OtherServerGCWZonePercent() {
}
public byte getUnknown1() {
public Point2D getPosition() {
synchronized(objectMutex) {
return unknown1;
return position;
}
}
public void setUnknown1(byte unknown1) {
public float getRadius() {
synchronized(objectMutex) {
this.unknown1 = unknown1;
return radius;
}
}
public String getServer() {
public int getGroup() {
synchronized(objectMutex) {
return server;
return group;
}
}
public String getZone() {
public float getWeight() {
synchronized(objectMutex) {
return zone;
}
}
public int getLastUpdateTime() {
synchronized(objectMutex) {
return lastUpdateTime;
return weight;
}
}
@@ -83,10 +76,10 @@ public class OtherServerGCWZonePercent extends ListObject {
}
}
public void setPercent(int percent) {
public CurrentServerGCWZonePercent setPercent(int percent) {
synchronized(objectMutex) {
this.percent = percent;
this.lastUpdateTime = ((int) System.currentTimeMillis());
return this;
}
}
@@ -108,11 +101,15 @@ public class OtherServerGCWZonePercent extends ListObject {
}
}
public int getLastUpdateTime() {
synchronized(objectMutex) {
return (int) lastUpdateTime;
}
}
public byte[] getBytes() {
synchronized(objectMutex) {
IoBuffer buffer = bufferPool.allocate((4 + server.length() + zone.length() + 4), false).order(ByteOrder.LITTLE_ENDIAN);
buffer.put(getAsciiString(server));
buffer.put(getAsciiString(zone));
IoBuffer buffer = bufferPool.allocate(4, false).order(ByteOrder.LITTLE_ENDIAN);
buffer.putInt(percent);
return buffer.array();
}
@@ -19,38 +19,21 @@
* Using NGEngine to work with NGECore2 is making a combined work based on NGEngine.
* Therefore all terms and conditions of the GNU Lesser General Public License cover the combination.
******************************************************************************/
package resources.objects;
package resources.gcw;
import java.nio.ByteOrder;
import org.apache.mina.core.buffer.IoBuffer;
public class CurrentServerGCWZoneHistory extends ListObject {
import resources.objects.ListObject;
public class OtherServerGCWZonePercent extends ListObject {
private byte unknown1 = 0;
private String zone = "";
private int lastUpdateTime = ((int) System.currentTimeMillis());
private int percent = 50;
public CurrentServerGCWZoneHistory(String zone, int percent) {
public OtherServerGCWZonePercent(String zone) {
this.zone = zone;
this.percent = percent;
}
public CurrentServerGCWZoneHistory(String zone) {
this.zone = zone;
}
public byte getUnknown1() {
synchronized(objectMutex) {
return unknown1;
}
}
public void setUnknown1(byte unknown1) {
synchronized(objectMutex) {
this.unknown1 = unknown1;
}
}
public String getZone() {
@@ -59,30 +42,23 @@ public class CurrentServerGCWZoneHistory extends ListObject {
}
}
public int getLastUpdateTime() {
synchronized(objectMutex) {
return lastUpdateTime;
}
}
public int getPercent() {
synchronized(objectMutex) {
return percent;
}
}
public void setPercent(int percent) {
public OtherServerGCWZonePercent setPercent(int percent) {
synchronized(objectMutex) {
this.percent = percent;
this.lastUpdateTime = ((int) System.currentTimeMillis());
return this;
}
}
public byte[] getBytes() {
synchronized(objectMutex) {
IoBuffer buffer = bufferPool.allocate((8 + zone.length() + 2), false).order(ByteOrder.LITTLE_ENDIAN);
IoBuffer buffer = bufferPool.allocate((2 + zone.length() + 4), false).order(ByteOrder.LITTLE_ENDIAN);
buffer.put(getAsciiString(zone));
buffer.putInt(lastUpdateTime);
buffer.putInt(percent);
return buffer.array();
}
@@ -19,13 +19,15 @@
* Using NGEngine to work with NGECore2 is making a combined work based on NGEngine.
* Therefore all terms and conditions of the GNU Lesser General Public License cover the combination.
******************************************************************************/
package resources.objects;
package resources.guild;
import java.nio.ByteOrder;
import java.util.List;
import org.apache.mina.core.buffer.IoBuffer;
import resources.objects.ListObject;
import engine.resources.objects.SWGObject;
public class Guild extends ListObject {
-1
View File
@@ -21,7 +21,6 @@
******************************************************************************/
package resources.objects;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import org.apache.mina.core.buffer.IoBuffer;
@@ -1,117 +0,0 @@
/*******************************************************************************
* Copyright (c) 2013 <Project SWG>
*
* This File is part of NGECore2.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Using NGEngine to work with NGECore2 is making a combined work based on NGEngine.
* Therefore all terms and conditions of the GNU Lesser General Public License cover the combination.
******************************************************************************/
package resources.objects;
import java.nio.ByteOrder;
import org.apache.mina.core.buffer.IoBuffer;
public class CurrentServerGCWZonePercent extends ListObject {
private byte unknown1 = 0;
private String zone = "";
private int percent = 60;
private int gcwPoints = 0;
public CurrentServerGCWZonePercent(String zone) {
this.zone = zone;
}
public byte getUnknown1() {
synchronized(objectMutex) {
return unknown1;
}
}
public void setUnknown1(byte unknown1) {
synchronized(objectMutex) {
this.unknown1 = unknown1;
}
}
public String getZone() {
synchronized(objectMutex) {
return zone;
}
}
public int getPercent() {
synchronized(objectMutex) {
return percent;
}
}
public void setPercent(int percent, SWGList<CurrentServerGCWZoneHistory> historyList) {
synchronized(objectMutex) {
int historyCount = 0;
int firstHistoryIndex = historyList.get().size();
int lastHistoryIndex = historyList.get().size();
for (int i = 0; i < historyList.size(); i++) {
if (historyList.get(i).getZone() == getZone()) {
historyCount++;
lastHistoryIndex = i;
if (historyCount == 1) {
firstHistoryIndex = i;
}
}
}
if (historyCount > 10) {
historyList.remove(firstHistoryIndex);
}
historyList.add(lastHistoryIndex, new CurrentServerGCWZoneHistory(zone, percent));
this.percent = percent;
}
}
public int getGCWPoints() {
synchronized(objectMutex) {
return gcwPoints;
}
}
public void addGCWPoints(int gcwPoints) {
synchronized(objectMutex) {
this.gcwPoints += gcwPoints;
}
}
public void removeGCWPoints(int gcwPoints) {
synchronized(objectMutex) {
this.gcwPoints = (((this.gcwPoints - gcwPoints) < 0) ? 0 : this.gcwPoints - gcwPoints);
}
}
public byte[] getBytes() {
synchronized(objectMutex) {
IoBuffer buffer = bufferPool.allocate((4 + zone.length() + 2), false).order(ByteOrder.LITTLE_ENDIAN);
buffer.put(getAsciiString(zone));
buffer.putInt(percent);
return buffer.array();
}
}
}
+91 -20
View File
@@ -22,11 +22,13 @@
package resources.objects;
import java.nio.ByteOrder;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import java.util.Map.Entry;
import org.apache.mina.core.buffer.IoBuffer;
@@ -54,6 +56,19 @@ public class SWGMap<K, V> implements Map<K, V> {
this.updateType = (short) updateType;
}
public SWGMap(Map<K, V> m) {
if (m instanceof SWGMap) {
this.messageBuilder = ((SWGMap<K, V>) m).messageBuilder;
this.viewType = ((SWGMap<K, V>) m).viewType;
this.updateType = ((SWGMap<K, V>) m).updateType;
map.putAll(m);
}
}
public SWGMap() {
}
public void clear() {
throw new UnsupportedOperationException();
}
@@ -96,19 +111,19 @@ public class SWGMap<K, V> implements Map<K, V> {
public V put(K key, V value) {
synchronized(objectMutex) {
if (key instanceof String && value instanceof IListObject) {
if ((key instanceof String || key instanceof Byte || key instanceof Short ||
key instanceof Integer || key instanceof Float ||key instanceof Long) &&
value instanceof IListObject) {
if (map.containsKey(key)) {
// Changing an existing map
V oldValue = map.put(key, value);
queue(item(2, key, ((IListObject) value).getBytes(), true, true));
queue(item(2, (String) key, ((IListObject) value).getBytes(), true, true));
return oldValue;
} else {
// Adding to the map
V oldValue = map.put(key, value);
queue(item(0, key, ((IListObject) value).getBytes(), true, true));
queue(item(0, (String) key, ((IListObject) value).getBytes(), true, true));
return oldValue;
}
@@ -119,11 +134,47 @@ public class SWGMap<K, V> implements Map<K, V> {
}
public void putAll(Map<? extends K, ? extends V> m) {
throw new UnsupportedOperationException();
synchronized(objectMutex) {
List<byte[]> buffer = new ArrayList<byte[]>();
for (Entry<? extends K, ? extends V> entry : m.entrySet()) {
K key = entry.getKey();
V value = entry.getValue();
if (key instanceof String || key instanceof Byte || key instanceof Short ||
key instanceof Integer || key instanceof Float || key instanceof Long ||
value instanceof IListObject) {
if (map.containsKey(key)) {
if (map.put(key, value) != null) {
buffer.add(item(2, (String) key, ((IListObject) value).getBytes(), true, true));
}
} else {
if (map.put(key, value) != null) {
buffer.add(item(0, (String) key, ((IListObject) value).getBytes(), true, true));
}
}
}
}
if (buffer.size() > 0) {
queue(buffer);
}
}
}
public V remove(Object arg0) {
throw new UnsupportedOperationException();
public V remove(Object key) {
synchronized(objectMutex) {
if (key instanceof String || key instanceof Byte || key instanceof Short ||
key instanceof Integer || key instanceof Float || key instanceof Long) {
V value = map.remove(key);
queue(item(1, key, ((IListObject) map.get(key)).getBytes(), true, true));
return value;
}
return null;
}
}
public int size() {
@@ -139,24 +190,44 @@ public class SWGMap<K, V> implements Map<K, V> {
}
public int getUpdateCounter() {
return updateCounter;
synchronized(objectMutex) {
return updateCounter;
}
}
private byte[] item(int type, K index, byte[] data, boolean useIndex, boolean useData) {
if (index instanceof String) {
int size = 1 + ((useIndex) ? (2 + ((String) index).getBytes().length) : 0) + ((useData) ? data.length : 0);
IoBuffer buffer = messageBuilder.bufferPool.allocate((size), false).order(ByteOrder.LITTLE_ENDIAN);
buffer.put((byte) type);
if (useIndex) buffer.put(((index instanceof String) ? StringUtilities.getAsciiString((String) index) : Integer.toString(0).getBytes()));
private byte[] item(int type, Object index, byte[] data, boolean useIndex, boolean useData) {
if (useIndex && !(index instanceof Byte) && !(index instanceof Short)
&& !(index instanceof Integer) && !(index instanceof Float)
&& !(index instanceof Long) && !(index instanceof String)) {
throw new IllegalArgumentException();
}
int size = 1 + ((useIndex) ? (2 + index.toString().getBytes().length) : 0) + ((useData) ? data.length : 0);
IoBuffer buffer = messageBuilder.bufferPool.allocate((size), false).order(ByteOrder.LITTLE_ENDIAN);
buffer.put((byte) type);
if (useIndex) {
if (index instanceof String) {
buffer.put(StringUtilities.getAsciiString((String) index));
} else if (index instanceof Byte) {
buffer.put(((Byte) index).byteValue());
} else if (index instanceof Short) {
buffer.putShort(((Short) index).shortValue());
} else if (index instanceof Integer) {
buffer.putInt(((Integer) index).intValue());
} else if (index instanceof Float) {
buffer.putFloat(((Float) index).floatValue());
} else if (index instanceof Long) {
buffer.putLong(((Long) index).longValue());
} else {
throw new IllegalArgumentException();
}
}
if (useData) buffer.put(data);
updateCounter++;
return buffer.array();
} else {
throw new IllegalArgumentException();
}
}
private void queue(byte[] data) {
+345
View File
@@ -0,0 +1,345 @@
/*******************************************************************************
* Copyright (c) 2013 <Project SWG>
*
* This File is part of NGECore2.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Using NGEngine to work with NGECore2 is making a combined work based on NGEngine.
* Therefore all terms and conditions of the GNU Lesser General Public License cover the combination.
******************************************************************************/
package resources.objects;
import java.nio.ByteOrder;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.TreeMap;
import org.apache.mina.core.buffer.IoBuffer;
import org.python.google.common.collect.ArrayListMultimap;
import org.python.google.common.collect.Multimap;
import org.python.google.common.collect.Multiset;
import org.python.google.common.collect.Ordering;
import org.python.google.common.collect.TreeMultimap;
import resources.common.StringUtilities;
import com.sleepycat.persist.model.NotPersistent;
@SuppressWarnings("unused")
public class SWGMultiMap<K, V> implements Multimap<K, V> {
private Multimap<K, V> map = ArrayListMultimap.create();
@NotPersistent
private int updateCounter;
private ObjectMessageBuilder messageBuilder;
private byte viewType;
private short updateType;
protected final Object objectMutex = new Object();
public SWGMultiMap(ObjectMessageBuilder messageBuilder, int viewType, int updateType) {
this.messageBuilder = messageBuilder;
this.viewType = (byte) viewType;
this.updateType = (short) updateType;
}
public SWGMultiMap(Multimap<K, V> m) {
if (m instanceof SWGMultiMap) {
this.messageBuilder = ((SWGMultiMap<K, V>) m).messageBuilder;
this.viewType = ((SWGMultiMap<K, V>) m).viewType;
this.updateType = ((SWGMultiMap<K, V>) m).updateType;
map.putAll(m);
}
}
public SWGMultiMap() {
}
public Map<K, Collection<V>> asMap() {
synchronized(objectMutex) {
return map.asMap();
}
}
public void clear() {
throw new UnsupportedOperationException();
}
public boolean containsEntry(Object key, Object value) {
synchronized(objectMutex) {
return map.containsEntry(key, value);
}
}
public boolean containsKey(Object key) {
synchronized(objectMutex) {
return map.containsKey(key);
}
}
public boolean containsValue(Object value) {
synchronized(objectMutex) {
return map.containsValue(value);
}
}
public Collection<Entry<K, V>> entries() {
synchronized(objectMutex) {
return map.entries();
}
}
public Collection<V> get(K key) {
synchronized(objectMutex) {
return map.get(key);
}
}
public boolean isEmpty() {
synchronized(objectMutex) {
return map.isEmpty();
}
}
public Multiset<K> keys() {
synchronized(objectMutex) {
return map.keys();
}
}
public Set<K> keySet() {
synchronized(objectMutex) {
return map.keySet();
}
}
public boolean put(K key, V value) {
synchronized(objectMutex) {
if (key instanceof String || key instanceof Byte || key instanceof Short ||
key instanceof Integer || key instanceof Float || key instanceof Long ||
value instanceof IListObject) {
if (map.put(key, value)) {
queue(item(0, (String) key, ((IListObject) value).getBytes(), true, true));
return true;
}
}
return false;
}
}
public boolean putAll(K key, Iterable<? extends V> values) {
synchronized(objectMutex) {
if (key instanceof String || key instanceof Byte || key instanceof Short ||
key instanceof Integer || key instanceof Float || key instanceof Long) {
List<byte[]> buffer = new ArrayList<byte[]>();
for (V value : values) {
if (value instanceof IListObject) {
if (map.put(key, value)) {
buffer.add(item(0, (String) key, ((IListObject) value).getBytes(), true, true));
}
}
}
if (buffer.size() > 0) {
queue(buffer);
return true;
}
}
return false;
}
}
public boolean putAll(Multimap<? extends K, ? extends V> map) {
synchronized(objectMutex) {
List<byte[]> buffer = new ArrayList<byte[]>();
for (Entry<? extends K, ? extends V> entry : map.entries()) {
K key = entry.getKey();
V value = entry.getValue();
if (key instanceof String || key instanceof Byte || key instanceof Short ||
key instanceof Integer || key instanceof Float || key instanceof Long ||
value instanceof IListObject) {
if (this.map.put(key, value)) {
buffer.add(item(0, (String) key, ((IListObject) value).getBytes(), true, true));
}
}
}
if (buffer.size() > 0) {
queue(buffer);
return true;
}
return false;
}
}
@SuppressWarnings("unchecked")
public boolean remove(Object key, Object value) {
synchronized(objectMutex) {
if (key instanceof String || key instanceof Byte || key instanceof Short ||
key instanceof Integer || key instanceof Float || key instanceof Long) {
if (map.remove(key, value)) {
queue(item(1, (String) key, ((IListObject) map.get((K) key)).getBytes(), true, true));
return true;
}
}
return false;
}
}
@SuppressWarnings("unchecked")
public Collection<V> removeAll(Object key) {
synchronized(objectMutex) {
if (key instanceof String || key instanceof Byte || key instanceof Short ||
key instanceof Integer || key instanceof Float || key instanceof Long) {
Collection<V> collection = map.get((K) key);
List<byte[]> buffer = new ArrayList<byte[]>();
for (V value : map.get((K) key)) {
if (map.remove(key, value)) {
buffer.add(item(1, (String) key, ((IListObject) map.get((K) key)).getBytes(), true, true));
}
}
if (buffer.size() > 0) {
queue(buffer);
return collection;
}
}
return null;
}
}
public Collection<V> replaceValues(K key, Iterable<? extends V> values) {
synchronized(objectMutex) {
if (key instanceof String || key instanceof Byte || key instanceof Short ||
key instanceof Integer || key instanceof Float || key instanceof Long) {
if (map.containsKey(key)) {
List<byte[]> buffer = new ArrayList<byte[]>();
for (V value : values) {
if (value instanceof IListObject) {
if (!map.get(key).contains(value)) {
buffer.add(item(2, (String) key, ((IListObject) value).getBytes(), true, true));
}
} else {
return null;
}
}
if (buffer.size() > 0) {
queue(buffer);
return map.replaceValues(key, values);
}
}
}
return null;
}
}
public int size() {
synchronized(objectMutex) {
return map.size();
}
}
public Collection<V> values() {
synchronized(objectMutex) {
return map.values();
}
}
public int getUpdateCounter() {
synchronized(objectMutex) {
return updateCounter;
}
}
private byte[] item(int type, Object index, byte[] data, boolean useIndex, boolean useData) {
if (useIndex && !(index instanceof Byte) && !(index instanceof Short)
&& !(index instanceof Integer) && !(index instanceof Float)
&& !(index instanceof Long) && !(index instanceof String)) {
throw new IllegalArgumentException();
}
int size = 1 + ((useIndex) ? (2 + index.toString().getBytes().length) : 0) + ((useData) ? data.length : 0);
IoBuffer buffer = messageBuilder.bufferPool.allocate((size), false).order(ByteOrder.LITTLE_ENDIAN);
buffer.put((byte) type);
if (useIndex) {
if (index instanceof String) {
buffer.put(StringUtilities.getAsciiString((String) index));
} else if (index instanceof Byte) {
buffer.put(((Byte) index).byteValue());
} else if (index instanceof Short) {
buffer.putShort(((Short) index).shortValue());
} else if (index instanceof Integer) {
buffer.putInt(((Integer) index).intValue());
} else if (index instanceof Float) {
buffer.putFloat(((Float) index).floatValue());
} else if (index instanceof Long) {
buffer.putLong(((Long) index).longValue());
} else {
throw new IllegalArgumentException();
}
}
if (useData) buffer.put(data);
updateCounter++;
return buffer.array();
}
private void queue(byte[] data) {
IoBuffer buffer = messageBuilder.bufferPool.allocate((data.length + 8), false).order(ByteOrder.LITTLE_ENDIAN);
buffer.putInt(1);
buffer.putInt(updateCounter);
buffer.put(data);
messageBuilder.sendListDelta(viewType, updateType, buffer);
}
private void queue(List<byte[]> data) {
int size = 0;
for (byte[] queued : data) {
size += queued.length;
}
IoBuffer buffer = messageBuilder.bufferPool.allocate((size + 8), false).order(ByteOrder.LITTLE_ENDIAN);
buffer.putInt(data.size());
buffer.putInt(updateCounter);
for (byte[] queued : data) buffer.put(queued);
messageBuilder.sendListDelta(viewType, updateType, buffer);
}
}
@@ -747,6 +747,7 @@ public class CreatureObject extends TangibleObject implements IPersistent {
}
@SuppressWarnings("unused")
@Override
public void sendBaselines(Client destination) {
@@ -22,21 +22,18 @@
package resources.objects.guild;
import java.nio.ByteOrder;
import java.util.ArrayList;
import java.util.List;
import org.apache.mina.core.buffer.IoBuffer;
import resources.objects.CurrentServerGCWZoneHistory;
import resources.objects.CurrentServerGCWZonePercent;
import resources.objects.Guild;
import engine.clients.Client;
import resources.gcw.CurrentServerGCWZoneHistory;
import resources.gcw.OtherServerGCWZonePercent;
import resources.guild.Guild;
import resources.objects.ObjectMessageBuilder;
import resources.objects.OtherServerGCWZonePercent;
public class GuildMessageBuilder extends ObjectMessageBuilder {
private List<IoBuffer> zoneUpdates = new ArrayList<IoBuffer>();
public GuildMessageBuilder(GuildObject guildObject) {
setObject(guildObject);
}
@@ -70,12 +67,12 @@ public class GuildMessageBuilder extends ObjectMessageBuilder {
GuildObject guilds = (GuildObject) object;
int capacity = 82;
capacity += (guilds.getCurrentServerGCWZonePercentList().size() * 30);
capacity += (guilds.getCurrentServerGCWTotalPercentList().size() * 14);
capacity += (guilds.getCurrentServerGCWZoneHistoryList().size() * 34);
capacity += (guilds.getCurrentServerGCWTotalHistoryList().size() * 18);
capacity += (guilds.getOtherServerGCWZonePercentList().size() * 45);
capacity += (guilds.getOtherServerGCWTotalPercentList().size() * 29);
capacity += (guilds.getCurrentServerGCWZonePercentMap().size() * 30);
capacity += (guilds.getCurrentServerGCWTotalPercentMap().size() * 14);
capacity += (guilds.getCurrentServerGCWZoneHistoryMap().size() * 34);
capacity += (guilds.getCurrentServerGCWTotalHistoryMap().size() * 18);
capacity += (guilds.getOtherServerGCWZonePercentMap().size() * 45);
capacity += (guilds.getOtherServerGCWTotalPercentMap().size() * 29);
IoBuffer buffer = bufferPool.allocate(capacity, false).order(ByteOrder.LITTLE_ENDIAN);
buffer.putShort((short) 9); // Object Count
@@ -83,51 +80,59 @@ public class GuildMessageBuilder extends ObjectMessageBuilder {
buffer.put(getAsciiString(guilds.getSTFFile()));
buffer.putInt(guilds.getUnknown1());
buffer.putShort(guilds.getUnknown2());
buffer.putInt(guilds.getCurrentServerGCWZonePercentList().size());
buffer.putInt(guilds.getCurrentServerGCWZonePercentList().getUpdateCounter());
for (CurrentServerGCWZonePercent object : guilds.getCurrentServerGCWZonePercentList().get()) {
buffer.put(object.getUnknown1());
buffer.put(getAsciiString(object.getZone()));
buffer.putInt(object.getPercent());
buffer.putInt(guilds.getCurrentServerGCWZonePercentMap().size());
buffer.putInt(guilds.getCurrentServerGCWZonePercentMap().getUpdateCounter());
for (String key : guilds.getCurrentServerGCWZonePercentMap().keySet()) {
buffer.put((byte) 0);
buffer.put(getAsciiString(key));
buffer.put(guilds.getCurrentServerGCWZonePercentMap().get(key).getBytes());
}
buffer.putInt(guilds.getCurrentServerGCWTotalPercentList().size());
buffer.putInt(guilds.getCurrentServerGCWTotalPercentList().getUpdateCounter());
for (CurrentServerGCWZonePercent object : guilds.getCurrentServerGCWTotalPercentList().get()) {
buffer.put(object.getUnknown1());
buffer.put(getAsciiString(object.getZone()));
buffer.putInt(object.getPercent());
buffer.putInt(guilds.getCurrentServerGCWTotalPercentMap().size());
buffer.putInt(guilds.getCurrentServerGCWTotalPercentMap().getUpdateCounter());
for (String key : guilds.getCurrentServerGCWTotalPercentMap().keySet()) {
buffer.put((byte) 0);
buffer.put(getAsciiString(key));
buffer.put(guilds.getCurrentServerGCWTotalPercentMap().get(key).getBytes());
}
buffer.putInt(guilds.getCurrentServerGCWZoneHistoryList().size());
buffer.putInt(guilds.getCurrentServerGCWZoneHistoryList().getUpdateCounter());
for (CurrentServerGCWZoneHistory object : guilds.getCurrentServerGCWZoneHistoryList().get()) {
buffer.put(object.getUnknown1());
buffer.put(getAsciiString(object.getZone()));
buffer.putInt(object.getLastUpdateTime());
buffer.putInt(object.getPercent());
buffer.putInt(guilds.getCurrentServerGCWZoneHistoryMap().size());
buffer.putInt(guilds.getCurrentServerGCWZoneHistoryMap().getUpdateCounter());
for (String key : guilds.getCurrentServerGCWZoneHistoryMap().keySet()) {
for (CurrentServerGCWZoneHistory historicZone : guilds.getCurrentServerGCWZoneHistoryMap().get(key)) {
buffer.put((byte) 0);
buffer.put(getAsciiString(key));
buffer.putInt(historicZone.getLastUpdateTime());
buffer.putInt(historicZone.getPercent());
}
}
buffer.putInt(guilds.getCurrentServerGCWTotalHistoryList().size());
buffer.putInt(guilds.getCurrentServerGCWTotalHistoryList().getUpdateCounter());
for (CurrentServerGCWZoneHistory object : guilds.getCurrentServerGCWTotalHistoryList().get()) {
buffer.put(object.getUnknown1());
buffer.put(getAsciiString(object.getZone()));
buffer.putInt(object.getLastUpdateTime());
buffer.putInt(object.getPercent());
buffer.putInt(guilds.getCurrentServerGCWTotalHistoryMap().size());
buffer.putInt(guilds.getCurrentServerGCWTotalHistoryMap().getUpdateCounter());
for (String key : guilds.getCurrentServerGCWTotalHistoryMap().keySet()) {
for (CurrentServerGCWZoneHistory historicTotal : guilds.getCurrentServerGCWZoneHistoryMap().get(key)) {
buffer.put((byte) 0);
buffer.put(getAsciiString(key));
buffer.putInt(historicTotal.getLastUpdateTime());
buffer.putInt(historicTotal.getPercent());
}
}
buffer.putInt(guilds.getOtherServerGCWZonePercentList().size());
buffer.putInt(guilds.getOtherServerGCWZonePercentList().getUpdateCounter());
for (OtherServerGCWZonePercent object : guilds.getOtherServerGCWZonePercentList().get()) {
buffer.put(object.getUnknown1());
buffer.put(getAsciiString(object.getServer()));
buffer.put(getAsciiString(object.getZone()));
buffer.putInt(object.getPercent());
buffer.putInt(guilds.getOtherServerGCWZonePercentMap().size());
buffer.putInt(guilds.getOtherServerGCWZonePercentMap().getUpdateCounter());
for (String key : guilds.getOtherServerGCWZonePercentMap().keySet()) {
for (OtherServerGCWZonePercent server : guilds.getOtherServerGCWZonePercentMap().get(key)) {
buffer.put((byte) 0);
buffer.put(getAsciiString(key));
buffer.put(getAsciiString(server.getZone()));
buffer.putInt(server.getPercent());
}
}
buffer.putInt(guilds.getOtherServerGCWTotalPercentList().size());
buffer.putInt(guilds.getOtherServerGCWTotalPercentList().getUpdateCounter());
for (OtherServerGCWZonePercent object : guilds.getOtherServerGCWTotalPercentList().get()) {
buffer.put(object.getUnknown1());
buffer.put(getAsciiString(object.getServer()));
buffer.put(getAsciiString(object.getZone()));
buffer.putInt(object.getPercent());
buffer.putInt(guilds.getOtherServerGCWTotalPercentMap().size());
buffer.putInt(guilds.getOtherServerGCWTotalPercentMap().getUpdateCounter());
for (String key : guilds.getOtherServerGCWTotalPercentMap().keySet()) {
for (OtherServerGCWZonePercent server : guilds.getOtherServerGCWZonePercentMap().get(key)) {
buffer.put((byte) 0);
buffer.put(getAsciiString(key));
buffer.put(getAsciiString(server.getZone()));
buffer.putInt(server.getPercent());
}
}
buffer.putInt(guilds.getUnknown3());
@@ -208,33 +213,6 @@ public class GuildMessageBuilder extends ObjectMessageBuilder {
return buffer;
}
public IoBuffer buildGCWDelta() {
synchronized(zoneUpdates) {
if (zoneUpdates.size() > 0) {
int updates = zoneUpdates.size();
int size = 4;
for (int i = 0; i < zoneUpdates.size(); i++) {
size += zoneUpdates.get(i).position();
}
IoBuffer buffer = bufferPool.allocate(size, false).order(ByteOrder.LITTLE_ENDIAN);
for (int i = 0; i < zoneUpdates.size(); i++) {
buffer.put(zoneUpdates.get(i).array());
}
zoneUpdates.clear();
buffer.flip();
return createDelta("GILD", (byte) 6, (short) updates, buffer, size);
} else {
return null;
}
}
}
public IoBuffer buildUnknown3(int unknown3) {
IoBuffer buffer = bufferPool.allocate(4, false).order(ByteOrder.LITTLE_ENDIAN);
@@ -246,57 +224,46 @@ public class GuildMessageBuilder extends ObjectMessageBuilder {
return buffer;
}
final protected static char[] hexArray = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
public static String bytesToHex(byte[] bytes) {
char[] hexChars = new char[bytes.length * 2];
int v;
for ( int j = 0; j < bytes.length; j++ ) {
v = bytes[j] & 0xFF;
hexChars[j * 2] = hexArray[v >>> 4];
hexChars[j * 2 + 1] = hexArray[v & 0x0F];
}
return new String(hexChars);
}
@Override
public void sendListDelta(byte viewType, short updateType, IoBuffer buffer) {
synchronized(zoneUpdates) {
switch (viewType) {
case 3:
{
switch (updateType) {
case 4:
{
buffer.flip();
buffer = createDelta("GILD", (byte) 3, (short) 1, (short) 4, buffer, buffer.position() + 4);
switch (viewType) {
case 3:
{
switch (updateType) {
case 4:
{
buffer = createDelta("GILD", (byte) 3, (short) 1, (short) 4, buffer.flip(), buffer.array().length + 4);
for (int i = 0; i < ((GuildObject) object).core.getActiveConnectionsMap().size(); i++) {
((GuildObject) object).core.getActiveConnectionsMap().get(i).getSession().write(buffer);
}
break;
for (Client client : ((GuildObject) object).core.getActiveConnectionsMap().values()) {
client.getSession().write(buffer);
}
break;
}
}
case 6:
{
switch (updateType) {
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
{
buffer = createDeltaObject(updateType, buffer, buffer.position());
//System.out.println("Packet: " + bytesToHex(buffer.array()));
zoneUpdates.add(buffer);
break;
}
default:
{
return;
}
case 6:
{
switch (updateType) {
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
{
buffer = createDelta("GILD", (byte) 6, (short) 1, (short) updateType, buffer.flip(), buffer.array().length + 4);
for (Client client : ((GuildObject) object).core.getActiveConnectionsMap().values()) {
client.getSession().write(buffer);
}
break;
}
default:
{
return;
}
}
}
+24 -37
View File
@@ -25,11 +25,13 @@ import org.apache.mina.core.buffer.IoBuffer;
import main.NGECore;
import resources.objects.CurrentServerGCWZoneHistory;
import resources.objects.CurrentServerGCWZonePercent;
import resources.objects.Guild;
import resources.objects.OtherServerGCWZonePercent;
import resources.gcw.CurrentServerGCWZoneHistory;
import resources.gcw.CurrentServerGCWZonePercent;
import resources.gcw.OtherServerGCWZonePercent;
import resources.guild.Guild;
import resources.objects.SWGList;
import resources.objects.SWGMap;
import resources.objects.SWGMultiMap;
import com.sleepycat.persist.model.NotPersistent;
@@ -59,12 +61,12 @@ public class GuildObject extends SWGObject {
//private String STFName = "string_id_table";
private int unknown1 = 0;
private short unknown2 = 0;
private SWGList<CurrentServerGCWZonePercent> currentServerGCWZonePercentList = new SWGList<CurrentServerGCWZonePercent>(messageBuilder, 6, 2);
private SWGList<CurrentServerGCWZonePercent> currentServerGCWTotalPercentList = new SWGList<CurrentServerGCWZonePercent>(messageBuilder, 6, 3);
private SWGList<CurrentServerGCWZoneHistory> currentServerGCWZoneHistoryList = new SWGList<CurrentServerGCWZoneHistory>(messageBuilder, 6, 4);
private SWGList<CurrentServerGCWZoneHistory> currentServerGCWTotalHistoryList = new SWGList<CurrentServerGCWZoneHistory>(messageBuilder, 6, 5);
private SWGList<OtherServerGCWZonePercent> otherServerGCWZonePercentList = new SWGList<OtherServerGCWZonePercent>(messageBuilder, 6, 6);
private SWGList<OtherServerGCWZonePercent> otherServerGCWTotalPercentList = new SWGList<OtherServerGCWZonePercent>(messageBuilder, 6, 7);
private SWGMap<String, CurrentServerGCWZonePercent> currentServerGCWZonePercentMap = new SWGMap<String, CurrentServerGCWZonePercent>(messageBuilder, 6, 2);
private SWGMap<String, CurrentServerGCWZonePercent> currentServerGCWTotalPercentMap = new SWGMap<String, CurrentServerGCWZonePercent>(messageBuilder, 6, 3);
private SWGMultiMap<String, CurrentServerGCWZoneHistory> currentServerGCWZoneHistoryMap = new SWGMultiMap<String, CurrentServerGCWZoneHistory>(messageBuilder, 6, 4);
private SWGMultiMap<String, CurrentServerGCWZoneHistory> currentServerGCWTotalHistoryMap = new SWGMultiMap<String, CurrentServerGCWZoneHistory>(messageBuilder, 6, 5);
private SWGMultiMap<String, OtherServerGCWZonePercent> otherServerGCWZonePercentMap = new SWGMultiMap<String, OtherServerGCWZonePercent>(messageBuilder, 6, 6);
private SWGMultiMap<String, OtherServerGCWZonePercent> otherServerGCWTotalPercentMap = new SWGMultiMap<String, OtherServerGCWZonePercent>(messageBuilder, 6, 7);
private int unknown3 = 5;
public GuildObject(NGECore core, long objectID, Planet planet, Point3D position, Quaternion orientation, String Template) {
@@ -202,28 +204,28 @@ public class GuildObject extends SWGObject {
notifyAll(messageBuilder.buildUnknowns(unknown1, unknown2));
}
public SWGList<CurrentServerGCWZonePercent> getCurrentServerGCWZonePercentList() {
return currentServerGCWZonePercentList;
public SWGMap<String, CurrentServerGCWZonePercent> getCurrentServerGCWZonePercentMap() {
return currentServerGCWZonePercentMap;
}
public SWGList<CurrentServerGCWZonePercent> getCurrentServerGCWTotalPercentList() {
return currentServerGCWTotalPercentList;
public SWGMap<String, CurrentServerGCWZonePercent> getCurrentServerGCWTotalPercentMap() {
return currentServerGCWTotalPercentMap;
}
public SWGList<CurrentServerGCWZoneHistory> getCurrentServerGCWZoneHistoryList() {
return currentServerGCWZoneHistoryList;
public SWGMultiMap<String, CurrentServerGCWZoneHistory> getCurrentServerGCWZoneHistoryMap() {
return currentServerGCWZoneHistoryMap;
}
public SWGList<CurrentServerGCWZoneHistory> getCurrentServerGCWTotalHistoryList() {
return currentServerGCWTotalHistoryList;
public SWGMultiMap<String, CurrentServerGCWZoneHistory> getCurrentServerGCWTotalHistoryMap() {
return currentServerGCWTotalHistoryMap;
}
public SWGList<OtherServerGCWZonePercent> getOtherServerGCWZonePercentList() {
return otherServerGCWZonePercentList;
public SWGMultiMap<String, OtherServerGCWZonePercent> getOtherServerGCWZonePercentMap() {
return otherServerGCWZonePercentMap;
}
public SWGList<OtherServerGCWZonePercent> getOtherServerGCWTotalPercentList() {
return otherServerGCWTotalPercentList;
public SWGMultiMap<String, OtherServerGCWZonePercent> getOtherServerGCWTotalPercentMap() {
return otherServerGCWTotalPercentMap;
}
public int getUnknown3() {
@@ -240,14 +242,6 @@ public class GuildObject extends SWGObject {
notifyAll(messageBuilder.buildUnknown3(unknown3));
}
public void sendGCWUpdate() {
IoBuffer buffer = messageBuilder.buildGCWDelta();
if (buffer != null) {
notifyAll(buffer);
}
}
@Override
public void sendBaselines(Client destination) {
destination.getSession().write(messageBuilder.buildBaseline3());
@@ -255,16 +249,9 @@ public class GuildObject extends SWGObject {
}
private void notifyAll(IoBuffer buffer) {
//for (int i = 0; i < core.getActiveConnectionsMap().size(); i++) {
// core.getActiveConnectionsMap().get(i).getSession().write(buffer);
//}
System.out.println("Notifying all...");
synchronized(core.getActiveConnectionsMap()) {
for (Client client : core.getActiveConnectionsMap().values()) {
System.out.println("Notifying..." + client.getParent().getCustomName());
client.getSession().write(buffer);
System.out.println("Notified them.");
System.out.println("Packet: " + buffer.getHexDump());
}
}
}
@@ -25,8 +25,6 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Vector;
import org.apache.mina.core.buffer.IoBuffer;
import resources.objects.creature.CreatureObject;
+202 -77
View File
@@ -22,15 +22,23 @@
package services.gcw;
import java.nio.ByteOrder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.TreeMap;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import org.apache.mina.core.buffer.IoBuffer;
import org.apache.mina.core.buffer.SimpleBufferAllocator;
import org.apache.mina.core.session.IoSession;
import org.python.google.common.collect.ArrayListMultimap;
import org.python.google.common.collect.Multimap;
import protocol.swg.GcwGroupsRsp;
import protocol.swg.GcwRegionsReq;
@@ -38,16 +46,21 @@ import protocol.swg.GcwRegionsRsp;
import protocol.swg.GetMapLocationsMessage;
import protocol.swg.GetMapLocationsResponseMessage;
import resources.common.Factions;
import resources.common.Opcodes;
import resources.objects.CurrentServerGCWZoneHistory;
import resources.objects.CurrentServerGCWZonePercent;
import resources.objects.OtherServerGCWZonePercent;
import resources.common.PvpStatus;
import resources.gcw.CurrentServerGCWZoneHistory;
import resources.gcw.CurrentServerGCWZonePercent;
import resources.gcw.OtherServerGCWZonePercent;
import resources.objects.creature.CreatureObject;
import resources.objects.guild.GuildObject;
import main.NGECore;
import engine.clients.Client;
import engine.resources.objects.SWGObject;
import engine.resources.scene.Point2D;
import engine.resources.scene.Point3D;
import engine.resources.service.INetworkDispatch;
import engine.resources.service.INetworkRemoteEvent;
@@ -57,103 +70,215 @@ public class GCWService implements INetworkDispatch {
private NGECore core;
private GuildObject object;
private Map<String, Map<String, CurrentServerGCWZonePercent>> zoneMap = new TreeMap<String, Map<String, CurrentServerGCWZonePercent>>();
private final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
private List<String> zoneList = Arrays.asList(new String[] { "corellia_airspace", "corellia_pve", "corellia_pvp", "dantooine_airspace", "dantooine_pve", "dantooine_pvp", "dathomir_airspace", "dathomir_pve", "dathomir_pvp", "endor_airspace", "endor_pve", "endor_pvp", "endor_pvp_battlefield", "gcw_region_corellia_1", "gcw_region_corellia_10", "gcw_region_corellia_11", "gcw_region_corellia_12", "gcw_region_corellia_13", "gcw_region_corellia_14", "gcw_region_corellia_2", "gcw_region_corellia_3", "gcw_region_corellia_4", "gcw_region_corellia_5", "gcw_region_corellia_6", "gcw_region_corellia_7", "gcw_region_corellia_8", "gcw_region_corellia_9", "gcw_region_dantooine_1", "gcw_region_dantooine_10", "gcw_region_dantooine_11", "gcw_region_dantooine_12", "gcw_region_dantooine_13", "gcw_region_dantooine_14", "gcw_region_dantooine_15", "gcw_region_dantooine_16", "gcw_region_dantooine_17", "gcw_region_dantooine_2", "gcw_region_dantooine_3", "gcw_region_dantooine_4", "gcw_region_dantooine_5", "gcw_region_dantooine_6", "gcw_region_dantooine_7", "gcw_region_dantooine_8", "gcw_region_dantooine_9", "gcw_region_dathomir_1", "gcw_region_dathomir_10", "gcw_region_dathomir_11", "gcw_region_dathomir_12", "gcw_region_dathomir_13", "gcw_region_dathomir_2", "gcw_region_dathomir_3", "gcw_region_dathomir_4", "gcw_region_dathomir_5", "gcw_region_dathomir_6", "gcw_region_dathomir_7", "gcw_region_dathomir_8", "gcw_region_dathomir_9", "gcw_region_endor_1", "gcw_region_endor_10", "gcw_region_endor_11", "gcw_region_endor_12", "gcw_region_endor_13", "gcw_region_endor_14", "gcw_region_endor_15", "gcw_region_endor_16", "gcw_region_endor_2", "gcw_region_endor_3", "gcw_region_endor_4", "gcw_region_endor_5", "gcw_region_endor_6", "gcw_region_endor_7", "gcw_region_endor_8", "gcw_region_endor_9", "gcw_region_lok_1", "gcw_region_lok_10", "gcw_region_lok_11", "gcw_region_lok_12", "gcw_region_lok_13", "gcw_region_lok_14", "gcw_region_lok_2", "gcw_region_lok_3", "gcw_region_lok_4", "gcw_region_lok_5", "gcw_region_lok_6", "gcw_region_lok_7", "gcw_region_lok_8", "gcw_region_lok_9", "gcw_region_naboo_1", "gcw_region_naboo_10", "gcw_region_naboo_11", "gcw_region_naboo_12", "gcw_region_naboo_13", "gcw_region_naboo_14", "gcw_region_naboo_2", "gcw_region_naboo_3", "gcw_region_naboo_4", "gcw_region_naboo_5", "gcw_region_naboo_6", "gcw_region_naboo_7", "gcw_region_naboo_8", "gcw_region_naboo_9", "gcw_region_rori_1", "gcw_region_rori_10", "gcw_region_rori_11", "gcw_region_rori_12", "gcw_region_rori_13", "gcw_region_rori_2", "gcw_region_rori_3", "gcw_region_rori_4", "gcw_region_rori_5", "gcw_region_rori_6", "gcw_region_rori_7", "gcw_region_rori_8", "gcw_region_rori_9", "gcw_region_talus_1", "gcw_region_talus_10", "gcw_region_talus_11", "gcw_region_talus_12", "gcw_region_talus_13", "gcw_region_talus_14", "gcw_region_talus_15", "gcw_region_talus_16", "gcw_region_talus_2", "gcw_region_talus_3", "gcw_region_talus_4", "gcw_region_talus_5", "gcw_region_talus_6", "gcw_region_talus_7", "gcw_region_talus_8", "gcw_region_talus_9", "gcw_region_tatooine_1", "gcw_region_tatooine_10", "gcw_region_tatooine_11", "gcw_region_tatooine_12", "gcw_region_tatooine_13", "gcw_region_tatooine_2", "gcw_region_tatooine_3", "gcw_region_tatooine_4", "gcw_region_tatooine_5", "gcw_region_tatooine_6", "gcw_region_tatooine_7", "gcw_region_tatooine_8", "gcw_region_tatooine_9", "gcw_region_yavin4_1", "gcw_region_yavin4_10", "gcw_region_yavin4_11", "gcw_region_yavin4_12", "gcw_region_yavin4_13", "gcw_region_yavin4_14", "gcw_region_yavin4_15", "gcw_region_yavin4_16", "gcw_region_yavin4_17", "gcw_region_yavin4_18", "gcw_region_yavin4_2", "gcw_region_yavin4_3", "gcw_region_yavin4_4", "gcw_region_yavin4_5", "gcw_region_yavin4_6", "gcw_region_yavin4_7", "gcw_region_yavin4_8", "gcw_region_yavin4_9", "lok_airspace", "lok_pve", "lok_pvp", "naboo_airspace", "naboo_pve", "naboo_pvp", "rori_airspace", "rori_pve", "rori_pvp", "space_corellia_space_pve", "space_corellia_space_pvp", "space_dantooine_space_pve", "space_dantooine_space_pvp", "space_dathomir_space_pve", "space_dathomir_space_pvp", "space_endor_space_pve", "space_endor_space_pvp", "space_lok_space_pve", "space_lok_space_pvp", "space_naboo_space_pve", "space_naboo_space_pvp", "space_tatooine_space_pve", "space_tatooine_space_pvp", "space_yavin4_space_pve", "space_yavin4_space_pvp", "talus_airspace", "talus_pve", "talus_pvp", "tatooine_airspace", "tatooine_pve", "tatooine_pvp", "yavin4_airspace", "yavin4_pve", "yavin4_pvp", "yavin4_pvp_battlefield" });
private List<String> totalList = Arrays.asList(new String[] { "corellia", "dantooine", "dathomir", "endor", "galaxy", "lok", "naboo", "rori", "talus", "tatooine", "yavin4" });
protected final Object objectMutex = new Object();
public GCWService(final NGECore core) {
this.core = core;
this.object = this.core.guildService.getGuildObject();
for (int i = 0; i < zoneList.size(); i++) {
object.getCurrentServerGCWZonePercentList().add(new CurrentServerGCWZonePercent(zoneList.get(i)));
object.getCurrentServerGCWZoneHistoryList().add(new CurrentServerGCWZoneHistory(zoneList.get(i)));
object.getOtherServerGCWZonePercentList().add(new OtherServerGCWZonePercent(zoneList.get(i)));
}
for (int i = 0; i < totalList.size(); i++) {
object.getCurrentServerGCWTotalPercentList().add(new CurrentServerGCWZonePercent(totalList.get(i)));
object.getCurrentServerGCWTotalHistoryList().add(new CurrentServerGCWZoneHistory(totalList.get(i)));
object.getOtherServerGCWTotalPercentList().add(new OtherServerGCWZonePercent(totalList.get(i)));
}
// Update the GCW Zones every minute as in live
scheduler.scheduleAtFixedRate(new Runnable() {
@Override
public void run() {
//object.sendGCWUpdate();
//addGCWPointsToZonesWithFactionalPresence(new Client());
//removeGCWPointFromZonesWithNoFactionalPresence(new Client());
scheduler.schedule(new Runnable() {
@Override public void run() { afterInitialisation(); }
private void afterInitialisation() {
core.scriptService.callScript("scripts/", "gcwzones", "addZones");
}
}, 1, TimeUnit.SECONDS);
scheduler.scheduleAtFixedRate(new Runnable() {
@Override public void run() { checkFactionalPresence(); }
private void checkFactionalPresence() {
for (String planet : zoneMap.keySet()) {
for (String zoneName : zoneMap.get(planet).keySet()) {
CurrentServerGCWZonePercent zone = zoneMap.get(planet).get(zoneName);
if (zone.getRadius() > 0) {
List<SWGObject> players = core.simulationService.get(core.terrainService.getPlanetByName(planet), zone.getPosition().x, zone.getPosition().z, (int) zone.getRadius());
for (SWGObject player : players) {
if (!core.terrainService.isWater(player.getPlanetId(), player.getPosition().x, player.getPosition().z)) {
if ((player instanceof CreatureObject)) {
if ((((CreatureObject) player).getFactionStatus() & PvpStatus.Overt) != 0) {
adjustZone(planet, zoneName, ((CreatureObject) player).getFaction(), 1);
}
}
}
}
}
}
}
}
}, 3, 3, TimeUnit.SECONDS);
scheduler.scheduleAtFixedRate(new Runnable() {
@Override public void run() { updateGCWZones(); }
private void updateGCWZones() {
Map<String, CurrentServerGCWZonePercent> zoneUpdates = new TreeMap<String, CurrentServerGCWZonePercent>();
Map<String, CurrentServerGCWZonePercent> totalUpdates = new TreeMap<String, CurrentServerGCWZonePercent>();
Multimap<String, CurrentServerGCWZoneHistory> zoneHistoryUpdates = ArrayListMultimap.create();
Multimap<String, CurrentServerGCWZoneHistory> totalHistoryUpdates = ArrayListMultimap.create();
int galaxyPercent = 0;
for (String planet : zoneMap.keySet()) {
if (!planet.equals("galaxy")) {
int planetPercent = 0;
for (String zone : zoneMap.get(planet).keySet()) {
planetPercent += zoneMap.get(planet).get(zone).getPercent();
if (zoneMap.get(planet).get(zone).getPercent() != object.getCurrentServerGCWZonePercentMap().get(zone).getPercent()) {
zoneUpdates.put(zone, zoneMap.get(planet).get(zone));
zoneHistoryUpdates.put(zone, new CurrentServerGCWZoneHistory(object.getCurrentServerGCWZonePercentMap().get(zone)));
}
}
planetPercent = ((planetPercent / (zoneMap.get(planet).size() * 100)) * 100);
if (planetPercent != object.getCurrentServerGCWTotalPercentMap().get(planet).getPercent()) {
CurrentServerGCWZonePercent planetObject = object.getCurrentServerGCWTotalPercentMap().get(planet);
planetObject.setPercent(planetPercent);
totalUpdates.put(planet, planetObject);
totalHistoryUpdates.put(planet, new CurrentServerGCWZoneHistory(object.getCurrentServerGCWTotalPercentMap().get(planet)));
}
galaxyPercent += planetPercent;
}
}
galaxyPercent = ((galaxyPercent / ((object.getCurrentServerGCWTotalPercentMap().size() - 1) * 100)) * 100);
if (galaxyPercent != object.getCurrentServerGCWTotalPercentMap().get("galaxy").getPercent()) {
CurrentServerGCWZonePercent galaxyObject = object.getCurrentServerGCWTotalPercentMap().get("galaxy");
galaxyObject.setPercent(galaxyPercent);
totalUpdates.put("galaxy", galaxyObject);
totalHistoryUpdates.put("galaxy", new CurrentServerGCWZoneHistory(object.getCurrentServerGCWTotalPercentMap().get("galaxy")));
}
if (zoneUpdates.size() > 0) {
object.getCurrentServerGCWZonePercentMap().putAll(zoneUpdates);
object.getCurrentServerGCWZoneHistoryMap().putAll(zoneHistoryUpdates);
if (totalUpdates.size() > 0) {
object.getCurrentServerGCWTotalPercentMap().putAll(totalUpdates);
object.getCurrentServerGCWTotalHistoryMap().putAll(totalHistoryUpdates);
}
}
}
}, 1, 1, TimeUnit.MINUTES);
// Update other server GCW Zones every 15 minutes (roughly like live I think)
scheduler.scheduleAtFixedRate(new Runnable() {
@Override
public void run() {
/*
for (int i = 0; i < object.getOtherServerGCWZonePercentList().size(); i++) {
object.getOtherServerGCWZonePercentList().get(i).setPercent(object.getCurrentServerGCWZonePercentList().get(i).getPercent());
object.getOtherServerGCWZonePercentList().set(i, object.getOtherServerGCWZonePercentList().get(i));
}
@Override public void run() { updateOtherGalaxiesGCWZones(); }
private void updateOtherGalaxiesGCWZones() {
updateGalaxiesWideGCWZones();
}
private void updateGalaxiesWideGCWZones() {
List<OtherServerGCWZonePercent> galaxyWideZones = new ArrayList<OtherServerGCWZonePercent>();
galaxyWideZones.addAll(object.getOtherServerGCWZonePercentMap().get("SWG"));
for (int i = 0; i < galaxyWideZones.size(); i++) {
OtherServerGCWZonePercent zone = galaxyWideZones.get(i);
int percent = object.getCurrentServerGCWZonePercentMap().get(zone.getZone()).getPercent();
for (int i = 0; i < object.getOtherServerGCWTotalPercentList().size(); i++) {
object.getOtherServerGCWTotalPercentList().get(i).setPercent(object.getCurrentServerGCWTotalPercentList().get(i).getPercent());
object.getOtherServerGCWZonePercentList().set(i, object.getOtherServerGCWZonePercentList().get(i));
if (zone.getPercent() != percent) {
zone.setPercent(percent);
galaxyWideZones.set(i, zone);
}
}
if (!galaxyWideZones.equals(object.getOtherServerGCWZonePercentMap().get("SWG"))) {
object.getOtherServerGCWZonePercentMap().replaceValues("SWG", galaxyWideZones);
}
*/
}
//}, 15, 15, TimeUnit.MINUTES);
}, 2, 5, TimeUnit.MINUTES);
}, 15, 15, TimeUnit.MINUTES);
// Reset weak GCW Zones every 2 days as in live
scheduler.scheduleAtFixedRate(new Runnable() {
@Override
public void run() {
/*
resetWeakGCWZones();
*/
}
@Override public void run() { decrementZoneStrength(); }
//}, 2, 2, TimeUnit.DAYS);
}, 2, 5, TimeUnit.MINUTES);
}
private void addGCWPointsToZonesWithFactionalPresence(Client client) {
}
private void removeGCWPointFromZonesWithNoFactionalPresence(Client client) {
}
private void resetWeakGCWZones() {
for (int i = 0; i < object.getCurrentServerGCWZonePercentList().size(); i++) {
CurrentServerGCWZonePercent zone = object.getCurrentServerGCWZonePercentList().get(i);
if (zone.getGCWPoints() == 0 && zone.getPercent() != 50) {
zone.setPercent(50, object.getCurrentServerGCWZoneHistoryList());
object.getCurrentServerGCWZonePercentList().set(i, zone);
private void decrementZoneStrength() {
for (String planet : zoneMap.keySet()) {
if (!planet.equals("galaxy")) {
for (String zone : zoneMap.get(planet).keySet()) {
zoneMap.get(planet).get(zone).removeGCWPoints(1);
object.getCurrentServerGCWZonePercentMap().get(zone).removeGCWPoints(1);
}
}
}
}
}, 1, 1, TimeUnit.MINUTES);
scheduler.scheduleAtFixedRate(new Runnable() {
@Override public void run() { resetWeakGCWZones(); }
private void resetWeakGCWZones() {
for (String planet : zoneMap.keySet()) {
for (String zoneName : zoneMap.get(planet).keySet()) {
CurrentServerGCWZonePercent zone = zoneMap.get(planet).get(zoneName);
if (zone.getGCWPoints() == 0 && zone.getPercent() != 50) {
zone.setPercent(50);
zoneMap.get(planet).put(zoneName, zone);
}
}
}
}
}, 2, 2, TimeUnit.DAYS);
}
public void addZone(String planet, String zone, float x, float y, float radius, int group, float weight) {
if (!zoneMap.containsKey(planet)) {
zoneMap.put(planet, new TreeMap<String, CurrentServerGCWZonePercent>());
}
for (int i = 0; i < object.getCurrentServerGCWTotalPercentList().size(); i++) {
CurrentServerGCWZonePercent zone = object.getCurrentServerGCWTotalPercentList().get(i);
if (zone.getGCWPoints() == 0 && zone.getPercent() != 50) {
zone.setPercent(50, object.getCurrentServerGCWTotalHistoryList());
object.getCurrentServerGCWTotalPercentList().set(i, zone);
zoneMap.get(planet).put(zone, new CurrentServerGCWZonePercent(new Point2D(x, y), radius, ((new SimpleBufferAllocator()).allocate(4, false).order(ByteOrder.BIG_ENDIAN).putInt(group).flip().getInt()), weight));
if (planet != "galaxy") {
object.getCurrentServerGCWZonePercentMap().put(zone, zoneMap.get(planet).get(zone));
object.getOtherServerGCWZonePercentMap().put("SWG", new OtherServerGCWZonePercent(zone));
}
if (!object.getCurrentServerGCWTotalPercentMap().containsKey(planet)) {
object.getCurrentServerGCWTotalPercentMap().put(planet, new CurrentServerGCWZonePercent(new Point2D(0, 0), 0, 0, 0));
object.getOtherServerGCWTotalPercentMap().put("SWG", new OtherServerGCWZonePercent(planet));
}
}
public void adjustZone(String planet, String zone, String faction, int amount) {
synchronized(objectMutex) {
CurrentServerGCWZonePercent zoneObject = zoneMap.get(planet).get(zone);
int newPercent = ((amount / zoneObject.getGCWPoints()) * 100);
switch (faction) {
case "rebel": {
zoneMap.get(planet).get(zone).setPercent(((zoneObject.getPercent() - newPercent) < 0) ? 0 : (zoneObject.getPercent() - newPercent));
zoneMap.get(planet).get(zone).addGCWPoints(amount);
}
case "imperial": {
zoneMap.get(planet).get(zone).setPercent(((zoneObject.getPercent() + newPercent) > 100) ? 0 : (zoneObject.getPercent() + newPercent));
zoneMap.get(planet).get(zone).addGCWPoints(amount);
}
}
}
}
public void adjustZone(String zone, String faction, int amount) {
for (String planet : zoneMap.keySet()) {
if (!planet.equals("galaxy")) {
if (zoneMap.get(planet).containsKey(zone)) {
adjustZone(planet, zone, faction, amount);
}
}
}
}
public void insertOpcodes(Map<Integer, INetworkRemoteEvent> swgOpcodes, Map<Integer, INetworkRemoteEvent> objControllerOpcodes) {
swgOpcodes.put(Opcodes.GcwRegionsReq, new INetworkRemoteEvent() {
@@ -179,8 +304,8 @@ public class GCWService implements INetworkDispatch {
return;
}
session.write((new GcwRegionsRsp()).serialize());
session.write((new GcwGroupsRsp()).serialize());
session.write((new GcwRegionsRsp(zoneMap)).serialize());
session.write((new GcwGroupsRsp(zoneMap)).serialize());
}
+18 -10
View File
@@ -26,19 +26,15 @@ import java.util.Map;
import org.apache.mina.core.buffer.IoBuffer;
import org.apache.mina.core.session.IoSession;
import protocol.swg.CmdSceneReady;
import resources.common.Opcodes;
import resources.objects.Guild;
import resources.guild.Guild;
import resources.objects.SWGList;
import resources.objects.creature.CreatureObject;
import resources.objects.guild.GuildObject;
import main.NGECore;
import engine.clients.Client;
import engine.resources.objects.SWGObject;
import engine.resources.scene.Point3D;
import engine.resources.service.INetworkDispatch;
import engine.resources.service.INetworkRemoteEvent;
@@ -124,19 +120,31 @@ public class GuildService implements INetworkDispatch {
@Override
public void insertOpcodes(Map<Integer, INetworkRemoteEvent> swgOpcodes, Map<Integer, INetworkRemoteEvent> objControllerOpcodes) {
/*
swgOpcodes.put(Opcodes.CmdSceneReady, new INetworkRemoteEvent() {
@Override
public void handlePacket(IoSession session, IoBuffer data) throws Exception {
Client client = core.getClient((Integer) session.getAttribute("connectionId"));
// CmdSceneReady sceneReady = new CmdSceneReady();
// client.getSession().write(sceneReady.serialize());
if (client == null || client.getSession() == null) {
return;
}
SWGObject object = client.getParent();
if (object == null) {
return;
}
object.sendCreate(client);
object.sendBaselines(client);
object.sendDestroy(client);
}
});
*/
}