Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Age Of Empires: Multiplayer matchmaking
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
iPromise
Grandmaster Cheater
Reputation: -1

Joined: 27 Jun 2009
Posts: 529
Location: Canada

PostPosted: Wed Jul 14, 2010 5:14 pm    Post subject: Age Of Empires: Multiplayer matchmaking Reply with quote

Where would I start in terms of making my own client similiar to Voobly or GamePark to connect users together to play a game of Age Of Empires II? After MSN Zone closed down a while back people made their own clients, right now Voobly is the one leading it with their client. I would just like to see 'how' it works, any links to topics that can answer my question is appreciated.

Thanks
Back to top
View user's profile Send private message MSN Messenger
tombana
Master Cheater
Reputation: 2

Joined: 14 Jun 2007
Posts: 456
Location: The Netherlands

PostPosted: Thu Jul 15, 2010 4:37 am    Post subject: Reply with quote

You can probably just pass an IP to AoE2 through the command line. So your client is just a normal program with a lobby and such, which will launch AoE2 with some specific command line switches that will make it connect to the other person.
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Thu Jul 15, 2010 6:15 am    Post subject: Reply with quote

Or you could, you know, do it the proper way which is to sniff packets on the client till you figure them all out. Find out what packets it needs to send to the server and in what format they must be in. Find what game events map to what packets. You might find that a packet needs to be sent when a unit is moved for example. If you are to recode a client you will need to do this too. Also you need to find what maps the other way too. For example when the server sends you a message you need to know what is the significance of it and what it expects you to do with it. Maybe it is saying end game in which case you need to represent that event to your user in your client. It's all common sense at the end but you may want to learn programming before you start.
Back to top
View user's profile Send private message
iPromise
Grandmaster Cheater
Reputation: -1

Joined: 27 Jun 2009
Posts: 529
Location: Canada

PostPosted: Thu Jul 15, 2010 1:49 pm    Post subject: Reply with quote

Well, from my investigation Age Of Empires uses DirectX. Also, most lobby systems use DirectPlay() and Winsock. So yeah, I am thinking I would need to use the P2P ( IDirectPlay8Peer ) interface to connect people together, and the Windows Socket API for the chat client, etc.
Back to top
View user's profile Send private message MSN Messenger
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Thu Jul 15, 2010 3:48 pm    Post subject: Reply with quote

You do not need DirectX at all. The client is just a representation of the packets that are sent back and forth. Any way to implement this representation is fine. By what you've said, you show yet again you do not understand the conceptual base behind yet another project you intend to undertake. For a non-programmer like yourself, I suggest you start lower. Perhaps 'Hello World' in your chosen language, making sure you understand everything you have written. Move up slowly.
Back to top
View user's profile Send private message
iPromise
Grandmaster Cheater
Reputation: -1

Joined: 27 Jun 2009
Posts: 529
Location: Canada

PostPosted: Thu Jul 15, 2010 8:43 pm    Post subject: Reply with quote

I do agree on the packet part, but knowing what packets to send / receive with your server / client (note: send with the server, receive with client) is hard. Seriously, i'd rather use DirectPlay then spend a year investigating what packets to send, i'm sure this is why everyone uses DirectPlay instead of Winsock..
Back to top
View user's profile Send private message MSN Messenger
justa_dude
Grandmaster Cheater
Reputation: 23

Joined: 29 Jun 2010
Posts: 891

PostPosted: Thu Jul 15, 2010 8:46 pm    Post subject: Reply with quote

I'm thinking that the "client" is built into the game. It's been a while since I've played with Direct X at all, but I'm thinking that the process was something like:

1) Use OLE/COM calls to find out if there are any directplay games running on the local system. If so, connect to the session. If not, enumerate the directplay games installed on the current system and launch one.
2) Use OLE/COM to pass connection parameters to the game.
3) go back to step one.

That is, I don't think the lobby server actually proxied the connection or anything, it just kinda' passed the most basic of info to the game (i.e., host ip, maybe number of players, etc). In this way, the game didn't have to know anything about the "lobby" that was launching it.

The framework probably had some more advanced features, like allowing the lobby to pass in-game chat messages between users in different games and browsing server lists and so forth, but I honestly don't remember ever seeing anything like that in any of the dplay games I used to play (df2:Jedi Knight and Crimson Skies, mostly).

The old SDKs that shipped with MSVC (I think MSVC 4.2 had DX5?) came with a couple of sample applications - you could try googling for bellhop and lserver. Mostly, though, I think that you just need to figure out how to launch the game you're interested in with the correct parameters. You might even, as someone earlier in the thread wisely stated, be able to do it all from the command-line without even messing with COM. Either way, the task of building a lobby is thusly reduced basically to one of building a chat server.

Cheers,
adude
Back to top
View user's profile Send private message
iPromise
Grandmaster Cheater
Reputation: -1

Joined: 27 Jun 2009
Posts: 529
Location: Canada

PostPosted: Thu Jul 15, 2010 8:54 pm    Post subject: Reply with quote

hmm, thanks adude. If you put it that way, maybe I just need to send a couple of packets instead of using DirectPlay like host ip, number of players and their ip's, etc. But, does anyone know how I can 'find" what packets to send to Age of empires?
Back to top
View user's profile Send private message MSN Messenger
Flyte
Peanuts!!!!
Reputation: 6

Joined: 19 Apr 2006
Posts: 1887
Location: Canada

PostPosted: Thu Jul 15, 2010 9:04 pm    Post subject: Reply with quote

iPromise wrote:
Seriously, i'd rather use DirectPlay then spend a year investigating what packets to send, i'm sure this is why everyone uses DirectPlay instead of Winsock..


Just thought I'd point out that DirectPlay was trash and no longer exists - i.e. it was deprecated 3 years ago.
Back to top
View user's profile Send private message
iPromise
Grandmaster Cheater
Reputation: -1

Joined: 27 Jun 2009
Posts: 529
Location: Canada

PostPosted: Thu Jul 15, 2010 9:37 pm    Post subject: Reply with quote

Yes I know that it was deprecated by Microsoft for Games for Windows Live but still, the game I am make a lobby/client for uses DirectPlay, so I have two choices, packets or DirectPlay. But I see that DirectPlay eases up things while Packets take a while, you need to know what data to send, and finding out how it works is another problem.
Back to top
View user's profile Send private message MSN Messenger
justa_dude
Grandmaster Cheater
Reputation: 23

Joined: 29 Jun 2010
Posts: 891

PostPosted: Thu Jul 15, 2010 9:59 pm    Post subject: Reply with quote

iPromise wrote:
hmm, thanks adude. If you put it that way, maybe I just need to send a couple of packets instead of using DirectPlay like host ip, number of players and their ip's, etc. But, does anyone know how I can 'find" what packets to send to Age of empires?


I refer you, again, to the old SDKs. In addition to bellhop and lserver, there's an example called dplaunch that I believe does what you need.

from the dplaunch readme.txt wrote:

DPLAUNCH
--------
Sample application to demonstrate how to launch a DirectPlay application
using the IDirectPlayLobby::RunApplication function. You can also use the
BELLHOP sample lobby client application and the sample lobby server to do
this.
[snip]
A real lobby client would be an application similar to DPLAUNCH but it
would be communicating with some lobby server to obtain all the
parameters for the IDirectPlayLobby::RunApplication call.
Cheers,
adude


--------------------
Flyte wrote:
iPromise wrote:
Seriously, i'd rather use DirectPlay then spend a year investigating what packets to send, i'm sure this is why everyone uses DirectPlay instead of Winsock..


Just thought I'd point out that DirectPlay was trash and no longer exists - i.e. it was deprecated 3 years ago.


At the risk of derailing the thread, I'll make a rebuttal. Back when DirectPlay was first announced (it was scheduled to ship with Win95, but missed by six months or so), the vast majority of games that featured multiplayer gameplay used IPX, modem, or null-modem connections. Very few (maybe none?) had native support for TCP/IP. There wasn't even a TCP/IP stack included with Windows back then. As a developer, you had to license tremendously expensive libraries for each connection method and then write your own abstraction wrappers. Once you got past all the scaffolding code, directplay let you write really really really simple network code that didn't even care how the users were connected. It was, in my humble opinion, a step forward.

Regards,
adude
Back to top
View user's profile Send private message
Flyte
Peanuts!!!!
Reputation: 6

Joined: 19 Apr 2006
Posts: 1887
Location: Canada

PostPosted: Fri Jul 16, 2010 12:11 am    Post subject: Reply with quote

justa_dude wrote:
At the risk of derailing the thread, I'll make a rebuttal. Back when DirectPlay was first announced (it was scheduled to ship with Win95, but missed by six months or so), the vast majority of games that featured multiplayer gameplay used IPX, modem, or null-modem connections. Very few (maybe none?) had native support for TCP/IP. There wasn't even a TCP/IP stack included with Windows back then. As a developer, you had to license tremendously expensive libraries for each connection method and then write your own abstraction wrappers. Once you got past all the scaffolding code, directplay let you write really really really simple network code that didn't even care how the users were connected. It was, in my humble opinion, a step forward.

Regards,
adude


While I will concede that it was worthwhile for the Windows 95/98/2000 era (and hence, a step forward), that was not what I was referring to. I was referring to it more towards the end of its lifetime - the fact that it was good in its time does not excuse the fact that it existed for almost a decade afterwards trying to solve a problem that no longer existed (as evidenced by first its overhaul in DirectX 8 and second its subsequent depreciation). It is much the same as a computer from that time frame: it may have been good at first, but ten years down the line it is trash all the same - new technologies have effectively replaced it.
Back to top
View user's profile Send private message
iPromise
Grandmaster Cheater
Reputation: -1

Joined: 27 Jun 2009
Posts: 529
Location: Canada

PostPosted: Fri Jul 16, 2010 2:19 pm    Post subject: Reply with quote

Hmm, for some reason I can't connect to myself? My local ip with port 80?

Code:

SOCKADDR_IN ServerInfo;

         ServerInfo.sin_addr.S_un.S_addr = inet_addr("192.168.0.42");
         ServerInfo.sin_family = AF_INET;
         ServerInfo.sin_port = htons(80);
         
         if ( connect(Socket, (SOCKADDR*) (&ServerInfo), sizeof(ServerInfo)) != 0 )
         {
            MessageBoxA(0, "Error: Failed to connect to host", 0, MB_OK);
         }
         else
         {
            MessageBoxA(0, "Connected to host!", 0, MB_OK);
         }


If the second parameter takes only const SOCKADDR* then SOCKADDR_IN won't work, right, or atleast, will have trouble?
Back to top
View user's profile Send private message MSN Messenger
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Fri Jul 16, 2010 2:22 pm    Post subject: Reply with quote

You need something listening on port 80 to connect to it.
_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
iPromise
Grandmaster Cheater
Reputation: -1

Joined: 27 Jun 2009
Posts: 529
Location: Canada

PostPosted: Fri Jul 16, 2010 2:31 pm    Post subject: Reply with quote

Still fails to connect to myself..?

My whole current source - code for Winsock:

Code:

#include <Windows.h>
#include <iostream>

using namespace std;

int main()
{
   WSADATA WinsockData; // Data variable that contains information on current Winsock installed.

   if ( WSAStartup(MAKEWORD(2, 0), &WinsockData) == 0 )
   {
      // Check current version

      if ( WinsockData.wVersion >= 2 )
      {
         SOCKET Socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);

         if ( Socket == INVALID_SOCKET )
         {
            MessageBoxA(0, "Error: Failed to create the socket", 0, MB_OK);
         }
         else
         {
            MessageBoxA(0, "Created the socket successfully", 0, MB_OK);
         }

         if ( listen(Socket, SOMAXCONN) != 0 )
         {
            MessageBoxA(0, "Error: Failed to listen to the socket", 0, MB_OK);
         }

         SOCKADDR_IN ServerInfo;

         ServerInfo.sin_addr.S_un.S_addr = inet_addr("192.168.0.42");
         ServerInfo.sin_family = AF_INET;
         ServerInfo.sin_port = htons(80);
         
         if ( connect(Socket, (SOCKADDR*) (&ServerInfo), sizeof(SOCKADDR)) != 0 )
         {
            MessageBoxA(0, "Error: Failed to connect to host", 0, MB_OK);
         }
         else
         {
            MessageBoxA(0, "Connected to host!", 0, MB_OK);            
         }

         char Buffer[256] = {0};

         cout << "Type: "; cin >> Buffer; cout << endl;
         
         cout << "Sending: " << Buffer << endl;

         cout << send( Socket, Buffer, 256, 0 ) << endl;

         char Receive[256] = {0};

         cout << recv( Socket, (char*) Receive, 256, 0 ) << endl << endl;

         cout << "Received: " << Receive << endl;

         MessageBoxA(0, "Current Winsock installed is acceptable", 0, MB_OK);
      }
      else
      {
         MessageBoxA(0, "Please upgrade your current Winsock software", 0, MB_OK);
      }

      // Close Winsock

      if ( WSACleanup() != 0 )
      {
         MessageBoxA(0, "Failed to close Winsock", 0, MB_OK);
      }
   }
   else
   {
      MessageBoxA(0, "Error: Failed to initialize Winsock", 0, MB_OK);
   }

   return 0;
}
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites