MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / Update

Method Update

engine/Poseidon/IO/FileServer.cpp:282–317  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

280void FileServerST::CancelRequest(const char* name, int from, int to) {}
281
282void FileServerST::Update()
283{
284 // check if current operation is terminated
285 // if it is, process next request
286 while (_queue.Size() > 0)
287 {
288 // get heap head
289 // check if operation already started
290 FileRequest& head = _queue[0];
291 if (!head._filebuf)
292 {
293 QFBank* bank = QIFStreamB::AutoBank(head._filename);
294 if (bank)
295 {
296 const char* name = head._filename;
297 name += bank->GetPrefix().GetLength();
298 head._filebuf = bank->ReadOverlapped(name);
299 }
300 else
301 {
302 QIFStreamB temp;
303 temp.AutoOpen(head._filename);
304 head._filebuf = head._in.GetBuffer();
305 }
306 }
307 // check if operation terminated
308 if (!head._filebuf->IsReady())
309 {
310 break;
311 }
312 FileRequest req;
313 _queue.HeapRemoveFirst(req);
314 req._in.OpenBuffer(head._filebuf);
315 _done.Add(req);
316 }
317}
318
319void FileServerST::Open(QIFStream& stream, const char* name)
320{

Callers 1

ParamValueSpecClass · 0.45

Calls 10

ReadOverlappedMethod · 0.80
AutoOpenMethod · 0.80
HeapRemoveFirstMethod · 0.80
OpenBufferMethod · 0.80
SizeMethod · 0.45
GetLengthMethod · 0.45
GetPrefixMethod · 0.45
GetBufferMethod · 0.45
IsReadyMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected