예제 #1
0
    static void Main(string[] args)
    {
        string host = "188.40.137.215";
        int    port = 23323;

        //string host = "99.229.37.128";
        // int port = 9990;
        RPCTest = DoSomething;

        RPCTest.Invoke(5, 4);
        byte    rpcID;
        RPCTest test  = new RPCTest(2);
        RPCTest test2 = new RPCTest(4);
        Type    type  = typeof(RPCTest);
        int     x1    = 5;
        int     x2    = 3;

        object[] obj = { 1, 2 };

        MethodInfo[] methods = type.GetMethods();

        for (int i = 0; i < methods.Count(); i++)
        {
            if (methods[i].IsDefined(typeof(MMORPC), out rpcID))
            {
                Console.WriteLine("Registerd Method with RPC ID =  " + rpcID);
                methods[i].Invoke(test, obj);
            }
        }
        Console.WriteLine("Connected to Server [Host = " + host + " ] [Port = " + port + Environment.NewLine);
        clientCore.InitializeClient(host, port);

        clientCore.onMovementSync  += OnMovementSync;
        clientCore.onChatResponse  += onChatResponse;
        clientCore.onLoginResponse += OnLoginResponse;
        clientCore.Connect();
        Thread thread = new Thread(new ThreadStart(KeyListen));

        thread.Start();
        while (true)
        {
            switch (Console.ReadLine().ToLower())
            {
            case "l": tbLogin_Click(); break;

            case "m": new Thread(new ThreadStart(SpamMovePackets)).Start(); break;
            }
        }
    }
예제 #2
0
 private void btnConnect_Click(object sender, EventArgs e)
 {
     this.rtbConsole.AppendText("Connected to Server [Host = " + host + " ] [Port = " + port + Environment.NewLine);
     clientCore.Connect();
     Logger.LogToFile("Report", "test");
 }