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?
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?
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
I hereby license the following file(s) under the CC-by license
I'd like to have an a little more detailed display in the resources-section. Resources, that's what it about anyway.
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.
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%
this data will be shown each second and after 2 seconds without broadcasting the pack will be marked as 100%
If the information is already present (as Peter said), no new messages should be added, as they increase overhead and thus download time.
ok, i will see.
so you mean everyone knows how many packs everybody is downloading but it is not displayed?
so you mean everyone knows how many packs everybody is downloading but it is not displayed?
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.
so i think, i have to introduce a new message type anyway.
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 -
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.
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill