MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / start

Method start

source/util/player.cpp:77–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77bool Player::start(BString directory) {
78 Player::instance = new Player();
79 BString script = BString(directory+"/"+RECORDER_SCRIPT);
80 instance->directory = directory;
81 instance->file.open(script);
82 instance->lastCommandTime = 0;
83 instance->lastScreenRead = 0;
84 if (!instance->file.isOpen()) {
85 klog_fmt("script not found: %s error=%d(%s)", script.c_str(), errno, strerror(errno));
86 exit(100);
87 } else {
88 klog_fmt("using script: %s", script.c_str());
89 }
90 instance->readCommand();
91 instance->version = instance->nextValue;
92 if (instance->version!="2") {
93 klog_fmt("script is wrong version, was expecting 2 and instead got %s", instance->version.c_str());
94 exit(99);
95 }
96 instance->readCommand();
97 return true;
98}
99
100void Player::initCommandLine(BString root, const std::vector<BString>& zips, BString working, const std::vector<BString>& args) {
101 while (this->nextCommand=="ROOT" || this->nextCommand=="ZIP" || this->nextCommand=="CWD" || this->nextCommand=="ARGC" || this->nextCommand.startsWith("ARG")) {

Callers 3

runMethod · 0.45
mainMethod · 0.45
runBoxedWineMethod · 0.45

Calls 6

BStringClass · 0.85
klog_fmtFunction · 0.85
readCommandMethod · 0.80
openMethod · 0.65
isOpenMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected