xrystal 59 Posted January 2, 2020 Author Share Posted January 2, 2020 (edited) Hello @NegativeOne, after all this distracting Christmas and new-year stuff I have finally merged your changes... In the development branch they are now usable with the Mysql setup, too. However, since I see that Mysql might just be an additional hassle for most users - especially for those who just want to host a lobby directly under windows right out of the box -, I will make a patch soon which will render Mysql an configurable option but keep Sqlite as default database driver. So you don't need to setup Mysql but can keep working on your base or the branch I put your changes into . I will put everything together in case anything diverges afterwards and also try to make the configuration files a bit nicer to use. Those lobby changes will be applied to the testing server probably later today. I am currently setting up the new server which will replace the testing server in the long run and should have a few more mods supported. Edit: The changes are now on the lobby server and I have some issues with the lobby chat which sometimes is not connecting (still have to figure out depending on which condition the connections works or does not work). Since it locally seems fine, I assume the issues are solely related to networking in my hosting instance or might be related to my Mysql-merge, not your original diff. Also I noticed yesterday I totally oversaw you already wrote about the SqLite/MySql topic. I was too focused on your list of changes apparently, forgive me my ignorance. But good to read we think the same about that . Anyway that improved lobby looks already very nice, thank you. Edited January 3, 2020 by xrystal 1 Link to comment
NegativeOne 16 Posted January 3, 2020 Share Posted January 3, 2020 (edited) That sounds good. I'll try your updated lobby soon. The important question about the lobby to get answers for is if my changes work with multiple players in the lobby because I could only test it with 2 accounts on the same computer. I'm currently trying to understand how the buddy list and ignore list work, but so far I can't get it to work in the lobby. EDIT: Here is a small fix for the warning you get when multiple people log in to lobby chat: https://pastebin.com/w5BD1pmJ Edited January 3, 2020 by NegativeOne Link to comment
xrystal 59 Posted January 3, 2020 Author Share Posted January 3, 2020 2 hours ago, NegativeOne said: EDIT: Here is a small fix for the warning you get when multiple people log in to lobby chat: https://pastebin.com/w5BD1pmJ Nice, I put it into the repo and will apply it to the test server later on. Also, thanks again for your help with my ip configuration mess ;) Link to comment
firelite91 2 Posted April 7, 2020 Share Posted April 7, 2020 On 12/31/2019 at 2:21 PM, NegativeOne said: That was closed net and I don't think we will get that working. If you start the game server with parameters for closed net you will see an error message that states it's not supported. They probably had special servers for closed net and unless someone figures out what the differences are we have to stick to open net servers. I have almost set up a server on my own on linux, but I got the always restarting problem maybe bound to port misconfiguration on firewall or sorta kind of that. However I was thinking about a possible implementation of a closed net server. We may wrap the connection message sent by client into connection manager and redirecting it into an open server storing account name. In database table we may store that account's characters and allow users to only create new characters or use the local stored characters created directly on server lobby. Hoping on an answer, I'd like to have an advice for configuring iptables to allow connections. I'm using OVH as hosting provider. Kind Regards 1 Link to comment
Popular Post xrystal 59 Posted April 7, 2020 Author Popular Post Share Posted April 7, 2020 Hey @firelite91, you are not the first one to notice my rather lacking documentation, sorry for that I will try to make a few tutorials with videos + structured text and in general try to finish the things still on my todo-list, but for now, a few images should hopefully help you as well as they are the fastest way for me to provide you with an answer to host a server with my currently running lobby: I just tried it myself with a second server connecting to the lobby server and with an external gameserver host it works, with following configuration for example: First, firewall, in my case ufw but it should not be difficult to express that directly via iptables: 7100/udp ALLOW Anywhere # Gameservers Port For multiple servers, just open port ranges accordingly, for the the one example server I have chosen 7100 randomly. Then, the folder structure: Spoiler Spoiler The docker files (these are not from the repo but just a copy of the currently running config with my local adjustments, but they should not differ in terms of networking stuff ): Spoiler Spoiler Configure your instance(s); Spoiler SERVER_IP/SERVER_URL are the address of your ovh server. LOBBY_NAME/LOBBY_PASSWORD are from your created account. The LOBBY_IP is currently hex41.de (will change in the future) or your locally hosted instance if you have a complete lobby running yourself. Remember to set GS1_TYPE to the folder name of your sacred 2 gameserver files in case you are using another mod. Running it: Spoiler Spoiler Probably important: Since docker uses the kernel of its host and wine is rather fragile, I should mention that in my case the kernel of debian 9 (4.9.0-8-amd64) for example worked, while under debian 10 (4.19.0-6-amd64) wine would not be able to succesfully startup a server, so you might need to check out a different kernel depending on your situation. I have an additional VPS at OVH aswell, so if you have specific questions regarding that host, just ask and I might be able to test there. (and generally speaking, yes, this is not dead, time just passes by way too fast... ;)) 2 Link to comment
firelite91 2 Posted April 8, 2020 Share Posted April 8, 2020 I feel a bit awkward because I didn't get to put gameserver files into gs folder Tomorrow I'm going to put it online. I'm looking forward to work on the server side storing of characters. If you're used to any kind of instant messaging platform, I'd like to join you for leading me through better understanding on the server protocol used by gs for working on this subject. Have a good night! Link to comment
gogoblender 3,071 Posted April 8, 2020 Share Posted April 8, 2020 8 hours ago, firelite91 said: I have almost set up a server on my own on linux, but I got the always restarting problem maybe bound to port misconfiguration on firewall or sorta kind of that. However I was thinking about a possible implementation of a closed net server. We may wrap the connection message sent by client into connection manager and redirecting it into an open server storing account name. In database table we may store that account's characters and allow users to only create new characters or use the local stored characters created directly on server lobby. Hoping on an answer, I'd like to have an advice for configuring iptables to allow connections. I'm using OVH as hosting provider. Kind Regards Just here to say hello, hiya and welcome to DarkMatters! May the Sacred Serving be successful! gogo 1 Link to comment
xrystal 59 Posted April 8, 2020 Author Share Posted April 8, 2020 5 hours ago, firelite91 said: I'm looking forward to work on the server side storing of characters. If you're used to any kind of instant messaging platform, I'd like to join you for leading me through better understanding on the server protocol used by gs for working on this subject. Yeah sure, even through I am not entirely confident I will be able to actually help you with that undertaking in detail as I am not that deep into the reverse engineered code and I don't think ClosedNet will be an easy task. Actually, I am already amazed OpenNet works this good. Otherwise, a few months earlier even that seemed impossible, so... ;) Anyway, for everything I can give support for, just write me a private message with the name of the messenger you prefer and your contact data, I will just install & setup that one (because currently I just use things like Steam/TS3 for communication as none of my friends has used IRC and alike messenging for years rendering it kind of pointless for me even through I really liked those things... :P). Since I have tinkered the whole night with my server (luckily I have holidays right now :)), I will probably sleep over the day and be back online sometime in the evening, maybe ~10 hours from the time of this post or something like that. Btw., the Lobby URL has been updated from hex41.de to (this is an image because the forum messes around with this specific address) as I finally put most things together on the new server which did nothing but idle for the last three months - good to have been reminded of the things which had to be done ;). The old domain is currently still working, because I will continue to use it for testing and have not restricted the access, but it will probably not be usable anymore someday in the future, so use the new one instead from now on, please. That one will stay online. 1 Link to comment
firelite91 2 Posted April 8, 2020 Share Posted April 8, 2020 Actually I'm having problem starting the lobby. sacred2_charax_db | Version: '10.4.12-MariaDB-1:10.4.12+maria~bionic' socket: '/var/run/mysqld/mysqld.sock' port: 3306 mariadb.org binary distribution sacred2_charax_lb | [Log system ready] sacred2_charax_lb | sacred2_charax_lb | Unhandled Exception: sacred2_charax_lb | System.DllNotFoundException: System.Data.SQLite.dll assembly:<unknown assembly> type:<unknown type> member:(null) sacred2_charax_lb | at (wrapper managed-to-native) System.Data.SQLite.UnsafeNativeMethods.sqlite3_config_none(System.Data.SQLite.SQLiteConfigOpsEnum) This is my folder structure find . -name \* -print . ./gameserver.docker-compose.yml ./volume ./volume/lb ./volume/lb/BouncyCastle.Crypto.dll ./volume/lb/S2Lobby.exe.config ./volume/lb/S2Library.dll ./volume/lb/System.Data.SQLite.dll ./volume/lb/S2Lobby.exe ./volume/lb/lobby_log.txt ./volume/lb/ip.cfg ./volume/gs ./volume/gs/vanilla ./volume/gs/vanilla/pak ./volume/gs/vanilla/pak/spawn.zip ./volume/gs/vanilla/pak/generic.zip ./volume/gs/vanilla/pak/persector.zip ./volume/gs/vanilla/scripts ./volume/gs/vanilla/scripts/autoexec.txt ./volume/gs/vanilla/scripts/behaviour.txt ./volume/gs/vanilla/scripts/genMipMapInfo.txt ./volume/gs/vanilla/scripts/shared ./volume/gs/vanilla/scripts/shared/itemtype.txt ./volume/gs/vanilla/scripts/shared/typification.txt ./volume/gs/vanilla/scripts/shared/staticinfo.txt ./volume/gs/vanilla/scripts/shared/iteminfo.txt ./volume/gs/vanilla/scripts/shared/spells.txt ./volume/gs/vanilla/scripts/shared/material.txt ./volume/gs/vanilla/scripts/shared/defines.txt ./volume/gs/vanilla/scripts/shared/creatureinfo.txt ./volume/gs/vanilla/scripts/shared/books.txt ./volume/gs/vanilla/scripts/server ./volume/gs/vanilla/scripts/server/questscripts.txt ./volume/gs/vanilla/scripts/server/weather.txt ./volume/gs/vanilla/scripts/server/blueprint.txt ./volume/gs/vanilla/scripts/server/equipsets.txt ./volume/gs/vanilla/scripts/server/pathObjects.txt ./volume/gs/vanilla/scripts/server/spawn.txt ./volume/gs/vanilla/scripts/server/quest.txt ./volume/gs/vanilla/scripts/server/region.txt ./volume/gs/vanilla/scripts/server/heroes ./volume/gs/vanilla/scripts/server/heroes/dryadin.txt ./volume/gs/vanilla/scripts/server/heroes/templeguard.txt ./volume/gs/vanilla/scripts/server/heroes/seraphim.txt ./volume/gs/vanilla/scripts/server/heroes/centurio.txt ./volume/gs/vanilla/scripts/server/heroes/highelve.txt ./volume/gs/vanilla/scripts/server/heroes/inquisitor.txt ./volume/gs/vanilla/scripts/server/heroes/dragonmage.txt ./volume/gs/vanilla/scripts/server/waypoints.txt ./volume/gs/vanilla/scripts/server/triggerarea.txt ./volume/gs/vanilla/scripts/server/faction.txt ./volume/gs/vanilla/scripts/server/portals.txt ./volume/gs/vanilla/scripts/server/worldobjects.txt ./volume/gs/vanilla/scripts/server/worldobjecthints.txt ./volume/gs/vanilla/scripts/server/treasure.txt ./volume/gs/vanilla/scripts/server/weaponpool.txt ./volume/gs/vanilla/scripts/server/creatures.txt ./volume/gs/vanilla/scripts/server/triggervolumes.txt ./volume/gs/vanilla/scripts/server/respawn.txt ./volume/gs/vanilla/scripts/server/spawnpos.txt ./volume/gs/vanilla/scripts/server/drop.txt ./volume/gs/vanilla/scripts/server/balance.txt ./volume/gs/vanilla/scripts/landscape.txt ./volume/gs/vanilla/scripts/startPos.txt ./volume/gs/vanilla/scripts/roadmap.txt ./volume/gs/vanilla/scripts/heightmap.txt ./volume/gs/vanilla/system ./volume/gs/vanilla/system/plugin_win32platform.dll ./volume/gs/vanilla/system/orcSystem.dll ./volume/gs/vanilla/system/plugin_filesystem.dll ./volume/gs/vanilla/system/memmgr.dll ./volume/gs/vanilla/system/s2gs.exe ./volume/gs/vanilla/system/s2core.dll ./volume/gs/vanilla/system/zlib1.dll ./volume/gs/vanilla/system/tincat3.dll ./volume/gs/vanilla/system/plugins_srv.cfg ./volume/gs/vanilla/system/s2logicdll.dll ./volume/gs/vanilla/system/s2logic.dll ./volume/gs/vanilla/system/plugin_filezip.dll ./volume/gs/vanilla/system/s2vista.dll ./volume/gs/vanilla/system/stlport.5.0.dll ./volume/db ./volume/db/multi-master.info ./volume/db/ib_buffer_pool ./volume/db/ib_logfile1 ./volume/db/aria_log_control ./volume/db/mysql ./volume/db/mysql/* ./lobby.docker-compose.yml ./.env ./gameserver.dockerfile 1 Link to comment
azukaar 1 Posted April 23, 2020 Share Posted April 23, 2020 Hello everyone! Let me start by saying this is PURE GOLD! I was actually considering writting the same thing, I'm so glad someone did it. I've been trying around and here's the experience so far: -The login / listing works well! - If I create a game myself, and my friend tries to connect (and vice versa) we get a 61 error code, "login failed" (not a port issue, same thing with DMZ activated) - If I try to join any online server, the game just crash I am using Win10, CM 1.60 & all DLC (Sacred 2 Gold). I havent been able to play multiplayer yet, but I can see we're getting very close, this is super exciting ! Thanks for the hard work, and thanks in advance if anyone can provide some help on why this is happening cheers 1 Link to comment
Flix 5,116 Posted April 23, 2020 Share Posted April 23, 2020 Welcome to DarkMatters azukaar, I hope you enjoy your time on the boards and with these wonderful games. I haven't yet used this impressive piece of coding myself, but here's hoping you get up this multiplayer and running. 1 Link to comment
gogoblender 3,071 Posted April 24, 2020 Share Posted April 24, 2020 5 hours ago, azukaar said: Hello everyone! and thanks in advance if anyone can provide some help on why this is happening cheers Hello friend, and welcome to DarkMatters! I'm always floored by the fans' love for this game. For more than a decade now and still going...there always seems to be a new project that someone has taken up with passion. We're happy you have made your way to these boards, and I'm sure these valiant coders are grateful for your recognition. Keep enjoying Sacred gogo Link to comment
xrystal 59 Posted April 24, 2020 Author Share Posted April 24, 2020 (edited) 8 hours ago, azukaar said: - If I create a game myself, and my friend tries to connect (and vice versa) we get a 61 error code, "login failed" (not a port issue, same thing with DMZ activated) - If I try to join any online server, the game just crash Hi azukaar, I have just looked into it and can confirm there was a server-side issue with joining. I didn't notice it as it caused no entry in the log files. Sorry for the inconvenience, if you don't mind, please try again to join a gamserver and report back if it works now as expected. For the self hosted server, maybe that was related to the same issue as well, if you are sure about the port redirection beeing fine. Usually, this error arises if the server cannot be reached from the client which tries to connect to it. Edited April 24, 2020 by xrystal 1 Link to comment
azukaar 1 Posted April 24, 2020 Share Posted April 24, 2020 Hey thanks a lot Flix and Globo ! Cheers Xrystal, I have been able to connect to the available servers, it works! Amazing I still have the 61 when connecting to my own game, I have forwarded the port 7011 which is the one that is usd by default, may be I need to more port than that? I would assume DMZ would have worked then Thanks this is great, let me know if I can help with anything around the code BTW Cheers Link to comment
xrystal 59 Posted May 11, 2020 Author Share Posted May 11, 2020 Hey, just a little update on a short notice as I just got the email notificiation I have been waiting for a very long time: Of course after all this time it had to happen of all things on a monday morning! But this evening when I am back from work I should be able to finally get it ready and update quite a bit of outdated information. After that domain is configured then, no one will need to change a URL in his config files anymore, it will just work because that domain I finally got registered is the original offical lobby address, which will very soon point to the emulated one. It is all coming back together, horray! 1 Link to comment
gogoblender 3,071 Posted May 11, 2020 Share Posted May 11, 2020 very appreciated, and kind work for the Sacred Community... can't believe its going to happen Thanks Xrystal! gogo Link to comment
Popular Post xrystal 59 Posted May 11, 2020 Author Popular Post Share Posted May 11, 2020 So, full 'story': Almost half a year ago now, as soon as this all started to look like 'it might just work...' (when cocomed posted his source code and Negative One his bugfixes), I made an initial offer on a domain trading platform to the owner of the original sacred2 lobby. I am used to simply buy any cheap, random domain which fits my purpose and is registered fast if I happen to need one. The occassion never occured to me that I felt compelled to go after a very specfic one already belonging to someone else. And well, nothing much of relevance happened for quite a while. But somehow, a few weeks ago, I got an email alert stating that my offer had been accepted. And today (or yesterday, appearently me typing this took too long :)), after going through a mindshattering slow process of waiting, reading, waiting, writing and constantly hoping for an answer or event to happen and please not abort the whole transfer to my registrar it is finally completed successfully. Yes! Why is this wonderful? Having control of the sacred2.net domain which is embedded by default into the games config files allows me to make a lobby instance way more accessible to the average player who does not know about the forums, obscure titled threads like this one or did not even want to mess with configfiles of his brand new game. But nethertheless 'out of the box' a clean sacred2 installation running without any modifications will be provided now with the emulated lobby the technically same way like with the original one back then. No one will be spared I know none of this is about lobby coding itself (after all, I am still in debt of at least some small promised & postponed improvements to the lobby ;)), but yet I think in the meanwhile getting some more players to actually know about this and giving those who just want to play together a nice playground will have it's purpose, too. It would be kind of a waste to just tinker on this in some dark forums corner with only a few enthusiasts experimenting with it while it could be already out there doing it's job good enough for most ;) For those who are already using my s2cm domain, nothing changes, because sacred2.net redirects now to the same servers. Whoever has a mod installed, which is the only minor nuisance remaining, might still need that additional file for the OpenNet button. But that is the only client side hassle remaining at all now and I guess if the modders see this working reliable enough they might be willing to enable the multiplayer buttons in their next releases by default again if asked kindly. The opening post has been updated, title and thread tags, too, to make it a bit more appealing to actual players and easier to find for them. After all, since you have already been so nice to pin this, it might catch a few eyes more that way. Seems like this also has reset thread following, whoops. As far as I have been able to gather the list of subdomains, eu.sacred2.net:6800 es.sacred2.net:6810 ru.sacred2.net:6820 ee.sacred2.net:6850 us.sacred2.net:6900 should be all combinations of ports and domain this needs to cover to work for everyone. Please write me if some country specific url is missing. I will try to do a few minor improvements, especially to documentation soon, but aside from that, I will probably just play for a while and will meet you all on the servers, I suppose... ;) 1 1 Link to comment
Flix 5,116 Posted May 11, 2020 Share Posted May 11, 2020 10 minutes ago, xrystal said: Whoever has a mod installed, which is the only minor nuisance remaining, might still need that additional file for the OpenNet button. But that is the only client side hassle remaining at all now and I guess if the modders see this working reliable enough they might be willing to enable the multiplayer buttons in their next releases by default again if asked kindly. Yes I can do that. It should never have been removed IMO. 1 Link to comment
Popular Post ALK 8 Posted May 20, 2020 Popular Post Share Posted May 20, 2020 (edited) On 5/12/2020 at 1:16 AM, xrystal said: eu.sacred2.net:6800 es.sacred2.net:6810 ru.sacred2.net:6820 ee.sacred2.net:6850 us.sacred2.net:6900 hi Xrystal, thx, works fine! its me "imba perception" I can’t believe that the original network is back, super Edited May 20, 2020 by ALK 2 Link to comment
Dax 481 Posted May 21, 2020 Share Posted May 21, 2020 Outstanding work, Xrystal! Lets see when the first recorded MP sessions arrive on youtube. 1 Link to comment
xrystal 59 Posted June 1, 2020 Author Share Posted June 1, 2020 (edited) Fyi, if you encounter a bug or have feature requests of any kind, you can of course post them here, but also in case you are used to github, you could as well put those directly in it's related issue section. I track every known bug or possible improvements in the usual feature branch workflow manner there. Not only, to keep it transparent and easy to get into it or to get a quick overview of "construction sites" in case somebody is interested in joing the codeing, but even more as a reliable reminder to myself about what I actually wanted to do every now and then*... As you can see there are a few things I still want to change and most of them are related to server side infrastructure, I.e. easier deploy and better monitoring of server health and status. Quality-of-life stuff for hosting in general. For the client side, the currently rather static server list (docker .env file) is sometimes not optimal. Because for example, due to most players playing with new characters, at some peek times at weekends the bronze or silver campagin servers were either full or not usable for everyone because the single server beeing active for a selected difficulty was not of their alignment (for example having a shadow char but everyone else plays light and thus "blocks" the campaign server for shadow players). Accordingly, the thing I am working on right now is a small daemon which will start additional instances of server configurations on demand saving me from having to keep more servers open than actually needed by default, but still being able to have more room whenever needed. Since this is technically optional and I dont want to pollute the lobby code more than neccassary with my additional requirements, that daemon will run in a separate process. As a nice side effect, because I need a communication layer between those two and feel like a separete database will fullfill that purpose better than a direct api, it will most likely be possible to use that additional database to provide an external list of servers on some web page as well with the same list of servers as ingame but viewable in your browser. *btw. now working on it again, I finally did the small change from the text config file to a xml file - just to notice that the .config files for .NET applications really lack flexibillity and even if they are an improvement I still don't really like them, but well, better than before at least... Edited June 1, 2020 by xrystal 1 Link to comment
Popular Post NegativeOne 16 Posted June 18, 2020 Popular Post Share Posted June 18, 2020 On 5/11/2020 at 8:51 AM, xrystal said: Hey, just a little update on a short notice as I just got the email notificiation I have been waiting for a very long time: Very great, you said you wanted to get the domain and now you have it. This will make more people play online again. Opennet is not closenet but it is better than using a vpn to play the lan mode. 2 Link to comment
gogoblender 3,071 Posted June 18, 2020 Share Posted June 18, 2020 wow, nice domain! gogo Link to comment
Popular Post ameaeth 50 Posted June 19, 2020 Popular Post Share Posted June 19, 2020 (edited) Hi @xrystal , @NegativeOne , @cocomed and everyone else. I'm speechless and completely amazed of all the the phenomenal work and dedication that is being shown since this topic started! And I'm really exited to start testing the online servers. Since I relocated to the Philippines half a year ago I have to check though how the latency is. Thanks so much everyone! Edit: I tested the servers yesterday and it worked flawless. Played in coop with a character named 'Lady Dank' and saw a few more playing on other servers. So good to have it back. Even latency logging in from Philippines didn't seem too bad, just had to hit the health pot button a little earlier sometimes. Edited June 20, 2020 by ameaeth 2 Link to comment
Popular Post xcessive 55 Posted June 22, 2020 Popular Post Share Posted June 22, 2020 (edited) Great work guys! I tested it today and holy - the Sacred 2 nostalgia kicked in so hard!!! Ameaeth was there and others as well. We had a campaign server with 5 players, And there were players on other servers, too. So yeah, I agree that this is the best thing that happened to the community since the Community Patch. I would also like to play on hardcore servers, if that is not too much trouble. You wrote earlier, that you didnt want to have too many unused servers open - and this would double the server number. But since you already have an option to add more servers, when the current ones are used, maybe the harcore servers can just be hosted whenever a hardcore character is in the open net lobby. But thats just an uneducated idea, Anyways, thanks a lot for this! I am really looking forward to play this game excessively again And maybe I will finally get my first Kiras Wall and Khrals Screptre, that I have hunted for years without luck. Edited June 22, 2020 by xcessive 1 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now