frmHub object equivilent in lua 5
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

frmHub object equivilent in lua 5

Started by Spoonlord312, 04 September, 2005, 06:29:49

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Spoonlord312

Hey guys,
in lua4 'frmHub:EnableSearchData' and 'frmHub:EnableFullData' were used to allow custom commands for the scripts...now that we're all trying to move up to lua5 i cant seem to figure out what happened to those objects...i have been looking on here for weeks.
I have found all the converter scripts and such and even found an index through a friend but for some strange reason i cannot find what these need to be changed to. This is really important as my registration system has to be put on hold until i figure it out so help is much appreciated! also forgive me if the solution is simple - my scripting experience is very limited in lua4 let alone lua5

Spoonlord312

so ... dataarrival doesnt cut it? i know there are a bunch more arrivals but at this point my scripting knowledge is at a minumum - and two of my scripts are huge (4000+ lines) so it all of a sudden looks like a huge job to edit them. could i get an example or two in reference to commands being entered into the main chat?

HaArD

Instead of using DataArrival for ALL incoming data and switching some data on and off like this:

--// This function is fired when a new data arrives
function DataArrival(curUser, sData) 
  -- TODO your code here
end

frmHub:EnableSearchData(n) 
  n = 1 or 0 (1-enable,0-disable)
  enables/disables passing of $Search, $MultiSearch and $SR to current script

frmHub:EnableFullData(n)
  n = 1 or 0 (1-enable,0-disable)
  enables/disables passing of ALL incomming data to current script
  NOTE: may have significant influence on hub's performance. Use it wisely!

The new approach has different events for different types of incoming data like this:

SupportsArrival(User, Data)			- Incoming supports from user.
ChatArrival(User, Data)				- Incoming chat message from user. If script return 1 hub don't process data.
KeyArrival(User, Data)				- Incoming key from user.
ValidateNickArrival(User, Data)			- Incoming validate nick from user.
PasswordArrival(User, Data)			- Incoming password from user.
VersionArrival(User, Data)			- Incoming version from user.
GetNickListArrival(User, Data)			- Incoming get nick list request from user.
MyINFOArrival(User, Data)			- Incoming user myinfo.
GetINFOArrival(User, Data)			- Incoming get info request from user.
SearchArrival(User, Data)			- Incoming search request from user. If script return 1 hub don't process data.
ToArrival(User, Data)				- Incoming private message from user. If script return 1 hub don't process data.
ConnectToMeArrival(User, Data)			- Incoming active connection request from user. If script return 1 hub don't process data.
MultiConnectToMeArrival(User, Data)		- Incoming multi connection request from user. If script return 1 hub don't process data.
RevConnectToMeArrival(User, Data)		- Incoming pasive connection request from user. If script return 1 hub don't process data.
SRArrival(User, Data)				- Incoming search reply from user. If script return 1 hub don't process data.
KickArrival(User, Data)				- Incoming kick command from user. If script return 1 hub don't process data.
OpForceMoveArrival(User, Data)			- Incoming redirect command from user. If script return 1 hub don't process data.
UserIPArrival(User, Data)			- Incoming user ip request from user. If script return 1 hub don't process data.
UnknownArrival(User, Data)			- Incoming unknown command from user. If script return 1 hub don't process data (don't disconnect user).
BotINFOArrival(User, Data)			- Incoming hublist pinger request from user. If script return 1 hub don't process data.

You could simply call dataarrival inside all of the new events, but that's not a very efficient conversion......

Spoonlord312

#3
Alright hey thanks man - now I have been able to convert all my scripts the right way...mostly - now i have to fix the problems caused by the "converter" program...
Appreciate the help!

SMF spam blocked by CleanTalk