Example #1
0
 static void Main(string[] args)
 {
     Network.Client monitorClient = Network.Client.Instance;
     monitorClient.Start("Monitor", Callback, args[0], int.Parse(args[1]));
     monitorClient.SendDataToServer(new Network.NetTools.Packet {
         Name = UserName, Key = 0, Data = new KeyValuePair <Network.NetTools.PacketCommand, object>(Network.NetTools.PacketCommand.C_REGISTER, "root")
     });
     Console.ReadKey();
 }
Example #2
0
File: Net.cs Project: Codex04/AREA
 /// <summary>
 /// Send the username to the server
 /// </summary>
 /// <param name="username"></param>
 /// <returns></returns>
 public bool Login(string username)
 {
     try
     {
         Username = username;
         Network.Client monitorClient = Network.Client.Instance;
         monitorClient.SendDataToServer(new Network.NetTools.Packet {
             Name = Username, Key = 0, Data = new KeyValuePair <Network.NetTools.PacketCommand, object>(Network.NetTools.PacketCommand.C_REGISTER, "root")
         });
         return(true);
     }
     catch (Exception ex)
     {
         Console.Error.Write(ex.Message);
         return(false);
     }
 }
Example #3
0
File: Net.cs Project: Codex04/AREA
 /// <summary>
 /// Set the connection to the server
 /// </summary>
 /// <param name="ipAddress"></param>
 /// <param name="port"></param>
 /// <returns></returns>
 public bool Connection(string ipAddress, string port)
 {
     try
     {
         Network.Client monitorClient = Network.Client.Instance;
         monitorClient.Start("Monitor", Callback, ipAddress, int.Parse(port));
         monitorClient.SendDataToServer(new Network.NetTools.Packet {
             Name = null, Key = 0, Data = new KeyValuePair <Network.NetTools.PacketCommand, object>(Network.NetTools.PacketCommand.C_PING, null)
         });
     }
     catch (Exception ex)
     {
         Console.Error.Write(ex.Message);
         return(false);
     }
     return(true);
 }