MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / exportToFile

Method exportToFile

Engine/source/app/banList.cpp:174–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172//------------------------------------------------------------------------------
173
174void BanList::exportToFile(const char *name)
175{
176 FileStream *banlist;
177
178 char filename[1024];
179 Con::expandScriptFilename(filename, sizeof(filename), name);
180 if((banlist = FileStream::createAndOpen( filename, Torque::FS::File::Write )) == NULL)
181 return;
182
183 char buf[1024];
184 Vector<BanInfo>::iterator i;
185 for(i = list.begin(); i != list.end(); i++)
186 {
187 dSprintf(buf, sizeof(buf), "BanList::addAbsolute(%d, \"%s\", %d);\r\n", i->uniqueId, i->transportAddress, i->bannedUntil);
188 banlist->write(dStrlen(buf), buf);
189 }
190
191 delete banlist;
192}
193
194//=============================================================================
195// API.

Callers 1

banList.cppFile · 0.80

Calls 6

expandScriptFilenameFunction · 0.85
dSprintfFunction · 0.85
dStrlenFunction · 0.50
beginMethod · 0.45
endMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected