Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add logic to share reputation, funds and contracts between clients #3

Closed
gavazquez opened this issue Oct 29, 2016 · 22 comments
Closed

Comments

@gavazquez
Copy link
Member

gavazquez commented Oct 29, 2016

Subscribe to events:
GameEvents.OnFundsChanged
GameEvents.OnReputationChanged
GameEvents.OnScienceChanged
GameEvents.OnTechnologyResearched

In order to sync science, tech, reputation and tech nodes between clients.

Regarding contracts:
Subscribe to all events in GameEvents.Contract.XXX

We also need to create the tailored messages and systems in server and client.

IIR The contracts are stored in the scenario so they should be already synced between clients, otherwise is just a matter of fixing the scenario system

@TheDaltonTT
Copy link

Just downloaded the project yesterday, got a server up and poking around in the code. My friend and I, both coders, would love to start a career together with shared resources.

Any idea where to start for this enhancement?
Only been looking at the code base for maybe 30 minutes now so would love to hear any thoughts you had/which classes to start looking at first.

Thanks!

@gavazquez
Copy link
Member Author

gavazquez commented Nov 5, 2016

Well you should create a new system based on the existing ones (like Asteroid system for example). Then subscribe to the proper game events like "OnFundsChanged" and when this event happens, send a new message type to the server specifiying the new funds.

The server should also keep track of the funds at all times and send the funds when a client connects.

The same applies to science and so on

@ghost
Copy link

ghost commented Jul 10, 2017

How is this feature going so far? I can't get the mod syncrio to work right so having the feature run by the server itself would be perfect

@gavazquez
Copy link
Member Author

I've lost a bit the track of LMP and work + personnal life takes most of my time.
I hope to get some spare time soon but I made the code as simple as I could so everyone could fork my mod or push changes to this repository.

@meyer9
Copy link
Contributor

meyer9 commented Oct 23, 2017

I think I'm going to work on porting Syncrio over to this mod. Syncrio uses a ton of shared code from DMP/LUNA, so it shouldn't be too hard to do this. I've also gone through a lot of the Syncrio and DMP code so I have a decent understanding of how everything fits together.

@meyer9
Copy link
Contributor

meyer9 commented Oct 24, 2017

So, I've started this one. I realized we need a group system for this to work, so I've started adding one here: #33.

@gavazquez gavazquez assigned gavazquez and unassigned gavazquez Oct 24, 2017
@gavazquez
Copy link
Member Author

You changes look nice! I've just made them thread safe and adjusted the channels.
If you need help or you don't understand some part of the code just let me know

@ghost
Copy link

ghost commented Oct 26, 2017

Hey everyone, following up on what meyer9 said. I do agree that Syncrio could be ported over, and to be honest I always hoped Syncrio would be merged into DMP or LMP. And on that note, I'd like to help make that possible, but I'm not familiar with LMP code so I don't know how much help I will be. But if I can help in any way just let me know.

@gavazquez
Copy link
Member Author

Hi Caylis1397. At the end LMP is based on DMP but with the code refactored in smaller pieces.
I'm at the moment fixing other stuff in order to have a workable LMP that at least lets you play multiplayer without much bugs, once that's done definatelly I will look into syncing funds, science etc in case meyer9 didn't finished it.

@meyer9
Copy link
Contributor

meyer9 commented Oct 26, 2017

The group system isn't quite done, but once I finish that, I'll definitely start work on the science/funds system.

@RedLeafPatriot
Copy link

RedLeafPatriot commented Oct 26, 2017 via email

@gavazquez
Copy link
Member Author

gavazquez commented Oct 27, 2017

Added some documentation to the top, I don't know how the group system should be implemented as it involves screens and so on but sharing the science, contracts, funds and reputation shouldn't be very difficult

@gavazquez
Copy link
Member Author

Fixed the group system as it was not thread safe and was giving errors when we were connecting, also now they are stored as a file in case the server restarts.
The UI is not done anyway as I just wanted to make it work while I finish the movement and other stuff

@Restioson
Copy link

Hi! I'm looking into maybe perhaps helping out with this... what exactly still needs to be done after #33 ?

@gavazquez
Copy link
Member Author

gavazquez commented Feb 5, 2018

add UI for the groups, share reputation, funds and contracts and then fix all the other stuff so it works with groups.

@Restioson If you feel like helping out in coding go to the discord server so we can sort it out ;)

@Restioson
Copy link

@gavazquez I am on it already! Ping me sometime.

@Zer0t3ch
Copy link

If the group system ends up being prohibitively complicated for the moment: I think it would be completely reasonable to add the research sharing without it, for private servers to use if nothing else.

@MalteJanz
Copy link
Contributor

A very basic 'sharing mode' would be very awesome, so we can play with some friends together. Groups and competition is nice to have but not necessary for basic coop gameplay (that i would love to see in LMP because Syncrio and DMP are not working very good for me and my friend). Maybe something simple could be implemented in the near future and extended with groups afterwards, so people doesn't need to wait that long.

@MalteJanz
Copy link
Contributor

MalteJanz commented Mar 15, 2018

Update:
I have started to work on this issue yesterday and today i got the first funds synchronisation working. At the moment i am learning mostly how LunaMultiplayer and KSP mods working. So it could take some time until i figured the necessary things out (i got some experience in c#, unity and other languages). My plan is to get a basic 'ShareProgress' system running first and maybe later the group system could be integrated. If i get the things to work i will submit a pull request.

@gavazquez
Copy link
Member Author

Contact me on discord and we can sort things out

@MalteJanz
Copy link
Contributor

Update:
This pull request added the first functionality:
#117

Also there is now a branch for this issue called: SharePlayerProgress.
So if anybody want to help you can look into that branch (specific the ShareProgress System).

@gavazquez
Copy link
Member Author

This work has been done by Malte so I close this task, in case there are errors on this we can open new issues to deal with them

gavazquez pushed a commit that referenced this issue May 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants