void SessionTimeoutMessage(string text) { m_buffer = new OutputBuffer(null); m_buffer.OutputText(text); m_buffer.AddJavaScriptToBuffer("sessionTimeout"); ClearJavaScriptBuffer(); }
public PlayerHandler(string filename, OutputBuffer buffer, string gameId, IUser user) { m_filename = filename; m_gameId = gameId; m_user = user; m_buffer = buffer; m_listHandler = new InterfaceListHandler(buffer); }
protected void Page_Load(object sender, EventArgs e) { // We store the game in the Session, but use a dictionary keyed by GUIDs which // are stored in the ViewState. This allows the same user in the same browser // to open multiple games in different browser tabs. if (Games == null) { Games = new Dictionary<string, PlayerHandler>(); } if (OutputBuffers == null) { OutputBuffers = new Dictionary<string, OutputBuffer>(); } if (Resources == null) { Resources = new SessionResources(); } m_gameId = (string)ViewState["GameId"]; if (m_gameId == null) { m_gameId = Guid.NewGuid().ToString(); ViewState["GameId"] = m_gameId; } if (Page.IsPostBack) { if (Games.ContainsKey(m_gameId)) { m_player = Games[m_gameId]; } if (!OutputBuffers.ContainsKey(m_gameId)) { // TO DO: Think this only ever happens while debugging? return; } m_buffer = OutputBuffers[m_gameId]; } else { m_buffer = new OutputBuffer(); OutputBuffers.Add(m_gameId, m_buffer); bool saveVisible = IsLoggedIn && (!string.IsNullOrEmpty(Request["id"]) || !string.IsNullOrEmpty(Request["load"])); m_buffer.AddJavaScriptToBuffer("showSaveButton", new BooleanParameter(saveVisible)); } }
protected void Page_Load(object sender, EventArgs e) { // We store the game in the Session, but use a dictionary keyed by GUIDs which // are stored in the ViewState. This allows the same user in the same browser // to open multiple games in different browser tabs. if (Games == null) { Games = new Dictionary <string, PlayerHandler>(); } if (OutputBuffers == null) { OutputBuffers = new Dictionary <string, OutputBuffer>(); } if (Resources == null) { Resources = new SessionResources(); } m_gameId = (string)ViewState["GameId"]; if (m_gameId == null) { m_gameId = Guid.NewGuid().ToString(); ViewState["GameId"] = m_gameId; } if (Page.IsPostBack) { if (Games.ContainsKey(m_gameId)) { m_player = Games[m_gameId]; } if (!OutputBuffers.ContainsKey(m_gameId)) { // TO DO: Think this only ever happens while debugging? return; } m_buffer = OutputBuffers[m_gameId]; } else { m_buffer = new OutputBuffer(m_gameId); OutputBuffers.Add(m_gameId, m_buffer); m_buffer.AddJavaScriptToBuffer("setOutputBufferId", new StringParameter(m_gameId)); } }
public PlayerHandler(string filename, OutputBuffer buffer) { m_filename = filename; m_buffer = buffer; m_listHandler = new InterfaceListHandler(buffer); }
void SessionTimeoutMessage(string text) { m_buffer = new OutputBuffer(null); m_buffer.OutputText(text); m_buffer.AddJavaScriptToBuffer("sessionTimeout"); ClearJavaScriptBuffer(); }
protected void Page_Load(object sender, EventArgs e) { string style = Request["style"]; if (!string.IsNullOrEmpty(style)) { if (style == "fluid") { styleLink.Href = "fluid.css"; } } // We store the game in the Session, but use a dictionary keyed by GUIDs which // are stored in the ViewState. This allows the same user in the same browser // to open multiple games in different browser tabs. m_gamesInSession = (Dictionary<string, PlayerHandler>)Session["Games"]; if (m_gamesInSession == null) { m_gamesInSession = new Dictionary<string, PlayerHandler>(); Session["Games"] = m_gamesInSession; } Dictionary<string, OutputBuffer> outputBuffersInSession = (Dictionary<string, OutputBuffer>)Session["OutputBuffers"]; if (outputBuffersInSession == null) { outputBuffersInSession = new Dictionary<string, OutputBuffer>(); Session["OutputBuffers"] = outputBuffersInSession; } m_gameId = (string)ViewState["GameId"]; if (m_gameId == null) { m_gameId = Guid.NewGuid().ToString(); ViewState["GameId"] = m_gameId; } if (Page.IsPostBack) { if (m_gamesInSession.ContainsKey(m_gameId)) { m_player = m_gamesInSession[m_gameId]; } if (!outputBuffersInSession.ContainsKey(m_gameId)) { // TO DO: Think this only ever happens while debugging? return; } m_buffer = outputBuffersInSession[m_gameId]; } else { m_buffer = new OutputBuffer(); outputBuffersInSession.Add(m_gameId, m_buffer); } }
public PlayerHandler(string filename, OutputBuffer buffer) { m_filename = filename; m_buffer = buffer; m_listHandler = new InterfaceListHandler(buffer); }
public InterfaceListHandler(OutputBuffer buffer) { m_buffer = buffer; }