Jump to content

xrystal

Sacred Game Modder
  • Posts

    59
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by xrystal

  1. On 12/4/2019 at 9:56 PM, NegativeOne said:

     If you find a nice way to replace sqlite with mysql or postgresql, please share. I don't have much time to experiment with that at the moment.

    'Nice' would be an exaggeration, but for now and simply testing these changes should do. If there are no other ideas on how to collaborate on this, you can just use the linked github repository which I used for experimenting with this and will continue to use so we can all utilize and improve the same lines of code without the hassle of file sharing (imho version control makes life easier a lot ;)).

    Mysql-Database Usage for now is simply an additional 5-line file "db.cfg" in the executable directory with the following format:

    DB_IP
    DB_PORT
    DB_NAME
    DB_USER
    DB_PASS

    Because of the dependency change from SQLite to MySQL however, it will probably not work right now with Linux (or at least not with the mentioned interop library which would have to be replaced with another one for MySQL), but if it does not yet runs ootb with another lib I am pretty sure to have that fixed for Linux by tomorrow, too, because I will have tested (and adjusted if necassary) it with your mono solution until then.

    [Edit]: Actually, that dependency causes no issues, MySQl.Data.MySqlClient seems to be available in mono, I could just run it with my existing installation to which I think I have not added any non default libs in the past.

    Later, I would like to add a more generic solution for configuration and also clean up the code a bit, but for now, it seems okay.

    • Respect! 1
  2. Hey, that's very nice, in a few days from a no-lobby-situation to being able to host everything under Linux. I really have to check that out.
    And yes, Mysql mostly works, I just have to fix one issue I could not get right yesterday with it and I will have time today evening or on the weekend for that.
    Maybe we should move the code to a public git repo? Seems akward if everybody works on his local copy and has to up- and download files selectivly... ;)

  3.  

    That is useful information NegativeOne, thanks. Glad to see that Public Domain Entry there, I oversaw that yesterday.

     

    On 12/2/2019 at 7:37 PM, NegativeOne said:

    I also wanted to test it with the CM Patch for Sacred 2 Gold, so I made this to enable the buttons on the multiplayer screen: https://www.dropbox.com/s/0kawzl5zkn99pwh/Sacred 2-CM-OpenNet-UI.7z?dl=1

    It's for CM Patch 1.60 and if you unpack it into the game directory, it will create this file:

    
    Sacred 2 Gold\pak\Windows\OutGameMenu\Internet.xml

     

    And that is even better, because I have zero knowledge regarding modding sacred2, so this will probably help a lot, I will check that out. If you want to test interaction between players alongside with these unknown packages, we could also meet up on a test server.

    Maybe we can take a few days to fiddle around with all these new possibilities and after that seeing how much resources the systems need to run fine and start a little public list or something alike regarding the things we need or can supply as individuals for a centralized community hosted infrastructure? Seeing how small the community is, it would probably be a good idea to keep the players together, I.e. don't split them over too many lobbies or servers but provide them as stable as possible with Sacred ;). I mean, this could be a perfect self hosted Christmas present to all of us... :D

    [Edit] FYI: Just in case someone did not know: The sacred 2 gameserver runs without additional configuration under linux within wine (just tested it on a debian stretch server). So you can host the lobby standalone on a windows machine and the gameservers on a separate one. This makes hosting a little bit cheaper as you need a server with a windows licence only for the lobby itself but not for its registered gameservers which will probably consume the most ressources (and at least for me that is also way less of a hassle to manage... ;)). For the lobby however it seems rather difficult to let it run in a non windows environment on the first glance, because of all this .NET stuff, but if it is only the lobby running on windows (even the database could be separated easily from windows by using another driver than sqlite and as a nice bonus would allow shared user accounts between lobby instances) it might be acceptable in terms of costs. I still want to experiment with that a little more.

    • Appreciation 1
  4. It took me a while because of networking and the weird issue that I needed to compile the debug target myself instead of the precompiled (release?) binary you provided (probably some missing dependencies on my side or something like that), but I was able to get this running under Win 10 and Windows Server 2016 or something like that. First I did a local test, then on the server and set up a lobby there and registered multiple game servers to it (not from localhost, but from a different location meaning even splitting the load between lobby and actual gameservers works which is great) - and accessed them successfully over WAN, so yes this works!

    Reconnecting to the lobby after tabbing out of the game seems to cause issues sometimes (connecting with no response), but those are solvable by providing wrong credentials once (which will trigger the "invalid parameter" response) and after that connecting will work again. But it is also possible, that this was already the case with the original lobby, as I remember, it was always a little bit wonky.

    In my opinion your work is pretty much the greatest contribution to Sacred 2 since the CM Patch, I can't say "thank you!" enough.

    Do you have any specific plans on public deployment if there are no serious bugs found after further testing? Or are we free to use your code to host services as we like? With a bit of coordination aside from private usage, we could create some kind of unofficial "hub" domain for game servers hosted by the community which would be epic. Also, if the CM-Patch guys are still active, they could probably bring back the "Open Net" Button which they removed from the Multiplayer menu which could allow usage not only for the base game, but also the more stable and better versions :P

    @ameaeth: Sorry for my massive delay with the VPN Server, but at least I have a perfect excuse now to delay that even further: The VPN will not be necessary anymore because we will have something way better now thanks to cocomed which is worth every server owners full attention ;)

    I have to go to work in four hours, so testing today ends here for me, but I probably have to start experimenting with dockerizing your application in the next days as I prefer my linux servers or rent  another windows machine if that is not possible.

    • Respect! 1
  5. On 11/9/2019 at 12:27 PM, ameaeth said:

    This sounds perfect and of course I'll wait for your notes patiently. I was sad that multiplayer wasn't really available anymore but if it works with a VPN maybe there is an option also to eventually have a Dark Matters community VPN for this purpose.  :superman:

    Regarding the idea of a community VPN, imho this is a rather difficult topic. Or at least, there are quite a few reasons I have avoided providing web services like that publicly in the past and currently only hosting them for close friends I know and trust (but feel free to soothe my mind on this ;)):

    Usually I would not only provide the peer-to-peer connection between clients, but also route all network traffic of the client over the VPN (including traffic of web browsing for example). On the one hand this simplifies the configuration effort on the client-side and on the other hand I remember a few cases client computers redirected part of the game network traffic wrong resulting in some games not working correctly over the VPN which I can circumvent by just forcing everything to resolve over my server. But of course, this means I have to install some kind of bandwidth quota for not having that one guy watching a youtube-stream at 8k-resolution or seeding a few torrents in the background ruin the fun of everyone else with latency spikes during gameplay.

    Also, there is legal stuff: If I provide a VPN, I am responsible for the traffic it routes. If somebody decides to not just use it for gaming but route illegal traffic over it instead, in the worst case I have to deal with it. Of course, I could try to at least be able to proof it is not my fault in case something bad happens by logging usage extensively and of course stating I prohibit such usage of my service, but that would lead straight to the next issue, namely protection of privacy and over engineered laws like our German DSGVO, meaning, I would have to provide some kind of opt-in / terms of service to be fine in terms of law.

    Furthermore, since everyone exposes his computer like in a local network to other participants of the same network, security issues arise. I remember someone once in a virtual network exposing his complete C:\ partition as a shared network drive without password protection. That was probably convenient for him in his home network to copy files from one pc to another, but is of course a complete disaster with unfamiliar internet users in the very same network. Briefly speaking, the VPN is just an additional risk for inexperienced internet users.

    Also, as the operator of such a server, it will consume quite some of your time to host it. Some Users will probably complain to you over certain issues which are caused by themselves, but can't be fixed by themselves needing you to support them like for example:
    - their own firewall blocking port 6800 for a hosted server
    - their antivirus snake-oil program decides to silently block your openvpn application but not tell anyone about it,
    - a broken* operating system which resets the network configuration all the time (*the user will claim his PC is alright :P)
    - that one special guy insisting you have to make your guide working for his beloved windows vista
    Such and other things are borderline fine for a few friends but a massive headache with dozens or hundreds of people... ;)

    Concerns like that led to my wish/hope to reverse engineer the old lobby network protocol instead of building various duct-tape services around it. It would be a safe network (for both server administrator and client), limited to network traffic of only Sacred itself and minimal to none client side effort.

    And btw. I think it might take me a few days more writing my stuff, because instead of just cleaning up my notes of my current setup (like I intended originally) it appears to me now like a much better approach to configure a fresh server from zero up and documenting what has to be done to do so (and actually checking it still works like intended a few years earlier), to be sure I don't miss out any things which might have been already configured on my currently running servers implicitly in the past but are also relevant for the networking of the VPN.

×
×
  • Create New...
Please Sign In or Sign Up