Ejemplo n.º 1
0
        /// <summary>
        /// Connects to a remote netServer.
        /// </summary>
        /// <param name="ip">The IP address of the netServer.</param>
        /// <param name="port">The port of the netServer.</param>
        /// <param name="password">The netServer password.</param>
        public void ClientConnect(string ip, int port, string password)
        {
            if (IsMPServerInitialized)
            {
                Log.Warning("Cannot connect client to server. Server is initialized.");
                return;
            }

            if (!IsMPClientInitialized)
            {
                Log.Warning("Cannot connect client to server. CLient is not initialized.");
            }

            Log.Message("Connecting client.");
            MPClient.ConnectToServer(ip, port, password);
            Log.Message("Client connected.");
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Connect to localhost on port 4230 with no password ("").
        /// </summary>
        public void ClientConnect()
        {
            if (IsMPServerInitialized)
            {
                Log.Warning("Cannot connect client to server. Server is initialized.");
                return;
            }

            if (!IsMPClientInitialized)
            {
                Log.Warning("Cannot connect client to server. CLient is not initialized.");
            }

            Log.Message("Connecting client.");
            MPClient.ConnectToServer();
            Log.Message("Client connected.");
        }