aiannacc / Goko-Salvager

Enhance your Dominion Online experience!
13 stars 9 forks source link

Censoring doesn't work #170

Open aiannacc opened 10 years ago

aiannacc commented 10 years ago

Blacklisting a player hides their avatar in the lobby, but not their chat. There's code to hide their chat too, but it doesn't work.

The problem is that we're overriding FS.MeetingRoom.prototype.onRoomChat, but this method has already been bound to an event manager. When a room chat is received, the event manager doesn't look to the MeetingRoom prototype... it just uses the version of the method that's already bound.

I have to wonder whether this ever worked at all. It would have to be able to override the prototype method after Goko initializes it, but before it gets bound it to the MeetingRoom's Connection object. I can't think of any way to make that timing happen reliably, even for the GM script... we certainly can't follow the same approach in the "who knows when it'll get loaded" environment we're working in now.

The best solution may be to:

  1. unbind the originally bound method from the mtgRoom.conn object (if any) and rebind our modified version
  2. override the prototype method anyway in case the mtgRoom.conn object can get replaced (e.g. by logging out and back in).