~ubuntu-branches/debian/stretch/assaultcube-data/stretch

« back to all changes in this revision

Viewing changes to source/CubeMS/App_Code/Log.cs

  • Committer: Bazaar Package Importer
  • Author(s): Gonéri Le Bouder, Ansgar Burchardt, Gonéri Le Bouder
  • Date: 2010-04-02 23:37:55 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20100402233755-kf74fxwlu634o6vg
Tags: 1.0.4+repack1-1
[ Ansgar Burchardt ]
* debian/control: fix typo in short description

[ Gonéri Le Bouder ]
* Upgrade to 1.0.4
* bump standards-version to 3.8.4
* Add Depends: ${misc:Depends} just to avoid a lintian warning
* Add a debian/source/format file for the same reason

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
using System;
 
2
using System.Data;
 
3
using System.Configuration;
 
4
using System.Web;
 
5
using System.Web.Security;
 
6
using System.Web.UI;
 
7
using System.Web.UI.WebControls;
 
8
using System.Web.UI.WebControls.WebParts;
 
9
using System.Web.UI.HtmlControls;
 
10
 
 
11
using System.IO;
 
12
using System.Xml;
 
13
using System.Net;
 
14
using System.Data.SqlClient;
 
15
 
 
16
/// <summary>
 
17
/// Summary description for Log
 
18
/// </summary>
 
19
public class Log
 
20
{
 
21
    public enum EventType : int
 
22
    {
 
23
        RegistrationFailed = 0,
 
24
        RegistrationSuceeeded,
 
25
        RetrieveServers,
 
26
        Exception,
 
27
    }
 
28
 
 
29
    public void AddEvent(EventType type, string data, IPEndPoint address)
 
30
    {
 
31
        SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["CubeMS"].ConnectionString as string);
 
32
        SqlCommand cmd = new SqlCommand("AddEvent", con);
 
33
        cmd.CommandType = CommandType.StoredProcedure;
 
34
        cmd.Parameters.AddWithValue("Type", type);
 
35
        cmd.Parameters.AddWithValue("Data", data);
 
36
        cmd.Parameters.AddWithValue("IP", IPTools.IPToInt(address.Address));
 
37
        con.Open();
 
38
        cmd.ExecuteNonQuery();
 
39
        con.Close();
 
40
    }
 
41
}