Exemple #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;
            }
        }
    }
Exemple #2
0
        public Form1()
        {
            InitializeComponent();
            Ping();
            clientCore.InitializeClient(host, port);
            clientCore.onChatResponse            += onChatResponse;
            clientCore.onMovementSync            += OnMovementSync;
            clientCore.clientSocket.onConnection += onConnection;
            //clientCore.onPlayerDataRecv += OnPlayerDataRecv;
            clientCore.onLoginResponse += OnLoginResponse;
            rtbChatWindow.Text          = ">> Welcome To ECE496 Chatroom\n";
            rtbConsole.Text             = ">> Command Line\n";
            rtbReceivedPacket.Text      = "<< Packet Receive Trunk\n";
            StartListening();
            Thread thread = new Thread(new ThreadStart(GetPackets));

            thread.Start();
        }