GithubHelp home page GithubHelp logo

lunamultiplayer / lunamultiplayer Goto Github PK

View Code? Open in Web Editor NEW
418.0 418.0 150.0 292.66 MB

Multiplayer mod for Kerbal Space Program (KSP)

Home Page: http://www.lunamultiplayer.com

License: MIT License

C# 99.02% Smalltalk 0.50% Batchfile 0.17% CSS 0.04% JavaScript 0.15% PowerShell 0.12%
dmp kerbal kerbal-space kerbal-space-program kerbalspaceprogram kmp ksp lidgren lmp luna lunamultiplayer mod multiplayer udp

lunamultiplayer's Introduction

Luna multiplayer logo Video Video

PayPal Chat on discord Latest release Total downloads

KSP forum post Latest build updater


Download Documentation


Luna Multiplayer Mod (LMP)

Multiplayer mod for Kerbal Space Program (KSP)

Main features:

  • Clean and optimized code, based on systems and windows which makes it easier to read and modify.
  • Multi threaded.
  • NTP protocol to sync the time between clients and the server.
  • UDP based using the Lidgren library for reliable UDP message handling.
  • Interpolation so the vessels won't jump when there are bad network conditions.
  • Multilanguage.
  • Nat-punchtrough feature so a server doesn't need to open ports on it's router.
  • IPv6 support for client<->server connections, allowing connection setup even behind symmetric IPv4 NAT
  • Servers displayed within the mod.
  • Settings saved as XML.
  • UPnP support for servers and master servers
  • Better creation of network messages so they are easier to modify and serialize.
  • Every network message is cached in order to reduce the garbage collector spikes.
  • Based on tasks instead of threads.
  • Supports career and science modes (funds, science, strategies, etc are shared between all players).
  • Cached QuickLZ for fast compression without generating garbage.
  • Support for groups/companies inside career and science modes.

Please check the wiki to see how to install, run, build or debug LMP among other things


Troubleshooting:

Please visit this page in the wiki to solve the most common issues with LMP Analytics


Contributing:

Consider donating trough paypal if you like this project. It will encourage us to do future releases, fix bugs and add new features ⭐

Please write the code as you were going to leave it, return after 1 year and you'd have to understand what you wrote.
It's very important that the code is clean and documented so in case someone leaves, another programmer could take and maintain it. Bear in mind that nobody likes to take a project where it's code looks like a dumpster.

There's also a test project in case you want to add tests to your code.


Servers:

You can check how many servers are up and running either in Release or in Nightly versions through our master servers

Master server Release Nightly
Dagger Release servers Nightly servers
Tekbot Release servers Nightly servers
Angryjoshi Release servers Nightly servers
Bloodfallen Release servers Nightly servers

Status:

Branch Build Tests Last commit Activity Commits
master AppVeyor AppVeyor Tests Last commit Commit activity Commits since release

Build history


Email: gavazquez@gmail.com License

lunamultiplayer's People

Contributors

abritinspace avatar alchemicalagent avatar alexfaraino avatar alfred-pictocube avatar celestialorb avatar checha35 avatar cominixo avatar dasskelett avatar dazoe avatar emlynlj avatar fierce-cat avatar gavazquez avatar godarklight avatar imrandoet avatar janepixel avatar llacqie avatar lothsahn avatar maltejanz avatar meyer9 avatar p0nch00 avatar pashagamesold avatar sladernimo avatar the-rene avatar thehellbox avatar thygrrr avatar toys0125 avatar wjezowski avatar zarlo avatar zivoy avatar zoombahh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lunamultiplayer's Issues

Add a system for syncinc kerbals in a vessel

Errors:

  1. If you recover a vessel, it's crew goes to KIA
  2. If you board a controlled vessel, the vessel controller won't have his portraits updated (he will still see only 1 kerbal)
  3. If you are spectating a vessel you should not be able to go on EVA (check BlockAllControls variable)
  4. If a kerbal is transferred inside a vessel or goes to eva the new vessel definition is sent but on the clients the new vessel must be reloaded

Tracking is lost when in visual view of other client

LMP testing 11/05/16 commit 126ca48
Here is the setup:
1 client on MUN landed
2nd client in orbit
Each client targets the other all is well.
Client in orbit warps a little closer both clients sync all is well (nice work btw :P)
Server has mod control DISABLED and is ran locally lan
The BUG:
Upon getting close to the landed client from orbit, what I call visual range(the range is consistant everytime). Tracking is lost everything goes haywire. DMP had same problem and I believe it has carried over to LMP as well. I dont know if it is a sync issue or what. Time warp worked flawlessly.
IMO it has something to do with the ship/parts when it transitions from to far away and just a reticle to actually being rendered as visible to the other client. You can see in the video the landing clients capsule becomes part of the landed ship's ship
LOGS:
KSP_Client _landed.txt
KSP_client in orbit.txt
VIDEO:
https://www.youtube.com/watch?v=WL-Kj4x4oVc

Rewrite the window framework and the windows of LMP

At the moment all the screens are recreated on every GUI frame as it was done before KSP 1.1
This is a really bad approach as it generates tons of garbage if the window is being shown

The new screens should be migrated to the new UI system as described here:
https://forum.kerbalspaceprogram.com/index.php?/topic/151354-unity-ui-creation-tutorial/

At least the "Status window" that is the window that is displayed all the time while flying should be moved to this new system the other screens are not so important

Sync kerbals between clients

Kerbals are not in sync with the other players.

Ideally when a player "takes" a kerbal it should not be available to be used by other players

Random ship explosions occur along with NullReferenceExceptions

Here's a snippet of my KSP.log file. The explosion occurred at 15:11:23 in the log. After that happens, this error occurs repeatedly in the log file:
[EXC 15:11:24.516] NullReferenceException: Object reference not set to an instance of an object
Part.OnCollisionStay (UnityEngine.Collision c)

[LOG 15:11:03.367] Camera Mode: FREE
[LOG 15:11:03.579] Camera Mode: ORBITAL
[LOG 15:11:03.757] Camera Mode: CHASE
[LOG 15:11:04.231] Camera Mode: LOCKED
[EXC 15:11:23.558] NullReferenceException: Object reference not set to an instance of an object
ProtoPartSnapshot.Load (.Vessel vesselRef, Boolean loadAsRootPart)
ProtoVessel.LoadObjects ()
Vessel.Load ()
Vessel.Update ()
[EXC 15:11:23.562] NullReferenceException: Object reference not set to an instance of an object
Part.GetModuleStartState ()
Part.ModulesOnStart ()
Part+c__Iterator38.MoveNext ()
UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)
[EXC 15:11:23.580] NullReferenceException: Object reference not set to an instance of an object
ModuleAnimateGeneric.FixedUpdate ()
[EXC 15:11:23.587] NullReferenceException: Object reference not set to an instance of an object
Part.OnCollisionExit (UnityEngine.Collision c)
[LOG 15:11:23.597] [LMP]: OVC Hairie Kerman belongs to c2e2c642-3b03-43f2-9d5a-3731df447a6a
[LOG 15:11:23.604] [LMP]: OVC Camzon Kerman belongs to c2e2c642-3b03-43f2-9d5a-3731df447a6a
[LOG 15:11:23.612] [LMP]: OVC Iralla Kerman belongs to c2e2c642-3b03-43f2-9d5a-3731df447a6a
[LOG 15:11:23.619] [LMP]: OVC Julma Kerman belongs to c2e2c642-3b03-43f2-9d5a-3731df447a6a
[LOG 15:11:23.642] [LMP]: OVC Hairie Kerman belongs to c2e2c642-3b03-43f2-9d5a-3731df447a6a
[LOG 15:11:23.652] [LMP]: OVC Camzon Kerman belongs to c2e2c642-3b03-43f2-9d5a-3731df447a6a
[LOG 15:11:23.663] [LMP]: OVC Iralla Kerman belongs to c2e2c642-3b03-43f2-9d5a-3731df447a6a
[LOG 15:11:23.671] [LMP]: OVC Julma Kerman belongs to c2e2c642-3b03-43f2-9d5a-3731df447a6a
[LOG 15:11:23.685] [LMP]: OVC Hairie Kerman belongs to c2e2c642-3b03-43f2-9d5a-3731df447a6a
[LOG 15:11:23.694] [LMP]: OVC Camzon Kerman belongs to c2e2c642-3b03-43f2-9d5a-3731df447a6a
[LOG 15:11:23.703] [LMP]: OVC Iralla Kerman belongs to c2e2c642-3b03-43f2-9d5a-3731df447a6a
[LOG 15:11:23.711] [LMP]: OVC Julma Kerman belongs to c2e2c642-3b03-43f2-9d5a-3731df447a6a
[LOG 15:11:23.728] [LMP]: OVC Hairie Kerman belongs to c2e2c642-3b03-43f2-9d5a-3731df447a6a
[LOG 15:11:23.736] [LMP]: OVC Camzon Kerman belongs to c2e2c642-3b03-43f2-9d5a-3731df447a6a
[LOG 15:11:23.743] [LMP]: OVC Iralla Kerman belongs to c2e2c642-3b03-43f2-9d5a-3731df447a6a
[LOG 15:11:23.750] [LMP]: OVC Julma Kerman belongs to c2e2c642-3b03-43f2-9d5a-3731df447a6a
[LOG 15:11:23.765] [LMP]: OVC Hairie Kerman belongs to c2e2c642-3b03-43f2-9d5a-3731df447a6a
[LOG 15:11:23.771] [LMP]: OVC Camzon Kerman belongs to c2e2c642-3b03-43f2-9d5a-3731df447a6a
[LOG 15:11:23.778] [LMP]: OVC Iralla Kerman belongs to c2e2c642-3b03-43f2-9d5a-3731df447a6a
[LOG 15:11:23.784] [LMP]: OVC Julma Kerman belongs to c2e2c642-3b03-43f2-9d5a-3731df447a6a
[LOG 15:11:23.797] [LMP]: OVC Hairie Kerman belongs to c2e2c642-3b03-43f2-9d5a-3731df447a6a
[LOG 15:11:23.804] [LMP]: OVC Camzon Kerman belongs to c2e2c642-3b03-43f2-9d5a-3731df447a6a
[LOG 15:11:23.810] [LMP]: OVC Iralla Kerman belongs to c2e2c642-3b03-43f2-9d5a-3731df447a6a
[LOG 15:11:23.821] [LMP]: OVC Julma Kerman belongs to c2e2c642-3b03-43f2-9d5a-3731df447a6a
[LOG 15:11:23.834] [LMP]: OVC Hairie Kerman belongs to c2e2c642-3b03-43f2-9d5a-3731df447a6a
[LOG 15:11:23.841] [LMP]: OVC Camzon Kerman belongs to c2e2c642-3b03-43f2-9d5a-3731df447a6a
[LOG 15:11:23.847] [LMP]: OVC Iralla Kerman belongs to c2e2c642-3b03-43f2-9d5a-3731df447a6a
[LOG 15:11:23.853] [LMP]: OVC Julma Kerman belongs to c2e2c642-3b03-43f2-9d5a-3731df447a6a
[LOG 15:11:23.866] [LMP]: OVC Hairie Kerman belongs to c2e2c642-3b03-43f2-9d5a-3731df447a6a
[LOG 15:11:23.872] [LMP]: OVC Camzon Kerman belongs to c2e2c642-3b03-43f2-9d5a-3731df447a6a
[LOG 15:11:23.878] [LMP]: OVC Iralla Kerman belongs to c2e2c642-3b03-43f2-9d5a-3731df447a6a
[LOG 15:11:23.885] [LMP]: OVC Julma Kerman belongs to c2e2c642-3b03-43f2-9d5a-3731df447a6a
[EXC 15:11:23.924] NullReferenceException: Object reference not set to an instance of an object
ModuleAnimateGeneric.FixedUpdate ()
[EXC 15:11:23.959] NullReferenceException: Object reference not set to an instance of an object
Part.OnCollisionExit (UnityEngine.Collision c)
[EXC 15:11:23.961] NullReferenceException: Object reference not set to an instance of an object
Part.OnCollisionExit (UnityEngine.Collision c)
[EXC 15:11:23.964] NullReferenceException: Object reference not set to an instance of an object
Part.OnCollisionExit (UnityEngine.Collision c)
[EXC 15:11:23.966] NullReferenceException: Object reference not set to an instance of an object
Part.OnCollisionExit (UnityEngine.Collision c)
[EXC 15:11:23.968] NullReferenceException: Object reference not set to an instance of an object
Part.OnCollisionExit (UnityEngine.Collision c)
[EXC 15:11:23.969] NullReferenceException: Object reference not set to an instance of an object
Part.OnCollisionExit (UnityEngine.Collision c)
[EXC 15:11:23.971] NullReferenceException: Object reference not set to an instance of an object
Part.OnCollisionExit (UnityEngine.Collision c)
[EXC 15:11:23.972] NullReferenceException: Object reference not set to an instance of an object
Part.OnCollisionExit (UnityEngine.Collision c)
[EXC 15:11:23.973] NullReferenceException: Object reference not set to an instance of an object
Part.OnCollisionExit (UnityEngine.Collision c)
[EXC 15:11:23.974] NullReferenceException: Object reference not set to an instance of an object
Part.OnCollisionExit (UnityEngine.Collision c)
[EXC 15:11:23.976] NullReferenceException: Object reference not set to an instance of an object
Part.OnCollisionExit (UnityEngine.Collision c)
[EXC 15:11:23.977] NullReferenceException: Object reference not set to an instance of an object
Part.OnCollisionExit (UnityEngine.Collision c)
[EXC 15:11:23.979] NullReferenceException: Object reference not set to an instance of an object
Part.OnCollisionExit (UnityEngine.Collision c)
[EXC 15:11:23.980] NullReferenceException: Object reference not set to an instance of an object
Part.OnCollisionExit (UnityEngine.Collision c)
[EXC 15:11:23.981] NullReferenceException: Object reference not set to an instance of an object
Part.OnCollisionExit (UnityEngine.Collision c)
[EXC 15:11:23.982] NullReferenceException: Object reference not set to an instance of an object
Part.OnCollisionExit (UnityEngine.Collision c)
[LOG 15:11:23.984] [F: 47718]: wingStrake collided into mk3CargoBayM - relative velocity: 42.70987 - impact momentum: 128.1
[LOG 15:11:23.988] wingStrake Exploded!! - blast awesomeness: 0.1
[LOG 15:11:23.992] [wingStrake]: Deactivated
[LOG 15:11:24.000] [F: 47718]: airlinerCtrlSrf collided into airlinerMainWing - relative velocity: 28.27601 - impact momentum: 101.9
[LOG 15:11:24.004] [Explosion] Combined.
[LOG 15:11:24.010] airlinerCtrlSrf Exploded!! - blast awesomeness: 0.1
[LOG 15:11:24.016] [airlinerCtrlSrf]: Deactivated
[LOG 15:11:24.026] [F: 47718]: airlinerMainWing collided into turboFanSize2 - relative velocity: 20.57582 - impact momentum: 92.9
[LOG 15:11:24.030] [Explosion] Combined.
[LOG 15:11:24.034] airlinerMainWing Exploded!! - blast awesomeness: 0.1
[LOG 15:11:24.063] [airlinerMainWing]: Deactivated
[LOG 15:11:24.069] [F: 47718]: elevon5 collided into mk3CargoBayM - relative velocity: 17.83668 - impact momentum: 53.5
[LOG 15:11:24.073] [Explosion] Combined.
[LOG 15:11:24.078] elevon5 Exploded!! - blast awesomeness: 0.1
[LOG 15:11:24.082] [elevon5]: Deactivated
[LOG 15:11:24.088] [F: 47718]: deltaWing collided into mk3CargoBayM - relative velocity: 28.66253 - impact momentum: 86.0
[LOG 15:11:24.093] [Explosion] Combined.
[LOG 15:11:24.097] deltaWing Exploded!! - blast awesomeness: 0.1
[LOG 15:11:24.101] [deltaWing]: Deactivated
[LOG 15:11:24.106] [F: 47718]: wingShuttleDelta collided into mk3CargoBayM - relative velocity: 29.34482 - impact momentum: 88.0
[LOG 15:11:24.110] [Explosion] Combined.
[LOG 15:11:24.113] wingShuttleDelta Exploded!! - blast awesomeness: 0.1
[LOG 15:11:24.129] [wingShuttleDelta]: Deactivated
[EXC 15:11:24.135] NullReferenceException: Object reference not set to an instance of an object
Part.OnCollisionExit (UnityEngine.Collision c)
[EXC 15:11:24.137] NullReferenceException: Object reference not set to an instance of an object
Part.OnCollisionExit (UnityEngine.Collision c)
[EXC 15:11:24.138] NullReferenceException: Object reference not set to an instance of an object
Part.OnCollisionExit (UnityEngine.Collision c)
[LOG 15:11:24.140] [F: 47718]: wingConnector2 collided into mk3CargoBayM - relative velocity: 34.04583 - impact momentum: 102.1
[LOG 15:11:24.144] [Explosion] Combined.
[LOG 15:11:24.149] wingConnector2 Exploded!! - blast awesomeness: 0.1
[LOG 15:11:24.155] [strutConnector]: Deactivated
[LOG 15:11:24.162] [wingConnector2]: Deactivated
[LOG 15:11:24.168] [F: 47718]: wingShuttleDelta collided into mk3CargoBayM - relative velocity: 29.01835 - impact momentum: 87.1
[LOG 15:11:24.172] [Explosion] Combined.
[LOG 15:11:24.177] wingShuttleDelta Exploded!! - blast awesomeness: 0.1
[LOG 15:11:24.183] [wingShuttleDelta]: Deactivated
[LOG 15:11:24.189] [F: 47718]: deltaWing collided into mk3CargoBayM - relative velocity: 28.9845 - impact momentum: 87.0
[LOG 15:11:24.193] [Explosion] Combined.
[LOG 15:11:24.197] deltaWing Exploded!! - blast awesomeness: 0.1
[LOG 15:11:24.206] [deltaWing]: Deactivated
[LOG 15:11:24.211] [F: 47718]: airlinerCtrlSrf collided into mk3CargoBayM - relative velocity: 16.70443 - impact momentum: 50.1
[LOG 15:11:24.215] [Explosion] Combined.
[LOG 15:11:24.219] airlinerCtrlSrf Exploded!! - blast awesomeness: 0.1
[LOG 15:11:24.224] [airlinerCtrlSrf]: Deactivated
[LOG 15:11:24.231] [F: 47718]: wingConnector2 collided into mk3CargoBayM - relative velocity: 26.19898 - impact momentum: 78.6
[LOG 15:11:24.235] [Explosion] Combined.
[LOG 15:11:24.241] wingConnector2 Exploded!! - blast awesomeness: 0.1
[LOG 15:11:24.256] [strutConnector]: Deactivated
[LOG 15:11:24.265] [wingConnector2]: Deactivated
[LOG 15:11:24.271] [F: 47718]: wingStrake collided into mk3CargoBayM - relative velocity: 44.40771 - impact momentum: 133.2
[LOG 15:11:24.275] [Explosion] Combined.
[LOG 15:11:24.280] wingStrake Exploded!! - blast awesomeness: 0.1
[LOG 15:11:24.284] [wingStrake]: Deactivated
[EXC 15:11:24.290] NullReferenceException: Object reference not set to an instance of an object
Part.OnCollisionExit (UnityEngine.Collision c)
[LOG 15:11:24.292] [F: 47718]: wingConnector2 collided into mk3CargoBayM - relative velocity: 30.577 - impact momentum: 91.7
[LOG 15:11:24.298] [Explosion] Combined.
[LOG 15:11:24.303] wingConnector2 Exploded!! - blast awesomeness: 0.1
[LOG 15:11:24.307] [wingConnector2]: Deactivated
[EXC 15:11:24.313] NullReferenceException: Object reference not set to an instance of an object
Part.OnCollisionExit (UnityEngine.Collision c)
[EXC 15:11:24.314] NullReferenceException: Object reference not set to an instance of an object
Part.OnCollisionExit (UnityEngine.Collision c)
[LOG 15:11:24.316] [F: 47718]: wingConnector2 collided into mk3CargoBayM - relative velocity: 21.82494 - impact momentum: 65.5
[LOG 15:11:24.321] [Explosion] Combined.
[LOG 15:11:24.326] wingConnector2 Exploded!! - blast awesomeness: 0.1
[LOG 15:11:24.334] [strutConnector]: Deactivated
[LOG 15:11:24.340] [wingConnector2]: Deactivated
[EXC 15:11:24.396] NullReferenceException: Object reference not set to an instance of an object
ProtoPartSnapshot.Load (.Vessel vesselRef, Boolean loadAsRootPart)
ProtoVessel.LoadObjects ()
Vessel.Load ()
Vessel.Update ()
[EXC 15:11:24.401] NullReferenceException: Object reference not set to an instance of an object
Part.GetModuleStartState ()
Part.ModulesOnStart ()
Part+c__Iterator38.MoveNext ()
UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)
[LOG 15:11:24.418] 1 explosions created.
[EXC 15:11:24.449] NullReferenceException: Object reference not set to an instance of an object
ModuleAnimateGeneric.FixedUpdate ()
[EXC 15:11:24.451] NullReferenceException: Object reference not set to an instance of an object
ModuleAnimateGeneric.FixedUpdate ()
[EXC 15:11:24.462] NullReferenceException: Object reference not set to an instance of an object
Part.OnCollisionExit (UnityEngine.Collision c)
[EXC 15:11:24.465] NullReferenceException: Object reference not set to an instance of an object
Part.OnCollisionExit (UnityEngine.Collision c)
[LOG 15:11:24.467] [F: 47719]: airlinerMainWing collided into turboFanSize2 - relative velocity: 16.32361 - impact momentum: 73.6
[LOG 15:11:24.471] airlinerMainWing Exploded!! - blast awesomeness: 0.1
[LOG 15:11:24.490] [airlinerMainWing]: Deactivated
[LOG 15:11:24.496] [F: 47719]: wingConnector2 collided into turboFanSize2 - relative velocity: 19.93002 - impact momentum: 90.0
[LOG 15:11:24.501] wingConnector2 Exploded!! - blast awesomeness: 0.1
[LOG 15:11:24.505] [wingConnector2]: Deactivated
[EXC 15:11:24.512] NullReferenceException: Object reference not set to an instance of an object
Part.OnCollisionExit (UnityEngine.Collision c)
[EXC 15:11:24.513] NullReferenceException: Object reference not set to an instance of an object
Part.OnCollisionStay (UnityEngine.Collision c)
[EXC 15:11:24.514] NullReferenceException: Object reference not set to an instance of an object
Part.OnCollisionStay (UnityEngine.Collision c)
[EXC 15:11:24.516] NullReferenceException: Object reference not set to an instance of an object
Part.OnCollisionStay (UnityEngine.Collision c)

The ExternalLibraries folder is missing, preventing the CopyToKSPDirectory.bat from running properly

The ExternalLibraries folder isn't there. The bottom half of the CopyToKSPDirectory bat file fails with the following errors:
C:\shared\kerbal space program\LunaMultiPlayer>xcopy /Y ".\ExternalLibraries\FastMember.dll" "C:\games\Steam\SteamApps\common\Kerbal Space Program\GameData\LunaMultiPlayer\Plugins"
File not found - FastMember.dll
0 File(s) copied

C:\shared\kerbal space program\LunaMultiPlayer>xcopy /Y ".\ExternalLibraries\Lidgren.Network.dll" "C:\games\Steam\SteamApps\common\Kerbal Space Program\GameData\LunaMultiPlayer\Plugins"
File not found - Lidgren.Network.dll
0 File(s) copied

C:\shared\kerbal space program\LunaMultiPlayer>xcopy /Y ".\ExternalLibraries\System.Threading.dll" "C:\games\Steam\SteamApps\common\Kerbal Space Program\GameData\LunaMultiPlayer\Plugins"
File not found - System.Threading.dll
0 File(s) copied

C:\shared\kerbal space program\LunaMultiPlayer>xcopy /Y ".\ExternalLibraries\System.Data.dll" "C:\games\Steam\SteamApps\common\Kerbal Space Program\GameData\LunaMultiPlayer\Plugins"
File not found - System.Data.dll
0 File(s) copied

C:\shared\kerbal space program\LunaMultiPlayer>xcopy /Y ".\ExternalLibraries\Mono.Data.Tds.dll" "C:\games\Steam\SteamApps\common\Kerbal Space Program\GameData\LunaMultiPlayer\Plugins"
File not found - Mono.Data.Tds.dll
0 File(s) copied

C:\shared\kerbal space program\LunaMultiPlayer>xcopy /Y ".\ExternalLibraries\System.Transactions.dll" "C:\games\Steam\SteamApps\common\Kerbal Space Program\GameData\LunaMultiPlayer\Plugins"
File not found - System.Transactions.dll
0 File(s) copied

Client can't be found in game

OS: Windows 10 Insider Preview

KSPVersion: 1.3.0.1804 (WindowsPlayer x64) zh-cn

Expected behaviour: Should see the Client control in the game menu

Current behaviour: There is no LMP-related display

Steps to reproduce: Follow Readme-how to build LMP

qq 20170708192511

Flags dub


OS: Linux


KSPVersion: 1.3.1


Steps to reproduce: Plant flag


After flag planting, flags are duplicated 50-100 times


Find a way to sync flags

Flags cannot be synced between clients as their vessel.id is always 0000000-0000-0000-0000-00000000000
You cannot set a standard GUID after planting the flag (onflagplantedevent) as that event is triggered BEFORE you specified the flag name and title.

An option would be to detect that flag planted and add it to a dictionary. Then in a routine check if that flag has a name and title assigned (meaning that is already finished) and once that happens, then assign a vessel id and send it to the server.

Other options involve creating custom messages but that can be a bit more complex

Bear in mind that you must also handle the flag remove event. When you remove a flag you trigger the "vessel.Die()" So this can be handled in the OnVesselWillDestroy event of VesselRemoveSystem

        public void OnVesselWillDestroy(Vessel dyingVessel)
        {
            if (dyingVessel.vesselType == VesselType.Flag)
            {
                LunaLog.Log($"[LMP]: Removing flag {dyingVessel.id} from the server");
                System.MessageSender.SendVesselRemove(dyingVessel.id);

                //Flag is dead so remove the locks
                SystemsContainer.Get<LockSystem>().ReleaseAllVesselLocks(dyingVessel.id);
            }

Add a ProtoSyncHandler

One of the issues in DMP and LMP is that the vessel parts are not correctly in sync.

For example if a player extend a solar panel or starts and engine with the right mouse button context menu those changes are not shared with the other players.

Before, LMP had a "vessel change system" that polled the active vessel and sent the engine, solar panel, etc status. This system was not optimal at all and was removed.

This, ideally should be done with the vessel proto.


We receive a vessel proto definition from a player every 500ms aprox and we hold a copy of the last vessel proto of a player in a dictionary in the vesselprotosystem

Right now that proto dictionary is only updated if the new protovessel that we received greater or less parts than the one we have stored.


The new procedure should:

1- receive the proto and compare with the one we have in the dictionary
2- If it have more or less parts then just set it as unloaded so the vessel is reloaded and end the process here
3- If the stage is different or if there are engines started/stoped or panels extended/retracted then TRIGGER those changes.

We don't want to replace the whole protovessel as we do in step 2 as this makes the vessel flicker. We want to apply those changes to the specific parts.

Server Console error while trying to connect through Master servers.


OS : Ubuntu 14.04
Mono Complete 5.4.1.6
KSPVersion: 1.3.1


Expected behaviour: Being able to connect using server menu.


Current behaviour: Can't connect through master server (server menu). Server is listed though and running fine when connecting manually (no errors).

Server console error message :

[Debug] : Lidgren: ERRORMESSAGE -- Failed to send packet: System.Net.Sockets.SocketException (0x80004005): Invalid arguments
  at System.Net.Sockets.Socket.SendTo (System.Byte[] buffer, System.Int32 offset, System.Int32 size, System.Net.Sockets.SocketFlags socketFlags, System.Net.EndPoint remoteEP) [0x00066] in <50d80b08c1a5449282b22aedf03ce925>:0 
  at Lidgren.Network.NetPeer.SendPacket (System.Int32 numBytes, System.Net.IPEndPoint target, System.Int32 numMessages, System.Boolean& connectionReset) [0x00028] in <446bdc015556418abf5208bcb1041e78>:
```0

**Master Server error message :**

Master Server Log :
/2017 20:38:31 - NEW SERVER: XX.XX.XX.XX:8800
11/12/2017 20:38:33 - REMOVING SERVER: XX.XX.XX.XX:8800
11/12/2017 20:38:53 - Client requested introduction to nonlisted host!

------------------------------------------------------------------------------

Steps to reproduce:  Simply trying to connect using the "server menu". Server is vanilla, fresh installed, mono is up-to-date, config files haven't been modified (except name and amount of players). I'm more thinking about a problem of registration on master server, not on client side.

Fix collisions between vessels

Right now when you crash against other client the client vessel representation is different of the real client vessel.

To solve this, one idea would be to make the other vessels that have control locks (this means that are controlled by other players) invulnerable to your client.

So, if you crash your vessel against another player, yours gets destroyed and your new vessel structure is sent to other players.
Meanwhile, the other player would see you coming and his vessel would be destroyed, then he would broadcast his new vessel structure.

This way both players would see the real representation of the vessels

Debris cleanup causes NullReferenceExceptions

[WRN 15:19:00.150] Vessel Aeris 3A Debris was removed from the game: it was debris cluttering up KSC.
[EXC 15:19:00.154] NullReferenceException
VPWheelCollider.UpdateVisualWheel ()
VehiclePhysics.VehicleBase.LateUpdate ()
[EXC 15:19:00.171] NullReferenceException
VPWheelCollider.GetGroundHit (UnityEngine.WheelHit& hit)
VehiclePhysics.VehicleBase.CalculateSuspensionTravel (VehiclePhysics.WheelState wheel)
VehiclePhysics.VehicleBase.FixedUpdate ()
[EXC 15:19:00.181] NullReferenceException
VPWheelCollider.GetGroundHit (UnityEngine.WheelHit& hit)
VehiclePhysics.VehicleBase.CalculateSuspensionTravel (VehiclePhysics.WheelState wheel)
VehiclePhysics.VehicleBase.FixedUpdate ()

Whitelist issue at start up of server

Server-side operation.

  1. whitelisted = True on Setting.txt
  2. at least a line of text is on Whitelist.txt
  3. run the LunaServer.exe

The text that already written on Whitelist.txt is written again three-times.

LMPWhitelist.txt

Does these post early yet...?

Edit: four-times->three-times

VesselUpdates are slow to generate

VesselUpdates are currently very slow, which makes having a high update rate from the server problematic.

We should optimize VesselUpdates so that they execute quickly.

Making the following changes to VesselUpdate changes the execution time to create a VesselUpdate (not even send it) from ~60µs to 5µs (elapsed time, not CPU time):

  1. Eliminate this method call:
    vessel.FindPartModulesImplementing();

  2. Eliminate the following code.
    ActiveEngines = engines.Where(e => e.EngineIgnited)
    .Select(e => e.part.craftID).ToArray(),
    StoppedEngines = engines.Where(e => !e.EngineIgnited)
    .Select(e => e.part.craftID).ToArray(),
    Decouplers = vessel.FindPartModulesImplementing()
    .Where(e => !e.isDecoupled)
    .Select(e => e.part.craftID).ToArray(),
    AnchoredDecouplers = vessel.FindPartModulesImplementing()
    .Where(e => !e.isDecoupled)
    .Select(e => e.part.craftID).ToArray(),
    Clamps = vessel.FindPartModulesImplementing()
    .Select(e => e.part.craftID).ToArray(),
    Docks = vessel.FindPartModulesImplementing()
    .Where(e => !e.IsDisabled)
    .Select(e => e.part.craftID).ToArray(),

  3. Comment out the following code:
    returnUpdate.FlightState.CopyFrom(vessel.ctrlState);

The 5µs doesn't account for CPU or network transmit time for actually sending the updates. The actual transmission should probably be done on another thread to avoid hanging the update thread's performance.

Replace all the arrays in the clases that implement IMessageData with Lists

We should replace all the arrays in the classes that implement IMessageData for Lists.
Then on deserialization call list.Clear() and then list.addRange(...) instead of creating a "new" all the time.

This will reduce the garbage.

Right now a new array is created all the time and the memory of the array that was before is left to be collected. When you use the clear()+ addrange() the memory is kept and only expanded if the data is bigger than the list capacity

Fix vessel positions when spectating

Vessel movement when spectating is bad. Specially in atmospheric flight

We need to find a better way to handle them:

Check lines 219 to 228 in VesselPositionUpdate.cs

LINUX: Warp stop event not detected

In Linux.

1- In map view select a point in the orbit and select the option "Warp here" or use the tool to warp
2- Wait until warp is complete
3- In status window it should not say "Warping"
Video: https://youtu.be/dIDAXu3G9Io?t=4m58s

Possible solutions:
At the moment we use an event to detect when the time war has changed (WarpEvents.cs - OnTimeWarpChanged())
For linux we may need to have a routine that does something like:

if (TimeWarp.CurrentRateIndex == 0 && System.CurrentSubspace == -1)
            {
                //We stopped warping so send our new subspace
                System.WaitingSubspaceIdFromServer = true;
                System.SendNewSubspace();
            }

This will reduce performance but could be an option for linux users if someone can confirm this bug

Stack trace on disconnect

[LOG 10:04:05.696] [LMP]: Disconnected, reason: Connection timed out
[ERR 10:04:05.718] [LMP]: Invalid server list reply msg: System.NullReferenceException: Object reference not set to an instance of an object
at LunaClient.Network.NetworkServerList.HandleServersList (Lidgren.Network.NetIncomingMessage msg) [0x00026] in C:\shared\kerbal space program\LunaMultiPlayer\Client\Network\NetworkServerList.cs:52
UnityEngine.Debug:LogError(Object)
LunaClient.Network.NetworkServerList:HandleServersList(NetIncomingMessage) (at C:/shared/kerbal space program/LunaMultiPlayer/Client/Network/NetworkServerList.cs:86)
LunaClient.Network.NetworkReceiver:ReceiveMain() (at C:/shared/kerbal space program/LunaMultiPlayer/Client/Network/NetworkReceiver.cs:56)
System.Threading.Tasks.ThreadPoolTaskScheduler:TaskExecuteWaitCallback(Object)

Add documentation

We should create a github wiki with both thechincal and user documentation that explain LMP features

Master Server Performance

The Master Server uses an enormous amount of CPU on the machine.
Tested on two machines, so not a single-machine issue.

Object reference not set to an instance of an object when calculating interpolations

"System.NullReferenceException: Object reference not set to an instance of an object
at LunaClient.Systems.VesselUpdateSys.VesselUpdate.GetInterpolatedAcceleration (Single interpolationValue) [0x00020] in C:\shared\kerbal space program\LunaMultiPlayer\Client\Systems\VesselUpdateSys\VesselUpdate.cs:449
at LunaClient.Systems.VesselUpdateSys.VesselUpdate.ApplySurfaceInterpolation (Single interpolationValue) [0x00001] in C:\shared\kerbal space program\LunaMultiPlayer\Client\Systems\VesselUpdateSys\VesselUpdate.cs:398
at LunaClient.Systems.VesselUpdateSys.VesselUpdate.ApplyInterpolations (Single percentage) [0x00033] in C:\shared\kerbal space program\LunaMultiPlayer\Client\Systems\VesselUpdateSys\VesselUpdate.cs:353 "

Breakpointing on VesselUpdate:449, I found that the Target.Acceleration was null, but the Target was valid. I'm not sure what the conditions are for a target to have or not have an acceleration.

Reduce the update frequency

Right now vessels send updates every 30ms as default. They send updates even if they are in orbit and you are not touching anything.

This must be changed to:

If vessel is above the atmosphere or in a planet without atmosphere and it doesn't have any input do NOT send any update at all and let the clients simulate their trajectories. Other option would be to send data but every several ms

Things to do once Squad updates unity...

This Issue is just a reminder of things to do once squad updates unity as we will have .net 4.5

1: Remove own implementation of System.Threading
2: In LunaTime.cs, remove the refactoring of TryOpenMutex()
WARNING: Do this step ONLY if mscorlib.dll in C:\Kerbal Space Program\KSP_x64_Data\Managed implements "TryOpenMutex"
So GetLunaMutex() looks like:

private static Mutex GetLunaMutex()
{
    try
    {
        return TryOpenMutex();
    }
    catch (Exception)
    {
        return new Mutex(false, "LunaTimeMutex");
    }
}

3: Remove RecyclableMemoryStream and RecyclableMemoryStreamManager
Use this dll: https://www.nuget.org/packages/Microsoft.IO.RecyclableMemoryStream/

4: Use a new FastMemberLibrary

Kerbals die over and over

image

This was in my log from the mission. Also, we were seeing some pretty heavy lag--not sure if it was related. 2 people were in a game and we did recover some ships prior to this flight.

Status is WARPING on load

You don't start with a subspace, so your ID is -1. Time warping and stopping will fix the status.

Add logic to share reputation, funds and contracts between clients

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.