<commit_before>// Copyright 2016 <NAME> (Raven), L3nn0x
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http ://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef _CMAPSERVER_H_
#define _CMAPSERVER_H_

#include <optional>

#include "croseserver.h"
#include "entitysystem.h"
#include "script_loader.h"

class CMapServer : public RoseCommon::CRoseServer {
 public:
  CMapServer(bool _isc = false, int16_t mapidx = -1);
  virtual ~CMapServer();

  int16_t GetMapIDX() const { return map_idx_; }

  void update(double dt);

  static void SendPacket(const std::shared_ptr<CMapClient>& sender, RoseCommon::CRoseServer::eSendType type,
                         RoseCommon::CRosePacket& _buffer);
  static void SendPacket(const CMapClient& sender, RoseCommon::CRoseServer::eSendType type,
                         RoseCommon::CRosePacket& _buffer);
 
  constexpr LuaScript::ScriptLoader& get_script_loader() noexcept { return script_loader_.value(); }

 protected:
  virtual void OnAccepted(std::unique_ptr<Core::INetwork> _sock);

  enum class ServerType : int8_t { MASTER_NODE = -1, WORKER_THREAD };
  int16_t map_idx_;
  uint32_t client_count_;
  uint32_t server_count_;
  std::shared_ptr<EntitySystem> entity_system_;
  std::optional<LuaScript::ScriptLoader> script_loader_;
};

#endif<commit_msg>Update cmapserver.h<commit_after>// Copyright 2016 <NAME> (Raven), L3nn0x
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http ://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef _CMAPSERVER_H_
#define _CMAPSERVER_H_

#include <optional>

#include "croseserver.h"
#include "entitysystem.h"
#include "script_loader.h"

class CMapServer : public RoseCommon::CRoseServer {
 public:
  CMapServer(bool _isc = false, int16_t mapidx = -1);
  virtual ~CMapServer();

  int16_t GetMapIDX() const { return map_idx_; }

  void update(double dt);

  static void SendPacket(const std::shared_ptr<CMapClient>& sender, RoseCommon::CRoseServer::eSendType type,
                         RoseCommon::CRosePacket& _buffer);
  static void SendPacket(const CMapClient& sender, RoseCommon::CRoseServer::eSendType type,
                         RoseCommon::CRosePacket& _buffer);
 
  inline LuaScript::ScriptLoader& get_script_loader() noexcept { return script_loader_.value(); }

 protected:
  virtual void OnAccepted(std::unique_ptr<Core::INetwork> _sock);

  enum class ServerType : int8_t { MASTER_NODE = -1, WORKER_THREAD };
  int16_t map_idx_;
  uint32_t client_count_;
  uint32_t server_count_;
  std::shared_ptr<EntitySystem> entity_system_;
  std::optional<LuaScript::ScriptLoader> script_loader_;
};

#endif
{'fraction_non_alphanumeric': 0.10019982871824151, 'fraction_numerical': 0.013131601484441906, 'mean_word_length': 4.3660030627871365, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5873289', 'n_tokens_mistral': 1089, 'n_tokens_neox': 1038, 'n_words': 330}