IsmAvatar
|
|
Posted on: September 21, 2010, 12:27:41 pm |
|
|
LateralGM Developer
Location: Pennsylvania/USA Joined: Apr 2008
Posts: 877
|
I've uploaded my networking files to: http://github.com/IsmAvatar/EnigmaNetMIT license, so they can easily be relicensed to GPL. Please feel free to contribute. At this time, they are written in C only. They are largely functional, but some aspects need a bit of improvement, or at least a thorough going-over - in particular, mplay_send and mplay_receive. They are currently named mplay_ until we get a better name for them. They do not use DirectPlay (which GM uses) and we do not aim to create a reproduction of the mplay_ functionality. They work standalone, but I'm sure they could be plugged into Enigma as well.
|
|
« Last Edit: September 21, 2010, 01:04:33 pm by IsmAvatar »
|
Logged
|
|
|
|
|
|
|
|
IsmAvatar
|
|
Reply #5 Posted on: September 25, 2010, 06:57:17 pm |
|
|
LateralGM Developer
Location: Pennsylvania/USA Joined: Apr 2008
Posts: 877
|
Reproducing those functions is more work than it's worth. I'd basically be creating my own protocol for sessions, player objects, global data objects, and message objects. Not having them is very little loss, especially considering that mplay didn't work 90% of the time for most people anyways, and everyone else switched to GmSock already. Implementing them, on the other hand, is a whole lot of work. Remember that each of those functions has a very specific purpose, so it's not like I could just hand-wave over them. I'd basically have to single-handedly recreate all the work that a large team at Microsoft/DirectX's programming division already did in directplay, and then later decided to scrap and deprecate anyways.
|
|
|
Logged
|
|
|
|
TheExDeus
|
|
Reply #6 Posted on: September 26, 2010, 09:00:13 am |
|
|
Joined: Apr 2008
Posts: 1860
|
Ok, I agree.
Also, I didn't imply that you need to write directplay version for Enigma (so it would be as bad as GM one, and so what would be the point?). I just meant that it would be good if functions remained, like mplay_data_write(ind,val), mplay_data_read(ind) and so on. It wouldn't matter what the underlying system is. But as noone used mplay_, then I guess its better to make another system, and net_ prefix suits it.
|
|
« Last Edit: September 26, 2010, 09:06:13 am by HaRRiKiRi »
|
Logged
|
|
|
|
Post made September 27, 2010, 10:49:55 am was deleted at the author's request.
|
r9k
|
|
Reply #8 Posted on: September 27, 2010, 11:22:50 am |
|
|
Joined: Aug 2010
Posts: 25
|
I'm working on it. http://github.com/r9k/EnigmaNet/Those are the currently working functions, I tried to do them like GM functions, so it's easier for gm users to use them. Expert users will still be able to use the low level functions. double net_tcp_connect(string ip, unsigned short port, bool blocking); double net_tcp_connect_timeout(string ip, unsigned short port, bool blocking, float seconds); bool net_tcp_set_blocking(double tcpsocketId, bool blocking); double net_tcp_listen(unsigned short port, bool blocking); double net_tcp_accept(double listener_id, bool blocking); bool net_tcp_connected(double tcpsocketId); bool net_tcp_disconnect(double tcpsocketId); bool net_tcp_send(double tcpsocketId, double packetId); bool net_tcp_receive(double tcpsocketId, double packetId); bool net_tcp_destroy(double tcpsocketId);
bool net_udp_bind(unsigned short port, bool blocking); bool net_udp_bind_available(bool blocking); bool net_udp_unbind(double udpsocketId); unsigned short net_udp_localport(double udpsocketId); bool net_udp_set_blocking(double udpsocketId, bool blocking); bool net_udp_send(double udpsocketId, double packetId, string ipAddress, unsigned short remotePort); bool net_udp_receive(double udpsocketId, double packetId, string &ipAddress, unsigned short &remotePort); bool net_udp_destroy(double udpsocketId);
double net_http_create(); bool net_http_host(double httpId, string host); double net_http_send(double httpId, double httpRequestId); bool net_http_destroy(double httpId); double net_http_request_create(); bool net_http_request_method(double httpRequestId, string method); bool net_http_request_uri(double httpRequestId, string uri); bool net_http_request_field(double httpRequestId, string name, string value); bool net_http_request_body(double httpRequestId, string body); bool net_http_request_destroy(double httpRequestId); double net_http_response_status(double httpResponseId); string net_http_response_body(double httpResponseId); bool net_http_response_destroy(double httpResponseId);
string net_last_error();
double net_packet_create(); bool net_packet_destroy(double packetId); template <class T> bool net_packet_write(double packetId, T value); template <class T> bool net_packet_read(double packetId, T &var); bool net_packet_clear(double packetId); double net_packet_size(double packetId);
double net_utility_rc4_create(string keyString); bool net_utility_rc4_step(double rc4Id); bool net_utility_rc4_step_add(double rc4Id, double step); bool net_utility_rc4_step_set(double rc4Id, double step); char net_utility_rc4_byte(double rc4Id); bool net_utility_rc4_xor(double rc4Id, double packetId); bool net_utility_rc4_destroy(double rc4Id);
|
|
« Last Edit: September 27, 2010, 11:24:28 am by r9k »
|
Logged
|
|
|
|
|