[C#] update Textbox or labelbox?

07/25/2011 18:18 kevin_owner#16
Yeah you shouldn't read it the same way. in Isro so also in grindroad it is a float.

So you don't read 2 words which are the current and max but 1 float which is a percent from 0 till 1. So you don't know what the player max is but just how full the server is in percent.
07/25/2011 18:30 Haxor#17
Quote:
Originally Posted by kevin_owner View Post
Yeah you shouldn't read it the same way. in Isro so also in grindroad it is a float.

So you don't read 2 words which are the current and max but 1 float which is a percent from 0 till 1. So you don't know what the player max is but just how full the server is in percent.
hmm how you mean
i read it like that
Quote:
ushort cur = 0;
ushort max = 0;
cur = packet.ReadUInt16();
max = packet.ReadUInt16();
and btw i get curr 0 and max 16248 :)
07/25/2011 18:44 kevin_owner#18
Yeah well in isro you don't have a current and max amount anymore so you should read it like this.

Code:
float ServerFullness = packet.ReadSingle(); // Or ReadFloat();
The value is a value between 0 and 1.
so:
Code:
0 = server empty
0.500000 = server 50% full
0.687 = server for 68,7% full
1 = server full
You don't know how many players there can be in the server. So you might have noticed that rev6 has 3500 as a max but joymax might have decreased the number or increased it you can't know how many players there are.

so what you can do with this value is to multiply it by 3500 so you get the current amount of players with 3500 as max.
07/25/2011 18:50 benco#19
hello,

use ReadSingle() for ratio.

Max player = 3500 everytime
Current Player = ratio * 3500
07/25/2011 18:56 Haxor#20
Ok i read it like that
now
Quote:
byte state = 0;
ushort cur = 0;
ushort max = 0;
id = packet.ReadUInt16();
name = packet.ReadAscii();
float ServerFullness = packet.ReadSingle();
state = packet.ReadUInt8();
new_entry = packet.ReadUInt8();
i get the number 0.96875
But something weird with that because server 1 have 600\1000 and it showed like that
and when i tryed to change id to 5 its didnt show anymore -.-
07/26/2011 10:14 lesderid#21
Quote:
Originally Posted by kevin_owner View Post
You don't know how many players there can be in the server. So you might have noticed that rev6 has 3500 as a max but joymax might have decreased the number or increased it you can't know how many players there are.
Actually, you can calculate it.

You save the float before you login.
You log in.
You start another connection to the GatewayServer and save the new float.

Calculation:
Code:
y = increase in float for 1 user. (secondFloat - firstFloat)
1 user = y
all users = 1 / y
You might have to do this a few times because it's possible you don't save it fast enough and someone else logged in/off during the time you were connecting/logging in.