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

[Request] Add ability to set socket host and port via lua api #1495

Closed
ezBeanie opened this issue Feb 24, 2019 · 6 comments

Comments

Projects
None yet
4 participants
@ezBeanie
Copy link

commented Feb 24, 2019

Currently you are only able to set socket ip and port by executing emuhawk.exe with arguments behind it. (--socket_port and --socket_ip)
It took me a long time to figure out how to change these values since they seem to be defaulted at 192.168.178.21 for ip and 9999 for port. Maybe atleast change these to 127.0.0.1 and 8080?

Or Is it possible to simplify setting these with lua commands like:
comm.setSocketServerIP
comm.setSocketServerPort

and adding
comm.getSocketServerIP
comm.getSocketServerPort

@YoshiRulz YoshiRulz added the Topic-Lua label Feb 25, 2019

@zeromus

This comment has been minimized.

Copy link
Contributor

commented Feb 25, 2019

@Ashafix please get rid of the defaults. the service shouldnt be available if listening socket isnt specified. using random defaults is no good.

@ezBeanie It doesnt make sense to me to follow your suggestion. The way it's designed, the services are established when emuhawk boots. It's considerably more complex to make the services be up'd and down'd from script. It's up to @Ashafix whether he wants to support this or not.

@Ashafix

This comment has been minimized.

Copy link
Contributor

commented Feb 25, 2019

@zeromus : makes sense, I'll get rid of the defaults. You can assign the ticket to me and I'll start working on it (please be patient, I have a day job as well).
@ezBeanie : I'll check how much effort it is to make it available at run time.

@zeromus

This comment has been minimized.

Copy link
Contributor

commented Feb 25, 2019

apparently i cant assign issues to people not on the tasvideos team...

@Ashafix

This comment has been minimized.

Copy link
Contributor

commented Feb 25, 2019

@zeromus : nevermind, I'll work on it anway and just make a PR referencing the ticket.

@Ashafix

This comment has been minimized.

Copy link
Contributor

commented Mar 2, 2019

Ashafix@a252873

  • All defaults were removed
  • An error message is shown when only IP or port is set for the socketserver in the command line parameters
  • socketServerSetIp/setSocketServerPort/socketServerGetIp/socketServerGetPort/socketServerGetInfo Lua functions were added
  • When a socket server is initialized from the command line, its IP and port can be changed later via Lua functions.
  • All communication (socket, HTTP, mmf) global classes are now set to null by default and only initialized if requested by command line parameters
  • Collateral damage: argparse.ParseArguments gets called twice (once in Program.cs and once in MainForm.cs) which causes the initialization to happen twice. Program.cs needs only one paramter, therefore a new static function GetCmdConfigFile was introduced. @zeromus : can you check if that works for you? This call was introduced in commit 15131a0
@zeromus

This comment has been minimized.

Copy link
Contributor

commented Mar 2, 2019

that works for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.