c# LF help

06/03/2018 03:18 moddypepo#1
Hello guys hope u r all fine
first i'm not professional in c# i used to make some programs that help me in dev only , as a way to reduce time
PS : i'm lazy :D

i tried to make a bat laucher.exe that save the name of sframe and argument and send the argument to the sframe to start the game as away to stop editing the *.txt files " simple one "

now i'm looking for a way to make the program send codes to the gameserver or to Auth as Hawasman @[Only registered and activated users can see links. Click Here To Register...] made one "" but i think he didn't make it in c# ""
Ps : codes like (start_service / #refresh("script") ....etc)

BTW if anyone can help i want to contact with him/her :D or u can contact with me faster from here [Only registered and activated users can see links. Click Here To Register...]
Ty all for reading ♥ ♥
:heyguys:
06/03/2018 04:04 Dark Blaze#2
Connect to the game server console and send the commands.
06/05/2018 15:34 moddypepo#3
Quote:
Originally Posted by Dark Blaze View Post
Connect to the game server console and send the commands.
Can u help with the code plz ? :handsdown::handsdown:
06/05/2018 19:47 Dark Blaze#4
What do you need help with?
06/05/2018 21:26 DARK-REVO#5
This is Example Console C# class for console connect and send commands.

Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Sockets;
using System.IO;
using System.Threading;

namespace ConsoleExampletool{
    class Client{

        StreamReader input = null;

        public Client(StreamReader input){
            this.input = input;
        }

        public void Run(){
            String line;
            while ((line=input.ReadLine())!=null){
                Console.Write(line+"\r\n");
           

            }
        }
     

        static void Main(string[] args){
            Console.Title = "EC Tool";
            Console.ForegroundColor = ConsoleColor.Blue;
            Console.WindowWidth = (Console.LargestWindowWidth * 6 / 10);
            Console.WindowHeight = (Console.LargestWindowHeight * 8 / 10);
       

            Console.Write("\r\n");
            Console.Write("                          ...::::EXample Console::::...");
          
        
            Console.Write("*-history -->To get commands history.");
            Console.Write("\r\n");
            Console.Write("*-set --> to set a new value.");
            Console.Write("\r\n");
            Console.Write("*-getcwd -->to get the working dir.");
            Console.Write("\r\n");
            Console.Write("*-list --> to get the operation list.");
            Console.Write("\r\n");

                Console.Write("Server IP: ");
                string host=Console.ReadLine();
                Console.Write("Port: ");
                int port;
                try{
                    port=int.Parse(Console.ReadLine());
                }
                catch(Exception){
                    Console.WriteLine("Wrong parameter. Using 4502 instead");
                    port=4515;
                }
                TcpClient socket=null;
                try{
                    socket = new TcpClient(host, port);
                }
                catch(SocketException){
                    Console.WriteLine("Unknown host - " + host + ". Quitting");
                    Console.ReadKey();
                    Environment.Exit(0);
                }
                NetworkStream stream = socket.GetStream();
                StreamWriter output = new StreamWriter(stream);
                StreamReader input = new StreamReader(stream);

                Client cliobj = new Client(input);
                Thread t = new Thread(new ThreadStart(cliobj.Run));
                t.Start();

                while(true){
                    output.Write(Console.ReadLine()+"\r\n");
                    output.Flush();
                }
        }

        public static string line { get; set; }

        public static string text { get; set; }

        public static object Write { get; set; }
    }
}