1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

[API] Plugin CP

Discussion in 'Requests' started by SOFe, Jun 3, 2017.

  1. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    Yes, we have external control panels like rcon. I'm not talking about rcon. I'm talking about a web server that is directly hosted on the server.
    Many good plugins are too sophisticated for configuration. If a web interface could be created by plugins directly (not a separate web server, because it'd be too hard to configure and self-refutes the purpose of easier configuration), users can probably configure plugins better.
    We already have Volt by @falk, which can be used for setting up the web server, but the setup for it is very inconvenient (developers have to learn using handle bars, work with threading and design the webpage). It would be great if someone creates a plugin configuration panel API that, for example, reads up a config prototype like this:
    Code:
    <Config owner="Hormones" name="config" namespace="Hormones\Config">
      <Section id="mysql" name="MySQL">
        <description>
          <![CDATA[Your <b>MySQL</b> credentials]]>
        </Description>
        <String id="host" name="Host" description="Host of MySQL server" />
        <Int id="port" name="Port" description="MySQL port" min="0" max="65535" />
        <String id="password" name="Password" password="true" description="MySQL password" />
      </Section>
    </Config>
    
    And probably, complex types:
    Code:
    <DeclareType class="Hormones\Config\TransferRule" name="TransferRule">
      <Enum type="String" id="action" description="Action to do">
        <Choice name="Kick" id="kick">
        ...
      </Enum>
      ...
    </DeclareType>
    <ConfigGroup blah="blah blah">
      <TransferRule .../>
      <List type="TransferRule" name="Other transfer rules" id="minor" />
    </ConfigGroup>
    Ideally, this API can also return the config data in a formatted way.
     
    DanielYTK, jasonwynn10 and Awzaw like this.
  2. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    What about a virion?
     
    Irish likes this.
  3. falk

    falk Slime Poggit Reviewer

    Messages:
    75
    GitHub:
    falkirks
    Keep in mind pthreads has no support for resources and they are broken in the newer versions. So if you call socket_close you get a segmentation fault.
     
  4. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    Then how does RakLib work?
    You're only referring to sharing sockets among threads, right?
     
  5. falk

    falk Slime Poggit Reviewer

    Messages:
    75
    GitHub:
    falkirks
    That is a good point. That is probably what causes the issue.
     
  6. dktapps

    dktapps Administrator Staff Member PMMP Team

    Messages:
    774
    GitHub:
    dktapps
    I had a look at Volt recently... one of the issues with segfaults you're having is you are opening a socket in the constructor (in the main thread context) then using it in the thread body. That is unsafe.
     
    jasonwynn10 and SOFe like this.
  7. TheDiamondYT

    TheDiamondYT Zombie

    Messages:
    298
    GitHub:
    TheDiamondYT1
    Can you recommend an xaml extension for PHP?
     
  8. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    You know, with so many variants ofo binary distribution out there, we can't really create any standards.
    SimpleXML seems to be the most commonly available XML extension. I personally like XMLReader, but it's probably not so prevalently available.
     
    jasonwynn10 likes this.
  9. falk

    falk Slime Poggit Reviewer

    Messages:
    75
    GitHub:
    falkirks
    This is true. I never encountered any segfaults with that, but it is defintely unsafe. I changed that locally a while ago. But either way there is a segfault on socket_close for the individual client sockets, which is harder to avoid. I am assuming it is because the socket is generated in the parent thread using socket_accept and then passed on to the worker, so when the worker attempts to close it, bad stuff happens. I will see if I can work around that.
     
    dktapps and jasonwynn10 like this.
  10. dktapps

    dktapps Administrator Staff Member PMMP Team

    Messages:
    774
    GitHub:
    dktapps
    When pthreads 3.1.7 reaches a stable release, there's a new thread-safe Socket class we'll be able to have fun with.
     
    jasonwynn10 likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.