/// <summary>
    ///		Starts the network connection.
    /// </summary>
    protected virtual void Initialize()
    {
        try
        {
            Debug.Log("Initializing NetworkManager");
            SaveLoad.SavePath    = Application.persistentDataPath;
            SaveLoad.Extention   = ".sprc";
            SaveLoad.EncryptData = false;
            ensureFileDirectories.Invoke();

            if (udpMaster == null || !udpMaster.IsInitialized)
            {
                udpMaster = new AppliedUDPMaster <NetworkMessage>();
                udpMaster.Initialize("1.1.1.1", PortOut, PortIn);
                udpMaster.AddListener(this);
            }

            networkLogger = new NetworkLogger <NetworkMessage>()
            {
                LogFileName = "NetworkLogs.sprc"
            };
            networkLogger.Initialize(udpMaster);
        }
        catch (Exception ex)
        {
            Debug.LogError(ex.Message);
        }
    }
コード例 #2
0
        public MainWindow()
        {
            this.Closing += new System.ComponentModel.CancelEventHandler(MainWindow_Closing);
            InitializeComponent();

            _networkLogs = new NetworkLogger(this.Dispatcher);
            _networkLogs.SessionStart += new NetworkLoggerSessionUpdatedHandler(network_NetworkSessionStart);
            _networkLogs.SessionEnd   += new NetworkLoggerSessionUpdatedHandler(network_NetworkSessionEnd);
            _networkLogs.Initialize();

            _pluginLogs = new PluginLogger(this.Dispatcher);
            _pluginLogs.ActiveLogChanged += new PluginLoggerActiveLogChangedHandler(_pluginLogs_ActiveLogChanged);
            _pluginLogs.Initialize();
        }