DoubleDeez / MDFramework

A multiplayer C# game framework for Godot 3.4 Mono.
https://discord.gg/UH49eHK
MIT License
76 stars 13 forks source link

Added PlayerName and fixed Vector class names #6

Closed Beider closed 4 years ago

Beider commented 4 years ago

The Vector extension class names do not match the file name so I fixed this. I also added PlayerName to the PlayerInfo and added a new event to GameSession that deals with a player name being changed.

Sorry about the diff on GameSession not sure how to fix that, I only added The event, function to call the event and removed the useless assignment from GetOrCreatePlayerObject(int PeerId)

Beider commented 4 years ago

I added a new feature so the MDGameSession can now optionally buffer packed scenes, this makes it a lot faster when instancing the same scene repeatedly over the network.

Beider commented 4 years ago

These changes can probably be ignored, with the exception of the enum fix for the log level. With the way the compare works Force actually logged nothing, now it logs everything as intended.

Beider commented 4 years ago

Added another feature, random name generation for network nodes. It is likely that you spawn multiple instances of the same scene (such as players) if you don't give them each a unique name then you will not have a good time.

If enabled this feature will check all existing networked nodes and if a collission is detected it will add a random number to the end of the name. Then run itself again to check that the new name does not conflict with any existing names.

DoubleDeez commented 4 years ago

There's some mismatch with indenting spaces vs tabs (the github diff shows it well) that needs fixing

Beider commented 4 years ago

Thanks for the hint, I fixed this now I think. I will have some time to work on networking this week and I had some ideas for some new features. I will outline them in the issues section

Beider commented 4 years ago

I just realized now that a bunch of my in progress code got tangled in here with my other code. Also I added a scene buffer that keeps scenes in memory instead of always loading from disc if active.

If this is too much of a pain to merge please let me know what I could do to help there.

Beider commented 4 years ago

Thanks for all the comments I see I left more of my local code in there I will fix it now before I head off to bed, should have it all done in half an hour or so I think.

DoubleDeez commented 4 years ago

Oh yeah, can you also squash them into 1 commit, including "Fixes #5" in the message.

Beider commented 4 years ago

That should be it.

Beider commented 4 years ago

There, never done a squash before but wasn't so bad. I hope all is correct now.

DoubleDeez commented 4 years ago

All good, I just realized GitHub has squashing integrated with merging PRs now so it's not necessary :P