"Plugin Messages" - Inter-mod communication

Discussion in 'Plugin Development' started by Flenix, Dec 3, 2013.

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

    Flenix

    Hey guys,

    I'm the developer for the forge mod "FlenixCities". The mod, amongst other things, adds a physical economy.

    I'm currently trying to add support for bukkit for the servers using MCPC+ or BukkitForge. This means I need to create a bukkit economy to work with my mod.


    I've nearly gotten everything working, all I need to do is set up communication between my mod and the bukkit plugin. I've gone for a simple approach of keeping them seperate so I don't need to worry about sync (Think of my bukkit-side economy as the BitCoin to my physical cash) - but I still need to let the other side know how much is in each account.

    For example, say my bukkit side has $15. If a player tries to transfer $20 from that to the Forge side, I need to tell Forge to NOT give him the money, because he doesn't really have it.

    I asked about this a while back on IRC, before I'd finished the bukkit-side plugin's core, and someone told me about a message packet system which can transmit data cross-platform between bukkit, forge and I believe even basemods and other APIs. However, I can't remember what it was called...

    So, does anyone know of an elegant solution for this? Has anyone ever tried anything along these lines?


    (Side-note, please don't bother commenting if you're just gonna hate on Forge. Bukkit and Forge offer different things; I'm merely trying to bridge the gap a bit.)
     
  2. Offline

    mattrick

    Flenix
    I believe it has something to do with packets, I haven't really worked with Forge....
     
  3. Offline

    Garris0n

  4. Offline

    Flenix



    That's what it was, thanks :p

    And no - money is stored server-side unless you're playing single player. If it was single player then yes, you could do that - but you can do that for items too, not really something I can prevent.
    The mod-side money is stored as NBT data in the root of the server directory - I don't think that's something bukkit can directly read.
     
  5. Offline

    Garris0n

    Technically, a plugin could be made to read it.
     
  6. Offline

    NathanWolf


    True, but I'm sure anyone dealing with real money on their servers is going to be pretty picky about which plugins they install.. I know I wouldn't use any that I didn't write myself or at least had source code access to :)

    Your server is only as secure as the most insecure thing you put on it...

    (Hi, Flenix!)
     
  7. Offline

    Flenix

    Hey!
    & your post confused me, just to clarify my "real money" is only items. I'm not doing anything with actual real money- BitCoin was just a reference :p

    I know with a lot of work I could make a plugin directly read/write to my money file, but to be honest I prefer the idea of the two seperate but compatible economies. It means I can use all the lovely things bukkit/vault have to offer without having to do very much at all to my mod - as I obviously want the mod to work just fine WITHOUT bukkit too (as the majority of players tend to play single-player in the world of Forge)


    Anyway, I'm struggling to find docs on receiving the info. Anyone got any advice? For now I just want to send a simple packet from the mod and get it in the plugin and vice versa, once I've got that I can tweak it as required.
     
Thread Status:
Not open for further replies.

Share This Page