chiark
/
gitweb
/
~ianmdlvl
/
otter.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d2b9322
)
fix
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sun, 23 Aug 2020 00:33:44 +0000
(
01:33
+0100)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sun, 23 Aug 2020 00:33:44 +0000
(
01:33
+0100)
src/global.rs
patch
|
blob
|
history
diff --git
a/src/global.rs
b/src/global.rs
index fed2c5647d159ed0835ab46559b901edd6dbccab..6f6dc1c914a148d90703715f764d8d8d806bf51b 100644
(file)
--- a/
src/global.rs
+++ b/
src/global.rs
@@
-651,7
+651,8
@@
impl InstanceGuard<'_> {
);
let g = Instance {
- name, gs, updates,
+ gs, updates,
+ name: name.clone(),
clients : Default::default(),
tokens_clients : Default::default(),
tokens_players : Default::default(),
@@
-660,7
+661,6
@@
impl InstanceGuard<'_> {
live: true,
g,
};
- // xxx record in GLOBAL.games
let gref = InstanceRef(Arc::new(Mutex::new(cont)));
let mut g = gref.lock().unwrap();
for (token, _) in &access_load.tokens_players {
@@
-676,6
+676,7
@@
impl InstanceGuard<'_> {
}
drop(global);
drop(g);
+ GLOBAL.games.write().unwrap().insert(name, gref.clone());
gref
}
}