C# need some help to send packets

01/13/2018 22:01 x1stvanx#1
Hello, anyone can help me with small example, how can i send packets to the server?
01/15/2018 16:19 #HB#2
Code:
string message = "Hey everyone, test test";
            Packet send_all = new Packet(0x7025);
            send_all.WriteUInt8(0x03);
            send_all.WriteUInt8(0x00);
            send_all.WriteAscii(message);
            Agent.Send(send_all);
This one sends chat to all players, (all) chat... its that simple ^^
01/16/2018 09:42 x1stvanx#3
And how can i connect my client to the server and send this packet? i know only Silkroad is using TCP, but no more.
01/16/2018 15:15 KingDollar#4
you should connect to the server first using tcp client or socket what ever you need
and with ssa you could send packets
01/17/2018 10:46 x1stvanx#5
I found this code in older thread:

Code:
 

private static SimpleSilkroadClient client;
private static Thread thSessionUpdater;

        static void Main(string[] args)
        {
            Console.Title = "SampleClient";

            client = new SimpleSilkroadClient();
            client.OnCommandReceived += Client_OnCommandReceived;
            client.Connect("127.0.0.1", 39000);

            thSessionUpdater = new Thread(ThreadedSessionUpdating);
            thSessionUpdater.Start();

            Console.WriteLine("Press any key to exit...");
            Console.ReadKey();
        }

        private static void ThreadedSessionUpdating()
        {
            while (true)
            {
                if (client != null)
                    client.Update();
                System.Threading.Thread.Sleep(1);
            }
        }

        private static void Client_OnCommandReceived(Packet packet)
        {
            //PACKET HANDLING
            if (packet.Opcode == 0x1234) //SAMPLE OPCODE
            {
                string message = packet.ReadAscii();

                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("Message: {0}", message);
                Console.ResetColor();

                Packet sampleResponse = new Packet(0x1234);
                sampleResponse.WriteAscii("Hello. It's nice being connected to you :)");
                client.Send(sampleResponse);
            }

        }
if i put the gameserver ip and port this will connect to it?
01/18/2018 23:11 #HB#6
Well, its better to look at a clientless source code cuz you will need SilkroadSecurityAPI.dll too

Here you are, a clientless arena source : [Only registered and activated users can see links. Click Here To Register...]