コード例 #1
0
ファイル: ServerTest.cs プロジェクト: tuita520/PlanetServer
    private void OnConnection(ConnectionEvent e)
    {
        _server.EventDispatcher.ConnectionEvent -= OnConnection;

        LoginRequest request = new LoginRequest("user", "pass");

        _server.Send(request);
    }
コード例 #2
0
ファイル: Server.cs プロジェクト: tuita520/PlanetServer
    /// <summary>
    /// Login in to the server with the specified username and password.
    /// </summary>
    /// <param name="username">Username to login with.</param>
    /// <param name="password">Password for username.</param>
    public void Login(string username, string password)
    {
        _server.EventDispatcher.LoginEvent += OnLogin;

        LoginRequest login = new LoginRequest(username, password);

        _server.Send(login);
    }