From cd0dff63bb9a42e288ca2ec9c40c2341d889156c Mon Sep 17 00:00:00 2001 From: Xottab-DUTY Date: Thu, 24 Oct 2024 05:09:13 +0300 Subject: [PATCH] =?UTF-8?q?Removed=20GameSpy=20achievements=20and=20stats?= =?UTF-8?q?=20code=20GameSpy=20server=20hosted=20by=20GSC=20(gamegsc.com)?= =?UTF-8?q?=20doesn't=20store=20achievements=20and=20stats.=20Thus,=20all?= =?UTF-8?q?=20this=20code=20is=20nearly=20dead=20legacy=20code.=20Only=20t?= =?UTF-8?q?hing=20that=20keeps=20it=20working=20is=20mp=5Fprofile.ltx=20fi?= =?UTF-8?q?le=20that=20gets=20created=20locally=20on=20your=20PC=20?= =?UTF-8?q?=E2=80=93=20the=20data=20is=20being=20saved=20only=20in=20this?= =?UTF-8?q?=20file.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From project maintenance view, it's better to remove it. --- src/xrGame/CMakeLists.txt | 104 --- src/xrGame/GameObject.cpp | 4 - src/xrGame/Level_Bullet_Manager.cpp | 4 - src/xrGame/MainMenu.cpp | 21 +- src/xrGame/MainMenu.h | 17 +- src/xrGame/StdAfx.h | 3 - src/xrGame/UIAchivementsIndicator.cpp | 32 - src/xrGame/UIAchivementsIndicator.h | 29 - src/xrGame/UIGameMP.cpp | 19 +- src/xrGame/UIGameMP.h | 4 - src/xrGame/WeaponFire.cpp | 5 - src/xrGame/account_manager_console.cpp | 73 +- src/xrGame/accumulative_states.h | 49 -- src/xrGame/ammunition_groups.cpp | 82 --- src/xrGame/ammunition_groups.h | 44 -- src/xrGame/atlas_stalkercoppc_v1.c | 656 ------------------ src/xrGame/atlas_stalkercoppc_v1.h | 173 ----- src/xrGame/atlas_stalkercs_v1.c | 648 ----------------- src/xrGame/atlas_stalkercs_v1.h | 171 ----- src/xrGame/atlas_submit_queue.cpp | 165 ----- src/xrGame/atlas_submit_queue.h | 64 -- src/xrGame/awards_store.cpp | 157 ----- src/xrGame/awards_store.h | 55 -- src/xrGame/best_scores_helper.cpp | 140 ---- src/xrGame/best_scores_helper.h | 65 -- src/xrGame/best_scores_store.cpp | 151 ---- src/xrGame/best_scores_store.h | 55 -- src/xrGame/black_list.cpp | 36 - src/xrGame/black_list.h | 33 - src/xrGame/bone_groups.cpp | 41 -- src/xrGame/bone_groups.h | 35 - src/xrGame/command_switch_counter.h | 28 - src/xrGame/double_shot_double_kill.cpp | 61 -- src/xrGame/double_shot_double_kill.h | 42 -- src/xrGame/event_conditions_collection.cpp | 336 --------- src/xrGame/event_conditions_collection.h | 120 ---- src/xrGame/faster_than_bullets_time.cpp | 72 -- src/xrGame/faster_than_bullets_time.h | 31 - src/xrGame/game_cl_artefacthunt.cpp | 13 - src/xrGame/game_cl_capture_the_artefact.cpp | 29 - src/xrGame/game_cl_deathmatch.cpp | 15 - src/xrGame/game_cl_mp.cpp | 38 - src/xrGame/game_cl_mp.h | 17 - src/xrGame/game_cl_teamdeathmatch.cpp | 12 - src/xrGame/game_events_handler.h | 33 - src/xrGame/game_state_accumulator.cpp | 491 ------------- src/xrGame/game_state_accumulator.h | 106 --- src/xrGame/game_state_accumulator_inline.h | 11 - .../game_state_accumulator_state_register.cpp | 78 --- src/xrGame/harvest_time.cpp | 78 --- src/xrGame/harvest_time.h | 33 - src/xrGame/hits_store.cpp | 31 - src/xrGame/hits_store.h | 43 -- src/xrGame/hits_store_inline.h | 24 - src/xrGame/invincible_fury.cpp | 63 -- src/xrGame/invincible_fury.h | 33 - src/xrGame/killer_victim_velocity_angle.cpp | 59 -- src/xrGame/killer_victim_velocity_angle.h | 30 - src/xrGame/kills_store.cpp | 30 - src/xrGame/kills_store.h | 45 -- src/xrGame/kills_store_inline.h | 24 - src/xrGame/obsolete_queue.h | 31 - src/xrGame/obsolete_queue_inline.h | 37 - src/xrGame/player_account.cpp | 38 +- src/xrGame/player_account.h | 4 - src/xrGame/player_spot_params.cpp | 101 --- src/xrGame/player_spot_params.h | 41 -- src/xrGame/player_state_achilles_heel.cpp | 49 -- src/xrGame/player_state_achilles_heel.h | 30 - src/xrGame/player_state_ambassador.cpp | 85 --- src/xrGame/player_state_ambassador.h | 35 - src/xrGame/player_state_ammo_elapsed.cpp | 21 - src/xrGame/player_state_ammo_elapsed.h | 25 - src/xrGame/player_state_avenger.cpp | 95 --- src/xrGame/player_state_avenger.h | 35 - src/xrGame/player_state_blitzkrieg.cpp | 57 -- src/xrGame/player_state_blitzkrieg.h | 34 - src/xrGame/player_state_cherub.cpp | 102 --- src/xrGame/player_state_cherub.h | 39 -- src/xrGame/player_state_climber.cpp | 46 -- src/xrGame/player_state_climber.h | 29 - src/xrGame/player_state_mad.cpp | 35 - src/xrGame/player_state_mad.h | 34 - src/xrGame/player_state_marksman.cpp | 65 -- src/xrGame/player_state_marksman.h | 35 - src/xrGame/player_state_multichampion.cpp | 72 -- src/xrGame/player_state_multichampion.h | 30 - src/xrGame/player_state_opener.cpp | 34 - src/xrGame/player_state_opener.h | 31 - src/xrGame/player_state_param.h | 43 -- src/xrGame/player_state_params.cpp | 107 --- src/xrGame/player_state_params.h | 102 --- src/xrGame/player_state_remembrance.cpp | 49 -- src/xrGame/player_state_remembrance.h | 32 - src/xrGame/player_state_skewer.cpp | 51 -- src/xrGame/player_state_skewer.h | 33 - src/xrGame/player_state_toughy.cpp | 47 -- src/xrGame/player_state_toughy.h | 32 - src/xrGame/player_team_win_score.cpp | 101 --- src/xrGame/player_team_win_score.h | 79 --- src/xrGame/profile_data_types.cpp | 172 ----- src/xrGame/profile_data_types.h | 34 +- src/xrGame/profile_data_types_script.h | 2 +- src/xrGame/profile_store.cpp | 276 +------- src/xrGame/profile_store.h | 83 +-- src/xrGame/reward_event_generator.cpp | 224 ------ src/xrGame/reward_event_generator.h | 61 -- src/xrGame/reward_event_handler.h | 37 - src/xrGame/reward_manager.cpp | 114 --- src/xrGame/reward_manager.h | 49 -- src/xrGame/reward_snd_messages.h | 9 - src/xrGame/rewarding_events_handlers.cpp | 205 ------ src/xrGame/rewarding_events_handlers.h | 49 -- src/xrGame/rewarding_state_events.cpp | 186 ----- src/xrGame/rewarding_state_events.h | 20 - src/xrGame/silent_shots.cpp | 47 -- src/xrGame/silent_shots.h | 31 - src/xrGame/sprinter_stopper.cpp | 37 - src/xrGame/sprinter_stopper.h | 30 - src/xrGame/stalker_flair.cpp | 36 - src/xrGame/stalker_flair.h | 33 - src/xrGame/state_arguments_functions.cpp | 17 - src/xrGame/state_arguments_functions.h | 65 -- src/xrGame/stats_submitter.cpp | 467 ------------- src/xrGame/stats_submitter.h | 98 --- src/xrGame/stats_submitter_dsa_params.cpp | 41 -- src/xrGame/xrGame.vcxproj | 105 --- src/xrGame/xrGame.vcxproj.filters | 321 --------- src/xrGameSpy/CMakeLists.txt | 2 - src/xrGameSpy/GameSpy_Full.cpp | 4 - src/xrGameSpy/GameSpy_Full.h | 3 - src/xrGameSpy/GameSpy_SAKE.cpp | 80 --- src/xrGameSpy/GameSpy_SAKE.h | 27 - src/xrGameSpy/xrGameSpy.vcxproj | 2 - src/xrGameSpy/xrGameSpy.vcxproj.filters | 6 - 135 files changed, 37 insertions(+), 10043 deletions(-) delete mode 100644 src/xrGame/UIAchivementsIndicator.cpp delete mode 100644 src/xrGame/UIAchivementsIndicator.h delete mode 100644 src/xrGame/accumulative_states.h delete mode 100644 src/xrGame/ammunition_groups.cpp delete mode 100644 src/xrGame/ammunition_groups.h delete mode 100644 src/xrGame/atlas_stalkercoppc_v1.c delete mode 100644 src/xrGame/atlas_stalkercoppc_v1.h delete mode 100644 src/xrGame/atlas_stalkercs_v1.c delete mode 100644 src/xrGame/atlas_stalkercs_v1.h delete mode 100644 src/xrGame/atlas_submit_queue.cpp delete mode 100644 src/xrGame/atlas_submit_queue.h delete mode 100644 src/xrGame/awards_store.cpp delete mode 100644 src/xrGame/awards_store.h delete mode 100644 src/xrGame/best_scores_helper.cpp delete mode 100644 src/xrGame/best_scores_helper.h delete mode 100644 src/xrGame/best_scores_store.cpp delete mode 100644 src/xrGame/best_scores_store.h delete mode 100644 src/xrGame/black_list.cpp delete mode 100644 src/xrGame/black_list.h delete mode 100644 src/xrGame/bone_groups.cpp delete mode 100644 src/xrGame/bone_groups.h delete mode 100644 src/xrGame/command_switch_counter.h delete mode 100644 src/xrGame/double_shot_double_kill.cpp delete mode 100644 src/xrGame/double_shot_double_kill.h delete mode 100644 src/xrGame/event_conditions_collection.cpp delete mode 100644 src/xrGame/event_conditions_collection.h delete mode 100644 src/xrGame/faster_than_bullets_time.cpp delete mode 100644 src/xrGame/faster_than_bullets_time.h delete mode 100644 src/xrGame/game_events_handler.h delete mode 100644 src/xrGame/game_state_accumulator.cpp delete mode 100644 src/xrGame/game_state_accumulator.h delete mode 100644 src/xrGame/game_state_accumulator_inline.h delete mode 100644 src/xrGame/game_state_accumulator_state_register.cpp delete mode 100644 src/xrGame/harvest_time.cpp delete mode 100644 src/xrGame/harvest_time.h delete mode 100644 src/xrGame/hits_store.cpp delete mode 100644 src/xrGame/hits_store.h delete mode 100644 src/xrGame/hits_store_inline.h delete mode 100644 src/xrGame/invincible_fury.cpp delete mode 100644 src/xrGame/invincible_fury.h delete mode 100644 src/xrGame/killer_victim_velocity_angle.cpp delete mode 100644 src/xrGame/killer_victim_velocity_angle.h delete mode 100644 src/xrGame/kills_store.cpp delete mode 100644 src/xrGame/kills_store.h delete mode 100644 src/xrGame/kills_store_inline.h delete mode 100644 src/xrGame/obsolete_queue.h delete mode 100644 src/xrGame/obsolete_queue_inline.h delete mode 100644 src/xrGame/player_spot_params.cpp delete mode 100644 src/xrGame/player_spot_params.h delete mode 100644 src/xrGame/player_state_achilles_heel.cpp delete mode 100644 src/xrGame/player_state_achilles_heel.h delete mode 100644 src/xrGame/player_state_ambassador.cpp delete mode 100644 src/xrGame/player_state_ambassador.h delete mode 100644 src/xrGame/player_state_ammo_elapsed.cpp delete mode 100644 src/xrGame/player_state_ammo_elapsed.h delete mode 100644 src/xrGame/player_state_avenger.cpp delete mode 100644 src/xrGame/player_state_avenger.h delete mode 100644 src/xrGame/player_state_blitzkrieg.cpp delete mode 100644 src/xrGame/player_state_blitzkrieg.h delete mode 100644 src/xrGame/player_state_cherub.cpp delete mode 100644 src/xrGame/player_state_cherub.h delete mode 100644 src/xrGame/player_state_climber.cpp delete mode 100644 src/xrGame/player_state_climber.h delete mode 100644 src/xrGame/player_state_mad.cpp delete mode 100644 src/xrGame/player_state_mad.h delete mode 100644 src/xrGame/player_state_marksman.cpp delete mode 100644 src/xrGame/player_state_marksman.h delete mode 100644 src/xrGame/player_state_multichampion.cpp delete mode 100644 src/xrGame/player_state_multichampion.h delete mode 100644 src/xrGame/player_state_opener.cpp delete mode 100644 src/xrGame/player_state_opener.h delete mode 100644 src/xrGame/player_state_param.h delete mode 100644 src/xrGame/player_state_params.cpp delete mode 100644 src/xrGame/player_state_params.h delete mode 100644 src/xrGame/player_state_remembrance.cpp delete mode 100644 src/xrGame/player_state_remembrance.h delete mode 100644 src/xrGame/player_state_skewer.cpp delete mode 100644 src/xrGame/player_state_skewer.h delete mode 100644 src/xrGame/player_state_toughy.cpp delete mode 100644 src/xrGame/player_state_toughy.h delete mode 100644 src/xrGame/player_team_win_score.cpp delete mode 100644 src/xrGame/player_team_win_score.h delete mode 100644 src/xrGame/profile_data_types.cpp delete mode 100644 src/xrGame/reward_event_generator.cpp delete mode 100644 src/xrGame/reward_event_generator.h delete mode 100644 src/xrGame/reward_event_handler.h delete mode 100644 src/xrGame/reward_manager.cpp delete mode 100644 src/xrGame/reward_manager.h delete mode 100644 src/xrGame/reward_snd_messages.h delete mode 100644 src/xrGame/rewarding_events_handlers.cpp delete mode 100644 src/xrGame/rewarding_events_handlers.h delete mode 100644 src/xrGame/rewarding_state_events.cpp delete mode 100644 src/xrGame/rewarding_state_events.h delete mode 100644 src/xrGame/silent_shots.cpp delete mode 100644 src/xrGame/silent_shots.h delete mode 100644 src/xrGame/sprinter_stopper.cpp delete mode 100644 src/xrGame/sprinter_stopper.h delete mode 100644 src/xrGame/stalker_flair.cpp delete mode 100644 src/xrGame/stalker_flair.h delete mode 100644 src/xrGame/state_arguments_functions.cpp delete mode 100644 src/xrGame/state_arguments_functions.h delete mode 100644 src/xrGame/stats_submitter.cpp delete mode 100644 src/xrGame/stats_submitter.h delete mode 100644 src/xrGame/stats_submitter_dsa_params.cpp delete mode 100644 src/xrGameSpy/GameSpy_SAKE.cpp delete mode 100644 src/xrGameSpy/GameSpy_SAKE.h diff --git a/src/xrGame/CMakeLists.txt b/src/xrGame/CMakeLists.txt index 4f7d4dcdee0..2120c294d83 100644 --- a/src/xrGame/CMakeLists.txt +++ b/src/xrGame/CMakeLists.txt @@ -10,7 +10,6 @@ target_sources(xrGame PRIVATE account_manager.cpp account_manager.h account_manager_script.cpp - accumulative_states.h action_base.h action_base_inline.h action_base_script.cpp @@ -241,8 +240,6 @@ target_sources(xrGame PRIVATE alife_update_manager.h AmebaZone.cpp AmebaZone.h - ammunition_groups.cpp - ammunition_groups.h animation_movement_controller.cpp animation_movement_controller.h animation_script_callback.cpp @@ -259,12 +256,6 @@ target_sources(xrGame PRIVATE Artefact.cpp Artefact.h artefact_script.cpp - atlas_stalkercoppc_v1.c - atlas_stalkercoppc_v1.h - #atlas_stalkercs_v1.c - #atlas_stalkercs_v1.h - atlas_submit_queue.cpp - atlas_submit_queue.h attachable_item.cpp attachable_item.h attachable_item_inline.h @@ -273,8 +264,6 @@ target_sources(xrGame PRIVATE autosave_manager.cpp autosave_manager.h autosave_manager_inline.h - awards_store.cpp - awards_store.h base_client_classes_script.cpp base_client_classes_wrappers.h BastArtifact.cpp @@ -282,21 +271,13 @@ target_sources(xrGame PRIVATE battleye.h #battleye_system.cpp #battleye_system.h - best_scores_helper.cpp - best_scores_helper.h - best_scores_store.cpp - best_scores_store.h BlackDrops.cpp BlackDrops.h BlackGraviArtifact.cpp BlackGraviArtifact.h - black_list.cpp - black_list.h BlockAllocator.h Bolt.cpp Bolt.h - bone_groups.cpp - bone_groups.h BoneProtections.cpp BoneProtections.h BottleItem.cpp @@ -349,7 +330,6 @@ target_sources(xrGame PRIVATE client_spawn_manager_script.cpp ClimableObject.cpp ClimableObject.h - command_switch_counter.h configs_common.cpp configs_common.h configs_dumper.cpp @@ -449,8 +429,6 @@ target_sources(xrGame PRIVATE doors.h doors_manager.cpp doors_manager.h - double_shot_double_kill.cpp - double_shot_double_kill.h DummyArtifact.cpp DummyArtifact.h #DynamicHeightMap.cpp @@ -499,8 +477,6 @@ target_sources(xrGame PRIVATE EntityCondition_script.cpp Entity.cpp Entity.h - event_conditions_collection.cpp - event_conditions_collection.h ExoOutfit.cpp ExoOutfit.h Explosive.cpp @@ -513,8 +489,6 @@ target_sources(xrGame PRIVATE F1.h FadedBall.cpp FadedBall.h - faster_than_bullets_time.cpp - faster_than_bullets_time.h filereceiver_node.cpp filereceiver_node.h filetransfer_common.h @@ -574,7 +548,6 @@ target_sources(xrGame PRIVATE game_cl_teamdeathmatch.cpp game_cl_teamdeathmatch.h game_cl_teamdeathmatch_snd_messages.h - game_events_handler.h game_location_selector.h game_location_selector_inline.h game_news.cpp @@ -586,10 +559,6 @@ target_sources(xrGame PRIVATE game_path_manager_inline.h GamePersistent.cpp GamePersistent.h - game_state_accumulator.cpp - game_state_accumulator.h - game_state_accumulator_inline.h - game_state_accumulator_state_register.cpp game_sv_artefacthunt.cpp game_sv_artefacthunt.h game_sv_artefacthunt_process_event.cpp @@ -650,8 +619,6 @@ target_sources(xrGame PRIVATE HairsZone_script.cpp HangingLamp.cpp HangingLamp.h - harvest_time.cpp - harvest_time.h Helicopter2.cpp Helicopter.cpp helicopter.h @@ -668,9 +635,6 @@ target_sources(xrGame PRIVATE hit_memory_manager.cpp hit_memory_manager.h hit_memory_manager_inline.h - hits_store.cpp - hits_store.h - hits_store_inline.h holder_custom.cpp holder_custom.h holder_custom_script.cpp @@ -756,16 +720,9 @@ target_sources(xrGame PRIVATE inventory_upgrade_root.cpp inventory_upgrade_root.h inventory_upgrade_root_inline.h - invincible_fury.cpp - invincible_fury.h item_manager.cpp item_manager.h item_manager_inline.h - killer_victim_velocity_angle.cpp - killer_victim_velocity_angle.h - kills_store.cpp - kills_store.h - kills_store_inline.h Level_Bullet_Manager.cpp Level_bullet_manager_firetrace.cpp Level_Bullet_Manager.h @@ -921,8 +878,6 @@ target_sources(xrGame PRIVATE object_property_evaluators.cpp object_property_evaluators.h object_property_evaluators_inline.h - obsolete_queue.h - obsolete_queue_inline.h obstacles_query.cpp obstacles_query.h obstacles_query_inline.h @@ -1008,41 +963,6 @@ target_sources(xrGame PRIVATE player_hud_tune.h player_name_modifyer.cpp player_name_modifyer.h - player_spot_params.cpp - player_spot_params.h - player_state_achilles_heel.cpp - player_state_achilles_heel.h - player_state_ambassador.cpp - player_state_ambassador.h - player_state_ammo_elapsed.cpp - player_state_ammo_elapsed.h - player_state_avenger.cpp - player_state_avenger.h - player_state_blitzkrieg.cpp - player_state_blitzkrieg.h - player_state_cherub.cpp - player_state_cherub.h - player_state_climber.cpp - player_state_climber.h - player_state_mad.cpp - player_state_mad.h - player_state_marksman.cpp - player_state_marksman.h - player_state_multichampion.cpp - player_state_multichampion.h - player_state_opener.cpp - player_state_opener.h - player_state_param.h - player_state_params.cpp - player_state_params.h - player_state_remembrance.cpp - player_state_remembrance.h - player_state_skewer.cpp - player_state_skewer.h - player_state_toughy.cpp - player_state_toughy.h - player_team_win_score.cpp - player_team_win_score.h pose_extrapolation.cpp pose_extrapolation.h poses_blending.cpp @@ -1053,7 +973,6 @@ target_sources(xrGame PRIVATE pp_effector_custom.h pp_effector_distance.cpp pp_effector_distance.h - profile_data_types.cpp profile_data_types.h profile_data_types_script.cpp profile_data_types_script.h @@ -1104,16 +1023,6 @@ target_sources(xrGame PRIVATE restricted_object_inline.h restricted_object_obstacle.cpp restricted_object_obstacle.h - reward_event_generator.cpp - reward_event_generator.h - reward_event_handler.h - rewarding_events_handlers.cpp - rewarding_events_handlers.h - rewarding_state_events.cpp - rewarding_state_events.h - reward_manager.cpp - reward_manager.h - reward_snd_messages.h RGD5.h RocketLauncher.cpp RocketLauncher.h @@ -1266,8 +1175,6 @@ target_sources(xrGame PRIVATE sight_manager_target.cpp Silencer.cpp Silencer.h - silent_shots.cpp - silent_shots.h SimpleDetector.cpp SimpleDetector.h SleepEffector.cpp @@ -1362,8 +1269,6 @@ target_sources(xrGame PRIVATE spectator_camera_first_eye.h Spectator.cpp Spectator.h - sprinter_stopper.cpp - sprinter_stopper.h squad_hierarchy_holder.cpp squad_hierarchy_holder.h squad_hierarchy_holder_inline.h @@ -1441,8 +1346,6 @@ target_sources(xrGame PRIVATE stalker_death_planner.cpp stalker_death_planner.h stalker_decision_space.h - stalker_flair.cpp - stalker_flair.h stalker_get_distance_actions.cpp stalker_get_distance_actions.h stalker_get_distance_planner.cpp @@ -1497,16 +1400,11 @@ target_sources(xrGame PRIVATE stalker_velocity_holder.cpp stalker_velocity_holder.h stalker_velocity_holder_inline.h - state_arguments_functions.cpp - state_arguments_functions.h static_cast_checked.hpp #static_cast_checked_test.cpp static_obstacles_avoider.cpp static_obstacles_avoider.h static_obstacles_avoider_inline.h - #stats_submitter.cpp - stats_submitter_dsa_params.cpp - stats_submitter.h StdAfx.cpp StdAfx.h steering_behaviour_alignment.h @@ -1553,8 +1451,6 @@ target_sources(xrGame PRIVATE traffic_optimization.h trajectories.cpp trajectories.h - UIAchivementsIndicator.cpp - UIAchivementsIndicator.h UIDialogHolder.cpp UIDialogHolder.h ui_export_script.cpp diff --git a/src/xrGame/GameObject.cpp b/src/xrGame/GameObject.cpp index 60aece96f3a..476da701817 100644 --- a/src/xrGame/GameObject.cpp +++ b/src/xrGame/GameObject.cpp @@ -27,7 +27,6 @@ #include "xrPhysics/MathUtils.h" #include "game_cl_base_weapon_usage_statistic.h" #include "game_cl_mp.h" -#include "reward_event_generator.h" #include "xrAICore/Navigation/game_level_cross_table.h" #include "ai_obstacle.h" #include "magic_box3.h" @@ -392,9 +391,6 @@ void CGameObject::OnEvent(NET_Packet& P, u16 type) if (GameID() != eGameIDSingle) { Game().m_WeaponUsageStatistic->OnBullet_Check_Result(false); - game_cl_mp* mp_game = smart_cast(&Game()); - if (mp_game->get_reward_generator()) - mp_game->get_reward_generator()->OnBullet_Hit(Hitter, this, Weapon, HDS.boneID); } //--------------------------------------------------------------------------- } diff --git a/src/xrGame/Level_Bullet_Manager.cpp b/src/xrGame/Level_Bullet_Manager.cpp index 29872c6fd09..40e038e31af 100644 --- a/src/xrGame/Level_Bullet_Manager.cpp +++ b/src/xrGame/Level_Bullet_Manager.cpp @@ -11,7 +11,6 @@ #include "mt_config.h" #include "game_cl_base_weapon_usage_statistic.h" #include "game_cl_mp.h" -#include "reward_event_generator.h" #include "Include/xrRender/UIRender.h" #include "Include/xrRender/Kinematics.h" @@ -196,9 +195,6 @@ void CBulletManager::AddBullet(const Fvector& position, const Fvector& direction { if (SendHit) Game().m_WeaponUsageStatistic->OnBullet_Fire(&bullet, cartridge); - game_cl_mp* tmp_cl_game = smart_cast(&Game()); - if (tmp_cl_game->get_reward_generator()) - tmp_cl_game->get_reward_generator()->OnBullet_Fire(sender_id, sendersweapon_id, position, direction); } } diff --git a/src/xrGame/MainMenu.cpp b/src/xrGame/MainMenu.cpp index 8fcc0e06e6f..463ae5c98d6 100644 --- a/src/xrGame/MainMenu.cpp +++ b/src/xrGame/MainMenu.cpp @@ -35,8 +35,6 @@ #include "account_manager.h" #include "login_manager.h" #include "profile_store.h" -#include "stats_submitter.h" -#include "atlas_submit_queue.h" #include "xrEngine/xr_input.h" // fwd. decl. @@ -104,14 +102,6 @@ CMainMenu::CMainMenu() m_deactivated_frame = 0; m_sPatchURL = ""; -#ifdef XR_PLATFORM_WINDOWS - m_pGameSpyFull = NULL; - m_account_mngr = NULL; - m_login_mngr = NULL; - m_profile_store = NULL; - m_stats_submitter = NULL; - m_atlas_submit_queue = NULL; -#endif m_sPDProgress.IsInProgress = false; m_downloaded_mp_map_url._set(""); @@ -155,16 +145,10 @@ CMainMenu::CMainMenu() downloadMsg->AddCallbackStr( "button_yes", MESSAGE_BOX_YES_CLICKED, CUIWndCallback::void_function(this, &CMainMenu::OnDownloadMPMap)); } - #endif - m_account_mngr = xr_new(m_pGameSpyFull->GetGameSpyGP()); m_login_mngr = xr_new(m_pGameSpyFull); - m_profile_store = xr_new(m_pGameSpyFull); -#ifdef XR_PLATFORM_WINDOWS - m_stats_submitter = xr_new(m_pGameSpyFull); - m_atlas_submit_queue = xr_new(m_stats_submitter); -#endif + m_profile_store = xr_new(); } Device.seqFrame.Add(this, REG_PRIORITY_LOW - 1000); @@ -185,8 +169,6 @@ CMainMenu::~CMainMenu() xr_delete(m_account_mngr); xr_delete(m_login_mngr); xr_delete(m_profile_store); - xr_delete(m_stats_submitter); - xr_delete(m_atlas_submit_queue); xr_delete(m_pGameSpyFull); #endif @@ -593,7 +575,6 @@ void CMainMenu::OnFrame() case GSUpdateStatus::Unknown: SetErrorDialog(ErrMasterServerConnectFailed); break; case GSUpdateStatus::OutOfService: SetErrorDialog(ErrGSServiceFailed); break; } - m_atlas_submit_queue->update(); } #endif diff --git a/src/xrGame/MainMenu.h b/src/xrGame/MainMenu.h index 86d9a49bbb3..569f3d1579e 100644 --- a/src/xrGame/MainMenu.h +++ b/src/xrGame/MainMenu.h @@ -26,11 +26,8 @@ class login_manager; namespace gamespy_profile { class profile_store; -class stats_submitter; } // namespace gamespy_profile -class atlas_submit_queue; - struct Patch_Dawnload_Progress { bool IsInProgress; @@ -72,15 +69,11 @@ class CMainMenu : public IMainMenu, xr_vector m_pp_draw_wnds; - CGameSpy_Full* m_pGameSpyFull; - gamespy_gp::account_manager* m_account_mngr; - gamespy_gp::login_manager* m_login_mngr; - gamespy_profile::profile_store* m_profile_store; + CGameSpy_Full* m_pGameSpyFull{}; + gamespy_gp::account_manager* m_account_mngr{}; + gamespy_gp::login_manager* m_login_mngr{}; + gamespy_profile::profile_store* m_profile_store{}; -#ifdef XR_PLATFORM_WINDOWS - gamespy_profile::stats_submitter* m_stats_submitter; - atlas_submit_queue* m_atlas_submit_queue; -#endif demo_info_loader* m_demo_info_loader; public: @@ -117,8 +110,6 @@ class CMainMenu : public IMainMenu, #ifdef XR_PLATFORM_WINDOWS CGameSpy_Full* GetGS() { return m_pGameSpyFull; }; - gamespy_profile::stats_submitter* GetStatsSubmitter() { return m_stats_submitter; }; - atlas_submit_queue* GetSubmitQueue() { return m_atlas_submit_queue; }; #endif protected: EErrorDlg m_NeedErrDialog; diff --git a/src/xrGame/StdAfx.h b/src/xrGame/StdAfx.h index 2b4f631d816..cee8789d13a 100644 --- a/src/xrGame/StdAfx.h +++ b/src/xrGame/StdAfx.h @@ -162,7 +162,6 @@ #include "xrGame/CameraEffector.h" // ~75, very heavy to compile #include "xrGame/alife_simulator.h" // ~80 #include "xrGame/alife_update_manager.h" -#include "xrGame/ammunition_groups.h" #include "xrGame/animation_utils.h" #include "xrGame/Artefact.h" // ~50 #include "xrGame/character_hit_animations.h" @@ -170,7 +169,6 @@ #include "xrGame/CharacterPhysicsSupport.h" // ~65 #include "xrGame/danger_object.h" #include "xrGame/Inventory.h" // ~120 -#include "xrGame/kills_store.h" #include "xrGame/MainMenu.h" #include "xrGame/map_location.h" #include "xrGame/map_location_defs.h" @@ -208,7 +206,6 @@ #include "xrGame/stalker_decision_space.h" // ~60, only enum's #include "xrGame/Spectator.h" // ~60, INCREDIBLY heavy to compile #include "xrGame/game_cl_mp.h" // ~60, INCREDIBLY heavy to compile -#include "xrGame/game_events_handler.h" // ~30, INCREDIBLY heavy to compile #include "xrGame/steering_behaviour.h" // ~30, measurable compile time #include "xrEngine/xr_level_controller.h" #include "xrGame/UIGameCustom.h" // ~85, quite heavy to compile diff --git a/src/xrGame/UIAchivementsIndicator.cpp b/src/xrGame/UIAchivementsIndicator.cpp deleted file mode 100644 index 1000beda2b5..00000000000 --- a/src/xrGame/UIAchivementsIndicator.cpp +++ /dev/null @@ -1,32 +0,0 @@ -#include "StdAfx.h" -#include "UIAchivementsIndicator.h" -#include "ui/UIXmlInit.h" -#include "ui/UIGameLog.h" -#include "xrUICore/XML/xrUIXmlParser.h" -#include "ui/UIPdaMsgListItem.h" -#include "profile_data_types.h" - -CUIAchivementIndicator::CUIAchivementIndicator() : CUIWindow("CUIAchivementIndicator") -{ - m_achivement_log = xr_new(); - AttachChild(m_achivement_log); - CUIXml tmp_xml; - tmp_xml.Load(CONFIG_PATH, UI_PATH, UI_PATH_DEFAULT, "ui_mp_achivements.xml"); - CUIXmlInit::InitWindow(tmp_xml, "mp_achivement_wnd", 0, this); - CUIXmlInit::InitScrollView(tmp_xml, "mp_achivement_wnd:achivement_list", 0, m_achivement_log); -} - -CUIAchivementIndicator::~CUIAchivementIndicator() { xr_delete(m_achivement_log); } -void CUIAchivementIndicator::Update() { inherited::Update(); } -void CUIAchivementIndicator::AddAchivement( - shared_str const& achivement_name, shared_str const& color_animation, u32 const width, u32 const height) -{ - CUIPdaMsgListItem* tmp_item = m_achivement_log->AddPdaMessage(); - VERIFY(tmp_item); - tmp_item->UIIcon.InitTexture(achivement_name.c_str()); - tmp_item->SetColorAnimation(color_animation.c_str(), LA_ONLYALPHA | LA_TEXTURECOLOR); - Fvector2 sz; - sz.set(int(width), int(height)); - tmp_item->SetWndSize(sz); - tmp_item->UIIcon.SetWndSize(sz); -} diff --git a/src/xrGame/UIAchivementsIndicator.h b/src/xrGame/UIAchivementsIndicator.h deleted file mode 100644 index d5a388659d3..00000000000 --- a/src/xrGame/UIAchivementsIndicator.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef UI_ACHIVEMENTS_INDICATOR_INCLUDED -#define UI_ACHIVEMENTS_INDICATOR_INCLUDED - -#include "xrUICore/Static/UIStatic.h" -#include "ui/KillMessageStruct.h" -#include "xrCore/Containers/AssociativeVector.hpp" - -class CUIXml; -class CUIGameLog; - -class CUIAchivementIndicator final : public CUIWindow -{ - typedef CUIWindow inherited; - -public: - CUIAchivementIndicator(); - virtual ~CUIAchivementIndicator(); - virtual void Update(); - - void AddAchivement( - shared_str const& achivement_name, shared_str const& color_animation, u32 const width, u32 const height); - - pcstr GetDebugType() override { return "CUIAchivementIndicator"; } - -protected: - CUIGameLog* m_achivement_log; -}; - -#endif //#ifndef UI_ACHIVEMENTS_INDICATOR_INCLUDED diff --git a/src/xrGame/UIGameMP.cpp b/src/xrGame/UIGameMP.cpp index cdeb66933cd..350ae43bbf1 100644 --- a/src/xrGame/UIGameMP.cpp +++ b/src/xrGame/UIGameMP.cpp @@ -1,13 +1,12 @@ #include "StdAfx.h" #include "UIGameMP.h" -#include "UIAchivementsIndicator.h" #include "ui/UIDemoPlayControl.h" #include "ui/UIServerInfo.h" #include "xrUICore/Cursor/UICursor.h" #include "Level.h" #include "game_cl_mp.h" -UIGameMP::UIGameMP() : m_pDemoPlayControl(NULL), m_pServerInfo(NULL), m_pAchivementIdicator(NULL), m_game(NULL) {} +UIGameMP::UIGameMP() : m_pDemoPlayControl(NULL), m_pServerInfo(NULL), m_game(NULL) {} UIGameMP::~UIGameMP() { xr_delete(m_pDemoPlayControl); @@ -32,12 +31,6 @@ bool UIGameMP::IR_UIOnKeyboardPress(int dik) ShowDemoPlayControl(); return true; } -#ifdef DEBUG - if (dik == SDL_SCANCODE_T) - { - m_game->AddRewardTask(0); // mp_award_massacre - } -#endif return inherited::IR_UIOnKeyboardPress(dik); } @@ -111,9 +104,6 @@ void UIGameMP::SetClGame(game_cl_GameState* g) xr_delete(m_pServerInfo); } m_pServerInfo = xr_new(); - m_pAchivementIdicator = xr_new(); - m_pAchivementIdicator->SetAutoDelete(true); - Window->AttachChild(m_pAchivementIdicator); } void UIGameMP::SetServerLogo(u8 const* data_ptr, u32 data_size) @@ -126,10 +116,3 @@ void UIGameMP::SetServerRules(u8 const* data_ptr, u32 data_size) VERIFY(m_pServerInfo); m_pServerInfo->SetServerRules(data_ptr, data_size); } - -void UIGameMP::AddAchivment( - shared_str const& achivement_name, shared_str const& color_animation, u32 const width, u32 const height) -{ - VERIFY(m_pAchivementIdicator); - m_pAchivementIdicator->AddAchivement(achivement_name, color_animation, width, height); -} diff --git a/src/xrGame/UIGameMP.h b/src/xrGame/UIGameMP.h index 2d383f45dd4..c62b8edd56c 100644 --- a/src/xrGame/UIGameMP.h +++ b/src/xrGame/UIGameMP.h @@ -5,7 +5,6 @@ class CUIDemoPlayControl; class CUIServerInfo; -class CUIAchivementIndicator; class game_cl_mp; class UIGameMP : public CUIGameCustom @@ -20,8 +19,6 @@ class UIGameMP : public CUIGameCustom void SetServerLogo(u8 const* data_ptr, u32 data_size); void SetServerRules(u8 const* data_ptr, u32 data_size); - void AddAchivment( - shared_str const& achivement_name, shared_str const& color_animation, u32 const width, u32 const height); bool IsServerInfoShown(); bool ShowServerInfo(); // shows only if it has some info ... @@ -33,7 +30,6 @@ class UIGameMP : public CUIGameCustom protected: CUIDemoPlayControl* m_pDemoPlayControl; CUIServerInfo* m_pServerInfo; - CUIAchivementIndicator* m_pAchivementIdicator; game_cl_mp* m_game; }; // class UIGameMP diff --git a/src/xrGame/WeaponFire.cpp b/src/xrGame/WeaponFire.cpp index fbbe67b9104..a7917bd7e18 100644 --- a/src/xrGame/WeaponFire.cpp +++ b/src/xrGame/WeaponFire.cpp @@ -14,7 +14,6 @@ #include "Level_Bullet_Manager.h" #include "game_cl_mp.h" -#include "reward_event_generator.h" #define FLAME_TIME 0.05f @@ -89,10 +88,6 @@ void CWeapon::FireTrace(const Fvector& P, const Fvector& D) m_first_bullet_controller.make_shot(); } } - game_cl_mp* tmp_mp_game = smart_cast(&Game()); - VERIFY(tmp_mp_game); - if (tmp_mp_game->get_reward_generator()) - tmp_mp_game->get_reward_generator()->OnWeapon_Fire(H_Parent()->ID(), ID()); } if (fsimilar(fire_disp, 0.f)) { diff --git a/src/xrGame/account_manager_console.cpp b/src/xrGame/account_manager_console.cpp index 8ab567b7f3d..2e0f6bf5d0c 100644 --- a/src/xrGame/account_manager_console.cpp +++ b/src/xrGame/account_manager_console.cpp @@ -2,11 +2,9 @@ #include "account_manager_console.h" #include "xrGameSpy/GameSpy_Full.h" #include "xrGameSpy/GameSpy_GP.h" -#include "xrGameSpy/GameSpy_SAKE.h" #include "account_manager.h" #include "login_manager.h" #include "profile_store.h" -#include "stats_submitter.h" #include "MainMenu.h" #include "profile_data_types_script.h" @@ -114,35 +112,6 @@ void CCC_GameSpyPrintProfile::Execute(LPCSTR args) Msg("- Current profile:"); Msg("- ProfileID : %u", tmp_profile->m_profile_id); Msg("- UniqueNick : %s", tmp_profile->m_unique_nick.c_str()); - - gamespy_profile::profile_store* tmp_store = MainMenu()->GetProfileStore(); - if (!tmp_store) - { - Msg("! No profile store available"); - return; - } - - Msg("- Player awards:"); - gamespy_profile::all_awards_t const& tmp_awards = tmp_store->get_awards(); - for (gamespy_profile::all_awards_t::const_iterator i = tmp_awards.begin(), ie = tmp_awards.end(); i < ie; ++i) - { - string64 rdate_str; - rdate_str[0] = 0; - print_time(i->second.m_last_reward_date, rdate_str); - Msg("- (award: %s), (count: %u), (last reward date: %s)", - gamespy_profile::get_award_name(static_cast(i->first)), - i->second.m_count, rdate_str); - } - - Msg("- Best player scores:"); - gamespy_profile::all_best_scores_t const& tmp_best_scores = tmp_store->get_best_scores(); - for (gamespy_profile::all_best_scores_t::const_iterator i = tmp_best_scores.begin(), ie = tmp_best_scores.end(); - i < ie; ++i) - { - Msg("- (score: %s), (score: %d)", - gamespy_profile::get_best_score_name(static_cast(i->first)), - i->second); - } } else { @@ -185,8 +154,6 @@ void CCC_GameSpyDeleteProfile::Execute(LPCSTR args) #endif } -static gamespy_profile::all_best_scores_t debug_best_scores; - void CCC_GameSpyProfile::Execute(LPCSTR args) { #ifdef XR_PLATFORM_WINDOWS @@ -216,45 +183,9 @@ void CCC_GameSpyProfile::Execute(LPCSTR args) tmp_prof_store->load_current_profile( gamespy_profile::store_operation_cb(), gamespy_profile::store_operation_cb()); } - else if (!xr_strcmp(tmp_command, "reward")) - { - gamespy_profile::stats_submitter* tmp_ssubmitter = MainMenu()->GetStatsSubmitter(); - VERIFY(tmp_ssubmitter); - char const* tmp_reward_id_str = args + xr_strlen(tmp_command); - unsigned int tmp_award_id = 0; - - if (!sscanf(tmp_reward_id_str, "%u", &tmp_award_id) || tmp_award_id >= gamespy_profile::enum_awards_t::at_awards_count) - { - Msg("! Bad award id"); - return; - } - tmp_ssubmitter->reward_with_award(static_cast(tmp_award_id), 1, tmp_curr_prof, - gamespy_profile::store_operation_cb()); - } - else if (!xr_strcmp(tmp_command, "bestscore")) + else if (!xr_strcmp(tmp_command, "reward") || !xr_strcmp(tmp_command, "bestscore")) { - gamespy_profile::stats_submitter* tmp_ssubmitter = MainMenu()->GetStatsSubmitter(); - VERIFY(tmp_ssubmitter); - char const* tmp_scores_str = args + xr_strlen(tmp_command); - unsigned int score_id = 0; - int score_value = 0; - if (sscanf(tmp_scores_str, "%u %d", &score_id, &score_value) != 2) - { - Msg("! Not enough parameters"); - return; - } - if (score_id >= gamespy_profile::bst_score_types_count) - { - Msg("! Bad scoreid"); - } - if (score_value < 0) - { - Msg("! Bad score value"); - } - debug_best_scores.clear(); - debug_best_scores.insert( - std::make_pair(static_cast(score_id), score_value)); - tmp_ssubmitter->set_best_scores(&debug_best_scores, tmp_curr_prof, gamespy_profile::store_operation_cb()); + Log("~ This command is unsupported since old gamespy profile code has been removed from the engine."); } #endif } diff --git a/src/xrGame/accumulative_states.h b/src/xrGame/accumulative_states.h deleted file mode 100644 index 55f7ac28636..00000000000 --- a/src/xrGame/accumulative_states.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef ACCUMULATIVE_STATES_INCLUDED -#define ACCUMULATIVE_STATES_INCLUDED - -namespace award_system -{ -enum enum_accumulative_player_values -{ - acpv_command_switch_count = 0x00, - acpv_kill_in_raw, - acpv_death_count, - acpv_spots, - acpv_my_team_win_score, - acpv_my_team_win_score_now, - acpv_enemy_top_player_div, - acpv_blitzkrieg_time, - acpv_enemy_team_score, - acpv_enemy_team_score_now, - acpv_artdeliver_count, - acpv_multi_champion, - acpv_mad, - acpv_achilles_heel_ready, - acpv_faster_than_bullets_time, - acpv_harvest_count, - acpv_skewer_count, - acpv_double_shot_double_kill_time, - acpv_climber, - acpv_ammo_elapsed, - acpv_opener_ready, - acpv_toughy, - acpv_invincible_fury, - acpv_move_state, - acpv_move_velocity, - acpv_move_ang_velocity, - acpv_sprinter_victim_velocity, - acpv_marksman_count, - acpv_ambassador, - acpv_remembrance, - acpv_avenger, - acpv_cherub_ready, - acpv_stalker_flair, - acpv_black_list, - acpv_thunder_count, - acpv_killer_victim_angle, - acpv_count, -}; // enum enum_accumulative_player_values - -} // namespace award_system - -#endif //#ifndef ACCUMULATIVE_STATES_INCLUDED diff --git a/src/xrGame/ammunition_groups.cpp b/src/xrGame/ammunition_groups.cpp deleted file mode 100644 index b42443a0628..00000000000 --- a/src/xrGame/ammunition_groups.cpp +++ /dev/null @@ -1,82 +0,0 @@ -#include "StdAfx.h" -#include "ammunition_groups.h" -#include "ui/UIBuyWndShared.h" -#include "xrCore/xr_ini.h" - -namespace award_system -{ -ammunition_group::ammunition_group() {} -ammunition_group::~ammunition_group() {} -void ammunition_group::init_ammunition_group( - CItemMgr const* item_manager, enum_group_id gid, shared_str const& weapons_string) -{ - string256 dststr; - u32 count = _GetItemCount(weapons_string.c_str()); - for (u32 i = 0; i < count; ++i) - { - _GetItem(weapons_string.c_str(), i, dststr); - u32 itm_index = item_manager->GetItemIdx(dststr); - if (itm_index != u32(-1)) - { - VERIFY((itm_index & 0xffff0000) == 0); - m_wpn_groups.emplace_back(static_cast(itm_index), gid); - } - }; -} - -static char const* dm_team_data = "deathmatch_team0"; - -void ammunition_group::init(CItemMgr const* item_manager) -{ - m_wpn_groups.clear(); - - shared_str tmp_string; - - init_ammunition_group(item_manager, gid_knife, "mp_wpn_knife"); - - tmp_string = pSettings->r_string(dm_team_data, "pistols"); - init_ammunition_group(item_manager, gid_pistols, tmp_string.c_str()); - - tmp_string = pSettings->r_string(dm_team_data, "shotgun"); - init_ammunition_group(item_manager, gid_shotguns, tmp_string.c_str()); - - tmp_string = pSettings->r_string(dm_team_data, "assault"); - init_ammunition_group(item_manager, gid_assault, tmp_string.c_str()); - - tmp_string = pSettings->r_string(dm_team_data, "sniper_rifles"); - init_ammunition_group(item_manager, gid_sniper_rifels, tmp_string.c_str()); - - tmp_string = pSettings->r_string(dm_team_data, "heavy_weapons"); - init_ammunition_group(item_manager, gid_heavy_weapons, tmp_string.c_str()); - - tmp_string = pSettings->r_string(dm_team_data, "gid_exo_outfit"); - init_ammunition_group(item_manager, gid_exo_outfit, tmp_string.c_str()); - - tmp_string = pSettings->r_string(dm_team_data, "gid_gauss_rifle"); - init_ammunition_group(item_manager, gid_gauss_rifle, tmp_string.c_str()); - - tmp_string = pSettings->r_string(dm_team_data, "gid_double_barred"); - init_ammunition_group(item_manager, gid_double_barred, tmp_string.c_str()); - - tmp_string = pSettings->r_string(dm_team_data, "gid_hand_grenades"); - init_ammunition_group(item_manager, gid_hand_grenades, tmp_string.c_str()); - - tmp_string = pSettings->r_string(dm_team_data, "gid_cool_weapons"); - init_ammunition_group(item_manager, gid_cool_weapons, tmp_string.c_str()); -} - -bool ammunition_group::is_item_in_group(u16 item_id, enum_group_id gid) const -{ - if (gid == gid_any) - return true; - - ammun_groups_map_t::const_iterator tmp_iter = - std::find(m_wpn_groups.begin(), m_wpn_groups.end(), ammun_groups_map_t::value_type(item_id & 0x00ff, gid)); - - if (tmp_iter == m_wpn_groups.end()) - return false; - - return true; -} - -} // namespace award_system diff --git a/src/xrGame/ammunition_groups.h b/src/xrGame/ammunition_groups.h deleted file mode 100644 index 41f7c116144..00000000000 --- a/src/xrGame/ammunition_groups.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef AMMUNITION_GROUPS_INCLUDED -#define AMMUNITION_GROUPS_INCLUDED - -#include "xrCore/Containers/AssociativeVector.hpp" - -class CItemMgr; - -namespace award_system -{ -class ammunition_group -{ -public: - enum enum_group_id : u16 - { - gid_knife = 0x00, - gid_pistols, - gid_assault, - gid_shotguns, - gid_sniper_rifels, - gid_gauss_rifle, - gid_heavy_weapons, - gid_exo_outfit, - gid_double_barred, - gid_hand_grenades, - gid_cool_weapons, - }; // enum_group_id - static u16 constexpr gid_any = u16(-1); - - ammunition_group(); - ~ammunition_group(); - - void init(CItemMgr const* item_manager); - bool is_item_in_group(u16 item_id, enum_group_id gid) const; - -private: - void init_ammunition_group(CItemMgr const* item_manager, enum_group_id gid, shared_str const& weapons_string); - - typedef xr_vector> ammun_groups_map_t; - ammun_groups_map_t m_wpn_groups; -}; - -} // namespace award_system - -#endif //#ifndef AMMUNITION_GROUPS_INCLUDED diff --git a/src/xrGame/atlas_stalkercoppc_v1.c b/src/xrGame/atlas_stalkercoppc_v1.c deleted file mode 100644 index 31b81a1e58c..00000000000 --- a/src/xrGame/atlas_stalkercoppc_v1.c +++ /dev/null @@ -1,656 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// GameSpy ATLAS Competition System Source File -// -// NOTE: This is an auto-generated file, do not edit this file directly. -/////////////////////////////////////////////////////////////////////////////// - -#include -#include "atlas_stalkercoppc_v1.h" - -int atlas_rule_set_version = 1; - -int ATLAS_GET_KEY(char* keyName) -{ - if (!keyName) - return 0; - - if (!strcmp("KEY_BestScore_KillsInRow", keyName)) - return KEY_BestScore_KillsInRow; - if (!strcmp("KEY_BestScore_KnifeKillsInRow", keyName)) - return KEY_BestScore_KnifeKillsInRow; - if (!strcmp("KEY_BestScore_BackstabsKillsInRow", keyName)) - return KEY_BestScore_BackstabsKillsInRow; - if (!strcmp("KEY_BestScore_HeadshotsKillsInRow", keyName)) - return KEY_BestScore_HeadshotsKillsInRow; - if (!strcmp("KEY_BestScore_EyeKillsInRow", keyName)) - return KEY_BestScore_EyeKillsInRow; - if (!strcmp("KEY_BestScore_BleedKillsInRow", keyName)) - return KEY_BestScore_BleedKillsInRow; - if (!strcmp("KEY_BestScore_ExplosiveKillsInRow", keyName)) - return KEY_BestScore_ExplosiveKillsInRow; - if (!strcmp("KEY_AwardMasscare", keyName)) - return KEY_AwardMasscare; - if (!strcmp("KEY_AwardMasscareLastRewardDate", keyName)) - return KEY_AwardMasscareLastRewardDate; - if (!strcmp("KEY_AwardParanoia", keyName)) - return KEY_AwardParanoia; - if (!strcmp("KEY_AwardParanoiaLastRewardDate", keyName)) - return KEY_AwardParanoiaLastRewardDate; - if (!strcmp("KEY_AwardOverwhelmingSuperiority", keyName)) - return KEY_AwardOverwhelmingSuperiority; - if (!strcmp("KEY_AwardOverwhelmingSuperiorityLastRewardDate", keyName)) - return KEY_AwardOverwhelmingSuperiorityLastRewardDate; - if (!strcmp("KEY_AwardBlitzkrieg", keyName)) - return KEY_AwardBlitzkrieg; - if (!strcmp("KEY_AwardBlitzkriegLastRewardDate", keyName)) - return KEY_AwardBlitzkriegLastRewardDate; - if (!strcmp("KEY_AwardDryVictory", keyName)) - return KEY_AwardDryVictory; - if (!strcmp("KEY_AwardDryVictoryLastRewardDate", keyName)) - return KEY_AwardDryVictoryLastRewardDate; - if (!strcmp("KEY_AwardMultichampion", keyName)) - return KEY_AwardMultichampion; - if (!strcmp("KEY_AwardMultichampionLastRewardDate", keyName)) - return KEY_AwardMultichampionLastRewardDate; - if (!strcmp("KEY_AwardMad", keyName)) - return KEY_AwardMad; - if (!strcmp("KEY_AwardMadLastRewardDate", keyName)) - return KEY_AwardMadLastRewardDate; - if (!strcmp("KEY_AwardAchillesHeel", keyName)) - return KEY_AwardAchillesHeel; - if (!strcmp("KEY_AwardAchillesHeelLastRewardDate", keyName)) - return KEY_AwardAchillesHeelLastRewardDate; - if (!strcmp("KEY_AwardFasterThanBullets", keyName)) - return KEY_AwardFasterThanBullets; - if (!strcmp("KEY_AwardFasterThanBulletsLastRewardDate", keyName)) - return KEY_AwardFasterThanBulletsLastRewardDate; - if (!strcmp("KEY_AwardHarvestTime", keyName)) - return KEY_AwardHarvestTime; - if (!strcmp("KEY_AwardHarvestTimeLastRewardDate", keyName)) - return KEY_AwardHarvestTimeLastRewardDate; - if (!strcmp("KEY_AwardSkewer", keyName)) - return KEY_AwardSkewer; - if (!strcmp("KEY_AwardSkewerLastRewardDate", keyName)) - return KEY_AwardSkewerLastRewardDate; - if (!strcmp("KEY_AwardDoubleShotDoubleKill", keyName)) - return KEY_AwardDoubleShotDoubleKill; - if (!strcmp("KEY_AwardDoubleShotDoubleKillLastRewardDate", keyName)) - return KEY_AwardDoubleShotDoubleKillLastRewardDate; - if (!strcmp("KEY_AwardClimber", keyName)) - return KEY_AwardClimber; - if (!strcmp("KEY_AwardClimberLastRewardDate", keyName)) - return KEY_AwardClimberLastRewardDate; - if (!strcmp("KEY_AwardOpener", keyName)) - return KEY_AwardOpener; - if (!strcmp("KEY_AwardOpenerLastRewardDate", keyName)) - return KEY_AwardOpenerLastRewardDate; - if (!strcmp("KEY_AwardToughy", keyName)) - return KEY_AwardToughy; - if (!strcmp("KEY_AwardToughyLastRewardDate", keyName)) - return KEY_AwardToughyLastRewardDate; - if (!strcmp("KEY_AwardInvincibleFury", keyName)) - return KEY_AwardInvincibleFury; - if (!strcmp("KEY_AwardInvincibleFuryLastRewardDate", keyName)) - return KEY_AwardInvincibleFuryLastRewardDate; - if (!strcmp("KEY_AwardOculist", keyName)) - return KEY_AwardOculist; - if (!strcmp("KEY_AwardOculistLastRewardDate", keyName)) - return KEY_AwardOculistLastRewardDate; - if (!strcmp("KEY_AwardLightingReflexes", keyName)) - return KEY_AwardLightingReflexes; - if (!strcmp("KEY_AwardLightingReflexesLastRewardDate", keyName)) - return KEY_AwardLightingReflexesLastRewardDate; - if (!strcmp("KEY_AwardSprinterStopper", keyName)) - return KEY_AwardSprinterStopper; - if (!strcmp("KEY_AwardSprinterStopperLastRewardDate", keyName)) - return KEY_AwardSprinterStopperLastRewardDate; - if (!strcmp("KEY_AwardMarksMan", keyName)) - return KEY_AwardMarksMan; - if (!strcmp("KEY_AwardMarksManLastRewardDate", keyName)) - return KEY_AwardMarksManLastRewardDate; - if (!strcmp("KEY_AwardPeaceAmbassador", keyName)) - return KEY_AwardPeaceAmbassador; - if (!strcmp("KEY_AwardPeaceAmbassadorLastRewardDate", keyName)) - return KEY_AwardPeaceAmbassadorLastRewardDate; - if (!strcmp("KEY_AwardDeadlyAccuracy", keyName)) - return KEY_AwardDeadlyAccuracy; - if (!strcmp("KEY_AwardDeadlyAccuracyLastRewardDate", keyName)) - return KEY_AwardDeadlyAccuracyLastRewardDate; - if (!strcmp("KEY_AwardRemembrance", keyName)) - return KEY_AwardRemembrance; - if (!strcmp("KEY_AwardRemembranceLastRewardDate", keyName)) - return KEY_AwardRemembranceLastRewardDate; - if (!strcmp("KEY_AwardAvenger", keyName)) - return KEY_AwardAvenger; - if (!strcmp("KEY_AwardAvengerLastRewardDate", keyName)) - return KEY_AwardAvengerLastRewardDate; - if (!strcmp("KEY_AwardCherub", keyName)) - return KEY_AwardCherub; - if (!strcmp("KEY_AwardCherubLastRewardDate", keyName)) - return KEY_AwardCherubLastRewardDate; - if (!strcmp("KEY_AwardDignity", keyName)) - return KEY_AwardDignity; - if (!strcmp("KEY_AwardDignityLastRewardDate", keyName)) - return KEY_AwardDignityLastRewardDate; - if (!strcmp("KEY_AwardStalkerFlair", keyName)) - return KEY_AwardStalkerFlair; - if (!strcmp("KEY_AwardStalkerFlairLastRewardDate", keyName)) - return KEY_AwardStalkerFlairLastRewardDate; - if (!strcmp("KEY_AwardLucky", keyName)) - return KEY_AwardLucky; - if (!strcmp("KEY_AwardLuckyLastRewardDate", keyName)) - return KEY_AwardLuckyLastRewardDate; - if (!strcmp("KEY_AwardBlackList", keyName)) - return KEY_AwardBlackList; - if (!strcmp("KEY_AwardBlackListLastRewardDate", keyName)) - return KEY_AwardBlackListLastRewardDate; - if (!strcmp("KEY_AwardSilentDeath", keyName)) - return KEY_AwardSilentDeath; - if (!strcmp("KEY_AwardSilentDeathLastRewardDate", keyName)) - return KEY_AwardSilentDeathLastRewardDate; - if (!strcmp("KEY_PlayerName", keyName)) - return KEY_PlayerName; - - return 0; -} - -char* ATLAS_GET_KEY_NAME(int keyId) -{ - if (keyId <= 0) - return ""; - - if (keyId == KEY_BestScore_KillsInRow) - return "KEY_BestScore_KillsInRow"; - if (keyId == KEY_BestScore_KnifeKillsInRow) - return "KEY_BestScore_KnifeKillsInRow"; - if (keyId == KEY_BestScore_BackstabsKillsInRow) - return "KEY_BestScore_BackstabsKillsInRow"; - if (keyId == KEY_BestScore_HeadshotsKillsInRow) - return "KEY_BestScore_HeadshotsKillsInRow"; - if (keyId == KEY_BestScore_EyeKillsInRow) - return "KEY_BestScore_EyeKillsInRow"; - if (keyId == KEY_BestScore_BleedKillsInRow) - return "KEY_BestScore_BleedKillsInRow"; - if (keyId == KEY_BestScore_ExplosiveKillsInRow) - return "KEY_BestScore_ExplosiveKillsInRow"; - if (keyId == KEY_AwardMasscare) - return "KEY_AwardMasscare"; - if (keyId == KEY_AwardMasscareLastRewardDate) - return "KEY_AwardMasscareLastRewardDate"; - if (keyId == KEY_AwardParanoia) - return "KEY_AwardParanoia"; - if (keyId == KEY_AwardParanoiaLastRewardDate) - return "KEY_AwardParanoiaLastRewardDate"; - if (keyId == KEY_AwardOverwhelmingSuperiority) - return "KEY_AwardOverwhelmingSuperiority"; - if (keyId == KEY_AwardOverwhelmingSuperiorityLastRewardDate) - return "KEY_AwardOverwhelmingSuperiorityLastRewardDate"; - if (keyId == KEY_AwardBlitzkrieg) - return "KEY_AwardBlitzkrieg"; - if (keyId == KEY_AwardBlitzkriegLastRewardDate) - return "KEY_AwardBlitzkriegLastRewardDate"; - if (keyId == KEY_AwardDryVictory) - return "KEY_AwardDryVictory"; - if (keyId == KEY_AwardDryVictoryLastRewardDate) - return "KEY_AwardDryVictoryLastRewardDate"; - if (keyId == KEY_AwardMultichampion) - return "KEY_AwardMultichampion"; - if (keyId == KEY_AwardMultichampionLastRewardDate) - return "KEY_AwardMultichampionLastRewardDate"; - if (keyId == KEY_AwardMad) - return "KEY_AwardMad"; - if (keyId == KEY_AwardMadLastRewardDate) - return "KEY_AwardMadLastRewardDate"; - if (keyId == KEY_AwardAchillesHeel) - return "KEY_AwardAchillesHeel"; - if (keyId == KEY_AwardAchillesHeelLastRewardDate) - return "KEY_AwardAchillesHeelLastRewardDate"; - if (keyId == KEY_AwardFasterThanBullets) - return "KEY_AwardFasterThanBullets"; - if (keyId == KEY_AwardFasterThanBulletsLastRewardDate) - return "KEY_AwardFasterThanBulletsLastRewardDate"; - if (keyId == KEY_AwardHarvestTime) - return "KEY_AwardHarvestTime"; - if (keyId == KEY_AwardHarvestTimeLastRewardDate) - return "KEY_AwardHarvestTimeLastRewardDate"; - if (keyId == KEY_AwardSkewer) - return "KEY_AwardSkewer"; - if (keyId == KEY_AwardSkewerLastRewardDate) - return "KEY_AwardSkewerLastRewardDate"; - if (keyId == KEY_AwardDoubleShotDoubleKill) - return "KEY_AwardDoubleShotDoubleKill"; - if (keyId == KEY_AwardDoubleShotDoubleKillLastRewardDate) - return "KEY_AwardDoubleShotDoubleKillLastRewardDate"; - if (keyId == KEY_AwardClimber) - return "KEY_AwardClimber"; - if (keyId == KEY_AwardClimberLastRewardDate) - return "KEY_AwardClimberLastRewardDate"; - if (keyId == KEY_AwardOpener) - return "KEY_AwardOpener"; - if (keyId == KEY_AwardOpenerLastRewardDate) - return "KEY_AwardOpenerLastRewardDate"; - if (keyId == KEY_AwardToughy) - return "KEY_AwardToughy"; - if (keyId == KEY_AwardToughyLastRewardDate) - return "KEY_AwardToughyLastRewardDate"; - if (keyId == KEY_AwardInvincibleFury) - return "KEY_AwardInvincibleFury"; - if (keyId == KEY_AwardInvincibleFuryLastRewardDate) - return "KEY_AwardInvincibleFuryLastRewardDate"; - if (keyId == KEY_AwardOculist) - return "KEY_AwardOculist"; - if (keyId == KEY_AwardOculistLastRewardDate) - return "KEY_AwardOculistLastRewardDate"; - if (keyId == KEY_AwardLightingReflexes) - return "KEY_AwardLightingReflexes"; - if (keyId == KEY_AwardLightingReflexesLastRewardDate) - return "KEY_AwardLightingReflexesLastRewardDate"; - if (keyId == KEY_AwardSprinterStopper) - return "KEY_AwardSprinterStopper"; - if (keyId == KEY_AwardSprinterStopperLastRewardDate) - return "KEY_AwardSprinterStopperLastRewardDate"; - if (keyId == KEY_AwardMarksMan) - return "KEY_AwardMarksMan"; - if (keyId == KEY_AwardMarksManLastRewardDate) - return "KEY_AwardMarksManLastRewardDate"; - if (keyId == KEY_AwardPeaceAmbassador) - return "KEY_AwardPeaceAmbassador"; - if (keyId == KEY_AwardPeaceAmbassadorLastRewardDate) - return "KEY_AwardPeaceAmbassadorLastRewardDate"; - if (keyId == KEY_AwardDeadlyAccuracy) - return "KEY_AwardDeadlyAccuracy"; - if (keyId == KEY_AwardDeadlyAccuracyLastRewardDate) - return "KEY_AwardDeadlyAccuracyLastRewardDate"; - if (keyId == KEY_AwardRemembrance) - return "KEY_AwardRemembrance"; - if (keyId == KEY_AwardRemembranceLastRewardDate) - return "KEY_AwardRemembranceLastRewardDate"; - if (keyId == KEY_AwardAvenger) - return "KEY_AwardAvenger"; - if (keyId == KEY_AwardAvengerLastRewardDate) - return "KEY_AwardAvengerLastRewardDate"; - if (keyId == KEY_AwardCherub) - return "KEY_AwardCherub"; - if (keyId == KEY_AwardCherubLastRewardDate) - return "KEY_AwardCherubLastRewardDate"; - if (keyId == KEY_AwardDignity) - return "KEY_AwardDignity"; - if (keyId == KEY_AwardDignityLastRewardDate) - return "KEY_AwardDignityLastRewardDate"; - if (keyId == KEY_AwardStalkerFlair) - return "KEY_AwardStalkerFlair"; - if (keyId == KEY_AwardStalkerFlairLastRewardDate) - return "KEY_AwardStalkerFlairLastRewardDate"; - if (keyId == KEY_AwardLucky) - return "KEY_AwardLucky"; - if (keyId == KEY_AwardLuckyLastRewardDate) - return "KEY_AwardLuckyLastRewardDate"; - if (keyId == KEY_AwardBlackList) - return "KEY_AwardBlackList"; - if (keyId == KEY_AwardBlackListLastRewardDate) - return "KEY_AwardBlackListLastRewardDate"; - if (keyId == KEY_AwardSilentDeath) - return "KEY_AwardSilentDeath"; - if (keyId == KEY_AwardSilentDeathLastRewardDate) - return "KEY_AwardSilentDeathLastRewardDate"; - if (keyId == KEY_PlayerName) - return "KEY_PlayerName"; - - return ""; -} - -int ATLAS_GET_STAT(char* statName) -{ - if (!statName) - return 0; - - if (!strcmp("STAT_AwardAchillesHeel", statName)) - return STAT_AwardAchillesHeel; - if (!strcmp("STAT_AwardAchillesHeelLastRewardDate", statName)) - return STAT_AwardAchillesHeelLastRewardDate; - if (!strcmp("STAT_AwardAvenger", statName)) - return STAT_AwardAvenger; - if (!strcmp("STAT_AwardAvengerLastRewardDate", statName)) - return STAT_AwardAvengerLastRewardDate; - if (!strcmp("STAT_AwardBlackList", statName)) - return STAT_AwardBlackList; - if (!strcmp("STAT_AwardBlackListLastRewardDate", statName)) - return STAT_AwardBlackListLastRewardDate; - if (!strcmp("STAT_AwardBlitzkrieg", statName)) - return STAT_AwardBlitzkrieg; - if (!strcmp("STAT_AwardBlitzkriegLastRewardDate", statName)) - return STAT_AwardBlitzkriegLastRewardDate; - if (!strcmp("STAT_AwardCherub", statName)) - return STAT_AwardCherub; - if (!strcmp("STAT_AwardCherubLastRewardDate", statName)) - return STAT_AwardCherubLastRewardDate; - if (!strcmp("STAT_AwardClimber", statName)) - return STAT_AwardClimber; - if (!strcmp("STAT_AwardClimberLastRewardDate", statName)) - return STAT_AwardClimberLastRewardDate; - if (!strcmp("STAT_AwardDeadlyAccuracy", statName)) - return STAT_AwardDeadlyAccuracy; - if (!strcmp("STAT_AwardDeadlyAccuracyLastRewardDate", statName)) - return STAT_AwardDeadlyAccuracyLastRewardDate; - if (!strcmp("STAT_AwardDignity", statName)) - return STAT_AwardDignity; - if (!strcmp("STAT_AwardDignityLastRewardDate", statName)) - return STAT_AwardDignityLastRewardDate; - if (!strcmp("STAT_AwardDoubleShotDoubleKill", statName)) - return STAT_AwardDoubleShotDoubleKill; - if (!strcmp("STAT_AwardDoubleShotDoubleKillLastRewardDate", statName)) - return STAT_AwardDoubleShotDoubleKillLastRewardDate; - if (!strcmp("STAT_AwardDryVictory", statName)) - return STAT_AwardDryVictory; - if (!strcmp("STAT_AwardDryVictoryLastRewardDate", statName)) - return STAT_AwardDryVictoryLastRewardDate; - if (!strcmp("STAT_AwardFasterThanBullets", statName)) - return STAT_AwardFasterThanBullets; - if (!strcmp("STAT_AwardFasterThanBulletsLastRewardDate", statName)) - return STAT_AwardFasterThanBulletsLastRewardDate; - if (!strcmp("STAT_AwardHarvestTime", statName)) - return STAT_AwardHarvestTime; - if (!strcmp("STAT_AwardHarvestTimeLastRewardDate", statName)) - return STAT_AwardHarvestTimeLastRewardDate; - if (!strcmp("STAT_AwardInvincibleFury", statName)) - return STAT_AwardInvincibleFury; - if (!strcmp("STAT_AwardInvincibleFuryLastRewardDate", statName)) - return STAT_AwardInvincibleFuryLastRewardDate; - if (!strcmp("STAT_AwardLightingReflexes", statName)) - return STAT_AwardLightingReflexes; - if (!strcmp("STAT_AwardLightingReflexesLastRewardDate", statName)) - return STAT_AwardLightingReflexesLastRewardDate; - if (!strcmp("STAT_AwardLucky", statName)) - return STAT_AwardLucky; - if (!strcmp("STAT_AwardLuckyLastRewardDate", statName)) - return STAT_AwardLuckyLastRewardDate; - if (!strcmp("STAT_AwardMad", statName)) - return STAT_AwardMad; - if (!strcmp("STAT_AwardMadLastRewardDate", statName)) - return STAT_AwardMadLastRewardDate; - if (!strcmp("STAT_AwardMarksman", statName)) - return STAT_AwardMarksman; - if (!strcmp("STAT_AwardMarksmanLastRewardDate", statName)) - return STAT_AwardMarksmanLastRewardDate; - if (!strcmp("STAT_AwardMasscare", statName)) - return STAT_AwardMasscare; - if (!strcmp("STAT_AwardMasscareLastRewardDate", statName)) - return STAT_AwardMasscareLastRewardDate; - if (!strcmp("STAT_AwardMultichampion", statName)) - return STAT_AwardMultichampion; - if (!strcmp("STAT_AwardMultichampionLastRewardDate", statName)) - return STAT_AwardMultichampionLastRewardDate; - if (!strcmp("STAT_AwardOculist", statName)) - return STAT_AwardOculist; - if (!strcmp("STAT_AwardOculistLastRewardDate", statName)) - return STAT_AwardOculistLastRewardDate; - if (!strcmp("STAT_AwardOpener", statName)) - return STAT_AwardOpener; - if (!strcmp("STAT_AwardOpenerLastRewardDate", statName)) - return STAT_AwardOpenerLastRewardDate; - if (!strcmp("STAT_AwardOwerwhelmingSuperiority", statName)) - return STAT_AwardOwerwhelmingSuperiority; - if (!strcmp("STAT_AwardOwerwhelmingSuperiorityLastRewardDate", statName)) - return STAT_AwardOwerwhelmingSuperiorityLastRewardDate; - if (!strcmp("STAT_AwardParanoia", statName)) - return STAT_AwardParanoia; - if (!strcmp("STAT_AwardParanoiaLastRewardDate", statName)) - return STAT_AwardParanoiaLastRewardDate; - if (!strcmp("STAT_AwardPeaceAmbassador", statName)) - return STAT_AwardPeaceAmbassador; - if (!strcmp("STAT_AwardPeaceAmbassadorLastRewardDate", statName)) - return STAT_AwardPeaceAmbassadorLastRewardDate; - if (!strcmp("STAT_AwardRemembrance", statName)) - return STAT_AwardRemembrance; - if (!strcmp("STAT_AwardRemembranceLastRewardDate", statName)) - return STAT_AwardRemembranceLastRewardDate; - if (!strcmp("STAT_AwardSilentDeath", statName)) - return STAT_AwardSilentDeath; - if (!strcmp("STAT_AwardSilentDeathLastRewardDate", statName)) - return STAT_AwardSilentDeathLastRewardDate; - if (!strcmp("STAT_AwardSkewer", statName)) - return STAT_AwardSkewer; - if (!strcmp("STAT_AwardSkewerLastRewardDate", statName)) - return STAT_AwardSkewerLastRewardDate; - if (!strcmp("STAT_AwardSprinterStopper", statName)) - return STAT_AwardSprinterStopper; - if (!strcmp("STAT_AwardSprinterStopperLastRewardDate", statName)) - return STAT_AwardSprinterStopperLastRewardDate; - if (!strcmp("STAT_AwardStalkerFlair", statName)) - return STAT_AwardStalkerFlair; - if (!strcmp("STAT_AwardStalkerFlairLastRewardDate", statName)) - return STAT_AwardStalkerFlairLastRewardDate; - if (!strcmp("STAT_AwardToughy", statName)) - return STAT_AwardToughy; - if (!strcmp("STAT_AwardToughyLastRewardDate", statName)) - return STAT_AwardToughyLastRewardDate; - if (!strcmp("STAT_BestScore_BackstabsKillsInRow", statName)) - return STAT_BestScore_BackstabsKillsInRow; - if (!strcmp("STAT_BestScore_BleedKillsInRow", statName)) - return STAT_BestScore_BleedKillsInRow; - if (!strcmp("STAT_BestScore_ExplosiveKillsInRow", statName)) - return STAT_BestScore_ExplosiveKillsInRow; - if (!strcmp("STAT_BestScore_EyeKillsInRow", statName)) - return STAT_BestScore_EyeKillsInRow; - if (!strcmp("STAT_BestScore_HeadshotsKillsInRow", statName)) - return STAT_BestScore_HeadshotsKillsInRow; - if (!strcmp("STAT_BestScore_KillsInRow", statName)) - return STAT_BestScore_KillsInRow; - if (!strcmp("STAT_BestScore_KnifeKillsInRow", statName)) - return STAT_BestScore_KnifeKillsInRow; - if (!strcmp("STAT_PlayerName", statName)) - return STAT_PlayerName; - - return 0; -} -char* ATLAS_GET_STAT_NAME(int statId) -{ - if (statId <= 0) - return ""; - - if (statId == STAT_AwardAchillesHeel) - return "STAT_AwardAchillesHeel"; - if (statId == STAT_AwardAchillesHeelLastRewardDate) - return "STAT_AwardAchillesHeelLastRewardDate"; - if (statId == STAT_AwardAvenger) - return "STAT_AwardAvenger"; - if (statId == STAT_AwardAvengerLastRewardDate) - return "STAT_AwardAvengerLastRewardDate"; - if (statId == STAT_AwardBlackList) - return "STAT_AwardBlackList"; - if (statId == STAT_AwardBlackListLastRewardDate) - return "STAT_AwardBlackListLastRewardDate"; - if (statId == STAT_AwardBlitzkrieg) - return "STAT_AwardBlitzkrieg"; - if (statId == STAT_AwardBlitzkriegLastRewardDate) - return "STAT_AwardBlitzkriegLastRewardDate"; - if (statId == STAT_AwardCherub) - return "STAT_AwardCherub"; - if (statId == STAT_AwardCherubLastRewardDate) - return "STAT_AwardCherubLastRewardDate"; - if (statId == STAT_AwardClimber) - return "STAT_AwardClimber"; - if (statId == STAT_AwardClimberLastRewardDate) - return "STAT_AwardClimberLastRewardDate"; - if (statId == STAT_AwardDeadlyAccuracy) - return "STAT_AwardDeadlyAccuracy"; - if (statId == STAT_AwardDeadlyAccuracyLastRewardDate) - return "STAT_AwardDeadlyAccuracyLastRewardDate"; - if (statId == STAT_AwardDignity) - return "STAT_AwardDignity"; - if (statId == STAT_AwardDignityLastRewardDate) - return "STAT_AwardDignityLastRewardDate"; - if (statId == STAT_AwardDoubleShotDoubleKill) - return "STAT_AwardDoubleShotDoubleKill"; - if (statId == STAT_AwardDoubleShotDoubleKillLastRewardDate) - return "STAT_AwardDoubleShotDoubleKillLastRewardDate"; - if (statId == STAT_AwardDryVictory) - return "STAT_AwardDryVictory"; - if (statId == STAT_AwardDryVictoryLastRewardDate) - return "STAT_AwardDryVictoryLastRewardDate"; - if (statId == STAT_AwardFasterThanBullets) - return "STAT_AwardFasterThanBullets"; - if (statId == STAT_AwardFasterThanBulletsLastRewardDate) - return "STAT_AwardFasterThanBulletsLastRewardDate"; - if (statId == STAT_AwardHarvestTime) - return "STAT_AwardHarvestTime"; - if (statId == STAT_AwardHarvestTimeLastRewardDate) - return "STAT_AwardHarvestTimeLastRewardDate"; - if (statId == STAT_AwardInvincibleFury) - return "STAT_AwardInvincibleFury"; - if (statId == STAT_AwardInvincibleFuryLastRewardDate) - return "STAT_AwardInvincibleFuryLastRewardDate"; - if (statId == STAT_AwardLightingReflexes) - return "STAT_AwardLightingReflexes"; - if (statId == STAT_AwardLightingReflexesLastRewardDate) - return "STAT_AwardLightingReflexesLastRewardDate"; - if (statId == STAT_AwardLucky) - return "STAT_AwardLucky"; - if (statId == STAT_AwardLuckyLastRewardDate) - return "STAT_AwardLuckyLastRewardDate"; - if (statId == STAT_AwardMad) - return "STAT_AwardMad"; - if (statId == STAT_AwardMadLastRewardDate) - return "STAT_AwardMadLastRewardDate"; - if (statId == STAT_AwardMarksman) - return "STAT_AwardMarksman"; - if (statId == STAT_AwardMarksmanLastRewardDate) - return "STAT_AwardMarksmanLastRewardDate"; - if (statId == STAT_AwardMasscare) - return "STAT_AwardMasscare"; - if (statId == STAT_AwardMasscareLastRewardDate) - return "STAT_AwardMasscareLastRewardDate"; - if (statId == STAT_AwardMultichampion) - return "STAT_AwardMultichampion"; - if (statId == STAT_AwardMultichampionLastRewardDate) - return "STAT_AwardMultichampionLastRewardDate"; - if (statId == STAT_AwardOculist) - return "STAT_AwardOculist"; - if (statId == STAT_AwardOculistLastRewardDate) - return "STAT_AwardOculistLastRewardDate"; - if (statId == STAT_AwardOpener) - return "STAT_AwardOpener"; - if (statId == STAT_AwardOpenerLastRewardDate) - return "STAT_AwardOpenerLastRewardDate"; - if (statId == STAT_AwardOwerwhelmingSuperiority) - return "STAT_AwardOwerwhelmingSuperiority"; - if (statId == STAT_AwardOwerwhelmingSuperiorityLastRewardDate) - return "STAT_AwardOwerwhelmingSuperiorityLastRewardDate"; - if (statId == STAT_AwardParanoia) - return "STAT_AwardParanoia"; - if (statId == STAT_AwardParanoiaLastRewardDate) - return "STAT_AwardParanoiaLastRewardDate"; - if (statId == STAT_AwardPeaceAmbassador) - return "STAT_AwardPeaceAmbassador"; - if (statId == STAT_AwardPeaceAmbassadorLastRewardDate) - return "STAT_AwardPeaceAmbassadorLastRewardDate"; - if (statId == STAT_AwardRemembrance) - return "STAT_AwardRemembrance"; - if (statId == STAT_AwardRemembranceLastRewardDate) - return "STAT_AwardRemembranceLastRewardDate"; - if (statId == STAT_AwardSilentDeath) - return "STAT_AwardSilentDeath"; - if (statId == STAT_AwardSilentDeathLastRewardDate) - return "STAT_AwardSilentDeathLastRewardDate"; - if (statId == STAT_AwardSkewer) - return "STAT_AwardSkewer"; - if (statId == STAT_AwardSkewerLastRewardDate) - return "STAT_AwardSkewerLastRewardDate"; - if (statId == STAT_AwardSprinterStopper) - return "STAT_AwardSprinterStopper"; - if (statId == STAT_AwardSprinterStopperLastRewardDate) - return "STAT_AwardSprinterStopperLastRewardDate"; - if (statId == STAT_AwardStalkerFlair) - return "STAT_AwardStalkerFlair"; - if (statId == STAT_AwardStalkerFlairLastRewardDate) - return "STAT_AwardStalkerFlairLastRewardDate"; - if (statId == STAT_AwardToughy) - return "STAT_AwardToughy"; - if (statId == STAT_AwardToughyLastRewardDate) - return "STAT_AwardToughyLastRewardDate"; - if (statId == STAT_BestScore_BackstabsKillsInRow) - return "STAT_BestScore_BackstabsKillsInRow"; - if (statId == STAT_BestScore_BleedKillsInRow) - return "STAT_BestScore_BleedKillsInRow"; - if (statId == STAT_BestScore_ExplosiveKillsInRow) - return "STAT_BestScore_ExplosiveKillsInRow"; - if (statId == STAT_BestScore_EyeKillsInRow) - return "STAT_BestScore_EyeKillsInRow"; - if (statId == STAT_BestScore_HeadshotsKillsInRow) - return "STAT_BestScore_HeadshotsKillsInRow"; - if (statId == STAT_BestScore_KillsInRow) - return "STAT_BestScore_KillsInRow"; - if (statId == STAT_BestScore_KnifeKillsInRow) - return "STAT_BestScore_KnifeKillsInRow"; - if (statId == STAT_PlayerName) - return "STAT_PlayerName"; - - return ""; -} - -int ATLAS_GET_STAT_PAGE_BY_ID(int statId) -{ - if (statId <= 0) - return 0; - - // PlayerStats - if (statId == 1 || statId == 2 || statId == 3 || statId == 4 || statId == 5 || statId == 6 || statId == 7 || - statId == 8 || statId == 9 || statId == 10 || statId == 11 || statId == 12 || statId == 13 || statId == 14 || - statId == 15 || statId == 16 || statId == 17 || statId == 18 || statId == 19 || statId == 20 || statId == 21 || - statId == 22 || statId == 23 || statId == 24 || statId == 25 || statId == 26 || statId == 27 || statId == 28 || - statId == 29 || statId == 30 || statId == 31 || statId == 32 || statId == 33 || statId == 34 || statId == 35 || - statId == 36 || statId == 37 || statId == 38 || statId == 39 || statId == 40 || statId == 41 || statId == 42 || - statId == 43 || statId == 44 || statId == 45 || statId == 46 || statId == 47 || statId == 48 || statId == 49 || - statId == 50 || statId == 51 || statId == 52 || statId == 53 || statId == 54 || statId == 55 || statId == 56 || - statId == 57 || statId == 58 || statId == 59 || statId == 60 || statId == 61 || statId == 62 || statId == 63 || - statId == 64 || statId == 65 || statId == 66 || statId == 67 || statId == 68) - return 1; - - return 0; -} - -int ATLAS_GET_STAT_PAGE_BY_NAME(char* statName) -{ - if (!statName) - return 0; - - // PlayerStats - if (!strcmp("STAT_AwardAchillesHeel", statName) || !strcmp("STAT_AwardAchillesHeelLastRewardDate", statName) || - !strcmp("STAT_AwardAvenger", statName) || !strcmp("STAT_AwardAvengerLastRewardDate", statName) || - !strcmp("STAT_AwardBlackList", statName) || !strcmp("STAT_AwardBlackListLastRewardDate", statName) || - !strcmp("STAT_AwardBlitzkrieg", statName) || !strcmp("STAT_AwardBlitzkriegLastRewardDate", statName) || - !strcmp("STAT_AwardCherub", statName) || !strcmp("STAT_AwardCherubLastRewardDate", statName) || - !strcmp("STAT_AwardClimber", statName) || !strcmp("STAT_AwardClimberLastRewardDate", statName) || - !strcmp("STAT_AwardDeadlyAccuracy", statName) || !strcmp("STAT_AwardDeadlyAccuracyLastRewardDate", statName) || - !strcmp("STAT_AwardDignity", statName) || !strcmp("STAT_AwardDignityLastRewardDate", statName) || - !strcmp("STAT_AwardDoubleShotDoubleKill", statName) || - !strcmp("STAT_AwardDoubleShotDoubleKillLastRewardDate", statName) || !strcmp("STAT_AwardDryVictory", statName) || - !strcmp("STAT_AwardDryVictoryLastRewardDate", statName) || !strcmp("STAT_AwardFasterThanBullets", statName) || - !strcmp("STAT_AwardFasterThanBulletsLastRewardDate", statName) || !strcmp("STAT_AwardHarvestTime", statName) || - !strcmp("STAT_AwardHarvestTimeLastRewardDate", statName) || !strcmp("STAT_AwardInvincibleFury", statName) || - !strcmp("STAT_AwardInvincibleFuryLastRewardDate", statName) || !strcmp("STAT_AwardLightingReflexes", statName) || - !strcmp("STAT_AwardLightingReflexesLastRewardDate", statName) || !strcmp("STAT_AwardLucky", statName) || - !strcmp("STAT_AwardLuckyLastRewardDate", statName) || !strcmp("STAT_AwardMad", statName) || - !strcmp("STAT_AwardMadLastRewardDate", statName) || !strcmp("STAT_AwardMarksman", statName) || - !strcmp("STAT_AwardMarksmanLastRewardDate", statName) || !strcmp("STAT_AwardMasscare", statName) || - !strcmp("STAT_AwardMasscareLastRewardDate", statName) || !strcmp("STAT_AwardMultichampion", statName) || - !strcmp("STAT_AwardMultichampionLastRewardDate", statName) || !strcmp("STAT_AwardOculist", statName) || - !strcmp("STAT_AwardOculistLastRewardDate", statName) || !strcmp("STAT_AwardOpener", statName) || - !strcmp("STAT_AwardOpenerLastRewardDate", statName) || !strcmp("STAT_AwardOwerwhelmingSuperiority", statName) || - !strcmp("STAT_AwardOwerwhelmingSuperiorityLastRewardDate", statName) || !strcmp("STAT_AwardParanoia", statName) || - !strcmp("STAT_AwardParanoiaLastRewardDate", statName) || !strcmp("STAT_AwardPeaceAmbassador", statName) || - !strcmp("STAT_AwardPeaceAmbassadorLastRewardDate", statName) || !strcmp("STAT_AwardRemembrance", statName) || - !strcmp("STAT_AwardRemembranceLastRewardDate", statName) || !strcmp("STAT_AwardSilentDeath", statName) || - !strcmp("STAT_AwardSilentDeathLastRewardDate", statName) || !strcmp("STAT_AwardSkewer", statName) || - !strcmp("STAT_AwardSkewerLastRewardDate", statName) || !strcmp("STAT_AwardSprinterStopper", statName) || - !strcmp("STAT_AwardSprinterStopperLastRewardDate", statName) || !strcmp("STAT_AwardStalkerFlair", statName) || - !strcmp("STAT_AwardStalkerFlairLastRewardDate", statName) || !strcmp("STAT_AwardToughy", statName) || - !strcmp("STAT_AwardToughyLastRewardDate", statName) || !strcmp("STAT_BestScore_BackstabsKillsInRow", statName) || - !strcmp("STAT_BestScore_BleedKillsInRow", statName) || !strcmp("STAT_BestScore_ExplosiveKillsInRow", statName) || - !strcmp("STAT_BestScore_EyeKillsInRow", statName) || !strcmp("STAT_BestScore_HeadshotsKillsInRow", statName) || - !strcmp("STAT_BestScore_KillsInRow", statName) || !strcmp("STAT_BestScore_KnifeKillsInRow", statName) || - !strcmp("STAT_PlayerName", statName)) - return 1; - - return 0; -} diff --git a/src/xrGame/atlas_stalkercoppc_v1.h b/src/xrGame/atlas_stalkercoppc_v1.h deleted file mode 100644 index 98d1431ac94..00000000000 --- a/src/xrGame/atlas_stalkercoppc_v1.h +++ /dev/null @@ -1,173 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// GameSpy ATLAS Competition System Header File -// -// NOTE: This is an auto-generated file, do not edit this file directly. -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _ATLAS_STALKERCOPPC_V1_H_ -#define _ATLAS_STALKERCOPPC_V1_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -extern int ATLAS_GET_KEY(char* keyName); -extern char* ATLAS_GET_KEY_NAME(int keyId); -extern int ATLAS_GET_STAT(char* statName); -extern char* ATLAS_GET_STAT_NAME(int statId); -extern int ATLAS_GET_STAT_PAGE_BY_ID(int statId); -extern int ATLAS_GET_STAT_PAGE_BY_NAME(char* statName); - -#define ATLAS_RULE_SET_VERSION 1 - -// KEYS -// Use these key ID's to report match data for your game. - -#define KEY_BestScore_KillsInRow 3 // [TYPE: int] [DESC: kills in row] -#define KEY_BestScore_KnifeKillsInRow 4 // [TYPE: int] [DESC: knife kills in row] -#define KEY_BestScore_BackstabsKillsInRow 5 // [TYPE: int] [DESC: knife backstabs kills in row] -#define KEY_BestScore_HeadshotsKillsInRow 6 // [TYPE: int] [DESC: headshots kills in row] -#define KEY_BestScore_EyeKillsInRow 7 // [TYPE: int] [DESC: eye kills in row] -#define KEY_BestScore_BleedKillsInRow 8 // [TYPE: int] [DESC: bleed kills in row] -#define KEY_BestScore_ExplosiveKillsInRow 9 // [TYPE: int] [DESC: explosive kills in row] -#define KEY_AwardMasscare 10 // [TYPE: int] -#define KEY_AwardMasscareLastRewardDate 11 // [TYPE: int] -#define KEY_AwardParanoia 12 // [TYPE: int] -#define KEY_AwardParanoiaLastRewardDate 13 // [TYPE: int] -#define KEY_AwardOverwhelmingSuperiority 14 // [TYPE: int] -#define KEY_AwardOverwhelmingSuperiorityLastRewardDate 15 // [TYPE: int] -#define KEY_AwardBlitzkrieg 16 // [TYPE: int] -#define KEY_AwardBlitzkriegLastRewardDate 17 // [TYPE: int] -#define KEY_AwardDryVictory 18 // [TYPE: int] -#define KEY_AwardDryVictoryLastRewardDate 19 // [TYPE: int] -#define KEY_AwardMultichampion 20 // [TYPE: int] -#define KEY_AwardMultichampionLastRewardDate 21 // [TYPE: int] -#define KEY_AwardMad 22 // [TYPE: int] -#define KEY_AwardMadLastRewardDate 23 // [TYPE: int] -#define KEY_AwardAchillesHeel 24 // [TYPE: int] -#define KEY_AwardAchillesHeelLastRewardDate 25 // [TYPE: int] -#define KEY_AwardFasterThanBullets 26 // [TYPE: int] -#define KEY_AwardFasterThanBulletsLastRewardDate 27 // [TYPE: int] -#define KEY_AwardHarvestTime 28 // [TYPE: int] -#define KEY_AwardHarvestTimeLastRewardDate 29 // [TYPE: int] -#define KEY_AwardSkewer 30 // [TYPE: int] -#define KEY_AwardSkewerLastRewardDate 31 // [TYPE: int] -#define KEY_AwardDoubleShotDoubleKill 32 // [TYPE: int] -#define KEY_AwardDoubleShotDoubleKillLastRewardDate 33 // [TYPE: int] -#define KEY_AwardClimber 34 // [TYPE: int] -#define KEY_AwardClimberLastRewardDate 35 // [TYPE: int] -#define KEY_AwardOpener 36 // [TYPE: int] -#define KEY_AwardOpenerLastRewardDate 37 // [TYPE: int] -#define KEY_AwardToughy 38 // [TYPE: int] -#define KEY_AwardToughyLastRewardDate 39 // [TYPE: int] -#define KEY_AwardInvincibleFury 40 // [TYPE: int] -#define KEY_AwardInvincibleFuryLastRewardDate 41 // [TYPE: int] -#define KEY_AwardOculist 42 // [TYPE: int] -#define KEY_AwardOculistLastRewardDate 43 // [TYPE: int] -#define KEY_AwardLightingReflexes 44 // [TYPE: int] -#define KEY_AwardLightingReflexesLastRewardDate 45 // [TYPE: int] -#define KEY_AwardSprinterStopper 46 // [TYPE: int] -#define KEY_AwardSprinterStopperLastRewardDate 47 // [TYPE: int] -#define KEY_AwardMarksMan 48 // [TYPE: int] -#define KEY_AwardMarksManLastRewardDate 49 // [TYPE: int] -#define KEY_AwardPeaceAmbassador 50 // [TYPE: int] -#define KEY_AwardPeaceAmbassadorLastRewardDate 51 // [TYPE: int] -#define KEY_AwardDeadlyAccuracy 52 // [TYPE: int] -#define KEY_AwardDeadlyAccuracyLastRewardDate 53 // [TYPE: int] -#define KEY_AwardRemembrance 54 // [TYPE: int] -#define KEY_AwardRemembranceLastRewardDate 55 // [TYPE: int] -#define KEY_AwardAvenger 56 // [TYPE: int] -#define KEY_AwardAvengerLastRewardDate 57 // [TYPE: int] -#define KEY_AwardCherub 58 // [TYPE: int] -#define KEY_AwardCherubLastRewardDate 59 // [TYPE: int] -#define KEY_AwardDignity 60 // [TYPE: int] -#define KEY_AwardDignityLastRewardDate 61 // [TYPE: int] -#define KEY_AwardStalkerFlair 62 // [TYPE: int] -#define KEY_AwardStalkerFlairLastRewardDate 63 // [TYPE: int] -#define KEY_AwardLucky 64 // [TYPE: int] -#define KEY_AwardLuckyLastRewardDate 65 // [TYPE: int] -#define KEY_AwardBlackList 66 // [TYPE: int] -#define KEY_AwardBlackListLastRewardDate 67 // [TYPE: int] -#define KEY_AwardSilentDeath 68 // [TYPE: int] -#define KEY_AwardSilentDeathLastRewardDate 69 // [TYPE: int] -#define KEY_PlayerName 70 // [TYPE: string] - -/////////////////////////////////////////////////////////////////////////////// - -// STATS -// Use these stat ID's to query aggregate statistics for your game. - -#define STAT_AwardAchillesHeel 1 // [TYPE: int] -#define STAT_AwardAchillesHeelLastRewardDate 2 // [TYPE: int] -#define STAT_AwardAvenger 3 // [TYPE: int] -#define STAT_AwardAvengerLastRewardDate 4 // [TYPE: int] -#define STAT_AwardBlackList 5 // [TYPE: int] -#define STAT_AwardBlackListLastRewardDate 6 // [TYPE: int] -#define STAT_AwardBlitzkrieg 7 // [TYPE: int] -#define STAT_AwardBlitzkriegLastRewardDate 8 // [TYPE: int] -#define STAT_AwardCherub 9 // [TYPE: int] -#define STAT_AwardCherubLastRewardDate 10 // [TYPE: int] -#define STAT_AwardClimber 11 // [TYPE: int] -#define STAT_AwardClimberLastRewardDate 12 // [TYPE: int] -#define STAT_AwardDeadlyAccuracy 13 // [TYPE: int] -#define STAT_AwardDeadlyAccuracyLastRewardDate 14 // [TYPE: int] -#define STAT_AwardDignity 15 // [TYPE: int] -#define STAT_AwardDignityLastRewardDate 16 // [TYPE: int] -#define STAT_AwardDoubleShotDoubleKill 17 // [TYPE: int] -#define STAT_AwardDoubleShotDoubleKillLastRewardDate 18 // [TYPE: int] -#define STAT_AwardDryVictory 19 // [TYPE: int] -#define STAT_AwardDryVictoryLastRewardDate 20 // [TYPE: int] -#define STAT_AwardFasterThanBullets 21 // [TYPE: int] -#define STAT_AwardFasterThanBulletsLastRewardDate 22 // [TYPE: int] -#define STAT_AwardHarvestTime 23 // [TYPE: int] -#define STAT_AwardHarvestTimeLastRewardDate 24 // [TYPE: int] -#define STAT_AwardInvincibleFury 25 // [TYPE: int] -#define STAT_AwardInvincibleFuryLastRewardDate 26 // [TYPE: int] -#define STAT_AwardLightingReflexes 27 // [TYPE: int] -#define STAT_AwardLightingReflexesLastRewardDate 28 // [TYPE: int] -#define STAT_AwardLucky 29 // [TYPE: int] -#define STAT_AwardLuckyLastRewardDate 30 // [TYPE: int] -#define STAT_AwardMad 31 // [TYPE: int] -#define STAT_AwardMadLastRewardDate 32 // [TYPE: int] -#define STAT_AwardMarksman 33 // [TYPE: int] -#define STAT_AwardMarksmanLastRewardDate 34 // [TYPE: int] -#define STAT_AwardMasscare 35 // [TYPE: int] -#define STAT_AwardMasscareLastRewardDate 36 // [TYPE: int] -#define STAT_AwardMultichampion 37 // [TYPE: int] -#define STAT_AwardMultichampionLastRewardDate 38 // [TYPE: int] -#define STAT_AwardOculist 39 // [TYPE: int] -#define STAT_AwardOculistLastRewardDate 40 // [TYPE: int] -#define STAT_AwardOpener 41 // [TYPE: int] -#define STAT_AwardOpenerLastRewardDate 42 // [TYPE: int] -#define STAT_AwardOwerwhelmingSuperiority 43 // [TYPE: int] -#define STAT_AwardOwerwhelmingSuperiorityLastRewardDate 44 // [TYPE: int] -#define STAT_AwardParanoia 45 // [TYPE: int] -#define STAT_AwardParanoiaLastRewardDate 46 // [TYPE: int] -#define STAT_AwardPeaceAmbassador 47 // [TYPE: int] -#define STAT_AwardPeaceAmbassadorLastRewardDate 48 // [TYPE: int] -#define STAT_AwardRemembrance 49 // [TYPE: int] -#define STAT_AwardRemembranceLastRewardDate 50 // [TYPE: int] -#define STAT_AwardSilentDeath 51 // [TYPE: int] -#define STAT_AwardSilentDeathLastRewardDate 52 // [TYPE: int] -#define STAT_AwardSkewer 53 // [TYPE: int] -#define STAT_AwardSkewerLastRewardDate 54 // [TYPE: int] -#define STAT_AwardSprinterStopper 55 // [TYPE: int] -#define STAT_AwardSprinterStopperLastRewardDate 56 // [TYPE: int] -#define STAT_AwardStalkerFlair 57 // [TYPE: int] -#define STAT_AwardStalkerFlairLastRewardDate 58 // [TYPE: int] -#define STAT_AwardToughy 59 // [TYPE: int] -#define STAT_AwardToughyLastRewardDate 60 // [TYPE: int] -#define STAT_BestScore_BackstabsKillsInRow 61 // [TYPE: int] -#define STAT_BestScore_BleedKillsInRow 62 // [TYPE: int] -#define STAT_BestScore_ExplosiveKillsInRow 63 // [TYPE: int] -#define STAT_BestScore_EyeKillsInRow 64 // [TYPE: int] -#define STAT_BestScore_HeadshotsKillsInRow 65 // [TYPE: int] -#define STAT_BestScore_KillsInRow 66 // [TYPE: int] -#define STAT_BestScore_KnifeKillsInRow 67 // [TYPE: int] -#define STAT_PlayerName 68 // [TYPE: string] [DESC: contains players name] - -#ifdef __cplusplus -} -#endif - -#endif // _ATLAS_STALKERCOPPC_V1_H_ diff --git a/src/xrGame/atlas_stalkercs_v1.c b/src/xrGame/atlas_stalkercs_v1.c deleted file mode 100644 index 6553b98a925..00000000000 --- a/src/xrGame/atlas_stalkercs_v1.c +++ /dev/null @@ -1,648 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// GameSpy ATLAS Competition System Source File -// -// NOTE: This is an auto-generated file, do not edit this file directly. -/////////////////////////////////////////////////////////////////////////////// - -#include -#include "atlas_stalkercs_v1.h" - -int atlas_rule_set_version = 1; - -int ATLAS_GET_KEY(char* keyName) -{ - if (!keyName) - return 0; - - if (!strcmp("KEY_AwardDeadlyAccuracyLastRewardDate", keyName)) - return KEY_AwardDeadlyAccuracyLastRewardDate; - if (!strcmp("KEY_AwardRemembrance", keyName)) - return KEY_AwardRemembrance; - if (!strcmp("KEY_AwardRemembranceLastRewardDate", keyName)) - return KEY_AwardRemembranceLastRewardDate; - if (!strcmp("KEY_AwardAvenger", keyName)) - return KEY_AwardAvenger; - if (!strcmp("KEY_AwardAvengerLastRewardDate", keyName)) - return KEY_AwardAvengerLastRewardDate; - if (!strcmp("KEY_AwardCherub", keyName)) - return KEY_AwardCherub; - if (!strcmp("KEY_AwardCherubLastRewardDate", keyName)) - return KEY_AwardCherubLastRewardDate; - if (!strcmp("KEY_AwardDignity", keyName)) - return KEY_AwardDignity; - if (!strcmp("KEY_AwardDignityLastRewardDate", keyName)) - return KEY_AwardDignityLastRewardDate; - if (!strcmp("KEY_AwardStalkerFlair", keyName)) - return KEY_AwardStalkerFlair; - if (!strcmp("KEY_AwardStalkerFlairLastRewardDate", keyName)) - return KEY_AwardStalkerFlairLastRewardDate; - if (!strcmp("KEY_AwardLucky", keyName)) - return KEY_AwardLucky; - if (!strcmp("KEY_AwardLuckyLastRewardDate", keyName)) - return KEY_AwardLuckyLastRewardDate; - if (!strcmp("KEY_AwardBlackList", keyName)) - return KEY_AwardBlackList; - if (!strcmp("KEY_AwardBlackListLastRewardDate", keyName)) - return KEY_AwardBlackListLastRewardDate; - if (!strcmp("KEY_AwardSilentDeath", keyName)) - return KEY_AwardSilentDeath; - if (!strcmp("KEY_AwardSilentDeathLastRewardDate", keyName)) - return KEY_AwardSilentDeathLastRewardDate; - if (!strcmp("KEY_AwardMasscare", keyName)) - return KEY_AwardMasscare; - if (!strcmp("KEY_AwardMasscareLastRewardDate", keyName)) - return KEY_AwardMasscareLastRewardDate; - if (!strcmp("KEY_AwardParanoia", keyName)) - return KEY_AwardParanoia; - if (!strcmp("KEY_AwardParanoiaLastRewardDate", keyName)) - return KEY_AwardParanoiaLastRewardDate; - if (!strcmp("KEY_AwardOverwhelmingSuperiority", keyName)) - return KEY_AwardOverwhelmingSuperiority; - if (!strcmp("KEY_AwardOverwhelmingSuperiorityLastRewardDate", keyName)) - return KEY_AwardOverwhelmingSuperiorityLastRewardDate; - if (!strcmp("KEY_AwardBlitzkrieg", keyName)) - return KEY_AwardBlitzkrieg; - if (!strcmp("KEY_AwardBlitzkriegLastRewardDate", keyName)) - return KEY_AwardBlitzkriegLastRewardDate; - if (!strcmp("KEY_AwardDryVictory", keyName)) - return KEY_AwardDryVictory; - if (!strcmp("KEY_AwardDryVictoryLastRewardDate", keyName)) - return KEY_AwardDryVictoryLastRewardDate; - if (!strcmp("KEY_AwardMultichampion", keyName)) - return KEY_AwardMultichampion; - if (!strcmp("KEY_AwardMultichampionLastRewardDate", keyName)) - return KEY_AwardMultichampionLastRewardDate; - if (!strcmp("KEY_AwardMad", keyName)) - return KEY_AwardMad; - if (!strcmp("KEY_AwardMadLastRewardDate", keyName)) - return KEY_AwardMadLastRewardDate; - if (!strcmp("KEY_AwardAchillesHeel", keyName)) - return KEY_AwardAchillesHeel; - if (!strcmp("KEY_AwardAchillesHeelLastRewardDate", keyName)) - return KEY_AwardAchillesHeelLastRewardDate; - if (!strcmp("KEY_AwardFasterThanBullets", keyName)) - return KEY_AwardFasterThanBullets; - if (!strcmp("KEY_AwardFasterThanBulletsLastRewardDate", keyName)) - return KEY_AwardFasterThanBulletsLastRewardDate; - if (!strcmp("KEY_AwardHarvestTime", keyName)) - return KEY_AwardHarvestTime; - if (!strcmp("KEY_AwardHarvestTimeLastRewardDate", keyName)) - return KEY_AwardHarvestTimeLastRewardDate; - if (!strcmp("KEY_AwardSkewer", keyName)) - return KEY_AwardSkewer; - if (!strcmp("KEY_AwardSkewerLastRewardDate", keyName)) - return KEY_AwardSkewerLastRewardDate; - if (!strcmp("KEY_AwardDoubleShotDoubleKill", keyName)) - return KEY_AwardDoubleShotDoubleKill; - if (!strcmp("KEY_AwardDoubleShotDoubleKillLastRewardDate", keyName)) - return KEY_AwardDoubleShotDoubleKillLastRewardDate; - if (!strcmp("KEY_AwardClimber", keyName)) - return KEY_AwardClimber; - if (!strcmp("KEY_AwardClimberLastRewardDate", keyName)) - return KEY_AwardClimberLastRewardDate; - if (!strcmp("KEY_AwardOpener", keyName)) - return KEY_AwardOpener; - if (!strcmp("KEY_AwardOpenerLastRewardDate", keyName)) - return KEY_AwardOpenerLastRewardDate; - if (!strcmp("KEY_AwardToughy", keyName)) - return KEY_AwardToughy; - if (!strcmp("KEY_AwardToughyLastRewardDate", keyName)) - return KEY_AwardToughyLastRewardDate; - if (!strcmp("KEY_AwardInvincibleFury", keyName)) - return KEY_AwardInvincibleFury; - if (!strcmp("KEY_AwardInvincibleFuryLastRewardDate", keyName)) - return KEY_AwardInvincibleFuryLastRewardDate; - if (!strcmp("KEY_AwardOculist", keyName)) - return KEY_AwardOculist; - if (!strcmp("KEY_AwardOculistLastRewardDate", keyName)) - return KEY_AwardOculistLastRewardDate; - if (!strcmp("KEY_AwardLightingReflexes", keyName)) - return KEY_AwardLightingReflexes; - if (!strcmp("KEY_AwardLightingReflexesLastRewardDate", keyName)) - return KEY_AwardLightingReflexesLastRewardDate; - if (!strcmp("KEY_AwardSprinterStopper", keyName)) - return KEY_AwardSprinterStopper; - if (!strcmp("KEY_AwardSprinterStopperLastRewardDate", keyName)) - return KEY_AwardSprinterStopperLastRewardDate; - if (!strcmp("KEY_AwardMarksMan", keyName)) - return KEY_AwardMarksMan; - if (!strcmp("KEY_AwardMarksManLastRewardDate", keyName)) - return KEY_AwardMarksManLastRewardDate; - if (!strcmp("KEY_AwardPeaceAmbassador", keyName)) - return KEY_AwardPeaceAmbassador; - if (!strcmp("KEY_AwardPeaceAmbassadorLastRewardDate", keyName)) - return KEY_AwardPeaceAmbassadorLastRewardDate; - if (!strcmp("KEY_AwardDeadlyAccuracy", keyName)) - return KEY_AwardDeadlyAccuracy; - if (!strcmp("KEY_BestScore_KillsInRow", keyName)) - return KEY_BestScore_KillsInRow; - if (!strcmp("KEY_BestScore_KnifeKillsInRow", keyName)) - return KEY_BestScore_KnifeKillsInRow; - if (!strcmp("KEY_BestScore_BackstabsKillsInRow", keyName)) - return KEY_BestScore_BackstabsKillsInRow; - if (!strcmp("KEY_BestScore_HeadshotsKillsInRow", keyName)) - return KEY_BestScore_HeadshotsKillsInRow; - if (!strcmp("KEY_BestScore_EyeKillsInRow", keyName)) - return KEY_BestScore_EyeKillsInRow; - if (!strcmp("KEY_BestScore_BleedKillsInRow", keyName)) - return KEY_BestScore_BleedKillsInRow; - if (!strcmp("KEY_BestScore_ExplosiveKillsInRow", keyName)) - return KEY_BestScore_ExplosiveKillsInRow; - - return 0; -} - -char* ATLAS_GET_KEY_NAME(int keyId) -{ - if (keyId <= 0) - return ""; - - if (keyId == KEY_AwardDeadlyAccuracyLastRewardDate) - return "KEY_AwardDeadlyAccuracyLastRewardDate"; - if (keyId == KEY_AwardRemembrance) - return "KEY_AwardRemembrance"; - if (keyId == KEY_AwardRemembranceLastRewardDate) - return "KEY_AwardRemembranceLastRewardDate"; - if (keyId == KEY_AwardAvenger) - return "KEY_AwardAvenger"; - if (keyId == KEY_AwardAvengerLastRewardDate) - return "KEY_AwardAvengerLastRewardDate"; - if (keyId == KEY_AwardCherub) - return "KEY_AwardCherub"; - if (keyId == KEY_AwardCherubLastRewardDate) - return "KEY_AwardCherubLastRewardDate"; - if (keyId == KEY_AwardDignity) - return "KEY_AwardDignity"; - if (keyId == KEY_AwardDignityLastRewardDate) - return "KEY_AwardDignityLastRewardDate"; - if (keyId == KEY_AwardStalkerFlair) - return "KEY_AwardStalkerFlair"; - if (keyId == KEY_AwardStalkerFlairLastRewardDate) - return "KEY_AwardStalkerFlairLastRewardDate"; - if (keyId == KEY_AwardLucky) - return "KEY_AwardLucky"; - if (keyId == KEY_AwardLuckyLastRewardDate) - return "KEY_AwardLuckyLastRewardDate"; - if (keyId == KEY_AwardBlackList) - return "KEY_AwardBlackList"; - if (keyId == KEY_AwardBlackListLastRewardDate) - return "KEY_AwardBlackListLastRewardDate"; - if (keyId == KEY_AwardSilentDeath) - return "KEY_AwardSilentDeath"; - if (keyId == KEY_AwardSilentDeathLastRewardDate) - return "KEY_AwardSilentDeathLastRewardDate"; - if (keyId == KEY_AwardMasscare) - return "KEY_AwardMasscare"; - if (keyId == KEY_AwardMasscareLastRewardDate) - return "KEY_AwardMasscareLastRewardDate"; - if (keyId == KEY_AwardParanoia) - return "KEY_AwardParanoia"; - if (keyId == KEY_AwardParanoiaLastRewardDate) - return "KEY_AwardParanoiaLastRewardDate"; - if (keyId == KEY_AwardOverwhelmingSuperiority) - return "KEY_AwardOverwhelmingSuperiority"; - if (keyId == KEY_AwardOverwhelmingSuperiorityLastRewardDate) - return "KEY_AwardOverwhelmingSuperiorityLastRewardDate"; - if (keyId == KEY_AwardBlitzkrieg) - return "KEY_AwardBlitzkrieg"; - if (keyId == KEY_AwardBlitzkriegLastRewardDate) - return "KEY_AwardBlitzkriegLastRewardDate"; - if (keyId == KEY_AwardDryVictory) - return "KEY_AwardDryVictory"; - if (keyId == KEY_AwardDryVictoryLastRewardDate) - return "KEY_AwardDryVictoryLastRewardDate"; - if (keyId == KEY_AwardMultichampion) - return "KEY_AwardMultichampion"; - if (keyId == KEY_AwardMultichampionLastRewardDate) - return "KEY_AwardMultichampionLastRewardDate"; - if (keyId == KEY_AwardMad) - return "KEY_AwardMad"; - if (keyId == KEY_AwardMadLastRewardDate) - return "KEY_AwardMadLastRewardDate"; - if (keyId == KEY_AwardAchillesHeel) - return "KEY_AwardAchillesHeel"; - if (keyId == KEY_AwardAchillesHeelLastRewardDate) - return "KEY_AwardAchillesHeelLastRewardDate"; - if (keyId == KEY_AwardFasterThanBullets) - return "KEY_AwardFasterThanBullets"; - if (keyId == KEY_AwardFasterThanBulletsLastRewardDate) - return "KEY_AwardFasterThanBulletsLastRewardDate"; - if (keyId == KEY_AwardHarvestTime) - return "KEY_AwardHarvestTime"; - if (keyId == KEY_AwardHarvestTimeLastRewardDate) - return "KEY_AwardHarvestTimeLastRewardDate"; - if (keyId == KEY_AwardSkewer) - return "KEY_AwardSkewer"; - if (keyId == KEY_AwardSkewerLastRewardDate) - return "KEY_AwardSkewerLastRewardDate"; - if (keyId == KEY_AwardDoubleShotDoubleKill) - return "KEY_AwardDoubleShotDoubleKill"; - if (keyId == KEY_AwardDoubleShotDoubleKillLastRewardDate) - return "KEY_AwardDoubleShotDoubleKillLastRewardDate"; - if (keyId == KEY_AwardClimber) - return "KEY_AwardClimber"; - if (keyId == KEY_AwardClimberLastRewardDate) - return "KEY_AwardClimberLastRewardDate"; - if (keyId == KEY_AwardOpener) - return "KEY_AwardOpener"; - if (keyId == KEY_AwardOpenerLastRewardDate) - return "KEY_AwardOpenerLastRewardDate"; - if (keyId == KEY_AwardToughy) - return "KEY_AwardToughy"; - if (keyId == KEY_AwardToughyLastRewardDate) - return "KEY_AwardToughyLastRewardDate"; - if (keyId == KEY_AwardInvincibleFury) - return "KEY_AwardInvincibleFury"; - if (keyId == KEY_AwardInvincibleFuryLastRewardDate) - return "KEY_AwardInvincibleFuryLastRewardDate"; - if (keyId == KEY_AwardOculist) - return "KEY_AwardOculist"; - if (keyId == KEY_AwardOculistLastRewardDate) - return "KEY_AwardOculistLastRewardDate"; - if (keyId == KEY_AwardLightingReflexes) - return "KEY_AwardLightingReflexes"; - if (keyId == KEY_AwardLightingReflexesLastRewardDate) - return "KEY_AwardLightingReflexesLastRewardDate"; - if (keyId == KEY_AwardSprinterStopper) - return "KEY_AwardSprinterStopper"; - if (keyId == KEY_AwardSprinterStopperLastRewardDate) - return "KEY_AwardSprinterStopperLastRewardDate"; - if (keyId == KEY_AwardMarksMan) - return "KEY_AwardMarksMan"; - if (keyId == KEY_AwardMarksManLastRewardDate) - return "KEY_AwardMarksManLastRewardDate"; - if (keyId == KEY_AwardPeaceAmbassador) - return "KEY_AwardPeaceAmbassador"; - if (keyId == KEY_AwardPeaceAmbassadorLastRewardDate) - return "KEY_AwardPeaceAmbassadorLastRewardDate"; - if (keyId == KEY_AwardDeadlyAccuracy) - return "KEY_AwardDeadlyAccuracy"; - if (keyId == KEY_BestScore_KillsInRow) - return "KEY_BestScore_KillsInRow"; - if (keyId == KEY_BestScore_KnifeKillsInRow) - return "KEY_BestScore_KnifeKillsInRow"; - if (keyId == KEY_BestScore_BackstabsKillsInRow) - return "KEY_BestScore_BackstabsKillsInRow"; - if (keyId == KEY_BestScore_HeadshotsKillsInRow) - return "KEY_BestScore_HeadshotsKillsInRow"; - if (keyId == KEY_BestScore_EyeKillsInRow) - return "KEY_BestScore_EyeKillsInRow"; - if (keyId == KEY_BestScore_BleedKillsInRow) - return "KEY_BestScore_BleedKillsInRow"; - if (keyId == KEY_BestScore_ExplosiveKillsInRow) - return "KEY_BestScore_ExplosiveKillsInRow"; - - return ""; -} - -int ATLAS_GET_STAT(char* statName) -{ - if (!statName) - return 0; - - if (!strcmp("STAT_AwardAchillesHeel", statName)) - return STAT_AwardAchillesHeel; - if (!strcmp("STAT_AwardAchillesHeelLastRewardDate", statName)) - return STAT_AwardAchillesHeelLastRewardDate; - if (!strcmp("STAT_AwardAvenger", statName)) - return STAT_AwardAvenger; - if (!strcmp("STAT_AwardAvengerLastRewardDate", statName)) - return STAT_AwardAvengerLastRewardDate; - if (!strcmp("STAT_AwardBlackList", statName)) - return STAT_AwardBlackList; - if (!strcmp("STAT_AwardBlackListLastRewardDate", statName)) - return STAT_AwardBlackListLastRewardDate; - if (!strcmp("STAT_AwardBlitzkrieg", statName)) - return STAT_AwardBlitzkrieg; - if (!strcmp("STAT_AwardBlitzkriegLastRewardDate", statName)) - return STAT_AwardBlitzkriegLastRewardDate; - if (!strcmp("STAT_AwardCherub", statName)) - return STAT_AwardCherub; - if (!strcmp("STAT_AwardCherubLastRewardDate", statName)) - return STAT_AwardCherubLastRewardDate; - if (!strcmp("STAT_AwardClimber", statName)) - return STAT_AwardClimber; - if (!strcmp("STAT_AwardClimberLastRewardDate", statName)) - return STAT_AwardClimberLastRewardDate; - if (!strcmp("STAT_AwardDeadlyAccuracy", statName)) - return STAT_AwardDeadlyAccuracy; - if (!strcmp("STAT_AwardDeadlyAccuracyLastRewardDate", statName)) - return STAT_AwardDeadlyAccuracyLastRewardDate; - if (!strcmp("STAT_AwardDignity", statName)) - return STAT_AwardDignity; - if (!strcmp("STAT_AwardDignityLastRewardDate", statName)) - return STAT_AwardDignityLastRewardDate; - if (!strcmp("STAT_AwardDoubleShotDoubleKill", statName)) - return STAT_AwardDoubleShotDoubleKill; - if (!strcmp("STAT_AwardDoubleShotDoubleKillLastRewardDate", statName)) - return STAT_AwardDoubleShotDoubleKillLastRewardDate; - if (!strcmp("STAT_AwardDryVictory", statName)) - return STAT_AwardDryVictory; - if (!strcmp("STAT_AwardDryVictoryLastRewardDate", statName)) - return STAT_AwardDryVictoryLastRewardDate; - if (!strcmp("STAT_AwardFasterThanBullets", statName)) - return STAT_AwardFasterThanBullets; - if (!strcmp("STAT_AwardFasterThanBulletsLastRewardDate", statName)) - return STAT_AwardFasterThanBulletsLastRewardDate; - if (!strcmp("STAT_AwardHarvestTime", statName)) - return STAT_AwardHarvestTime; - if (!strcmp("STAT_AwardHarvestTimeLastRewardDate", statName)) - return STAT_AwardHarvestTimeLastRewardDate; - if (!strcmp("STAT_AwardInvincibleFury", statName)) - return STAT_AwardInvincibleFury; - if (!strcmp("STAT_AwardInvincibleFuryLastRewardDate", statName)) - return STAT_AwardInvincibleFuryLastRewardDate; - if (!strcmp("STAT_AwardLightingReflexes", statName)) - return STAT_AwardLightingReflexes; - if (!strcmp("STAT_AwardLightingReflexesLastRewardDate", statName)) - return STAT_AwardLightingReflexesLastRewardDate; - if (!strcmp("STAT_AwardLucky", statName)) - return STAT_AwardLucky; - if (!strcmp("STAT_AwardLuckyLastRewardDate", statName)) - return STAT_AwardLuckyLastRewardDate; - if (!strcmp("STAT_AwardMad", statName)) - return STAT_AwardMad; - if (!strcmp("STAT_AwardMadLastRewardDate", statName)) - return STAT_AwardMadLastRewardDate; - if (!strcmp("STAT_AwardMarksman", statName)) - return STAT_AwardMarksman; - if (!strcmp("STAT_AwardMarksmanLastRewardDate", statName)) - return STAT_AwardMarksmanLastRewardDate; - if (!strcmp("STAT_AwardMasscare", statName)) - return STAT_AwardMasscare; - if (!strcmp("STAT_AwardMasscareLastRewardDate", statName)) - return STAT_AwardMasscareLastRewardDate; - if (!strcmp("STAT_AwardMultichampion", statName)) - return STAT_AwardMultichampion; - if (!strcmp("STAT_AwardMultichampionLastRewardDate", statName)) - return STAT_AwardMultichampionLastRewardDate; - if (!strcmp("STAT_AwardOculist", statName)) - return STAT_AwardOculist; - if (!strcmp("STAT_AwardOculistLastRewardDate", statName)) - return STAT_AwardOculistLastRewardDate; - if (!strcmp("STAT_AwardOpener", statName)) - return STAT_AwardOpener; - if (!strcmp("STAT_AwardOpenerLastRewardDate", statName)) - return STAT_AwardOpenerLastRewardDate; - if (!strcmp("STAT_AwardOwerwhelmingSuperiority", statName)) - return STAT_AwardOwerwhelmingSuperiority; - if (!strcmp("STAT_AwardOwerwhelmingSuperiorityLastRewardDate", statName)) - return STAT_AwardOwerwhelmingSuperiorityLastRewardDate; - if (!strcmp("STAT_AwardParanoia", statName)) - return STAT_AwardParanoia; - if (!strcmp("STAT_AwardParanoiaLastRewardDate", statName)) - return STAT_AwardParanoiaLastRewardDate; - if (!strcmp("STAT_AwardPeaceAmbassador", statName)) - return STAT_AwardPeaceAmbassador; - if (!strcmp("STAT_AwardPeaceAmbassadorLastRewardDate", statName)) - return STAT_AwardPeaceAmbassadorLastRewardDate; - if (!strcmp("STAT_AwardRemembrance", statName)) - return STAT_AwardRemembrance; - if (!strcmp("STAT_AwardRemembranceLastRewardDate", statName)) - return STAT_AwardRemembranceLastRewardDate; - if (!strcmp("STAT_AwardSilentDeath", statName)) - return STAT_AwardSilentDeath; - if (!strcmp("STAT_AwardSilentDeathLastRewardDate", statName)) - return STAT_AwardSilentDeathLastRewardDate; - if (!strcmp("STAT_AwardSkewer", statName)) - return STAT_AwardSkewer; - if (!strcmp("STAT_AwardSkewerLastRewardDate", statName)) - return STAT_AwardSkewerLastRewardDate; - if (!strcmp("STAT_AwardSprinterStopper", statName)) - return STAT_AwardSprinterStopper; - if (!strcmp("STAT_AwardSprinterStopperLastRewardDate", statName)) - return STAT_AwardSprinterStopperLastRewardDate; - if (!strcmp("STAT_AwardStalkerFlair", statName)) - return STAT_AwardStalkerFlair; - if (!strcmp("STAT_AwardStalkerFlairLastRewardDate", statName)) - return STAT_AwardStalkerFlairLastRewardDate; - if (!strcmp("STAT_AwardToughy", statName)) - return STAT_AwardToughy; - if (!strcmp("STAT_AwardToughyLastRewardDate", statName)) - return STAT_AwardToughyLastRewardDate; - if (!strcmp("STAT_BestScore_BackstabsKillsInRow", statName)) - return STAT_BestScore_BackstabsKillsInRow; - if (!strcmp("STAT_BestScore_BleedKillsInRow", statName)) - return STAT_BestScore_BleedKillsInRow; - if (!strcmp("STAT_BestScore_ExplosiveKillsInRow", statName)) - return STAT_BestScore_ExplosiveKillsInRow; - if (!strcmp("STAT_BestScore_EyeKillsInRow", statName)) - return STAT_BestScore_EyeKillsInRow; - if (!strcmp("STAT_BestScore_HeadshotsKillsInRow", statName)) - return STAT_BestScore_HeadshotsKillsInRow; - if (!strcmp("STAT_BestScore_KillsInRow", statName)) - return STAT_BestScore_KillsInRow; - if (!strcmp("STAT_BestScore_KnifeKillsInRow", statName)) - return STAT_BestScore_KnifeKillsInRow; - - return 0; -} -char* ATLAS_GET_STAT_NAME(int statId) -{ - if (statId <= 0) - return ""; - - if (statId == STAT_AwardAchillesHeel) - return "STAT_AwardAchillesHeel"; - if (statId == STAT_AwardAchillesHeelLastRewardDate) - return "STAT_AwardAchillesHeelLastRewardDate"; - if (statId == STAT_AwardAvenger) - return "STAT_AwardAvenger"; - if (statId == STAT_AwardAvengerLastRewardDate) - return "STAT_AwardAvengerLastRewardDate"; - if (statId == STAT_AwardBlackList) - return "STAT_AwardBlackList"; - if (statId == STAT_AwardBlackListLastRewardDate) - return "STAT_AwardBlackListLastRewardDate"; - if (statId == STAT_AwardBlitzkrieg) - return "STAT_AwardBlitzkrieg"; - if (statId == STAT_AwardBlitzkriegLastRewardDate) - return "STAT_AwardBlitzkriegLastRewardDate"; - if (statId == STAT_AwardCherub) - return "STAT_AwardCherub"; - if (statId == STAT_AwardCherubLastRewardDate) - return "STAT_AwardCherubLastRewardDate"; - if (statId == STAT_AwardClimber) - return "STAT_AwardClimber"; - if (statId == STAT_AwardClimberLastRewardDate) - return "STAT_AwardClimberLastRewardDate"; - if (statId == STAT_AwardDeadlyAccuracy) - return "STAT_AwardDeadlyAccuracy"; - if (statId == STAT_AwardDeadlyAccuracyLastRewardDate) - return "STAT_AwardDeadlyAccuracyLastRewardDate"; - if (statId == STAT_AwardDignity) - return "STAT_AwardDignity"; - if (statId == STAT_AwardDignityLastRewardDate) - return "STAT_AwardDignityLastRewardDate"; - if (statId == STAT_AwardDoubleShotDoubleKill) - return "STAT_AwardDoubleShotDoubleKill"; - if (statId == STAT_AwardDoubleShotDoubleKillLastRewardDate) - return "STAT_AwardDoubleShotDoubleKillLastRewardDate"; - if (statId == STAT_AwardDryVictory) - return "STAT_AwardDryVictory"; - if (statId == STAT_AwardDryVictoryLastRewardDate) - return "STAT_AwardDryVictoryLastRewardDate"; - if (statId == STAT_AwardFasterThanBullets) - return "STAT_AwardFasterThanBullets"; - if (statId == STAT_AwardFasterThanBulletsLastRewardDate) - return "STAT_AwardFasterThanBulletsLastRewardDate"; - if (statId == STAT_AwardHarvestTime) - return "STAT_AwardHarvestTime"; - if (statId == STAT_AwardHarvestTimeLastRewardDate) - return "STAT_AwardHarvestTimeLastRewardDate"; - if (statId == STAT_AwardInvincibleFury) - return "STAT_AwardInvincibleFury"; - if (statId == STAT_AwardInvincibleFuryLastRewardDate) - return "STAT_AwardInvincibleFuryLastRewardDate"; - if (statId == STAT_AwardLightingReflexes) - return "STAT_AwardLightingReflexes"; - if (statId == STAT_AwardLightingReflexesLastRewardDate) - return "STAT_AwardLightingReflexesLastRewardDate"; - if (statId == STAT_AwardLucky) - return "STAT_AwardLucky"; - if (statId == STAT_AwardLuckyLastRewardDate) - return "STAT_AwardLuckyLastRewardDate"; - if (statId == STAT_AwardMad) - return "STAT_AwardMad"; - if (statId == STAT_AwardMadLastRewardDate) - return "STAT_AwardMadLastRewardDate"; - if (statId == STAT_AwardMarksman) - return "STAT_AwardMarksman"; - if (statId == STAT_AwardMarksmanLastRewardDate) - return "STAT_AwardMarksmanLastRewardDate"; - if (statId == STAT_AwardMasscare) - return "STAT_AwardMasscare"; - if (statId == STAT_AwardMasscareLastRewardDate) - return "STAT_AwardMasscareLastRewardDate"; - if (statId == STAT_AwardMultichampion) - return "STAT_AwardMultichampion"; - if (statId == STAT_AwardMultichampionLastRewardDate) - return "STAT_AwardMultichampionLastRewardDate"; - if (statId == STAT_AwardOculist) - return "STAT_AwardOculist"; - if (statId == STAT_AwardOculistLastRewardDate) - return "STAT_AwardOculistLastRewardDate"; - if (statId == STAT_AwardOpener) - return "STAT_AwardOpener"; - if (statId == STAT_AwardOpenerLastRewardDate) - return "STAT_AwardOpenerLastRewardDate"; - if (statId == STAT_AwardOwerwhelmingSuperiority) - return "STAT_AwardOwerwhelmingSuperiority"; - if (statId == STAT_AwardOwerwhelmingSuperiorityLastRewardDate) - return "STAT_AwardOwerwhelmingSuperiorityLastRewardDate"; - if (statId == STAT_AwardParanoia) - return "STAT_AwardParanoia"; - if (statId == STAT_AwardParanoiaLastRewardDate) - return "STAT_AwardParanoiaLastRewardDate"; - if (statId == STAT_AwardPeaceAmbassador) - return "STAT_AwardPeaceAmbassador"; - if (statId == STAT_AwardPeaceAmbassadorLastRewardDate) - return "STAT_AwardPeaceAmbassadorLastRewardDate"; - if (statId == STAT_AwardRemembrance) - return "STAT_AwardRemembrance"; - if (statId == STAT_AwardRemembranceLastRewardDate) - return "STAT_AwardRemembranceLastRewardDate"; - if (statId == STAT_AwardSilentDeath) - return "STAT_AwardSilentDeath"; - if (statId == STAT_AwardSilentDeathLastRewardDate) - return "STAT_AwardSilentDeathLastRewardDate"; - if (statId == STAT_AwardSkewer) - return "STAT_AwardSkewer"; - if (statId == STAT_AwardSkewerLastRewardDate) - return "STAT_AwardSkewerLastRewardDate"; - if (statId == STAT_AwardSprinterStopper) - return "STAT_AwardSprinterStopper"; - if (statId == STAT_AwardSprinterStopperLastRewardDate) - return "STAT_AwardSprinterStopperLastRewardDate"; - if (statId == STAT_AwardStalkerFlair) - return "STAT_AwardStalkerFlair"; - if (statId == STAT_AwardStalkerFlairLastRewardDate) - return "STAT_AwardStalkerFlairLastRewardDate"; - if (statId == STAT_AwardToughy) - return "STAT_AwardToughy"; - if (statId == STAT_AwardToughyLastRewardDate) - return "STAT_AwardToughyLastRewardDate"; - if (statId == STAT_BestScore_BackstabsKillsInRow) - return "STAT_BestScore_BackstabsKillsInRow"; - if (statId == STAT_BestScore_BleedKillsInRow) - return "STAT_BestScore_BleedKillsInRow"; - if (statId == STAT_BestScore_ExplosiveKillsInRow) - return "STAT_BestScore_ExplosiveKillsInRow"; - if (statId == STAT_BestScore_EyeKillsInRow) - return "STAT_BestScore_EyeKillsInRow"; - if (statId == STAT_BestScore_HeadshotsKillsInRow) - return "STAT_BestScore_HeadshotsKillsInRow"; - if (statId == STAT_BestScore_KillsInRow) - return "STAT_BestScore_KillsInRow"; - if (statId == STAT_BestScore_KnifeKillsInRow) - return "STAT_BestScore_KnifeKillsInRow"; - - return ""; -} - -int ATLAS_GET_STAT_PAGE_BY_ID(int statId) -{ - if (statId <= 0) - return 0; - - // PlayerStats - if (statId == 3 || statId == 4 || statId == 5 || statId == 6 || statId == 7 || statId == 8 || statId == 9 || - statId == 10 || statId == 11 || statId == 12 || statId == 13 || statId == 14 || statId == 15 || statId == 16 || - statId == 17 || statId == 18 || statId == 19 || statId == 20 || statId == 21 || statId == 22 || statId == 23 || - statId == 24 || statId == 25 || statId == 26 || statId == 27 || statId == 28 || statId == 29 || statId == 30 || - statId == 31 || statId == 32 || statId == 33 || statId == 34 || statId == 35 || statId == 36 || statId == 37 || - statId == 38 || statId == 39 || statId == 40 || statId == 41 || statId == 42 || statId == 43 || statId == 44 || - statId == 45 || statId == 46 || statId == 47 || statId == 48 || statId == 49 || statId == 50 || statId == 51 || - statId == 52 || statId == 53 || statId == 54 || statId == 55 || statId == 56 || statId == 57 || statId == 58 || - statId == 59 || statId == 60 || statId == 61 || statId == 62 || statId == 63 || statId == 64 || statId == 65 || - statId == 66 || statId == 67 || statId == 68 || statId == 69) - return 1; - - return 0; -} - -int ATLAS_GET_STAT_PAGE_BY_NAME(char* statName) -{ - if (!statName) - return 0; - - // PlayerStats - if (!strcmp("STAT_BestScore_KillsInRow", statName) || !strcmp("STAT_BestScore_KnifeKillsInRow", statName) || - !strcmp("STAT_BestScore_BackstabsKillsInRow", statName) || - !strcmp("STAT_BestScore_HeadshotsKillsInRow", statName) || !strcmp("STAT_BestScore_EyeKillsInRow", statName) || - !strcmp("STAT_BestScore_BleedKillsInRow", statName) || !strcmp("STAT_BestScore_ExplosiveKillsInRow", statName) || - !strcmp("STAT_AwardMasscare", statName) || !strcmp("STAT_AwardMasscareLastRewardDate", statName) || - !strcmp("STAT_AwardParanoia", statName) || !strcmp("STAT_AwardParanoiaLastRewardDate", statName) || - !strcmp("STAT_AwardOwerwhelmingSuperiority", statName) || - !strcmp("STAT_AwardOwerwhelmingSuperiorityLastRewardDate", statName) || !strcmp("STAT_AwardBlitzkrieg", statName) || - !strcmp("STAT_AwardBlitzkriegLastRewardDate", statName) || !strcmp("STAT_AwardDryVictory", statName) || - !strcmp("STAT_AwardDryVictoryLastRewardDate", statName) || !strcmp("STAT_AwardMultichampion", statName) || - !strcmp("STAT_AwardMultichampionLastRewardDate", statName) || !strcmp("STAT_AwardMad", statName) || - !strcmp("STAT_AwardMadLastRewardDate", statName) || !strcmp("STAT_AwardAchillesHeel", statName) || - !strcmp("STAT_AwardAchillesHeelLastRewardDate", statName) || !strcmp("STAT_AwardFasterThanBullets", statName) || - !strcmp("STAT_AwardFasterThanBulletsLastRewardDate", statName) || !strcmp("STAT_AwardHarvestTime", statName) || - !strcmp("STAT_AwardHarvestTimeLastRewardDate", statName) || !strcmp("STAT_AwardSkewer", statName) || - !strcmp("STAT_AwardSkewerLastRewardDate", statName) || !strcmp("STAT_AwardDoubleShotDoubleKill", statName) || - !strcmp("STAT_AwardDoubleShotDoubleKillLastRewardDate", statName) || !strcmp("STAT_AwardClimber", statName) || - !strcmp("STAT_AwardClimberLastRewardDate", statName) || !strcmp("STAT_AwardOpener", statName) || - !strcmp("STAT_AwardOpenerLastRewardDate", statName) || !strcmp("STAT_AwardToughy", statName) || - !strcmp("STAT_AwardToughyLastRewardDate", statName) || !strcmp("STAT_AwardInvincibleFury", statName) || - !strcmp("STAT_AwardInvincibleFuryLastRewardDate", statName) || !strcmp("STAT_AwardOculist", statName) || - !strcmp("STAT_AwardOculistLastRewardDate", statName) || !strcmp("STAT_AwardLightingReflexes", statName) || - !strcmp("STAT_AwardLightingReflexesLastRewardDate", statName) || !strcmp("STAT_AwardSprinterStopper", statName) || - !strcmp("STAT_AwardSprinterStopperLastRewardDate", statName) || !strcmp("STAT_AwardMarksman", statName) || - !strcmp("STAT_AwardMarksmanLastRewardDate", statName) || !strcmp("STAT_AwardPeaceAmbassador", statName) || - !strcmp("STAT_AwardPeaceAmbassadorLastRewardDate", statName) || !strcmp("STAT_AwardDeadlyAccuracy", statName) || - !strcmp("STAT_AwardDeadlyAccuracyLastRewardDate", statName) || !strcmp("STAT_AwardRemembrance", statName) || - !strcmp("STAT_AwardRemembranceLastRewardDate", statName) || !strcmp("STAT_AwardAvenger", statName) || - !strcmp("STAT_AwardAvengerLastRewardDate", statName) || !strcmp("STAT_AwardCherub", statName) || - !strcmp("STAT_AwardCherubLastRewardDate", statName) || !strcmp("STAT_AwardDignity", statName) || - !strcmp("STAT_AwardDignityLastRewardDate", statName) || !strcmp("STAT_AwardStalkerFlair", statName) || - !strcmp("STAT_AwardStalkerFlairLastRewardDate", statName) || !strcmp("STAT_AwardLucky", statName) || - !strcmp("STAT_AwardLuckyLastRewardDate", statName) || !strcmp("STAT_AwardBlackList", statName) || - !strcmp("STAT_AwardBlackListLastRewardDate", statName) || !strcmp("STAT_AwardSilentDeath", statName) || - !strcmp("STAT_AwardSilentDeathLastRewardDate", statName)) - return 1; - - return 0; -} diff --git a/src/xrGame/atlas_stalkercs_v1.h b/src/xrGame/atlas_stalkercs_v1.h deleted file mode 100644 index b9ff11b6924..00000000000 --- a/src/xrGame/atlas_stalkercs_v1.h +++ /dev/null @@ -1,171 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// GameSpy ATLAS Competition System Header File -// -// NOTE: This is an auto-generated file, do not edit this file directly. -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _ATLAS_STALKERCS_V1_H_ -#define _ATLAS_STALKERCS_V1_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -extern int ATLAS_GET_KEY(char* keyName); -extern char* ATLAS_GET_KEY_NAME(int keyId); -extern int ATLAS_GET_STAT(char* statName); -extern char* ATLAS_GET_STAT_NAME(int statId); -extern int ATLAS_GET_STAT_PAGE_BY_ID(int statId); -extern int ATLAS_GET_STAT_PAGE_BY_NAME(char* statName); - -#define ATLAS_RULE_SET_VERSION 1 - -// KEYS -// Use these key ID's to report match data for your game. - -#define KEY_AwardDeadlyAccuracyLastRewardDate 53 // [TYPE: int] -#define KEY_AwardRemembrance 54 // [TYPE: int] -#define KEY_AwardRemembranceLastRewardDate 55 // [TYPE: int] -#define KEY_AwardAvenger 56 // [TYPE: int] -#define KEY_AwardAvengerLastRewardDate 57 // [TYPE: int] -#define KEY_AwardCherub 58 // [TYPE: int] -#define KEY_AwardCherubLastRewardDate 59 // [TYPE: int] -#define KEY_AwardDignity 60 // [TYPE: int] -#define KEY_AwardDignityLastRewardDate 61 // [TYPE: int] -#define KEY_AwardStalkerFlair 62 // [TYPE: int] -#define KEY_AwardStalkerFlairLastRewardDate 63 // [TYPE: int] -#define KEY_AwardLucky 64 // [TYPE: int] -#define KEY_AwardLuckyLastRewardDate 65 // [TYPE: int] -#define KEY_AwardBlackList 66 // [TYPE: int] -#define KEY_AwardBlackListLastRewardDate 67 // [TYPE: int] -#define KEY_AwardSilentDeath 68 // [TYPE: int] -#define KEY_AwardSilentDeathLastRewardDate 69 // [TYPE: int] -#define KEY_AwardMasscare 10 // [TYPE: int] -#define KEY_AwardMasscareLastRewardDate 11 // [TYPE: int] -#define KEY_AwardParanoia 12 // [TYPE: int] -#define KEY_AwardParanoiaLastRewardDate 13 // [TYPE: int] -#define KEY_AwardOverwhelmingSuperiority 14 // [TYPE: int] -#define KEY_AwardOverwhelmingSuperiorityLastRewardDate 15 // [TYPE: int] -#define KEY_AwardBlitzkrieg 16 // [TYPE: int] -#define KEY_AwardBlitzkriegLastRewardDate 17 // [TYPE: int] -#define KEY_AwardDryVictory 18 // [TYPE: int] -#define KEY_AwardDryVictoryLastRewardDate 19 // [TYPE: int] -#define KEY_AwardMultichampion 20 // [TYPE: int] -#define KEY_AwardMultichampionLastRewardDate 21 // [TYPE: int] -#define KEY_AwardMad 22 // [TYPE: int] -#define KEY_AwardMadLastRewardDate 23 // [TYPE: int] -#define KEY_AwardAchillesHeel 24 // [TYPE: int] -#define KEY_AwardAchillesHeelLastRewardDate 25 // [TYPE: int] -#define KEY_AwardFasterThanBullets 26 // [TYPE: int] -#define KEY_AwardFasterThanBulletsLastRewardDate 27 // [TYPE: int] -#define KEY_AwardHarvestTime 28 // [TYPE: int] -#define KEY_AwardHarvestTimeLastRewardDate 29 // [TYPE: int] -#define KEY_AwardSkewer 30 // [TYPE: int] -#define KEY_AwardSkewerLastRewardDate 31 // [TYPE: int] -#define KEY_AwardDoubleShotDoubleKill 32 // [TYPE: int] -#define KEY_AwardDoubleShotDoubleKillLastRewardDate 33 // [TYPE: int] -#define KEY_AwardClimber 34 // [TYPE: int] -#define KEY_AwardClimberLastRewardDate 35 // [TYPE: int] -#define KEY_AwardOpener 36 // [TYPE: int] -#define KEY_AwardOpenerLastRewardDate 37 // [TYPE: int] -#define KEY_AwardToughy 38 // [TYPE: int] -#define KEY_AwardToughyLastRewardDate 39 // [TYPE: int] -#define KEY_AwardInvincibleFury 40 // [TYPE: int] -#define KEY_AwardInvincibleFuryLastRewardDate 41 // [TYPE: int] -#define KEY_AwardOculist 42 // [TYPE: int] -#define KEY_AwardOculistLastRewardDate 43 // [TYPE: int] -#define KEY_AwardLightingReflexes 44 // [TYPE: int] -#define KEY_AwardLightingReflexesLastRewardDate 45 // [TYPE: int] -#define KEY_AwardSprinterStopper 46 // [TYPE: int] -#define KEY_AwardSprinterStopperLastRewardDate 47 // [TYPE: int] -#define KEY_AwardMarksMan 48 // [TYPE: int] -#define KEY_AwardMarksManLastRewardDate 49 // [TYPE: int] -#define KEY_AwardPeaceAmbassador 50 // [TYPE: int] -#define KEY_AwardPeaceAmbassadorLastRewardDate 51 // [TYPE: int] -#define KEY_AwardDeadlyAccuracy 52 // [TYPE: int] -#define KEY_BestScore_KillsInRow 3 // [TYPE: int] [DESC: kills in row] -#define KEY_BestScore_KnifeKillsInRow 4 // [TYPE: int] [DESC: knife kills in row] -#define KEY_BestScore_BackstabsKillsInRow 5 // [TYPE: int] [DESC: knife backstabs kills in row] -#define KEY_BestScore_HeadshotsKillsInRow 6 // [TYPE: int] [DESC: headshots kills in row] -#define KEY_BestScore_EyeKillsInRow 7 // [TYPE: int] [DESC: eye kills in row] -#define KEY_BestScore_BleedKillsInRow 8 // [TYPE: int] [DESC: bleed kills in row] -#define KEY_BestScore_ExplosiveKillsInRow 9 // [TYPE: int] [DESC: explosive kills in row] - -/////////////////////////////////////////////////////////////////////////////// - -// STATS -// Use these stat ID's to query aggregate statistics for your game. - -#define STAT_AwardAchillesHeel 24 // [TYPE: int] -#define STAT_AwardAchillesHeelLastRewardDate 25 // [TYPE: int] -#define STAT_AwardAvenger 56 // [TYPE: int] -#define STAT_AwardAvengerLastRewardDate 57 // [TYPE: int] -#define STAT_AwardBlackList 66 // [TYPE: int] -#define STAT_AwardBlackListLastRewardDate 67 // [TYPE: int] -#define STAT_AwardBlitzkrieg 16 // [TYPE: int] -#define STAT_AwardBlitzkriegLastRewardDate 17 // [TYPE: int] -#define STAT_AwardCherub 58 // [TYPE: int] -#define STAT_AwardCherubLastRewardDate 59 // [TYPE: int] -#define STAT_AwardClimber 34 // [TYPE: int] -#define STAT_AwardClimberLastRewardDate 35 // [TYPE: int] -#define STAT_AwardDeadlyAccuracy 52 // [TYPE: int] -#define STAT_AwardDeadlyAccuracyLastRewardDate 53 // [TYPE: int] -#define STAT_AwardDignity 60 // [TYPE: int] -#define STAT_AwardDignityLastRewardDate 61 // [TYPE: int] -#define STAT_AwardDoubleShotDoubleKill 32 // [TYPE: int] -#define STAT_AwardDoubleShotDoubleKillLastRewardDate 33 // [TYPE: int] -#define STAT_AwardDryVictory 18 // [TYPE: int] -#define STAT_AwardDryVictoryLastRewardDate 19 // [TYPE: int] -#define STAT_AwardFasterThanBullets 26 // [TYPE: int] -#define STAT_AwardFasterThanBulletsLastRewardDate 27 // [TYPE: int] -#define STAT_AwardHarvestTime 28 // [TYPE: int] -#define STAT_AwardHarvestTimeLastRewardDate 29 // [TYPE: int] -#define STAT_AwardInvincibleFury 40 // [TYPE: int] -#define STAT_AwardInvincibleFuryLastRewardDate 41 // [TYPE: int] -#define STAT_AwardLightingReflexes 44 // [TYPE: int] -#define STAT_AwardLightingReflexesLastRewardDate 45 // [TYPE: int] -#define STAT_AwardLucky 64 // [TYPE: int] -#define STAT_AwardLuckyLastRewardDate 65 // [TYPE: int] -#define STAT_AwardMad 22 // [TYPE: int] -#define STAT_AwardMadLastRewardDate 23 // [TYPE: int] -#define STAT_AwardMarksman 48 // [TYPE: int] -#define STAT_AwardMarksmanLastRewardDate 49 // [TYPE: int] -#define STAT_AwardMasscare 10 // [TYPE: int] -#define STAT_AwardMasscareLastRewardDate 11 // [TYPE: int] -#define STAT_AwardMultichampion 20 // [TYPE: int] -#define STAT_AwardMultichampionLastRewardDate 21 // [TYPE: int] -#define STAT_AwardOculist 42 // [TYPE: int] -#define STAT_AwardOculistLastRewardDate 43 // [TYPE: int] -#define STAT_AwardOpener 36 // [TYPE: int] -#define STAT_AwardOpenerLastRewardDate 37 // [TYPE: int] -#define STAT_AwardOwerwhelmingSuperiority 14 // [TYPE: int] -#define STAT_AwardOwerwhelmingSuperiorityLastRewardDate 15 // [TYPE: int] -#define STAT_AwardParanoia 12 // [TYPE: int] -#define STAT_AwardParanoiaLastRewardDate 13 // [TYPE: int] -#define STAT_AwardPeaceAmbassador 50 // [TYPE: int] -#define STAT_AwardPeaceAmbassadorLastRewardDate 51 // [TYPE: int] -#define STAT_AwardRemembrance 54 // [TYPE: int] -#define STAT_AwardRemembranceLastRewardDate 55 // [TYPE: int] -#define STAT_AwardSilentDeath 68 // [TYPE: int] -#define STAT_AwardSilentDeathLastRewardDate 69 // [TYPE: int] -#define STAT_AwardSkewer 30 // [TYPE: int] -#define STAT_AwardSkewerLastRewardDate 31 // [TYPE: int] -#define STAT_AwardSprinterStopper 46 // [TYPE: int] -#define STAT_AwardSprinterStopperLastRewardDate 47 // [TYPE: int] -#define STAT_AwardStalkerFlair 62 // [TYPE: int] -#define STAT_AwardStalkerFlairLastRewardDate 63 // [TYPE: int] -#define STAT_AwardToughy 38 // [TYPE: int] -#define STAT_AwardToughyLastRewardDate 39 // [TYPE: int] -#define STAT_BestScore_BackstabsKillsInRow 5 // [TYPE: int] -#define STAT_BestScore_BleedKillsInRow 8 // [TYPE: int] -#define STAT_BestScore_ExplosiveKillsInRow 9 // [TYPE: int] -#define STAT_BestScore_EyeKillsInRow 7 // [TYPE: int] -#define STAT_BestScore_HeadshotsKillsInRow 6 // [TYPE: int] -#define STAT_BestScore_KillsInRow 3 // [TYPE: int] -#define STAT_BestScore_KnifeKillsInRow 4 // [TYPE: int] - -#ifdef __cplusplus -} -#endif - -#endif // _ATLAS_STALKERCS_V1_H_ diff --git a/src/xrGame/atlas_submit_queue.cpp b/src/xrGame/atlas_submit_queue.cpp deleted file mode 100644 index c3804db625a..00000000000 --- a/src/xrGame/atlas_submit_queue.cpp +++ /dev/null @@ -1,165 +0,0 @@ -#include "StdAfx.h" -#include "atlas_submit_queue.h" -#include "stats_submitter.h" -#include "login_manager.h" -#include "profile_store.h" -#include "MainMenu.h" - -atlas_submit_queue::atlas_submit_queue(gamespy_profile::stats_submitter* stats_submitter) - : m_stats_submitter(stats_submitter), m_atlas_in_process(false) -{ - VERIFY(m_stats_submitter); - m_atlas_submitted.bind(this, &atlas_submit_queue::atlas_submitted); -} - -atlas_submit_queue::~atlas_submit_queue() {} -void atlas_submit_queue::submit_all() -{ -#ifdef XR_PLATFORM_WINDOWS - gamespy_gp::login_manager* tmp_lmngr = MainMenu()->GetLoginMngr(); - VERIFY(tmp_lmngr); - gamespy_gp::profile const* tmp_curr_prof = tmp_lmngr->get_current_profile(); - if (!tmp_curr_prof || !tmp_curr_prof->online()) - { - Msg("! ATLAS submit can be only in online profile mode"); - return; - } - submit_task tmp_task; - tmp_task.m_data_type = submit_task::edt_submit_all; - m_reward_tasks.push_back(tmp_task); - update(); -#endif -} - -void atlas_submit_queue::submit_reward(gamespy_profile::enum_awards_t const award_id) -{ -#ifdef XR_PLATFORM_WINDOWS - using namespace gamespy_profile; - gamespy_gp::login_manager* tmp_lmngr = MainMenu()->GetLoginMngr(); - VERIFY(tmp_lmngr); - gamespy_gp::profile const* tmp_curr_prof = tmp_lmngr->get_current_profile(); - if (!tmp_curr_prof->online()) - { - Msg("! ATLAS submit can be only in online profile mode"); - return; - } - m_stats_submitter->quick_reward_with_award(award_id, tmp_curr_prof); - - profile_store* tmp_store = MainMenu()->GetProfileStore(); - R_ASSERT(tmp_store); - all_awards_t const& tmp_all_awards = tmp_store->get_awards(); - all_awards_t::const_iterator tmp_iter = tmp_all_awards.find(award_id); - R_ASSERT(tmp_iter != tmp_all_awards.end()); - - submit_task tmp_task; - tmp_task.m_data_type = submit_task::edt_award_id; - tmp_task.m_award_id = award_id; - tmp_task.m_awards_count = tmp_iter->second.m_count; //+1 was on quick_reward_with_award - m_reward_tasks.push_back(tmp_task); - - update(); -#endif -} - -void atlas_submit_queue::submit_best_results() -{ -#ifdef XR_PLATFORM_WINDOWS - gamespy_gp::login_manager* tmp_lmngr = MainMenu()->GetLoginMngr(); - VERIFY(tmp_lmngr); - gamespy_gp::profile const* tmp_curr_prof = tmp_lmngr->get_current_profile(); - if (!tmp_curr_prof->online()) - { - Msg("! ATLAS submit can be only in online profile mode"); - return; - } - - submit_task tmp_task; - tmp_task.m_data_type = submit_task::edt_best_scores_ptr; - m_reward_tasks.push_back(tmp_task); - m_stats_submitter->quick_set_best_scores(&m_best_results_to_submit, tmp_curr_prof); - update(); -#endif -} - -void atlas_submit_queue::update() -{ -#ifdef XR_PLATFORM_WINDOWS - if (m_reward_tasks.empty() || is_active()) - return; - - gamespy_gp::login_manager* tmp_lmngr = MainMenu()->GetLoginMngr(); - VERIFY(tmp_lmngr); - gamespy_gp::profile const* tmp_curr_prof = tmp_lmngr->get_current_profile(); - VERIFY(tmp_curr_prof); - VERIFY2(tmp_curr_prof->online(), "ATLAS submit can be only in online profile mode"); - - if (m_reward_tasks.front().m_data_type == submit_task::edt_award_id) - { - do_atlas_reward(tmp_curr_prof, m_reward_tasks.front().m_award_id, m_reward_tasks.front().m_awards_count); - } - else if (m_reward_tasks.front().m_data_type == submit_task::edt_best_scores_ptr) - { - do_atlas_best_results(tmp_curr_prof, &m_best_results_to_submit); - } - else if (m_reward_tasks.front().m_data_type == submit_task::edt_submit_all) - { - do_atlas_submit_all(tmp_curr_prof); - } - else - { - NODEFAULT; - } - m_reward_tasks.pop_front(); -#endif -} - -void atlas_submit_queue::do_atlas_reward( - gamespy_gp::profile const* profile, gamespy_profile::enum_awards_t const award_id, u32 const count) -{ - VERIFY(m_stats_submitter); - VERIFY(!m_atlas_in_process); - - m_atlas_in_process = true; -#ifdef XR_PLATFORM_WINDOWS - m_stats_submitter->reward_with_award(award_id, count, profile, m_atlas_submitted); -#endif -} - -void atlas_submit_queue::do_atlas_best_results( - gamespy_gp::profile const* profile, gamespy_profile::all_best_scores_t* br_ptr) -{ - VERIFY(m_stats_submitter); - VERIFY(!m_atlas_in_process); - - m_atlas_in_process = true; -#ifdef XR_PLATFORM_WINDOWS - m_stats_submitter->set_best_scores(br_ptr, profile, m_atlas_submitted); -#endif -} - -void atlas_submit_queue::do_atlas_submit_all(gamespy_gp::profile const* profile) -{ -#ifdef XR_PLATFORM_WINDOWS - VERIFY(m_stats_submitter); - VERIFY(!m_atlas_in_process); - - gamespy_profile::profile_store* tmp_store = MainMenu()->GetProfileStore(); - VERIFY(tmp_store); - - m_atlas_in_process = true; - m_stats_submitter->submit_all(&tmp_store->get_awards(), &tmp_store->get_best_scores(), profile, m_atlas_submitted); -#endif -} - -void atlas_submit_queue::atlas_submitted(bool result, char const* err_string) -{ - if (result) - { - Msg("* submit complete successfully !"); - } - else - { - Msg("! failed to submit atlas report: %s", err_string); - } - m_atlas_in_process = false; -} diff --git a/src/xrGame/atlas_submit_queue.h b/src/xrGame/atlas_submit_queue.h deleted file mode 100644 index 0f228a072a8..00000000000 --- a/src/xrGame/atlas_submit_queue.h +++ /dev/null @@ -1,64 +0,0 @@ -#pragma once -#ifndef ATLAS_SUBMIT_QUEUE_INCLUDED -#define ATLAS_SUBMIT_QUEUE_INCLUDED - -#include "Common/Noncopyable.hpp" -#include "xrCore/fastdelegate.h" -#include "profile_data_types.h" -#include "profile_data_types_script.h" -#include "xrCommon/xr_deque.h" - -namespace gamespy_profile -{ -class stats_submitter; -}; -namespace gamespy_gp -{ -struct profile; -}; - -class atlas_submit_queue : private Noncopyable -{ -public: - atlas_submit_queue(gamespy_profile::stats_submitter* stats_submitter); - ~atlas_submit_queue(); - - // awards and best scores will be fetched from profile_store object - void submit_all(); - void submit_reward(gamespy_profile::enum_awards_t const award_id); - void submit_best_results(); - bool is_active() const { return m_atlas_in_process; }; - void update(); - - gamespy_profile::all_best_scores_t& get_best_results_store() { return m_best_results_to_submit; }; -private: - struct submit_task - { - enum enum_data_type - { - edt_award_id = 0x00, - edt_best_scores_ptr, - edt_submit_all, - } m_data_type; - gamespy_profile::enum_awards_t m_award_id; - u32 m_awards_count; - // gamespy_profile::all_best_scores_t* m_best_scores_ptr; - }; // struct submit_task - typedef xr_deque reward_tasks_t; - reward_tasks_t m_reward_tasks; - gamespy_profile::all_best_scores_t m_best_results_to_submit; - - //void do_task(submit_task const& td); - void do_atlas_reward( - gamespy_gp::profile const* profile, gamespy_profile::enum_awards_t const award_id, u32 const count); - void do_atlas_best_results(gamespy_gp::profile const* profile, gamespy_profile::all_best_scores_t* br_ptr); - void do_atlas_submit_all(gamespy_gp::profile const* profile); - - gamespy_profile::stats_submitter* m_stats_submitter; - gamespy_profile::store_operation_cb m_atlas_submitted; - bool m_atlas_in_process; - - void atlas_submitted(bool result, char const* err_string); -}; // class atlas_submit_quque - -#endif //#ifndef ATLAS_SUBMIT_QUEUE_INCLUDED diff --git a/src/xrGame/awards_store.cpp b/src/xrGame/awards_store.cpp deleted file mode 100644 index 47c377bb1b8..00000000000 --- a/src/xrGame/awards_store.cpp +++ /dev/null @@ -1,157 +0,0 @@ -#include "StdAfx.h" -#include "awards_store.h" -#include "xrGameSpy/GameSpy_Full.h" -#include "xrGameSpy/GameSpy_SAKE.h" - -namespace gamespy_profile -{ -awards_store::awards_store(CGameSpy_Full* fullgs_obj) -{ - VERIFY(fullgs_obj && fullgs_obj->GetGameSpySAKE()); - m_fullgs_obj = fullgs_obj; - m_sake_obj = fullgs_obj->GetGameSpySAKE(); - - init_field_names(); - m_get_records_input.mTableId = (char*)profile_table_name; - m_get_records_input.mFieldNames = m_field_names_store; - m_get_records_input.mNumFields = fields_count; -} - -awards_store::~awards_store() {} -void awards_store::init_field_names() -{ - for (int i = 0; i < at_awards_count; ++i) - { - int findex = i * ap_award_params_count; - m_field_names_store[findex + ap_award_id] = - ATLAS_GET_STAT_NAME(get_award_id_stat(static_cast(i))); - m_field_names_store[findex + ap_award_rdate] = - ATLAS_GET_STAT_NAME(get_award_reward_date_stat(static_cast(i))); - } -} - -void awards_store::reset_awards() -{ - m_awards_result.clear(); - m_ltx_awards_result.clear(); - - for (int aidx = 0; aidx < at_awards_count; ++aidx) - { - m_awards_result.emplace(enum_awards_t(aidx), award_data(u16(0), u32(0))); - }; -} - -void awards_store::load_awards(store_operation_cb& opcb) -{ - m_award_operation_cb = opcb; - - SAKERequest reqres = m_sake_obj->GetMyRecords(&m_get_records_input, &awards_store::get_my_awards_cb, this); - - if (!reqres) - { - SAKEStartRequestResult tmp_result = m_sake_obj->GetRequestResult(); - m_award_operation_cb(false, CGameSpy_SAKE::TryToTranslate(tmp_result).c_str()); - m_award_operation_cb.clear(); - } -} - -void awards_store::load_awards_from_ltx(CInifile& ini) -{ - for (int i = 0; i < at_awards_count; ++i) - { - enum_awards_t tmp_awid = static_cast(i); - LPCSTR tmp_award_name = get_award_name(tmp_awid); - u16 tmp_count = ini.r_u16(tmp_award_name, award_count_line); - u32 tmp_rdate = ini.r_u32(tmp_award_name, award_rdate_line); - m_ltx_awards_result.emplace(tmp_awid, award_data(tmp_count, tmp_rdate)); - } -} -void awards_store::merge_sake_to_ltx_awards() -{ - for (all_awards_t::iterator i = m_ltx_awards_result.begin(), ie = m_ltx_awards_result.end(); i != ie; ++i) - { - all_awards_t::const_iterator tmp_awi = m_awards_result.find(i->first); - if (tmp_awi != m_awards_result.end()) - { - u16 tmp_count = std::max(i->second.m_count, tmp_awi->second.m_count); - u32 tmp_rdate = std::max(i->second.m_last_reward_date, tmp_awi->second.m_last_reward_date); - i->second = award_data(tmp_count, tmp_rdate); - } - } -} - -all_awards_t& awards_store::get_player_awards() -{ - if (m_ltx_awards_result.empty()) - return m_awards_result; - return m_ltx_awards_result; -} - -bool awards_store::is_sake_equal_to_file() const -{ - VERIFY(!m_ltx_awards_result.empty()); - if (m_ltx_awards_result.empty()) - return true; // unknown - - for (all_awards_t::const_iterator i = m_ltx_awards_result.begin(), ie = m_ltx_awards_result.end(); i != ie; ++i) - { - all_awards_t::const_iterator tmp_iter = m_awards_result.find(i->first); - R_ASSERT(tmp_iter != m_awards_result.end()); - - if (i->second.m_count != tmp_iter->second.m_count) - return false; - } - return true; -} - -void awards_store::process_award(SAKEField* award_params) -{ - enum_awards_t awid = get_award_by_stat_name(award_params[ap_award_id].mName); - VERIFY(awid != at_awards_count); - -#ifdef DEBUG - int rdate_statid_real = get_award_reward_date_stat(awid); - int rdate_statid_from_table = ATLAS_GET_STAT(award_params[ap_award_rdate].mName); - VERIFY(rdate_statid_real == rdate_statid_from_table); -#endif - - u16 awards_count = award_params[ap_award_id].mValue.mShort; - u32 award_rdate = award_params[ap_award_rdate].mValue.mInt; - m_awards_result.emplace(awid, award_data(awards_count, award_rdate)); -} - -void awards_store::process_aw_out_response(SAKEGetMyRecordsOutput* tmp_out, int const out_fields_count) -{ - VERIFY(tmp_out->mNumRecords <= 1); // one raw - if (tmp_out->mNumRecords == 0) - return; - - for (int i = 0; i < out_fields_count; ++i) - { - if (get_award_by_stat_name(tmp_out->mRecords[0][i].mName) != at_awards_count) - { - process_award(&tmp_out->mRecords[0][i]); - } - } -} - -void __cdecl awards_store::get_my_awards_cb( - SAKE sake, SAKERequest request, SAKERequestResult result, void* inputData, void* outputData, void* userData) -{ - awards_store* my_inst = static_cast(userData); - VERIFY(my_inst && my_inst->m_award_operation_cb); - if (result != SAKERequestResult_SUCCESS) - { - my_inst->m_award_operation_cb(false, CGameSpy_SAKE::TryToTranslate(result).c_str()); - } - else - { - SAKEGetMyRecordsOutput* tmp_out = static_cast(outputData); - VERIFY(tmp_out); - my_inst->process_aw_out_response(tmp_out, fields_count); - my_inst->m_award_operation_cb(true, ""); - } - my_inst->m_award_operation_cb.clear(); -} - -} // namespace gamespy_profile diff --git a/src/xrGame/awards_store.h b/src/xrGame/awards_store.h deleted file mode 100644 index 388f17a899a..00000000000 --- a/src/xrGame/awards_store.h +++ /dev/null @@ -1,55 +0,0 @@ -#ifndef AWARD_SYSTEM_INCLUDED -#define AWARD_SYSTEM_INCLUDED - -#include "xrCore/Containers/AssociativeVector.hpp" -#include "Common/Noncopyable.hpp" -#include "profile_data_types.h" -#include -#include "gsc_dsigned_ltx.h" -#include "profile_data_types_script.h" - -class CGameSpy_Full; -class CGameSpy_SAKE; - -namespace gamespy_profile -{ -class awards_store : Noncopyable -{ -public: - awards_store(CGameSpy_Full* fullgs); - ~awards_store(); - - void load_awards(store_operation_cb& opcb); - void load_awards_from_ltx(CInifile& ini); - bool is_sake_equal_to_file() const; - void reset_awards(); - - static int const fields_count = at_awards_count * ap_award_params_count; - typedef char* award_fields_names_t[fields_count]; - - all_awards_t& get_player_awards(); - void merge_sake_to_ltx_awards(); - award_fields_names_t const& get_field_names() const { return m_field_names_store; } - void process_aw_out_response(SAKEGetMyRecordsOutput* tmp_out, int const out_fields_count); - -private: - all_awards_t m_awards_result; - all_awards_t m_ltx_awards_result; - store_operation_cb m_award_operation_cb; - - CGameSpy_SAKE* m_sake_obj; - CGameSpy_Full* m_fullgs_obj; - - award_fields_names_t m_field_names_store; - SAKEGetMyRecordsInput m_get_records_input; - void init_field_names(); - - void process_award(SAKEField* ap); - - static void __cdecl get_my_awards_cb( - SAKE sake, SAKERequest request, SAKERequestResult result, void* inputData, void* outputData, void* userData); -}; // class award_system - -} // namespace gamespy_profile - -#endif //#ifndef AWARD_SYSTEM_INCLUDED diff --git a/src/xrGame/best_scores_helper.cpp b/src/xrGame/best_scores_helper.cpp deleted file mode 100644 index af0c01ccdee..00000000000 --- a/src/xrGame/best_scores_helper.cpp +++ /dev/null @@ -1,140 +0,0 @@ -#include "StdAfx.h" -#include "best_scores_helper.h" -#include "game_base.h" - -namespace award_system -{ -best_scores_helper::best_scores_helper(game_state_accumulator* pstate) : inherited(pstate) -{ - reset_stats(); - reset_max(); -} - -best_scores_helper::~best_scores_helper() {} -void best_scores_helper::reset_max() -{ - m_max_kills_in_row = 0; - m_max_knife_kills_in_row = 0; - m_max_backstab_kills_in_row = 0; - m_max_headshots_kills_in_row = 0; - m_max_eyeshots_kills_in_row = 0; - m_max_bleed_kills_in_row = 0; - m_max_explosive_kills_in_row = 0; -} - -void best_scores_helper::reset_stats() -{ - m_kills_in_row = 0; - m_knife_kills_in_row = 0; - m_backstab_kills_in_row = 0; - m_headshots_kills_in_row = 0; - m_eyeshots_kills_in_row = 0; - m_bleed_kills_in_row = 0; - m_explosive_kills_in_row = 0; - m_artefacts = 0; -} - -void best_scores_helper::write_max() -{ - m_max_kills_in_row = std::max(m_kills_in_row, m_max_kills_in_row); - m_max_knife_kills_in_row = std::max(m_max_knife_kills_in_row, m_knife_kills_in_row); - m_max_backstab_kills_in_row = std::max(m_max_backstab_kills_in_row, m_backstab_kills_in_row); - m_max_headshots_kills_in_row = std::max(m_max_headshots_kills_in_row, m_headshots_kills_in_row); - m_max_eyeshots_kills_in_row = std::max(m_max_eyeshots_kills_in_row, m_eyeshots_kills_in_row); - m_max_bleed_kills_in_row = std::max(m_max_bleed_kills_in_row, m_bleed_kills_in_row); - m_max_explosive_kills_in_row = std::max(m_max_explosive_kills_in_row, m_explosive_kills_in_row); -} - -void best_scores_helper::fill_best_results(gamespy_profile::all_best_scores_t& dest_br) -{ - using namespace gamespy_profile; - write_max(); - dest_br.clear(); - dest_br.emplace(bst_kills_in_row, m_max_kills_in_row); - dest_br.emplace(bst_kinife_kills_in_row, m_max_knife_kills_in_row); - dest_br.emplace(bst_backstabs_in_row, m_max_backstab_kills_in_row); - dest_br.emplace(bst_head_shots_in_row, m_max_headshots_kills_in_row); - dest_br.emplace(bst_eye_kills_in_row, m_max_eyeshots_kills_in_row); - dest_br.emplace(bst_bleed_kills_in_row, m_max_bleed_kills_in_row); - dest_br.emplace(bst_explosive_kills_in_row, m_max_explosive_kills_in_row); -} - -bool best_scores_helper::OnPlayerBringArtefact(game_PlayerState const* ps) -{ - game_PlayerState* local_player = m_player_state_accum->get_local_player(); - if (!local_player) - return false; - - if (ps == local_player) - ++m_artefacts; - - return false; -} - -bool best_scores_helper::OnPlayerSpawned(game_PlayerState const* ps) -{ - game_PlayerState* local_player = m_player_state_accum->get_local_player(); - if (!local_player) - return false; - - if (ps == local_player) - { - write_max(); - reset_stats(); - } - - return false; -} - -bool best_scores_helper::OnRoundStart() -{ - reset_stats(); - reset_max(); - return false; -} - -bool best_scores_helper::OnPlayerKilled( - u16 killer_id, u16 target_id, u16 weapon_id, std::pair kill_type) -{ - game_PlayerState* local_player = m_player_state_accum->get_local_player(); - if (!local_player) - return false; - - if (killer_id != local_player->GameID) - return false; - - if (!m_player_state_accum->is_enemies(killer_id, target_id)) - return false; - - if (kill_type.first == KT_BLEEDING) - { - ++m_bleed_kills_in_row; - } - - u16 kill_weapon_id = m_player_state_accum->get_object_id(weapon_id); - if (m_player_state_accum->is_item_in_group(kill_weapon_id, ammunition_group::gid_hand_grenades)) - { - ++m_explosive_kills_in_row; - } - - switch (kill_type.second) - { - case SKT_HEADSHOT: - ++m_headshots_kills_in_row; - break; - case SKT_BACKSTAB: - ++m_backstab_kills_in_row; - break; - case SKT_KNIFEKILL: - ++m_knife_kills_in_row; - break; - case SKT_EYESHOT: - ++m_eyeshots_kills_in_row; - break; - } // switch (kill_type.second) - - ++m_kills_in_row; - return false; -} - -} // namespace award_system diff --git a/src/xrGame/best_scores_helper.h b/src/xrGame/best_scores_helper.h deleted file mode 100644 index 575ba227c01..00000000000 --- a/src/xrGame/best_scores_helper.h +++ /dev/null @@ -1,65 +0,0 @@ -#ifndef BEST_SCORES_HELPER_INCLUDED -#define BEST_SCORES_HELPER_INCLUDED - -#include "profile_data_types.h" -#include "reward_event_handler.h" - -namespace award_system -{ -class best_scores_helper : public reward_event_handler -{ - typedef reward_event_handler inherited; - -public: - best_scores_helper(game_state_accumulator* pstate); - virtual ~best_scores_helper(); - - virtual bool OnWeapon_Fire(u16 sender, u16 sender_weapon_id) { return false; }; - virtual bool OnBullet_Fire(u16 sender, u16 sender_weapon_id, const Fvector& position, const Fvector& direction) - { - return false; - }; - virtual bool OnBullet_Hit( - IGameObject const* hitter, IGameObject const* victim, IGameObject const* weapon, u16 const bone) - { - return false; - }; - virtual bool OnArtefactSpawned() { return false; }; - virtual bool OnPlayerTakeArtefact(game_PlayerState const* ps) { return false; }; - virtual bool OnPlayerDropArtefact(game_PlayerState const* ps) { return false; }; - virtual bool OnPlayerBringArtefact(game_PlayerState const* ps); - virtual bool OnPlayerSpawned(game_PlayerState const* ps); - virtual bool OnPlayerKilled( - u16 killer_id, u16 target_id, u16 weapon_id, std::pair kill_type); - virtual bool OnPlayerChangeTeam(s8 team) { return false; }; - virtual bool OnRoundEnd() { return false; }; - virtual bool OnRoundStart(); - virtual bool OnPlayerRankChanged() { return false; }; - void fill_best_results(gamespy_profile::all_best_scores_t& dest_br); - -private: - int m_kills_in_row; - int m_knife_kills_in_row; - int m_backstab_kills_in_row; - int m_headshots_kills_in_row; - int m_eyeshots_kills_in_row; - int m_bleed_kills_in_row; - int m_explosive_kills_in_row; - int m_artefacts; - - int m_max_kills_in_row; - int m_max_knife_kills_in_row; - int m_max_backstab_kills_in_row; - int m_max_headshots_kills_in_row; - int m_max_eyeshots_kills_in_row; - int m_max_bleed_kills_in_row; - int m_max_explosive_kills_in_row; - - void reset_stats(); - void reset_max(); - void write_max(); -}; // class best_scores_helper - -} // namespace award_system - -#endif //#ifndef BEST_SCORES_HELPER_INCLUDED diff --git a/src/xrGame/best_scores_store.cpp b/src/xrGame/best_scores_store.cpp deleted file mode 100644 index 2ecbb17ccf5..00000000000 --- a/src/xrGame/best_scores_store.cpp +++ /dev/null @@ -1,151 +0,0 @@ -#include "StdAfx.h" -#include "best_scores_store.h" -#include "xrGameSpy/GameSpy_Full.h" -#include "xrGameSpy/GameSpy_SAKE.h" - -namespace gamespy_profile -{ -best_scores_store::best_scores_store(CGameSpy_Full* fullgs_obj) -{ - VERIFY(fullgs_obj && fullgs_obj->GetGameSpySAKE()); - m_fullgs_obj = fullgs_obj; - m_sake_obj = fullgs_obj->GetGameSpySAKE(); - - init_field_names(); - - m_get_records_input.mTableId = (char*)profile_table_name; - m_get_records_input.mFieldNames = m_field_names_store; - m_get_records_input.mNumFields = fields_count; -} - -best_scores_store::~best_scores_store() -{ - // VERIFY(!m_scores_operation_cb); -} - -void best_scores_store::init_field_names() -{ - for (int i = 0; i < bst_score_types_count; ++i) - { - m_field_names_store[i] = ATLAS_GET_STAT_NAME(get_best_score_id_stat(static_cast(i))); - } -} - -void best_scores_store::reset_scores() -{ - m_result_scores.clear(); - m_ltx_result_scores.clear(); - - for (int bsidx = 0; bsidx < bst_score_types_count; ++bsidx) - { - m_result_scores.emplace(enum_best_score_type(bsidx), 0); - }; -} - -void best_scores_store::load_best_scores(store_operation_cb& opcb) -{ - m_scores_operation_cb = opcb; - - SAKERequest reqres = - m_sake_obj->GetMyRecords(&m_get_records_input, &best_scores_store::get_my_player_scores_cb, this); - - if (!reqres) - { - SAKEStartRequestResult tmp_result = m_sake_obj->GetRequestResult(); - m_scores_operation_cb(false, CGameSpy_SAKE::TryToTranslate(tmp_result).c_str()); - m_scores_operation_cb.clear(); - } -} - -void best_scores_store::load_best_scores_from_ltx(CInifile& ini) -{ - for (int i = 0; i != bst_score_types_count; ++i) - { - enum_best_score_type bstype = static_cast(i); - m_ltx_result_scores.emplace( - bstype, ini.r_u32(get_best_score_name(bstype), best_score_value_line) - ); - } -} - -void best_scores_store::merge_sake_to_ltx_best_scores() -{ - for (all_best_scores_t::iterator i = m_ltx_result_scores.begin(), ie = m_ltx_result_scores.end(); i != ie; ++i) - { - all_best_scores_t::const_iterator tmp_bi = m_result_scores.find(i->first); - if (tmp_bi != m_result_scores.end()) - { - u32 tmp_value = std::max(i->second, tmp_bi->second); - i->second = tmp_value; - } - } -} - -all_best_scores_t& best_scores_store::get_player_best_scores() -{ - if (m_ltx_result_scores.empty()) - return m_result_scores; - - return m_ltx_result_scores; -} - -bool best_scores_store::is_sake_equal_to_file() const -{ - VERIFY(!m_ltx_result_scores.empty()); - if (m_ltx_result_scores.empty()) - return true; - - for (all_best_scores_t::const_iterator i = m_ltx_result_scores.begin(), ie = m_ltx_result_scores.end(); i != ie; - ++i) - { - all_best_scores_t::const_iterator tmp_iter = m_result_scores.find(i->first); - R_ASSERT(tmp_iter != m_result_scores.end()); - - if (i->second != tmp_iter->second) - return false; - } - return true; -} - -void __cdecl best_scores_store::get_my_player_scores_cb( - SAKE sake, SAKERequest request, SAKERequestResult result, void* inputData, void* outputData, void* userData) -{ - best_scores_store* my_inst = static_cast(userData); - VERIFY(my_inst && my_inst->m_scores_operation_cb); - if (result != SAKERequestResult_SUCCESS) - { - my_inst->m_scores_operation_cb(false, CGameSpy_SAKE::TryToTranslate(result).c_str()); - } - else - { - SAKEGetMyRecordsOutput* tmp_out = static_cast(outputData); - VERIFY(tmp_out); - my_inst->process_scores_out_response(tmp_out, fields_count); - my_inst->m_scores_operation_cb(true, "mp_load_best_scores_complete"); - } - my_inst->m_scores_operation_cb.clear(); -} - -void best_scores_store::process_scores_out_response(SAKEGetMyRecordsOutput* tmp_out, int const out_fields_count) -{ - VERIFY(tmp_out->mNumRecords <= 1); // one raw - if (tmp_out->mNumRecords == 0) - { - for (int i = 0; i < bst_score_types_count; ++i) - { - m_result_scores.emplace(static_cast(i), 0); - } - return; - } - - for (int i = 0; i < out_fields_count; ++i) - { - enum_best_score_type bst = get_best_score_type_by_sname(tmp_out->mRecords[0][i].mName); - if (bst == bst_score_types_count) - continue; - s32 bs_value = tmp_out->mRecords[0][i].mValue.mInt; // one raw - m_result_scores.emplace(bst, bs_value); - }; -} - -} // namespace gamespy_profile diff --git a/src/xrGame/best_scores_store.h b/src/xrGame/best_scores_store.h deleted file mode 100644 index c805054871c..00000000000 --- a/src/xrGame/best_scores_store.h +++ /dev/null @@ -1,55 +0,0 @@ -#ifndef BEST_SCORES_SYSTEM_INCLUDED -#define BEST_SCORES_SYSTEM_INCLUDED - -#include "Common/Noncopyable.hpp" -#include "xrCore/Containers/AssociativeVector.hpp" -#include -#include "profile_data_types.h" -#include "profile_data_types_script.h" - -class CGameSpy_Full; -class CGameSpy_SAKE; - -namespace gamespy_profile -{ -typedef fastdelegate::FastDelegate bestscore_operation_cb; - -class best_scores_store -{ -public: - best_scores_store(CGameSpy_Full* fullgs); - ~best_scores_store(); - - void load_best_scores(store_operation_cb& opcb); - void load_best_scores_from_ltx(CInifile& ini); - bool is_sake_equal_to_file() const; - void reset_scores(); - - all_best_scores_t& get_player_best_scores(); - void merge_sake_to_ltx_best_scores(); - - static int const fields_count = bst_score_types_count; - typedef char* best_fields_names_t[fields_count]; - - best_fields_names_t const& get_field_names() const { return m_field_names_store; } - void process_scores_out_response(SAKEGetMyRecordsOutput* tmp_out, int const out_fields_count); - -private: - all_best_scores_t m_result_scores; - all_best_scores_t m_ltx_result_scores; - store_operation_cb m_scores_operation_cb; - - CGameSpy_SAKE* m_sake_obj; - CGameSpy_Full* m_fullgs_obj; - - best_fields_names_t m_field_names_store; - SAKEGetMyRecordsInput m_get_records_input; - void init_field_names(); - - static void __cdecl get_my_player_scores_cb( - SAKE sake, SAKERequest request, SAKERequestResult result, void* inputData, void* outputData, void* userData); -}; // best_scores_store - -} // namespace gamespy_profile - -#endif //#ifndef BEST_SCORES_SYSTEM_INCLUDED diff --git a/src/xrGame/black_list.cpp b/src/xrGame/black_list.cpp deleted file mode 100644 index e9fcf918508..00000000000 --- a/src/xrGame/black_list.cpp +++ /dev/null @@ -1,36 +0,0 @@ -#include "StdAfx.h" -#include "black_list.h" -#include "Level.h" -#include "game_cl_base.h" -#include "game_state_accumulator.h" - -namespace award_system -{ -u32 black_list::get_u32_param() { return m_victims.size(); } -void black_list::reset_game() { m_victims.clear(); } -void black_list::OnPlayerKilled( - u16 killer_id, u16 target_id, u16 weapon_id, std::pair kill_type) -{ - game_PlayerState* tmp_local_player = m_owner->get_local_player(); - if (!tmp_local_player) - return; - - if (killer_id != tmp_local_player->GameID) - return; - - game_PlayerState* victim_player = Game().GetPlayerByGameID(target_id); - if (!victim_player) - return; - - m_victims.emplace(shared_str(victim_player->getName()), Device.dwTimeGlobal); -} - -void black_list::OnPlayerSpawned(game_PlayerState const* ps) -{ - if (ps == m_owner->get_local_player()) - { - m_victims.clear(); - } -} - -} // namespace award_system diff --git a/src/xrGame/black_list.h b/src/xrGame/black_list.h deleted file mode 100644 index e60e762e092..00000000000 --- a/src/xrGame/black_list.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef BLACK_LIST_INCLUDED -#define BLACK_LIST_INCLUDED - -#include "player_state_param.h" -#include "accumulative_states.h" - -namespace award_system -{ -class black_list : public player_state_param -{ - typedef player_state_param inherited; - -public: - black_list(game_state_accumulator* owner) : inherited(owner) {} - ~black_list(){}; - - virtual void update(){}; - virtual u32 get_u32_param(); - virtual float get_float_param() { return 0.0f; }; - virtual void reset_game(); - - virtual void OnPlayerKilled( - u16 killer_id, u16 target_id, u16 weapon_id, std::pair kill_type); - virtual void OnPlayerSpawned(game_PlayerState const* ps); - -protected: - // data of the vector is u32 - kill time - AssociativeVector m_victims; -}; // class black_list - -} // namespace award_system - -#endif //#ifndef BLACK_LIST_INCLUDED diff --git a/src/xrGame/bone_groups.cpp b/src/xrGame/bone_groups.cpp deleted file mode 100644 index 06abc3df2f5..00000000000 --- a/src/xrGame/bone_groups.cpp +++ /dev/null @@ -1,41 +0,0 @@ -#include "StdAfx.h" -#include "bone_groups.h" -#include "Actor.h" -#include "Include/xrRender/Kinematics.h" - -namespace award_system -{ -bone_group::bone_group() {} -bone_group::~bone_group() {} -void bone_group::init(CActor* actor_ptr) -{ - if (!m_bone_groups.empty()) - return; - - IKinematics* V = smart_cast(actor_ptr->Visual()); - VERIFY(V); - - m_bone_groups.emplace(V->LL_BoneID("bip01_head"), gid_head); - - m_bone_groups.emplace(V->LL_BoneID("eye_left"), gid_eyes); - m_bone_groups.emplace(V->LL_BoneID("eye_right"), gid_eyes); - - m_bone_groups.emplace(V->LL_BoneID("bip01_spine"), gid_spine); - m_bone_groups.emplace(V->LL_BoneID("bip01_spine1"), gid_spine); - m_bone_groups.emplace(V->LL_BoneID("bip01_spine2"), gid_spine); - m_bone_groups.emplace(V->LL_BoneID("bip01_spine2"), gid_spine); -} - -bool bone_group::is_bone_in_group(u16 bone_id, enum_group_id gid) const -{ - if (gid == gid_any) - return true; - - bone_groups_map_t::const_iterator tmp_iter = m_bone_groups.find(bone_id); - if (tmp_iter == m_bone_groups.end()) - return false; - - return (tmp_iter->second == gid); -} - -} // namespace award_system diff --git a/src/xrGame/bone_groups.h b/src/xrGame/bone_groups.h deleted file mode 100644 index 374a3b5fdcb..00000000000 --- a/src/xrGame/bone_groups.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef BONE_GROUP_INCLUDED -#define BONE_GROUP_INCLUDED - -#include "xrCore/Containers/AssociativeVector.hpp" - -class CActor; - -namespace award_system -{ -class bone_group -{ -public: - enum enum_group_id : u16 - { - gid_head = 0x00, - gid_eyes, - gid_spine, - }; // enum enum_group_id - static u16 constexpr gid_any = u16(-1); - - bone_group(); - ~bone_group(); - - void init(CActor* first_spawned_actor); - bool is_bone_in_group(u16 bone_id, enum_group_id gid) const; - -private: - typedef AssociativeVector bone_groups_map_t; - - bone_groups_map_t m_bone_groups; -}; // class bone_group - -} // namespace award_system - -#endif //#ifndef BONE_GROUP_INCLUDED diff --git a/src/xrGame/command_switch_counter.h b/src/xrGame/command_switch_counter.h deleted file mode 100644 index 39dfc4f9ca3..00000000000 --- a/src/xrGame/command_switch_counter.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef COMMAND_SWITCH_COUNTER_INCLUDED -#define COMMAND_SWITCH_COUNTER_INCLUDED - -#include "player_state_param.h" -#include "accumulative_states.h" - -namespace award_system -{ -class command_switch_counter : public player_state_param -{ - typedef player_state_param inherited; - -public: - command_switch_counter(game_state_accumulator* owner) : inherited(owner) {} - virtual ~command_switch_counter(){} - - virtual void update(){}; - virtual u32 get_u32_param() { return m_counter; }; - virtual float get_float_param() { return 0.0f; }; - virtual void reset_game() { m_counter = 0; }; - virtual void OnPlayerChangeTeam(s8 team) { ++m_counter; }; -private: - u32 m_counter{}; -}; // class command_switch_counter - -} // namespace award_system - -#endif //#ifndef COMMAND_SWITCH_COUNTER_INCLUDED diff --git a/src/xrGame/double_shot_double_kill.cpp b/src/xrGame/double_shot_double_kill.cpp deleted file mode 100644 index 1d69df16e79..00000000000 --- a/src/xrGame/double_shot_double_kill.cpp +++ /dev/null @@ -1,61 +0,0 @@ -#include "StdAfx.h" -#include "double_shot_double_kill.h" -#include "game_base.h" -#include "Level.h" -#include "game_state_accumulator.h" - -namespace award_system -{ -u32 double_shot_double_kill::get_u32_param() -{ - if (m_kills.size() == 2) - { - kills_times_t::const_iterator last_shot = m_kills.begin(); - ++last_shot; - kills_times_t::const_iterator first_shot = m_kills.begin(); - if ((last_shot->m_shot_number - first_shot->m_shot_number) != 1) - return u32(-1); - - return (last_shot->m_shot_time - first_shot->m_shot_time); - } - return u32(-1); -} - -void double_shot_double_kill::reset_game() -{ - m_kills.clear(); - m_shot_count = 0; -} - -void double_shot_double_kill::OnWeapon_Fire(u16 sender, u16 sender_weapon_id) -{ - game_PlayerState* tmp_local_player = m_owner->get_local_player(); - if (!tmp_local_player) - return; - - if (sender != tmp_local_player->GameID) - return; - - ++m_shot_count; -} - -void double_shot_double_kill::OnPlayerKilled( - u16 killer_id, u16 target_id, u16 weapon_id, std::pair kill_type) -{ - game_PlayerState* tmp_local_player = m_owner->get_local_player(); - if (!tmp_local_player) - return; - - if (killer_id != tmp_local_player->GameID) - return; - - if (!m_owner->is_item_in_group(m_owner->get_object_id(weapon_id), ammunition_group::gid_double_barred)) - { - return; - } - kill_shot_id tmp_kill_shot; - tmp_kill_shot.m_shot_number = m_shot_count; - tmp_kill_shot.m_shot_time = Device.dwTimeGlobal; - m_kills.push_obsolete(tmp_kill_shot); -} -} diff --git a/src/xrGame/double_shot_double_kill.h b/src/xrGame/double_shot_double_kill.h deleted file mode 100644 index b7f0f5887a0..00000000000 --- a/src/xrGame/double_shot_double_kill.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef DOUBLE_SHOT_DOUBLE_KILL_INCLUDED -#define DOUBLE_SHOT_DOUBLE_KILL_INCLUDED - -#include "player_state_param.h" -#include "obsolete_queue.h" -#include "accumulative_states.h" - -namespace award_system -{ -class double_shot_double_kill : public player_state_param -{ - typedef player_state_param inherited; - -public: - double_shot_double_kill(game_state_accumulator* owner) : inherited(owner) {} - virtual ~double_shot_double_kill(){}; - - virtual void update(){}; - virtual u32 get_u32_param(); - virtual float get_float_param() { return 0.0f; }; - virtual void reset_game(); - - virtual void OnWeapon_Fire(u16 sender, u16 sender_weapon_id); - virtual void OnPlayerKilled( - u16 killer_id, u16 target_id, u16 weapon_id, std::pair kill_type); - -protected: - struct kill_shot_id - { - u32 m_shot_number; - u32 m_shot_time; - }; - - typedef obsolete_queue, 2> kills_times_t; - - kills_times_t m_kills; - u32 m_shot_count{}; -}; // class double_shot_double_kill - -} // namespace award_system - -#endif //#ifndef DOUBLE_SHOT_DOUBLE_KILL_INCLUDED diff --git a/src/xrGame/event_conditions_collection.cpp b/src/xrGame/event_conditions_collection.cpp deleted file mode 100644 index 48211a67621..00000000000 --- a/src/xrGame/event_conditions_collection.cpp +++ /dev/null @@ -1,336 +0,0 @@ -#include "StdAfx.h" -#include "event_conditions_collection.h" -#include "Common/object_broker.h" -#include "game_state_accumulator.h" -#include "Level.h" -#include "game_cl_base.h" - -namespace award_system -{ -event_conditions_collection::event_conditions_collection( - game_state_accumulator* pstate_accum, event_action_delegate_t ea_delegate) - : m_player_state_accum(pstate_accum), m_event_action(ea_delegate) -{ -} - -event_conditions_collection::~event_conditions_collection() -{ - m_root_conditions.clear(); - delete_data(m_all_conditions); -} - -void event_conditions_collection::clear_events() -{ - m_root_conditions.clear(); - delete_data(m_all_conditions); -} - -void event_conditions_collection::check_for_events() -{ - // std::foreach - for (event_root_conditions_t::iterator i = m_root_conditions.begin(), ie = m_root_conditions.end(); i != ie; ++i) - { - execute_root_condtiion(*i); - } -} - -event_condition_t* event_conditions_collection::add_condition( - enum_event_operation operation, buffer_vector& arguments) -{ - event_condition_t* tmp_condition = xr_new(); - tmp_condition->m_operation = operation; - - for (buffer_vector::const_iterator i = arguments.begin(), ie = arguments.end(); i != ie; ++i) - { - tmp_condition->m_arguments.push_back(*i); - } - - m_all_conditions.push_back(tmp_condition); - return tmp_condition; -} - -void event_conditions_collection::add_event( - event_condition_t* root_condition, u32 const max_rise_count, u32 const game_id_mask, u32 const delegate_argument) -{ - event_root_condition_t tmp_root_condition; - tmp_root_condition.m_delegate_argument = delegate_argument; - tmp_root_condition.m_rise_count = max_rise_count; - tmp_root_condition.m_game_mask = game_id_mask; - tmp_root_condition.m_root_condition = root_condition; - m_root_conditions.push_back(tmp_root_condition); -} - -//-----executing condiditons ---- - -bool event_conditions_collection::logical_and(arguments_t& arguments) -{ - VERIFY(arguments.size() >= 2); - bool result = true; - for (arguments_t::iterator i = arguments.begin(), ie = arguments.end(); i != ie; ++i) - { - VERIFY(i->m_argument_type_tag == event_argument_type::at_condition); - result &= execute_condition(i->m_argument_value.cond_ptr_value); - if (!result) - return false; - } - return true; -} - -bool event_conditions_collection::logical_or(arguments_t& arguments) -{ - VERIFY(arguments.size() >= 2); - bool result = false; - for (arguments_t::iterator i = arguments.begin(), ie = arguments.end(); i != ie; ++i) - { - VERIFY(i->m_argument_type_tag == event_argument_type::at_condition); - result |= execute_condition(i->m_argument_value.cond_ptr_value); - if (result) - return true; - } - return false; -} - -enum enum_hit_params_args -{ - hpa_hit_count = 0x00, - hpa_hit_wpn_group_id, - hpa_hit_bone_group_id, - hpa_bfunc, - hpa_hit_distance, - hpa_args_count -}; // enum enum_hit_params_args - -bool event_conditions_collection::hit_params(arguments_t& arguments) -{ - VERIFY(arguments.size() == hpa_args_count); - VERIFY(arguments[hpa_hit_count].m_argument_type_tag == event_argument_type::at_u32); - VERIFY(arguments[hpa_hit_wpn_group_id].m_argument_type_tag == event_argument_type::at_u16); - VERIFY(arguments[hpa_hit_bone_group_id].m_argument_type_tag == event_argument_type::at_u16); - VERIFY(arguments[hpa_bfunc].m_argument_type_tag == event_argument_type::at_float_bfunction); - VERIFY(arguments[hpa_hit_distance].m_argument_type_tag == event_argument_type::at_float); - - return m_player_state_accum->check_hit_params(arguments[hpa_hit_count].m_argument_value.u32_value, - static_cast(arguments[hpa_hit_wpn_group_id].m_argument_value.u16_value), - static_cast(arguments[hpa_hit_bone_group_id].m_argument_value.u16_value), - arguments[hpa_bfunc].m_argument_value.float_function_ptr, - arguments[hpa_hit_distance].m_argument_value.float_value); -} - -enum enum_kill_params_args -{ - kpa_kill_count = 0x00, - kpa_kill_wpn_group_id, - kpa_kill_kill_type, - kpa_kill_spec_kill_type, - kpa_kill_time_period, - kpa_args_count -}; // enum enum_kill_params_args - -bool event_conditions_collection::kill_params(arguments_t& arguments) -{ - VERIFY(arguments.size() == kpa_args_count); - VERIFY(arguments[kpa_kill_count].m_argument_type_tag == event_argument_type::at_u32); - VERIFY(arguments[kpa_kill_wpn_group_id].m_argument_type_tag == event_argument_type::at_u16); - VERIFY(arguments[kpa_kill_kill_type].m_argument_type_tag == event_argument_type::at_u16); - VERIFY(arguments[kpa_kill_spec_kill_type].m_argument_type_tag == event_argument_type::at_u16); - VERIFY(arguments[kpa_kill_time_period].m_argument_type_tag == event_argument_type::at_u32); - - return m_player_state_accum->check_kill_params(arguments[kpa_kill_count].m_argument_value.u32_value, - static_cast(arguments[kpa_kill_wpn_group_id].m_argument_value.u16_value), - static_cast(arguments[kpa_kill_kill_type].m_argument_value.u16_value), - static_cast(arguments[kpa_kill_spec_kill_type].m_argument_value.u16_value), - arguments[kpa_kill_time_period].m_argument_value.u32_value); -} - -enum enum_accumul_params_args -{ - cpa_param_id, - cpa_bfunc, - cpa_value, - cpa_args_count -}; // enum enum_accumul_params_args - -bool event_conditions_collection::accumul_params(arguments_t& arguments) -{ - VERIFY(arguments.size() == cpa_args_count); - VERIFY(arguments[cpa_param_id].m_argument_type_tag == event_argument_type::at_u16); - VERIFY((arguments[cpa_bfunc].m_argument_type_tag == event_argument_type::at_float_bfunction) || - (arguments[cpa_bfunc].m_argument_type_tag == event_argument_type::at_u32_bfunction)); - VERIFY((arguments[cpa_value].m_argument_type_tag == event_argument_type::at_float) || - (arguments[cpa_value].m_argument_type_tag == event_argument_type::at_u32)); - if (arguments[cpa_value].m_argument_type_tag == event_argument_type::at_float) - { - return m_player_state_accum->check_accumulative_value( - static_cast(arguments[cpa_param_id].m_argument_value.u16_value), - arguments[cpa_bfunc].m_argument_value.float_function_ptr, - arguments[cpa_value].m_argument_value.float_value); - } - return m_player_state_accum->check_accumulative_value( - static_cast(arguments[cpa_param_id].m_argument_value.u16_value), - arguments[cpa_bfunc].m_argument_value.u32_function_ptr, arguments[cpa_value].m_argument_value.u32_value); -} - -bool event_conditions_collection::execute_condition(event_condition_t* cond) -{ - VERIFY(cond); - bool result = false; - switch (cond->m_operation) - { - case eo_logical_and: result = logical_and(cond->m_arguments); break; - case eo_logical_or: result = logical_or(cond->m_arguments); break; - case eo_hit_params: result = hit_params(cond->m_arguments); break; - case eo_kill_params: result = kill_params(cond->m_arguments); break; - case eo_accumul_value_params: result = accumul_params(cond->m_arguments); break; - }; // switch (cond->m_operation) - return result; -} - -void event_conditions_collection::execute_root_condtiion(event_root_conditions_t::value_type& rcond) -{ - if (!rcond.m_rise_count) - return; - - if ((rcond.m_game_mask & Game().Type()) == 0) - return; - - VERIFY(rcond.m_root_condition); - if (execute_condition(rcond.m_root_condition)) - { - m_event_action(rcond.m_delegate_argument); - --rcond.m_rise_count; - } -} - -//---helper functions ---- - -event_condition_t* event_conditions_collection::add_and_condition(event_condition_t* left, event_condition_t* right) -{ - buffer_vector args_buffer(xr_alloca(sizeof(event_argument_type) * 2), 2); - event_argument_type tmp_arg; - tmp_arg.m_argument_type_tag = event_argument_type::at_condition; - tmp_arg.m_argument_value.cond_ptr_value = left; - args_buffer.push_back(tmp_arg); - - tmp_arg.m_argument_value.cond_ptr_value = right; - args_buffer.push_back(tmp_arg); - - return add_condition(eo_logical_and, args_buffer); -} - -event_condition_t* event_conditions_collection::add_or_condition(event_condition_t* left, event_condition_t* right) -{ - buffer_vector args_buffer(xr_alloca(sizeof(event_argument_type) * 2), 2); - event_argument_type tmp_arg; - tmp_arg.m_argument_type_tag = event_argument_type::at_condition; - tmp_arg.m_argument_value.cond_ptr_value = left; - args_buffer.push_back(tmp_arg); - - tmp_arg.m_argument_value.cond_ptr_value = right; - args_buffer.push_back(tmp_arg); - - return add_condition(eo_logical_or, args_buffer); -} - -event_condition_t* event_conditions_collection::add_hit_condition_dist( - u32 hit_counts, u16 weapon_id, u16 bone_id, float_binary_function* fbfunc, float distanse) -{ - buffer_vector args_buffer( - xr_alloca(sizeof(event_argument_type) * hpa_args_count), hpa_args_count); - event_argument_type tmp_arg; - tmp_arg.m_argument_type_tag = event_argument_type::at_u32; - tmp_arg.m_argument_value.u32_value = hit_counts; - args_buffer.push_back(tmp_arg); - - tmp_arg.m_argument_type_tag = event_argument_type::at_u16; - tmp_arg.m_argument_value.u16_value = weapon_id; - args_buffer.push_back(tmp_arg); - - tmp_arg.m_argument_type_tag = event_argument_type::at_u16; - tmp_arg.m_argument_value.u16_value = bone_id; - args_buffer.push_back(tmp_arg); - - tmp_arg.m_argument_type_tag = event_argument_type::at_float_bfunction; - tmp_arg.m_argument_value.float_function_ptr = fbfunc; - args_buffer.push_back(tmp_arg); - - tmp_arg.m_argument_type_tag = event_argument_type::at_float; - tmp_arg.m_argument_value.float_value = distanse; - args_buffer.push_back(tmp_arg); - - return add_condition(eo_hit_params, args_buffer); -} - -event_condition_t* event_conditions_collection::add_kill_condition_dist( - u32 kill_counts, u16 weapon_id, u16 kill_type, u16 special_kill_type, u32 time_period) -{ - buffer_vector args_buffer( - xr_alloca(sizeof(event_argument_type) * kpa_args_count), kpa_args_count); - event_argument_type tmp_arg; - tmp_arg.m_argument_type_tag = event_argument_type::at_u32; - tmp_arg.m_argument_value.u32_value = kill_counts; - args_buffer.push_back(tmp_arg); - - tmp_arg.m_argument_type_tag = event_argument_type::at_u16; - tmp_arg.m_argument_value.u16_value = weapon_id; - args_buffer.push_back(tmp_arg); - - tmp_arg.m_argument_type_tag = event_argument_type::at_u16; - tmp_arg.m_argument_value.u16_value = kill_type; - args_buffer.push_back(tmp_arg); - - tmp_arg.m_argument_type_tag = event_argument_type::at_u16; - tmp_arg.m_argument_value.u16_value = special_kill_type; - args_buffer.push_back(tmp_arg); - - tmp_arg.m_argument_type_tag = event_argument_type::at_u32; - tmp_arg.m_argument_value.u32_value = time_period; - args_buffer.push_back(tmp_arg); - - return add_condition(eo_kill_params, args_buffer); -} - -event_condition_t* event_conditions_collection::add_accumm_value_condition( - u16 param_id, float_binary_function* fbfunc, float argument) -{ - buffer_vector args_buffer( - xr_alloca(sizeof(event_argument_type) * cpa_args_count), cpa_args_count); - event_argument_type tmp_arg; - - tmp_arg.m_argument_type_tag = event_argument_type::at_u16; - tmp_arg.m_argument_value.u16_value = param_id; - args_buffer.push_back(tmp_arg); - - tmp_arg.m_argument_type_tag = event_argument_type::at_float_bfunction; - tmp_arg.m_argument_value.float_function_ptr = fbfunc; - args_buffer.push_back(tmp_arg); - - tmp_arg.m_argument_type_tag = event_argument_type::at_float; - tmp_arg.m_argument_value.float_value = argument; - args_buffer.push_back(tmp_arg); - - return add_condition(eo_accumul_value_params, args_buffer); -} - -event_condition_t* event_conditions_collection::add_accumm_value_condition( - u16 param_id, u32_binary_function* fbfunc, u32 argument) -{ - buffer_vector args_buffer( - xr_alloca(sizeof(event_argument_type) * cpa_args_count), cpa_args_count); - event_argument_type tmp_arg; - - tmp_arg.m_argument_type_tag = event_argument_type::at_u16; - tmp_arg.m_argument_value.u16_value = param_id; - args_buffer.push_back(tmp_arg); - - tmp_arg.m_argument_type_tag = event_argument_type::at_u32_bfunction; - tmp_arg.m_argument_value.u32_function_ptr = fbfunc; - args_buffer.push_back(tmp_arg); - - tmp_arg.m_argument_type_tag = event_argument_type::at_u32; - tmp_arg.m_argument_value.u32_value = argument; - args_buffer.push_back(tmp_arg); - - return add_condition(eo_accumul_value_params, args_buffer); -} - -} // namespace award_system diff --git a/src/xrGame/event_conditions_collection.h b/src/xrGame/event_conditions_collection.h deleted file mode 100644 index e360367a45d..00000000000 --- a/src/xrGame/event_conditions_collection.h +++ /dev/null @@ -1,120 +0,0 @@ -#ifndef EVENT_CONDITIONS_COLLECTION_INCLUDED -#define EVENT_CONDITIONS_COLLECTION_INCLUDED - -#include "state_arguments_functions.h" - -// fwd. decl. -template class buffer_vector; - -namespace award_system -{ -class game_state_accumulator; - -enum enum_event_operation -{ - // binary predicates - eo_logical_and = 0x00, - eo_logical_or, - // player predicates - eo_hit_params, // count, weapon_id, bone_id, operation for fly_dist, bullet fly_dist argument - eo_kill_params, // count, weapon_id, bone_id, operation for fly_dist, bullet fly_dist argument - eo_accumul_value_params // param name, operation for argument, argument -}; // enum enum_event_operation - -struct event_condition_t; - -struct event_argument_type -{ - enum enum_argument_type - { - at_u16 = 0x00, - at_u32, - at_float, - at_float_bfunction, - at_u32_bfunction, - at_operation, - at_condition - }; // enum enum_type - - union union_argument_value - { - u16 u16_value; - u32 u32_value; - float float_value; - float_binary_function* float_function_ptr; - u32_binary_function* u32_function_ptr; - enum_event_operation operation_value; - event_condition_t* cond_ptr_value; - }; // union union_argument_value - - enum_argument_type m_argument_type_tag; - union_argument_value m_argument_value; -}; // struct event_argument_type -typedef xr_vector arguments_t; - -struct event_condition_t -{ - enum_event_operation m_operation; - arguments_t m_arguments; -}; // struct event_condition_t - -struct event_root_condition_t -{ - u32 m_delegate_argument; - u32 m_rise_count; - u32 m_game_mask; - event_condition_t* m_root_condition; -}; // event_root_condition_t - -typedef fastdelegate::FastDelegate event_action_delegate_t; - -class event_conditions_collection -{ -public: - explicit event_conditions_collection(game_state_accumulator* pstate_accum, event_action_delegate_t ea_delegate); - virtual ~event_conditions_collection(); - virtual void init() = 0; - void check_for_events(); - void clear_events(); - -protected: - event_condition_t* add_condition(enum_event_operation operation, buffer_vector& arguments); - void add_event(event_condition_t* root_condition, u32 const max_rise_count, u32 const game_id_mask, - u32 const delegate_argument); - // helper functions - event_condition_t* add_or_condition(event_condition_t* left, event_condition_t* right); - event_condition_t* add_and_condition(event_condition_t* left, event_condition_t* right); - - event_condition_t* add_hit_condition_dist( - u32 hit_counts, u16 weapon_id, u16 bone_id, float_binary_function* fbfunc, float distanse); - event_condition_t* add_kill_condition_dist( - u32 kill_counts, u16 weapon_id, u16 kill_type, u16 special_kill_type, u32 time_period = u32(-1)); - - event_condition_t* add_accumm_value_condition(u16 param_id, float_binary_function* fbfunc, float argument); - event_condition_t* add_accumm_value_condition(u16 param_id, u32_binary_function* fbfunc, u32 argument); - -private: - typedef xr_vector event_conditions_t; - typedef xr_vector event_root_conditions_t; - - game_state_accumulator* m_player_state_accum; - event_action_delegate_t m_event_action; - - event_conditions_t m_all_conditions; - event_root_conditions_t m_root_conditions; - - // operation implementations - bool logical_and(arguments_t& arguments); - bool logical_or(arguments_t& arguments); - - bool hit_params(arguments_t& arguments); - bool kill_params(arguments_t& arguments); - bool accumul_params(arguments_t& arguments); - - bool execute_condition(event_condition_t* cond); - void execute_root_condtiion(event_root_conditions_t::value_type& rcond); -}; // class event_conditions_collection - -} // namespace award_system - -#endif //#ifndef EVENT_CONDITIONS_COLLECTION_INCLUDED diff --git a/src/xrGame/faster_than_bullets_time.cpp b/src/xrGame/faster_than_bullets_time.cpp deleted file mode 100644 index 3cfd56ecb78..00000000000 --- a/src/xrGame/faster_than_bullets_time.cpp +++ /dev/null @@ -1,72 +0,0 @@ -#include "StdAfx.h" -#include "faster_than_bullets_time.h" -#include "hits_store.h" -#include "game_state_accumulator.h" -#include "Level.h" - -namespace award_system -{ -u32 faster_than_bullets_time::get_u32_param() { return m_no_demag_time; } -void faster_than_bullets_time::reset_game() { m_no_demag_time = u32(-1); } -struct last_hits_fetcher -{ - typedef hits_store::bullet_hits_map_t::key_type key_type; - last_hits_fetcher(shared_str const& killer_name, shared_str const& victim_name) - : m_killer_name(killer_name), m_victim_name(victim_name) - { - m_last_hit_time = 0; - }; - - last_hits_fetcher& operator=(last_hits_fetcher const& copy) - { - m_killer_name = copy.m_killer_name; - m_victim_name = copy.m_victim_name; - m_last_hit_time = copy.m_last_hit_time; - return *this; - } - - bool operator()(shared_str const& k_name, shared_str const& v_name, hits_store::bullet_hit const& hit) - { - if ((k_name == m_killer_name) && (v_name == m_victim_name)) - { - if (hit.m_hit_time > m_last_hit_time) - { - m_last_hit_time = hit.m_hit_time; - return true; - } - } - return false; - } - - shared_str m_killer_name; - shared_str m_victim_name; - u32 m_last_hit_time; -}; - -void faster_than_bullets_time::OnPlayerKilled( - u16 killer_id, u16 target_id, u16 weapon_id, std::pair kill_type) -{ - game_PlayerState* tmp_local_player = m_owner->get_local_player(); - if (!tmp_local_player) - return; - - if ((killer_id != tmp_local_player->GameID) || (kill_type.second != SKT_KNIFEKILL)) - { - return; - } - - IGameObject* victim_obj = Level().Objects.net_Find(target_id); - if (!victim_obj) - return; - - last_hits_fetcher tmp_predicate(victim_obj->cName(), tmp_local_player->getName()); - buffer_vector tmp_hits_result(NULL, 0); - - if (m_owner->get_hits_store().fetch_hits(tmp_predicate, tmp_hits_result)) - { - VERIFY(tmp_predicate.m_last_hit_time); - m_no_demag_time = Device.dwTimeGlobal - tmp_predicate.m_last_hit_time; - } -} - -} // namespace award_system diff --git a/src/xrGame/faster_than_bullets_time.h b/src/xrGame/faster_than_bullets_time.h deleted file mode 100644 index 1ea49257196..00000000000 --- a/src/xrGame/faster_than_bullets_time.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef FASTER_THAN_BULLETS_INCLUDED -#define FASTER_THAN_BULLETS_INCLUDED - -#include "player_state_param.h" -#include "accumulative_states.h" - -namespace award_system -{ -class faster_than_bullets_time : public player_state_param -{ - typedef player_state_param inherited; - -public: - faster_than_bullets_time(game_state_accumulator* owner) : inherited(owner) {} - virtual ~faster_than_bullets_time(){}; - - virtual void update(){}; - virtual u32 get_u32_param(); - virtual float get_float_param() { return 0.0f; }; - virtual void reset_game(); - - virtual void OnPlayerKilled( - u16 killer_id, u16 target_id, u16 weapon_id, std::pair kill_type); - -protected: - u32 m_no_demag_time{ u32(-1) }; -}; // class faster_than_bullets_time - -} // namespace award_system - -#endif //#ifndef FASTER_THAN_BULLETS_INCLUDED diff --git a/src/xrGame/game_cl_artefacthunt.cpp b/src/xrGame/game_cl_artefacthunt.cpp index 87a8853118b..107c64aa414 100644 --- a/src/xrGame/game_cl_artefacthunt.cpp +++ b/src/xrGame/game_cl_artefacthunt.cpp @@ -27,8 +27,6 @@ #include "game_cl_artefacthunt_snd_msg.h" #include "xrEngine/IGame_Persistent.h" -#include "reward_event_generator.h" - namespace detail::mp::ahunt { //static constexpr pcstr TEAM0_MENU = "artefacthunt_team0"; @@ -188,9 +186,6 @@ void game_cl_ArtefactHunt::TranslateGameMessage(u32 msg, NET_Packet& P) if (!pPlayer) break; - if (m_reward_generator) - m_reward_generator->OnPlayerTakeArtefact(pPlayer); - xr_sprintf(tmp, "%s%s", "%s%s %s", *st.translate("mp_has_tak_art")); xr_sprintf(Text, tmp, CTeamInfo::GetTeam_color_tag(int(Team)), pPlayer->getName(), Color_Main, Color_Artefact); @@ -218,9 +213,6 @@ void game_cl_ArtefactHunt::TranslateGameMessage(u32 msg, NET_Packet& P) if (!pPlayer) break; - if (m_reward_generator) - m_reward_generator->OnPlayerDropArtefact(pPlayer); - xr_sprintf(tmp, "%s%s", "%s%s %s", *st.translate("mp_has_drop_art")); xr_sprintf(Text, tmp, CTeamInfo::GetTeam_color_tag(int(Team)), pPlayer->getName(), Color_Main, Color_Artefact); @@ -241,9 +233,6 @@ void game_cl_ArtefactHunt::TranslateGameMessage(u32 msg, NET_Packet& P) if (!pPlayer) break; - if (m_reward_generator) - m_reward_generator->OnPlayerBringArtefact(pPlayer); - xr_sprintf(tmp, "%s%s", "%s%s %s", *st.translate("mp_scores")); xr_sprintf(Text, tmp, CTeamInfo::GetTeam_color_tag(int(Team)), CTeamInfo::GetTeam_name(int(Team)), Color_Main); @@ -265,8 +254,6 @@ void game_cl_ArtefactHunt::TranslateGameMessage(u32 msg, NET_Packet& P) xr_sprintf(Text, "%s%s", Color_Main, *st.translate("mp_art_spowned")); if (CurrentGameUI()) CurrentGameUI()->CommonMessageOut(Text); - if (m_reward_generator) - m_reward_generator->OnArtefactSpawned(); PlaySndMessage(ID_NEW_AF); } diff --git a/src/xrGame/game_cl_capture_the_artefact.cpp b/src/xrGame/game_cl_capture_the_artefact.cpp index 46c0956250b..bca34bc726e 100644 --- a/src/xrGame/game_cl_capture_the_artefact.cpp +++ b/src/xrGame/game_cl_capture_the_artefact.cpp @@ -28,8 +28,6 @@ #include "game_cl_artefacthunt_snd_msg.h" #include "game_cl_deathmatch_snd_messages.h" -#include "reward_event_generator.h" - #ifndef MASTER_GOLD #define CLIENT_CTA_LOG #endif @@ -217,11 +215,6 @@ void game_cl_CaptureTheArtefact::shedule_Update(u32 dt) m_captions_manager.SetWinnerTeam(etBlueTeam); } m_winnerTeamShowed = TRUE; - if (m_reward_generator) - { - m_reward_generator->OnRoundEnd(); - m_reward_generator->CommitBestResults(); - } } } break; @@ -295,8 +288,6 @@ void game_cl_CaptureTheArtefact::TranslateGameMessage(u32 msg, NET_Packet& P) Color_Main, st.translate("mp_captured_artefact").c_str()); PlayCapturedTheArtefact(ps); - if (m_reward_generator) - m_reward_generator->OnPlayerTakeArtefact(ps); if (artefactOwnerTeam == static_cast(etGreenTeam)) { @@ -312,8 +303,6 @@ void game_cl_CaptureTheArtefact::TranslateGameMessage(u32 msg, NET_Packet& P) xr_sprintf(Text, "%s%s", Color_Main, *st.translate("mp_you_captured_artefact")); PlayCapturedTheArtefact(ps); - if (m_reward_generator) - m_reward_generator->OnPlayerTakeArtefact(ps); if (artefactOwnerTeam == static_cast(etGreenTeam)) { @@ -362,9 +351,6 @@ void game_cl_CaptureTheArtefact::TranslateGameMessage(u32 msg, NET_Packet& P) xr_sprintf(Text, "%s%s %s%s", CTeamInfo::GetTeam_color_tag(ModifyTeam(ps->team) + 1), ps->getName(), Color_Main, st.translate("mp_has_dropped_artefact").c_str()); // need translate - - if (m_reward_generator) - m_reward_generator->OnPlayerDropArtefact(ps); } else { @@ -386,9 +372,6 @@ void game_cl_CaptureTheArtefact::TranslateGameMessage(u32 msg, NET_Packet& P) if (!local_player) // can be NULL, because not actor or spectator spawned yet... return; - if (m_reward_generator) - m_reward_generator->OnPlayerBringArtefact(ps); - if (delivererTeam == local_player->team) { // artefact on base ! @@ -695,7 +678,6 @@ void game_cl_CaptureTheArtefact::OnGameMenuRespond_ChangeSkin(NET_Packet& P) m_bSkinSelected = TRUE; m_bSpectatorSelected = FALSE; Msg("* player [%s][%d] changed skin to %d", local_player->getName(), local_player->GameID, local_player->skin); - ReInitRewardGenerator(local_player); // SpawnMe(); } @@ -727,8 +709,6 @@ void game_cl_CaptureTheArtefact::OnGameMenuRespond_ChangeTeam(NET_Packet& P) m_game_ui->UpdateBuyMenu(teamSection, BASECOST_SECTION); m_game_ui->UpdateSkinMenu(teamSection);*/ OnTeamChanged(); - if (m_reward_generator) - m_reward_generator->OnPlayerChangeTeam(local_player->team); if (CanCallSkinMenu()) { m_game_ui->ShowSkinMenu(local_player->skin); @@ -858,12 +838,6 @@ void game_cl_CaptureTheArtefact::OnSpawn(IGameObject* pObj) if (!ps) return; - if (m_reward_generator) - { - m_reward_generator->init_bone_groups(pActor); - m_reward_generator->OnPlayerSpawned(ps); - } - // VERIFY(ps); if ((ps->team == local_player->team) && (ps != local_player)) { @@ -1162,7 +1136,6 @@ void game_cl_CaptureTheArtefact::OnTeamChanged() m_game_ui->UpdateSkinMenu(temp_section); m_game_ui->SetRank(static_cast(local_player->team), local_player->rank); m_game_ui->ReInitPlayerDefItems(); - ReInitRewardGenerator(local_player); UpdateMapLocations(); } @@ -1176,8 +1149,6 @@ void game_cl_CaptureTheArtefact::OnGameRoundStarted() Msg("--- CTA: Round started !!!"); #endif // #ifdef DEBUG } - if (m_reward_generator) - m_reward_generator->OnRoundStart(); } void game_cl_CaptureTheArtefact::OnTeamScoresChanged() diff --git a/src/xrGame/game_cl_deathmatch.cpp b/src/xrGame/game_cl_deathmatch.cpp index f58809216b1..e5353e9da1f 100644 --- a/src/xrGame/game_cl_deathmatch.cpp +++ b/src/xrGame/game_cl_deathmatch.cpp @@ -20,7 +20,6 @@ #include "Weapon.h" #include "game_cl_base_weapon_usage_statistic.h" -#include "reward_event_generator.h" #include "game_cl_deathmatch_snd_messages.h" #include "game_base_menu_events.h" @@ -140,11 +139,6 @@ void game_cl_Deathmatch::net_import_state(NET_Packet& P) { PlaySndMessage(ID_YOU_WON); } - if (NeedSndMessage && m_reward_generator) - { - m_reward_generator->OnRoundEnd(); - m_reward_generator->CommitBestResults(); - } } break; } @@ -996,13 +990,6 @@ void game_cl_Deathmatch::OnSpawn(IGameObject* pObj) { if (xr_strlen(Actor_Spawn_Effect)) PlayParticleEffect(Actor_Spawn_Effect.c_str(), pObj->Position()); - game_PlayerState* ps = GetPlayerByGameID(pActor->ID()); - - if (ps && m_reward_generator) - { - m_reward_generator->OnPlayerSpawned(ps); - m_reward_generator->init_bone_groups(pActor); - } }; if (smart_cast(pObj)) { @@ -1089,7 +1076,6 @@ void game_cl_Deathmatch::OnGameRoundStarted() if (pCurBuyMenu && pCurPresetItems) { LoadTeamDefaultPresetItems(GetTeamMenu(local_player->team), pCurBuyMenu, pCurPresetItems); - ReInitRewardGenerator(local_player); } } if (pCurBuyMenu) @@ -1156,7 +1142,6 @@ void game_cl_Deathmatch::OnGameMenuRespond_ChangeSkin(NET_Packet& P) if (pCurSkinMenu) pCurSkinMenu->SetCurSkin(local_player->skin); SetCurrentBuyMenu(); - ReInitRewardGenerator(local_player); m_bSpectatorSelected = FALSE; if (m_bMenuCalledFromReady) diff --git a/src/xrGame/game_cl_mp.cpp b/src/xrGame/game_cl_mp.cpp index 314c13b3683..332cc7a02a3 100644 --- a/src/xrGame/game_cl_mp.cpp +++ b/src/xrGame/game_cl_mp.cpp @@ -34,11 +34,8 @@ #include "xrCore/Compression/rt_compressor.h" #include "game_cl_mp_snd_messages.h" -#include "reward_event_generator.h" #include "game_cl_base_weapon_usage_statistic.h" -#include "reward_manager.h" #include "login_manager.h" -#include "stats_submitter.h" #include "xrServer_info.h" //for enum_server_info_type @@ -91,9 +88,7 @@ game_cl_mp::game_cl_mp() abs(m_iSpawn_Cost)); pBuySpawnMsgBox->SetText(BuySpawnText); */ //----------------------------------------------------------- - m_reward_generator = NULL; m_ready_to_open_buy_menu = true; - m_reward_manager = NULL; }; game_cl_mp::~game_cl_mp() @@ -140,8 +135,6 @@ game_cl_mp::~game_cl_mp() xr_delete(m_pAdminMenuWindow); xr_delete(m_pMessageBox); - xr_delete(m_reward_generator); - xr_delete(m_reward_manager); local_player = NULL; }; @@ -573,11 +566,6 @@ void game_cl_mp::shedule_Update(u32 dt) if (GEnv.isDedicatedServer) return; - if (m_reward_generator) - m_reward_generator->update(); - if (m_reward_manager) - m_reward_manager->update_tasks(); - switch (Phase()) { case GAME_PHASE_PENDING: @@ -727,9 +715,6 @@ void game_cl_mp::OnSwitchPhase(u32 old_phase, u32 new_phase) { case GAME_PHASE_INPROGRESS: { - if (m_reward_generator) - m_reward_generator->OnRoundStart(); - m_bSpectatorSelected = FALSE; if (CurrentGameUI()) @@ -831,8 +816,6 @@ void game_cl_mp::OnPlayerKilled(NET_Packet& P) u16 KillerID = P.r_u16(); u16 WeaponID = P.r_u16(); SPECIAL_KILL_TYPE SpecialKill = SPECIAL_KILL_TYPE(P.r_u8()); - if (m_reward_generator) - m_reward_generator->OnPlayerKilled(KillerID, KilledID, WeaponID, std::make_pair(KillType, SpecialKill)); //----------------------------------------------------------- IGameObject* pOKiller = Level().Objects.net_Find(KillerID); IGameObject* pWeapon = Level().Objects.net_Find(WeaponID); @@ -1121,8 +1104,6 @@ void game_cl_mp::OnRankChanged(u8 OldRank) #ifdef DEBUG Msg("- %s", RankStr); #endif - if (m_reward_generator) - m_reward_generator->OnPlayerRankdChanged(); }; void game_cl_mp::net_import_update(NET_Packet& P) @@ -1891,25 +1872,6 @@ void game_cl_mp::extract_server_info(u8* data_ptr, u32 data_size) } } -void game_cl_mp::AddRewardTask(u32 const award_id) -{ - IGameObject* tmp_view_entity = Level().CurrentViewEntity(); - if ((tmp_view_entity && local_player) && (tmp_view_entity->ID() == local_player->GameID)) - { - m_reward_manager->add_task(award_id); - } -} - -void game_cl_mp::ReInitRewardGenerator(game_PlayerState* local_ps) -{ - if (!m_reward_generator) - { - m_reward_generator = xr_new(u32(-1)); - m_reward_manager = xr_new(this); - } - m_reward_generator->init_player(local_ps); -} - bool game_cl_mp::IsLocalPlayerInitialized() const { game_cl_GameState::PLAYERS_MAP const& playersMap = Game().players; diff --git a/src/xrGame/game_cl_mp.h b/src/xrGame/game_cl_mp.h index e68c9ae2a00..8d988f563ec 100644 --- a/src/xrGame/game_cl_mp.h +++ b/src/xrGame/game_cl_mp.h @@ -13,11 +13,6 @@ class CUIWindow; class CUISpeechMenu; class CUIMessageBoxEx; -namespace award_system -{ -class reward_manager; -} // namespace award_system - struct SND_Message { ref_sound pSound; @@ -112,11 +107,6 @@ class CUIVote; class CUIMessageBoxEx; class CUIMpAdminMenu; -namespace award_system -{ -class reward_event_generator; -} - class game_cl_mp : public game_cl_GameState { typedef game_cl_GameState inherited; @@ -182,9 +172,6 @@ class game_cl_mp : public game_cl_GameState virtual void LoadBonuses(); - award_system::reward_event_generator* m_reward_generator; - void ReInitRewardGenerator(game_PlayerState* local_ps); - public: game_cl_mp(); virtual ~game_cl_mp(); @@ -257,9 +244,6 @@ class game_cl_mp : public game_cl_GameState mp_anticheat::configs_dumper cd_manager; mp_anticheat::configs_verifyer cd_verifyer; - award_system::reward_event_generator* get_reward_generator() const { return m_reward_generator; }; - void AddRewardTask(u32 const award_id); - void AddSoundMessage(LPCSTR sound_name, u32 const sound_priority, u32 const soundID); void PlaySndMessage(u32 ID); typedef fastdelegate::FastDelegate player_info_reply_cb_t; @@ -272,7 +256,6 @@ class game_cl_mp : public game_cl_GameState void reinit_compress_buffer(u32 need_size); void deinit_compress_buffer(); - award_system::reward_manager* m_reward_manager; void start_receive_server_info(ClientID const& svclient_id); player_info_reply_cb_t m_players_info_reply; diff --git a/src/xrGame/game_cl_teamdeathmatch.cpp b/src/xrGame/game_cl_teamdeathmatch.cpp index a7b7dac7f10..963c3c0fdbc 100644 --- a/src/xrGame/game_cl_teamdeathmatch.cpp +++ b/src/xrGame/game_cl_teamdeathmatch.cpp @@ -18,7 +18,6 @@ #include "game_cl_teamdeathmatch_snd_messages.h" -#include "reward_event_generator.h" namespace detail::mp::tdm { @@ -106,11 +105,6 @@ void game_cl_TeamDeathmatch::net_import_state(NET_Packet& P) PlaySndMessage(ID_TEAMS_EQUAL); } }; - if ((old_phase != new_phase) && ((new_phase == GAME_PHASE_TEAM1_SCORES) || (new_phase == GAME_PHASE_TEAM2_SCORES))) - { - if (m_reward_generator) - m_reward_generator->OnRoundEnd(); - } } void game_cl_TeamDeathmatch::TranslateGameMessage(u32 msg, NET_Packet& P) { @@ -727,10 +721,6 @@ void game_cl_TeamDeathmatch::OnTeamChanged() { xr_delete(pCurBuyMenu); SetCurrentBuyMenu(); - if (pCurBuyMenu) - { - ReInitRewardGenerator(local_player); - } inherited::OnTeamChanged(); }; @@ -758,8 +748,6 @@ void game_cl_TeamDeathmatch::OnGameMenuRespond_ChangeTeam(NET_Packet& P) if (OldTeam != local_player->team) { OnTeamChanged(); - if (m_reward_generator) - m_reward_generator->OnPlayerChangeTeam(local_player->team); } SetCurrentSkinMenu(); diff --git a/src/xrGame/game_events_handler.h b/src/xrGame/game_events_handler.h deleted file mode 100644 index 40ff0f2a4f9..00000000000 --- a/src/xrGame/game_events_handler.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef GAME_EVENTS_HANDLER_INCLUDED -#define GAME_EVENTS_HANDLER_INCLUDED - -#include "game_cl_base_weapon_usage_statistic.h" - -namespace award_system -{ -class game_events_handler -{ -public: - game_events_handler(){}; - virtual ~game_events_handler(){}; - - virtual void OnWeapon_Fire(u16 sender, u16 sender_weapon_id) = 0; - virtual void OnBullet_Fire(u16 sender, u16 sender_weapon_id, const Fvector& position, const Fvector& direction) = 0; - virtual void OnBullet_Hit( - IGameObject const* hitter, IGameObject const* victim, IGameObject const* weapon, u16 const bone) = 0; - virtual void OnArtefactSpawned() = 0; - virtual void OnPlayerTakeArtefact(game_PlayerState const* ps) = 0; - virtual void OnPlayerDropArtefact(game_PlayerState const* ps) = 0; - virtual void OnPlayerBringArtefact(game_PlayerState const* ps) = 0; - virtual void OnPlayerSpawned(game_PlayerState const* ps) = 0; - virtual void OnPlayerKilled( - u16 killer_id, u16 target_id, u16 weapon_id, std::pair kill_type) = 0; - virtual void OnPlayerChangeTeam(s8 team) = 0; - virtual void OnPlayerRankChanged() = 0; - virtual void OnRoundEnd() = 0; - virtual void OnRoundStart() = 0; -}; // class game_events_handler - -} // namespace award_system - -#endif //#ifndef GAME_EVENTS_HANDLER_INCLUDED diff --git a/src/xrGame/game_state_accumulator.cpp b/src/xrGame/game_state_accumulator.cpp deleted file mode 100644 index 437035d21ca..00000000000 --- a/src/xrGame/game_state_accumulator.cpp +++ /dev/null @@ -1,491 +0,0 @@ -#include "StdAfx.h" -#include "game_state_accumulator.h" -#include "Level.h" -#include "actor_mp_client.h" -#include "CustomOutfit.h" -#include "Weapon.h" -#include "game_cl_deathmatch.h" -#include "UIGameCTA.h" -#include "ui/UIMpTradeWnd.h" -#include "ui/UIBuyWndShared.h" - -namespace award_system -{ -game_state_accumulator::game_state_accumulator() -{ - m_last_player_spawn_time = 0; - m_local_player = NULL; - m_item_mngr = NULL; -} - -game_state_accumulator::~game_state_accumulator() { delete_data(m_accumulative_values); } -void game_state_accumulator::update() -{ - // update_average_values (); - update_accumulative_values(); -} - -void game_state_accumulator::init_bone_groups(CActor* first_spawned_actor) { m_bone_groups.init(first_spawned_actor); } -void game_state_accumulator::init() -{ - // init_average_values (); - init_accumulative_values(); -} - -void game_state_accumulator::init_player(game_PlayerState* local_player) -{ - m_local_player = local_player; - init_player_accum_values(local_player); - - CUIMpTradeWnd* tmp_trade_wnd = NULL; - game_cl_Deathmatch* tmp_dm_game = smart_cast(&Game()); - if (tmp_dm_game) - { - tmp_trade_wnd = smart_cast(tmp_dm_game->GetBuyWnd()); - } - else - { - R_ASSERT(Game().Type() == eGameIDCaptureTheArtefact); - CUIGameCTA* tmp_cta_ui = smart_cast(CurrentGameUI()); - VERIFY(tmp_cta_ui); - tmp_trade_wnd = smart_cast(tmp_cta_ui->GetBuyWnd()); - } - R_ASSERT(tmp_trade_wnd); - m_item_mngr = tmp_trade_wnd->GetItemMngr(); - R_ASSERT(m_item_mngr); - m_amm_groups.init(m_item_mngr); -} - -void game_state_accumulator::OnWeapon_Fire(u16 sender, u16 sender_weapon_id) -{ - for (accumulative_values_collection_t::iterator i = m_accumulative_values.begin(), ie = m_accumulative_values.end(); - i != ie; ++i) - { - i->second->OnWeapon_Fire(sender, sender_weapon_id); - } -} -void game_state_accumulator::OnBullet_Fire( - u16 sender, u16 sender_weapon_id, const Fvector& position, const Fvector& direction) -{ - for (accumulative_values_collection_t::iterator i = m_accumulative_values.begin(), ie = m_accumulative_values.end(); - i != ie; ++i) - { - i->second->OnBullet_Fire(sender, sender_weapon_id, position, direction); - } -} - -void game_state_accumulator::OnBullet_Hit( - IGameObject const* hitter, IGameObject const* victim, IGameObject const* weapon, u16 const bone) -{ - if (!hitter || !victim || !weapon) - return; - - float bullet_fly_dist = 0.0f; - - bullet_fly_dist = hitter->Position().distance_to(victim->Position()); - - m_hits.add_hit(hitter->cName(), victim->cName(), get_object_id(weapon), bone, bullet_fly_dist); - for (accumulative_values_collection_t::iterator i = m_accumulative_values.begin(), ie = m_accumulative_values.end(); - i != ie; ++i) - { - i->second->OnBullet_Hit(hitter, victim, weapon, bone); - } -} - -void game_state_accumulator::OnArtefactSpawned() -{ - for (accumulative_values_collection_t::iterator i = m_accumulative_values.begin(), ie = m_accumulative_values.end(); - i != ie; ++i) - { - i->second->OnArtefactSpawned(); - } -} - -void game_state_accumulator::OnPlayerTakeArtefact(game_PlayerState const* ps) -{ - for (accumulative_values_collection_t::iterator i = m_accumulative_values.begin(), ie = m_accumulative_values.end(); - i != ie; ++i) - { - i->second->OnPlayerTakeArtefact(ps); - } -} - -void game_state_accumulator::OnPlayerDropArtefact(game_PlayerState const* ps) -{ - for (accumulative_values_collection_t::iterator i = m_accumulative_values.begin(), ie = m_accumulative_values.end(); - i != ie; ++i) - { - i->second->OnPlayerDropArtefact(ps); - } -} - -void game_state_accumulator::OnPlayerBringArtefact(game_PlayerState const* ps) -{ - for (accumulative_values_collection_t::iterator i = m_accumulative_values.begin(), ie = m_accumulative_values.end(); - i != ie; ++i) - { - i->second->OnPlayerBringArtefact(ps); - } -} - -void game_state_accumulator::OnPlayerSpawned(game_PlayerState const* ps) -{ - if (ps == m_local_player) - { - m_last_player_spawn_time = Device.dwTimeGlobal; - } - for (accumulative_values_collection_t::iterator i = m_accumulative_values.begin(), ie = m_accumulative_values.end(); - i != ie; ++i) - { - i->second->OnPlayerSpawned(ps); - } -} - -void game_state_accumulator::OnPlayerKilled( - u16 killer_id, u16 target_id, u16 weapon_id, std::pair kill_type) -{ - if (!is_enemies(killer_id, target_id)) - return; - - IGameObject* killer_obj = Level().Objects.net_Find(killer_id); - IGameObject* victim_obj = Level().Objects.net_Find(target_id); - if (killer_obj && victim_obj) - { - m_kills.add_kill( - killer_obj->cName(), victim_obj->cName(), get_object_id(weapon_id), kill_type.first, kill_type.second); - } - - for (accumulative_values_collection_t::iterator i = m_accumulative_values.begin(), ie = m_accumulative_values.end(); - i != ie; ++i) - { - i->second->OnPlayerKilled(killer_id, target_id, weapon_id, kill_type); - } -} - -void game_state_accumulator::OnPlayerChangeTeam(s8 team) -{ - for (accumulative_values_collection_t::iterator i = m_accumulative_values.begin(), ie = m_accumulative_values.end(); - i != ie; ++i) - { - i->second->OnPlayerChangeTeam(team); - } -} -void game_state_accumulator::OnPlayerRankChanged() -{ - for (accumulative_values_collection_t::iterator i = m_accumulative_values.begin(), ie = m_accumulative_values.end(); - i != ie; ++i) - { - i->second->OnPlayerRankChanged(); - } -} - -void game_state_accumulator::OnRoundEnd() -{ - for (accumulative_values_collection_t::iterator i = m_accumulative_values.begin(), ie = m_accumulative_values.end(); - i != ie; ++i) - { - i->second->OnRoundEnd(); - } -} -void game_state_accumulator::OnRoundStart() -{ - for (accumulative_values_collection_t::iterator i = m_accumulative_values.begin(), ie = m_accumulative_values.end(); - i != ie; ++i) - { - i->second->OnRoundStart(); - } -} - -u16 game_state_accumulator::get_object_id(IGameObject const* obj) -{ - if (!obj) - return 0; - - R_ASSERT2(m_item_mngr, "item manager not initialized"); - u32 itm_index = m_item_mngr->GetItemIdx(obj->cNameSect()); - if (itm_index == u32(-1)) - return 0; - - VERIFY((itm_index & 0xffff0000) == 0); - return static_cast(itm_index); -} - -u16 game_state_accumulator::get_object_id(u16 item_object_id) -{ - IGameObject* tmp_object = Level().Objects.net_Find(item_object_id); - if (!tmp_object) - return 0; - - return get_object_id(tmp_object); -} - -void game_state_accumulator::reset_player_game() -{ - m_kills.clear(); - m_hits.clear(); - m_last_player_spawn_time = 0; - - for (accumulative_values_collection_t::iterator i = m_accumulative_values.begin(), ie = m_accumulative_values.end(); - i != ie; ++i) - { - i->second->reset_game(); - } -} - -void game_state_accumulator::init_player_accum_values(game_PlayerState* new_local_player) -{ - for (int i = 0; i < acpv_count; ++i) - { - accumulative_values_collection_t::iterator tmp_iter = - m_accumulative_values.find(static_cast(i)); - R_ASSERT(tmp_iter != m_accumulative_values.end()); - tmp_iter->second->init_player(new_local_player); - } -} - -void game_state_accumulator::update_accumulative_values() -{ - for (accumulative_values_collection_t::iterator i = m_accumulative_values.begin(), ie = m_accumulative_values.end(); - i != ie; ++i) - { - i->second->update(); - } -} - -bool game_state_accumulator::check_hit_params(u32 count, ammunition_group::enum_group_id weapon_group_id, - bone_group::enum_group_id bone_group_id, float_binary_function* func, float right_dist_arg) -{ - struct hit_fetcher - { - bool operator()(shared_str const& hitter, shared_str const& victim, hits_store::bullet_hit const& hit) - { - if (m_hitter_name != hitter) - return false; - - if (!m_owner->is_item_in_group(hit.m_weapon_id, ammunition_group::gid_sniper_rifels)) - return false; - - if (!m_func->exec(hit.m_dist, m_right_arg)) - return false; - - if (!m_owner->is_bone_in_group(hit.m_bone_id, m_bone_gid)) - return false; - - return true; - } - shared_str m_hitter_name; - game_state_accumulator* m_owner; - ammunition_group::enum_group_id m_weapon_gid; - bone_group::enum_group_id m_bone_gid; - float_binary_function* m_func; - float m_right_arg; - }; // struct hit_fetcher - - if (!m_local_player) - return false; - - hit_fetcher tmp_fetcher; - tmp_fetcher.m_hitter_name = m_local_player->getName(); - tmp_fetcher.m_owner = this; - tmp_fetcher.m_weapon_gid = weapon_group_id; - tmp_fetcher.m_bone_gid = bone_group_id; - tmp_fetcher.m_func = func; - tmp_fetcher.m_right_arg = right_dist_arg; - - buffer_vector tmp_fake_buffer(NULL, 0); - if (m_hits.fetch_hits(tmp_fetcher, tmp_fake_buffer) >= count) - { - return true; - } - - return false; -} - -bool game_state_accumulator::check_kill_params(u32 count, ammunition_group::enum_group_id weapon_group_id, - KILL_TYPE kill_type, SPECIAL_KILL_TYPE special_kill_type, u32 time_period) -{ - struct kills_fetcher - { - bool operator()(shared_str const& killer, shared_str const& victim, kills_store::kill const& kill) - { - if (killer != m_killer_name) - return false; - - if (kill.m_kill_time < m_after_time) - return false; - - if (!m_owner->is_item_in_group(kill.m_weapon_id, m_weapon_gid)) - return false; - - if (kill.m_kill_type != m_kill_type) - return false; - - if ((m_spec_kill != SKT_NONE) && (kill.m_spec_kill_type != m_spec_kill)) - { - return false; - } - - return true; - } - shared_str m_killer_name; - u32 m_after_time; - game_state_accumulator* m_owner; - KILL_TYPE m_kill_type; - SPECIAL_KILL_TYPE m_spec_kill; - ammunition_group::enum_group_id m_weapon_gid; - }; // struct kills_fetcher - - if (!m_local_player) - return false; - - kills_fetcher tmp_predicate; - tmp_predicate.m_killer_name = m_local_player->getName(); - if (time_period == u32(-1)) - { - tmp_predicate.m_after_time = m_last_player_spawn_time; - } - else - { - tmp_predicate.m_after_time = Device.dwTimeGlobal - time_period; - } - tmp_predicate.m_owner = this; - tmp_predicate.m_kill_type = kill_type; - tmp_predicate.m_spec_kill = special_kill_type; - tmp_predicate.m_weapon_gid = weapon_group_id; - - buffer_vector tmp_buffer(NULL, 0); - if (m_kills.fetch_kills(tmp_predicate, tmp_buffer) >= count) - return true; - - return false; -} - -bool game_state_accumulator::check_accumulative_value( - enum_accumulative_player_values param_id, float_binary_function* func, float right_arg) -{ - accumulative_values_collection_t::iterator tmp_iter = m_accumulative_values.find(param_id); - VERIFY2( - tmp_iter != m_accumulative_values.end(), make_string("accumulative parameter %d not found", param_id).c_str()); - - return func->exec(tmp_iter->second->get_float_param(), right_arg); -} - -bool game_state_accumulator::check_accumulative_value( - enum_accumulative_player_values param_id, u32_binary_function* func, u32 right_arg) -{ - accumulative_values_collection_t::iterator tmp_iter = m_accumulative_values.find(param_id); - VERIFY2( - tmp_iter != m_accumulative_values.end(), make_string("accumulative parameter %d not found", param_id).c_str()); - bool ret_value = func->exec(tmp_iter->second->get_u32_param(), right_arg); -#ifdef DEBUG - Msg("* checking accumulative value: %s, result = %s", player_values_strtable[param_id], - ret_value ? "true" : "false"); -#endif - return ret_value; -} - -bool game_state_accumulator::is_item_in_group(u16 item_id, ammunition_group::enum_group_id gid) -{ - return m_amm_groups.is_item_in_group(item_id, gid); -} - -bool game_state_accumulator::is_bone_in_group(u16 bone_id, bone_group::enum_group_id gid) -{ - return m_bone_groups.is_bone_in_group(bone_id, gid); -} - -u16 game_state_accumulator::get_armor_of_player(game_PlayerState* player) -{ - if (!player) - return 0; - - CActorMP const* tmp_actor = smart_cast(Level().Objects.net_Find(player->GameID)); - - if (!tmp_actor) - return 0; - - CCustomOutfit* tmp_outfit = tmp_actor->GetOutfit(); - if (!tmp_outfit) - return 0; - - return get_object_id(tmp_outfit); -} - -u16 game_state_accumulator::get_active_weapon_of_player(game_PlayerState* player) -{ - if (!player) - return 0; - - CActorMP const* tmp_actor = smart_cast(Level().Objects.net_Find(player->GameID)); - - if (!tmp_actor) - return 0; - - u16 tmp_active_slot = tmp_actor->inventory().GetActiveSlot(); - CInventoryItem const* tmp_inv_item = - tmp_active_slot != NO_ACTIVE_SLOT ? tmp_actor->inventory().ItemFromSlot(tmp_active_slot) : NULL; - - if (!tmp_inv_item) - return 0; - - return get_object_id(tmp_inv_item->object_id()); -} - -CWeapon* game_state_accumulator::get_active_weapon(game_PlayerState* player) -{ - if (!player) - return NULL; - - IGameObject* tmp_obj = Level().Objects.net_Find(player->GameID); - if (!tmp_obj) - return NULL; - - CActorMP const* tmp_actor = smart_cast(tmp_obj); - - if (!tmp_actor) - return NULL; - - u16 tmp_active_slot = tmp_actor->inventory().GetActiveSlot(); - CInventoryItem* tmp_inv_item = - tmp_active_slot != NO_ACTIVE_SLOT ? tmp_actor->inventory().ItemFromSlot(tmp_active_slot) : NULL; - - if (!tmp_inv_item) - return NULL; - - return smart_cast(tmp_inv_item); -} - -CActor* game_state_accumulator::get_players_actor(u16 game_id) -{ - IGameObject* tmp_obj = Level().Objects.net_Find(game_id); - if (!tmp_obj) - return NULL; - - return smart_cast(tmp_obj); -} - -bool game_state_accumulator::is_enemies(u16 left_pid, u16 right_pid) const -{ - game_PlayerState const* tmp_lp = Game().GetPlayerByGameID(left_pid); - game_PlayerState const* tmp_rp = Game().GetPlayerByGameID(right_pid); - return is_enemies(tmp_lp, tmp_rp); -} - -bool game_state_accumulator::is_enemies(game_PlayerState const* left_player, game_PlayerState const* right_player) const -{ - if (!left_player || !right_player) - return false; - - if (left_player == right_player) - return false; - - if (Game().Type() == eGameIDDeathmatch) - return true; - - if (left_player->team != right_player->team) - return true; - - return false; -} - -} // namespace award_system diff --git a/src/xrGame/game_state_accumulator.h b/src/xrGame/game_state_accumulator.h deleted file mode 100644 index ea1a4d0dbbf..00000000000 --- a/src/xrGame/game_state_accumulator.h +++ /dev/null @@ -1,106 +0,0 @@ -#ifndef GAME_STATE_ACCUMULATOR_INCLUDED -#define GAME_STATE_ACCUMULATOR_INCLUDED - -#include "game_cl_base_weapon_usage_statistic.h" -#include "state_arguments_functions.h" -#include "player_state_param.h" -#include "game_events_handler.h" -#include "bone_groups.h" -#include "ammunition_groups.h" -#include "hits_store.h" -#include "kills_store.h" -#include "accumulative_states.h" - -class CWeapon; - -namespace award_system -{ -#ifdef DEBUG -constexpr pcstr player_values_strtable[] = { - "command_switch_count", "kill_in_raw_count", "death_count", "spots", "my_team_win_score", "my_team_win_score_now", - "enemy_top_player_div", "blitzkrieg_time", "enemy_team_score", "enemy_team_score_now", "artdeliver_counter", - "multi_champion", "mad", "achilles_heel_ready", "faster_than_bullets_time", "harvest_count", "skewer_count", - "double_shot_double_kill_time", "ammo_elapsed", "climber", "opener_ready", "invincible_fury", "move_state", - "move_velocity", "move_angular_velocity", "sprinter_victim_velocity", "marksman_count", "ambassador", "remembrance", - "avenger", "cherub_ready", "stalker_flair", "black_list", "thunder_count", "killer_victim_angle_cos", -}; -#endif //#ifdef DEBUG - -class game_state_accumulator : public game_events_handler -{ -public: - game_state_accumulator(); - virtual ~game_state_accumulator(); - - void update(); - void init(); - void init_player(game_PlayerState* local_player); - void init_bone_groups(CActor* first_spawned_actor); - - u16 get_object_id(u16 item_object_id); - u16 get_object_id(IGameObject const* obj); - bool is_item_in_group(u16 item_id, ammunition_group::enum_group_id gid); - bool is_bone_in_group(u16 bone_id, bone_group::enum_group_id gid); - u16 get_armor_of_player(game_PlayerState* player); - u16 get_active_weapon_of_player(game_PlayerState* player); - CWeapon* get_active_weapon(game_PlayerState* player); - CActor* get_players_actor(u16 game_id); - game_PlayerState* get_local_player() const { return m_local_player; }; - hits_store& get_hits_store() { return m_hits; }; - kills_store& get_kills_store() { return m_kills; }; - bool is_enemies(u16 left_pid, u16 right_pid) const; - bool is_enemies(game_PlayerState const* left_player, game_PlayerState const* right_player) const; - - void reset_player_game(); - - virtual void OnWeapon_Fire(u16 sender, u16 sender_weapon_id); - virtual void OnBullet_Fire(u16 sender, u16 sender_weapon_id, const Fvector& position, const Fvector& direction); - virtual void OnBullet_Hit( - IGameObject const* hitter, IGameObject const* victim, IGameObject const* weapon, u16 const bone); - virtual void OnArtefactSpawned(); - virtual void OnPlayerTakeArtefact(game_PlayerState const* ps); - virtual void OnPlayerDropArtefact(game_PlayerState const* ps); - virtual void OnPlayerBringArtefact(game_PlayerState const* ps); - virtual void OnPlayerSpawned(game_PlayerState const* ps); - virtual void OnPlayerKilled( - u16 killer_id, u16 target_id, u16 weapon_id, std::pair kill_type); - virtual void OnPlayerChangeTeam(s8 team); - virtual void OnPlayerRankChanged(); - virtual void OnRoundEnd(); - virtual void OnRoundStart(); - - bool check_hit_params(u32 count, ammunition_group::enum_group_id weapon_group_id, - bone_group::enum_group_id bone_group_id, float_binary_function* func, float right_dist_arg); - - bool check_kill_params(u32 count, ammunition_group::enum_group_id weapon_group_id, KILL_TYPE kill_type, - SPECIAL_KILL_TYPE special_kill_type, u32 time_period); - - bool check_accumulative_value( - enum_accumulative_player_values param_id, float_binary_function* func, float right_arg); - - bool check_accumulative_value(enum_accumulative_player_values param_id, u32_binary_function* func, u32 right_arg); - - using accumulative_values_collection_t = AssociativeVector; -private: - // average_values_collection_t m_average_values; - accumulative_values_collection_t m_accumulative_values; - CItemMgr const* m_item_mngr; - game_PlayerState* m_local_player; - u32 m_last_player_spawn_time; - - // void init_average_values (); - void init_accumulative_values(); - void init_player_accum_values(game_PlayerState* new_local_player); - - void update_average_values(); - void update_accumulative_values(); - - hits_store m_hits; - kills_store m_kills; - - ammunition_group m_amm_groups; - bone_group m_bone_groups; -}; // class game_state_accumulator -} // namespace award_system - -#endif //#ifndef GAME_STATE_ACCUMULATOR_INCLUDED diff --git a/src/xrGame/game_state_accumulator_inline.h b/src/xrGame/game_state_accumulator_inline.h deleted file mode 100644 index 05252e10adc..00000000000 --- a/src/xrGame/game_state_accumulator_inline.h +++ /dev/null @@ -1,11 +0,0 @@ -template -void game_state_accumulator::init_acpv_list() -{ - static_assert(Loki::TL::is_Typelist::value, - "Type must have a Loki Type List type use ADD_ACCUMULATIVE_STATE macro define."); - init_acpv_list(); - - player_state_param* tmp_obj_inst = xr_new(this); - - m_accumulative_values.insert(std::make_pair(TypeListElement::Head::value_id, tmp_obj_inst)); -} diff --git a/src/xrGame/game_state_accumulator_state_register.cpp b/src/xrGame/game_state_accumulator_state_register.cpp deleted file mode 100644 index 058c5a54033..00000000000 --- a/src/xrGame/game_state_accumulator_state_register.cpp +++ /dev/null @@ -1,78 +0,0 @@ -#include "StdAfx.h" -#include "game_state_accumulator.h" - -// typelist: -#include "command_switch_counter.h" -#include "player_state_params.h" -#include "player_team_win_score.h" -#include "player_spot_params.h" -#include "player_state_blitzkrieg.h" -#include "player_state_multichampion.h" -#include "player_state_mad.h" -#include "player_state_achilles_heel.h" -#include "faster_than_bullets_time.h" -#include "harvest_time.h" -#include "player_state_skewer.h" -#include "double_shot_double_kill.h" -#include "player_state_climber.h" -#include "player_state_ammo_elapsed.h" -#include "player_state_opener.h" -#include "player_state_toughy.h" -#include "invincible_fury.h" -#include "sprinter_stopper.h" -#include "player_state_marksman.h" -#include "player_state_ambassador.h" -#include "player_state_remembrance.h" -#include "player_state_avenger.h" -#include "player_state_cherub.h" -#include "stalker_flair.h" -#include "black_list.h" -#include "silent_shots.h" -#include "killer_victim_velocity_angle.h" - -#define INIT_ACCUMULATIVE_VALUE(Kind, SomeClass) \ - m_accumulative_values.emplace(Kind, xr_new(this)); - -namespace award_system -{ - -void game_state_accumulator::init_accumulative_values() -{ - INIT_ACCUMULATIVE_VALUE(acpv_mad, player_state_mad); - INIT_ACCUMULATIVE_VALUE(acpv_spots, player_spots_counter); - INIT_ACCUMULATIVE_VALUE(acpv_toughy, player_state_toughy); - INIT_ACCUMULATIVE_VALUE(acpv_avenger, player_state_avenger); - INIT_ACCUMULATIVE_VALUE(acpv_climber, player_state_climber); - INIT_ACCUMULATIVE_VALUE(acpv_move_state, player_state_move); - INIT_ACCUMULATIVE_VALUE(acpv_ambassador, player_state_ambassador); - INIT_ACCUMULATIVE_VALUE(acpv_black_list, black_list); - INIT_ACCUMULATIVE_VALUE(acpv_kill_in_raw, player_rawkill_counter); - INIT_ACCUMULATIVE_VALUE(acpv_death_count, player_death_counter); - INIT_ACCUMULATIVE_VALUE(acpv_remembrance, player_state_remembrance); - INIT_ACCUMULATIVE_VALUE(acpv_cherub_ready, player_state_cherub); - INIT_ACCUMULATIVE_VALUE(acpv_ammo_elapsed, player_state_ammo_elapsed); - INIT_ACCUMULATIVE_VALUE(acpv_opener_ready, player_state_opener); - INIT_ACCUMULATIVE_VALUE(acpv_skewer_count, player_state_skewer); - INIT_ACCUMULATIVE_VALUE(acpv_stalker_flair, stalker_flair); - INIT_ACCUMULATIVE_VALUE(acpv_thunder_count, silent_shots); - INIT_ACCUMULATIVE_VALUE(acpv_move_velocity, player_state_velocity); - INIT_ACCUMULATIVE_VALUE(acpv_harvest_count, harvest_time); - INIT_ACCUMULATIVE_VALUE(acpv_marksman_count, player_state_marksman); - INIT_ACCUMULATIVE_VALUE(acpv_multi_champion, player_multichampion); - INIT_ACCUMULATIVE_VALUE(acpv_invincible_fury, player_state_invincible_fury); - INIT_ACCUMULATIVE_VALUE(acpv_blitzkrieg_time, player_blitzkrieg); - INIT_ACCUMULATIVE_VALUE(acpv_enemy_team_score, player_enemy_team_score); - INIT_ACCUMULATIVE_VALUE(acpv_artdeliver_count, player_artdeliver_counter); - INIT_ACCUMULATIVE_VALUE(acpv_my_team_win_score, player_team_win_score); - INIT_ACCUMULATIVE_VALUE(acpv_move_ang_velocity, player_state_ang_velocity); - INIT_ACCUMULATIVE_VALUE(acpv_achilles_heel_ready, achilles_heel_kill); - INIT_ACCUMULATIVE_VALUE(acpv_killer_victim_angle, killer_victim_angle); - INIT_ACCUMULATIVE_VALUE(acpv_enemy_top_player_div, player_spots_with_top_enemy_divider); - INIT_ACCUMULATIVE_VALUE(acpv_command_switch_count, command_switch_counter); - INIT_ACCUMULATIVE_VALUE(acpv_enemy_team_score_now, player_runtime_enemy_team_score); - INIT_ACCUMULATIVE_VALUE(acpv_my_team_win_score_now, player_runtime_win_score); - INIT_ACCUMULATIVE_VALUE(acpv_sprinter_victim_velocity, spritnter_stopper); - INIT_ACCUMULATIVE_VALUE(acpv_faster_than_bullets_time, faster_than_bullets_time); - INIT_ACCUMULATIVE_VALUE(acpv_double_shot_double_kill_time, double_shot_double_kill); -} -} // namespace award_system diff --git a/src/xrGame/harvest_time.cpp b/src/xrGame/harvest_time.cpp deleted file mode 100644 index 67c255fca80..00000000000 --- a/src/xrGame/harvest_time.cpp +++ /dev/null @@ -1,78 +0,0 @@ -#include "StdAfx.h" -#include "harvest_time.h" -#include "kills_store.h" -#include "game_base.h" -#include "Level.h" -#include "game_state_accumulator.h" - -namespace award_system -{ -u32 harvest_time::get_u32_param() { return m_harvest_count; } -void harvest_time::reset_game() -{ - m_harvest_count = 0; - m_spawn_time = 0; -} - -struct victim_raw_kill -{ - victim_raw_kill(shared_str const& killer, shared_str const& victim, u32 const after_time) - : m_killer(killer), m_victim(victim), m_after_time(after_time) - { - } - - victim_raw_kill& operator=(victim_raw_kill const& copy) - { - m_killer = copy.m_killer; - m_victim = copy.m_victim; - m_after_time = copy.m_after_time; - return *this; - } - - bool operator()(shared_str const& killer, shared_str const& victim, kills_store::kill const& kill) - { - if ((killer == m_killer) && (victim == m_victim) && (kill.m_kill_time >= m_after_time)) - { - return true; - } - return false; - } - - shared_str m_killer; - shared_str m_victim; - u32 m_after_time; -}; // struct victim_raw_kill - -void harvest_time::OnPlayerKilled( - u16 killer_id, u16 target_id, u16 weapon_id, std::pair kill_type) -{ - game_PlayerState* tmp_local_player = m_owner->get_local_player(); - if (!tmp_local_player) - return; - - if (!m_spawn_time) - return; - - if (killer_id != tmp_local_player->GameID) - return; - - IGameObject* victim_obj = Level().Objects.net_Find(target_id); - if (!victim_obj) - return; - - victim_raw_kill tmp_predicate(tmp_local_player->getName(), victim_obj->cName(), m_spawn_time); - - buffer_vector tmp_fake_buffer(NULL, 0); - - m_harvest_count = m_owner->get_kills_store().fetch_kills(tmp_predicate, tmp_fake_buffer); -} - -void harvest_time::OnPlayerSpawned(game_PlayerState const* ps) -{ - if (ps == m_owner->get_local_player()) - { - m_spawn_time = Device.dwTimeGlobal; - } -} - -} // namespace award_system diff --git a/src/xrGame/harvest_time.h b/src/xrGame/harvest_time.h deleted file mode 100644 index c17bad58c6f..00000000000 --- a/src/xrGame/harvest_time.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef HARVEST_TIME_INCLUDED -#define HARVEST_TIME_INCLUDED - -#include "player_state_param.h" -#include "accumulative_states.h" - -namespace award_system -{ -class harvest_time : public player_state_param -{ - typedef player_state_param inherited; - -public: - harvest_time(game_state_accumulator* owner) : inherited(owner) {} - ~harvest_time(){}; - - virtual void update(){}; - virtual u32 get_u32_param(); - virtual float get_float_param() { return 0.0f; }; - virtual void reset_game(); - - virtual void OnPlayerKilled( - u16 killer_id, u16 target_id, u16 weapon_id, std::pair kill_type); - virtual void OnPlayerSpawned(game_PlayerState const* ps); - -protected: - u32 m_harvest_count{}; - u32 m_spawn_time{}; -}; // class harvest_time - -} // namespace award_system - -#endif //#ifndef HARVEST_TIME_INCLUDED diff --git a/src/xrGame/hits_store.cpp b/src/xrGame/hits_store.cpp deleted file mode 100644 index 083c2f48469..00000000000 --- a/src/xrGame/hits_store.cpp +++ /dev/null @@ -1,31 +0,0 @@ -#include "StdAfx.h" -#include "hits_store.h" -#include "Common/object_broker.h" - -namespace award_system -{ -hits_store::hits_store() {} -hits_store::~hits_store() { clear(); } -void hits_store::clear() { delete_data(m_bullet_hits); } -void hits_store::add_hit( - shared_str const& hitter, shared_str const& victim, u16 weapon_id, u16 bone_id, float bullet_fly_dist) -{ - std::pair search_key(hitter, victim); - bullet_hits_map_t::iterator tmp_iter = m_bullet_hits.find(search_key); - - if (tmp_iter == m_bullet_hits.end()) - { - bullet_hits_t* new_hits_queue = xr_new(); - tmp_iter = m_bullet_hits.emplace(search_key, new_hits_queue).first; - } - - bullet_hit tmp_hit; - tmp_hit.m_hit_time = Device.dwTimeGlobal; - tmp_hit.m_dist = bullet_fly_dist; - tmp_hit.m_weapon_id = weapon_id; - tmp_hit.m_bone_id = bone_id; - - tmp_iter->second->push_obsolete(tmp_hit); -} - -} // namespace award_system diff --git a/src/xrGame/hits_store.h b/src/xrGame/hits_store.h deleted file mode 100644 index 5f6bc1c602f..00000000000 --- a/src/xrGame/hits_store.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef HITS_STORE_INCLUDED -#define HITS_STORE_INCLUDED - -#include "obsolete_queue.h" -#include "xrCore/Containers/AssociativeVector.hpp" - -namespace award_system -{ -class hits_store -{ -public: - hits_store(); - ~hits_store(); - - void clear(); - - struct bullet_hit - { - u32 m_hit_time; - float m_dist; - u16 m_weapon_id; - u16 m_bone_id; - }; // struct bullet_hit - - static unsigned int const max_hits_count = 10; - typedef obsolete_queue, max_hits_count> bullet_hits_t; - // key: (initiator, victim) - typedef AssociativeVector, bullet_hits_t*> bullet_hits_map_t; - - void add_hit(shared_str const& hitter, shared_str const& victim, u16 weapon_id, u16 bone_id, float bullet_fly_dist); - - template - u32 fetch_hits(Predicate& predicate, buffer_vector& dest_hits) const; - -private: - bullet_hits_map_t m_bullet_hits; -}; // class hits_store - -} // namespace award_system - -#include "hits_store_inline.h" - -#endif //#ifndef HITS_STORE_INCLUDED diff --git a/src/xrGame/hits_store_inline.h b/src/xrGame/hits_store_inline.h deleted file mode 100644 index b73ad979a96..00000000000 --- a/src/xrGame/hits_store_inline.h +++ /dev/null @@ -1,24 +0,0 @@ -namespace award_system -{ -template -u32 hits_store::fetch_hits(Predicate& predicate, buffer_vector& dest_hits) const -{ - u32 ret_count = 0; - for (bullet_hits_map_t::const_iterator i = m_bullet_hits.begin(), ie = m_bullet_hits.end(); i != ie; ++i) - { - for (bullet_hits_t::const_iterator hi = i->second->begin(), hie = i->second->end(); hi != hie; ++hi) - { - if (predicate(i->first.first, i->first.second, *hi)) - { - ++ret_count; - if (dest_hits.capacity() == dest_hits.size()) - continue; - - dest_hits.push_back(*hi); - } - } - } - return ret_count; -} - -} // namespace award_system diff --git a/src/xrGame/invincible_fury.cpp b/src/xrGame/invincible_fury.cpp deleted file mode 100644 index 9856f5487c1..00000000000 --- a/src/xrGame/invincible_fury.cpp +++ /dev/null @@ -1,63 +0,0 @@ -#include "StdAfx.h" -#include "invincible_fury.h" -#include "kills_store.h" -#include "game_cl_base.h" -#include "game_state_accumulator.h" - -namespace award_system -{ -u32 player_state_invincible_fury::get_u32_param() { return m_last_kills; } -void player_state_invincible_fury::reset_game() { m_last_kills = 0; } -struct fury_killer -{ - fury_killer(shared_str const& killer_name, u32 after_time) : m_killer_name(killer_name), m_after_time(after_time) {} - fury_killer& operator=(fury_killer const& copy) - { - m_killer_name = copy.m_killer_name; - m_after_time = copy.m_after_time; - return *this; - } - - bool operator()(shared_str const& killer, shared_str const& victim, kills_store::kill const& kill) - { - if ((killer == m_killer_name) && (kill.m_kill_time >= m_after_time)) - { - return true; - } - return false; - } - shared_str m_killer_name; - u32 m_after_time; -}; // struct fury_killer - -void player_state_invincible_fury::OnPlayerKilled( - u16 killer_id, u16 target_id, u16 weapon_id, std::pair kill_type) -{ - game_PlayerState* tmp_local_player = m_owner->get_local_player(); - - if (!tmp_local_player) - return; - - if (killer_id != tmp_local_player->GameID) - return; - - fury_killer tmp_predicate(tmp_local_player->getName(), Device.dwTimeGlobal - max_fury_time); - kills_store::kill tmp_kills_store[kills_store::max_kills_count]; - buffer_vector tmp_buffer(tmp_kills_store, kills_store::max_kills_count); - - m_owner->get_kills_store().fetch_kills(tmp_predicate, tmp_buffer); - m_last_kills = 0; - for (buffer_vector::const_iterator i = tmp_buffer.begin(), ie = tmp_buffer.end(); i != ie; ++i) - { - if (m_owner->is_item_in_group(i->m_weapon_id, ammunition_group::gid_assault) || - m_owner->is_item_in_group(i->m_weapon_id, ammunition_group::gid_sniper_rifels) || - m_owner->is_item_in_group(i->m_weapon_id, ammunition_group::gid_shotguns) || - m_owner->is_item_in_group(i->m_weapon_id, ammunition_group::gid_pistols) || - m_owner->is_item_in_group(i->m_weapon_id, ammunition_group::gid_knife)) - { - ++m_last_kills; - } - } -} - -} // namespace award_system diff --git a/src/xrGame/invincible_fury.h b/src/xrGame/invincible_fury.h deleted file mode 100644 index ca7517a6a96..00000000000 --- a/src/xrGame/invincible_fury.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef INVINCIBLE_FURY_INCLUDED -#define INVINCIBLE_FURY_INCLUDED - -#include "obsolete_queue.h" -#include "player_state_param.h" -#include "accumulative_states.h" - -namespace award_system -{ -class player_state_invincible_fury : public player_state_param -{ - typedef player_state_param inherited; - -public: - player_state_invincible_fury(game_state_accumulator* owner) : inherited(owner) {} - virtual ~player_state_invincible_fury(){}; - - virtual void update(){}; - virtual u32 get_u32_param(); - virtual float get_float_param() { return 0.0f; }; - virtual void reset_game(); - - virtual void OnPlayerKilled( - u16 killer_id, u16 target_id, u16 weapon_id, std::pair kill_type); - -private: - static u32 const max_fury_time = 6000; - u32 m_last_kills{}; -}; // class player_state_invincible_fury - -} // namespace award_system - -#endif //#ifndef INVINCIBLE_FURY_INCLUDED diff --git a/src/xrGame/killer_victim_velocity_angle.cpp b/src/xrGame/killer_victim_velocity_angle.cpp deleted file mode 100644 index 7e1cca7f9d8..00000000000 --- a/src/xrGame/killer_victim_velocity_angle.cpp +++ /dev/null @@ -1,59 +0,0 @@ -#include "StdAfx.h" -#include "killer_victim_velocity_angle.h" -#include "game_state_accumulator.h" -#include "game_cl_base.h" -#include "Level.h" -#include "ammunition_groups.h" -#include "Actor.h" -#include "CharacterPhysicsSupport.h" -#include "PHMovementControl.h" -#include "xrEngine/CameraBase.h" - -namespace award_system -{ -void killer_victim_angle::reset_game() { m_killer_victim_angle_cos = 1.f; } -u32 killer_victim_angle::get_u32_param() { return u32(acosf(m_killer_victim_angle_cos) * (180.f / PI)); } -void killer_victim_angle::OnPlayerKilled( - u16 killer_id, u16 target_id, u16 weapon_id, std::pair kill_type) -{ - game_PlayerState* tmp_local_player = m_owner->get_local_player(); - if (!tmp_local_player) - return; - - if (tmp_local_player->GameID != killer_id) - return; - - CActor* killer_actor = m_owner->get_players_actor(killer_id); - CActor* victim_actor = m_owner->get_players_actor(target_id); - if (!victim_actor || !killer_actor) - return; - - Fvector killer_dir; - Fvector victim_velocity; - - CCharacterPhysicsSupport* tmp_cphys = victim_actor->character_physics_support(); - if (!tmp_cphys) - return; - - CPHMovementControl* tmp_movc = tmp_cphys->movement(); - if (!tmp_movc) - return; - - victim_velocity = tmp_movc->GetVelocity(); - if (victim_velocity.square_magnitude() < EPS) - return; - - Fvector cam_pos, cam_norm; - killer_actor->cam_Active()->Get(cam_pos, killer_dir, cam_norm); - if (killer_dir.square_magnitude() < EPS) - return; - - killer_dir.normalize(); - victim_velocity.normalize(); - - m_killer_victim_angle_cos = _abs(killer_dir.dotproduct(victim_velocity)); - // Msg("* Killer victim angle cos: %1.3f", m_killer_victim_angle_cos); - // Msg("* Killer victim angle: %d", get_u32_param()); -} - -} // namespace award_system diff --git a/src/xrGame/killer_victim_velocity_angle.h b/src/xrGame/killer_victim_velocity_angle.h deleted file mode 100644 index bcfc1ac1439..00000000000 --- a/src/xrGame/killer_victim_velocity_angle.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef KILLER_VICTIM_VELOCITY_ANGLE_INCLUDED -#define KILLER_VICTIM_VELOCITY_ANGLE_INCLUDED - -#include "player_state_param.h" -#include "accumulative_states.h" - -namespace award_system -{ -class killer_victim_angle : public player_state_param -{ - typedef player_state_param inherited; - -public: - killer_victim_angle(game_state_accumulator* owner) : inherited(owner) {} - virtual ~killer_victim_angle(){}; - - virtual void update(){}; - virtual u32 get_u32_param(); - virtual float get_float_param() { return m_killer_victim_angle_cos; }; - virtual void reset_game(); - virtual void OnPlayerKilled( - u16 killer_id, u16 target_id, u16 weapon_id, std::pair kill_type); - -protected: - float m_killer_victim_angle_cos{ 1.0f }; -}; // class killer_victim_angle - -} // namespace award_system - -#endif //#ifndef KILLER_VICTIM_VELOCITY_ANGLE_INCLUDED diff --git a/src/xrGame/kills_store.cpp b/src/xrGame/kills_store.cpp deleted file mode 100644 index e5c73145ba8..00000000000 --- a/src/xrGame/kills_store.cpp +++ /dev/null @@ -1,30 +0,0 @@ -#include "StdAfx.h" -#include "kills_store.h" -#include "Common/object_broker.h" - -namespace award_system -{ -kills_store::kills_store() {} -kills_store::~kills_store() {} -void kills_store::clear() { delete_data(m_kills); } -void kills_store::add_kill(shared_str const& killer, shared_str const& victim, u16 weapon_id, KILL_TYPE const kill_type, - SPECIAL_KILL_TYPE const spec_kill_type) -{ - std::pair search_key(killer, victim); - kills_map_t::iterator tmp_iter = m_kills.find(search_key); - if (tmp_iter == m_kills.end()) - { - kills_t* new_kills = xr_new(); - tmp_iter = m_kills.emplace(search_key, new_kills).first; - } - - kill new_kill; - new_kill.m_kill_time = Device.dwTimeGlobal; - new_kill.m_weapon_id = weapon_id; - new_kill.m_kill_type = kill_type; - new_kill.m_spec_kill_type = spec_kill_type; - - tmp_iter->second->push_obsolete(new_kill); -} - -} // namespace award_system diff --git a/src/xrGame/kills_store.h b/src/xrGame/kills_store.h deleted file mode 100644 index 2f4e4bf87e1..00000000000 --- a/src/xrGame/kills_store.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef KILLS_STORE_INCLUDED -#define KILLS_STORE_INCLUDED - -#include "obsolete_queue.h" -#include "game_base_kill_type.h" -#include "xrCore/Containers/AssociativeVector.hpp" - -namespace award_system -{ -class kills_store -{ -public: - kills_store(); - ~kills_store(); - - void clear(); - - struct kill - { - u32 m_kill_time; - u16 m_weapon_id; - KILL_TYPE m_kill_type; - SPECIAL_KILL_TYPE m_spec_kill_type; - }; // struct kill - - static constexpr size_t max_kills_count = 10; - typedef obsolete_queue, max_kills_count> kills_t; - // key: (initiator, victim) - typedef AssociativeVector, kills_t*> kills_map_t; - - void add_kill(shared_str const& killer, shared_str const& victim, u16 weapon_id, KILL_TYPE const kill_type, - SPECIAL_KILL_TYPE const spec_kill_type); - - template - u32 const fetch_kills(Predicate& predicate, buffer_vector& dest_kills); - -private: - kills_map_t m_kills; -}; // class kills_store - -} // namespace award_system - -#include "kills_store_inline.h" - -#endif //#ifndef KILLS_STORE_INCLUDED diff --git a/src/xrGame/kills_store_inline.h b/src/xrGame/kills_store_inline.h deleted file mode 100644 index 07968c14b2e..00000000000 --- a/src/xrGame/kills_store_inline.h +++ /dev/null @@ -1,24 +0,0 @@ -namespace award_system -{ -template -u32 const kills_store::fetch_kills(Predicate& predicate, buffer_vector& dest_kills) -{ - u32 ret_count = 0; - for (kills_map_t::const_iterator i = m_kills.begin(), ie = m_kills.end(); i != ie; ++i) - { - for (kills_t::const_iterator ki = i->second->begin(), kie = i->second->end(); ki != kie; ++ki) - { - if (predicate(i->first.first, i->first.second, *ki)) - { - ++ret_count; - if (dest_kills.capacity() == dest_kills.size()) - continue; - - dest_kills.push_back(*ki); - } - } - } - return ret_count; -} - -} // namespace award_system diff --git a/src/xrGame/obsolete_queue.h b/src/xrGame/obsolete_queue.h deleted file mode 100644 index b5f8c84a1d3..00000000000 --- a/src/xrGame/obsolete_queue.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef OBSOLETE_QUEUE_INCLUDED -#define OBSOLETE_QUEUE_INCLUDED - -template -class obsolete_queue -{ -public: - typedef Contaiter container_type; - typedef typename Contaiter::value_type value_type; - typedef typename Contaiter::reference reference; - typedef typename Contaiter::const_reference const_reference; - typedef typename Contaiter::iterator iterator; - typedef typename Contaiter::const_iterator const_iterator; - typedef typename Contaiter::size_type size_type; - - obsolete_queue(); - ~obsolete_queue(); - - void push_obsolete(const_reference element); - const_iterator begin() const; - const_iterator end() const; - iterator begin(); - iterator end(); - void clear(); - size_type size() const; - container_type const& get_contaier() const; -}; - -#include "obsolete_queue_inline.h" - -#endif //#ifndef OBSOLETE_QUEUE_INCLUDED diff --git a/src/xrGame/obsolete_queue_inline.h b/src/xrGame/obsolete_queue_inline.h deleted file mode 100644 index 6a227fc72fb..00000000000 --- a/src/xrGame/obsolete_queue_inline.h +++ /dev/null @@ -1,37 +0,0 @@ -#include "xrCore/buffer_vector.h" - -template -class obsolete_queue, MaxCount> -{ -public: - typedef buffer_vector container_type; - typedef typename container_type::value_type value_type; - typedef typename container_type::reference reference; - typedef typename container_type::const_reference const_reference; - typedef typename container_type::iterator iterator; - typedef typename container_type::const_iterator const_iterator; - typedef typename container_type::size_type size_type; - - obsolete_queue() : m_sequence(m_sequence_store, MaxCount){}; - ~obsolete_queue(){}; - - void push_obsolete(const_reference element) - { - if (m_sequence.size() >= MaxCount) - { - m_sequence.erase(m_sequence.begin()); - } - m_sequence.push_back(element); - } - - const_iterator begin() const { return m_sequence.begin(); }; - const_iterator end() const { return m_sequence.end(); }; - iterator begin() { return m_sequence.begin(); }; - iterator end() { return m_sequence.end(); }; - void clear() { m_sequence.clear(); }; - size_type size() const { return m_sequence.size(); }; - container_type const& get_contaier() const { return m_sequence; }; -private: - container_type m_sequence; - T m_sequence_store[MaxCount]; -}; // class obsolete_queue, MaxCount> diff --git a/src/xrGame/player_account.cpp b/src/xrGame/player_account.cpp index 42ac012bea8..5a445dee348 100644 --- a/src/xrGame/player_account.cpp +++ b/src/xrGame/player_account.cpp @@ -7,15 +7,14 @@ using namespace gamespy_profile; player_account::player_account() : m_player_name(""), m_clan_name(""), m_clan_leader(false), m_online_account(false) {} -player_account::~player_account() {} + void player_account::load_account() { -#ifdef XR_PLATFORM_WINDOWS - gamespy_gp::login_manager* tmp_lmngr = MainMenu()->GetLoginMngr(); + const auto tmp_lmngr = MainMenu()->GetLoginMngr(); VERIFY(tmp_lmngr); - gamespy_profile::profile_store* tmp_store = MainMenu()->GetProfileStore(); + const auto tmp_store = MainMenu()->GetProfileStore(); VERIFY(tmp_store); - gamespy_gp::profile const* tmp_curr_prof = tmp_lmngr->get_current_profile(); + const auto tmp_curr_prof = tmp_lmngr->get_current_profile(); if (!tmp_curr_prof) { @@ -36,13 +35,6 @@ void player_account::load_account() } m_clan_name = ""; m_clan_leader = false; - - gamespy_profile::all_awards_t const& tmp_awards = tmp_store->get_awards(); - for (gamespy_profile::all_awards_t::const_iterator i = tmp_awards.begin(), ie = tmp_awards.end(); i != ie; ++i) - { - m_awards.insert(*i); - } -#endif } void player_account::net_Import(NET_Packet& P) @@ -53,14 +45,11 @@ void player_account::net_Import(NET_Packet& P) m_clan_leader = P.r_u8() ? true : false; m_online_account = P.r_u8() ? true : false; - u16 awards_count = P.r_u16(); + const u16 awards_count = P.r_u16(); for (u16 i = 0; i < awards_count; ++i) { - u16 award_id = P.r_u16(); - u16 acount = P.r_u16(); - m_awards.emplace( - static_cast(award_id), gamespy_profile::award_data(acount, time_t()) - ); + std::ignore = P.r_u16(); + std::ignore = P.r_u16(); } } @@ -72,11 +61,11 @@ void player_account::skip_Import(NET_Packet& P) P.r_stringZ_s(tmp_string); P.r_u8(); P.r_u8(); - u16 awards_count = P.r_u16(); + const u16 awards_count = P.r_u16(); for (u16 i = 0; i < awards_count; ++i) { - P.r_u16(); - P.r_u16(); + std::ignore = P.r_u16(); + std::ignore = P.r_u16(); } } @@ -87,12 +76,7 @@ void player_account::net_Export(NET_Packet& P) P.w_stringZ(m_clan_name); P.w_u8(m_clan_leader ? 1 : 0); P.w_u8(m_online_account ? 1 : 0); - P.w_u16(static_cast(m_awards.size())); - for (all_awards_t::const_iterator i = m_awards.begin(), ie = m_awards.end(); i != ie; ++i) - { - P.w_u16(static_cast(i->first)); - P.w_u16(i->second.m_count); - } + P.w_u16(0); // awards } void player_account::set_player_name(char const* new_name) diff --git a/src/xrGame/player_account.h b/src/xrGame/player_account.h index 68ebbbeb015..7aae47eeea1 100644 --- a/src/xrGame/player_account.h +++ b/src/xrGame/player_account.h @@ -7,7 +7,6 @@ class player_account { public: player_account(); - ~player_account(); shared_str const& name() const { return m_player_name; }; shared_str const& clan_name() const { return m_clan_name; }; @@ -18,7 +17,6 @@ class player_account static void skip_Import(NET_Packet& P); void load_account(); bool is_online() const { return m_online_account; }; - gamespy_profile::all_awards_t const& get_awards() const { return m_awards; }; void set_player_name(char const* new_name); protected: @@ -27,8 +25,6 @@ class player_account u32 m_profile_id; bool m_clan_leader; bool m_online_account; - - gamespy_profile::all_awards_t m_awards; }; // class player_account #endif //#ifndef PLAYER_ACCOUNT_H diff --git a/src/xrGame/player_spot_params.cpp b/src/xrGame/player_spot_params.cpp deleted file mode 100644 index 71682eca9e7..00000000000 --- a/src/xrGame/player_spot_params.cpp +++ /dev/null @@ -1,101 +0,0 @@ -#include "StdAfx.h" -#include "player_spot_params.h" -#include "game_base.h" -#include "game_cl_capture_the_artefact.h" -#include "game_cl_artefacthunt.h" -#include "game_state_accumulator.h" - -namespace award_system -{ -u32 calculate_spots(game_PlayerState* ps) -{ - return ps->m_iRivalKills - (ps->m_iTeamKills * 2) - ps->m_iSelfKills + (ps->af_count * 3); -}; - -u32 player_spots_counter::get_u32_param() -{ - game_PlayerState* tmp_local_player = m_owner->get_local_player(); - if (tmp_local_player) - return calculate_spots(tmp_local_player); - - return 0; -} - -u32 player_spots_with_top_enemy_divider::get_top_enemy_player_score() -{ - game_PlayerState* tmp_local_player = m_owner->get_local_player(); - if (!tmp_local_player) - return 0; - - s8 enemy_team = -1; - switch (Game().Type()) - { - case eGameIDCaptureTheArtefact: - { - if (tmp_local_player->team == etGreenTeam) - { - enemy_team = etBlueTeam; - } - else if (tmp_local_player->team == etBlueTeam) - { - enemy_team = etGreenTeam; - } - else - { - return 0; - } - } - break; - case eGameIDArtefactHunt: - case eGameIDTeamDeathmatch: - { - game_cl_TeamDeathmatch* tmp_game = smart_cast(Level().game); - s16 player_team = tmp_game->ModifyTeam(tmp_local_player->team); - if (player_team == etGreenTeam) - { - enemy_team = etBlueTeam + 1; - } - else if (player_team == etBlueTeam) - { - enemy_team = etGreenTeam + 1; - } - else - { - return 0; - } - } - break; - default: return 0; - }; // switch (Game().Type()) - - s32 max_score = 0; - - for (game_cl_GameState::PLAYERS_MAP_CIT i = Game().players.begin(), ie = Game().players.end(); i != ie; ++i) - { - s32 tmp_score = 0; - game_PlayerState* tmp_player = i->second; - if (tmp_player && (tmp_player->team == enemy_team)) - { - tmp_score = calculate_spots(tmp_player); - } - if (max_score < tmp_score) - max_score = tmp_score; - } - if (max_score < 0) - max_score = 0; - - return max_score; -} - -float player_spots_with_top_enemy_divider::get_float_param() -{ - float my_spots_count = static_cast(player_spots_counter::get_u32_param()); - u32 top_enemy = get_top_enemy_player_score(); - if (top_enemy == 0) - { - return my_spots_count; - } - return my_spots_count / top_enemy; -} - -} // namespace award_system diff --git a/src/xrGame/player_spot_params.h b/src/xrGame/player_spot_params.h deleted file mode 100644 index 7fc2a5ed858..00000000000 --- a/src/xrGame/player_spot_params.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef PLAYER_SPOT_PARAMS_INCLUDED -#define PLAYER_SPOT_PARAMS_INCLUDED - -#include "player_state_param.h" -#include "accumulative_states.h" - -namespace award_system -{ -extern u32 calculate_spots(game_PlayerState* ps); - -class player_spots_counter : public player_state_param -{ - typedef player_state_param inherited; - -public: - player_spots_counter(game_state_accumulator* owner) : inherited(owner) {} - virtual ~player_spots_counter(){}; - - virtual void update(){}; - virtual u32 get_u32_param(); - virtual float get_float_param() { return 0.0f; }; - virtual void reset_game(){}; -}; // class player_spots_counter - -class player_spots_with_top_enemy_divider : public player_spots_counter -{ - typedef player_spots_counter inherited; - -public: - player_spots_with_top_enemy_divider(game_state_accumulator* owner) : inherited(owner){}; - virtual ~player_spots_with_top_enemy_divider(){}; - virtual u32 get_u32_param() { return 0; }; - virtual float get_float_param(); - -private: - u32 get_top_enemy_player_score(); -}; // player_spots_with_top_enemy_divider - -} // namespace award_system - -#endif //#ifndef PLAYER_SPOT_PARAMS_INCLUDED diff --git a/src/xrGame/player_state_achilles_heel.cpp b/src/xrGame/player_state_achilles_heel.cpp deleted file mode 100644 index 11b0df48f61..00000000000 --- a/src/xrGame/player_state_achilles_heel.cpp +++ /dev/null @@ -1,49 +0,0 @@ -#include "StdAfx.h" -#include "player_state_achilles_heel.h" -#include "game_state_accumulator.h" -#include "game_cl_base.h" -#include "Level.h" -#include "ammunition_groups.h" - -namespace award_system -{ -u32 achilles_heel_kill::get_u32_param() { return m_achilles_kill_was ? 1 : 0; } -void achilles_heel_kill::reset_game() { m_achilles_kill_was = false; } -void achilles_heel_kill::OnPlayerKilled( - u16 killer_id, u16 target_id, u16 weapon_id, std::pair kill_type) -{ - game_PlayerState* tmp_local_player = m_owner->get_local_player(); - if (!tmp_local_player) - return; - - if (tmp_local_player->GameID != killer_id) - return; - - if (kill_type.second != SKT_EYESHOT) - return; - - u16 killer_armor = m_owner->get_armor_of_player(tmp_local_player); - if (killer_armor) - return; - - u16 weapon_gid = m_owner->get_active_weapon_of_player(tmp_local_player); - if (!m_owner->is_item_in_group(weapon_gid, ammunition_group::gid_pistols)) - return; - - game_PlayerState* victim_player = Game().GetPlayerByGameID(target_id); - if (!victim_player) - return; - - u16 victim_armor = m_owner->get_armor_of_player(victim_player); - if (!victim_armor) - return; - - u16 victim_weapon = m_owner->get_active_weapon_of_player(victim_player); - if (m_owner->is_item_in_group(victim_armor, ammunition_group::gid_exo_outfit) && - m_owner->is_item_in_group(victim_weapon, ammunition_group::gid_cool_weapons)) - { - m_achilles_kill_was = true; - } -} - -} // namespace award_system diff --git a/src/xrGame/player_state_achilles_heel.h b/src/xrGame/player_state_achilles_heel.h deleted file mode 100644 index f81d6bd717c..00000000000 --- a/src/xrGame/player_state_achilles_heel.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef PLAYER_STATE_ACHILLES_HEEL_INCLUDED -#define PLAYER_STATE_ACHILLES_HEEL_INCLUDED - -#include "player_state_param.h" -#include "accumulative_states.h" - -namespace award_system -{ -class achilles_heel_kill : public player_state_param -{ - typedef player_state_param inherited; - -public: - achilles_heel_kill(game_state_accumulator* owner) : inherited(owner) {} - virtual ~achilles_heel_kill(){}; - - virtual void update(){}; - virtual u32 get_u32_param(); - virtual float get_float_param() { return 0.0f; }; - virtual void reset_game(); - virtual void OnPlayerKilled( - u16 killer_id, u16 target_id, u16 weapon_id, std::pair kill_type); - -protected: - bool m_achilles_kill_was{}; -}; // class achilles_heel_kill - -} // namespace award_system - -#endif //#ifndef PLAYER_STATE_ACHILLES_HEEL_INCLUDED diff --git a/src/xrGame/player_state_ambassador.cpp b/src/xrGame/player_state_ambassador.cpp deleted file mode 100644 index 77d84578d84..00000000000 --- a/src/xrGame/player_state_ambassador.cpp +++ /dev/null @@ -1,85 +0,0 @@ -#include "StdAfx.h" -#include "player_state_ambassador.h" -#include "game_cl_base.h" -#include "game_state_accumulator.h" - -namespace award_system -{ -u32 player_state_ambassador::get_u32_param() -{ - if (m_delivered && (m_shots_count == 0) && (m_art_drop_count == 0)) - return 1; - - return 0; -} - -void player_state_ambassador::reset_game() -{ - m_shots_count = u32(-1); - m_art_drop_count = 0; - m_delivered = false; -} - -void player_state_ambassador::OnWeapon_Fire(u16 sender, u16 sender_weapon_id) -{ - game_PlayerState* tmp_local_player = m_owner->get_local_player(); - - if (!tmp_local_player) - return; - - if (sender != tmp_local_player->GameID) - return; - - ++m_shots_count; -} - -void player_state_ambassador::OnPlayerTakeArtefact(game_PlayerState const* ps) -{ - game_PlayerState* tmp_local_player = m_owner->get_local_player(); - - if (m_art_drop_count) - return; - - if (!tmp_local_player) - return; - - if (ps != tmp_local_player) - return; - - if (m_art_drop_count > 0) - return; - - m_shots_count = 0; - m_delivered = false; -} - -void player_state_ambassador::OnPlayerDropArtefact(game_PlayerState const* ps) -{ - game_PlayerState* tmp_local_player = m_owner->get_local_player(); - if (!tmp_local_player) - { - ++m_art_drop_count; - return; - } - if (tmp_local_player->team == ps->team) - { - ++m_art_drop_count; - } -} - -void player_state_ambassador::OnPlayerBringArtefact(game_PlayerState const* ps) -{ - m_art_drop_count = 0; - - game_PlayerState* tmp_local_player = m_owner->get_local_player(); - - if (!tmp_local_player) - return; - - if (ps != tmp_local_player) - return; - - m_delivered = true; -} - -} // namespace award_system diff --git a/src/xrGame/player_state_ambassador.h b/src/xrGame/player_state_ambassador.h deleted file mode 100644 index ba34c076a62..00000000000 --- a/src/xrGame/player_state_ambassador.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef PLAYER_STATE_AMBASSADOR_INCLUDED -#define PLAYER_STATE_AMBASSADOR_INCLUDED - -#include "player_state_param.h" -#include "accumulative_states.h" - -namespace award_system -{ -class player_state_ambassador : public player_state_param -{ - typedef player_state_param inherited; - -public: - player_state_ambassador(game_state_accumulator* owner) : inherited(owner) {} - virtual ~player_state_ambassador(){}; - - virtual void update(){}; - virtual u32 get_u32_param(); - virtual float get_float_param() { return -1.0f; }; - virtual void reset_game(); - - virtual void OnWeapon_Fire(u16 sender, u16 sender_weapon_id); - virtual void OnPlayerTakeArtefact(game_PlayerState const* ps); - virtual void OnPlayerDropArtefact(game_PlayerState const* ps); - virtual void OnPlayerBringArtefact(game_PlayerState const* ps); - -protected: - u32 m_shots_count{ u32(-1) }; - u32 m_art_drop_count{}; - bool m_delivered{}; -}; // class player_state_ambassador - -} // namespace award_system - -#endif //#ifndef PLAYER_STATE_AMBASSADOR_INCLUDED diff --git a/src/xrGame/player_state_ammo_elapsed.cpp b/src/xrGame/player_state_ammo_elapsed.cpp deleted file mode 100644 index a1552f2ede2..00000000000 --- a/src/xrGame/player_state_ammo_elapsed.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include "StdAfx.h" -#include "player_state_ammo_elapsed.h" -#include "game_state_accumulator.h" -#include "Weapon.h" - -namespace award_system -{ -u32 player_state_ammo_elapsed::get_u32_param() -{ - game_PlayerState* tmp_local_player = m_owner->get_local_player(); - if (!tmp_local_player) - return u32(-1); - - CWeapon* tmp_active_weapon = m_owner->get_active_weapon(tmp_local_player); - if (!tmp_active_weapon) - return u32(-1); - - return static_cast(tmp_active_weapon->GetAmmoElapsed()); -} - -} // namespace award_system diff --git a/src/xrGame/player_state_ammo_elapsed.h b/src/xrGame/player_state_ammo_elapsed.h deleted file mode 100644 index 820b23725fc..00000000000 --- a/src/xrGame/player_state_ammo_elapsed.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef PLAYER_STATE_AMMO_ELAPSED_INCLUDED -#define PLAYER_STATE_AMMO_ELAPSED_INCLUDED - -#include "player_state_param.h" -#include "accumulative_states.h" - -namespace award_system -{ -class player_state_ammo_elapsed : public player_state_param -{ - typedef player_state_param inherited; - -public: - player_state_ammo_elapsed(game_state_accumulator* owner) : inherited(owner) {}; - virtual ~player_state_ammo_elapsed(){}; - - virtual void update(){}; - virtual u32 get_u32_param(); - virtual float get_float_param() { return 0.0f; }; - virtual void reset_game(){}; -}; // class player_state_ammo_elapsed - -} // namespace award_system - -#endif //#ifndef PLAYER_STATE_AMMO_ELAPSED_INCLUDED diff --git a/src/xrGame/player_state_avenger.cpp b/src/xrGame/player_state_avenger.cpp deleted file mode 100644 index 87ed2e0769f..00000000000 --- a/src/xrGame/player_state_avenger.cpp +++ /dev/null @@ -1,95 +0,0 @@ -#include "StdAfx.h" -#include "player_state_avenger.h" -#include "kills_store.h" -#include "game_cl_base.h" -#include "Level.h" -#include "game_state_accumulator.h" - -namespace award_system -{ -void player_state_avenger::reset_game() -{ - m_player_spawns.clear(); - m_aveng_count = 0; -} - -void player_state_avenger::OnPlayerKilled( - u16 killer_id, u16 target_id, u16 weapon_id, std::pair kill_type) -{ - struct need_revenge : Noncopyable - { - need_revenge(shared_str* buff_store, u32 store_size) : m_my_team_players(buff_store, store_size){}; - - bool operator()(shared_str const& killer, shared_str const& victim, kills_store::kill const& kill) - { - if ((killer == m_killer_name) && (kill.m_kill_time >= m_killer_spawn_time)) - { - if (std::find(m_my_team_players.begin(), m_my_team_players.end(), victim) != m_my_team_players.end()) - { - return true; - } - } - return false; - } - shared_str m_killer_name; - u32 m_killer_spawn_time; - buffer_vector m_my_team_players; - }; // struct need_revenge - - game_PlayerState const* tmp_local_player = m_owner->get_local_player(); - if (!tmp_local_player || tmp_local_player->GameID != killer_id) - return; - - game_PlayerState const* tmp_victim = Game().GetPlayerByGameID(target_id); - if (!tmp_victim) - return; - - shared_str team_players_store[MAX_PLAYERS_COUNT]; - need_revenge tmp_predicate(team_players_store, sizeof(team_players_store) / sizeof(shared_str)); - tmp_predicate.m_killer_name = tmp_victim->getName(); - - player_spawn_times_t::const_iterator tmp_spawn_time = m_player_spawns.find(tmp_predicate.m_killer_name); - - if (tmp_spawn_time == m_player_spawns.end()) - return; - - tmp_predicate.m_killer_spawn_time = tmp_spawn_time->second; - feel_my_team_players(tmp_local_player, tmp_predicate.m_my_team_players); - - buffer_vector tmp_fake_buffer(NULL, 0); - if (m_owner->get_kills_store().fetch_kills(tmp_predicate, tmp_fake_buffer) > 0) - { - ++m_aveng_count; - } -} - -void player_state_avenger::feel_my_team_players(game_PlayerState const* of_player, buffer_vector& dest) -{ - game_PlayerState const* tmp_local_player = m_owner->get_local_player(); - for (game_cl_GameState::PLAYERS_MAP_CIT i = Game().players.begin(), ie = Game().players.end(); i != ie; ++i) - { - if (i->second == tmp_local_player) - continue; - - if (!m_owner->is_enemies(of_player, i->second)) - { - dest.push_back(i->second->getName()); - } - }; -} - -void player_state_avenger::OnPlayerSpawned(game_PlayerState const* ps) -{ - game_PlayerState const* tmp_local_player = m_owner->get_local_player(); - if (ps == tmp_local_player) - { - m_aveng_count = 0; - return; - } - if (tmp_local_player && m_owner->is_enemies(tmp_local_player, ps)) - { - m_player_spawns.emplace(shared_str(ps->getName()), Device.dwTimeGlobal); - } -} - -} // namespace award_system diff --git a/src/xrGame/player_state_avenger.h b/src/xrGame/player_state_avenger.h deleted file mode 100644 index b74dfdffefa..00000000000 --- a/src/xrGame/player_state_avenger.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef PLAYER_STATE_AVENGER -#define PLAYER_STATE_AVENGER - -#include "player_state_param.h" -#include "accumulative_states.h" - -namespace award_system -{ -class player_state_avenger : public player_state_param -{ - typedef player_state_param inherited; - -public: - player_state_avenger(game_state_accumulator* owner) : inherited(owner) {}; - ~player_state_avenger(){}; - - virtual void update(){}; - virtual u32 get_u32_param() { return m_aveng_count; }; - virtual float get_float_param() { return 0.0f; }; - virtual void reset_game(); - - virtual void OnPlayerKilled( - u16 killer_id, u16 target_id, u16 weapon_id, std::pair kill_type); - virtual void OnPlayerSpawned(game_PlayerState const* ps); - -protected: - void feel_my_team_players(game_PlayerState const* of_player, buffer_vector& dest); - typedef AssociativeVector player_spawn_times_t; - player_spawn_times_t m_player_spawns; - u32 m_aveng_count{}; -}; // class player_state_avenger - -} // namespace award_system - -#endif //#ifndef PLAYER_STATE_AVENGER diff --git a/src/xrGame/player_state_blitzkrieg.cpp b/src/xrGame/player_state_blitzkrieg.cpp deleted file mode 100644 index 19daac0c618..00000000000 --- a/src/xrGame/player_state_blitzkrieg.cpp +++ /dev/null @@ -1,57 +0,0 @@ -#include "StdAfx.h" -#include "game_cl_base.h" -#include "player_state_blitzkrieg.h" -#include "game_state_accumulator.h" - -namespace award_system -{ -void player_blitzkrieg::reset_game() -{ - m_art_drop_count = 0; - m_deliver_time = u32(-1); - m_take_time = 0; -} - -void player_blitzkrieg::OnPlayerTakeArtefact(game_PlayerState const* ps) -{ - game_PlayerState* tmp_local_player = m_owner->get_local_player(); - if ((m_art_drop_count == 0) && (ps == tmp_local_player)) - { - m_take_time = Device.dwTimeGlobal; - } - else - { - m_take_time = 0; - } - m_deliver_time = u32(-1); -} - -void player_blitzkrieg::OnPlayerDropArtefact(game_PlayerState const* ps) -{ - game_PlayerState* tmp_local_player = m_owner->get_local_player(); - if (!tmp_local_player) - return; - - // if there was dropping before delivering then, artefacts not on base .. - if (ps->team == tmp_local_player->team) - { - ++m_art_drop_count; - } -} - -void player_blitzkrieg::OnPlayerBringArtefact(game_PlayerState const* ps) -{ - game_PlayerState* tmp_local_player = m_owner->get_local_player(); - if ((m_art_drop_count <= 1) && (ps == tmp_local_player)) - { - m_deliver_time = Device.dwTimeGlobal - m_take_time; - } - else - { - m_deliver_time = u32(-1); - } - m_art_drop_count = 0; -} - -u32 player_blitzkrieg::get_u32_param() { return m_deliver_time; }; -} // namespace award_system diff --git a/src/xrGame/player_state_blitzkrieg.h b/src/xrGame/player_state_blitzkrieg.h deleted file mode 100644 index 6f0c95af43e..00000000000 --- a/src/xrGame/player_state_blitzkrieg.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef PLAYER_STATE_BLITZKRIEG_INCLUDED -#define PLAYER_STATE_BLITZKRIEG_INCLUDED - -#include "player_state_param.h" -#include "accumulative_states.h" - -namespace award_system -{ -class player_blitzkrieg : public player_state_param -{ - typedef player_state_param inherited; - -public: - player_blitzkrieg(game_state_accumulator* owner) : inherited(owner) {}; - virtual ~player_blitzkrieg(){}; - - virtual void update(){}; - virtual u32 get_u32_param(); - virtual float get_float_param() { return -1.0f; }; - virtual void reset_game(); - - virtual void OnPlayerTakeArtefact(game_PlayerState const* ps); - virtual void OnPlayerDropArtefact(game_PlayerState const* ps); - virtual void OnPlayerBringArtefact(game_PlayerState const* ps); - -protected: - u32 m_deliver_time{ u32(-1) }; - u32 m_take_time{}; - u32 m_art_drop_count{}; -}; // class player_blitzkrieg - -} // namespace award_system - -#endif //#ifndef PLAYER_STATE_BLITZKRIEG_INCLUDED diff --git a/src/xrGame/player_state_cherub.cpp b/src/xrGame/player_state_cherub.cpp deleted file mode 100644 index a9404261bf9..00000000000 --- a/src/xrGame/player_state_cherub.cpp +++ /dev/null @@ -1,102 +0,0 @@ -#include "StdAfx.h" -#include "player_state_cherub.h" -#include "kills_store.h" -#include "game_cl_base.h" -#include "Level.h" -#include "game_state_accumulator.h" - -namespace award_system -{ -void player_state_cherub::reset_game() -{ - m_kill_count = 0; - m_art_take_time = 0; - m_bearer_id = u16(-1); - m_bearer_name = ""; -} - -void player_state_cherub::OnPlayerTakeArtefact(game_PlayerState const* ps) -{ - if (m_owner->is_enemies(ps, m_owner->get_local_player())) - return; - - m_bearer_id = ps->GameID; - m_bearer_name = ps->getName(); - m_art_take_time = Device.dwTimeGlobal; -} - -void player_state_cherub::OnPlayerDropArtefact(game_PlayerState const* ps) -{ - if (ps->GameID == m_bearer_id) - { - m_bearer_id = u16(-1); - m_bearer_name = ""; - } -} - -void player_state_cherub::OnPlayerBringArtefact(game_PlayerState const* ps) -{ - if (ps->GameID == m_bearer_id) - { - m_bearer_id = u16(-1); - m_bearer_name = ""; - } -} - -void player_state_cherub::OnPlayerKilled( - u16 killer_id, u16 target_id, u16 weapon_id, std::pair kill_type) -{ - struct hit_fetcher - { - bool operator()(shared_str const& hitter, shared_str const& victim, hits_store::bullet_hit const& hit) - { - if ((hitter == m_hitter_name) && (victim == m_victim_name) && (hit.m_hit_time >= m_art_take_time)) - { - return true; - } - return false; - } - shared_str m_hitter_name; - shared_str m_victim_name; - u32 m_art_take_time; - }; // struct hit_fetcher - - game_PlayerState* tmp_player_state = m_owner->get_local_player(); - if (!tmp_player_state) - return; - - if (killer_id != tmp_player_state->GameID) - return; - - if (m_bearer_id == u16(-1)) - return; - - if (m_bearer_name == tmp_player_state->getName()) - return; - - game_PlayerState* tmp_victim_player = Game().GetPlayerByGameID(target_id); - if (!tmp_victim_player) - return; - - hit_fetcher tmp_fetcher; - tmp_fetcher.m_victim_name = m_bearer_name; - tmp_fetcher.m_hitter_name = tmp_victim_player->getName(); - tmp_fetcher.m_art_take_time = m_art_take_time; - - buffer_vector tmp_fake_buffer(NULL, 0); - - if (m_owner->get_hits_store().fetch_hits(tmp_fetcher, tmp_fake_buffer) > 0) - { - ++m_kill_count; - } -} - -void player_state_cherub::OnPlayerSpawned(game_PlayerState const* ps) -{ - if (ps == m_owner->get_local_player()) - { - m_kill_count = 0; - } -} - -} // namespace award_system diff --git a/src/xrGame/player_state_cherub.h b/src/xrGame/player_state_cherub.h deleted file mode 100644 index c4facf88948..00000000000 --- a/src/xrGame/player_state_cherub.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef PLAYER_STATE_CHERUB_INCLUDED -#define PLAYER_STATE_CHERUB_INCLUDED - -#include "player_state_param.h" -#include "accumulative_states.h" - -namespace award_system -{ -class player_state_cherub : public player_state_param -{ - typedef player_state_param inherited; - -public: - player_state_cherub(game_state_accumulator* owner) : inherited(owner) {}; - virtual ~player_state_cherub(){}; - - virtual void update(){}; - virtual u32 get_u32_param() { return m_kill_count; }; - virtual float get_float_param() { return -1.0f; }; - virtual void reset_game(); - - virtual void OnPlayerTakeArtefact(game_PlayerState const* ps); - virtual void OnPlayerDropArtefact(game_PlayerState const* ps); - virtual void OnPlayerBringArtefact(game_PlayerState const* ps); - - virtual void OnPlayerKilled( - u16 killer_id, u16 target_id, u16 weapon_id, std::pair kill_type); - virtual void OnPlayerSpawned(game_PlayerState const* ps); - -protected: - u32 m_kill_count{}; - u32 m_art_take_time{}; - u16 m_bearer_id{ u16(-1) }; - shared_str m_bearer_name; -}; // class player_state_cherub - -} - -#endif //#ifndef PLAYER_STATE_CHERUB_INCLUDED diff --git a/src/xrGame/player_state_climber.cpp b/src/xrGame/player_state_climber.cpp deleted file mode 100644 index b149610edec..00000000000 --- a/src/xrGame/player_state_climber.cpp +++ /dev/null @@ -1,46 +0,0 @@ -#include "StdAfx.h" -#include "player_state_climber.h" -#include "game_cl_base.h" -#include "Level.h" -#include "game_state_accumulator.h" - -namespace award_system -{ -u32 player_state_climber::get_u32_param() -{ - game_PlayerState* tmp_local_player = m_owner->get_local_player(); - if (!tmp_local_player) - return 0; - - return m_player_is_climber ? tmp_local_player->rank : 0; -} - -void player_state_climber::OnPlayerRankChanged() -{ - game_PlayerState* tmp_local_player = m_owner->get_local_player(); - if (!tmp_local_player) - return; - - u8 max_rank = 0; - u8 max_count = 0; - game_PlayerState* max_player_rank = NULL; - - for (game_cl_GameState::PLAYERS_MAP_CIT i = Game().players.begin(), ie = Game().players.end(); i != ie; ++i) - { - u8 player_rank = i->second->rank; - if (player_rank > max_rank) - { - max_player_rank = i->second; - max_count = 1; - max_rank = max_player_rank->rank; - } - else if (player_rank == max_rank) - { - ++max_count; - } - } - if (max_count && (max_player_rank == tmp_local_player)) - m_player_is_climber = true; -} - -} // namespace award_system diff --git a/src/xrGame/player_state_climber.h b/src/xrGame/player_state_climber.h deleted file mode 100644 index 0b6bb436fa6..00000000000 --- a/src/xrGame/player_state_climber.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef PLAYER_STATE_CLIMBER_INCLUDED -#define PLAYER_STATE_CLIMBER_INCLUDED - -#include "player_state_param.h" -#include "accumulative_states.h" - -namespace award_system -{ -class player_state_climber : public player_state_param -{ - typedef player_state_param inherited; - -public: - player_state_climber(game_state_accumulator* owner) : inherited(owner) {}; - ~player_state_climber(){}; - - virtual void update(){}; - virtual u32 get_u32_param(); - virtual float get_float_param() { return 0.0f; }; - virtual void reset_game() { m_player_is_climber = false; }; - virtual void OnPlayerRankChanged(); - -protected: - bool m_player_is_climber{}; -}; // class player_state_climber - -} // namespace award_system - -#endif //#ifndef PLAYER_STATE_CLIMBER_INCLUDED diff --git a/src/xrGame/player_state_mad.cpp b/src/xrGame/player_state_mad.cpp deleted file mode 100644 index fabdce0e861..00000000000 --- a/src/xrGame/player_state_mad.cpp +++ /dev/null @@ -1,35 +0,0 @@ -#include "StdAfx.h" -#include "player_state_mad.h" -#include "game_base.h" -#include "game_state_accumulator.h" - -namespace award_system -{ -void player_state_mad::reset_game() { m_kill_times.clear(); } -void player_state_mad::OnPlayerKilled( - u16 killer_id, u16 target_id, u16 weapon_id, std::pair kill_type) -{ - game_PlayerState* tmp_local_player = m_owner->get_local_player(); - if (!tmp_local_player) - return; - - if ((tmp_local_player->GameID == killer_id) && - ((kill_type.second == SKT_KNIFEKILL) || (kill_type.second == SKT_BACKSTAB))) - { - m_kill_times.push_back(Device.dwTimeGlobal); - } - clear_old_kills(); -} - -void player_state_mad::clear_old_kills() -{ - u32 current_time = Device.dwTimeGlobal; - - while (!m_kill_times.empty() && ((current_time - m_kill_times.front()) > mad_time_period)) - { - m_kill_times.erase(m_kill_times.begin()); - } -} - -u32 player_state_mad::get_u32_param() { return m_kill_times.size(); } -} // namespace award_system diff --git a/src/xrGame/player_state_mad.h b/src/xrGame/player_state_mad.h deleted file mode 100644 index 432bba65608..00000000000 --- a/src/xrGame/player_state_mad.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef PLAYER_STATE_MAD_INCLUDED -#define PLAYER_STATE_MAD_INCLUDED - -#include "player_state_param.h" -#include "accumulative_states.h" - -namespace award_system -{ -class player_state_mad : public player_state_param -{ - typedef player_state_param inherited; - -public: - player_state_mad(game_state_accumulator* owner) : inherited(owner) {}; - virtual ~player_state_mad(){}; - - virtual void update(){}; - virtual u32 get_u32_param(); - virtual float get_float_param() { return 0.0f; }; - virtual void reset_game(); - virtual void OnPlayerKilled( - u16 killer_id, u16 target_id, u16 weapon_id, std::pair kill_type); - - static u32 const mad_time_period = 20000; // 20 seconds -protected: - typedef xr_vector kill_times_t; - - kill_times_t m_kill_times; - void clear_old_kills(); -}; // class player_state_mad - -} // namespace award_system - -#endif //#ifndef PLAYER_STATE_MAD_INCLUDED diff --git a/src/xrGame/player_state_marksman.cpp b/src/xrGame/player_state_marksman.cpp deleted file mode 100644 index 2def5946ab9..00000000000 --- a/src/xrGame/player_state_marksman.cpp +++ /dev/null @@ -1,65 +0,0 @@ -#include "StdAfx.h" -#include "player_state_marksman.h" -#include "kills_store.h" -#include "game_cl_base.h" -#include "Level.h" -#include "game_state_accumulator.h" -#include "Actor.h" - -namespace award_system -{ -u32 player_state_marksman::get_u32_param() { return m_sniper_victims.size(); } -void player_state_marksman::reset_game() -{ - m_spawn_time = 0; - m_sniper_victims.clear(); -} - -void player_state_marksman::OnPlayerKilled( - u16 killer_id, u16 target_id, u16 weapon_id, std::pair kill_type) -{ - game_PlayerState* tmp_local_player = m_owner->get_local_player(); - if (!tmp_local_player) - return; - - if (!m_spawn_time) - return; - - if (killer_id != tmp_local_player->GameID) - return; - - u16 weapon_gid = m_owner->get_active_weapon_of_player(tmp_local_player); - if (!m_owner->is_item_in_group(weapon_gid, ammunition_group::gid_sniper_rifels)) - return; - - game_PlayerState* victim_player = Game().GetPlayerByGameID(target_id); - if (!victim_player) - return; - - u16 victim_weapon_gid = m_owner->get_active_weapon_of_player(victim_player); - if (!m_owner->is_item_in_group(victim_weapon_gid, ammunition_group::gid_sniper_rifels)) - return; - - CActor* killer_actor = m_owner->get_players_actor(killer_id); - CActor* victim_actor = m_owner->get_players_actor(target_id); - - if (killer_actor && victim_actor) - { - float kill_dist = killer_actor->Position().distance_to(victim_actor->Position()); - if (kill_dist >= max_kill_dist) - { - m_sniper_victims.emplace(victim_actor->cName(), kill_dist); - } - } -} - -void player_state_marksman::OnPlayerSpawned(game_PlayerState const* ps) -{ - if (ps == m_owner->get_local_player()) - { - m_spawn_time = Device.dwTimeGlobal; - m_sniper_victims.clear(); - } -} - -} // namespace award_system diff --git a/src/xrGame/player_state_marksman.h b/src/xrGame/player_state_marksman.h deleted file mode 100644 index f878c6bdd49..00000000000 --- a/src/xrGame/player_state_marksman.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef PLAYER_STATE_MARKSMAN -#define PLAYER_STATE_MARKSMAN - -#include "player_state_param.h" -#include "accumulative_states.h" - -namespace award_system -{ -class player_state_marksman : public player_state_param -{ - typedef player_state_param inherited; - -public: - player_state_marksman(game_state_accumulator* owner) : inherited(owner) {}; - ~player_state_marksman(){}; - - virtual void update(){}; - virtual u32 get_u32_param(); - virtual float get_float_param() { return 0.0f; }; - virtual void reset_game(); - - virtual void OnPlayerKilled( - u16 killer_id, u16 target_id, u16 weapon_id, std::pair kill_type); - virtual void OnPlayerSpawned(game_PlayerState const* ps); - -protected: - static int const max_kill_dist = 80; - // data of the vector is float - kill distance - used only for debug. - AssociativeVector m_sniper_victims; - u32 m_spawn_time{}; -}; // class player_state_marksman - -} // namespace award_system - -#endif //#ifndef PLAYER_STATE_MARKSMAN diff --git a/src/xrGame/player_state_multichampion.cpp b/src/xrGame/player_state_multichampion.cpp deleted file mode 100644 index b7ae85f6e60..00000000000 --- a/src/xrGame/player_state_multichampion.cpp +++ /dev/null @@ -1,72 +0,0 @@ -#include "StdAfx.h" -#include "player_state_multichampion.h" -#include "player_spot_params.h" -#include "game_cl_base.h" -#include "Level.h" -#include "game_state_accumulator.h" - -namespace award_system -{ -void player_multichampion::reset_game() { m_can_be_multichampion = false; } -void player_multichampion::OnRoundEnd() { m_can_be_multichampion = true; } -u32 player_multichampion::get_u32_param() -{ - game_PlayerState* tmp_local_player = m_owner->get_local_player(); - if (!tmp_local_player) - return 0; - - if (!m_can_be_multichampion) - return 0; - - s32 max_score = calculate_spots(tmp_local_player); - s16 min_death = tmp_local_player->m_iDeaths; - u8 max_arts = tmp_local_player->af_count; - - game_PlayerState* max_score_player = tmp_local_player; - game_PlayerState* max_arts_player = tmp_local_player; - game_PlayerState* min_death_player = tmp_local_player; - - for (game_cl_GameState::PLAYERS_MAP_CIT i = Game().players.begin(), ie = Game().players.end(); i != ie; ++i) - { - s32 tmp_score = 0; - s16 tmp_death = 0; - u8 tmp_arts = 0; - game_PlayerState* tmp_player = i->second; - if (tmp_player) - { - tmp_score = calculate_spots(tmp_player); - tmp_death = tmp_player->m_iDeaths; - tmp_arts = tmp_player->af_count; - } - else - { - continue; - } - - if (max_score < tmp_score) - { - max_score = tmp_score; - max_score_player = tmp_player; - } - if (min_death > tmp_death) - { - min_death = tmp_death; - min_death_player = tmp_player; - } - if (max_arts < tmp_arts) - { - max_arts = tmp_arts; - max_arts_player = tmp_player; - } - } - - if ((min_death_player == tmp_local_player) && (max_score_player == tmp_local_player) && - (max_arts_player == tmp_local_player)) - { - m_can_be_multichampion = false; - return 1; - } - return 0; -} - -} // namespace award_system diff --git a/src/xrGame/player_state_multichampion.h b/src/xrGame/player_state_multichampion.h deleted file mode 100644 index 889f4c2d1af..00000000000 --- a/src/xrGame/player_state_multichampion.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef PLAYER_STATE_MULTICHAMPION_INCLUDED -#define PLAYER_STATE_MULTICHAMPION_INCLUDED - -#include "player_state_param.h" -#include "accumulative_states.h" - -namespace award_system -{ -class player_multichampion : public player_state_param -{ - typedef player_state_param inherited; - -public: - player_multichampion(game_state_accumulator* owner) : inherited(owner) {}; - virtual ~player_multichampion(){}; - - virtual void update(){}; - virtual u32 get_u32_param(); - virtual float get_float_param() { return 0.0f; }; - virtual void reset_game(); - - virtual void OnRoundEnd(); - -protected: - bool m_can_be_multichampion{}; -}; // class player_multichampion - -} // namespace award_system - -#endif //#ifndef PLAYER_STATE_MULTICHAMPION_INCLUDED diff --git a/src/xrGame/player_state_opener.cpp b/src/xrGame/player_state_opener.cpp deleted file mode 100644 index 7286a97a83b..00000000000 --- a/src/xrGame/player_state_opener.cpp +++ /dev/null @@ -1,34 +0,0 @@ -#include "StdAfx.h" -#include "player_state_opener.h" -#include "game_cl_base.h" -#include "Level.h" -#include "game_state_accumulator.h" - -namespace award_system -{ -u32 player_state_opener::get_u32_param() { return m_opener_ready ? 1 : 0; } -void player_state_opener::reset_game() { m_opener_ready = false; } -void player_state_opener::OnPlayerKilled( - u16 killer_id, u16 target_id, u16 weapon_id, std::pair kill_type) -{ - game_PlayerState* tmp_local_player = m_owner->get_local_player(); - - if (!tmp_local_player) - return; - - if (killer_id != tmp_local_player->GameID) - return; - - game_PlayerState* victim_player = Game().GetPlayerByGameID(target_id); - if (!victim_player) - return; - - u16 victim_armor = m_owner->get_armor_of_player(victim_player); - if ((kill_type.second == SKT_KNIFEKILL) && - m_owner->is_item_in_group(victim_armor, ammunition_group::gid_exo_outfit)) - { - m_opener_ready = true; - } -} - -} // namespace award_system diff --git a/src/xrGame/player_state_opener.h b/src/xrGame/player_state_opener.h deleted file mode 100644 index 640b1e25712..00000000000 --- a/src/xrGame/player_state_opener.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef PLAYER_STATE_OPENER_INCLUDED -#define PLAYER_STATE_OPENER_INCLUDED - -#include "player_state_param.h" -#include "accumulative_states.h" - -namespace award_system -{ -class player_state_opener : public player_state_param -{ - typedef player_state_param inherited; - -public: - player_state_opener(game_state_accumulator* owner) : inherited(owner) {}; - virtual ~player_state_opener(){}; - - virtual void update(){}; - virtual u32 get_u32_param(); - virtual float get_float_param() { return 0.0f; }; - virtual void reset_game(); - - virtual void OnPlayerKilled( - u16 killer_id, u16 target_id, u16 weapon_id, std::pair kill_type); - -protected: - bool m_opener_ready{}; -}; // class player_state_opener - -} // namespace award_system - -#endif //#ifndef PLAYER_STATE_OPENER_INCLUDED diff --git a/src/xrGame/player_state_param.h b/src/xrGame/player_state_param.h deleted file mode 100644 index 7f78cc82534..00000000000 --- a/src/xrGame/player_state_param.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef PLAYER_STATE_PARAM_INCLUDED -#define PLAYER_STATE_PARAM_INCLUDED - -#include "game_events_handler.h" - -namespace award_system -{ -class game_state_accumulator; - -class player_state_param : public game_events_handler -{ -public: - player_state_param(game_state_accumulator* owner) : m_owner(owner) {} - virtual ~player_state_param(){}; - virtual void update() = 0; - virtual void init_player(game_PlayerState* new_local_player){}; - virtual u32 get_u32_param() = 0; - virtual float get_float_param() = 0; - virtual void reset_game() = 0; - - virtual void OnWeapon_Fire(u16 sender, u16 sender_weapon_id){}; - virtual void OnBullet_Fire(u16 sender, u16 sender_weapon_id, const Fvector& position, const Fvector& direction){}; - virtual void OnBullet_Hit( - IGameObject const* hitter, IGameObject const* victim, IGameObject const* weapon, u16 const bone){}; - virtual void OnArtefactSpawned(){}; - virtual void OnPlayerTakeArtefact(game_PlayerState const* ps){}; - virtual void OnPlayerDropArtefact(game_PlayerState const* ps){}; - virtual void OnPlayerBringArtefact(game_PlayerState const* ps){}; - virtual void OnPlayerSpawned(game_PlayerState const* ps){}; - virtual void OnPlayerKilled( - u16 killer_id, u16 target_id, u16 weapon_id, std::pair kill_type){}; - virtual void OnPlayerChangeTeam(s8 team){}; - virtual void OnPlayerRankChanged(){}; - virtual void OnRoundEnd(){}; - virtual void OnRoundStart(){}; - -protected: - game_state_accumulator* m_owner; -}; // class player_state_param - -} // namespace award_system - -#endif //#ifndef PLAYER_STATE_PARAM_INCLUDED diff --git a/src/xrGame/player_state_params.cpp b/src/xrGame/player_state_params.cpp deleted file mode 100644 index ceaaddb1f62..00000000000 --- a/src/xrGame/player_state_params.cpp +++ /dev/null @@ -1,107 +0,0 @@ -#include "StdAfx.h" -#include "player_state_params.h" -#include "game_cl_base.h" -#include "game_state_accumulator.h" -#include "Actor.h" - -namespace award_system -{ -u32 player_death_counter::get_u32_param() -{ - game_PlayerState* tmp_local_player = m_owner->get_local_player(); - u32 death_count = tmp_local_player ? static_cast(tmp_local_player->m_iDeaths) : u32(-1); - return death_count; -} - -// player_artdeliver_counter - -u32 player_artdeliver_counter::get_u32_param() -{ - game_PlayerState* tmp_local_player = m_owner->get_local_player(); - u32 arts_count = tmp_local_player ? static_cast(tmp_local_player->af_count) : 0; - return arts_count; -} - -// player_rawkill_counter - -u32 player_rawkill_counter::get_u32_param() -{ - // u32 rawkill_count = m_local_player ? m_local_player->m_iKillsInRowCurr : 0; - return m_raw_kills; -} - -void player_rawkill_counter::reset_game() { m_raw_kills = 0; }; -void player_rawkill_counter::OnPlayerSpawned(game_PlayerState const* ps) -{ - game_PlayerState* tmp_local_player = m_owner->get_local_player(); - if (!tmp_local_player) - return; - - if (ps == tmp_local_player) - { - m_raw_kills = 0; - } -} - -void player_rawkill_counter::OnPlayerKilled( - u16 killer_id, u16 target_id, u16 weapon_id, std::pair kill_type) -{ - game_PlayerState* tmp_local_player = m_owner->get_local_player(); - if (!tmp_local_player) - return; - - if (killer_id == tmp_local_player->GameID) - { - ++m_raw_kills; - } -} - -u32 player_state_move::get_u32_param() -{ - game_PlayerState* tmp_local_player = m_owner->get_local_player(); - if (!tmp_local_player) - return 0; - - CActor* tmp_actor = m_owner->get_players_actor(tmp_local_player->GameID); - if (!tmp_actor) - return 0; - - CEntity::SEntityState state; - tmp_actor->g_State(state); - - return state.bCrouch | (state.bSprint << 1) | (state.bJump << 2) | (state.bFall << 3); -} - -float player_state_velocity::get_float_param() -{ - game_PlayerState* tmp_local_player = m_owner->get_local_player(); - if (!tmp_local_player) - return 0.0f; - - CActor* tmp_actor = m_owner->get_players_actor(tmp_local_player->GameID); - if (!tmp_actor) - return 0.0f; - - CEntity::SEntityState state; - tmp_actor->g_State(state); - - return state.fVelocity; -} - -float player_state_ang_velocity::get_float_param() -{ - game_PlayerState* tmp_local_player = m_owner->get_local_player(); - if (!tmp_local_player) - return 0.0f; - - CActor* tmp_actor = m_owner->get_players_actor(tmp_local_player->GameID); - if (!tmp_actor) - return 0.0f; - - CEntity::SEntityState state; - tmp_actor->g_State(state); - - return state.fAVelocity; -} - -} // namespace award_system diff --git a/src/xrGame/player_state_params.h b/src/xrGame/player_state_params.h deleted file mode 100644 index 27d2fed04f6..00000000000 --- a/src/xrGame/player_state_params.h +++ /dev/null @@ -1,102 +0,0 @@ -#ifndef DEATH_COUNT_INCLUDED -#define DEATH_COUNT_INCLUDED - -#include "player_state_param.h" -#include "accumulative_states.h" - -namespace award_system -{ -class player_death_counter : public player_state_param -{ - typedef player_state_param inherited; - -public: - player_death_counter(game_state_accumulator* owner) : inherited(owner) {}; - virtual ~player_death_counter(){}; - - virtual void update(){}; - virtual u32 get_u32_param(); - virtual float get_float_param() { return -1.0f; }; - virtual void reset_game(){}; -}; // class player_death_counter - -class player_artdeliver_counter : public player_state_param -{ - typedef player_state_param inherited; - -public: - player_artdeliver_counter(game_state_accumulator* owner) : inherited(owner) {}; - virtual ~player_artdeliver_counter(){}; - - virtual void update(){}; - virtual u32 get_u32_param(); - virtual float get_float_param() { return 0.0f; }; - virtual void reset_game(){}; -}; // class player_artdeliver_counter - -class player_rawkill_counter : public player_state_param -{ - typedef player_state_param inherited; - -public: - player_rawkill_counter(game_state_accumulator* owner) : inherited(owner) {}; - virtual ~player_rawkill_counter(){}; - - virtual void update(){}; - virtual u32 get_u32_param(); - virtual float get_float_param() { return 0.0f; }; - virtual void reset_game(); - - virtual void OnPlayerSpawned(game_PlayerState const* ps); - virtual void OnPlayerKilled( - u16 killer_id, u16 target_id, u16 weapon_id, std::pair kill_type); - -protected: - u32 m_raw_kills{}; -}; // class player_rawkill_counter - -class player_state_move : public player_state_param -{ - typedef player_state_param inherited; - -public: - player_state_move(game_state_accumulator* owner) : inherited(owner) {}; - virtual ~player_state_move(){}; - - virtual void update(){}; - virtual u32 get_u32_param(); - virtual float get_float_param() { return 0.0f; }; - virtual void reset_game(){}; -}; // class player_state_move - -class player_state_velocity : public player_state_param -{ - typedef player_state_param inherited; - -public: - player_state_velocity(game_state_accumulator* owner) : inherited(owner) {}; - virtual ~player_state_velocity(){}; - - virtual void update(){}; - virtual u32 get_u32_param() { return 0; } - virtual float get_float_param(); - virtual void reset_game(){}; -}; // class player_state_velocity - -class player_state_ang_velocity : public player_state_param -{ - typedef player_state_param inherited; - -public: - player_state_ang_velocity(game_state_accumulator* owner) : inherited(owner) {}; - virtual ~player_state_ang_velocity(){}; - - virtual void update(){}; - virtual u32 get_u32_param() { return 0; } - virtual float get_float_param(); - virtual void reset_game(){}; -}; // class player_state_ang_velocity - -} // namespace award_system - -#endif //#ifndef DEATH_COUNT_INCLUDED diff --git a/src/xrGame/player_state_remembrance.cpp b/src/xrGame/player_state_remembrance.cpp deleted file mode 100644 index 3283055d5f5..00000000000 --- a/src/xrGame/player_state_remembrance.cpp +++ /dev/null @@ -1,49 +0,0 @@ -#include "StdAfx.h" -#include "player_state_remembrance.h" -#include "kills_store.h" -#include "game_cl_base.h" -#include "Level.h" -#include "game_state_accumulator.h" -#include "Actor.h" - -namespace award_system -{ -u32 player_state_remembrance::get_u32_param() { return m_is_remembrance ? 1 : 0; } -void player_state_remembrance::reset_game() { m_is_remembrance = false; } -void player_state_remembrance::OnPlayerKilled( - u16 killer_id, u16 target_id, u16 weapon_id, std::pair kill_type) -{ - game_PlayerState* tmp_local_player = m_owner->get_local_player(); - if (!tmp_local_player) - return; - - if (killer_id != tmp_local_player->GameID) - return; - - u16 kill_weapon_id = m_owner->get_object_id(weapon_id); - - if (!m_owner->is_item_in_group(kill_weapon_id, ammunition_group::gid_hand_grenades)) - return; - - if (!tmp_local_player->testFlag(GAME_PLAYER_FLAG_VERY_VERY_DEAD)) - return; - - game_PlayerState* victim_player = Game().GetPlayerByGameID(target_id); - if (!victim_player) - return; - - CActor* killer_actor = m_owner->get_players_actor(killer_id); - CActor* victim_actor = m_owner->get_players_actor(target_id); - - if (!killer_actor || !victim_actor) - return; - - float kill_dist = killer_actor->Position().distance_to(victim_actor->Position()); - - if (kill_dist <= max_kill_dist) - { - m_is_remembrance = true; - } -} - -} // namespace award_system diff --git a/src/xrGame/player_state_remembrance.h b/src/xrGame/player_state_remembrance.h deleted file mode 100644 index df0c0b99a1e..00000000000 --- a/src/xrGame/player_state_remembrance.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef PLAYER_STATE_REMEMBRANCE -#define PLAYER_STATE_REMEMBRANCE - -#include "player_state_param.h" -#include "accumulative_states.h" - -namespace award_system -{ -class player_state_remembrance : public player_state_param -{ - typedef player_state_param inherited; - -public: - player_state_remembrance(game_state_accumulator* owner) : inherited(owner) {}; - ~player_state_remembrance(){}; - - virtual void update(){}; - virtual u32 get_u32_param(); - virtual float get_float_param() { return 0.0f; }; - virtual void reset_game(); - - virtual void OnPlayerKilled( - u16 killer_id, u16 target_id, u16 weapon_id, std::pair kill_type); - -protected: - static int const max_kill_dist{ 5 }; - bool m_is_remembrance{}; -}; // class player_state_remembrance - -} // namespace award_system - -#endif //#ifndef PLAYER_STATE_REMEMBRANCE diff --git a/src/xrGame/player_state_skewer.cpp b/src/xrGame/player_state_skewer.cpp deleted file mode 100644 index 9776fd3de53..00000000000 --- a/src/xrGame/player_state_skewer.cpp +++ /dev/null @@ -1,51 +0,0 @@ -#include "StdAfx.h" -#include "player_state_skewer.h" -#include "game_base.h" -#include "game_state_accumulator.h" - -namespace award_system -{ -u32 player_state_skewer::get_u32_param() { return m_kills_count; } -void player_state_skewer::reset_game() -{ - m_shot = 1; - m_kills_count = 0; -} - -void player_state_skewer::OnWeapon_Fire(u16 sender, u16 sender_weapon_id) -{ - game_PlayerState* tmp_local_player = m_owner->get_local_player(); - if (!tmp_local_player) - return; - - if (sender != tmp_local_player->GameID) - return; - - ++m_shot; -} - -void player_state_skewer::OnPlayerKilled( - u16 killer_id, u16 target_id, u16 weapon_id, std::pair kill_type) -{ - game_PlayerState* tmp_local_player = m_owner->get_local_player(); - if (!tmp_local_player) - return; - - if (killer_id != tmp_local_player->GameID) - return; - - if (m_owner->is_item_in_group(m_owner->get_object_id(weapon_id), ammunition_group::gid_gauss_rifle)) - { - if (m_shot) - { - m_kills_count = 1; - m_shot = 0; - } - else - { - ++m_kills_count; - } - } -} - -} // namespace award_system diff --git a/src/xrGame/player_state_skewer.h b/src/xrGame/player_state_skewer.h deleted file mode 100644 index abd1bb4acf1..00000000000 --- a/src/xrGame/player_state_skewer.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef PLAYER_STATE_SKEWER_INCLUDED -#define PLAYER_STATE_SKEWER_INCLUDED - -#include "player_state_param.h" -#include "accumulative_states.h" - -namespace award_system -{ -class player_state_skewer : public player_state_param -{ - typedef player_state_param inherited; - -public: - player_state_skewer(game_state_accumulator* owner) : inherited(owner) {}; - virtual ~player_state_skewer(){}; - - virtual void update(){}; - virtual u32 get_u32_param(); - virtual float get_float_param() { return 0.0f; }; - virtual void reset_game(); - - virtual void OnWeapon_Fire(u16 sender, u16 sender_weapon_id); - virtual void OnPlayerKilled( - u16 killer_id, u16 target_id, u16 weapon_id, std::pair kill_type); - -protected: - u32 m_shot{ 1 }; - u32 m_kills_count{}; -}; // class player_state_skewer - -} // namespace award_system - -#endif //#ifndef PLAYER_STATE_SKEWER_INCLUDED diff --git a/src/xrGame/player_state_toughy.cpp b/src/xrGame/player_state_toughy.cpp deleted file mode 100644 index 2fa484569c0..00000000000 --- a/src/xrGame/player_state_toughy.cpp +++ /dev/null @@ -1,47 +0,0 @@ -#include "StdAfx.h" -#include "player_state_toughy.h" -#include "game_cl_base.h" -#include "game_state_accumulator.h" -#include "Actor.h" -#include "ActorCondition.h" - -namespace award_system -{ -u32 player_state_toughy::get_u32_param() { return m_kills_count; } -void player_state_toughy::reset_game() { m_kills_count = 0; } -void player_state_toughy::OnPlayerKilled( - u16 killer_id, u16 target_id, u16 weapon_id, std::pair kill_type) -{ - game_PlayerState* tmp_local_player = m_owner->get_local_player(); - - if (!tmp_local_player) - return; - - if (killer_id != tmp_local_player->GameID) - return; - - u16 weapon_gid = m_owner->get_object_id(weapon_id); - if (!m_owner->is_item_in_group(weapon_gid, ammunition_group::gid_pistols) && - !m_owner->is_item_in_group(weapon_gid, ammunition_group::gid_assault) && - !m_owner->is_item_in_group(weapon_gid, ammunition_group::gid_shotguns) && - !m_owner->is_item_in_group(weapon_gid, ammunition_group::gid_knife)) - { - return; - } - - CActor* tmp_actor = m_owner->get_players_actor(tmp_local_player->GameID); - if (!tmp_actor) - return; - - if (tmp_actor->conditions().IsLimping()) - { - ++m_kills_count; - } -} - -void player_state_toughy::OnPlayerSpawned(game_PlayerState const* ps) -{ - if (m_owner->get_local_player() == ps) - reset_game(); -} -} diff --git a/src/xrGame/player_state_toughy.h b/src/xrGame/player_state_toughy.h deleted file mode 100644 index 34685dd5961..00000000000 --- a/src/xrGame/player_state_toughy.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef PLAYER_STATE_TOUGHY_INCLUDED -#define PLAYER_STATE_TOUGHY_INCLUDED - -#include "player_state_param.h" -#include "accumulative_states.h" - -namespace award_system -{ -class player_state_toughy : public player_state_param -{ - typedef player_state_param inherited; - -public: - player_state_toughy(game_state_accumulator* owner) : inherited(owner) {}; - virtual ~player_state_toughy(){}; - - virtual void update(){}; - virtual u32 get_u32_param(); - virtual float get_float_param() { return 0.0f; }; - virtual void reset_game(); - - virtual void OnPlayerKilled( - u16 killer_id, u16 target_id, u16 weapon_id, std::pair kill_type); - virtual void OnPlayerSpawned(game_PlayerState const* ps); - -protected: - u32 m_kills_count{}; -}; // class player_state_toughy - -} // namespace award_system - -#endif //#ifndef PLAYER_STATE_TOUGHY_INCLUDED diff --git a/src/xrGame/player_team_win_score.cpp b/src/xrGame/player_team_win_score.cpp deleted file mode 100644 index 4a30fe05703..00000000000 --- a/src/xrGame/player_team_win_score.cpp +++ /dev/null @@ -1,101 +0,0 @@ -#include "StdAfx.h" -#include "player_team_win_score.h" -#include "game_cl_capture_the_artefact.h" -#include "game_cl_artefacthunt.h" -#include "game_state_accumulator.h" - -namespace award_system -{ -void player_team_win_score::reset_game() { m_win_score = 0; } -void player_team_win_score::OnRoundStart() { reset_game(); } -void player_team_win_score::OnRoundEnd() { save_round_scores(); } -void player_team_win_score::save_round_scores() -{ - m_green_team_score = 0; - m_blue_team_score = 0; - m_player_team = etSpectatorsTeam; - - game_PlayerState* tmp_local_player = m_owner->get_local_player(); - if (!tmp_local_player) - return; - - switch (Game().Type()) - { - case eGameIDCaptureTheArtefact: - { - game_cl_CaptureTheArtefact* tmp_game = smart_cast(Level().game); - m_green_team_score = tmp_game->GetGreenTeamScore(); - m_blue_team_score = tmp_game->GetBlueTeamScore(); - m_player_team = tmp_local_player->team; - break; - } - case eGameIDArtefactHunt: - case eGameIDTeamDeathmatch: - { - game_cl_TeamDeathmatch* tmp_game = smart_cast(Level().game); - m_green_team_score = tmp_game->GetGreenTeamScore(); - m_blue_team_score = tmp_game->GetBlueTeamScore(); - if (tmp_local_player->team > 0) - { - m_player_team = static_cast(tmp_game->ModifyTeam(tmp_local_player->team)); - } - break; - } - case eGameIDDeathmatch: - { - game_cl_Deathmatch* tmp_game = smart_cast(Level().game); - if (!xr_strcmp(tmp_local_player->getName(), tmp_game->WinnerName)) - { - m_win_score = tmp_local_player->m_iRivalKills; - return; - } - break; - } - }; // switch (Game().Type()) - if (static_cast(m_player_team) == etGreenTeam) - { - m_win_score = (m_green_team_score > m_blue_team_score) ? m_green_team_score : 0; - } - else if (static_cast(m_player_team) == etBlueTeam) - { - m_win_score = (m_blue_team_score > m_green_team_score) ? m_blue_team_score : 0; - } -} - -void player_enemy_team_score::reset_game() -{ - inherited::reset_game(); - m_enemy_team_score = 0; -} - -void player_enemy_team_score::OnRoundEnd() { save_round_scores(); } -void player_enemy_team_score::save_round_scores() -{ - inherited::save_round_scores(); - if (static_cast(m_player_team) == etGreenTeam) - { - m_enemy_team_score = m_blue_team_score; - } - else if (static_cast(m_player_team) == etBlueTeam) - { - m_enemy_team_score = m_green_team_score; - } -} - -u32 player_runtime_win_score::get_u32_param() -{ - u32 ret_score = 0; - if (static_cast(m_player_team) == etGreenTeam) - { - ret_score = m_green_team_score; - } - else if (static_cast(m_player_team) == etBlueTeam) - { - ret_score = m_blue_team_score; - } - return ret_score; -} - -void player_runtime_win_score::OnPlayerBringArtefact(game_PlayerState const* ps) { save_round_scores(); } -void player_runtime_enemy_team_score::OnPlayerBringArtefact(game_PlayerState const* ps) { save_round_scores(); } -} // namespace award_system diff --git a/src/xrGame/player_team_win_score.h b/src/xrGame/player_team_win_score.h deleted file mode 100644 index 14eb1edfda0..00000000000 --- a/src/xrGame/player_team_win_score.h +++ /dev/null @@ -1,79 +0,0 @@ -#ifndef PLAYER_TEAM_WIN_SCORE_INCLUDED -#define PLAYER_TEAM_WIN_SCORE_INCLUDED - -#include "player_state_param.h" -#include "accumulative_states.h" - -namespace award_system -{ -class player_team_win_score : public player_state_param -{ - typedef player_state_param inherited; - -public: - player_team_win_score(game_state_accumulator* owner) : inherited(owner) {}; - virtual ~player_team_win_score(){}; - - virtual void update(){}; - virtual u32 get_u32_param() { return m_win_score; }; - virtual float get_float_param() { return 0.0f; }; - virtual void reset_game(); - - virtual void OnRoundEnd(); - virtual void OnRoundStart(); - -protected: - void save_round_scores(); - u32 m_win_score{}; - - s32 m_green_team_score{}; - s32 m_blue_team_score{}; - u8 m_player_team{}; -}; // class player_team_win_score - -class player_enemy_team_score : public player_team_win_score -{ - typedef player_team_win_score inherited; - -public: - player_enemy_team_score(game_state_accumulator* owner) : inherited(owner) {}; - virtual ~player_enemy_team_score(){}; - - virtual u32 get_u32_param() { return m_enemy_team_score; }; - virtual float get_float_param() { return 0.0f; }; - virtual void reset_game(); - - virtual void OnRoundEnd(); - -protected: - void save_round_scores(); - u32 m_enemy_team_score{}; - -}; // class player_enemy_team_score - -class player_runtime_win_score : public player_team_win_score -{ - typedef player_team_win_score inherited; - -public: - player_runtime_win_score(game_state_accumulator* owner) : inherited(owner) {}; - virtual ~player_runtime_win_score(){}; - virtual u32 get_u32_param(); - - virtual void OnPlayerBringArtefact(game_PlayerState const* ps); -}; // class player_runtime_win_score - -class player_runtime_enemy_team_score : public player_enemy_team_score -{ - typedef player_enemy_team_score inherited; - -public: - player_runtime_enemy_team_score(game_state_accumulator* owner) : inherited(owner) {}; - virtual ~player_runtime_enemy_team_score(){}; - - virtual void OnPlayerBringArtefact(game_PlayerState const* ps); -}; // class player_runtime_enemy_team_score - -} // namespace award_system - -#endif //#ifndef PLAYER_TEAM_WIN_SCORE_INCLUDED diff --git a/src/xrGame/profile_data_types.cpp b/src/xrGame/profile_data_types.cpp deleted file mode 100644 index 0c6264112b6..00000000000 --- a/src/xrGame/profile_data_types.cpp +++ /dev/null @@ -1,172 +0,0 @@ -#include "StdAfx.h" -#include "profile_data_types.h" - -namespace gamespy_profile -{ -static constexpr pcstr awards_names[at_awards_count] = { - "mp_award_massacre", "mp_award_paranoia", "mp_award_overwhelming_superiority", "mp_award_blitzkrieg", - "mp_award_dry_victory", "mp_award_multichampion", "mp_award_mad", "mp_award_achilles_heel", - "mp_award_fater_than_bullets", "mp_award_harvest_time", "mp_award_skewer", "mp_award_double_shot_double_kill", - "mp_award_climber", "mp_award_opener", "mp_award_toughy", "mp_award_invincible_fury", "mp_award_oculist", - "mp_award_lightning_reflexes", "mp_award_sprinter_stopper", "mp_award_marksman", "mp_award_peace_ambassador", - "mp_award_deadly_accuracy", "mp_award_remembrance", "mp_award_avenger", "mp_award_cherub", "mp_award_dignity", - "mp_award_stalker_flair", "mp_award_lucky", "mp_award_black_list", "mp_award_silent_death", -}; - -static constexpr u16 award_atlas_keys_map[at_awards_count][ap_award_params_count] = { - {KEY_AwardMasscare, KEY_AwardMasscareLastRewardDate}, // mp_award_massacre - {KEY_AwardParanoia, KEY_AwardParanoiaLastRewardDate}, // mp_award_paranoia - {KEY_AwardOverwhelmingSuperiority, - KEY_AwardOverwhelmingSuperiorityLastRewardDate}, // mp_award_overwhelming_superiority - {KEY_AwardBlitzkrieg, KEY_AwardBlitzkriegLastRewardDate}, // mp_award_blitzkrieg - {KEY_AwardDryVictory, KEY_AwardDryVictoryLastRewardDate}, // mp_award_dry_victory - {KEY_AwardMultichampion, KEY_AwardMultichampionLastRewardDate}, // mp_award_multichampion - {KEY_AwardMad, KEY_AwardMadLastRewardDate}, // mp_award_mad - {KEY_AwardAchillesHeel, KEY_AwardAchillesHeelLastRewardDate}, // mp_award_achilles_heel - {KEY_AwardFasterThanBullets, KEY_AwardFasterThanBulletsLastRewardDate}, // mp_award_fater_than_bullets - {KEY_AwardHarvestTime, KEY_AwardHarvestTimeLastRewardDate}, // mp_award_harvest_time - {KEY_AwardSkewer, KEY_AwardSkewerLastRewardDate}, // mp_award_skewer - {KEY_AwardDoubleShotDoubleKill, KEY_AwardDoubleShotDoubleKillLastRewardDate}, // mp_award_double_shot_double_kill - {KEY_AwardClimber, KEY_AwardClimberLastRewardDate}, // mp_award_climber - {KEY_AwardOpener, KEY_AwardOpenerLastRewardDate}, // mp_award_opener - {KEY_AwardToughy, KEY_AwardToughyLastRewardDate}, // mp_award_toughy - {KEY_AwardInvincibleFury, KEY_AwardInvincibleFuryLastRewardDate}, // mp_award_invincible_fury - {KEY_AwardOculist, KEY_AwardOculistLastRewardDate}, // mp_award_oculist - {KEY_AwardLightingReflexes, KEY_AwardLightingReflexesLastRewardDate}, // mp_award_lightning_reflexes - {KEY_AwardSprinterStopper, KEY_AwardSprinterStopperLastRewardDate}, // mp_award_sprinter_stopper - {KEY_AwardMarksMan, KEY_AwardMarksManLastRewardDate}, // mp_award_marksman - {KEY_AwardPeaceAmbassador, KEY_AwardPeaceAmbassadorLastRewardDate}, // mp_award_peace_ambassador - {KEY_AwardDeadlyAccuracy, KEY_AwardDeadlyAccuracyLastRewardDate}, // mp_award_deadly_accuracy - {KEY_AwardRemembrance, KEY_AwardRemembranceLastRewardDate}, // mp_award_remembrance - {KEY_AwardAvenger, KEY_AwardAvengerLastRewardDate}, // mp_award_avenger - {KEY_AwardCherub, KEY_AwardCherubLastRewardDate}, // mp_award_cherub - {KEY_AwardDignity, KEY_AwardDignityLastRewardDate}, // mp_award_dignity - {KEY_AwardStalkerFlair, KEY_AwardStalkerFlairLastRewardDate}, // mp_award_stalker_flair - {KEY_AwardLucky, KEY_AwardLuckyLastRewardDate}, // mp_award_lucky - {KEY_AwardBlackList, KEY_AwardBlackListLastRewardDate}, // mp_award_black_list - {KEY_AwardSilentDeath, KEY_AwardSilentDeathLastRewardDate}, // mp_award_silent_death -}; - -static constexpr u16 award_atlas_stats_map[at_awards_count][ap_award_params_count] = { - {STAT_AwardMasscare, STAT_AwardMasscareLastRewardDate}, // mp_award_massacre - {STAT_AwardParanoia, STAT_AwardParanoiaLastRewardDate}, // mp_award_paranoia - {STAT_AwardOwerwhelmingSuperiority, - STAT_AwardOwerwhelmingSuperiorityLastRewardDate}, // mp_award_overwhelming_superiority - {STAT_AwardBlitzkrieg, STAT_AwardBlitzkriegLastRewardDate}, // mp_award_blitzkrieg - {STAT_AwardDryVictory, STAT_AwardDryVictoryLastRewardDate}, // mp_award_dry_victory - {STAT_AwardMultichampion, STAT_AwardMultichampionLastRewardDate}, // mp_award_multichampion - {STAT_AwardMad, STAT_AwardMadLastRewardDate}, // mp_award_mad - {STAT_AwardAchillesHeel, STAT_AwardAchillesHeelLastRewardDate}, // mp_award_achilles_heel - {STAT_AwardFasterThanBullets, STAT_AwardFasterThanBulletsLastRewardDate}, // mp_award_fater_than_bullets - {STAT_AwardHarvestTime, STAT_AwardHarvestTimeLastRewardDate}, // mp_award_harvest_time - {STAT_AwardSkewer, STAT_AwardSkewerLastRewardDate}, // mp_award_skewer - {STAT_AwardDoubleShotDoubleKill, STAT_AwardDoubleShotDoubleKillLastRewardDate}, // mp_award_double_shot_double_kill - {STAT_AwardClimber, STAT_AwardClimberLastRewardDate}, // mp_award_climber - {STAT_AwardOpener, STAT_AwardOpenerLastRewardDate}, // mp_award_opener - {STAT_AwardToughy, STAT_AwardToughyLastRewardDate}, // mp_award_toughy - {STAT_AwardInvincibleFury, STAT_AwardInvincibleFuryLastRewardDate}, // mp_award_invincible_fury - {STAT_AwardOculist, STAT_AwardOculistLastRewardDate}, // mp_award_oculist - {STAT_AwardLightingReflexes, STAT_AwardLightingReflexesLastRewardDate}, // mp_award_lightning_reflexes - {STAT_AwardSprinterStopper, STAT_AwardSprinterStopperLastRewardDate}, // mp_award_sprinter_stopper - {STAT_AwardMarksman, STAT_AwardMarksmanLastRewardDate}, // mp_award_marksman - {STAT_AwardPeaceAmbassador, STAT_AwardPeaceAmbassadorLastRewardDate}, // mp_award_peace_ambassador - {STAT_AwardDeadlyAccuracy, STAT_AwardDeadlyAccuracyLastRewardDate}, // mp_award_deadly_accuracy - {STAT_AwardRemembrance, STAT_AwardRemembranceLastRewardDate}, // mp_award_remembrance - {STAT_AwardAvenger, STAT_AwardAvengerLastRewardDate}, // mp_award_avenger - {STAT_AwardCherub, STAT_AwardCherubLastRewardDate}, // mp_award_cherub - {STAT_AwardDignity, STAT_AwardDignityLastRewardDate}, // mp_award_dignity - {STAT_AwardStalkerFlair, STAT_AwardStalkerFlairLastRewardDate}, // mp_award_stalker_flair - {STAT_AwardLucky, STAT_AwardLuckyLastRewardDate}, // mp_award_lucky - {STAT_AwardBlackList, STAT_AwardBlackListLastRewardDate}, // mp_award_black_list - {STAT_AwardSilentDeath, STAT_AwardSilentDeathLastRewardDate}, // mp_award_silent_death -}; - -char const* get_award_name(enum_awards_t award) -{ - VERIFY(award < at_awards_count); - return awards_names[award]; -} - -u16 get_award_id_key(enum_awards_t award) -{ - VERIFY(award < at_awards_count); - return award_atlas_keys_map[award][ap_award_id]; -} - -u16 get_award_reward_date_key(enum_awards_t award) -{ - VERIFY(award < at_awards_count); - return award_atlas_keys_map[award][ap_award_rdate]; -} - -u16 get_award_id_stat(enum_awards_t award) -{ - VERIFY(award < at_awards_count); - return award_atlas_stats_map[award][ap_award_id]; -} - -enum_awards_t get_award_by_stat_name(char const* stat_name) -{ - for (int i = 0; i < at_awards_count; ++i) - { - if (!xr_strcmp(stat_name, ATLAS_GET_STAT_NAME(award_atlas_stats_map[i][ap_award_id]))) - { - return static_cast(i); - } - } - return static_cast(at_awards_count); -} - -u16 get_award_reward_date_stat(enum_awards_t award) -{ - VERIFY(award < at_awards_count); - return award_atlas_stats_map[award][ap_award_rdate]; -} - -// best scores ----- - -static char const* best_score_names[bst_score_types_count] = {"mp_bst_kills_in_row", "mp_bst_kinife_kills_in_row", - "mp_bst_backstabs_in_row", "mp_bst_head_shots_in_row", "mp_bst_eye_kills_in_row", "mp_bst_bleed_kills_in_row", - "mp_bst_explosive_kills_in_row"}; // static char const * best_score_names[bst_score_types_count] - -static u16 best_scores_atlas_keys_map[bst_score_types_count] = {KEY_BestScore_KillsInRow, KEY_BestScore_KnifeKillsInRow, - KEY_BestScore_BackstabsKillsInRow, KEY_BestScore_HeadshotsKillsInRow, KEY_BestScore_EyeKillsInRow, - KEY_BestScore_BleedKillsInRow, - KEY_BestScore_ExplosiveKillsInRow}; // static u16 best_scores_atlas_keys_map[bst_score_types_count] - -static u16 best_scores_atlas_stats_map[bst_score_types_count] = {STAT_BestScore_KillsInRow, - STAT_BestScore_KnifeKillsInRow, STAT_BestScore_BackstabsKillsInRow, STAT_BestScore_HeadshotsKillsInRow, - STAT_BestScore_EyeKillsInRow, STAT_BestScore_BleedKillsInRow, - STAT_BestScore_ExplosiveKillsInRow}; // static u16 best_scores_atlas_stats_map[bst_score_types_count] - -char const* get_best_score_name(enum_best_score_type bst) -{ - VERIFY(bst < bst_score_types_count); - return best_score_names[bst]; -} - -u16 get_best_score_id_key(enum_best_score_type bst) -{ - VERIFY(bst < bst_score_types_count); - return best_scores_atlas_keys_map[bst]; -} - -u16 get_best_score_id_stat(enum_best_score_type bst) -{ - VERIFY(bst < bst_score_types_count); - return best_scores_atlas_stats_map[bst]; -} - -enum_best_score_type get_best_score_type_by_sname(char const* stat_name) -{ - for (int i = 0; i < bst_score_types_count; ++i) - { - if (!xr_strcmp(stat_name, ATLAS_GET_STAT_NAME(best_scores_atlas_stats_map[i]))) - { - return static_cast(i); - } - } - return static_cast(bst_score_types_count); -} - -} // namespace gamespy_profile diff --git a/src/xrGame/profile_data_types.h b/src/xrGame/profile_data_types.h index 862638035ae..76bcfeb5422 100644 --- a/src/xrGame/profile_data_types.h +++ b/src/xrGame/profile_data_types.h @@ -1,9 +1,6 @@ #pragma once -#ifndef PLAYER_AWARDS -#define PLAYER_AWARDS #include "xrCore/Containers/AssociativeVector.hpp" -#include "atlas_stalkercoppc_v1.h" namespace gamespy_profile { @@ -57,16 +54,7 @@ struct award_data u32 m_last_reward_date; }; -typedef AssociativeVector all_awards_t; - -char const* get_award_name(enum_awards_t award); -extern u16 get_award_id_key(enum_awards_t award); -extern u16 get_award_reward_date_key(enum_awards_t award); - -extern u16 get_award_id_stat(enum_awards_t award); -extern u16 get_award_reward_date_stat(enum_awards_t award); - -extern enum_awards_t get_award_by_stat_name(char const* stat_name); +using all_awards_t = AssociativeVector; enum enum_best_score_type { @@ -80,23 +68,5 @@ enum enum_best_score_type bst_score_types_count }; // enum enum_best_score_type -char const* get_best_score_name(enum_best_score_type bst); -u16 get_best_score_id_key(enum_best_score_type bst); -u16 get_best_score_id_stat(enum_best_score_type bst); -enum_best_score_type get_best_score_type_by_sname(char const* stat_name); - -typedef AssociativeVector all_best_scores_t; - -constexpr pcstr profile_table_name = "PlayerStats_v1"; - -constexpr pcstr profile_store_file_name = "mp_profile.ltx"; -constexpr pcstr award_count_line = "count"; -constexpr pcstr award_rdate_line = "rdate"; -constexpr pcstr best_score_value_line = "value"; -constexpr pcstr profile_data_section = "profile_data"; -constexpr pcstr profile_id_line = "id"; -constexpr pcstr profile_last_submit_time = "last_submit"; - +using all_best_scores_t = AssociativeVector; } // namespace gamespy_profile - -#endif //#ifndef PLAYER_AWARDS diff --git a/src/xrGame/profile_data_types_script.h b/src/xrGame/profile_data_types_script.h index ddec83f7f48..4f193b7cab3 100644 --- a/src/xrGame/profile_data_types_script.h +++ b/src/xrGame/profile_data_types_script.h @@ -10,5 +10,5 @@ namespace gamespy_profile { -typedef mixed_delegate store_operation_cb; +using store_operation_cb = mixed_delegate; } diff --git a/src/xrGame/profile_store.cpp b/src/xrGame/profile_store.cpp index 9553f507087..16531669589 100644 --- a/src/xrGame/profile_store.cpp +++ b/src/xrGame/profile_store.cpp @@ -1,287 +1,19 @@ #include "StdAfx.h" #include "profile_store.h" -#include "xrGameSpy/GameSpy_Full.h" -#include "xrGameSpy/GameSpy_SAKE.h" #include "MainMenu.h" #include "login_manager.h" -#include "awards_store.h" -#include "best_scores_store.h" -#include "stats_submitter.h" -#include "atlas_submit_queue.h" namespace gamespy_profile { -profile_store::profile_store(CGameSpy_Full* fullgs_obj) - : m_dsigned_reader( - stats_submitter::p_number, stats_submitter::q_number, stats_submitter::g_number, stats_submitter::public_key) +void profile_store::load_current_profile(store_operation_cb /*progress_indicator_cb*/, store_operation_cb complete_cb) { - VERIFY(fullgs_obj && fullgs_obj->GetGameSpySAKE()); - m_fullgs_obj = fullgs_obj; - m_sake_obj = fullgs_obj->GetGameSpySAKE(); - - m_awards_store = xr_new(fullgs_obj); - m_best_scores_store = xr_new(fullgs_obj); -} - -profile_store::~profile_store() -{ - if (m_progress_indicator) - Engine.Sheduler.Unregister(this); - - xr_delete(m_awards_store); - xr_delete(m_best_scores_store); -} - -all_awards_t const& profile_store::get_awards() -{ - VERIFY(m_awards_store); - return m_awards_store->get_player_awards(); -} - -all_best_scores_t const& profile_store::get_best_scores() -{ - VERIFY(m_best_scores_store); - return m_best_scores_store->get_player_best_scores(); -} - -void profile_store::shedule_Update(u32 dt) -{ - VERIFY(m_fullgs_obj); -#ifdef DEBUG - Msg("--- GameSpy core (SAKE) thinking ..."); -#endif - m_fullgs_obj->CoreThink(10); // 10 milliseconds on update -} - -void profile_store::set_current_profile(int profileId, char const* loginTicket) -{ - VERIFY(m_sake_obj); - m_sake_obj->SetProfile(profileId, loginTicket); -} - -void profile_store::load_current_profile(store_operation_cb progress_indicator_cb, store_operation_cb complete_cb) -{ -#ifdef XR_PLATFORM_WINDOWS - if (!complete_cb) - { - complete_cb.bind(this, &profile_store::onlylog_completion); - } gamespy_gp::login_manager* tmp_lmngr = MainMenu()->GetLoginMngr(); - R_ASSERT(tmp_lmngr); - gamespy_gp::profile const* tmp_curr_prof = tmp_lmngr->get_current_profile(); - if (!tmp_curr_prof) - { - complete_cb(false, "mp_first_need_to_login"); - return; - } - set_current_profile(tmp_curr_prof->m_profile_id, tmp_curr_prof->m_login_ticket.c_str()); - - load_prof_params_t tmp_args(progress_indicator_cb); - m_load_current_profile_qam.execute(this, tmp_args, complete_cb); -#endif -} - -void profile_store::load_current_profile_raw(load_prof_params_t const& args, store_operation_cb complete_cb) -{ - if (m_complete_cb) + if (tmp_lmngr && tmp_lmngr->get_current_profile()) { - Msg("! ERROR: loading already in progress."); if (complete_cb) - { - complete_cb(false, "mp_loading_already_in_progress"); - } + complete_cb(true, ""); return; } - m_complete_cb = complete_cb; - load_profile(args.m_t1); -} - -void profile_store::stop_loading() -{ - m_load_current_profile_qam.stop(); - m_progress_indicator.clear(); - m_progress_indicator.bind(this, &profile_store::onlylog_operation); -} - -void profile_store::release_current_profile(bool, char const*) {} -void profile_store::load_profile(store_operation_cb progress_indicator_cb) -{ - VERIFY(!m_progress_indicator); - if (!progress_indicator_cb) - { - m_progress_indicator.bind(this, &profile_store::onlylog_operation); - } - else - { - m_progress_indicator = progress_indicator_cb; - } - - string_path tmp_path; - FS.update_path(tmp_path, "$app_data_root$", profile_store_file_name); - IReader* tmp_reader = NULL; - m_valid_ltx = false; - - if (FS.exist(tmp_path)) - { - tmp_reader = FS.r_open("$app_data_root$", profile_store_file_name); - } - - if (tmp_reader) - { - u32 const tmp_length = tmp_reader->length(); - if (tmp_length) - { - m_valid_ltx = m_dsigned_reader.load_and_verify(static_cast(tmp_reader->pointer()), tmp_length); - FS.r_close(tmp_reader); - } - } -#ifdef XR_PLATFORM_WINDOWS - if (m_valid_ltx) - { - s32 tmp_profile_id = m_dsigned_reader.get_ltx().r_s32(profile_data_section, profile_id_line); - gamespy_gp::login_manager* tmp_lmngr = MainMenu()->GetLoginMngr(); - R_ASSERT(tmp_lmngr); - gamespy_gp::profile const* tmp_curr_prof = tmp_lmngr->get_current_profile(); - R_ASSERT(tmp_curr_prof); - m_valid_ltx = (tmp_profile_id == tmp_curr_prof->m_profile_id); - } -#endif - m_awards_store->reset_awards(); - m_best_scores_store->reset_scores(); - - merge_fields(m_best_scores_store->get_field_names(), m_awards_store->get_field_names()); - - m_progress_indicator(true, "mp_loading_awards"); - // m_progress_indicator (true, "mp_loading_best_scores"); - merged - Engine.Sheduler.Register(this, FALSE); - load_profile_fields(); + complete_cb(false, "mp_first_need_to_login"); } - -void profile_store::merge_fields( - best_scores_store::best_fields_names_t const& best_results, awards_store::award_fields_names_t const& awards_fields) -{ - unsigned int i = 0; - for (unsigned int bf = 0; bf < best_scores_store::fields_count; ++bf) - { - m_field_names_store[i] = best_results[bf]; - ++i; - } - for (unsigned int af = 0; af < awards_store::fields_count; ++af) - { - m_field_names_store[i] = awards_fields[af]; - ++i; - } - VERIFY(i == merged_fields_count); - m_get_records_input.mNumFields = i; - m_get_records_input.mFieldNames = m_field_names_store; - m_get_records_input.mTableId = (char*)profile_table_name; -} - -void profile_store::load_profile_fields() -{ - SAKERequest reqres = m_sake_obj->GetMyRecords(&m_get_records_input, &profile_store::get_my_fields_cb, this); - - if (!reqres) - { - SAKEStartRequestResult tmp_result = m_sake_obj->GetRequestResult(); - loaded_fields(false, CGameSpy_SAKE::TryToTranslate(tmp_result).c_str()); - } -} - -void __cdecl profile_store::get_my_fields_cb( - SAKE sake, SAKERequest request, SAKERequestResult result, void* inputData, void* outputData, void* userData) -{ - profile_store* my_inst = static_cast(userData); - if (result != SAKERequestResult_SUCCESS) - { - my_inst->loaded_fields(false, CGameSpy_SAKE::TryToTranslate(result).c_str()); - return; - } - SAKEGetMyRecordsOutput* tmp_out = static_cast(outputData); - VERIFY(tmp_out); - my_inst->m_awards_store->process_aw_out_response(tmp_out, merged_fields_count); - my_inst->m_best_scores_store->process_scores_out_response(tmp_out, merged_fields_count); - my_inst->loaded_fields(true, ""); -} - -void profile_store::loaded_fields(bool const result, char const* err_descr) -{ - if (!m_complete_cb) - { - Msg("WARNING: loading awards terminated by user"); - VERIFY(!m_progress_indicator); - Engine.Sheduler.Unregister(this); - return; - } - - store_operation_cb tmp_cb = m_complete_cb; - m_complete_cb.clear(); - m_progress_indicator.clear(); - Engine.Sheduler.Unregister(this); - - if (!result) - { - tmp_cb(false, err_descr); - return; - } - - if (m_valid_ltx) - { - m_awards_store->load_awards_from_ltx(m_dsigned_reader.get_ltx()); - m_best_scores_store->load_best_scores_from_ltx(m_dsigned_reader.get_ltx()); - m_awards_store->merge_sake_to_ltx_awards(); - m_best_scores_store->merge_sake_to_ltx_best_scores(); - check_sake_actuality(); - } - tmp_cb(true, ""); -} - -void profile_store::onlylog_operation(bool const result, char const* descr) -{ - if (!result) - { - Msg("! Profile store ERROR: %s", descr ? descr : "unknown"); - return; - } - Msg("* Profile store: %s", descr ? descr : ""); -} - -void profile_store::onlylog_completion(bool const result, char const* err_descr) -{ - if (!result) - { - Msg("! Profile loading ERROR: %s", err_descr ? err_descr : "unknown"); - return; - } - Msg("* Profile loading successfully complete"); -} - -#ifdef XR_PLATFORM_WINDOWS -#ifdef DEBUG -static u32 const actuality_update_time = 120; -#else -static u32 const actuality_update_time = 3600; -#endif //#ifdef DEBUG -#endif //#ifdef XR_PLATFORM_WINDOWS - -void profile_store::check_sake_actuality() -{ - if (!m_awards_store->is_sake_equal_to_file() || !m_best_scores_store->is_sake_equal_to_file()) - { -#ifdef XR_PLATFORM_WINDOWS // XXX: Port to Linux - __time32_t current_time; - _time32(¤t_time); - - __time32_t last_submit_time = - static_cast<__time32_t>(m_dsigned_reader.get_ltx().r_u32(profile_data_section, profile_last_submit_time)); - if ((current_time - last_submit_time) >= actuality_update_time) - { - atlas_submit_queue* tmp_submit_queue = MainMenu()->GetSubmitQueue(); - VERIFY(tmp_submit_queue); - tmp_submit_queue->submit_all(); - } -#endif - } -} - } // namespace gamespy_profile diff --git a/src/xrGame/profile_store.h b/src/xrGame/profile_store.h index e4611967a08..ac59ee12948 100644 --- a/src/xrGame/profile_store.h +++ b/src/xrGame/profile_store.h @@ -1,87 +1,26 @@ -#ifndef GAMESPY_PROFILE_STORE -#define GAMESPY_PROFILE_STORE +#pragma once -#include "Common/Noncopyable.hpp" -#include "xrEngine/ISheduled.h" #include "profile_data_types.h" -#include "queued_async_method.h" -#include "gsc_dsigned_ltx.h" -#include "best_scores_store.h" -#include "awards_store.h" #include "profile_data_types_script.h" -class CGameSpy_Full; -class CGameSpy_SAKE; -// class CGameSpy_ATLAS; - namespace gamespy_profile { -class awards_store; -class best_scores_store; - -class profile_store : public ScheduledBase +class profile_store { public: - explicit profile_store(CGameSpy_Full* fullgs_obj); - ~profile_store(); - - void set_current_profile(int profileId, char const* loginTicket); void load_current_profile(store_operation_cb progress_indicator_cb, store_operation_cb complete_cb); - void stop_loading(); - - virtual void shedule_Update(u32 dt); - virtual shared_str shedule_Name() const { return shared_str("gamespy_sake_updator"); }; - virtual bool shedule_Needed() { return true; }; - virtual float shedule_Scale() const { return 1.0f; }; - all_awards_t const& get_awards(); - all_best_scores_t const& get_best_scores(); - - awards_store* get_awards_store() { return m_awards_store; }; - best_scores_store* get_best_scores_store() { return m_best_scores_store; }; -private: - typedef parameters_tuple1 load_prof_params_t; - void load_current_profile_raw(load_prof_params_t const& args, store_operation_cb complete_cb); - void release_current_profile(bool, char const*); - void check_sake_actuality(); - queued_async_method - m_load_current_profile_qam; - - CGameSpy_SAKE* m_sake_obj; - // CGameSpy_ATLAS* m_atlas_obj; - CGameSpy_Full* m_fullgs_obj; - - store_operation_cb m_progress_indicator; - store_operation_cb m_complete_cb; + void stop_loading() {} - gsc_dsigned_ltx_reader m_dsigned_reader; - bool m_valid_ltx; - awards_store* m_awards_store; - best_scores_store* m_best_scores_store; + [[nodiscard]] + const auto& get_awards() const { return m_awards; } - static unsigned int const merged_fields_count = best_scores_store::fields_count + awards_store::fields_count; - typedef char* merged_fields_names_t[merged_fields_count]; + [[nodiscard]] + const auto& get_best_scores() const { return m_best_scores; } - void load_profile(store_operation_cb progress_indicator_cb); - void merge_fields(best_scores_store::best_fields_names_t const& best_results, - awards_store::award_fields_names_t const& awards_fields); - merged_fields_names_t m_field_names_store; - SAKEGetMyRecordsInput m_get_records_input; - - void load_profile_fields(); - - void loaded_fields(bool const result, char const* err_descr); - void loaded_best_scores(bool const result, char const* err_descr); - - void onlylog_operation(bool const result, char const* err_descr); - void onlylog_completion(bool const result, char const* err_descr); - - static void __cdecl get_my_fields_cb( - SAKE sake, SAKERequest request, SAKERequestResult result, void* inputData, void* outputData, void* userData); +private: + // These are dummies + all_awards_t m_awards; + all_best_scores_t m_best_scores; }; // class profile_store } // namespace gamespy_profile - -typedef gamespy_profile::profile_store gamespy_profile_profile_store; - -#endif //#ifndef GAMESPY_PROFILE_STORE diff --git a/src/xrGame/reward_event_generator.cpp b/src/xrGame/reward_event_generator.cpp deleted file mode 100644 index 2c048600a53..00000000000 --- a/src/xrGame/reward_event_generator.cpp +++ /dev/null @@ -1,224 +0,0 @@ -#include "StdAfx.h" -#include "reward_event_generator.h" -#include "game_state_accumulator.h" -#include "game_base.h" -#include "game_cl_mp.h" - -#include "rewarding_state_events.h" -#include "rewarding_events_handlers.h" -#include "best_scores_helper.h" - -#include "MainMenu.h" -#include "login_manager.h" -#include "stats_submitter.h" -#include "atlas_submit_queue.h" - -namespace award_system -{ -reward_event_generator::reward_event_generator(u32 const max_rewards_per_game) : m_max_rewards(max_rewards_per_game) -{ - m_local_player = NULL; - m_rewarded = 0; - m_state_accum = xr_new(); - event_action_delegate_t tmp_delegate(this, &reward_event_generator::AddRewardTask); - m_state_event_checker = xr_new(m_state_accum, tmp_delegate); - - m_event_handlers = xr_new(m_state_accum, tmp_delegate); - m_best_scores_helper = xr_new(m_state_accum); - m_event_handlers->set_null_handler(m_best_scores_helper); - - m_state_event_checker->init(); - m_state_accum->init(); - m_event_handlers->init(); -#ifdef XR_PLATFORM_WINDOWS - m_submit_queue = MainMenu()->GetSubmitQueue(); - VERIFY(m_submit_queue); -#endif -} - -reward_event_generator::~reward_event_generator() -{ - xr_delete(m_state_accum); - xr_delete(m_state_event_checker); - xr_delete(m_event_handlers); - xr_delete(m_best_scores_helper); -} - -void reward_event_generator::init_player(game_PlayerState* local_player) -{ - m_local_player = local_player; - m_state_accum->init_player(local_player); -} - -void reward_event_generator::init_bone_groups(CActor* first_spawned_actor) -{ - m_state_accum->init_bone_groups(first_spawned_actor); -} - -void reward_event_generator::update() -{ - m_state_accum->update(); - m_submit_queue->update(); -} - -void reward_event_generator::OnWeapon_Fire(u16 sender, u16 sender_weapon_id) -{ - m_state_accum->OnWeapon_Fire(sender, sender_weapon_id); - m_event_handlers->OnWeapon_Fire(sender, sender_weapon_id); -} - -void reward_event_generator::OnBullet_Fire( - u16 sender, u16 sender_weapon_id, const Fvector& position, const Fvector& direction) -{ - m_state_accum->OnBullet_Fire(sender, sender_weapon_id, position, direction); - m_event_handlers->OnBullet_Fire(sender, sender_weapon_id, position, direction); -} - -void reward_event_generator::OnBullet_Hit( - IGameObject const* hitter, IGameObject const* victim, IGameObject* weapon, u16 const bone) -{ - m_state_accum->OnBullet_Hit(hitter, victim, weapon, bone); - m_event_handlers->OnBullet_Hit(hitter, victim, weapon, bone); - m_state_event_checker->check_for_events(); -} - -void reward_event_generator::OnArtefactSpawned() -{ - m_state_accum->OnArtefactSpawned(); - m_event_handlers->OnArtefactSpawned(); - m_state_event_checker->check_for_events(); -} - -void reward_event_generator::OnPlayerTakeArtefact(game_PlayerState const* ps) -{ - m_state_accum->OnPlayerTakeArtefact(ps); - m_event_handlers->OnPlayerTakeArtefact(ps); - m_state_event_checker->check_for_events(); -} - -void reward_event_generator::OnPlayerDropArtefact(game_PlayerState const* ps) -{ - m_state_accum->OnPlayerDropArtefact(ps); - m_event_handlers->OnPlayerDropArtefact(ps); - m_state_event_checker->check_for_events(); -} - -void reward_event_generator::OnPlayerBringArtefact(game_PlayerState const* ps) -{ - m_state_accum->OnPlayerBringArtefact(ps); - m_event_handlers->OnPlayerBringArtefact(ps); - m_state_event_checker->check_for_events(); -} - -void reward_event_generator::OnPlayerSpawned(game_PlayerState const* ps) -{ - m_event_handlers->OnPlayerSpawned(ps); - m_state_accum->OnPlayerSpawned(ps); - m_state_event_checker->check_for_events(); -} - -void reward_event_generator::OnPlayerKilled( - u16 killer_id, u16 target_id, u16 weapon_id, std::pair kill_type) -{ - m_event_handlers->OnPlayerKilled(killer_id, target_id, weapon_id, kill_type); - m_state_accum->OnPlayerKilled(killer_id, target_id, weapon_id, kill_type); - m_state_event_checker->check_for_events(); -} - -void reward_event_generator::OnPlayerChangeTeam(s8 team) -{ - m_event_handlers->OnPlayerChangeTeam(team); - m_state_accum->OnPlayerChangeTeam(team); - m_state_event_checker->check_for_events(); -} -void reward_event_generator::OnPlayerRankdChanged() -{ - m_event_handlers->OnPlayerRankChanged(); - m_state_accum->OnPlayerRankChanged(); - m_state_event_checker->check_for_events(); -} - -void reward_event_generator::OnRoundEnd() -{ - m_event_handlers->OnRoundEnd(); - m_state_accum->OnRoundEnd(); - m_state_event_checker->check_for_events(); -} - -void reward_event_generator::OnRoundStart() -{ - m_rewarded = 0; - m_state_event_checker->clear_events(); - m_state_event_checker->init(); - m_state_accum->reset_player_game(); - m_event_handlers->OnRoundStart(); - m_state_accum->OnRoundStart(); -} - -void reward_event_generator::AddRewardTask(u32 award_id) -{ - game_cl_mp* tmp_cl_game = smart_cast(&Game()); - VERIFY(tmp_cl_game); - if (!tmp_cl_game->Is_Rewarding_Allowed()) - return; - - if (Level().IsDemoPlayStarted()) - return; -#ifdef XR_PLATFORM_WINDOWS - gamespy_profile::enum_awards_t tmp_award_type = static_cast(award_id); - VERIFY(award_id < gamespy_profile::at_awards_count); - - gamespy_gp::login_manager* tmp_lmngr = MainMenu()->GetLoginMngr(); - VERIFY(tmp_lmngr); - gamespy_gp::profile const* tmp_curr_prof = tmp_lmngr->get_current_profile(); - if (!tmp_curr_prof) - { - Msg("! ERROR: can't reward player - not logged in"); - return; - } - if ((m_rewarded >= m_max_rewards) && (m_max_rewards != u32(-1))) - { - Msg("! You have been rewarded by award [%s], but maximum rewards per game reached... sorry :(", - gamespy_profile::get_award_name(tmp_award_type)); - return; - } - - game_cl_mp* tmp_mp_game = smart_cast(&Game()); - VERIFY(tmp_mp_game); - tmp_mp_game->AddRewardTask(award_id); - ++m_rewarded; - - if (!tmp_curr_prof->online()) - { - Msg("* An offline player has been rewarded by [%s] award", get_award_name(tmp_award_type)); - return; - } - m_submit_queue->submit_reward(tmp_award_type); -#endif -} - -void reward_event_generator::CommitBestResults() -{ - if (Level().IsDemoPlayStarted()) - return; -#ifdef XR_PLATFORM_WINDOWS - gamespy_gp::login_manager* tmp_lmngr = MainMenu()->GetLoginMngr(); - VERIFY(tmp_lmngr); - gamespy_gp::profile const* tmp_curr_prof = tmp_lmngr->get_current_profile(); - if (!tmp_curr_prof) - { - Msg("! ERROR: can't submit best scores - not logged in"); - return; - } - if (!tmp_curr_prof->online()) - { - return; - } - - VERIFY(m_best_scores_helper); - m_best_scores_helper->fill_best_results(m_submit_queue->get_best_results_store()); - m_submit_queue->submit_best_results(); -#endif -} - -} // namespace award_system diff --git a/src/xrGame/reward_event_generator.h b/src/xrGame/reward_event_generator.h deleted file mode 100644 index 8ff4721922e..00000000000 --- a/src/xrGame/reward_event_generator.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef REWARD_EVENT_GENERATOR_INCLUDED -#define REWARD_EVENT_GENERATOR_INCLUDED - -#include "game_cl_base_weapon_usage_statistic.h" -#include "profile_data_types.h" -#include "Common/Noncopyable.hpp" - -class atlas_submit_queue; - -namespace award_system -{ -class game_state_accumulator; -class rewarding_state_events; -class rewarding_event_handlers; -class best_scores_helper; - -class reward_event_generator : public Noncopyable -{ -public: - explicit reward_event_generator(u32 const max_rewards_per_game); - virtual ~reward_event_generator(); - - void init_player( - game_PlayerState* local_player); // must be called when buy menu and local_player will be initialized - void init_bone_groups(CActor* first_spawned_actor); - void update(); - - void OnWeapon_Fire(u16 sender, u16 sender_weapon_id); - void OnBullet_Fire(u16 sender, u16 sender_weapon_id, const Fvector& position, const Fvector& direction); - void OnBullet_Hit(IGameObject const* hitter, IGameObject const* victim, IGameObject* weapon, u16 const bone); - void OnArtefactSpawned(); - void OnPlayerTakeArtefact(game_PlayerState const* ps); - void OnPlayerDropArtefact(game_PlayerState const* ps); - void OnPlayerBringArtefact(game_PlayerState const* ps); - void OnPlayerSpawned(game_PlayerState const* ps); - void OnPlayerKilled(u16 killer_id, u16 target_id, u16 weapon_id, std::pair kill_type); - void OnPlayerChangeTeam(s8 team); - void OnPlayerRankdChanged(); - void OnRoundEnd(); - void OnRoundStart(); - - void CommitBestResults(); - -private: - game_PlayerState* m_local_player; - game_state_accumulator* m_state_accum; - rewarding_state_events* m_state_event_checker; - - best_scores_helper* m_best_scores_helper; - - rewarding_event_handlers* m_event_handlers; - atlas_submit_queue* m_submit_queue; - - u32 const m_max_rewards; - u32 m_rewarded; - void AddRewardTask(u32 award_id); -}; // class reward_event_generator - -} // namespace award_system - -#endif //#ifndef REWARD_EVENT_GENERATOR_INCLUDED diff --git a/src/xrGame/reward_event_handler.h b/src/xrGame/reward_event_handler.h deleted file mode 100644 index afc8bad4b17..00000000000 --- a/src/xrGame/reward_event_handler.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef REWARD_EVENT_HANDLER -#define REWARD_EVENT_HANDLER - -#include "game_state_accumulator.h" - -namespace award_system -{ -class game_state_accumulator; - -class reward_event_handler -{ -public: - reward_event_handler(game_state_accumulator* pstate) : m_player_state_accum(pstate) {} - virtual ~reward_event_handler(){}; - virtual bool OnWeapon_Fire(u16 sender, u16 sender_weapon_id) = 0; - virtual bool OnBullet_Fire(u16 sender, u16 sender_weapon_id, const Fvector& position, const Fvector& direction) = 0; - virtual bool OnBullet_Hit( - IGameObject const* hitter, IGameObject const* victim, IGameObject const* weapon, u16 const bone) = 0; - virtual bool OnArtefactSpawned() = 0; - virtual bool OnPlayerTakeArtefact(game_PlayerState const* ps) = 0; - virtual bool OnPlayerDropArtefact(game_PlayerState const* ps) = 0; - virtual bool OnPlayerBringArtefact(game_PlayerState const* ps) = 0; - virtual bool OnPlayerSpawned(game_PlayerState const* ps) = 0; - virtual bool OnPlayerKilled( - u16 killer_id, u16 target_id, u16 weapon_id, std::pair kill_type) = 0; - virtual bool OnPlayerChangeTeam(s8 team) = 0; - virtual bool OnRoundEnd() = 0; - virtual bool OnRoundStart() = 0; - virtual bool OnPlayerRankChanged() = 0; - -protected: - game_state_accumulator* m_player_state_accum; -}; // class reward_event_handler - -} // namespace award_system - -#endif //#ifndef REWARD_EVENT_HANDLER diff --git a/src/xrGame/reward_manager.cpp b/src/xrGame/reward_manager.cpp deleted file mode 100644 index 7b15bc820fc..00000000000 --- a/src/xrGame/reward_manager.cpp +++ /dev/null @@ -1,114 +0,0 @@ -#include "StdAfx.h" -#include "reward_manager.h" -#include "game_cl_mp.h" -#include "UIGameMP.h" -#include "reward_snd_messages.h" -#include "HUDManager.h" -#include "Common/object_broker.h" - -namespace award_system -{ -reward_manager::reward_manager(game_cl_mp* owner) : m_reward_process_time(1000), m_last_reward_time(0), m_owner(owner) -{ - load_rewards(); -} - -reward_manager::~reward_manager() { delete_data(m_rewards_map); } -void reward_manager::add_task(u32 const award_id) { m_to_reward_queue.push_back(award_id); } -void reward_manager::update_tasks() -{ - if (m_to_reward_queue.empty()) - return; - - u32 const tmp_award_id = m_to_reward_queue.front(); - - if ((Device.dwTimeGlobal - m_last_reward_time) < m_reward_process_time) - return; - - process_reward(tmp_award_id); - m_to_reward_queue.pop_front(); -} - -void reward_manager::load_rewards() -{ - static char const* section_name_prefix = "reward_"; - string_path reward_config_path; - FS.update_path(reward_config_path, "$game_config$", "mp" DELIMITER "rewarding.ltx"); - IReader* tmp_reader = FS.r_open(reward_config_path); - VERIFY2(tmp_reader, "can't open $game_config$" DELIMITER "mp" DELIMITER "rewarding.ltx"); - CInifile rewards_config(tmp_reader); - - u32 reward_index = 0; - LPCSTR section_name = NULL; - char tmp_dst_buff[16]; - - STRCONCAT(section_name, section_name_prefix, xr_itoa(reward_index, tmp_dst_buff, 10)); - - while (rewards_config.section_exist(section_name)) - { - load_reward_item(rewards_config, reward_index, section_name); - ++reward_index; - STRCONCAT(section_name, section_name_prefix, xr_itoa(reward_index, tmp_dst_buff, 10)); - } - - FS.r_close(tmp_reader); -} - -void reward_manager::load_reward_item(CInifile& reward_config, u32 const index, shared_str const& section) -{ -#ifdef DEBUG - struct award_name_searcher - { - shared_str m_award_name; - bool operator()(rewards_map_t::value_type const& item) const - { - return item.second->m_award_name == m_award_name; - } - }; // struct award_name_searcher -#endif - VERIFY2(m_rewards_map.find(index) == m_rewards_map.end(), - make_string("reward with id=%d already loaded", index).c_str()); - - reward_descriptor* tmp_descriptor = xr_new(); - tmp_descriptor->m_award_name = reward_config.r_string(section, "name"); - tmp_descriptor->m_texture_name = reward_config.r_string(section, "ingame_texture"); - tmp_descriptor->m_color_animation = reward_config.r_string(section, "color_animation"); - tmp_descriptor->m_width = reward_config.r_u32(section, "ingame_texture_width"); - tmp_descriptor->m_height = reward_config.r_u32(section, "ingame_texture_height"); - - LPCSTR tmp_sound_name = reward_config.r_string(section, "play_sound"); - tmp_descriptor->m_play_sound.create(tmp_sound_name, st_Effect, 0); - tmp_descriptor->m_process_time = reward_config.r_u32(section, "reward_time"); - -#ifdef DEBUG - award_name_searcher tmp_award_searcher; - tmp_award_searcher.m_award_name = tmp_descriptor->m_award_name; - VERIFY2(std::find_if(m_rewards_map.begin(), m_rewards_map.end(), tmp_award_searcher) == m_rewards_map.end(), - make_string("reward with award %s already loaded", tmp_award_searcher.m_award_name.c_str()).c_str()); -#endif - m_rewards_map.emplace(index, tmp_descriptor); -} - -void reward_manager::process_reward(u32 const award_id) -{ - for (rewards_map_t::iterator i = m_rewards_map.begin(), ie = m_rewards_map.end(); i != ie; ++i) - { - if (i->second->m_play_sound._feedback()) - { - i->second->m_play_sound.stop(); - } - } - rewards_map_t::const_iterator tmp_iter = m_rewards_map.find(award_id); - VERIFY(tmp_iter != m_rewards_map.end()); - UIGameMP* tmp_ui_mp_game = smart_cast(CurrentGameUI()); - R_ASSERT(tmp_ui_mp_game); - - tmp_ui_mp_game->AddAchivment(tmp_iter->second->m_texture_name, tmp_iter->second->m_color_animation, - tmp_iter->second->m_width, tmp_iter->second->m_height); - - tmp_iter->second->m_play_sound.play(NULL, sm_2D); - m_reward_process_time = tmp_iter->second->m_process_time; - m_last_reward_time = Device.dwTimeGlobal; -} - -} // namespace award_system diff --git a/src/xrGame/reward_manager.h b/src/xrGame/reward_manager.h deleted file mode 100644 index bbb1e775c31..00000000000 --- a/src/xrGame/reward_manager.h +++ /dev/null @@ -1,49 +0,0 @@ -#pragma once -#ifndef REWARD_MANAGER_INCLUDED -#define REWARD_MANAGER_INCLUDED - -#include "xrCore/Containers/AssociativeVector.hpp" -#include "xrCommon/xr_deque.h" - -class game_cl_mp; - -namespace award_system -{ -class reward_manager -{ -public: - explicit reward_manager(game_cl_mp* owner); - ~reward_manager(); - - void add_task(u32 const award_id); - void update_tasks(); - -private: - struct reward_descriptor - { - shared_str m_award_name; - shared_str m_texture_name; - shared_str m_color_animation; - u32 m_width; - u32 m_height; - ref_sound m_play_sound; - u32 m_process_time; - }; // struct reward_descriptor - - typedef AssociativeVector rewards_map_t; - typedef xr_deque reward_tasks_queue_t; - - u32 m_reward_process_time; - u32 m_last_reward_time; - reward_tasks_queue_t m_to_reward_queue; - rewards_map_t m_rewards_map; - game_cl_mp* m_owner; - - void load_rewards(); - void load_reward_item(CInifile& reward_config, u32 const index, shared_str const& section); - void process_reward(u32 const award_id); -}; // class reward_manager - -} // namespace award_system - -#endif //#ifndef REWARD_MANAGER_INCLUDED diff --git a/src/xrGame/reward_snd_messages.h b/src/xrGame/reward_snd_messages.h deleted file mode 100644 index b8515097b51..00000000000 --- a/src/xrGame/reward_snd_messages.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef REWARD_SND_MESSAGES_INCLUDED -#define REWARD_SND_MESSAGES_INCLUDED - -enum : u32 -{ - ID_REWARD_RANGE_START = 500, -}; - -#endif //#ifndef REWARD_SND_MESSAGES_INCLUDED diff --git a/src/xrGame/rewarding_events_handlers.cpp b/src/xrGame/rewarding_events_handlers.cpp deleted file mode 100644 index 3d7a90e1b1b..00000000000 --- a/src/xrGame/rewarding_events_handlers.cpp +++ /dev/null @@ -1,205 +0,0 @@ -#include "StdAfx.h" -#include "rewarding_events_handlers.h" -#include "reward_event_handler.h" -#include "Common/object_broker.h" - -namespace award_system -{ -rewarding_event_handlers::rewarding_event_handlers( - game_state_accumulator* pstate_accum, event_action_delegate_t ea_delegate) - : m_reward_action(ea_delegate), m_player_state_accum(pstate_accum) -{ -} - -rewarding_event_handlers::~rewarding_event_handlers() { delete_data(m_events_store); } -void rewarding_event_handlers::OnWeapon_Fire(u16 sender, u16 sender_weapon_id) -{ - for (handlers_store_t::iterator i = m_events_store.begin(), ie = m_events_store.end(); i != ie; ++i) - { - if (i->second->OnWeapon_Fire(sender, sender_weapon_id)) - { - m_reward_action(i->first); - break; - } - } - if (m_null_hanlder) - m_null_hanlder->OnWeapon_Fire(sender, sender_weapon_id); -} - -void rewarding_event_handlers::OnBullet_Fire( - u16 sender, u16 sender_weapon_id, const Fvector& position, const Fvector& direction) -{ - for (handlers_store_t::iterator i = m_events_store.begin(), ie = m_events_store.end(); i != ie; ++i) - { - if (i->second->OnBullet_Fire(sender, sender_weapon_id, position, direction)) - { - m_reward_action(i->first); - break; - } - } - if (m_null_hanlder) - m_null_hanlder->OnBullet_Fire(sender, sender_weapon_id, position, direction); -} - -void rewarding_event_handlers::OnBullet_Hit( - IGameObject const* hitter, IGameObject const* victim, IGameObject const* weapon, u16 const bone) -{ - for (handlers_store_t::iterator i = m_events_store.begin(), ie = m_events_store.end(); i != ie; ++i) - { - if (i->second->OnBullet_Hit(hitter, victim, weapon, bone)) - { - m_reward_action(i->first); - break; - } - } - if (m_null_hanlder) - m_null_hanlder->OnBullet_Hit(hitter, victim, weapon, bone); -} -void rewarding_event_handlers::OnArtefactSpawned() -{ - for (handlers_store_t::iterator i = m_events_store.begin(), ie = m_events_store.end(); i != ie; ++i) - { - if (i->second->OnArtefactSpawned()) - { - m_reward_action(i->first); - break; - } - } - if (m_null_hanlder) - m_null_hanlder->OnArtefactSpawned(); -} - -void rewarding_event_handlers::OnPlayerTakeArtefact(game_PlayerState const* ps) -{ - for (handlers_store_t::iterator i = m_events_store.begin(), ie = m_events_store.end(); i != ie; ++i) - { - if (i->second->OnPlayerTakeArtefact(ps)) - { - m_reward_action(i->first); - break; - } - } - if (m_null_hanlder) - m_null_hanlder->OnPlayerTakeArtefact(ps); -} - -void rewarding_event_handlers::OnPlayerDropArtefact(game_PlayerState const* ps) -{ - for (handlers_store_t::iterator i = m_events_store.begin(), ie = m_events_store.end(); i != ie; ++i) - { - if (i->second->OnPlayerDropArtefact(ps)) - { - m_reward_action(i->first); - break; - } - } - if (m_null_hanlder) - m_null_hanlder->OnPlayerDropArtefact(ps); -} - -void rewarding_event_handlers::OnPlayerBringArtefact(game_PlayerState const* ps) -{ - for (handlers_store_t::iterator i = m_events_store.begin(), ie = m_events_store.end(); i != ie; ++i) - { - if (i->second->OnPlayerBringArtefact(ps)) - { - m_reward_action(i->first); - break; - } - } - if (m_null_hanlder) - m_null_hanlder->OnPlayerBringArtefact(ps); -} - -void rewarding_event_handlers::OnPlayerSpawned(game_PlayerState const* ps) -{ - for (handlers_store_t::iterator i = m_events_store.begin(), ie = m_events_store.end(); i != ie; ++i) - { - if (i->second->OnPlayerSpawned(ps)) - { - m_reward_action(i->first); - break; - } - } - if (m_null_hanlder) - m_null_hanlder->OnPlayerSpawned(ps); -} - -void rewarding_event_handlers::OnPlayerKilled( - u16 killer_id, u16 target_id, u16 weapon_id, std::pair kill_type) -{ - for (handlers_store_t::iterator i = m_events_store.begin(), ie = m_events_store.end(); i != ie; ++i) - { - if (i->second->OnPlayerKilled(killer_id, target_id, weapon_id, kill_type)) - { - m_reward_action(i->first); - break; - } - } - if (m_null_hanlder) - m_null_hanlder->OnPlayerKilled(killer_id, target_id, weapon_id, kill_type); -} -void rewarding_event_handlers::OnPlayerChangeTeam(s8 team) -{ - for (handlers_store_t::iterator i = m_events_store.begin(), ie = m_events_store.end(); i != ie; ++i) - { - if (i->second->OnPlayerChangeTeam(team)) - { - m_reward_action(i->first); - break; - } - } - if (m_null_hanlder) - m_null_hanlder->OnPlayerChangeTeam(team); -} - -void rewarding_event_handlers::OnPlayerRankChanged() -{ - for (handlers_store_t::iterator i = m_events_store.begin(), ie = m_events_store.end(); i != ie; ++i) - { - if (i->second->OnPlayerRankChanged()) - { - m_reward_action(i->first); - break; - } - } - if (m_null_hanlder) - m_null_hanlder->OnPlayerRankChanged(); -} - -void rewarding_event_handlers::OnRoundEnd() -{ - for (handlers_store_t::iterator i = m_events_store.begin(), ie = m_events_store.end(); i != ie; ++i) - { - if (i->second->OnRoundEnd()) - { - m_reward_action(i->first); - break; - } - } - if (m_null_hanlder) - m_null_hanlder->OnRoundEnd(); -} - -void rewarding_event_handlers::OnRoundStart() -{ - for (handlers_store_t::iterator i = m_events_store.begin(), ie = m_events_store.end(); i != ie; ++i) - { - if (i->second->OnRoundStart()) - { - m_reward_action(i->first); - break; - } - } - if (m_null_hanlder) - m_null_hanlder->OnRoundStart(); -} - -void rewarding_event_handlers::set_null_handler(reward_event_handler* new_handler) -{ - VERIFY(new_handler); - m_null_hanlder = new_handler; -} - -void rewarding_event_handlers::init() {} -} // namespace award_system diff --git a/src/xrGame/rewarding_events_handlers.h b/src/xrGame/rewarding_events_handlers.h deleted file mode 100644 index 3535d41dc1a..00000000000 --- a/src/xrGame/rewarding_events_handlers.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef REWARDING_EVENTS_HANDLERS_INCLUDED -#define REWARDING_EVENTS_HANDLERS_INCLUDED - -#include "event_conditions_collection.h" //for event_action_delegate_t -#include "game_cl_base_weapon_usage_statistic.h" -#include "xrCore/Containers/AssociativeVector.hpp" -#include "game_events_handler.h" - -namespace award_system -{ -class reward_event_handler; - -class rewarding_event_handlers : public game_events_handler -{ -public: - rewarding_event_handlers(game_state_accumulator* pstate_accum, event_action_delegate_t ea_delegate); - ~rewarding_event_handlers(); - - void init(); - void set_null_handler(reward_event_handler* new_handler); - - virtual void OnWeapon_Fire(u16 sender, u16 sender_weapon_id); - virtual void OnBullet_Fire(u16 sender, u16 sender_weapon_id, const Fvector& position, const Fvector& direction); - virtual void OnBullet_Hit( - IGameObject const* hitter, IGameObject const* victim, IGameObject const* weapon, u16 const bone); - virtual void OnArtefactSpawned(); - virtual void OnPlayerTakeArtefact(game_PlayerState const* ps); - virtual void OnPlayerDropArtefact(game_PlayerState const* ps); - virtual void OnPlayerBringArtefact(game_PlayerState const* ps); - virtual void OnPlayerSpawned(game_PlayerState const* ps); - virtual void OnPlayerKilled( - u16 killer_id, u16 target_id, u16 weapon_id, std::pair kill_type); - virtual void OnPlayerChangeTeam(s8 team); - virtual void OnPlayerRankChanged(); - virtual void OnRoundEnd(); - virtual void OnRoundStart(); - -private: - typedef AssociativeVector handlers_store_t; - - handlers_store_t m_events_store; - event_action_delegate_t m_reward_action; - game_state_accumulator* m_player_state_accum; - reward_event_handler* m_null_hanlder{}; -}; // class rewarding_event_handlers - -} // namespace award_system - -#endif //#ifndef REWARDING_EVENTS_HANDLERS_INCLUDED diff --git a/src/xrGame/rewarding_state_events.cpp b/src/xrGame/rewarding_state_events.cpp deleted file mode 100644 index 497fcafdecf..00000000000 --- a/src/xrGame/rewarding_state_events.cpp +++ /dev/null @@ -1,186 +0,0 @@ -#include "StdAfx.h" -#include "rewarding_state_events.h" -#include "game_state_accumulator.h" -#include "profile_data_types.h" -#include "ammunition_groups.h" -#include "bone_groups.h" - -namespace award_system -{ -rewarding_state_events::rewarding_state_events( - game_state_accumulator* pstate_accum, event_action_delegate_t ea_delegate) - : inherited(pstate_accum, ea_delegate) -{ -} - -rewarding_state_events::~rewarding_state_events() {} -void rewarding_state_events::init() -{ - clear_events(); - - add_event( - add_accumm_value_condition(acpv_kill_in_raw, u32_bfunc_cf::get_function(u32_bfunc_cf::tt_greater_equal), 20), 1, - eGameIDDeathmatch, gamespy_profile::at_award_massacre); - - add_event(add_and_condition(add_accumm_value_condition( - acpv_death_count, u32_bfunc_cf::get_function(u32_bfunc_cf::tt_less_equal), 0), - add_and_condition(add_accumm_value_condition(acpv_my_team_win_score, - u32_bfunc_cf::get_function(u32_bfunc_cf::tt_greater_equal), 1), - add_and_condition(add_accumm_value_condition(acpv_command_switch_count, - u32_bfunc_cf::get_function(u32_bfunc_cf::tt_less_equal), 0), - add_accumm_value_condition( - acpv_spots, u32_bfunc_cf::get_function(u32_bfunc_cf::tt_greater_equal), 15)))), - 1, eGameIDTeamDeathmatch | eGameIDCaptureTheArtefact, gamespy_profile::at_award_paranoia); - - add_event(add_and_condition(add_accumm_value_condition(acpv_my_team_win_score, - u32_bfunc_cf::get_function(u32_bfunc_cf::tt_greater_equal), 1), - add_accumm_value_condition( - acpv_enemy_top_player_div, float_bfunc_cf::get_function(float_bfunc_cf::tt_greater_equal), 2.0f)), - 1, eGameIDTeamDeathmatch, gamespy_profile::at_award_overwhelming_superiority); - - add_event(add_accumm_value_condition( - acpv_blitzkrieg_time, u32_bfunc_cf::get_function(u32_bfunc_cf::tt_less_equal), 180000), - 1, eGameIDCaptureTheArtefact, gamespy_profile::at_award_blitzkrieg); - - add_event(add_and_condition(add_accumm_value_condition(acpv_artdeliver_count, - u32_bfunc_cf::get_function(u32_bfunc_cf::tt_greater_equal), 1), - add_and_condition(add_accumm_value_condition(acpv_my_team_win_score, - u32_bfunc_cf::get_function(u32_bfunc_cf::tt_greater_equal), 10), - add_accumm_value_condition( - acpv_enemy_team_score, u32_bfunc_cf::get_function(u32_bfunc_cf::tt_less_equal), 0))), - 1, eGameIDCaptureTheArtefact | eGameIDArtefactHunt, gamespy_profile::at_award_dry_victory); - - add_event( - add_accumm_value_condition(acpv_multi_champion, u32_bfunc_cf::get_function(u32_bfunc_cf::tt_greater_equal), 1), - 1, eGameIDCaptureTheArtefact | eGameIDArtefactHunt, gamespy_profile::at_award_multichampion); - - add_event(add_accumm_value_condition(acpv_mad, u32_bfunc_cf::get_function(u32_bfunc_cf::tt_greater_equal), 3), 1, - eGameIDDeathmatch | eGameIDTeamDeathmatch | eGameIDArtefactHunt | eGameIDCaptureTheArtefact, - gamespy_profile::at_award_mad); - - add_event(add_accumm_value_condition( - acpv_achilles_heel_ready, u32_bfunc_cf::get_function(u32_bfunc_cf::tt_greater_equal), 1), - 1, eGameIDDeathmatch | eGameIDTeamDeathmatch | eGameIDArtefactHunt | eGameIDCaptureTheArtefact, - gamespy_profile::at_award_achilles_heel); - - add_event(add_and_condition(add_accumm_value_condition(acpv_faster_than_bullets_time, - u32_bfunc_cf::get_function(u32_bfunc_cf::tt_greater_equal), 3000), - add_accumm_value_condition( - acpv_faster_than_bullets_time, u32_bfunc_cf::get_function(u32_bfunc_cf::tt_less_equal), 10000)), - 1, eGameIDDeathmatch | eGameIDTeamDeathmatch | eGameIDArtefactHunt | eGameIDCaptureTheArtefact, - gamespy_profile::at_award_fater_than_bullets); - - add_event( - add_accumm_value_condition(acpv_harvest_count, u32_bfunc_cf::get_function(u32_bfunc_cf::tt_greater_equal), 10), - 1, eGameIDDeathmatch | eGameIDTeamDeathmatch | eGameIDArtefactHunt | eGameIDCaptureTheArtefact, - gamespy_profile::at_award_harvest_time); - - add_event( - add_accumm_value_condition(acpv_skewer_count, u32_bfunc_cf::get_function(u32_bfunc_cf::tt_greater_equal), 2), 1, - eGameIDDeathmatch | eGameIDTeamDeathmatch | eGameIDArtefactHunt | eGameIDCaptureTheArtefact, - gamespy_profile::at_award_skewer); - - add_event( - add_and_condition(add_accumm_value_condition(acpv_double_shot_double_kill_time, - u32_bfunc_cf::get_function(u32_bfunc_cf::tt_less_equal), 1000), - add_accumm_value_condition(acpv_ammo_elapsed, u32_bfunc_cf::get_function(u32_bfunc_cf::tt_less_equal), 0)), - 1, eGameIDDeathmatch | eGameIDTeamDeathmatch | eGameIDArtefactHunt | eGameIDCaptureTheArtefact, - gamespy_profile::at_award_double_shot_double_kill); - - add_event(add_accumm_value_condition(acpv_climber, u32_bfunc_cf::get_function(u32_bfunc_cf::tt_greater_equal), 4), - 1, eGameIDArtefactHunt | eGameIDCaptureTheArtefact, gamespy_profile::at_award_climber); - - add_event( - add_accumm_value_condition(acpv_opener_ready, u32_bfunc_cf::get_function(u32_bfunc_cf::tt_greater_equal), 1), 1, - eGameIDDeathmatch | eGameIDTeamDeathmatch | eGameIDArtefactHunt | eGameIDCaptureTheArtefact, - gamespy_profile::at_award_opener); - - add_event(add_accumm_value_condition(acpv_toughy, u32_bfunc_cf::get_function(u32_bfunc_cf::tt_greater_equal), 5), 1, - eGameIDDeathmatch | eGameIDTeamDeathmatch | eGameIDArtefactHunt | eGameIDCaptureTheArtefact, - gamespy_profile::at_award_toughy); - - add_event( - add_accumm_value_condition(acpv_invincible_fury, u32_bfunc_cf::get_function(u32_bfunc_cf::tt_greater_equal), 5), - 1, eGameIDDeathmatch | eGameIDTeamDeathmatch | eGameIDArtefactHunt | eGameIDCaptureTheArtefact, - gamespy_profile::at_award_invincible_fury); - - add_event(add_kill_condition_dist(2, ammunition_group::gid_any, KT_HIT, SKT_EYESHOT), 1, - eGameIDDeathmatch | eGameIDTeamDeathmatch | eGameIDArtefactHunt | eGameIDCaptureTheArtefact, - gamespy_profile::at_award_oculist); - - add_event(add_and_condition(add_kill_condition_dist(1, ammunition_group::gid_any, KT_HIT, SKT_HEADSHOT, 0), - add_and_condition(add_accumm_value_condition(acpv_move_velocity, - float_bfunc_cf::get_function(float_bfunc_cf::tt_greater_equal), 6.0f), - add_accumm_value_condition(acpv_move_ang_velocity, - float_bfunc_cf::get_function(float_bfunc_cf::tt_greater_equal), 10.0f))), - 1, eGameIDDeathmatch | eGameIDTeamDeathmatch | eGameIDArtefactHunt | eGameIDCaptureTheArtefact, - gamespy_profile::at_award_lightning_reflexes); - - add_event(add_and_condition(add_accumm_value_condition(acpv_sprinter_victim_velocity, - float_bfunc_cf::get_function(float_bfunc_cf::tt_greater_equal), 6.0f), - add_accumm_value_condition(acpv_killer_victim_angle, - float_bfunc_cf::get_function(float_bfunc_cf::tt_less_equal), - _cos(PI_DIV_2 - 0.345f)) //~ 90 +- 20 degrees - ), - 1, eGameIDDeathmatch | eGameIDTeamDeathmatch | eGameIDArtefactHunt | eGameIDCaptureTheArtefact, - gamespy_profile::at_award_sprinter_stopper); - - add_event( - add_accumm_value_condition(acpv_marksman_count, u32_bfunc_cf::get_function(u32_bfunc_cf::tt_greater_equal), 3), - 1, eGameIDDeathmatch | eGameIDTeamDeathmatch | eGameIDArtefactHunt | eGameIDCaptureTheArtefact, - gamespy_profile::at_award_marksman); - - add_event( - add_accumm_value_condition(acpv_ambassador, u32_bfunc_cf::get_function(u32_bfunc_cf::tt_greater_equal), 1), 1, - eGameIDCaptureTheArtefact, gamespy_profile::at_award_peace_ambassador); - - add_event(add_hit_condition_dist(1, ammunition_group::gid_sniper_rifels, bone_group::gid_eyes, - float_bfunc_cf::get_function(float_bfunc_cf::tt_greater_equal), 120.0f), - 1, eGameIDDeathmatch | eGameIDTeamDeathmatch | eGameIDArtefactHunt | eGameIDCaptureTheArtefact, - gamespy_profile::at_award_deadly_accuracy); - - add_event( - add_accumm_value_condition(acpv_remembrance, u32_bfunc_cf::get_function(u32_bfunc_cf::tt_greater_equal), 1), 1, - eGameIDDeathmatch | eGameIDTeamDeathmatch | eGameIDArtefactHunt | eGameIDCaptureTheArtefact, - gamespy_profile::at_award_remembrance); - - add_event(add_accumm_value_condition(acpv_avenger, u32_bfunc_cf::get_function(u32_bfunc_cf::tt_greater_equal), 3), - 1, eGameIDTeamDeathmatch | eGameIDArtefactHunt | eGameIDCaptureTheArtefact, gamespy_profile::at_award_avenger); - - add_event( - add_accumm_value_condition(acpv_cherub_ready, u32_bfunc_cf::get_function(u32_bfunc_cf::tt_greater_equal), 2), 1, - eGameIDArtefactHunt | eGameIDCaptureTheArtefact, gamespy_profile::at_award_cherub); - - add_event(add_and_condition(add_and_condition(add_accumm_value_condition(acpv_enemy_team_score_now, - u32_bfunc_cf::get_function(u32_bfunc_cf::tt_greater_equal), 5), - add_accumm_value_condition(acpv_artdeliver_count, - u32_bfunc_cf::get_function(u32_bfunc_cf::tt_greater_equal), 1)), - add_accumm_value_condition( - acpv_my_team_win_score_now, u32_bfunc_cf::get_function(u32_bfunc_cf::tt_less_equal), 1)), - 1, eGameIDArtefactHunt | eGameIDCaptureTheArtefact, gamespy_profile::at_award_dignity); - - add_event( - add_accumm_value_condition(acpv_stalker_flair, u32_bfunc_cf::get_function(u32_bfunc_cf::tt_less_equal), 2000), - 1, eGameIDArtefactHunt, gamespy_profile::at_award_stalker_flair); - - add_event(add_and_condition(add_accumm_value_condition( - acpv_ammo_elapsed, u32_bfunc_cf::get_function(u32_bfunc_cf::tt_less_equal), 0), - add_kill_condition_dist(1, ammunition_group::gid_assault, KT_HIT, SKT_NONE, 0)), - 1, eGameIDDeathmatch | eGameIDTeamDeathmatch | eGameIDArtefactHunt | eGameIDCaptureTheArtefact, - gamespy_profile::at_award_lucky); - - add_event( - add_accumm_value_condition(acpv_black_list, u32_bfunc_cf::get_function(u32_bfunc_cf::tt_greater_equal), 8), 1, - eGameIDArtefactHunt | eGameIDCaptureTheArtefact, gamespy_profile::at_award_black_list); - - add_event(add_and_condition(add_accumm_value_condition( - acpv_thunder_count, u32_bfunc_cf::get_function(u32_bfunc_cf::tt_less_equal), 0), - add_and_condition(add_accumm_value_condition(acpv_my_team_win_score, - u32_bfunc_cf::get_function(u32_bfunc_cf::tt_greater_equal), 1), - add_accumm_value_condition( - acpv_spots, u32_bfunc_cf::get_function(u32_bfunc_cf::tt_greater_equal), 15))), - 1, eGameIDDeathmatch | eGameIDTeamDeathmatch | eGameIDArtefactHunt | eGameIDCaptureTheArtefact, - gamespy_profile::at_award_silent_death); -} - -} // namespace award_system diff --git a/src/xrGame/rewarding_state_events.h b/src/xrGame/rewarding_state_events.h deleted file mode 100644 index ea04027acc8..00000000000 --- a/src/xrGame/rewarding_state_events.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef REWARDING_EVENTS_INCLUDED -#define REWARDING_EVENTS_INCLUDED - -#include "event_conditions_collection.h" - -namespace award_system -{ -class rewarding_state_events : public event_conditions_collection -{ - typedef event_conditions_collection inherited; - -public: - rewarding_state_events(game_state_accumulator* pstate_accum, event_action_delegate_t ea_delegate); - virtual ~rewarding_state_events(); - virtual void init(); -}; // class rewarding_state_events - -} // namespace award_system - -#endif //#ifndef REWARDING_EVENTS_INCLUDED diff --git a/src/xrGame/silent_shots.cpp b/src/xrGame/silent_shots.cpp deleted file mode 100644 index 77cb7083e8e..00000000000 --- a/src/xrGame/silent_shots.cpp +++ /dev/null @@ -1,47 +0,0 @@ -#include "StdAfx.h" -#include "silent_shots.h" -#include "game_base.h" -#include "game_state_accumulator.h" -#include "Weapon.h" -#include "WeaponKnife.h" - -namespace award_system -{ -void silent_shots::reset_game() -{ - m_thunder_count = 0; - m_last_shoot_weapon = 0; -} - -void silent_shots::OnWeapon_Fire(u16 sender, u16 sender_weapon_id) -{ - if (m_last_shoot_weapon == sender_weapon_id) - return; - - game_PlayerState* tmp_local_player = m_owner->get_local_player(); - if (!tmp_local_player) - return; - - if (sender != tmp_local_player->GameID) - return; - - CWeapon* shoot_weapon = m_owner->get_active_weapon(tmp_local_player); - if (!shoot_weapon || (sender_weapon_id != shoot_weapon->ID())) - return; - - if (shoot_weapon->IsSilencerAttached()) - { - m_last_shoot_weapon = sender_weapon_id; - return; - } - - if (smart_cast(shoot_weapon)) - { - m_last_shoot_weapon = sender_weapon_id; - return; - } - - ++m_thunder_count; -} - -} // namespace award_system diff --git a/src/xrGame/silent_shots.h b/src/xrGame/silent_shots.h deleted file mode 100644 index a9f607c89b7..00000000000 --- a/src/xrGame/silent_shots.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef SILENT_SHOTS_INCLUDED -#define SILENT_SHOTS_INCLUDED - -#include "player_state_param.h" -#include "accumulative_states.h" - -namespace award_system -{ -class silent_shots : public player_state_param -{ - typedef player_state_param inherited; - -public: - silent_shots(game_state_accumulator* owner) : inherited(owner) {}; - virtual ~silent_shots(){}; - - virtual void update(){}; - virtual u32 get_u32_param() { return m_thunder_count; }; - virtual float get_float_param() { return 0.0f; }; - virtual void reset_game(); - - virtual void OnWeapon_Fire(u16 sender, u16 sender_weapon_id); - -protected: - u32 m_thunder_count{}; - u16 m_last_shoot_weapon{}; -}; // class silent_shots - -} // namespace award_system - -#endif //#ifndef SILENT_SHOTS_INCLUDED diff --git a/src/xrGame/sprinter_stopper.cpp b/src/xrGame/sprinter_stopper.cpp deleted file mode 100644 index 636464089af..00000000000 --- a/src/xrGame/sprinter_stopper.cpp +++ /dev/null @@ -1,37 +0,0 @@ -#include "StdAfx.h" -#include "sprinter_stopper.h" -#include "game_state_accumulator.h" -#include "game_cl_base.h" -#include "Level.h" -#include "ammunition_groups.h" -#include "Actor.h" - -namespace award_system -{ -void spritnter_stopper::reset_game() { m_sprinter_victim_velocity = 0.0f; } -float spritnter_stopper::get_float_param() { return m_sprinter_victim_velocity; } -void spritnter_stopper::OnPlayerKilled( - u16 killer_id, u16 target_id, u16 weapon_id, std::pair kill_type) -{ - game_PlayerState* tmp_local_player = m_owner->get_local_player(); - if (!tmp_local_player) - return; - - if (tmp_local_player->GameID != killer_id) - return; - - u16 weapon_gid = m_owner->get_active_weapon_of_player(tmp_local_player); - if (!m_owner->is_item_in_group(weapon_gid, ammunition_group::gid_sniper_rifels)) - return; - - CActor* victim_actor = m_owner->get_players_actor(target_id); - if (!victim_actor) - return; - - CEntity::SEntityState state; - victim_actor->g_State(state); - - m_sprinter_victim_velocity = state.fVelocity; -} - -} // namespace award_system diff --git a/src/xrGame/sprinter_stopper.h b/src/xrGame/sprinter_stopper.h deleted file mode 100644 index 8faf1262985..00000000000 --- a/src/xrGame/sprinter_stopper.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef SPRINTER_STOPPER_INCLUDED -#define SPRINTER_STOPPER_INCLUDED - -#include "player_state_param.h" -#include "accumulative_states.h" - -namespace award_system -{ -class spritnter_stopper : public player_state_param -{ - typedef player_state_param inherited; - -public: - spritnter_stopper(game_state_accumulator* owner) : inherited(owner) {}; - virtual ~spritnter_stopper(){}; - - virtual void update(){}; - virtual u32 get_u32_param() { return 0; }; - virtual float get_float_param(); - virtual void reset_game(); - virtual void OnPlayerKilled( - u16 killer_id, u16 target_id, u16 weapon_id, std::pair kill_type); - -protected: - float m_sprinter_victim_velocity{}; -}; // class spritnter_stopper - -} // namespace award_system - -#endif //#ifndef SPRINTER_STOPPER_INCLUDED diff --git a/src/xrGame/stalker_flair.cpp b/src/xrGame/stalker_flair.cpp deleted file mode 100644 index 0e9aa9d5f78..00000000000 --- a/src/xrGame/stalker_flair.cpp +++ /dev/null @@ -1,36 +0,0 @@ -#include "StdAfx.h" -#include "game_cl_base.h" -#include "stalker_flair.h" -#include "game_state_accumulator.h" - -namespace award_system -{ -u32 stalker_flair::get_u32_param() -{ - if (!m_art_spawn_time || !m_art_take_time) - return u32(-1); - - return m_art_take_time - m_art_spawn_time; -} - -void stalker_flair::reset_game() -{ - m_art_spawn_time = 0; - m_art_take_time = 0; -} - -void stalker_flair::OnArtefactSpawned() -{ - m_art_spawn_time = Device.dwTimeGlobal; - m_art_take_time = 0; -} - -void stalker_flair::OnPlayerTakeArtefact(game_PlayerState const* ps) -{ - if (ps == m_owner->get_local_player()) - { - m_art_take_time = Device.dwTimeGlobal; - } -} - -} // namespace award_system diff --git a/src/xrGame/stalker_flair.h b/src/xrGame/stalker_flair.h deleted file mode 100644 index 4efcc3d4a83..00000000000 --- a/src/xrGame/stalker_flair.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef STALKER_FLAIR_INCLUDED -#define STALKER_FLAIR_INCLUDED - -#include "player_state_param.h" -#include "accumulative_states.h" - -namespace award_system -{ -class stalker_flair : public player_state_param -{ - typedef player_state_param inherited; - -public: - stalker_flair(game_state_accumulator* owner) : inherited(owner) {}; - virtual ~stalker_flair(){}; - - virtual void update(){}; - - virtual u32 get_u32_param(); - virtual float get_float_param() { return -1.0f; }; - virtual void reset_game(); - - virtual void OnArtefactSpawned(); - virtual void OnPlayerTakeArtefact(game_PlayerState const* ps); - -protected: - u32 m_art_spawn_time{}; - u32 m_art_take_time{}; -}; // class stalker_flair - -} // namespace award_system - -#endif //#ifndef PLAYER_STATE_BLITZKRIEG_INCLUDED diff --git a/src/xrGame/state_arguments_functions.cpp b/src/xrGame/state_arguments_functions.cpp deleted file mode 100644 index a22d18e20ac..00000000000 --- a/src/xrGame/state_arguments_functions.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include "StdAfx.h" -#include "state_arguments_functions.h" - -namespace award_system -{ -// definitions of static members of functions_cf -template<> -ge_function functions_cf::s_ge_function {}; -template<> -le_function functions_cf::s_le_function {}; - -template<> -ge_function functions_cf::s_ge_function {}; -template<> -le_function functions_cf::s_le_function {}; - -} // namespace award_system diff --git a/src/xrGame/state_arguments_functions.h b/src/xrGame/state_arguments_functions.h deleted file mode 100644 index dcc88d5179f..00000000000 --- a/src/xrGame/state_arguments_functions.h +++ /dev/null @@ -1,65 +0,0 @@ -#ifndef STATE_PREDICATES_INCLUDED -#define STATE_PREDICATES_INCLUDED - -namespace award_system -{ -// float functions -template -class binary_function -{ -public: - virtual bool exec(T const left, T const right) = 0; -}; // float_binary_function - -template -class ge_function : public binary_function -{ -public: - virtual bool exec(T const left, T const right) { return left >= right; } -}; // class float_ge_function - -template -class le_function : public binary_function -{ -public: - virtual bool exec(T const left, T const right) { return left <= right; } -}; // float_le_function - -template -class functions_cf -{ -public: - typedef binary_function function_type; - enum enum_type_tags - { - tt_greater_equal = 0x00, - tt_less_equal, - tt_count - }; // enum type_tags - - static function_type* get_function(enum_type_tags ftype) - { - switch (ftype) - { - case tt_greater_equal: - return &s_ge_function; - case tt_less_equal: - return &s_le_function; - }; // switch (ftype) - return nullptr; - } - -private: - static ge_function s_ge_function; - static le_function s_le_function; -}; - -typedef binary_function float_binary_function; -typedef functions_cf float_bfunc_cf; - -typedef binary_function u32_binary_function; -typedef functions_cf u32_bfunc_cf; - -} // namespace award_system - -#endif //#ifndef STATE_PREDICATES_INCLUDED diff --git a/src/xrGame/stats_submitter.cpp b/src/xrGame/stats_submitter.cpp deleted file mode 100644 index a078a415a6b..00000000000 --- a/src/xrGame/stats_submitter.cpp +++ /dev/null @@ -1,467 +0,0 @@ -#include "StdAfx.h" -#include "stats_submitter.h" -#include "xrGameSpy/GameSpy_Full.h" -#include "login_manager.h" -#include "MainMenu.h" -#include "profile_store.h" -#include "awards_store.h" -#include "best_scores_store.h" - -namespace gamespy_profile -{ -stats_submitter::stats_submitter(CGameSpy_Full* fullgs) - : m_ltx_file(p_number, q_number, g_number, &stats_submitter::fill_private_key) -{ - shedule.t_min = 500; - shedule.t_max = 1000; - VERIFY(fullgs); - m_fullgs_obj = fullgs; - m_atlas_obj = fullgs->GetGameSpyATLAS(); - VERIFY(m_atlas_obj); - m_last_operation_profile = NULL; - m_atlas_report = NULL; - m_last_best_scores = NULL; - ZeroMemory(m_atlas_connection_id, sizeof(m_atlas_connection_id)); -} - -stats_submitter::~stats_submitter() {} -void stats_submitter::reward_with_award( - enum_awards_t award_id, u32 const count, gamespy_gp::profile const* profile, store_operation_cb opcb) -{ - if (!opcb) - { - m_last_operation_cb.bind(this, &stats_submitter::onlylog_operation); - } - else - { - m_last_operation_cb = opcb; - } - R_ASSERT(!m_last_operation_profile); - - m_last_operation_profile = profile; - m_report_type = ert_set_award; - m_last_award_id = award_id; - m_last_award_count = count; - - begin_session(); -} - -void stats_submitter::set_best_scores( - all_best_scores_t const* scores, gamespy_gp::profile const* profile, store_operation_cb opcb) -{ - if (!opcb) - { - m_last_operation_cb.bind(this, &stats_submitter::onlylog_operation); - } - else - { - m_last_operation_cb = opcb; - } - R_ASSERT(!m_last_operation_profile); - - m_last_operation_profile = profile; - m_report_type = ert_set_best_scores; - m_last_best_scores = scores; - - begin_session(); -} - -void stats_submitter::submit_all(all_awards_t const* awards, all_best_scores_t const* scores, - gamespy_gp::profile const* profile, store_operation_cb opcb) -{ - if (!opcb) - { - m_last_operation_cb.bind(this, &stats_submitter::onlylog_operation); - } - else - { - m_last_operation_cb = opcb; - } - R_ASSERT(!m_last_operation_profile); - - m_last_operation_profile = profile; - m_report_type = ert_synchronize_profile; - m_last_all_awards = awards; - m_last_best_scores = scores; - - begin_session(); -} - -void stats_submitter::shedule_Update(u32 dt) -{ - VERIFY(m_fullgs_obj && m_atlas_obj); -#ifdef DEBUG - Msg("--- GameSpy core and atlas thinking ..."); -#endif - m_fullgs_obj->CoreThink(10); // 10 milliseconds on update - m_atlas_obj->Think(); -} - -void stats_submitter::onlylog_operation(bool const result, char const* err_descr) -{ - if (!result) - { - Msg("! Store operation ERROR: %s", err_descr ? err_descr : "unknown"); - return; - } - Msg("* Store operation successfullly complete."); -} - -u32 const stats_submitter::operation_timeout_value = 60000; // 60 seconds -void stats_submitter::begin_session() -{ - VERIFY(m_last_operation_profile && m_last_operation_cb); - SCResult tmp_result = m_atlas_obj->CreateSession(&m_last_operation_profile->mCertificate, - &m_last_operation_profile->mPrivateData, &stats_submitter::created_session_cb, operation_timeout_value, this); - - if (tmp_result != SCResult_NO_ERROR) - { - m_last_operation_cb(false, CGameSpy_ATLAS::TryToTranslate(tmp_result).c_str()); - terminate_session(); - return; - } - - Engine.Sheduler.Register(this, FALSE); -} - -void __cdecl stats_submitter::created_session_cb( - const SCInterfacePtr theInterface, GHTTPResult theHttpResult, SCResult theResult, void* theUserData) -{ - stats_submitter* my_inst = static_cast(theUserData); - VERIFY(my_inst && my_inst->m_last_operation_profile); - if (theHttpResult != GHTTPSuccess) - { - my_inst->m_last_operation_cb(false, CGameSpy_ATLAS::TryToTranslate(theHttpResult).c_str()); - my_inst->terminate_session(); - Engine.Sheduler.Unregister(my_inst); - return; - } - if (theResult != SCResult_NO_ERROR) - { - my_inst->m_last_operation_cb(false, CGameSpy_ATLAS::TryToTranslate(theResult).c_str()); - my_inst->terminate_session(); - Engine.Sheduler.Unregister(my_inst); - return; - } - SCResult tmp_result = my_inst->m_atlas_obj->SetReportIntention(NULL, gsi_true, - &my_inst->m_last_operation_profile->mCertificate, &my_inst->m_last_operation_profile->mPrivateData, - &stats_submitter::set_intension_cb, stats_submitter::operation_timeout_value, my_inst); - - if (tmp_result != SCResult_NO_ERROR) - { - my_inst->m_last_operation_cb(false, CGameSpy_ATLAS::TryToTranslate(tmp_result).c_str()); - my_inst->terminate_session(); - Engine.Sheduler.Unregister(my_inst); - return; - } -} - -void __cdecl stats_submitter::set_intension_cb( - const SCInterfacePtr theInterface, GHTTPResult theHttpResult, SCResult theResult, void* theUserData) -{ - stats_submitter* my_inst = static_cast(theUserData); - VERIFY(my_inst && my_inst->m_last_operation_profile); - if (theHttpResult != GHTTPSuccess) - { - my_inst->m_last_operation_cb(false, CGameSpy_ATLAS::TryToTranslate(theHttpResult).c_str()); - my_inst->terminate_session(); - Engine.Sheduler.Unregister(my_inst); - return; - } - if (theResult != SCResult_NO_ERROR) - { - my_inst->m_last_operation_cb(false, CGameSpy_ATLAS::TryToTranslate(theResult).c_str()); - my_inst->terminate_session(); - Engine.Sheduler.Unregister(my_inst); - return; - } - char const* tmp_connection_id = my_inst->m_atlas_obj->GetConnectionId(); - VERIFY(tmp_connection_id); - xr_strcpy(static_cast((void*)my_inst->m_atlas_connection_id), sizeof(my_inst->m_atlas_connection_id), - tmp_connection_id); - - if (!my_inst->prepare_report()) - { - my_inst->m_last_operation_cb(false, "mp_failed_to_create_report"); - my_inst->terminate_session(); - Engine.Sheduler.Unregister(my_inst); - return; - } - - SCResult tmp_result = my_inst->m_atlas_obj->SubmitReport(my_inst->m_atlas_report, gsi_true, - &my_inst->m_last_operation_profile->mCertificate, &my_inst->m_last_operation_profile->mPrivateData, - &stats_submitter::submitted_cb, stats_submitter::operation_timeout_value, my_inst); - if (tmp_result != SCResult_NO_ERROR) - { - my_inst->m_last_operation_cb(false, CGameSpy_ATLAS::TryToTranslate(tmp_result).c_str()); - my_inst->terminate_session(); - Engine.Sheduler.Unregister(my_inst); - return; - } -} - -void __cdecl stats_submitter::submitted_cb( - const SCInterfacePtr theInterface, GHTTPResult theHttpResult, SCResult theResult, void* theUserData) -{ - stats_submitter* my_inst = static_cast(theUserData); - VERIFY(my_inst && my_inst->m_last_operation_profile); - if (theHttpResult != GHTTPSuccess) - { - my_inst->m_last_operation_cb(false, CGameSpy_ATLAS::TryToTranslate(theHttpResult).c_str()); - my_inst->terminate_session(); - Engine.Sheduler.Unregister(my_inst); - return; - } - if (theResult != SCResult_NO_ERROR) - { - my_inst->m_last_operation_cb(false, CGameSpy_ATLAS::TryToTranslate(theResult).c_str()); - my_inst->terminate_session(); - Engine.Sheduler.Unregister(my_inst); - return; - } - - my_inst->m_last_operation_cb(true, ""); - my_inst->terminate_session(); - Engine.Sheduler.Unregister(my_inst); -} - -bool stats_submitter::prepare_report() -{ - VERIFY(!m_atlas_report); - SCResult tmp_res = m_atlas_obj->CreateReport(ATLAS_RULE_SET_VERSION, 1, 0, &m_atlas_report); - VERIFY2((tmp_res == SCResult_NO_ERROR) && (m_atlas_report), "failed to create atlas report"); - if ((tmp_res != SCResult_NO_ERROR) || (!m_atlas_report)) - return false; - - tmp_res = m_atlas_obj->ReportBeginGlobalData(m_atlas_report); - VERIFY2(tmp_res == SCResult_NO_ERROR, "failed to begin global data"); - if (tmp_res != SCResult_NO_ERROR) - return false; - - tmp_res = m_atlas_obj->ReportBeginPlayerData(m_atlas_report); - VERIFY2(tmp_res == SCResult_NO_ERROR, "failed to begin player data"); - if (tmp_res != SCResult_NO_ERROR) - return false; - - tmp_res = m_atlas_obj->ReportBeginNewPlayer(m_atlas_report); - VERIFY2(tmp_res == SCResult_NO_ERROR, "failed to begin new player data"); - if (tmp_res != SCResult_NO_ERROR) - return false; - - tmp_res = m_atlas_obj->ReportSetPlayerData(m_atlas_report, 0, m_atlas_connection_id, 0, SCGameResult_NONE, - m_last_operation_profile->m_profile_id, &m_last_operation_profile->mCertificate); - VERIFY2(tmp_res == SCResult_NO_ERROR, "failed to set player data"); - if (tmp_res != SCResult_NO_ERROR) - return false; - - bool report_creation_result = false; - switch (m_report_type) - { - case ert_set_award: { report_creation_result = create_award_inc_report(); - } - break; - case ert_set_best_scores: { report_creation_result = create_best_scores_report(); - } - break; - case ert_synchronize_profile: - { - report_creation_result = create_all_awards_report(); - report_creation_result &= create_best_scores_report(); - } - break; - default: NODEFAULT; - }; // switch (m_report_type) - if (report_creation_result) - { - tmp_res = m_atlas_obj->ReportEnd(m_atlas_report, gsi_true, SCGameStatus_COMPLETE); - VERIFY(tmp_res == SCResult_NO_ERROR); - return (tmp_res == SCResult_NO_ERROR); - } - return false; -} - -bool stats_submitter::add_player_name_to_report() -{ - SCResult tmp_res = - m_atlas_obj->ReportAddStringValue(m_atlas_report, KEY_PlayerName, m_last_operation_profile->unique_nick()); - VERIFY(tmp_res == SCResult_NO_ERROR); - if (tmp_res != SCResult_NO_ERROR) - return false; - - return true; -} - -bool stats_submitter::create_award_inc_report() -{ -#ifdef XR_PLATFORM_WINDOWS - __time32_t tmp_time = 0; - _time32(&tmp_time); - - SCResult tmp_res = m_atlas_obj->ReportAddIntValue( - m_atlas_report, get_award_id_key(m_last_award_id), static_cast(m_last_award_count)); - VERIFY(tmp_res == SCResult_NO_ERROR); - if (tmp_res != SCResult_NO_ERROR) - return false; - - tmp_res = m_atlas_obj->ReportAddIntValue( - m_atlas_report, get_award_reward_date_key(m_last_award_id), static_cast(tmp_time)); - VERIFY(tmp_res == SCResult_NO_ERROR); - if (tmp_res != SCResult_NO_ERROR) - return false; - - return add_player_name_to_report(); -#else - return false; // XXX: Add implementation for Linux -#endif -} - -bool stats_submitter::create_best_scores_report() -{ - VERIFY(m_last_best_scores); - SCResult tmp_res; - for (all_best_scores_t::const_iterator si = m_last_best_scores->begin(), sie = m_last_best_scores->end(); si != sie; - ++si) - { - tmp_res = m_atlas_obj->ReportAddIntValue(m_atlas_report, - get_best_score_id_key(static_cast(si->first)), si->second); - VERIFY(tmp_res == SCResult_NO_ERROR); - if (tmp_res != SCResult_NO_ERROR) - return false; - } - return add_player_name_to_report(); -} - -bool stats_submitter::create_all_awards_report() -{ - VERIFY(m_last_all_awards); - for (all_awards_t::const_iterator ai = m_last_all_awards->begin(), aie = m_last_all_awards->end(); ai != aie; ++ai) - { - SCResult tmp_res = m_atlas_obj->ReportAddIntValue( - m_atlas_report, get_award_id_key(ai->first), static_cast(ai->second.m_count)); - VERIFY(tmp_res == SCResult_NO_ERROR); - if (tmp_res != SCResult_NO_ERROR) - return false; - - tmp_res = m_atlas_obj->ReportAddIntValue( - m_atlas_report, get_award_reward_date_key(ai->first), static_cast(ai->second.m_last_reward_date)); - VERIFY(tmp_res == SCResult_NO_ERROR); - if (tmp_res != SCResult_NO_ERROR) - return false; - } - return add_player_name_to_report(); -} - -void stats_submitter::terminate_session() -{ - m_last_operation_cb.clear(); - m_last_operation_profile = NULL; - m_atlas_report = NULL; - m_last_best_scores = NULL; - ZeroMemory(m_atlas_connection_id, sizeof(m_atlas_connection_id)); -} - -void stats_submitter::quick_reward_with_award(enum_awards_t award_id, gamespy_gp::profile const* profile) -{ - profile_store* tmp_prof_store = MainMenu()->GetProfileStore(); - VERIFY(tmp_prof_store); - awards_store* tmp_awards_store = tmp_prof_store->get_awards_store(); - VERIFY(tmp_awards_store); - - all_awards_t& tmp_awards = tmp_awards_store->get_player_awards(); - - all_awards_t::iterator award_iter = tmp_awards.find(award_id); - R_ASSERT(award_iter != tmp_awards.end()); - ++award_iter->second.m_count; -#ifdef XR_PLATFORM_WINDOWS // XXX: Add implementation for Linux - __time32_t tmp_time = 0; - _time32(&tmp_time); - award_iter->second.m_last_reward_date = static_cast(tmp_time); -#endif - save_file(profile); -} - -void stats_submitter::quick_set_best_scores(all_best_scores_t const* scores, gamespy_gp::profile const* profile) -{ - VERIFY(scores); - profile_store* tmp_prof_store = MainMenu()->GetProfileStore(); - VERIFY(tmp_prof_store); - best_scores_store* tmp_bs_store = tmp_prof_store->get_best_scores_store(); - VERIFY(tmp_bs_store); - - all_best_scores_t& tmp_best_scores = tmp_bs_store->get_player_best_scores(); - - for (all_best_scores_t::iterator i = tmp_best_scores.begin(), ie = tmp_best_scores.end(); i != ie; ++i) - { - all_best_scores_t::const_iterator tmp_iter = scores->find(i->first); - if (tmp_iter == scores->end()) - continue; - i->second = std::max(i->second, tmp_iter->second); - } - save_file(profile); -} - -void stats_submitter::save_file(gamespy_gp::profile const* profile) -{ - profile_store* tmp_prof_store = MainMenu()->GetProfileStore(); - VERIFY(tmp_prof_store); - awards_store* tmp_awards_store = tmp_prof_store->get_awards_store(); - VERIFY(tmp_awards_store); - best_scores_store* tmp_bs_store = tmp_prof_store->get_best_scores_store(); - VERIFY(tmp_prof_store); - - all_awards_t& tmp_awards = tmp_awards_store->get_player_awards(); - all_best_scores_t& tmp_best_scores = tmp_bs_store->get_player_best_scores(); - - CInifile& ltx_to_write = m_ltx_file.get_ltx(); - ltx_to_write.sections().clear(); - - for (all_awards_t::const_iterator i = tmp_awards.begin(), ie = tmp_awards.end(); i != ie; ++i) - { - LPCSTR tmp_award_name = get_award_name(i->first); - ltx_to_write.w_u16(tmp_award_name, award_count_line, i->second.m_count); - ltx_to_write.w_u32(tmp_award_name, award_rdate_line, i->second.m_last_reward_date); - } - - for (all_best_scores_t::const_iterator i = tmp_best_scores.begin(), ie = tmp_best_scores.end(); i != ie; ++i) - { - LPCSTR tmp_bs_name = get_best_score_name(i->first); - ltx_to_write.w_u32(tmp_bs_name, best_score_value_line, i->second); - } - -#ifdef XR_PLATFORM_WINDOWS // XXX: Add implementation for Linux - __time32_t tmp_time = 0; - _time32(&tmp_time); - - ltx_to_write.w_s32(profile_data_section, profile_id_line, profile->m_profile_id); - ltx_to_write.w_u32(profile_data_section, profile_last_submit_time, static_cast(tmp_time)); -#endif - IWriter* tmp_writer = FS.w_open("$app_data_root$", profile_store_file_name); - m_ltx_file.sign_and_save(*tmp_writer); - FS.w_close(tmp_writer); -} - -void stats_submitter::fill_private_key(crypto::xr_dsa::private_key_t& priv_key_dest) -{ - priv_key_dest.m_value[0] = 0x82; - priv_key_dest.m_value[1] = 0xf0; - priv_key_dest.m_value[2] = 0x41; - priv_key_dest.m_value[3] = 0xe9; - priv_key_dest.m_value[4] = 0x9a; - priv_key_dest.m_value[5] = 0x98; - priv_key_dest.m_value[6] = 0xa0; - priv_key_dest.m_value[7] = 0xf9; - priv_key_dest.m_value[8] = 0xff; - priv_key_dest.m_value[9] = 0xe1; - priv_key_dest.m_value[10] = 0x14; - priv_key_dest.m_value[11] = 0x48; - priv_key_dest.m_value[12] = 0xb3; - priv_key_dest.m_value[13] = 0xde; - priv_key_dest.m_value[14] = 0xe3; - priv_key_dest.m_value[15] = 0x69; - priv_key_dest.m_value[16] = 0xea; - priv_key_dest.m_value[17] = 0x16; - priv_key_dest.m_value[18] = 0x64; - priv_key_dest.m_value[19] = 0xf2; -} - -} // namespace gamespy_profile diff --git a/src/xrGame/stats_submitter.h b/src/xrGame/stats_submitter.h deleted file mode 100644 index faa7ac2d631..00000000000 --- a/src/xrGame/stats_submitter.h +++ /dev/null @@ -1,98 +0,0 @@ -#ifndef STATS_SUBMITTER_INCLUDED -#define STATS_SUBMITTER_INCLUDED - -#include "Common/Noncopyable.hpp" -#include "xrGameSpy/GameSpy_ATLAS.h" -#include "profile_data_types.h" -#include "gsc_dsigned_ltx.h" -#include "xrCore/Crypto/xr_dsa.h" -#include "profile_data_types_script.h" -#include "xrEngine/ISheduled.h" - -class CGameSpy_Full; - -namespace gamespy_gp -{ -struct profile; -}; - -namespace gamespy_profile -{ -class stats_submitter : public ScheduledBase -{ -public: - stats_submitter(CGameSpy_Full* fullgs); - ~stats_submitter(); - - void reward_with_award( - enum_awards_t award_id, u32 const count, gamespy_gp::profile const* profile, store_operation_cb opcb); - void quick_reward_with_award(enum_awards_t const award_id, gamespy_gp::profile const* profile); - - void set_best_scores(all_best_scores_t const* scores, gamespy_gp::profile const* profile, store_operation_cb opcb); - void quick_set_best_scores(all_best_scores_t const* scores, gamespy_gp::profile const* profile); - - void submit_all(all_awards_t const* awards, all_best_scores_t const* scores, gamespy_gp::profile const* profile, - store_operation_cb opcb); - - virtual void shedule_Update(u32 dt); - virtual shared_str shedule_Name() const { return shared_str("gamespy_atlas_updator"); }; - virtual bool shedule_Needed() { return true; }; - virtual float shedule_Scale() const { return 1.0f; }; - static u8 const p_number[crypto::xr_dsa::public_key_length]; - static u8 const q_number[crypto::xr_dsa::private_key_length]; - static u8 const g_number[crypto::xr_dsa::public_key_length]; - static u8 const public_key[crypto::xr_dsa::public_key_length]; - -private: - CGameSpy_Full* m_fullgs_obj; - CGameSpy_ATLAS* m_atlas_obj; - gsc_dsigned_ltx_writer m_ltx_file; - - gamespy_gp::profile const* m_last_operation_profile; - gsi_u8 m_atlas_connection_id[SC_CONNECTION_GUID_SIZE]; - SCReportPtr m_atlas_report; - - enum enum_report_type - { - ert_set_award = 0x00, - ert_set_best_scores, - ert_synchronize_profile - }; // enum enum_report_type - - enum_report_type m_report_type; - enum_awards_t m_last_award_id; - u32 m_last_award_count; - all_awards_t const* m_last_all_awards; - all_best_scores_t const* m_last_best_scores; - - store_operation_cb m_last_operation_cb; - - void begin_session(); - bool prepare_report(); - - bool add_player_name_to_report(); - bool create_award_inc_report(); - bool create_best_scores_report(); - bool create_all_awards_report(); - - void terminate_session(); - - void save_file(gamespy_gp::profile const* profile); - - void onlylog_operation(bool const result, char const* err_descr); - - static void fill_private_key(crypto::xr_dsa::private_key_t& priv_key_dest); - - //------- callbacks -------- - static u32 const operation_timeout_value; - static void __cdecl created_session_cb( - const SCInterfacePtr theInterface, GHTTPResult theHttpResult, SCResult theResult, void* theUserData); - static void __cdecl set_intension_cb( - const SCInterfacePtr theInterface, GHTTPResult theHttpResult, SCResult theResult, void* theUserData); - static void __cdecl submitted_cb( - const SCInterfacePtr theInterface, GHTTPResult theHttpResult, SCResult theResult, void* theUserData); -}; - -} // namespace gamespy_profile - -#endif //#ifndef STATS_SUBMITTER_INCLUDED diff --git a/src/xrGame/stats_submitter_dsa_params.cpp b/src/xrGame/stats_submitter_dsa_params.cpp deleted file mode 100644 index d9ccce2db13..00000000000 --- a/src/xrGame/stats_submitter_dsa_params.cpp +++ /dev/null @@ -1,41 +0,0 @@ -#include "StdAfx.h" -#include "stats_submitter.h" - -namespace gamespy_profile -{ -// DSA params -u8 const stats_submitter::p_number[crypto::xr_dsa::public_key_length] = { - 0x81, 0x45, 0xf1, 0x8f, 0x3c, 0x00, 0x36, 0xb8, 0xf5, 0x7b, 0x26, 0xba, 0x1d, 0x98, 0xb8, 0x25, 0xce, 0x53, 0xbd, - 0x10, 0xc3, 0x34, 0xa0, 0xfc, 0xcf, 0x5e, 0x50, 0x48, 0x78, 0x3e, 0x6a, 0x53, 0xce, 0x24, 0x89, 0x76, 0x41, 0xf7, - 0xd2, 0x3d, 0x28, 0x0d, 0x00, 0xac, 0x28, 0xc8, 0x8f, 0xfd, 0x10, 0xca, 0xf7, 0x1e, 0x45, 0xf8, 0xef, 0xa9, 0xed, - 0x4d, 0x1c, 0xa7, 0x0b, 0x48, 0xac, 0xb6, 0xd4, 0x23, 0x4a, 0x5f, 0x43, 0x3c, 0x2b, 0x6a, 0x51, 0xf2, 0x4b, 0xc4, - 0x51, 0x4c, 0xef, 0x9b, 0x18, 0xdd, 0xb7, 0x6e, 0xe9, 0x06, 0x8c, 0x15, 0x8e, 0xa9, 0x32, 0x05, 0xaa, 0x3a, 0x64, - 0x58, 0xc6, 0x5f, 0x10, 0xba, 0xfb, 0x26, 0x49, 0x58, 0xd2, 0x4a, 0xd7, 0x6c, 0xab, 0x6b, 0x5c, 0x90, 0xad, 0xdc, - 0x92, 0x42, 0x22, 0x95, 0xb0, 0xbe, 0xb0, 0xab, 0xe7, 0xd3, 0xd4, 0x4b, 0xd7, 0xe9, -}; // p_number - -u8 const stats_submitter::q_number[crypto::xr_dsa::private_key_length] = { - 0xaa, 0x22, 0x5b, 0x49, 0xbd, 0x81, 0xc0, 0x05, 0x85, 0x94, 0xae, 0x4f, 0xfc, 0x06, 0xd7, 0x01, 0x4e, 0xdb, 0x4d, - 0x67, -}; // q_number -u8 const stats_submitter::g_number[crypto::xr_dsa::public_key_length] = { - 0x21, 0x0f, 0x1d, 0xbf, 0x5e, 0x04, 0xae, 0x82, 0x7a, 0x57, 0xef, 0x73, 0xf3, 0x71, 0x1f, 0xc8, 0x52, 0x62, 0x09, - 0x62, 0x19, 0x8a, 0xe1, 0xab, 0xbd, 0xc7, 0xbd, 0x99, 0xc0, 0x88, 0xff, 0x29, 0x2f, 0xa6, 0x60, 0x51, 0xde, 0xfe, - 0x35, 0xfd, 0x6d, 0xd3, 0xc6, 0x87, 0x62, 0x78, 0xbe, 0x14, 0xfc, 0x78, 0x01, 0x1f, 0x03, 0x50, 0xaa, 0x1c, 0x15, - 0x7f, 0xcb, 0xb7, 0x19, 0x34, 0x77, 0x37, 0x16, 0x59, 0x76, 0x9b, 0x4c, 0x3d, 0x40, 0x0a, 0x04, 0x8f, 0xa6, 0x7b, - 0x8a, 0x8e, 0x22, 0xde, 0xd1, 0x13, 0x83, 0x38, 0xb8, 0x87, 0xe7, 0x3a, 0x60, 0x34, 0x47, 0x55, 0xde, 0xac, 0x34, - 0x2e, 0xe1, 0x6e, 0x39, 0x56, 0xfc, 0xab, 0xce, 0x2c, 0xf2, 0xc6, 0x5b, 0x23, 0x31, 0xf5, 0x28, 0x18, 0x4e, 0x83, - 0xeb, 0x09, 0x7a, 0xc2, 0x83, 0xd0, 0x8a, 0xf0, 0x3a, 0xc1, 0xbd, 0x69, 0x67, 0xfb, -}; // g_number - -u8 const stats_submitter::public_key[crypto::xr_dsa::public_key_length] = { - 0x66, 0xe4, 0x18, 0x25, 0x1f, 0x19, 0x13, 0xae, 0x77, 0xb2, 0x09, 0x7e, 0x1c, 0xe8, 0xf8, 0xe9, 0xea, 0x1d, 0x5e, - 0xce, 0x70, 0xd2, 0xe8, 0x2a, 0x92, 0x81, 0xf5, 0xce, 0x1a, 0x17, 0x80, 0x32, 0x06, 0x87, 0xbb, 0x4c, 0x9c, 0xed, - 0x36, 0x84, 0xc2, 0x11, 0xb8, 0xc3, 0x7c, 0xa4, 0xbb, 0x97, 0xb9, 0x59, 0x9f, 0xcb, 0x68, 0x0a, 0x3f, 0x1c, 0xac, - 0xb8, 0x65, 0x71, 0x13, 0x3e, 0xce, 0xb4, 0xb1, 0x2d, 0xf9, 0x08, 0x7a, 0xf0, 0x73, 0x98, 0x2c, 0xa0, 0xf1, 0x9b, - 0xd3, 0x3d, 0x0b, 0xcc, 0x99, 0x7e, 0x82, 0x9d, 0x63, 0x81, 0xd5, 0x20, 0x3f, 0xe5, 0xd1, 0x02, 0x0d, 0x26, 0xb0, - 0xd5, 0x44, 0x59, 0x9f, 0x2c, 0xd7, 0xce, 0x1c, 0x92, 0xd2, 0xe6, 0xbb, 0x52, 0x54, 0x15, 0xfd, 0xc6, 0x22, 0x02, - 0xd2, 0xf1, 0x28, 0x89, 0xa9, 0x47, 0x4d, 0xc2, 0x79, 0x07, 0x5c, 0xb3, 0xd6, 0x2b, -}; // public_key - -} // namespace gamespy_profile diff --git a/src/xrGame/xrGame.vcxproj b/src/xrGame/xrGame.vcxproj index 1fc2352e6c6..97985ef2915 100644 --- a/src/xrGame/xrGame.vcxproj +++ b/src/xrGame/xrGame.vcxproj @@ -103,7 +103,6 @@ - @@ -565,7 +564,6 @@ - @@ -574,24 +572,17 @@ - - - - - - - @@ -617,7 +608,6 @@ - @@ -671,7 +661,6 @@ - @@ -698,14 +687,12 @@ - - @@ -741,15 +728,12 @@ - - - @@ -774,12 +758,9 @@ - - - @@ -842,11 +823,7 @@ - - - - @@ -924,8 +901,6 @@ - - @@ -969,24 +944,6 @@ - - - - - - - - - - - - - - - - - - @@ -1024,12 +981,6 @@ - - - - - - @@ -1110,7 +1061,6 @@ - @@ -1169,7 +1119,6 @@ - @@ -1209,7 +1158,6 @@ - @@ -1241,11 +1189,9 @@ - - @@ -1276,7 +1222,6 @@ - @@ -2022,7 +1967,6 @@ - pch_script.h @@ -2037,28 +1981,18 @@ pch_script.h $(IntDir)$(ProjectName)_script.pch - - - - - - pch_script.h $(IntDir)$(ProjectName)_script.pch - - - - @@ -2168,7 +2102,6 @@ $(IntDir)$(ProjectName)_script.pch - true @@ -2205,7 +2138,6 @@ pch_script.h $(IntDir)$(ProjectName)_script.pch - @@ -2215,7 +2147,6 @@ $(IntDir)$(ProjectName)_script.pch - @@ -2285,8 +2216,6 @@ - - @@ -2332,7 +2261,6 @@ pch_script.h $(IntDir)$(ProjectName)_script.pch - pch_script.h $(IntDir)$(ProjectName)_script.pch @@ -2352,7 +2280,6 @@ - pch_script.h @@ -2448,10 +2375,7 @@ pch_script.h $(IntDir)$(ProjectName)_script.pch - - - pch_script.h $(IntDir)$(ProjectName)_script.pch @@ -2650,29 +2574,11 @@ - - - - - - - - - - - - - - - - - - @@ -2700,10 +2606,6 @@ - - - - @@ -2908,7 +2810,6 @@ - pch_script.h @@ -3005,7 +2906,6 @@ - pch_script.h @@ -3073,7 +2973,6 @@ - pch_script.h $(IntDir)$(ProjectName)_script.pch @@ -3131,13 +3030,10 @@ - true - - Create @@ -3165,7 +3061,6 @@ - diff --git a/src/xrGame/xrGame.vcxproj.filters b/src/xrGame/xrGame.vcxproj.filters index 6ec15dde90f..36c2fcd0f0b 100644 --- a/src/xrGame/xrGame.vcxproj.filters +++ b/src/xrGame/xrGame.vcxproj.filters @@ -1774,18 +1774,6 @@ {05fd45d5-e228-4cf4-b0ba-95c70c241d32} - - {a6c8ba3f-676b-481e-9a66-384adbd86cfb} - - - {bed9b7e6-790d-4e2b-86ca-09c60a4790cd} - - - {c99f1659-c3d6-40e4-9a31-f183fff6edcf} - - - {d311624a-97c9-478e-b79e-c683de716d95} - {90021637-62c4-48f9-a213-150237749e59} @@ -2032,9 +2020,6 @@ {4d53f414-59e3-42bb-8f3c-038994de1bf9} - - {bd82763e-8bc7-4a97-84e7-7db1211a0560} - {3dea9773-a080-4168-a028-9d6de40c3840} @@ -5562,153 +5547,6 @@ Core\Server\Games\client\mp\anticheat - - Core\Server\Games\client\mp\award_system - - - Core\Server\Games\client\mp\award_system - - - Core\Server\Games\client\mp\award_system - - - Core\Server\Games\client\mp\award_system - - - Core\Server\Games\client\mp\award_system - - - Core\Server\Games\client\mp\award_system - - - Core\Server\Games\client\mp\award_system - - - Core\Server\Games\client\mp\award_system - - - Core\Server\Games\client\mp\award_system - - - Core\Server\Games\client\mp\award_system - - - Core\Server\Games\client\mp\award_system\event_handlers - - - Core\Server\Games\client\mp\award_system\event_handlers - - - Core\Server\Games\client\mp\award_system\player_state - - - Core\Server\Games\client\mp\award_system\player_state - - - Core\Server\Games\client\mp\award_system\player_state - - - Core\Server\Games\client\mp\award_system\player_state - - - Core\Server\Games\client\mp\award_system\player_state - - - Core\Server\Games\client\mp\award_system\player_state - - - Core\Server\Games\client\mp\award_system\player_state - - - Core\Server\Games\client\mp\award_system\player_state - - - Core\Server\Games\client\mp\award_system\player_state - - - Core\Server\Games\client\mp\award_system\player_state - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - Core\Server\Games\client\capture_the_artefact @@ -5760,18 +5598,6 @@ Core\Server\Games\PlayerAccounts - - Core\Server\Games\PlayerAccounts - - - Core\Server\Games\PlayerAccounts - - - Core\Server\Games\PlayerAccounts - - - Core\Server\Games\PlayerAccounts - Core\Server\Games\PlayerAccounts @@ -5796,9 +5622,6 @@ Core\Server\Games\PlayerAccounts - - Core\Server\Games\PlayerAccounts - Core\Server\QR2 callbacks @@ -6183,9 +6006,6 @@ UI\Multiplayer\DemoPlayControl - - UI\Multiplayer\Achivements - UI\Multiplayer\AdminMenu @@ -8806,123 +8626,6 @@ Core\Server\Games\client\mp\anticheat - - Core\Server\Games\client\mp\award_system - - - Core\Server\Games\client\mp\award_system - - - Core\Server\Games\client\mp\award_system - - - Core\Server\Games\client\mp\award_system - - - Core\Server\Games\client\mp\award_system - - - Core\Server\Games\client\mp\award_system - - - Core\Server\Games\client\mp\award_system - - - Core\Server\Games\client\mp\award_system - - - Core\Server\Games\client\mp\award_system\event_handlers - - - Core\Server\Games\client\mp\award_system\player_state - - - Core\Server\Games\client\mp\award_system\player_state - - - Core\Server\Games\client\mp\award_system\player_state - - - Core\Server\Games\client\mp\award_system\player_state - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - - - Core\Server\Games\client\mp\award_system\player_state\state_parameters - Core\Server\Games\client\capture_the_artefact @@ -8992,18 +8695,6 @@ Core\Server\Games\PlayerAccounts - - Core\Server\Games\PlayerAccounts - - - Core\Server\Games\PlayerAccounts - - - Core\Server\Games\PlayerAccounts - - - Core\Server\Games\PlayerAccounts - Core\Server\Games\PlayerAccounts @@ -9016,9 +8707,6 @@ Core\Server\Games\PlayerAccounts - - Core\Server\Games\PlayerAccounts - Core\Server\Games\PlayerAccounts @@ -9028,12 +8716,6 @@ Core\Server\Games\PlayerAccounts - - Core\Server\Games\PlayerAccounts - - - Core\Server\Games\PlayerAccounts - Core\Server\QR2 callbacks @@ -9550,9 +9232,6 @@ UI\Multiplayer\DemoPlayControl - - UI\Multiplayer\Achivements - UI\Multiplayer\AdminMenu diff --git a/src/xrGameSpy/CMakeLists.txt b/src/xrGameSpy/CMakeLists.txt index 6c024db1bb2..0be0c0aed20 100644 --- a/src/xrGameSpy/CMakeLists.txt +++ b/src/xrGameSpy/CMakeLists.txt @@ -43,8 +43,6 @@ target_sources_grouped( GameSpy_Patching.h GameSpy_QR2.cpp GameSpy_QR2.h - GameSpy_SAKE.cpp - GameSpy_SAKE.h ) target_include_directories(xrGameSpy diff --git a/src/xrGameSpy/GameSpy_Full.cpp b/src/xrGameSpy/GameSpy_Full.cpp index 30a4e47a67e..685aa80a908 100644 --- a/src/xrGameSpy/GameSpy_Full.cpp +++ b/src/xrGameSpy/GameSpy_Full.cpp @@ -5,7 +5,6 @@ #include "GameSpy_HTTP.h" #include "GameSpy_BrowsersWrapper.h" #include "GameSpy_GP.h" -#include "GameSpy_SAKE.h" #include "GameSpy_ATLAS.h" #include "Common/object_broker.h" @@ -16,7 +15,6 @@ CGameSpy_Full::CGameSpy_Full() m_pGS_HTTP = NULL; m_pGS_SB = NULL; m_pGS_GP = NULL; - m_bServicesAlreadyChecked = false; //--------------------------------------- m_pGSA = xr_new(); //----------------------------------------------------- @@ -29,7 +27,6 @@ CGameSpy_Full::CGameSpy_Full() m_pGS_SB = xr_new(); m_pGS_GP = xr_new(); - m_pGS_SAKE = xr_new(); m_pGS_ATLAS = xr_new(); } @@ -40,7 +37,6 @@ CGameSpy_Full::~CGameSpy_Full() delete_data(m_pGS_HTTP); delete_data(m_pGS_SB); delete_data(m_pGS_GP); - delete_data(m_pGS_SAKE); delete_data(m_pGS_ATLAS); gsCoreShutdown(); } diff --git a/src/xrGameSpy/GameSpy_Full.h b/src/xrGameSpy/GameSpy_Full.h index 8d58f631345..151793c6a66 100644 --- a/src/xrGameSpy/GameSpy_Full.h +++ b/src/xrGameSpy/GameSpy_Full.h @@ -7,7 +7,6 @@ class CGameSpy_HTTP; enum class GSUpdateStatus; class CGameSpy_BrowsersWrapper; class CGameSpy_GP; -class CGameSpy_SAKE; class CGameSpy_ATLAS; class XRGAMESPY_API CGameSpy_Full @@ -23,7 +22,6 @@ class XRGAMESPY_API CGameSpy_Full CGameSpy_HTTP* GetGameSpyHTTP() const { return m_pGS_HTTP; } CGameSpy_BrowsersWrapper* GetGameSpyBrowser() const { return m_pGS_SB; } CGameSpy_GP* GetGameSpyGP() const { return m_pGS_GP; } - CGameSpy_SAKE* GetGameSpySAKE() const { return m_pGS_SAKE; } CGameSpy_ATLAS* GetGameSpyATLAS() const { return m_pGS_ATLAS; } GSUpdateStatus Update(); void CoreThink(u32 millisecondsTimeout); @@ -34,6 +32,5 @@ class XRGAMESPY_API CGameSpy_Full CGameSpy_HTTP* m_pGS_HTTP; CGameSpy_BrowsersWrapper* m_pGS_SB; CGameSpy_GP* m_pGS_GP; - CGameSpy_SAKE* m_pGS_SAKE; CGameSpy_ATLAS* m_pGS_ATLAS; }; diff --git a/src/xrGameSpy/GameSpy_SAKE.cpp b/src/xrGameSpy/GameSpy_SAKE.cpp deleted file mode 100644 index 8a72d741088..00000000000 --- a/src/xrGameSpy/GameSpy_SAKE.cpp +++ /dev/null @@ -1,80 +0,0 @@ -#include "stdafx.h" -#include "GameSpy_SAKE.h" - -shared_str const CGameSpy_SAKE::TryToTranslate(SAKERequestResult const& request_result) -{ - string16 digit_dest; - LPCSTR tmp_string = NULL; - _itoa_s(request_result, digit_dest, 10); - STRCONCAT(tmp_string, "mp_sake_database_request_error_", digit_dest); - return tmp_string; -} -shared_str const CGameSpy_SAKE::TryToTranslate(SAKEStartRequestResult const& request_result) -{ - string16 digit_dest; - LPCSTR tmp_string = NULL; - _itoa_s(request_result, digit_dest, 10); - STRCONCAT(tmp_string, "mp_sake_database_start_request_error_", digit_dest); - return tmp_string; -} - -SAKEStartupResult xrGS_sakeStartup(SAKE* sakePtr) -{ - SAKEStartupResult tmp_res = sakeStartup(sakePtr); - if (tmp_res == SAKEStartupResult_SUCCESS) - { - sakeSetGame(*sakePtr, GAMESPY_GAMENAME, GAMESPY_GAMEID, GAMESPY_GAMEKEY); - } - return tmp_res; -} - -void CGameSpy_SAKE::Init() -{ - SAKEStartupResult result = sakeStartup(&m_sake_inst); - if (result == SAKEStartupResult_SUCCESS) - { - sakeSetGame(m_sake_inst, GAMESPY_GAMENAME, GAMESPY_GAMEID, GAMESPY_GAMEKEY); - } - else - Msg("! GameSpy SAKE: failed to initialize, error code: %d", result); - VERIFY(result == SAKEStartupResult_SUCCESS); -} - -CGameSpy_SAKE::CGameSpy_SAKE() -{ - m_sake_inst = NULL; - Init(); -} - -CGameSpy_SAKE::~CGameSpy_SAKE() -{ - if (m_sake_inst) - { - sakeShutdown(m_sake_inst); - } -} - -void CGameSpy_SAKE::SetProfile(int profileId, const char* loginTicket) -{ - sakeSetProfile(m_sake_inst, profileId, loginTicket); -} - -SAKEStartRequestResult CGameSpy_SAKE::GetRequestResult() { return sakeGetStartRequestResult(m_sake_inst); } -SAKERequest CGameSpy_SAKE::GetMyRecords(SAKEGetMyRecordsInput* input, SAKERequestCallback callback, void* userData) -{ - return sakeGetMyRecords(m_sake_inst, input, callback, userData); -} -SAKERequest CGameSpy_SAKE::CreateRecord(SAKECreateRecordInput* input, SAKERequestCallback callback, void* userdata) -{ - return sakeCreateRecord(m_sake_inst, input, callback, userdata); -} -SAKERequest CGameSpy_SAKE::UpdateRecord(SAKEUpdateRecordInput* input, SAKERequestCallback callback, void* userdata) -{ - return sakeUpdateRecord(m_sake_inst, input, callback, userdata); -} - -SAKERequest CGameSpy_SAKE::SearchForRecords( - SAKESearchForRecordsInput* input, SAKERequestCallback callback, void* userData) -{ - return sakeSearchForRecords(m_sake_inst, input, callback, userData); -} diff --git a/src/xrGameSpy/GameSpy_SAKE.h b/src/xrGameSpy/GameSpy_SAKE.h deleted file mode 100644 index f95ed3381bb..00000000000 --- a/src/xrGameSpy/GameSpy_SAKE.h +++ /dev/null @@ -1,27 +0,0 @@ -#pragma once -#include "xrGameSpy/xrGameSpy.h" - -namespace gamespy_sake -{ -} // namespace gamespy_sake - -class XRGAMESPY_API CGameSpy_SAKE -{ -public: - CGameSpy_SAKE(); - ~CGameSpy_SAKE(); - - void SetProfile(int profileId, const char* loginTicket); - SAKEStartRequestResult GetRequestResult(); - SAKERequest GetMyRecords(SAKEGetMyRecordsInput* input, SAKERequestCallback callback, void* userData); - SAKERequest CreateRecord(SAKECreateRecordInput* input, SAKERequestCallback callback, void* userdata); - SAKERequest UpdateRecord(SAKEUpdateRecordInput* input, SAKERequestCallback callback, void* userdata); - SAKERequest SearchForRecords(SAKESearchForRecordsInput* input, SAKERequestCallback callback, void* userData); - static shared_str const TryToTranslate(SAKERequestResult const& request_result); - static shared_str const TryToTranslate(SAKEStartRequestResult const& request_result); - -private: - SAKE m_sake_inst; - - void Init(); -}; // class GameSpy_SAKE diff --git a/src/xrGameSpy/xrGameSpy.vcxproj b/src/xrGameSpy/xrGameSpy.vcxproj index 7b43427043e..8474cb15d05 100644 --- a/src/xrGameSpy/xrGameSpy.vcxproj +++ b/src/xrGameSpy/xrGameSpy.vcxproj @@ -42,7 +42,6 @@ - Create @@ -61,7 +60,6 @@ - diff --git a/src/xrGameSpy/xrGameSpy.vcxproj.filters b/src/xrGameSpy/xrGameSpy.vcxproj.filters index 4ce772edce4..fac0bad8cd4 100644 --- a/src/xrGameSpy/xrGameSpy.vcxproj.filters +++ b/src/xrGameSpy/xrGameSpy.vcxproj.filters @@ -45,9 +45,6 @@ Wrapper - - Wrapper - Wrapper @@ -95,9 +92,6 @@ Wrapper - - Wrapper - Wrapper