Easy to use Roblox Chat/Event logger (logs to database, has web interface)

I had this idea for a long time, but finally sat down to make it. I open sourced it, for the case anyone could use it. If no one cares, this thread will easily drop to the next page of LatCC, and I won’t complain.

Features:

[ul]
[li]Easy-to use roblox Module which allows you to easily dump chats and events (user-specified) to the server[/li]
[li]The web interface allows you to find online servers and also archived servers[/li]
[li]Access server event and chat logs[/li]
[/ul]

I’m currently running this on a rPi, for my extremely unpopular game with about 1 visit per day. I have to note that this is my first time using PHP and also my first time to “seriously” use MySQL. I learned a lot today, and it was fun :DDD

Pictures (note: the html is processed according to some “standards”. It should be easy to CSS these pages, but for now, it just shows that “it iswork”)

The homepage shows online servers. These are retrieved from the database, which checks if the auto-updating timestamp key has been updated the last 5 minutes. If not, it falls to the Archived servers.

Events. Let me post the actual code of the used script;

RES = require(script.RobloxEvents)

_G.RES = RES

RES:Run()

game.Players.PlayerAdded:connect(function(p)
	RES:AddEvent(p.Name .. " has joined the game!")
	p.CharacterAdded:connect(function(c)
		RES:AddEvent(p.Name .. " has spawned!")
		repeat wait() until c:FindFirstChild("Humanoid")
		c.Humanoid.Died:connect(function()
			RES:AddEvent(p.Name .. " died!")
		end)
	end)
end)
game.Players.PlayerRemoving:connect(function(p)
	RES:AddEvent(p.Name .. " has left the game!")
end)

I easily piped my custom chat to the module. Notice that the last chats are shown on top. (Same goes for events). Code:

	if _G.RES then
		_G.RES:AddChat(Message, Data.Player)
	end

Data.Player is from a Remote[Function | Event] interface.

The source, with crude installation instructions (will update!) are located:

HERE

Small notice:
I did currently not escape all sql and html strings. If you decide to run this at your own server, this is, (also per licence) your own risk. For standalone use this should not be a big problem. I will fix this ASAP. (or shoot a pull request).

If you have any questions, feel free to ask.

1 Like

Your images don’t work

[strike]Why would I use this instead of google analytics?[/strike]

EDIT: Derp, thought I was in development discussion

[quote] Your images don’t work

Why would I use this instead of google analytics? [/quote]

It’s not a matter of what you would use in production, but a matter of “hey, i made this as an experiment, and if you wanna check it out cool, if not, still cool.”

Oh my bad, I thought I was in development discussion.

Yeah it’s super cool, there’s no way I’d be able to make that.

[quote] Your images don’t work

[strike]Why would I use this instead of google analytics?[/strike]

EDIT: Derp, thought I was in development discussion [/quote]

Because I can add custom hooks, such as email or other goodies. Plus it’s an interesting project.

This is really neat! Thanks for making such a cool think. :slight_smile:

Use SQLite3/PDO over MySQL :)?
I will read the source code when I’m home from school.

I can’t find where $userid is escaped on line 48 of add_data.php. You may want to fix this if I have not overlooked something.

Add some CSS to it, to make it more appealing please :stuck_out_tongue:

Other then that, great tool

[quote] Add some CSS to it, to make it more appealing please :stuck_out_tongue:

Other then that, great tool [/quote]

Yeah as I said, it’s more a proof of concept. Plus adding css would be easy for the current version, so easy that other users can make it themselves. Just define css rules for a’s, tr/td/table/th, and h1. That’s it. Or feel free to create your own css and add it as pull request.

For the escapes: I’ll fix them.