File: arsc.java

package info (click to toggle)
moodle 1.4.4.dfsg.1-3sarge1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 57,876 kB
  • ctags: 29,496
  • sloc: php: 271,617; sql: 5,084; xml: 702; perl: 638; sh: 403; java: 283; makefile: 42; pascal: 21
file content (90 lines) | stat: -rw-r--r-- 1,951 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
import java.awt.*;
import java.awt.event.*;
import java.net.*;
import java.io.*;
import java.sql.*;
import java.util.*;

public class arsc
{
 static String DBUrl = "jdbc:mysql://194.231.30.146/arscdev?user=user&password=password";
 static String arsc_sid = "dhndewbz2798z23dzdewdew";

 public static void main(String[] args)
 {
  MainFrameGui gui = new MainFrameGui();
  gui.setSize(480,300);
  gui.setVisible(true);
  
  try
  {
   try
   {
    Class.forName("org.gjt.mm.mysql.Driver").newInstance();
   }
   catch (Exception e)
   {
    System.err.println(e.toString());
   }
   
   Connection conn = null;
   Statement stmt = null;
   PreparedStatement pStmt = null;
  
   conn = DriverManager.getConnection(DBUrl);
   stmt = conn.createStatement();
   stmt.executeUpdate("INSERT INTO arsc_users (id, user, lastping, ip, room, language, version, level, sid, lastmessageping) VALUES ('', 'javapgod', '', '', 'lounge', 'german', 'sockets', '1', 'abcdefg', '') ");
  }
  catch (SQLException sqlEx) { System.err.println(sqlEx.toString()); }

  try
  {
   Thread.sleep(5000);
  }
  catch (InterruptedException e)
  {
   //nix
  }

  try
  {
   Socket sock = new Socket("194.231.30.146", 12345);
   BufferedReader in = new BufferedReader(new InputStreamReader(sock.getInputStream()));
   OutputStream out = sock.getOutputStream();
   String line = "arsc_sid=abcdefg HTTP";
   out.write(line.getBytes());
   out.write('\r');
   out.write('\n');
   String blubb = new String();
   while ((blubb = in.readLine()) != null)
   {
    gui.messages.append(blubb);
   }
   in.close();
   out.close();
   sock.close();
  }
  catch (IOException e)
  {
   System.err.println(e.toString());
   //System.exit;
  }
  
  while (true)
  {
   try
   {
    Thread.sleep(500);
   }
   catch (InterruptedException e)
   {
    //nix
   }
   //gui.messages.append("blah...\n");
   if (gui.cb.getState() == true)
   {
    gui.messages.setCaretPosition(99999999);
   }
  }
 }
}