Cube  Diff

Differences From Artifact [895b86000b]:

To Artifact [6f1a324e2b]:


38
39
40
41
42
43
44



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59

60

61
62
63













64
65
66
67
68
69
70

	if (!allow)
		conoutf(@"editing in multiplayer requires coopedit mode (1)");

	return allow;
}




VARF(rate, 0, 0, 25000,
	if (clienthost && (!rate || rate > 1000))
		enet_host_bandwidth_limit(clienthost, rate, rate));

void throttle();

VARF(throttle_interval, 0, 5, 30, throttle());
VARF(throttle_accel, 0, 2, 32, throttle());
VARF(throttle_decel, 0, 2, 32, throttle());

void
throttle()
{
	if (!clienthost || connecting)
		return;

	assert(ENET_PEER_PACKET_THROTTLE_SCALE == 32);

	enet_peer_throttle_configure(clienthost->peers,
	    throttle_interval * 1000, throttle_accel, throttle_decel);
}














static void
newname(OFString *name)
{
	c2sinit = false;

	if (name.length > 16)







>
>
>
|

|
|
<

|
|
|

|
|



>

>



>
>
>
>
>
>
>
>
>
>
>
>
>







38
39
40
41
42
43
44
45
46
47
48
49
50
51

52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87

	if (!allow)
		conoutf(@"editing in multiplayer requires coopedit mode (1)");

	return allow;
}

static int rate = 0;
VARB(rate, 0, 25000, ^ { return rate; }, ^ (int value) {
	rate = value;

	if (clienthost && (!rate || rate > 1000))
		enet_host_bandwidth_limit(clienthost, rate, rate);
})


static int throttle_interval = 5;
static int throttle_accel = 2;
static int throttle_decel = 2;

static void
throttle(void)
{
	if (!clienthost || connecting)
		return;

	assert(ENET_PEER_PACKET_THROTTLE_SCALE == 32);

	enet_peer_throttle_configure(clienthost->peers,
	    throttle_interval * 1000, throttle_accel, throttle_decel);
}

VARB(throttle_interval, 0, 30, ^ { return throttle_interval; }, ^ (int value) {
	throttle_interval = value;
	throttle();
})
VARB(throttle_accel, 0, 32, ^ { return throttle_accel; }, ^ (int value) {
	throttle_accel = value;
	throttle();
})
VARB(throttle_decel, 0, 32, ^ { return throttle_decel; }, ^ (int value) {
	throttle_decel = value;
	throttle();
})

static void
newname(OFString *name)
{
	c2sinit = false;

	if (name.length > 16)