Pages: 1
Author Topic: C++, Linux and 39DLL.  (71,093 Views)
Offline (Unknown gender) kkg

Member
Joined: Nov 2009
Posts: 84
View profile
Posted on: May 14, 2010, 06:25:50 AM
Okay, so let's face it: The only two languages I can use are PHP and GML. I'm making a multiplayer game in Game Maker. I want to make the dedicated server run on linux. The only method of multiplayer I know is 39DLL. I have extensive knowledge of GML and I know what all the functions of 39DLL do if it is of any help.
The only thing I know about 39DLL is it uses Windows sockets. I don't know what Windows sockets are or how they work (yay).
I know GML very well if that helps :P

I have the following options available to me:

1. Use the .cbp for the 39DLL and somehow fix it(alter it, w/e) to use Linux socket libraries, and keep making the game in 39DLL.

2. Use libting(http://code.google.com/p/ting/), learn how to make a DLL out of it, make the game using my own DLL from that library, and then learn how to use it in C++ and compile a C++ Server natively in Linux.

3. Run the C++ Server in WINE on Linux (I don't even know if this would work :D).

4. Just make the server for Windows and spend the extra money on a Windows VPS instead of a Linux VPS (this is last resort T_T)

5. Somehow write something in Linux that will communicate with my game on Windows. This is probably the same option as 1 :P

As I have zero experience in C++ and shit, I'd like to know not necessarily which would be the easiest course of action to take, but the best overall. I'm not afraid of learning :) The only problem is, the only way I actually learned what I know now was through already made engines. I would then tinker with variables and functions until I knew what they did to the engine, then rewrite the engine myself seeing if what I knew worked. My understanding is C++ is so ridiculous that I probably have zero hope of learning it using the same method, so :P
Any explanations of how anything [internally] 39DLL works would be fantastic.

This isn't a topic saying "MAKE ME AN ENGINE", it's a topic for recommending the correct path.

Thanks! ^_^

Oh and also, to get the 39DLL project files : http://gmc.yoyogames.com/index.php?showtopic=415883&st=0

TL;DR
What's the best way for a newbie fag to make a server in Linux that will communicate with a 39DLL GM game?
Offline (Unknown gender) Josh @ Dreamland

Prince of all Goldfish
Developer
Joined: Feb 2008
Posts: 2,950
View profile
Reply #1 Posted on: May 14, 2010, 12:54:49 PM
I was wondering that myself, really. I mean, not how to make a server, but how to bring multiplayer functions to ENIGMA cross-platform.

I, unlike the Game Maker brigade, see the potential and beauty in importing all-popular projects such as 39Dll. My thought was a mix of #1 and essentially #2, though ting wasn't my personal thought. Perhaps ting is worth looking in to for it. In other words, I want to incorporate a cross platform version of 39Dll into ENIGMA's default functions.

You're thinking of disaster cases on a forum regarding at least a mildly better option. ENIGMA is like five revisions away from letting you #include ting and use it in your scripts, which I imagine you'd like better than being lost in the world of C++ without a graphics library.

I don't want to begin a cross-platform port of 39Dll just now, for obvious reasons. Perhaps you should turn this into a development plea for ENIGMA and someone will take it on themselves more immediately. Otherwise, I'll get to it "eventually" but would recommend--since I assume you don't wish to wait--doing the same; using ting to recode the contents of 39Dll. If you succeed, and it works well, and you give it to us, we can add it right in as part of the language.

Not sure how similar ting is to WinSock. Good luck either way.
Offline (Unknown gender) serprex

Smooth ER
Developer
Joined: Apr 2008
Posts: 106
View profile WWW
Reply #2 Posted on: May 14, 2010, 01:34:11 PM
You don't have to use 39dll on a Linux server to communicate with a 39dll client
Offline (Unknown gender) Josh @ Dreamland

Prince of all Goldfish
Developer
Joined: Feb 2008
Posts: 2,950
View profile
Reply #3 Posted on: May 14, 2010, 01:46:20 PM
He knows. Hence option 5
Offline (Unknown gender) serprex

Smooth ER
Developer
Joined: Apr 2008
Posts: 106
View profile WWW
Reply #4 Posted on: May 14, 2010, 07:58:52 PM
It appears he doesn't, due to thinking it the same as Option 1. There is no need to think in stacks once you receive it server side. Though I'll admit that 39dll's stack abstraction is quite nice for sockets, making the streaming abstraction apply throughout
Offline (Unknown gender) kkg

Member
Joined: Nov 2009
Posts: 84
View profile
Reply #5 Posted on: May 15, 2010, 02:34:59 AM
Nah I did know that as long as they were using the same protocols and similar methods of sending that you could make an entirely original program to communicate with it, I just don't think that would be the best option for me right now as I don't really know shit :D
Offline (Unknown gender) IsmAvatar

LateralGM Developer
LGM Developer
Joined: Apr 2008
Posts: 877
View profile
Reply #6 Posted on: May 15, 2010, 02:58:33 AM
I developed the mplay-like functions for Enigma, which can be used similar to 39dll. I'm pretty sure I recall developing them cross-platform.
Offline (Unknown gender) RetroX

Master of all things Linux
Contributor
Joined: Apr 2008
Posts: 1,055
View profile
Reply #7 Posted on: May 15, 2010, 03:37:07 PM
39dll is merely a wrapper for WinAPI calls.  It's not cross-platform at all.

WINE can be used to read DLLs, and that can be an option for DLLs being cross-platform in ENIGMA.
Offline (Unknown gender) Rusky

Resident Troll
Joined: Feb 2008
Posts: 954
View profile WWW
Reply #8 Posted on: May 15, 2010, 04:05:08 PM
39dll is merely a wrapper for WinAPI calls... which are actually the Berkely sockets API, and are thus cross-platform. You only need to change which header files you include and add/remove a couple calls on initialization/destruction.
Offline (Unknown gender) kkg

Member
Joined: Nov 2009
Posts: 84
View profile
Reply #9 Posted on: May 16, 2010, 02:27:15 AM
Sweet Ism, Josh says he wants to take a look at them. I'm sure that's not really a priority right now for him so I'll still work on making this DLL just for the experience, but if your functions can be dropped right into ENIGMA that would be fantastic :D
Offline (Unknown gender) IsmAvatar

LateralGM Developer
LGM Developer
Joined: Apr 2008
Posts: 877
View profile
Reply #10 Posted on: May 16, 2010, 04:36:39 PM
Josh already saw them. I developed them almost a year ago. No clue where they are lying around now. I thought they might already be in the Enigma project. If not, I'll hunt around for wherever I put them.
Offline (Unknown gender) kkg

Member
Joined: Nov 2009
Posts: 84
View profile
Reply #11 Posted on: May 17, 2010, 04:23:31 AM
Yeah I haven't spoken to him the last couple of days so I don't know if he has them in his possession or not, you might want to contact him (yay for time zones). Anyway don't go out of your way to do it, but I am pretty keen to see how they work ;p
Offline (Unknown gender) IsmAvatar

LateralGM Developer
LGM Developer
Joined: Apr 2008
Posts: 877
View profile
Reply #12 Posted on: May 17, 2010, 02:37:01 PM
iirc, they are tiered. The lower tiers allow you to work with the raw data being sent through the network. The middle tiers handle packets for you. The higher tiers handle protocols like TCP and UDP, and ultimately, actual transfer protocols, like HTTP and FTP.

MPlay will be a little more difficult to code since its "protocol" is deprecated, windows only, and massive and proprietary, so I chose not to implement it. You'd basically have to build your own protocol packets, much like you do with 39dll
Offline (Unknown gender) RetroX

Master of all things Linux
Contributor
Joined: Apr 2008
Posts: 1,055
View profile
Reply #13 Posted on: May 18, 2010, 02:02:12 AM
Quote from: Rusky on May 15, 2010, 04:05:08 PM
39dll is merely a wrapper for WinAPI calls... which are actually the Berkely sockets API, and are thus cross-platform.
wait what really
Offline (Unknown gender) MahFreenAmeh

sysadmin
Web Team
Joined: Apr 2008
Posts: 13
View profile WWW
Reply #14 Posted on: May 21, 2010, 04:38:06 PM
derp.
Pages: 1