Map Database  •  FAQ  •  RSS  •  Login

DirectPlay

<<

MrcredsAlex

Rogue

Posts: 51

Joined: 15 Mar 2009, 23:00

Post 17 Mar 2009, 23:18

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
<<

FallenLeader

Lance Carrier

Posts: 69

Joined: 17 Feb 2009, 23:00

Post 18 Mar 2009, 02:08

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.
<<

harold

Knight

Posts: 562

Joined: 19 Nov 2007, 23:00

Post 18 Mar 2009, 02:25

Hamachi doesn't have anything to do with this, it's just a VPC client.
<<

FallenLeader

Lance Carrier

Posts: 69

Joined: 17 Feb 2009, 23:00

Post 18 Mar 2009, 02:31

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.
<<

MrcredsAlex

Rogue

Posts: 51

Joined: 15 Mar 2009, 23:00

Post 18 Mar 2009, 12:49

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)
<<

harold

Knight

Posts: 562

Joined: 19 Nov 2007, 23:00

Post 18 Mar 2009, 13:05

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)
<<

MrcredsAlex

Rogue

Posts: 51

Joined: 15 Mar 2009, 23:00

Post 18 Mar 2009, 13:52

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]
<<

harold

Knight

Posts: 562

Joined: 19 Nov 2007, 23:00

Post 18 Mar 2009, 14:17

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.
<<

MrcredsAlex

Rogue

Posts: 51

Joined: 15 Mar 2009, 23:00

Post 18 Mar 2009, 14:18

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.
<<

MrcredsAlex

Rogue

Posts: 51

Joined: 15 Mar 2009, 23:00

Post 19 Mar 2009, 11:03

Searched the registry loads of times, still can't find any "device" to put as a GUID...
<<

The Knight

User avatar

Pikeman

Posts: 177

Joined: 28 Jul 2006, 22:00

KaM Skill Level: Average

Post 22 Mar 2009, 08:54

I don't understand sense of this code? Whith what success?
<<

MrcredsAlex

Rogue

Posts: 51

Joined: 15 Mar 2009, 23:00

Post 22 Mar 2009, 13:24

I don't understand sense of this code? Whith what success?
KaM online :D
<<

MrcredsAlex

Rogue

Posts: 51

Joined: 15 Mar 2009, 23:00

Post 02 Apr 2009, 09:55

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:
<<

harold

Knight

Posts: 562

Joined: 19 Nov 2007, 23:00

Post 02 Apr 2009, 12:45

How can it have no message loop? Windows would think it had stopped responding.. And it responds to Alt+F4 etc
<<

MrcredsAlex

Rogue

Posts: 51

Joined: 15 Mar 2009, 23:00

Post 02 Apr 2009, 22:49

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.

Return to “General Talk”

Who is online

Users browsing this forum: No registered users and 5 guests