diff --git a/Sample/Sample.csproj b/Sample/Sample.csproj index 9946435..26ea748 100644 --- a/Sample/Sample.csproj +++ b/Sample/Sample.csproj @@ -57,6 +57,7 @@ + Web.config @@ -74,6 +75,13 @@ Global.asax + + Sessions.aspx + ASPXCodeBehind + + + Sessions.aspx + store.ashx diff --git a/Sample/Sessions.aspx b/Sample/Sessions.aspx new file mode 100644 index 0000000..6286dbb --- /dev/null +++ b/Sample/Sessions.aspx @@ -0,0 +1,16 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Sessions.aspx.cs" Inherits="Sample.Sessions" %> + + + + + + + + +
+
+ +
+
+ + diff --git a/Sample/Sessions.aspx.cs b/Sample/Sessions.aspx.cs new file mode 100644 index 0000000..a35d038 --- /dev/null +++ b/Sample/Sessions.aspx.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using GamestatsBase; + +namespace Sample +{ + public partial class Sessions : System.Web.UI.Page + { + protected void Page_Load(object sender, EventArgs e) + { + GamestatsSessionManager gsm = GamestatsSessionManager.FromContext(Context); + StringBuilder builder = new StringBuilder(); + builder.Append("Active sessions ("); + builder.Append(gsm.Sessions.Count); + builder.Append("):
"); + foreach (KeyValuePair session in gsm.Sessions) + { + builder.Append("Game ID: "); + builder.Append(session.Value.GameId); + builder.Append("
PID: "); + builder.Append(session.Value.PID); + builder.Append("
Token: "); + builder.Append(session.Value.Token); + builder.Append("
Hash: "); + builder.Append(session.Value.Hash); + builder.Append("
URL: "); + builder.Append(session.Value.URL); + builder.Append("
Expires: "); + builder.Append(session.Value.ExpiryDate); + builder.Append("

"); + } + + litDebug.Text = builder.ToString(); + } + } +} \ No newline at end of file diff --git a/Sample/Sessions.aspx.designer.cs b/Sample/Sessions.aspx.designer.cs new file mode 100644 index 0000000..d1b17ee --- /dev/null +++ b/Sample/Sessions.aspx.designer.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Sample { + + + public partial class Sessions { + + /// + /// form1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// litDebug control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litDebug; + } +} diff --git a/Sample/tetrisds/store.ashx.cs b/Sample/tetrisds/store.ashx.cs index 283c15b..5f59624 100644 --- a/Sample/tetrisds/store.ashx.cs +++ b/Sample/tetrisds/store.ashx.cs @@ -23,6 +23,9 @@ namespace Sample.tetrisds Buffer.BlockCopy(nameBytes, 0, nameChars, 0, nameBytes.Length); String name = new String(nameChars); + + // Since the correct response is actually blank, we don't need to + // write anything to it here. } } }