I'm going to code this thing. I already have a modified version of ACC that compiles the ACS for HTTP communication. It will be a little while before I have a copy of Visual C++ .NET, however.Am I the only one who doesn't see any real use in this, not to mention that the amount of work required to properly implement it will probably be in no relation to the benefits?
ACS Networking
Moderator: GZDoom Developers
-
- Posts: 47
- Joined: Tue Apr 20, 2004 9:00 pm
- Location: Renton, WA
-
- Posts: 802
- Joined: Sun Oct 31, 2004 5:06 pm
- Location: Raleigh, NC
-
- Posts: 47
- Joined: Tue Apr 20, 2004 9:00 pm
- Location: Renton, WA
Okay, so apparently...
http://forum.zdoom.org/viewtopic.php?t=5587
Graf Zahl really doesn't like this potential feature.
If there's anyone who still wants to see this happen, post your support, and I will code it. Otherwise, I'll let it go.
Here is a piece of ACS that I can compile with a modified version of ACC. Think of it as one possibility for connecting to HTTP resources with ACS.
This way, I thought, only one function would need to be added to ACC's function list. DoHttpCommand() with HTTP_OPEN won't return control to the ACS code until the page is downloaded or an error/time-out occurs. The return value is either a positive index to the downloaded page or a negative value indicating a specific reason for the failure.
In this example, I included HTTP_CHECK_FIELD so one could determine whether a particular field is present in downloaded text, but I would make HTTP_GET_FIELD return 0 for a field that wasn't present anyway. Of course, the field reading code would only work for a plain text page that is formatted to return lines of name=value, but one would still be able to send data to any page.
So now I just need to know whether this is acceptable, should be changed, or should be scrapped. I already have HTTP 1.1 code for downloading files, so all I would need to do is link it up to ZDoom.
http://forum.zdoom.org/viewtopic.php?t=5587
Graf Zahl really doesn't like this potential feature.
If there's anyone who still wants to see this happen, post your support, and I will code it. Otherwise, I'll let it go.
Here is a piece of ACS that I can compile with a modified version of ACC. Think of it as one possibility for connecting to HTTP resources with ACS.
Code: Select all
#define HTTP_OPEN 1
#define HTTP_CHECK_FIELD 2
#define HTTP_GET_FIELD 3
#define HTTP_CLOSE 4
script 1 (int iAction)
{
int hService;
str strServer, strPage, strUrl;
strServer = "www.zdoom.org";
strPage = "action.asp?a=" + iAction;
strUrl = "http://" + strServer + "/" + strPage;
print(s:strUrl);
hService = DoHttpCommand(HTTP_OPEN,strServer,strPage);
if(hService > 0)
{
int iValue;
if(DoHttpCommand(HTTP_CHECK_FIELD,hService,"field1"))
{
iValue = DoHttpCommand(HTTP_GET_FIELD,hService,"field1");
print(s:"field1 = ", d:iValue);
}
if(DoHttpCommand(HTTP_CHECK_FIELD,hService,"field2"))
{
iValue = DoHttpCommand(HTTP_GET_FIELD,hService,"field2");
print(s:"field2 = ", d:iValue);
}
DoHttpCommand(HTTP_CLOSE,hService,0);
}
else
{
print(s:"Could not connect to ", s:strServer);
print(s:"Error #", d:hService, s:" occurred!");
}
}
In this example, I included HTTP_CHECK_FIELD so one could determine whether a particular field is present in downloaded text, but I would make HTTP_GET_FIELD return 0 for a field that wasn't present anyway. Of course, the field reading code would only work for a plain text page that is formatted to return lines of name=value, but one would still be able to send data to any page.
So now I just need to know whether this is acceptable, should be changed, or should be scrapped. I already have HTTP 1.1 code for downloading files, so all I would need to do is link it up to ZDoom.
-
- Lead GZDoom+Raze Developer
- Posts: 49184
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
[sarcasm]Great! You have extended ACC to handle one more function. What an achievement![/sarcasm]
Anyway, your code won't work. That's because ACS doesn't have any string management. You are simply not able to concatenate strings as you do. If you write
all you will get is another string from the string table at the index of the sum of all the indices you add.
Anyway, your code won't work. That's because ACS doesn't have any string management. You are simply not able to concatenate strings as you do. If you write
Code: Select all
strUrl = "http://" + strServer + "/" + strPage;
-
- Posts: 766
- Joined: Tue Sep 16, 2003 3:03 pm
String concatination is pretty important sometimes.
Maybe it should be included?
EDIT: I would rather see a pure socket implementation where you have to do everything yourself.
Also, what about if ZDoom supported a player that really didn't exist? I mean, a program connects to ZDoom and acts like a player, but it's really a scoreboard backend or something. And ACS is able to "embed" extra data into the connection stream for that scoreboard to read.
Maybe it should be included?
EDIT: I would rather see a pure socket implementation where you have to do everything yourself.
Also, what about if ZDoom supported a player that really didn't exist? I mean, a program connects to ZDoom and acts like a player, but it's really a scoreboard backend or something. And ACS is able to "embed" extra data into the connection stream for that scoreboard to read.
-
- Lead GZDoom+Raze Developer
- Posts: 49184
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
charris wrote:String concatination is pretty important sometimes.
Maybe it should be included?
Impossible with ACS. If you define a completely new scripting language it might be done. The closest thing I have seen so far is Jim's ACC patch to output arrays as strings but I think that's the best that can be done.
It's pointless anyway. ACS is far too limited for this to work - ever. Some people are apparently unwilling to listen but IMO any effort invested in this matter is a total waste of time.EDIT: I would rather see a pure socket implementation where you have to do everything yourself.
Also, what about if ZDoom supported a player that really didn't exist? I mean, a program connects to ZDoom and acts like a player, but it's really a scoreboard backend or something. And ACS is able to "embed" extra data into the connection stream for that scoreboard to read.
-
- Posts: 47
- Joined: Tue Apr 20, 2004 9:00 pm
- Location: Renton, WA
How about this?
Code: Select all
#define HTTP_OPEN 1
#define HTTP_CLEAR_QUERY 2
#define HTTP_ADD_QUERY_INT 3
#define HTTP_ADD_QUERY_STR 4
#define HTTP_CONNECT 5
#define HTTP_CHECK_FIELD 6
#define HTTP_GET_FIELD 7
#define HTTP_CLOSE 8
script 1 (int iAction)
{
int hService, iError;
str strServer;
strServer = "www.zdoom.org";
hService = DoHttpCommand(HTTP_OPEN,strServer,0);
DoHttpCommand(HTTP_ADD_QUERY_STR,hService,"action.asp?a=");
DoHttpCommand(HTTP_ADD_QUERY_INT,hService,iAction);
print(s:"http://", s:strServer, s:"/action.asp?a=", d:iAction);
iError = DoHttpCommand(HTTP_CONNECT,0,0);
if(iError == 0)
{
int iValue;
if(DoHttpCommand(HTTP_CHECK_FIELD,hService,"field1"))
{
iValue = DoHttpCommand(HTTP_GET_FIELD,hService,"field1");
print(s:"field1 = ", d:iValue);
}
if(DoHttpCommand(HTTP_CHECK_FIELD,hService,"field2"))
{
iValue = DoHttpCommand(HTTP_GET_FIELD,hService,"field2");
print(s:"field2 = ", d:iValue);
}
}
else
{
print(s:"Could not connect to ", s:strServer);
print(s:"Error #", d:iError, s:" occurred!");
}
DoHttpCommand(HTTP_CLOSE,hService,0);
}
-
- Posts: 766
- Joined: Tue Sep 16, 2003 3:03 pm
That's pretty much my idea of a string. An array of single characters.Graf Zahl wrote:charris wrote:String concatination is pretty important sometimes.
Maybe it should be included?
Impossible with ACS. If you define a completely new scripting language it might be done. The closest thing I have seen so far is Jim's ACC patch to output arrays as strings but I think that's the best that can be done.
It wouldn't be too hard, ACS could act as a pass through for real networking code. I've done a lot of socket stuff in C, and it'd be prime if it was identical to that. OMG did I just say prime...freaky... Anyways, I don't know how ACS works, but the engine could just move what I say in ACS and interpret it into the resulting C code.It's pointless anyway. ACS is far too limited for this to work - ever. Some people are apparently unwilling to listen but IMO any effort invested in this matter is a total waste of time.EDIT: I would rather see a pure socket implementation where you have to do everything yourself.
Also, what about if ZDoom supported a player that really didn't exist? I mean, a program connects to ZDoom and acts like a player, but it's really a scoreboard backend or something. And ACS is able to "embed" extra data into the connection stream for that scoreboard to read.
-
- Posts: 1193
- Joined: Thu Apr 15, 2004 3:28 pm
- Location: Leeds
-
- Posts: 802
- Joined: Sun Oct 31, 2004 5:06 pm
- Location: Raleigh, NC
-
-
- Posts: 10773
- Joined: Sun Jul 20, 2003 12:15 pm
-
- Lead GZDoom+Raze Developer
- Posts: 49184
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Xaser wrote:I don't really like this idea, for this reason: I have dialup.
Not only would it lag like hell for me, but it would also require me to connect to the internet every time I want the wad to run porperly. IMO, it's just not worth it.
Which is the main reason I don't like this idea. Apart from having very limited use in relation to a rather large amount of time in addition to an extremely high risk of abuse makes this a complete nightmare and I honestly can't imagine that Randy might even consider adding this to ZDoom.
To be blunt: It's nonsense dreamt up by people who don't have a clue what this means.
And yes, ZDoom Steam sums it up perfectly!
-
-
- Posts: 26574
- Joined: Tue Jul 15, 2003 4:58 pm
- Location: Scotland
I don't see this actually getting any worthwhile, real use. It's a pie in the sky idea with no real practical or realistic use. The user base and people interested in developing for it would simply be too small.
Database and updating maps? Be realistic. That's just not going to happen. It would involve all the map authors putting the net code into their behavior lumps and somebody maintaining the version numbers - somehow. Do you see most map authors wanting to do that? And yes, Zdoom Steam sums it up very nicely.
All the other suggestions (what "all") eg the scroeboard. Well, what scores do you have in mind? Zdoom doesn't have a scoring system in regular play. Frags? Use Zdaemon. It's already established and doesn't use an ACS modification. So, were looking at a score board for the 2 or 3 wads that might come out with some kind of scoring implemented, and a complimentary online scoreboard. Not gonna happen. Or if it does, it will rise, have its moment in the sun and then just fall by the wayside.
I really don't see this being used to any great extent, if at all. Perhaps one or two people might use it as an example, to show it can be done, and then it will simply become an unused feature with no online database, no scoreboard, no nothing to support it. More effort than it's worth to implement. Especially when Randy has many other things to consider and work on. Things that people will actually use and benefit from.
In the highly unlikely, snowball's chance in hell, thrown by a flying pig as he crossed in front of a blue moon, after a month of Sundays event that it did get implemented, then I'd simply set my firewall to stop Zdoom accessing the internet and the feature would cease to exist for me anyway.
56
Database and updating maps? Be realistic. That's just not going to happen. It would involve all the map authors putting the net code into their behavior lumps and somebody maintaining the version numbers - somehow. Do you see most map authors wanting to do that? And yes, Zdoom Steam sums it up very nicely.
All the other suggestions (what "all") eg the scroeboard. Well, what scores do you have in mind? Zdoom doesn't have a scoring system in regular play. Frags? Use Zdaemon. It's already established and doesn't use an ACS modification. So, were looking at a score board for the 2 or 3 wads that might come out with some kind of scoring implemented, and a complimentary online scoreboard. Not gonna happen. Or if it does, it will rise, have its moment in the sun and then just fall by the wayside.
I really don't see this being used to any great extent, if at all. Perhaps one or two people might use it as an example, to show it can be done, and then it will simply become an unused feature with no online database, no scoreboard, no nothing to support it. More effort than it's worth to implement. Especially when Randy has many other things to consider and work on. Things that people will actually use and benefit from.
In the highly unlikely, snowball's chance in hell, thrown by a flying pig as he crossed in front of a blue moon, after a month of Sundays event that it did get implemented, then I'd simply set my firewall to stop Zdoom accessing the internet and the feature would cease to exist for me anyway.
56
-
- Lead GZDoom+Raze Developer
- Posts: 49184
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
When Enjay starts to rant it gets funny!
But seriously, I couldn't agree more. But from looking at this thread it is obvious that there are some people who seem to stick to their stupid ideas until the bitter end.
But the most idiotic thing about all this is not the idea itself, it's to implement it in ACS! If this was a feature of the engine it might have some (very limited) value but for each mapper to code it by himself is just plain stupid to the most extreme degree.
IMO it's time to close this thread or move it to another forum. As a feature suggestion it is worthless but if some people here are intent on discussing it further I think this is the wrong place for it.
But seriously, I couldn't agree more. But from looking at this thread it is obvious that there are some people who seem to stick to their stupid ideas until the bitter end.
But the most idiotic thing about all this is not the idea itself, it's to implement it in ACS! If this was a feature of the engine it might have some (very limited) value but for each mapper to code it by himself is just plain stupid to the most extreme degree.
IMO it's time to close this thread or move it to another forum. As a feature suggestion it is worthless but if some people here are intent on discussing it further I think this is the wrong place for it.