Jump to content

DarkMultiPlayer 0.3.8.0 [KSP 1.12.0]


godarklight

Recommended Posts

@StarDrive85: About the server list, I'll have to check over it, I knew proper XHTML would bite me when I decided to use it, but I haven't heard any reports suggesting it was broken for a while :-/

@Rabidsimon/Terry: I've bumped the window ID's, hopefully this gets it out of the range where it would react with KSP or other mods. Try installing dev to see if it's fixed (I haven't run into the problem personally, but I've heard many reports of it breaking that way)

@Treki26: Now that you have mono installed, you should be able to open the terminal and type: "mono DMPServer.exe" after changing to that directory. You'll likely need a tutorial on the mac terminal, but as I don't have mac I'm likely not the person to help with that. I would have thought you guys had the equivalent of "Open with", if that's the case, open DMPServer.exe with "mono".

@Spacepigu: There's a good reason 127.0.0.1 is the default in the "Add Server" menu. 127.0.0.1 means the computer you are on already, commonly called "localhost".

Your other option is to connect to your network address (usually in the form of 192.168.0.x).

People connecting from outside your network will need to connect to your public IP address, and you'll have to port forward. You can find out your public IP and test portforwarding with www.canyouseeme.org, port 6702.

@Everyone: Reverting has now been disabled in dev due to the massive problems it causes - It will be gone in dev until I either:

a) Trick KSP into not doing the revert when pressing the revert button; or

B) Keep all the vessel update messages around, causing a slow memory leak.

a Is likely impossible, b is relatively easy to do, but I'd still like to throw away updates from before the revert universe save time.

I'll release one more version on the 0.1.5.x series and then move on to 0.1.6.0, The 0.1.6.0 branch will be the last branch until KSP 0.25 comes out, and will also mark feature completion, so it's going to take a while (1-2 months) :)

After that, I'll pull off some refactoring, squash whatever bugs I can and drop this silly alpha tag with 0.2.0.0 - I don't feel like counting to 7 :D

Link to comment
Share on other sites

@Kerbin, We have a problem: https://github.com/godarklight/DarkMultiPlayer/blob/master/README.md#mods-1

Most mods will Just Work , but remember scenario data is per-player, so for example, different players would see different kethane maps.

Things that modify the time will generally conflict with DMP, also mods that are time dependent also act weird (like TAC-LS)

Link to comment
Share on other sites

My buddy and I are trying to play through LogMeIn Hamachi. I can connect but he cannot. He puts in the same ip and port that I put in but he cannot connect. He either get a time out error or just cannot connect altogether. Any help would be awesome!

From what you said, I suppose that the issue is that he is putting his own IP.

When he should be actually putting yours.

Link to comment
Share on other sites

I'm no C# programmer, but isn't it a little inefficient to have to re-instantiate the message writer every time you want to sent a message?

Honestly, I'm surprised you've rolled your own message system; it seems quite daunting to use, especially in a "safe" manner.

On another note, is it just me or is the "lag" on the ships "not really happening"? From the way the camera reacts, it looks like the vessel is physically moving fluidly, but the model is lagging behind it or updating roughly. Could just be my imagination.

Link to comment
Share on other sites

@Soundwave__007: KSP64 appears to be incredibly unstable on windows, can I get you to try it on 32bit with Active Texture Manager?. What's odd is that it crashed straight after:

AddonLoader: Instantiating addon 'PersistentEmitterManager' from assembly 'SmokeScreen' - I guess that's part of B9.

@inigma: It wasn't actually a KillVessel bug I think, it was a paradoxical bug that I never thought about. When a part breaks off a ship, it actually creates a new vessel. The client will then sync the debris back to the server, even if it didn't break off for the other player.

I fixed it by deleting new crafts that break off other vessels if they are controlled by other players.

@uncle natzer: To date, everyone that has gotten hamachi working has never actually told me how. I can't (or maybe won't) run hamachi on linux.

Generally, you shouldn't need to bind DMPServer to your network address, 0.0.0.0 means "Listen on everything". Perhaps drop into IRC one day, I'd like to see a few screenshots if you figure it out.

Also I should mention to try port forwarding unless it's simply not possible (either you don't have access to your modem or your ISP is *insert expletives here* bad at being an ISP, and doesn't give you a public IP address in the first place, which is often the case with mobile internet and wireless broadband).

@tetryds: I need to find a link to explain how TCP/IP works with pretty pictures, it might explain the need to port forward and what address to type when

@Kerbin, We have a problem: Back in the good old days (~0.1.0.0 to maybe 0.1.2.0) I did actually run a DMPServer, the bad news is Australia has metered internet, and because DMPServer is a message relay, the bandwidth usage is nearly exponential with players, so I had to take it down to avoid getting shaped every month :(.

@Miner459: That problem should be fixed in the development version - Vessels that fail to save don't get loaded into the game and PM's the server about bad vessels, I'll figure out the actual cause sooner or later when I start gathering bad vessels of the server admins (DMPServer doesn't call home or anything, there's just quite a few server admins in #DMP, it's a place for players too though!).

@dsonbill: MessageWriter is a thin wrapper around MemoryStream - so hopefully it's not too expensive or hurts GC too much, but I haven't done any profiling on it. DMPServer uses MessageWriter/Reader and seems perfectly fine running on potato hardware :).

The reason MessageWriter exists is because I *hate* BinaryFormatter with a passion, and it abstracts this away, so I'm not as likely to create bugs in the bitstream. The equivalent in DMP is this.

The only thing I don't like about it is you can't switch on type in C#, but if it annoys me enough I might replace it with a Dictionary<Type, Delegate>. That's not very likely though - as MessageWriter doesn't correct for edianness either. Perhaps I'll take care of that in 0.2.0.0 (It's not too big a problem as KSP can only run on little endian and I'm unsure about big endian machines that can run mono for DMPServer).

The lag is likely real unless you're spectating updates from the future. The vessel "kick" is caused by incorrect angular velocity or rotation, but I can't fix those until I break the network protocol and go for 0.1.6. The vessel replacement to update the parts is expensive though, as it kills the vessel and replaces it with a new copy every 30 seconds.

Link to comment
Share on other sites

I am getting some...odd behavior. When I am running a server locally I am able to connect to it no problem. However when I disconnect, the server log shows:

[02:51:44][iNFO] : Client ***** disconnected in ReceiveCallback, endpoint 127.0.0.1:49672, error: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. (An existing connection was forcibly closed by the remote host)

[02:51:44][DEBUG] : Error closing client connection: The operation is not allowed on non-connected sockets.

I will get these messages regardless of game mode setting or KSP architecture (x86 or 64bit). I bring up the game mode thing because the main problem I am having has to do with disconnecting on the client side in career. I am able to disconnect the first time, however, if I reconnect WITHOUT RESTARTING KSP I can get onto the server but start getting the odd behavior. If I then try to disconnect again, the server still has the same log messages as above. However, on the client side, the DMP windows disappear, but I remain at the launch complex. When I try to go back to the main menu, it will not respond and the game is stuck in the launch complex, unable to get to any other screen.

This behavior DOES NOT repeat for other game mode settings (Science or Sandbox). The server log stays the same, but I am able to connect/disconnect as often as desired.

Link to comment
Share on other sites

Log Spam Issue In VAB:

Hi. I'm getting :

DarkMultiPlayer: Resetting warp rate back to 0

spammed in the VAB. Warpmode on the server is set at 5

warpmode,5

It's creating a bit of lag on the client. If you cannot reproduce it, I'll send both logs.

Regards.

Edited by PaidLeber
Link to comment
Share on other sites

@Godark I see. I've just recently installed Visual Studio again so I've been taking a look at the sauce. Personally, I'm too specialized in python to be of any help with this (my latest trend when it comes to servers is websockets, and my message system are almost always just concatenated strings + rex. nuff said.). Honestly, I've looked through too much code that I don't exactly understand the purpose or impact so it's unlikely I can help with the programming side of this beast.

I do want to make some of my own commands and functionality. Any tips on getting an environment ready to compile a plugin dll? I can gather how to register the command from command handler, and that I have to extend from the plugin interface, but I'm not exactly sure how to do that... Might just look for some generic C# guides.

EDIT: Nevermind, I feel like such a boss. The knowledge just came flooding back to me from my early days (...and I poked around a bit).

Here's something actually worth looking at.

Your first command:


using DarkMultiPlayerServer;




namespace PluginDLLName
{
public class ActualPluginNameOrWhatever : DMPPlugin
{
public ActualPluginNameOrWhatever()
{
DarkLog.Normal("Debug Playground has mother-blanking initialized.");
CommandHandler.RegisterCommand("firebob", FireBobKerman, "Fires Bob Kerman.");
}

static int bobCount = 0;

// Command method MUST take a string.
private static void FireBobKerman(string fooBar)
{
bobCount++;

DarkLog.Normal("Fired Bob Kerman");
ClientHandler.SendChatMessageToAll("WARNING: Bob Kerman has been fired.");
ClientHandler.SendChatMessageToAll("Bob has been fired " + bobCount + " times.");
}
}
}

Now all I need is a way to send commands to MechJeb or something... I'm guessing this is beyond the boundaries of a plugin at this moment?

*Cleaned up the language a bit for the forums... it was pretty expletive ;)

EDIT2: Holy $#!! IronPython Works with mono. I'm getting some ideas....

Edited by dsonbill
Edited to reflect suggestions below; it makes a nice little example now, I think :P
Link to comment
Share on other sites

@doug4664: As far as DMPServer is concerned, that message is *pretty* normal, Apparently my code closes the socket even if it's already closed. I'll fix / silence that error in 0.1.6.

As for the going back into the game thing when pressing 'disconnect', (/me pokes finger) squad did it. There's methods for starting games, but I haven't quite figured out what code that red exit to main menu button is hooked up to. I originally run into that all the time when I was trying to port to 0.24, then it went away, but only most of the time :-/. I might have to poke that kraken a little more - it's safer to use the red "Exit to main menu" button on the space center screen for now, that does seem to work correctly.

@PaidLeber: I haven't ran the other warp modes since before DMP v0.1.0.0, they've been a bit neglected since then. The warp system will get a little bit of love for 0.1.6.0, I'll nail that bug then, along with the vote system port to LockSystem, Ignoring MCW votes for inactive players, and removing the "Kicked for creating existing subspace" bug.

@dsonbill: Simplifing a little here, but DMP's "packets" in the TCP stream roughy looks like this (In little endian though, because of my lameness :)):

| integer (4 byte) type header | integer (4 byte payload length) | payload. Obviously in the tcp stream you'll have |packet|packet|packet all right next to each other, the payload length specifies how much longer to read before you know you have the full message (TCP Length Prefixing). My very first commit to KMP that took me a week to figure out actually fixed that very exact receive bug, I've come a long way since that very first commit :). EDIT: Sorry, that was because we were playing with sockets. Similar-ish problem though.

payload is a byte array that uses my MessageWriter thing, it basically bit-packs the type converted to byte[], unless it's a string, in which case it adds another length prefix for the UTF8 encoded string, and if it's an array of any of the standard types it also adds *another* length prefix for the number of elements.

Plugins will be able to interact with the network over my mod-support branch, I've only got the basics down and given it a quick little test with an example plugin, It will likely be fleshed out more and improved for 0.1.6 (for example, I don't have OnConnect or OnDisconnect events in the plugin handler client side.

Also you might want to move command registration to the constructor, OnServerStart is called during a restart as well (but registered commands are ignored, so it's probably fine). base.OnServerStart is empty as well, you can remove that line :P

And just a heads up, There's no function calls to remove kerbals from a game - KSP will have kittens even if you did manage it, as KerbalRescue contracts completely bug out the game if the kerbal is missing (I promise to fix this properly in 0.1.6).

Edited by godarklight
Link to comment
Share on other sites

I really like the mod message system; string comparison and concatenation really is the simplest method there is afaik. I like how everything is clearly separated; It's certainly more straight-forward than some of the monstrosities I've created in the past.

Also, I cannot thank you enough for the templates; I don't know that I ever would have gotten a ksp plugin working with my current level of knowledge with C#. I'm currently working on an intuitive way I can script portions of the plugins with ironpython (might be a viable choice for a few of the ideas I have; python is pretty straight-forward if beginners want to make small changes in functionality; and no re-compile).

Also, I fixed the above example in case someone comes across it.

Edited by dsonbill
Link to comment
Share on other sites

Hello!

I wanted to invite you godarklight to a discussion on a mod list I'm testing. Let me know in that thread if you would be interested in helping test other listed mods with yours, or if you already have.

Inigma's KSP Essentials Mod List

http://forum.kerbalspaceprogram.com/threads/94353-WIP-Inigma-s-KSP-Essentials-Mod-List-%28in-Testing%29

Link to comment
Share on other sites

Can anything be done about these keyboard focus issues with the chat window?

1: You can't focus on the chat by clicking on just the chat window- you have to click on the specific narrow chat input line. Is there a way to send focus to the chat line upon any click on the entire chat window?

2: When typing a line in the chat window, if a player connects or disconnects, the message that appears in the chat window to tell you that they have joined (or left) the server causes the keyboard focus to shift away from the input line while you were in the middle of typing. I've lost lots of craft that way because of how often you type "spacebar" when typing text words. When the focus is taken away in the middle of typing text, I end up activating a stage with the spacebar because I type too fast to stop myself upon seeing the message appear.

Link to comment
Share on other sites

@Steven Mading:

1) Sounds like a good idea, but I'd preserve the player name click -> PM functionality. I'll clean up the GUI's for 0.1.6 too I guess. I'd also like to implement the flightgear style chat while the window is minimized (basically press ~ and what you type will come up in the yellow text).

2) Hadn't noticed this one, thanks for letting me know :).

Also, I will also save the window positions and also make sure they can't be dragged off screen, some people have ran into that one before.

@Everyone, 0.1.6.0 is going to take me a while, I basically want to get DMP feature complete and kind of go into bugfix only mode. but I've still got my seasonal job which is why my github history has taken a massive nose-dive.

It seems to be a constant month or two away at the moment :(. After 0.1.6 comes to life and proves stable, DMP 0.2.0.0 (I can't count to 7) will be a re-factor / cleanup and will be tagged as 'beta'.

After that, I'll update DMP for new versions of KSP until squad releases KSPM :).

EDIT: 0.1.5.6 is available, I'm tagging this now so I can make a real start on 0.1.6.

Edited by godarklight
Link to comment
Share on other sites

I've been looking for where to start on this one:

  • Hook up the server admin console to the client so you can /pm the server console commands. Player names are authenticated.

Where is chat from the client handled server-side? It should be easy enough to implement if I can find the time.

EDIT: Started reading the documentation like a good boy, lol; also scanned through ClientHandler again and found it right away. I'll work on it a bit later tonight.

Here's a much better question: is there currently a way to authenticate admins?

E2: Well I've found what I need after looking around. The code is written very well! This should be very, very easy.

Edited by dsonbill
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...