Fixed fundamental flaw with throttling code. Changed the client to adjust its message rate when it actually sends the throttle updated message. Otherwise the client starts sending at the new rate before the server knows about it. Keep the messages per second in the message.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5499 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Jamie Doornbos
2008-11-04 08:37:13 +00:00
parent ed002196b0
commit 14755a6cea
4 changed files with 40 additions and 2 deletions
@@ -21,10 +21,25 @@
package com.threerings.presents.net {
import com.threerings.io.ObjectOutputStream;
/**
* Notifies the server that the client has received its UpdateThrottleMessage.
*/
public class ThrottleUpdatedMessage extends UpstreamMessage
{
/** The number of messages allowed per second. */
public var messagesPerSec :int;
public function ThrottleUpdatedMessage (messagesPerSec :int = 0)
{
this.messagesPerSec = messagesPerSec;
}
override public function writeObject (outs :ObjectOutputStream) :void
{
super.writeObject(outs);
outs.writeInt(messagesPerSec);
}
}
}