Working on logging...everything

Discussion in 'Plugin Development' started by kwg, Mar 9, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    kwg

    So, I'm not a developer. I'm learning java now and I am loving it so far, but I have no experience in this area so the going is slow. As per my normal masochistic behaviour, I might have selected a rather large target for my first plugin. I would like some advice as to how/if to proceed.

    My first plugin started as a joke. I had just killed a sheep with a porkchop and a friend commented that there should be an achievement for doing that 100 times... I wont repeat what the title reward was he said we should give for killing 100 sheep with your meat :)

    So the idea started as - "how do I track who killed what with what". That part turned out to be somewhat simpler than I thought. The storage method has occupied over a week of my time though. I know SQL to a degree (and the wife breathes it) and I admin/IT databases and larger servers (babysit). Once we started building out tables for what all needed to be tracked I realized "this is going to get huge. fast". Pretty much talking about tracking every single thing I can write a listener for - which is just about everything. So much so that we are now talking about 2 databases, one on another server that writes live and one on the MC server that is read only and writes from the buffer at some yet undetermined interval. How many times has X player broken Y block using Z tool? How many steps has X player taken on Y terrain? What was every action that X player took from Y date to Z date?

    This very quickly became a "wow, this could be used by just about every plugin out there". Create new tables and you have attributes, skills, levels, classes, money, AI rules, quests, NPCs, unique items, etc... As long as the format was generic enough any plugin could use the data and even add their own data as well. As long as they played nice and didn't destroy the original format this would coexist just fine. If formatted correctly you could use this to extend MC as well. a block_id XX:YY is block and skin, XX:YY:AA:BB could be block:skin:mod:id for example. Now I can make enchanted armor? currency_ids could contain entries for multiple economy plug ins and you could have rules for translating from one to another so that plugins that need iconomy work with a plugin that only supports joebobbriggsmoney plugin. Logging every transaction allows the creation of admin tools much ... ok a lot much... like that really popular mmo's GMs use on the backend that I may or may not have ever seen. Degriefing, scam investigations, /report player, command history, chat logs, etc.

    I'm very interested in trying this. I have a few friends that know java but have little time. So far I have been told "that might work" :) Like I said, this started as an achievement plugin, but I think this might be more useful in general, so I wanted to share my idea... even if I get laughed at for it.

    kwg

    for example, a few tables would look like this:
    Code:
    Transaction Tables - (player_id)_trans_eventlistener
    (player_id)_trans_blocks:transaction_id,equipped_id,action_id,action_value,block_id,world_id,x,y,z,timestamp
    (player_id)_trans_creatures:transaction_id,equipped_id,action_id,action_value,creature_id,world_id,x,y,z,timestamp
    (player_id)_players:transaction_id,equipped_id,action_id,action_value,player_id,world_id,x,y,z,timestamp
    
    ID Tables                            
    block_ids:block_id,short_name,short_plural,long_name,long_plural        
    action_ids:action_id,short_name,short_past,short_future,long_name,long_past,long_future
    creature_ids:creature_id,short_name,long_name                
    world_ids:world_id,short_name,long_name,world_type
     
Thread Status:
Not open for further replies.

Share This Page