@@ -162,18 +162,18 @@ class AuthHandlerTable
162162 }
163163
164164private:
165- // perfect hash function for all valid values of eAuthCmd
165+ // perfect hash function for all valid client to server values of eAuthCmd
166166 inline static constexpr std::size_t GetOpcodeArrayIndex (eAuthCmd c)
167167 {
168- return (c & 0x7 ) + ((c & 0x10 ) >> 2 ) + ((c & 0x20 ) >> 5 );
168+ return (c & 0x7 ) + ((c & 0x10 ) >> 2 ) - ((c & 0x20 ) >> 5 );
169169 }
170170
171171 constexpr void InitializeHandler (eAuthCmd cmd, AuthStatus status, std::size_t packetSize, bool (*handler)(AuthSession*))
172172 {
173173 _handlers[GetOpcodeArrayIndex (cmd)] = { .cmd = cmd, .status = status, .packetSize = packetSize, .handler = handler, };
174174 }
175175
176- std::array<AuthHandler, 10 > _handlers;
176+ std::array<AuthHandler, 8 > _handlers;
177177} inline constexpr Handlers;
178178
179179void AccountInfo::LoadResult (Field* fields)
@@ -209,7 +209,7 @@ AuthSession::AuthSession(Trinity::Net::IoContextTcpSocket&& socket) : Socket(std
209209void AuthSession::Start ()
210210{
211211 // build initializer chain
212- std::array<std::shared_ptr<Trinity::Net::SocketConnectionInitializer>, 3 > initializers =
212+ std::array<std::shared_ptr<Trinity::Net::SocketConnectionInitializer>, 2 > initializers =
213213 { {
214214 std::make_shared<Trinity::Net::IpBanCheckConnectionInitializer<AuthSession>>(this ),
215215 std::make_shared<Trinity::Net::ReadConnectionInitializer<AuthSession>>(this ),
0 commit comments