Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Telecomms compiler fails to upload for certain scripts #2775

Closed
Tastyfish opened this issue Dec 8, 2015 · 14 comments
Closed

Telecomms compiler fails to upload for certain scripts #2775

Tastyfish opened this issue Dec 8, 2015 · 14 comments
Labels
Bug This is a bug in our game code

Comments

@Tastyfish
Copy link
Contributor

Uploading my script caused the local html to refuse to upload it.
Here

  • Line 58 is the window.location = that pushes the script to the (real game) server. From fiddling with deleting parts of the script, I think it flips out if the script is over a certain length.

Going to naturally assume related to #2433. Can upload the script somewhere if need be for testing.

@tigercat2000
Copy link
Contributor

The script would be appreciated.

@Tastyfish
Copy link
Contributor Author

@TheDZD TheDZD added the Bug This is a bug in our game code label Dec 8, 2015
@marlyn-x86
Copy link
Member

I think the "encodeURIComponent" call on the text buffer might result in too large of a string for setting "window.location" to handle once there are too many characters in the buffer, as removing all newlines and putting the script in one line resulted in the same problem. To fix this, giving BYOND the script in some means other than through the URL would probably be necessary. @Tastyfish @tigercat2000

@marlyn-x86
Copy link
Member

Looks like what -tg- had, before NTSL was removed completely, was the winshow() built-in BYOND proc. Unfortunately, I don't think that's going to work here, so... Someone more experienced with web development than I may be able to help here.

@tigercat2000
Copy link
Contributor

@Crazylemon64 Problem is, there isn't any other way to give BYOND the script.
Byond is a piece of fucking shit in every regard, so the only way to actually communicate between browser and code is via a fucking parameter in a byond:// link.

@marlyn-x86
Copy link
Member

I think we, in a few other points in our codebase, make use of external libraries to get past stuff BYOND can't do. If we were, perhaps, to copy the code over to a cache on the server, then make BYOND read the data in with an external library call, we might be able to get around the "can only give BYOND data through url" problem

@Tastyfish
Copy link
Contributor Author

The code could in theory also be broken up into chunks of a size that we know do work, send the chunks, and then reconstruct it on the server, sorta like TCP.

@monster860
Copy link
Contributor

Yeah, how come no one tried changing it like that?

@marlyn-x86
Copy link
Member

I am not familiar with web development! I take it POST uses a similar format to including the message in the URL?

@monster860
Copy link
Contributor

Well, fun shit there. Anyways, I got that script above to compile after fixing a few errors, but I have trouble figuring out what it's supposed to do.

@monster860
Copy link
Contributor

With GET requests, which is what was used before, the data sent to the server is encoded in the URL. With POST, the data is sent after the URL in the HTTP request. The code used before is actually not the right way to make a get request, so I had to put in the proper code so I could set method to POST.

@marlyn-x86
Copy link
Member

@monster860 I think it's supposed to "markov chain", or use a repository of words to randomly generate messages, based on words it's given. So basically, it makes everyone not whitelisted sound like a chatbot, which says things with words that are often put after one another.

@Tastyfish
Copy link
Contributor Author

@Crazylemon64 I believe monster860 was talking about the compiler's code, although yes, that is what the ntsl script does (in theory, it's a revision I haven't tested yet because it became too long for the current compiler before the fix that just was made)

@monster860
Copy link
Contributor

Well, it works with my patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This is a bug in our game code
Projects
None yet
Development

No branches or pull requests

5 participants