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

Last Line Trimmed #4

Open
daesiku opened this issue Jun 7, 2016 · 8 comments
Open

Last Line Trimmed #4

daesiku opened this issue Jun 7, 2016 · 8 comments

Comments

@daesiku
Copy link

daesiku commented Jun 7, 2016

When using the ChatWindow.dll with mm2k6 multi line chats are dropping the last line. Only appears to happen on messages routed through server, and only drops it from the ChatWindowLastChat variable which appears to be what is dumped to the ChatWindow. Not sure if it's an issue with the DLL or with hirveserv (or perhaps my implementation there of)

@mikejsavage
Copy link
Owner

I don't have a Windows machine atm (and won't for a while) so unfortunately this is going to have to wait.

Is this happening to other people, and are you using the super latest version of mm2k? I've seen people complaining about the most recent version breaking scripts

@daesiku
Copy link
Author

daesiku commented Jun 9, 2016

Version is 4.28.1.17 (MudMaster 4.2.8), and I have reproduced on multiple installs. What's happening (which might be the DLLs fault honestly) is that the full chat value isn't getting placed into the variable for some reason, and as such it's not dumping to the logger window, and anything depending on that data (custom scripts) will fail. I am going to do a packet capture to see if I can spot any anomalies between the packets being sent from hirveserv and what a normal mm2k6 client sends to another client. If I don't use the ChatWindow.dll, and just use the native chat functionality built into mm2k6 the messages come through fine. If you have a hirveserv instance setup somewhere I can connect to and test against, I can see if it's just my install that's at fault somehow (perhaps a different version of a rock or something).
Steps to reproduce:
Standard mm2k6 install on Windows, connect to hirveserv and do anything that will result in hirveserv sending the client multi-line text back, EX: wiki table of contents. Check the $ChatWindowLastChat variable, which in my case is always missing the last line of text.

I have confirmed that any multi-line message, including chat messages from other hirveserv users, will result in this behavior.

@mikejsavage
Copy link
Owner

I mudmailed you a test IP + credentials

(since it sounds like you got a local instance running - were the docs at all helpful or do I need to work on those?)

@daesiku
Copy link
Author

daesiku commented Jun 10, 2016

Tested, and results are the same.
Screenshot of tail end of variable value:
image

Screenshot of tail end of actual output (bypassing ChatWindow.dll):
image

RE: Docs
I am not sure which docs you are referring to. If you mean the ReadMe then I would say it was missing quite a bit of data. I'd be happy to share some of what I encountered with you to try and improve things if you'd like.

@mikejsavage
Copy link
Owner

mikejsavage commented Jun 10, 2016

maybe the dll expects a trailing newline

you can test that quickly by editing Client:msg (line 185) in client.lua. replace

 "#lr<%s%s#lr>#lw %s" % { chat.config.name, prompt, table.concat( form, "\n" )

with

 "#lr<%s%s#lr>#lw %s\n" % { chat.config.name, prompt, table.concat( form, "\n" )

and similarly for the other clause.

I do mean the readme, please do let me know where it was lacking

@daesiku
Copy link
Author

daesiku commented Jun 11, 2016

I have modified the hirveserv "binary" directly and restarted the script. Here are the 2 modified lines:

"#lr<%s%s#lr>#lw %s\n" % { chat.config.name, prompt, table.concat( form, "\n" ) }

and

"#lr<%s%s#lr>#lw %s\n" % { chat.config.name, prompt, form:format( ... ) }

That appears to have partially fix the issue. Now when I print out the heIp file I can see the full contents, but chats from others still truncate. I am assuming that's because there are multiple places where the code sends data back without the trailing newline.

Re: Readme
I don't have a comprehensive list of all the things I tripped up on, but here are a couple of them, which could honestly just be my lack of knowledge about lua (this is my first time doing anything with the lua language)

  1. lua-ev would not install without installing libev As I am unfamiliar with these rocks, I did try a few other methods but manually downloading and compiling that was the only way I was successful
  2. When running the make process, it seems like you used luafilesystem to assign permissions, which I didnt have installed so it threw an error.
  3. libssl-dev was a requirement for one of the rocks, dont remember which one but I think it was bcrypt
  4. luasocket was needed though not listed as a requirement
  5. creating the wiki files on a windows machine (notepad) and scp-ing them over to the chat server didnt work (not really a surprise), when building it threw an error. I had to create them natively or modify them using a local editor (I used nano) for them to build successfully.
  6. git was actually a requirement for one of the dependencies to build successfully. Originally I just download the files and unzipped them intending to compile and roll, but something (I dont recall what) forced me to apt-get install git on that chat server

This was all on a newly configured Ubuntu box that was deployed specifically for this application to run on. I remember I had a few other trip ups as well, and I will be rebuilding from scratch soon for the sake of documenting the process. When I do I will share my exact setup steps.

@mikejsavage
Copy link
Owner

chats don't use msg so you would expect them to get cut off still

ack sorry! didn't realise it was that bad. will fix it up a little

wiki/consider db don't look for windows line endings which is why they were broken. not so hard to fix

@daesiku
Copy link
Author

daesiku commented Jun 11, 2016

Overall, I would like to say that the server is very functional and I have enjoyed debugging the errors I ran into. The comments in the code are entertaining as well.

Let me know if I can do anything else to help. If you fix the compatibility issues with the dll, I will pull a fresh copy and test. Any ideas on resolving the user <-> user multi-line chat issue? This feels like more of an issue with the DLL than with your code tbh.....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants