SEGS  0.4.2
Super Entity Game Server
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
clientoptions_definitions.h
Go to the documentation of this file.
1 /*
2  * SEGS - Super Entity Game Server
3  * http://www.segs.io/
4  * Copyright (c) 2006 - 2018 SEGS Team (see Authors.txt)
5  * This software is licensed! (See License.txt for details)
6  */
7 
8 #pragma once
9 
10 #include <QtCore/QString>
11 #include <stdint.h>
12 #include <vector>
13 #include <cassert>
14 
15 #include <QDebug>
16 
17 enum ReticleVisibility : uint32_t {
19  rv_Always = 1,
23 };
24 
26 {
27  enum eType
28  {
29  t_int = 1,
30  t_string = 2,
31  t_float = 3,
34  t_mat4 = 6,
35  t_vec3 = 7,
36  t_date = 9,
38  };
39  struct Arg
40  {
41  Arg(int t,void *v) : type(eType(t)),tgt(v){}
43  void *tgt;
44  };
45  std::string name;
46  std::vector<Arg> m_args;
47  //ClientOption(const char *v) : name(v) {}
48 };
49 
51 {
52  std::vector<ClientOption> m_opts;
53  void init();
54 public:
56  {
57  init();
58  m_mouse_speed = 0.6f;
59  }
60 
61 // ClientOptions serialization class version
62 static const constexpr uint32_t class_version = 1;
63 
64  // Other Options
65  int32_t control_debug = 0;
66  int32_t no_strafe = 0;
67  int32_t alwaysmobile = 0; // 1 - player is always mobile (can't be immobilized by powers)
68  int32_t repredict = 0; // 1 - client is out of sync with server, asking for new physics state info.
69  int32_t neterrorcorrection = 0;
70  float speed_scale = 0;
71 
75 
76  // Options
77  bool m_first_person_view = false;
78 
79  // Options Window Settings
80  bool m_mouse_invert = false;
81  float m_mouse_speed = 0;
82  float m_turn_speed = 3; // client displays this as pct (*100)
83  bool m_fade_chat_wnd = true;
84  bool m_fade_nav_wnd = true;
85  bool m_show_tooltips = true;
86  bool m_allow_profanity = false;
87  bool m_chat_balloons = true;
97  uint8_t m_chat_font_size = 12; // 12 default size
98 
99  ClientOption *get(int idx)
100  {
101  if(idx<0)
102  return nullptr;
103  assert((size_t(idx)<m_opts.size()) && "Unknown option requested!!");
104  return &m_opts[idx];
105  }
106 
107  void clientOptionsDump() const
108  {
109  qDebug().noquote() << "Debugging ClientOptions:"
110  << "\n\t" << "Invert Mouse:" << m_mouse_invert
111  << "\n\t" << "Mouse Speed:" << m_mouse_speed
112  << "\n\t" << "Turn Speed:" << m_turn_speed
113  << "\n\t" << "Fade Chat Window:" << m_fade_chat_wnd
114  << "\n\t" << "Fade Nav Window:" << m_fade_nav_wnd
115  << "\n\t" << "Show Tooltips:" << m_show_tooltips
116  << "\n\t" << "Allow Profanity:" << m_allow_profanity
117  << "\n\t" << "Chat Balloons:" << m_chat_balloons
118  << "\n\t" << "Show Archetype:" << m_show_archetype
119  << "\n\t" << "Show SuperGroup:" << m_show_supergroup
120  << "\n\t" << "Show Player Name:" << m_show_player_name
121  << "\n\t" << "Show Player Bars:" << m_show_player_bars
122  << "\n\t" << "Show Enemy Name:" << m_show_enemy_name
123  << "\n\t" << "Show Enemy Bars:" << m_show_enemy_bars
124  << "\n\t" << "Show Player Reticles:" << m_show_player_reticles
125  << "\n\t" << "Show Enemy Reticles:" << m_show_enemy_reticles
126  << "\n\t" << "Show Assist Reticles:" << m_show_assist_reticles
127  << "\n\t" << "Chat Font Size:" << m_chat_font_size;
128  }
129 
130 };
Definition: clientoptions_definitions.h:20
ReticleVisibility m_show_assist_reticles
Definition: clientoptions_definitions.h:96
int32_t svr_oo_packets
Definition: clientoptions_definitions.h:72
Definition: clientoptions_definitions.h:37
static const constexpr uint32_t class_version
Definition: clientoptions_definitions.h:62
int32_t atest0
Definition: clientoptions_definitions.h:73
ReticleVisibility m_show_enemy_name
Definition: clientoptions_definitions.h:92
int32_t alwaysmobile
Definition: clientoptions_definitions.h:67
int32_t predict
Definition: clientoptions_definitions.h:74
bool m_allow_profanity
Definition: clientoptions_definitions.h:86
int32_t atest8
Definition: clientoptions_definitions.h:73
int32_t svr_pl
Definition: clientoptions_definitions.h:72
Definition: clientoptions_definitions.h:29
bool m_show_tooltips
Definition: clientoptions_definitions.h:85
int32_t atest3
Definition: clientoptions_definitions.h:73
ReticleVisibility m_show_supergroup
Definition: clientoptions_definitions.h:89
int32_t control_debug
Definition: clientoptions_definitions.h:65
int32_t repredict
Definition: clientoptions_definitions.h:68
eType
Definition: clientoptions_definitions.h:27
bool m_fade_nav_wnd
Definition: clientoptions_definitions.h:84
bool m_mouse_invert
Definition: clientoptions_definitions.h:80
Definition: clientoptions_definitions.h:21
int32_t atest4
Definition: clientoptions_definitions.h:73
Definition: clientoptions_definitions.h:18
ReticleVisibility m_show_enemy_bars
Definition: clientoptions_definitions.h:93
Definition: clientoptions_definitions.h:33
Definition: clientoptions_definitions.h:39
ReticleVisibility m_show_enemy_reticles
Definition: clientoptions_definitions.h:95
int32_t atest1
Definition: clientoptions_definitions.h:73
ReticleVisibility
Definition: clientoptions_definitions.h:17
ReticleVisibility m_show_player_bars
Definition: clientoptions_definitions.h:91
eType type
Definition: clientoptions_definitions.h:42
uint8_t m_chat_font_size
Definition: clientoptions_definitions.h:97
int32_t svr_lag_vary
Definition: clientoptions_definitions.h:72
int32_t atest2
Definition: clientoptions_definitions.h:73
Definition: clientoptions_definitions.h:34
int32_t client_pos_id
Definition: clientoptions_definitions.h:72
bool m_chat_balloons
Definition: clientoptions_definitions.h:87
Definition: clientoptions_definitions.h:30
Definition: clientoptions_definitions.h:22
std::string name
Definition: clientoptions_definitions.h:45
Arg(int t, void *v)
Definition: clientoptions_definitions.h:41
int32_t atest7
Definition: clientoptions_definitions.h:73
Definition: clientoptions_definitions.h:35
Definition: clientoptions_definitions.h:36
std::vector< Arg > m_args
Definition: clientoptions_definitions.h:46
float speed_scale
Definition: clientoptions_definitions.h:70
void clientOptionsDump() const
Definition: clientoptions_definitions.h:107
bool m_fade_chat_wnd
Definition: clientoptions_definitions.h:83
int32_t atest9
Definition: clientoptions_definitions.h:73
int32_t svr_lag
Definition: clientoptions_definitions.h:72
void * tgt
Definition: clientoptions_definitions.h:43
int32_t selected_ent_server_index
Definition: clientoptions_definitions.h:74
Definition: clientoptions_definitions.h:19
int32_t atest5
Definition: clientoptions_definitions.h:73
int32_t no_strafe
Definition: clientoptions_definitions.h:66
ReticleVisibility m_show_archetype
Definition: clientoptions_definitions.h:88
Definition: clientoptions_definitions.h:25
Definition: clientoptions_definitions.h:50
Definition: clientoptions_definitions.h:32
ReticleVisibility m_show_player_name
Definition: clientoptions_definitions.h:90
int32_t atest6
Definition: clientoptions_definitions.h:73
float m_mouse_speed
Definition: clientoptions_definitions.h:81
bool m_first_person_view
Definition: clientoptions_definitions.h:77
int32_t neterrorcorrection
Definition: clientoptions_definitions.h:69
ClientOptions()
Definition: clientoptions_definitions.h:55
Definition: clientoptions_definitions.h:31
float m_turn_speed
Definition: clientoptions_definitions.h:82
ReticleVisibility m_show_player_reticles
Definition: clientoptions_definitions.h:94
int32_t notimeout
Definition: clientoptions_definitions.h:74