API Feedback and Suggestions

Discussion in 'Empyrion API' started by Jascha, Mar 8, 2017.

  1. joemorin73

    joemorin73 Captain

    Joined:
    Aug 24, 2016
    Messages:
    319
    Likes Received:
    170
    This is great. Can't wait to try it tonight!
     
    #161
  2. zztong

    zztong Rear Admiral

    Joined:
    Apr 12, 2016
    Messages:
    249
    Likes Received:
    269
    As a former software engineer, I don't see a database being incompatible with data in text files. We often used SQL in text files to initialize a database. Database servers also have text-based configuration files used to get them started. Text files are very convenient and flexible. They're wonderfully crossplatform. But you're right, they're not great for storing live data or data that updates frequently. What you're talking about is how data is stored/accessed after the system is running and a database (or RAM) is handy there.
     
    #162
  3. joemorin73

    joemorin73 Captain

    Joined:
    Aug 24, 2016
    Messages:
    319
    Likes Received:
    170
    BTW, was the code updated to allow multiple DLLs in the same folder?
     
    #163
  4. Jascha

    Jascha Administrator

    • Moderator
    Joined:
    Jan 22, 2016
    Messages:
    1,141
    Likes Received:
    713
    Not yet. It might be more difficult for now they said. Depending DLLs might have to be placed in the managed folder for now.
     
    #164
  5. joemorin73

    joemorin73 Captain

    Joined:
    Aug 24, 2016
    Messages:
    319
    Likes Received:
    170
    Booo!

    ;)
     
    #165
  6. Hjorvir

    Hjorvir Ensign

    Joined:
    Apr 12, 2017
    Messages:
    3
    Likes Received:
    0
    There seems to be a lot of functionality, especially for server admins that want to create other means of interfacing with the game other than using the game's own mechanics.

    However, it seems like I am unable to interact with chat. I'd like to interface two programs (Discord & Empyrion) to create support-tickets via a bot, i.e. when you type certain commands in in-game chat, you'd be able to filter these messages via your tool, perhaps through something like Event_Player_Chat allowing you to read/write chat from players to a different output, i.e. discord.

    Edit: Sorry, just saw that Event_ChatMessage was added. Hasn't been documented yet though :I
     
    #166
  7. joemorin73

    joemorin73 Captain

    Joined:
    Aug 24, 2016
    Messages:
    319
    Likes Received:
    170
    Event_Chat_Message is how you receive chat messages. To send messages via "chat", you need to use the console commands. I've included a sample of how to send a message.

     
    #167
    Jascha likes this.
  8. Hjorvir

    Hjorvir Ensign

    Joined:
    Apr 12, 2017
    Messages:
    3
    Likes Received:
    0
    Oh nice, thanks for the example bit too. I was mostly looking for the receiving part to keep tabs on chat in game while I'm unable to attend it during work or something.
     
    #168
  9. joemorin73

    joemorin73 Captain

    Joined:
    Aug 24, 2016
    Messages:
    319
    Likes Received:
    170
    Then Event_Chat_Message is indeed what you are looking for.
     
    #169
  10. joemorin73

    joemorin73 Captain

    Joined:
    Aug 24, 2016
    Messages:
    319
    Likes Received:
    170
    @Jascha
    We have Request_InGameMessage_AllPlayers and Request_InGameMessage_SinglePlayer, but no Request_InGameMessage_Faction.
     
    #170
    Jascha likes this.
  11. Jascha

    Jascha Administrator

    • Moderator
    Joined:
    Jan 22, 2016
    Messages:
    1,141
    Likes Received:
    713
    Might come in next EXP :)
     
    #171
    joemorin73 likes this.
  12. Exacute

    Exacute Rear Admiral

    Joined:
    Feb 17, 2017
    Messages:
    456
    Likes Received:
    307
  13. Jascha

    Jascha Administrator

    • Moderator
    Joined:
    Jan 22, 2016
    Messages:
    1,141
    Likes Received:
    713
    Not yet over the API.
     
    #173
  14. Exacute

    Exacute Rear Admiral

    Joined:
    Feb 17, 2017
    Messages:
    456
    Likes Received:
    307
    Atleast I'm not blind then ;) Any chance of this being a thing of the near-ish future?
     
    #174
  15. joemorin73

    joemorin73 Captain

    Joined:
    Aug 24, 2016
    Messages:
    319
    Likes Received:
    170
    There is a workaround to get it. If you include Assembly-CSharp-firstpass into your project, you can use YamlDotNet that is in it. With it, you could read the dedicated.yaml to get the seed. The only caveat is that you can not be sure if someone is using a different dedicated.yaml.
     
    #175
    Exacute likes this.
  16. Xango2000

    Xango2000 Captain

    Joined:
    Jun 15, 2016
    Messages:
    385
    Likes Received:
    202
    Or just connect via telnet... It's right there in the first data you receive after login.
     
    #176
  17. joemorin73

    joemorin73 Captain

    Joined:
    Aug 24, 2016
    Messages:
    319
    Likes Received:
    170
    @Jascha
    Found another issue. I'm trying to make a base class to use as the framework for my mods through a "Shared Library". Empyrion detects my abstract class as the class to instantiate and attempts to create it.

    Code:
    22-19:19:11.248 15_19 -EXC- System.MissingMethodException: Cannot create an abstract class 'EmpyrionModBase.ModBase'.
      at System.Activator.CheckAbstractType (System.Type type) [0x00000] in <filename unknown>:0
      at System.Activator.CreateInstance (System.Type type, Boolean nonPublic) [0x00000] in <filename unknown>:0
      at System.Activator.CreateInstance (System.Type type) [0x00000] in <filename unknown>:0
      at Assembly-CSharp.FormLayout.DetachPartition () [0x00000] in <filename unknown>:0 
    I might recommend to do one of the following:
    • Modify the detection code to ignore abstract classes when reflecting or
    • Create an attribute that we would set in on the classes to inform Empyrion as to which class it should use.
     
    #177
  18. Jascha

    Jascha Administrator

    • Moderator
    Joined:
    Jan 22, 2016
    Messages:
    1,141
    Likes Received:
    713
    Hey,

    could you do the devs a favour and post a mini test-project (with source) of the Mod.dll with this case so the devs could check it on their side?
     
    #178
  19. joemorin73

    joemorin73 Captain

    Joined:
    Aug 24, 2016
    Messages:
    319
    Likes Received:
    170
    Done. This includes a simple project with a compiled dll.

    https://1drv.ms/u/s!AqvXBFJCQ8T0jY40fG0SrHOMlOMIJg
     
    #179
    Jascha likes this.
  20. joemorin73

    joemorin73 Captain

    Joined:
    Aug 24, 2016
    Messages:
    319
    Likes Received:
    170
    @Jascha
    New API request. Not sure how this will fit in.

    Ability to search for player info of offline players by player name. There does not appear to be a way to search for players while they are offline.
     
    #180

Share This Page