ManaPlus
Functions
EAthena::GeneralRecv Namespace Reference

Functions

void processConnectionProblem (Net::MessageIn &msg)
 
void processMapNotFound (Net::MessageIn &msg)
 

Function Documentation

◆ processConnectionProblem()

void EAthena::GeneralRecv::processConnectionProblem ( Net::MessageIn msg)

Definition at line 42 of file generalrecv.cpp.

43 {
44  const uint8_t code = msg.readUInt8("flag");
45  logger->log("Connection problem: %u", CAST_U32(code));
46 
47  switch (code)
48  {
49  case 0:
50  // TRANSLATORS: error message
51  errorMessage = _("Authentication failed.");
52  break;
53  case 1:
54  // TRANSLATORS: error message
55  errorMessage = _("No servers available.");
56  break;
57  case 2:
58  if (client->getState() == State::GAME)
59  {
60  // TRANSLATORS: error message
61  errorMessage = _("Someone else is trying to use "
62  "this account.");
63  }
64  else
65  {
66  // TRANSLATORS: error message
67  errorMessage = _("This account is already logged in.");
68  }
69  break;
70  case 3:
71  // TRANSLATORS: error message
72  errorMessage = _("Speed hack detected.");
73  break;
74  case 4:
75  // TRANSLATORS: error message
76  errorMessage = _("Server full.");
77  break;
78  case 5:
79  // TRANSLATORS: error message
80  errorMessage = _("Sorry, you are underaged.");
81  break;
82  case 8:
83  // TRANSLATORS: error message
84  errorMessage = _("Duplicated login.");
85  break;
86  case 9:
87  // TRANSLATORS: error message
88  errorMessage = _("To many connections from same ip.");
89  break;
90  case 10:
91  // TRANSLATORS: error message
92  errorMessage = _("Not paid for this time.");
93  break;
94  case 11:
95  // TRANSLATORS: error message
96  errorMessage = _("Pay suspended.");
97  break;
98  case 12:
99  // TRANSLATORS: error message
100  errorMessage = _("Pay changed.");
101  break;
102  case 13:
103  // TRANSLATORS: error message
104  errorMessage = _("Pay wrong ip.");
105  break;
106  case 14:
107  // TRANSLATORS: error message
108  errorMessage = _("Pay game room.");
109  break;
110  case 15:
111  // TRANSLATORS: error message
112  errorMessage = _("Disconnect forced by GM.");
113  break;
114  case 16:
115  case 17:
116  // TRANSLATORS: error message
117  errorMessage = _("Ban japan refuse.");
118  break;
119  case 18:
120  // TRANSLATORS: error message
121  errorMessage = _("Remained other account.");
122  break;
123  case 100:
124  // TRANSLATORS: error message
125  errorMessage = _("Ip unfair.");
126  break;
127  case 101:
128  // TRANSLATORS: error message
129  errorMessage = _("Ip count all.");
130  break;
131  case 102:
132  // TRANSLATORS: error message
133  errorMessage = _("Ip count.");
134  break;
135  case 103:
136  case 104:
137  // TRANSLATORS: error message
138  errorMessage = _("Memory.");
139  break;
140  case 105:
141  // TRANSLATORS: error message
142  errorMessage = _("Han valid.");
143  break;
144  case 106:
145  // TRANSLATORS: error message
146  errorMessage = _("Ip limited access.");
147  break;
148  case 107:
149  // TRANSLATORS: error message
150  errorMessage = _("Over characters list.");
151  break;
152  case 108:
153  // TRANSLATORS: error message
154  errorMessage = _("Ip blocked.");
155  break;
156  case 109:
157  // TRANSLATORS: error message
158  errorMessage = _("Invalid password count.");
159  break;
160  case 110:
161  // TRANSLATORS: error message
162  errorMessage = _("Not allowed race.");
163  break;
164  case 113:
165  // TRANSLATORS: error message
166  errorMessage = _("Access restricted in hours 00:00 to 06:00.");
167  break;
168  case 115:
169  // TRANSLATORS: error message
170  errorMessage = _("You was banned.");
171  break;
172  default:
173  // TRANSLATORS: error message
174  errorMessage = _("Unknown connection error.");
175  break;
176  }
178 }
#define CAST_U32
Definition: cast.h:31
void setState(const StateT state)
Definition: client.h:66
StateT getState() const
Definition: client.h:69
void log(const char *const log_text,...)
Definition: logger.cpp:269
Client * client
Definition: client.cpp:118
std::string errorMessage
Definition: client.cpp:116
#define _(s)
Definition: gettext.h:35
Logger * logger
Definition: logger.cpp:89
bool msg(InputEvent &event)
Definition: chat.cpp:39
@ GAME
Definition: state.h:49
@ ERROR
Definition: state.h:35

References _, CAST_U32, client, State::ERROR, errorMessage, State::GAME, Client::getState(), Logger::log(), logger, Actions::msg(), and Client::setState().

◆ processMapNotFound()

void EAthena::GeneralRecv::processMapNotFound ( Net::MessageIn msg)

Definition at line 180 of file generalrecv.cpp.

181 {
182  const int sz = msg.readInt16("len") - 4;
183  msg.readString(sz, "map name?");
184  // TRANSLATORS: error message
185  errorMessage = _("Map not found");
187 }

References _, client, State::ERROR, errorMessage, Actions::msg(), and Client::setState().