示例#1
0
        static void Main(string[] args)
        {
            Console.WriteLine("[Client]");

            try
            {
                dora.Connect("127.0.0.1", 8888);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
            Console.ReadLine();
        }
示例#2
0
    //----------------------------------------------------------
    // Public interface methods for UI
    //----------------------------------------------------------

    public void OnLoginButtonClick()
    {
        enableLoginUI(false);


        doraemon = new Doraemon();
        doraemon.AddEventListener(DoraemonEvent.CONNECTION, OnConnection);
        doraemon.AddEventListener(DoraemonEvent.CONNECTION_LOST, OnConnectionLost);
        doraemon.AddEventListener(DoraemonEvent.LOGIN, OnLogin);
        doraemon.AddEventListener(DoraemonEvent.LOGIN_ERROR, OnLoginError);
        doraemon.AddEventListener(DoraemonEvent.ROOM_JOIN, OnRoomJoin);
        doraemon.AddEventListener(DoraemonEvent.ROOM_JOIN_ERROR, OnRoomJoinError);

        // Connect to SFS2X
        doraemon.Connect(Host, TcpPort);
    }