• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

How to save every player's log?

Galaxy

New Member
Joined
Feb 24, 2011
Messages
108
Reaction score
1
Location
Ireland/Carlow
Hello,

I'd like to know if there is a possibility of making a script that will save all player's log into folder my ots -> data -> logs -> players

At the moment, it saves only all the talkaction words of every players but I'd like it to save all words that a player says...

Thank you :)

Im so sorry. I was suppose to post this in "Request" board... Could moderator of this forum move this thread? Id be greatful... Its just, Im always checking Support board and I got used to post in here haha. Sorry again
 
Last edited:
No ;p I dont want to know their position or time or wha ever ;D

I want to know everything they say... So what ever they say is going to be saved in the folder "logs -> players -> simple document file called player name

And then inside it, there will be everything he said (EXCEPT FOR SPELLS AND COMMANDS!!!!).

So its gonnab e like that:

Date [Time] Player's_Name: HERE WHAT EVER HE SAID

So example:
22/11/2011 [20:11] Super Ninja: I love this server! :D

At the moment, only logs of gm/cm/god are saved and only commands they used... actually, I'm happy that it saves cm's/gm's/god's commands because I will always know what did they do. but also normal chat logs.
 
maybe copy the script that saves the gm/cm/god commands and change a few things to make it work for players as well [its just a possible way to do it, im not a scripter so idk how to do it myself]
 
game.cpp
[cpp]#include "textlogger.h"[/cpp]and
[cpp]Logger::getInstance()->eFile("players/" + player->getName() + ".log", text, true);[/cpp]2nd line goes inside Game::playerSay above switch(type)
 
@up
where exacly does that go?
Code:
Logger::getInstance()->eFile("players/" + player->getName() + ".log", text, true);

here are the first few lines after Game::playerSay~. I don't know if this is what u need. If not then I can give u more lines ;D

Code:
bool Game::playerSay(uint32_t playerId, uint16_t channelId, SpeakClasses type, const std::string& receiver, const std::string& text)
{
	Player* player = getPlayerByID(playerId);
	if(!player || player->isRemoved())
		return false;

	uint32_t muted = 0;
	bool mute = player->isMuted(channelId, type, muted);
	if(muted && mute)
	{
		char buffer[75];
		sprintf(buffer, "You are still muted for %d seconds.", muted);
		player->sendTextMessage(MSG_STATUS_SMALL, buffer);
		return false;
	}

	if(player->isAccountManager())
	{
		if(mute)
			player->removeMessageBuffer();

		return internalCreatureSay(player, SPEAK_SAY, text, false);
	}


EDIT:
I found that switch(type) and yes, I pasted it just above that. Now it's compiling. ;p But maybe I will get some error so visit this thread later xD Coz i will edit this post xD

I got this errors :S I'm not gonna copy everything because I think picture is the best way to show something xDD
so here we go ;d a picture xD I am sorry for the polish tho ;sss but that's the program someone told me I should use. Dunno if its the right one xD btw if you got the english version I'd be glad ;D
problemomgxdd.png
 

Attachments

  • problem  omg xdd.jpg
    problem omg xdd.jpg
    18.9 KB · Views: 23 · VirusTotal
Last edited:
Hello,

I'd like to know if there is a possibility of making a script that will save all player's log into folder my ots -> data -> logs -> players

At the moment, it saves only all the talkaction words of every players but I'd like it to save all words that a player says...

Thank you :)

Im so sorry. I was suppose to post this in "Request" board... Could moderator of this forum move this thread? Id be greatful... Its just, Im always checking Support board and I got used to post in here haha. Sorry again
;o
like big bro plugin in minecraft.
Why you want to save every action? Or you want to log messages only?

Edit: If you want this open channels.xml and add logged="yes" to all channels
 
Last edited:
@up

I want it to be in the following way:

inb my ots folder, there is a folder called "logs", right?
in this folder, I want a folder called "players".
In folder "players" i want all the things that a person said. So a file should be called after someones in-game nick...

Say for example, a player called "Test" says "I love this server" in default/help or which ever channel.... So, now this sentence is saved in a file called Test and in that file it is written:
[DAY/MONTH/YEAR HOUR:MINUTES:SECONDS] IN_GAME_NAME [LEVEL]: HIS_LOG

example would be:
[16/11/2011 18:0:52] Test [104]: I love this server.
 
Back
Top