mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
Optimize _Saverdict.update that caused issues for webclient option update (#2224)
This commit is contained in:
parent
668551a0d5
commit
91e2e68291
5 changed files with 10 additions and 5 deletions
|
|
@ -389,7 +389,7 @@ gaming style you like and possibly any new ones you can come up with!
|
|||
(aka MUDs, MUSHes, MUX, MOOs...). It is open-source and |wfree to use|n, also for
|
||||
commercial projects (BSD license).
|
||||
|
||||
Out of the box, Evennia provides a |wfull, if empty game|n. Whereas you can play
|
||||
Out of the box, Evennia provides a |wworking, if empty game|n. Whereas you can play
|
||||
via traditional telnet MUD-clients, the server runs your game's website and
|
||||
offers a |wHTML5 webclient|n so that people can play your game in their browser
|
||||
without downloading anything extra.
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ class MonitorHandler(object):
|
|||
|
||||
def at_update(self, obj, fieldname):
|
||||
"""
|
||||
Called by the field as it saves.
|
||||
Called by the field/attribute as it saves.
|
||||
|
||||
"""
|
||||
to_delete = []
|
||||
|
|
|
|||
|
|
@ -521,9 +521,8 @@ def webclient_options(session, *args, **kwargs):
|
|||
session=session,
|
||||
)
|
||||
else:
|
||||
# kwargs provided: persist them to the account object
|
||||
for key, value in kwargs.items():
|
||||
clientoptions[key] = value
|
||||
# kwargs provided: persist them to the account object.
|
||||
clientoptions.update(kwargs)
|
||||
|
||||
|
||||
# OOB protocol-specific aliases and wrappers
|
||||
|
|
|
|||
|
|
@ -300,6 +300,10 @@ class _SaverDict(_SaverMutable, MutableMapping):
|
|||
def has_key(self, key):
|
||||
return key in self._data
|
||||
|
||||
@_save
|
||||
def update(self, *args, **kwargs):
|
||||
self._data.update(*args, **kwargs)
|
||||
|
||||
|
||||
class _SaverSet(_SaverMutable, MutableSet):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -268,12 +268,14 @@ An "emitter" object must have a function
|
|||
// Parse the incoming data, send to emitter
|
||||
// Incoming data is on the form [cmdname, args, kwargs]
|
||||
data = JSON.parse(data);
|
||||
// console.log(" server->client:", data)
|
||||
Evennia.emit(data[0], data[1], data[2]);
|
||||
};
|
||||
}
|
||||
|
||||
var msg = function(data) {
|
||||
// send data across the wire. Make sure to json it.
|
||||
// console.log("client->server:", data)
|
||||
websocket.send(JSON.stringify(data));
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue