Page 2 of 3

PostPosted: 17 Mar 2009, 23:18
by MrcredsAlex
Sucesfully managed to register KaM as a DirectPlay application (took 5 minutes :P)

In registry:

HKEY_LOCAL_MACHINE\Software\Microsoft\DirectPlay\Applications

Create subkey KaM

Create strings:

CommandLine -> (empty)
CurrentDirectory -> C:\KnightsAndMerchants
File -> KaM_1024.exe
Guid -> {65bebb82-ae34-46e2-b89c-18dd09826ff8}
Path -> C:\KnightsAndMerchants

(Changing C:\KnightsAndMerchants to where you have the game installed if you have a different path)

(Use KaM_800.exe instead of KaM_1024.exe if you want 800*600 instead of 1024*768 resolution)

If this works, it would be good to make the program automatically change the registry :P

PostPosted: 18 Mar 2009, 02:08
by FallenLeader
hamachi? i dont care for hamachi at all though.

i really would like to run all my games online vs others with me and my son. but its always lan or net. can't have both at same time.

PostPosted: 18 Mar 2009, 02:25
by harold
Hamachi doesn't have anything to do with this, it's just a VPC client.

PostPosted: 18 Mar 2009, 02:31
by FallenLeader
oh, i thought it was just about playing the game online. this is trying to be done without a client like that?

i'll bow out of the topic and just keep reading as it gets posted.
getting out of my general modding knowledge.

PostPosted: 18 Mar 2009, 12:49
by MrcredsAlex
oh, i thought it was just about playing the game online. this is trying to be done without a client like that?
We're trying to make a lobby to play KaM online (without Hamachi, but I think DMZ will need to be enabled on router)

PostPosted: 18 Mar 2009, 13:05
by harold
I think:
Port 2300 TCP
Port 2350 UDP

If that's all then DMZ is not needed
It isn't needed anyway, one could just remove the router and you're done (easier, IMO)

PostPosted: 18 Mar 2009, 13:52
by MrcredsAlex
Fixed a bit of that C++ code and ported it to C#, but it now has Microsoft.DirectX.DirectPlay.DoesNotExistException
  Code:
Microsoft.DirectX.DirectPlay.Lobby.Client connection = new Microsoft.DirectX.DirectPlay.Lobby.Client();          ConnectInformation ci = new ConnectInformation();          ci.GuidApplication = new Guid("{65bebb82-ae34-46e2-b89c-18dd09826ff8}");          ci.Flags = Microsoft.DirectX.DirectPlay.Lobby.ConnectFlags.LaunchNew;          ci.UseConnectionSettings = true;          Address address = new Address();          address.AddComponent(Address.KeyHostname, "localhost");          address.AddComponent(Address.KeyPort, 2300);          address.Device=Address.ServiceProviderTcpIp;          address.ServiceProvider=Address.ServiceProviderTcpIp;          ci.ConnectionSettings.SetDeviceAddresses(new Address[]{address});          ci.ConnectionSettings.PlayerName = "MeTheHost";          ci.ConnectionSettings.HostAddress=new Address("localhost",7575);          int kamh = connection.ConnectApplication(ci,System.Threading.Timeout.Infinite,null);[/quote]

PostPosted: 18 Mar 2009, 14:17
by harold
That sounds scary.. or does that just mean it can't find the GUID? That is also bad, but at least it's not "ApocalypseException"
It's all quite annoying to make code for it IMO, everything has this stupid "Obsoleted, do not use!" kind of message.

PostPosted: 18 Mar 2009, 14:18
by MrcredsAlex
That sounds scary.. or does that just mean it can't find the GUID? That is also bad, but at least it's not "ApocalypseException"
It's all quite annoying to make code for it IMO, everything has this stupid "Obsoleted, do not use!" kind of message.
It does find the GUID, because I tried launching another game and it also throwed the same exception.

Oh and yeah it's so annoying :P

It seems to be a problem of Address.Device.

PostPosted: 19 Mar 2009, 11:03
by MrcredsAlex
Searched the registry loads of times, still can't find any "device" to put as a GUID...

PostPosted: 22 Mar 2009, 08:54
by The Knight
I don't understand sense of this code? Whith what success?

PostPosted: 22 Mar 2009, 13:24
by MrcredsAlex
I don't understand sense of this code? Whith what success?
KaM online :D

PostPosted: 02 Apr 2009, 09:55
by MrcredsAlex
If this DirectPlay thingy does not work or we are unable to find that
impossible-to-find device:

I also thought that, while KaM does not have a message loop (I think?),
the mouse might be moved using memory, so we could point at multiplayer,
click, enter the IP, etc.

Of course we would have to find out how to click :lol:

PostPosted: 02 Apr 2009, 12:45
by harold
How can it have no message loop? Windows would think it had stopped responding.. And it responds to Alt+F4 etc

PostPosted: 02 Apr 2009, 22:49
by MrcredsAlex
How can it have no message loop? Windows would think it had stopped responding.. And it responds to Alt+F4 etc
Well, what I meant is that it might have one but just ignores
mouse/keyboard input and uses DirectInput for that or something.