MGI::ClearLog => {
let (ig, _) = cs.check_acl(&ag, ig, PCH::Instance, &[TP::Super])?;
+ for gpl in ig.gs.players.values_mut() {
+ gpl.movehist.clear();
+ }
ig.gs.log.clear();
for ipr in ig.iplayers.values_mut() {
// todo: do this only if there are no hidden pieces?
tr.retain(|_k, v| v.latest >= latest);
}
}
- // xxx clear the movehist
+ let raw = Some(vec![ PUE::MoveHistClear ]);
(U{ pcs: vec![ ],
log: vec![ LogEntry {
- html: hformat!("{} cleared the log", who),
+ html: hformat!("{} cleared the log history", who),
} ],
- raw: None },
+ raw },
Fine, None, ig)
},
let acl = acl.try_into()?;
let mut insns = vec![];
- insns.push(MGI::ClearLog);
insns.push(MGI::SetACL { acl });
insns.push(MGI::SetLinks(links.clone()));
insns
insns.push(MGI::DefinePieceAlias{ alias, target });
}
+ insns.push(MGI::ClearLog);
insns.push(MGI::SetTableSize(table_size));
insns.push(MGI::SetTableColour(table_colour));
}
}
+impl PlHist {
+ pub fn clear(&mut self) { self.hist.clear() }
+}
+
// We're track this on behalf of the client, based on the updates
// we are sending. That means we don't ahve to worry about
// occultation, etc. etc.
Piece(PreparedUpdateEntry_Piece),
Image(PreparedUpdateEntry_Image),
MoveHistEnt(SecondarySlotMap<PlayerId, movehist::Ent>),
+ MoveHistClear,
SetTableSize(Pos),
SetTableColour(Colour),
SetLinks(Arc<LinksTable>),
Piece(TransmitUpdateEntry_Piece<'u>),
Image(TransmitUpdateEntry_Image<'u>),
MoveHistEnt(&'u movehist::Ent),
+ MoveHistClear{},
RecordedUnpredictable {
piece: VisiblePieceId,
cseq: ClientSequence,
Log(logent) => {
logent.logent.html.json_len() * 28
}
+ MoveHistClear => 50,
AddPlayer {
player:_,
data: DataLoadPlayer { dasharray, nick, },
_ => continue,
}
}
+ PUE::MoveHistClear => {
+ TUE::MoveHistClear{}
+ }
PUE::Log(logent) => {
TUE::Log((&tz, &logent))
}
}
messages.MoveHistEnt = <MessageHandler>movehist_record;
+messages.MoveHistClear = <MessageHandler>function() {
+ movehist_revisible_custmax(0);
+}
function movehist_record(ent: MoveHistEnt) {
let old_pos = ent.posx[0].pos;
}
}
-function movehist_revisible() {
+function movehist_revisible() {
+ movehist_revisible_custmax(movehist_len_max);
+}
+
+function movehist_revisible_custmax(len_max: number) {
let n = movehist_lens[movehist_len_i];
let i = 0;
let node = movehist_end;
- while (i < movehist_len_max) {
+ while (i < len_max) {
i++; // i now eg 1..10
node = node.previousElementSibling! as SVGGraphicsElement;
if (node == movehist_start)