-1

Is it possible to use Python to make a server and use another coding language to create a client side program? I'm using Director 8.5/10 (Made by Adobe, much similar to FlashPlayer) and the server on this scripting language is quite bad. I'm mainly looking for something that will point me in the right direction on what to search for, haven't had much luck w/ google. The server I apparently used last time (found an old .py script I had) utilized the BaseHTTPServer module. Is this the one I should be using for basic data transfer of .txt files for a game?

If worst comes to worse than I'll probably use Java/C++ but I'm hoping I will not have to. Director compiles the source code to a .exe (called a projector) or a shockwave file if that makes any difference. I'm tired of using multiusr.xtra for Director, not only is it slow it only allocates 1000 connections. Any help is much appreciated

Micha
  • 5,117
  • 8
  • 34
  • 47

1 Answers1

0

Yes, you can create a server and a client in totally different languages and on totally different platforms as long as they exchange data in an agreed upon format. Generally these days the format of choice is JSON though XML was a popular format in the past. Understand that in both cases you're not sending "files" but text data.

You may want to read up on RESTful APIs which are a standard way of representing web services these days.

Soviut
  • 88,194
  • 49
  • 192
  • 260
  • Thank you very much, I'll look into this. I know that it is just text data being sent, just what I'm looking for. I think the biggest problem for me is getting a connection on the client side. Lingo (director's coding style) is a bit basic when it comes to some functions. – Sicarius Solaris Jun 20 '13 at 09:57
  • REST APIs are based purely on HTTP, meaning as long as you can connect to a URL, you can at least read from them. I'm fairly certain that at this point both Director and Lingo have HTTP facilities similar to Flash. – Soviut Jun 20 '13 at 16:16
  • Unfortunately Director has many limitations in what it can do, probably why Adobe Director isn't as popular as Adobe Flash. I'll definitely look into HTTP connections for it though. It is possible to enable UDP (not sure what default connection is on multiuser xtra, doesn't say in server files or on wikia), is that anything like JSON/XML format and could it possible be used with python? I'm trying to avoid using a website other than to either host the game or have to post newer updated clients on it (kind of limited on bandwidth and storage). I really appreciate the help – Sicarius Solaris Jun 20 '13 at 19:58
  • Yeah, avoid those as best you can unless you're trying to build a real-time multiplayer network game. If you just want to load remote levels or player profiles, REST via HTTP is easier to implement, easier to test (any browser can see the data), and generally easier to parse on the client. – Soviut Jun 20 '13 at 23:11
  • I forgot to mention that it is a real-time multiplayer game. I could use REST/HTTP for about 90% of the data being sent/received though. Would probably reduce lag a bit. I just looked into the sockets on python and realized that the connections are similar to multuser, but there is uneeded code that is used to log in via multiuser. I'll ask my friend who knows more about director than me, thank you so much for your help. – Sicarius Solaris Jun 21 '13 at 00:16
  • Unless you're really stuck with Director, I'd suggest using an actual game engine for proper TCP or UDP networking. Maybe look at Unity3D or Corona. – Soviut Jun 21 '13 at 03:25
  • I was thinking about switching to java/c++ soon anyway but Unity3D looks amazing, everything renders so fast. From what I understand as long as the socket format is the same, unity3d/python can connect without a hassle. Thank you so much for all your help. – Sicarius Solaris Jun 21 '13 at 09:10