This module shows several server parameters using the Minequery plugin (http://minestatus.net/minequery) from a Minecraft server. Through fsockopen it connects to the minecraft server, retrieves the data and displays it in a block. As far as I know, nothing like this has been done for Drupal.
Server host and port are configurable. Results are cached with a configurable timelimit.
- Sandbox url: http://drupal.org/sandbox/dvandijk/1165946
- This is a port of the Wordpress module: http://wordpress.org/extend/plugins/minestatus/
- Live preview: http://davidvandijk.nl/minecraft, first block in the right column (Minecraft serverstatus)
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | minestatus-1165966-8.patch | 1.78 KB | tim.plunkett |
Comments
Comment #1
joachim commentedThere's a lot of cruft left over from the Wordpress version in this...
- Both the docblocks at the top of the module file are nonstandard.
> return array('view server credentials');
That's not a very clear permission name. Which server?
- hook_block keeps switching on $delta when there is only one!
You have a lot of functions like this which just wrap variable_get or variable_set. I don't see the point of these at all.
Why unshift? Why not put that in the array earlier on, since you're the one creating it?
Plugin, eh?
Version is added for you automatically. Package should only be set when you're forming part of an established group, so should not be there.
If that's all the theming you have to do, then you really don't need a TPL file. You should be using a theme function instead, which should also have the stuff from minestatus_preprocess_minestatus_list() in it.
Finally, run this through Coder. I don't see many formatting errors, but I've spotted at least one :)
Comment #2
dvandijk commentedThanks joachim for taking the time to review my module. I fixed all the issues you mentioned and added an .install file for removing the variables when uninstalling the module. I did got a warning of a missing $Id$ comment in Coder on the .install file, is this still necessary in Git?
Comment #3
joachim commented> I did got a warning of a missing $Id$ comment in Coder on the .install file, is this still necessary in Git?
That's a bug in Coder -- the $Id$ strings should definitely not be there for Git :)
Comment #4
dvandijk commentedWhat's the next step from now?
Comment #5
svendecabooterMarking as critical as per http://drupal.org/node/894256
Sorry for the long wait.
Comment #6
joachim commentedSome comments inline:
Capitalise constants: TRUE.
> fwrite($obj_sock, 'QUERY_JSON'."\n");
Space either side of . operator.
Missing newline at end of module file.
'arguments' should probably be an empty array rather than NULL? Not sure though.
> '#title' => t('Cache the results for a period in seconds'),
This should describe the field rather than the action, so 'Duration for which the results are cached, in seconds.' would be better.
> if ('list' == $op) {
I find that way round of writing an equality test a bit odd to read, but that's just personal preference; AFAIK there's no standards on it.
Just minor niggles overall, so I'm happy to mark this RTBC as I'm confident these will be addressed :)
Comment #7
dvandijk commentedThe minor issues are addressed.
Comment #8
tim.plunkettHere's a final coding standards patch for you, but I've also given you full project creation rights. Thank you for your patience!