Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unsigned char playerip[4];
- *(unsigned long*)&playerip = player->lastip;
- char buf[64];
- time_t ticks = time(0);
- strftime(buf, sizeof(buf), "%Y-%m-%d, %H:%M", localtime(&ticks));
- std::string file = "/home/all/data/logs/bugs/" + player->getName() + ".log";
- std::ofstream outfile;
- outfile.open(file.c_str(), std::ios_base::out | std::ios_base::app);
- outfile << "[" << buf << "] " << player->getName() << " [POS: " << player->pos.x << " " << player->pos.y << " " << player->pos.z << " ,IP: " << (unsigned int)playerip[0] << "." << (unsigned int)playerip[1] << "." << (unsigned int)playerip[2] << "." << (unsigned int)playerip[3] << "] " << param << std::endl;
- outfile.close();
- void Protocol76::parseReportBug(NetworkMessage &msg)
- {
- std::string bug = msg.GetString();
- std::stringstream filename;
- filename << "data/logs/reports/" << player->getName() << " report.txt";
- FILE* f = fopen(filename.str().c_str(), "a");
- if(f) {
- fputs("------------------------------\n", f);
- fputs(bug.c_str(), f);
- fputs("\n", f);
- fclose(f);
- }
- player->sendTextMessage(MSG_INFO, "Your report has been sent.\nWe will try to solve the problem within 24 hours.");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement