Not logged inOpenClonk Forum
Up Topic General / Feedback and Ideas / Percentage of the client download
- - By Carli [de] Date 2010-03-28 21:19
Hi,

i want to build a feature that the host (or each player) can see how many packages a client has to load before the game begins.

But i'm even thinking about where i should place this display.

There are two places, i can imagine:

a) As an item in the Client list, above or under the joining players
b) in the files-list (don't know how exactly)

what do you think about?
Parent - By Ringwaul [ca] Date 2010-03-28 21:43
I think it would be best to have a percentage number beside the client's name.

I hereby license the following file(s) under the CC-by license
Reply
Parent - - By Caesar [de] Date 2010-03-29 11:38
I'd like to have an a little more detailed display in the resources-section. Resources, that's what it about anyway.
Parent - By Carli [de] Date 2010-03-29 15:32
i think, the host should not be able to force the clients to save the game.
it's eachs own decision and sometimes i don't want to override my fresh downloaded eke 1.5.
Parent - - By PeterW [de] Date 2010-03-29 11:48
That's not really a complicated change, btw, if done right. Clients already track what chunks all other clients have (well, at least all clients they are connected to), but only if they are currently loading the file in question. So in theory, you must only change this so all information is retained, then build some accessors and the GUI code.
Parent - - By Carli [de] Date 2010-03-29 15:31
my idea was to introduce a new message format (like chat or sound) that is broadcasted each second what pack with how much percent
this data will be shown each second and after 2 seconds without broadcasting the pack will be marked as 100%
Parent - - By Sven2 [de] Date 2010-03-29 17:55
If the information is already present (as Peter said), no new messages should be added, as they increase overhead and thus download time.
Parent - - By Carli [de] Date 2010-03-29 18:02
ok, i will see.

so you mean everyone knows how many packs everybody is downloading but it is not displayed?
Parent - - By Sven2 [de] Date 2010-03-29 18:39
According to Peter, yes.
Parent - - By Carli [de] Date 2010-03-29 21:20
it seems to me that only the client itself knows how many chunks he did load.

so i think, i have to introduce a new message type anyway.
Parent - By PeterW [de] Date 2010-03-30 01:10
No, you don't. Just think about it for a second - the network code needs to know what chunks other clients have so it can select what chunks to request.

The details: C4Network2ResList::OnTimer gets called periodically (obviously), which calls  C4Network2Res::SendsStatus on all resources that are dirty (= new chunks received since last announce). This sends a NetResStat message to all connected clients (C4Network2IO::BroadcastMsg). This in turn gets received by C4Network2ResList::HandlePacket, which calls C4Network2Res::OnStatus.

Which discards the information if the resource in question currently isn't loaded - which you must change so other clients retain that information too. I guess you could just remove that check - iDiscoverStartTime won't matter after the resource is complete. The call to StartLoad, on the other hand, still needs that check. Also move the CChunk freeing code from C4Network2Res::ClearLoad to C4Network2Res::Clear, or your data might get deleted when the resource in question gets completed. After that, as I said, you should only need some accessors and you should be good to go.
Up Topic General / Feedback and Ideas / Percentage of the client download

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill