/// <summary> /// Modifies the hand page index with a given mode and sends the current hand page of this user. /// </summary> /// <param name="szMode">'How-to' modify the hand page index.</param> public void sendHandStrip(string szMode) { if (this.itemStripHandler != null) { this.itemStripHandler.changeHandStripPage(szMode); // Switch! serverMessage Message = new serverMessage(140); // "BL" Message.Append(this.itemStripHandler.getHandItemCasts()); Message.appendChar(13); Message.Append(this.itemStripHandler.handItemCount); this.gameConnection.sendMessage(Message); } }
/// <summary> /// Gets the transactions (credit log) of a user on given user session and sends it to the session's game connection. /// </summary> /// <param name="Session">The Woodpecker.Sessions.Session object to get the transaction for and to send the message to.</param> public void sendTransactions(ref Session Session) { if (Session.User == null) return; serverMessage Message = new serverMessage(209); // "CQ" Database Database = new Database(false, true); Database.addParameterWithValue("userid", Session.User.ID); Database.Open(); if (Database.Ready) { DataTable creditLogData = Database.getTable("SELECT moment,type,activity FROM users_creditlog WHERE userid = @userid LIMIT 50"); foreach (DataRow dRow in creditLogData.Rows) { DateTime Moment = (DateTime)dRow["moment"]; Message.appendTabbedValue(Moment.ToString("dd/MM/yyyy")); Message.appendTabbedValue(Moment.ToString("hh:mm")); Message.appendTabbedValue(dRow["activity"].ToString()); Message.appendTabbedValue("0"); Message.appendTabbedValue(""); Message.Append(dRow["type"].ToString()); Message.appendChar(13); } } Session.gameConnection.sendMessage(Message); }