<commit_before>﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using LiteNetLib;
using LiteNetLib.Utils;
using LiteNetLibHighLevel.Utils;

namespace LiteNetLibHighLevel
{
    public class LiteNetLibServer : INetEventListener
    {
        public LiteNetLibManager Manager { get; protected set; }
        public NetManager NetManager { get; protected set; }

        public LiteNetLibServer(LiteNetLibManager manager, int maxConnections, string connectKey)
        {
            this.Manager = manager;
            NetManager = new NetManager(this, maxConnections, connectKey);
        }

        public void OnNetworkError(NetEndPoint endPoint, int socketErrorCode)
        {
            if (Manager.LogError) Debug.LogError("[" + Manager.name + "] LiteNetLibServer::OnNetworkError endPoint: " + endPoint + " socketErrorCode " + socketErrorCode);
            Manager.OnServerNetworkError(endPoint, socketErrorCode);
        }

        public void OnNetworkLatencyUpdate(NetPeer peer, int latency)
        {
        }

        public void OnNetworkReceive(NetPeer peer, NetDataReader reader)
        {
            Manager.ServerReadPacket(peer, reader);
        }

        public void OnNetworkReceiveUnconnected(NetEndPoint remoteEndPoint, NetDataReader reader, UnconnectedMessageType messageType)
        {
            if (messageType == UnconnectedMessageType.DiscoveryRequest)
                Manager.OnServerReceivedDiscoveryRequest(remoteEndPoint, StringBytesConverter.ConvertToString(reader.Data));
        }

        public void OnPeerConnected(NetPeer peer)
        {
            if (Manager.LogInfo) Debug.Log("[" + Manager.name + "] LiteNetLibServer::OnPeerConnected peer.ConnectId: " + peer.ConnectId);
            Manager.AddPeer(peer);
            Manager.OnServerConnected(peer);
        }

        public void OnPeerDisconnected(NetPeer peer, DisconnectInfo disconnectInfo)
        {
            if (Manager.LogInfo) Debug.Log("[" + Manager.name + "] LiteNetLibServer::OnPeerDisconnected peer.ConnectId: " + peer.ConnectId + " disconnectInfo.Reason: " + disconnectInfo.Reason);
            Manager.RemovePeer(peer);
            Manager.OnServerDisconnected(peer, disconnectInfo);
        }
    }
}
<commit_msg>Remove some unnessary codes<commit_after>﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using LiteNetLib;
using LiteNetLib.Utils;
using LiteNetLibHighLevel.Utils;

namespace LiteNetLibHighLevel
{
    public class LiteNetLibServer : INetEventListener
    {
        public LiteNetLibManager Manager { get; protected set; }
        public NetManager NetManager { get; protected set; }

        public LiteNetLibServer(LiteNetLibManager manager, int maxConnections, string connectKey)
        {
            Manager = manager;
            NetManager = new NetManager(this, maxConnections, connectKey);
        }

        public void OnNetworkError(NetEndPoint endPoint, int socketErrorCode)
        {
            if (Manager.LogError) Debug.LogError("[" + Manager.name + "] LiteNetLibServer::OnNetworkError endPoint: " + endPoint + " socketErrorCode " + socketErrorCode);
            Manager.OnServerNetworkError(endPoint, socketErrorCode);
        }

        public void OnNetworkLatencyUpdate(NetPeer peer, int latency)
        {
        }

        public void OnNetworkReceive(NetPeer peer, NetDataReader reader)
        {
            Manager.ServerReadPacket(peer, reader);
        }

        public void OnNetworkReceiveUnconnected(NetEndPoint remoteEndPoint, NetDataReader reader, UnconnectedMessageType messageType)
        {
            if (messageType == UnconnectedMessageType.DiscoveryRequest)
                Manager.OnServerReceivedDiscoveryRequest(remoteEndPoint, StringBytesConverter.ConvertToString(reader.Data));
        }

        public void OnPeerConnected(NetPeer peer)
        {
            if (Manager.LogInfo) Debug.Log("[" + Manager.name + "] LiteNetLibServer::OnPeerConnected peer.ConnectId: " + peer.ConnectId);
            Manager.AddPeer(peer);
            Manager.OnServerConnected(peer);
        }

        public void OnPeerDisconnected(NetPeer peer, DisconnectInfo disconnectInfo)
        {
            if (Manager.LogInfo) Debug.Log("[" + Manager.name + "] LiteNetLibServer::OnPeerDisconnected peer.ConnectId: " + peer.ConnectId + " disconnectInfo.Reason: " + disconnectInfo.Reason);
            Manager.RemovePeer(peer);
            Manager.OnServerDisconnected(peer, disconnectInfo);
        }
    }
}

{'fraction_non_alphanumeric': 0.08335175768295379, 'fraction_numerical': 0.0, 'mean_word_length': 3.007085916740478, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '3072081', 'n_tokens_mistral': 1192, 'n_tokens_neox': 1173, 'n_words': 241}