GeoIP for Lua5
 

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

GeoIP for Lua5

Started by VidFamne, 08 March, 2005, 21:15:04

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

VidFamne


Psycho_Chihuahua

Cool good Work Vid

one question though...

to allow more then one CC how should i enter them?

CH DE.......

or

CH;DE.......  ?
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

Alexandros

I get this error :-S
Syntax Files/Func/fFunc.lua:118: attempt to perform arithmetic on field `?' (a nil value)

Psycho_Chihuahua

i had that, but after a hub restart it worked. i think its because at start you dont have a Cnumb.txt in the files/Save Folder.

So just restart and it should work ^^
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

Skynet

i had same problem as well after adding Cnumb.txt in the files/Save Folder it works fine

Skynet
landofkaraoke

Copyright SkynetSystems 2000-2005 @Phoenix Network

nEgativE

#5
Is the link ok ?

Tks VidFamne.

bokkepoot

It seems that the GeoIP link doesn't work.
Can somebody place a good working link ?

Thanks in advance

Bokkepoot

Psycho_Chihuahua

PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

bokkepoot

Thank you very much !!

This is much apreciated by the operators of the queen hub.
They use this function to have some ease back-ground info about logged on users.
(To have a oppertunity if they have succes to talking in english to this new logged in user or not)

anyway thanks for downloading the script.
I go test it now !!

greetings


Bokkepoot

Psycho_Chihuahua

#9
well if they understand German i can post my translated version (haven't done all yet)  :D
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

bokkepoot

This will be fun !!!!

The operator who is using (and did request this script for LUA 5) is from Germany  :)

It would be nice if I can surpise her with a german version

If you can share it with us, it would be great !!

thank you very much

Bokkepoot

UwV

\NL   The knowledge and skills you have achieved are meant to be forgotten so you can float comfortably in emptiness, without obstruction.
" Holly loves me,...  . "      ;o)

& don't forget, the motto is :
  -- SUPPORT YOUR LOCAL DJ'S --

Psycho_Chihuahua

Sure no problem

Here you go GeoIP.German

But the compiled files i haven't translated so the Country's still appear as english...but commands and right click menu i've done
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

bolamix

Thanks for the link! I should have a French version ready tonight ;)
Sharing is of the essence!

Live music >> Aiwadirock! live music hub
PtokaX knowledge >> The PtokaX Wiki

UwV

#14
i think i have found a slight problem with the next though ..
so i added these 3 'debug' lines to the script ..
recnick = "UwV"
repnick = "Geo"

Newcon = function(User)
     -- cut 2 make post a little smaller --
	local Countn = tCnumb[C]-1
     	SendPmToNick(recnick, repnick, "  - IN    -->  "..User.sName.." \t from \t"..C.."\t was just added to table tCnumb by Ge0iP")
     	User:SendData
      -- cut 2 make post a little smaller --
end

UserDisc = function(User)
    -- cut 2 make post smaller --
    tCnumb[C] = tCnumb[C] - 1
    SendPmToNick(recnick, repnick, "  - OUT ->  "..User.sName.."\t from\t "..C.." has just been substracted from table tCnumb by Ge0iP
and got this printed to me

[15:06:47]  - IN    -->  Doustna     from    Poland was just added to table tCnumb by Ge0iP
[15:07:39]  - IN    -->  Ms.Nice     from    Local Host  was just added to table tCnumb by Ge0iP
[15:08:01]  - IN    -->  Gert     from    Netherlands  was just added to table tCnumb by Ge0iP
[15:08:18]  - OUT ->  ragdool    from    Sweden has just been substracted from table tCnumb by Ge0iP
[15:09:18]  - IN    -->  psycho.sys    from    Israel was just added to table tCnumb by Ge0iP
[15:09:19]  - IN    -->  Panoramix    from    United Kingdom was just added to table tCnumb by Ge0iP
[15:09:58]  - IN    -->  DiMT    from    Russian Federation was just added to table tCnumb by Ge0iP
[15:10:22]  - IN    -->  ragdool    from    Sweden was just added to table tCnumb by Ge0iP
[15:10:28]  - IN    -->  Gert    from    Netherlands was just added to table tCnumb by Ge0iP
[15:10:29]  - OUT ->  Tranceguy    from    Finland has just been substracted from table tCnumb by Ge0iP
[15:11:06]  - OUT ->  Ms.Nice    from    Local Host has just been substracted from table tCnumb by Ge0iP
[15:11:07]  - IN    -->  Ms.Nice    from    Local Host was just added to table tCnumb by Ge0iP
[15:11:11]  - OUT ->  Ms.Nice    from    Local Host has just been substracted from table tCnumb by Ge0iP
[15:11:11]  - IN    -->  Ms.Nice    from    Local Host was just added to table tCnumb by Ge0iP
[15:11:13]  - OUT ->  Ms.Nice    from    Local Host has just been substracted from table tCnumb by Ge0iP
[15:11:13]  - IN    -->  Tranceguy    from    Finland was just added to table tCnumb by Ge0iP
[15:11:14]  - IN    -->  Ms.Nice    from    Local Host was just added to table tCnumb by Ge0iP
[15:11:41]  - OUT ->  Doustna    from    Poland has just been substracted from table tCnumb by Ge0iP

so i think "Gert" has a bad connection or a bad client, or it is something in the hubsoft ? ..
then i read the PtokaX debug window and i see this ..

[15:10] (xxx.xxx.xxx.251) > $ValidateNick Gert|
[15:10] Gert (xxx.xxx.xxx.251) > $Version 1,0091|
[15:10] Gert (xxx.xxx.xxx.251) > $GetNickList|
[15:10] Gert (xxx.xxx.xxx.251) > $MyINFO $ALL Gert <++ V:0.305,M:P,H:34/0/0,S:15,O:15>$ $Cable$MAil@nowhere.nl$39826034582$|
[15:10] x User removed: Gert (Socket 804)..


" H:34 "  is why he is being disconnected by the hub .. (maxhub is set to 34)
 so not a bad client , not a bad connection, and not something with the hubsoft either ..
 anybody any ideas how to solve this 'nasty' thing..?  
   (exept for adding a second ('nickonline') table, to remember/check if a nick is not considered 'online' by the script.. ..   )
\NL   The knowledge and skills you have achieved are meant to be forgotten so you can float comfortably in emptiness, without obstruction.
" Holly loves me,...  . "      ;o)

& don't forget, the motto is :
  -- SUPPORT YOUR LOCAL DJ'S --

UwV

#15
i mean
Newcon = function(User)
     local compIp = f.ComputeIP(User.sIP)
     local C, CC = f.tSearchCountry(compIp)
          if (CountryCode == CC  or CountryCode == "ALL" or User.bOperator) then else
               User:SendData("Sorry but this hub only allow users from "..CountryCode)
               User:Disconnect(); return nil
          end
          if (tOnline[User.sName] ~= 1) then else
               return nil
          end
     tOnline[User.sName] = 1
     tCnumb[C] = tCnumb[C] or 0
     tCnumb[C] = tCnumb[C] + 1
     local Countn = tCnumb[C]-1User:SendData(" Hello "..User.sName.."  from "..C.." Welcome to "..frmHub:GetHubName()..
    ". \r\nOut of "..frmHub:GetUsersCount().." users in this hub,You have "..Countn.." compatriots in this hub.\r\n"..
    "Sending you this hubs normal user-command. Right-click on hub tab or userlist.|$UserCommand 255 7|"..
    "$UserCommand 0 1|$UserCommand 1 1 Get Country Stats.$<%[mynick]> +TopCountry||"..
    "$UserCommand 0 2|$UserCommand 2 2 Get User's Country$<%[mynick]> +Country %[nick]||"..
    "$UserCommand 1 1 Country by IP$<%[mynick]> +Country %[line:IP?]||"..
    "$UserCommand 1 1 My IP$<%[mynick]> +myip||")
        if User.bOperator then
    User:SendData("$UserCommand 1 1 Allow by Country Code$<%[mynick]> +Allow %[line:Country Code? or ALL?]||")
        end
end,
UserDisc = function(User)
    local compIp = f.ComputeIP(User.sIP)
    local C, CC = f.tSearchCountry(compIp)
    tCnumb[C] = tCnumb[C] - 1
    tOnline[User.sName] = 0
end,
actually solves that problem ..  but i dont really like it since i'll need to do the whole file routine if i want it to work on script reboot,.. besides that it might become a pretty large table after a week or two .. and thus eating 'precious' memory away  ..  :0(
\NL   The knowledge and skills you have achieved are meant to be forgotten so you can float comfortably in emptiness, without obstruction.
" Holly loves me,...  . "      ;o)

& don't forget, the motto is :
  -- SUPPORT YOUR LOCAL DJ'S --

Zigurds

I am use script user command  (http://board.univ-angers.fr/thread.php?threadid=3722&boardid=26&styleid=1&sid=0d782bdc9edba822428ffad76d6dd9fc)

use this GeoIP here me is conflict,  invisibility my commands

Sorry my bad English
--------------------------------------------
owner for Latvian hubs Alfa

VidFamne

To Zigurds, delete this;   $UserCommand 255 7|
in the NewCon function.
And to UwV, I could only assume that the NewUserConnected function is trigged only when a user is properly loged in.
PPK could perhaps answer this question.

Zigurds

and any
how much have updates this GeoIP ?
My hub for Latvian users only

UwV

#19
QuoteOriginally posted by VidFamne
And to UwV, I could only assume that the NewUserConnected function is trigged only when a user is properly loged in.
PPK could perhaps answer this question.

problem is with the  UserDisconnected function..
not the NewUserConnected function..

but anyway .. guess your answer is the same ..
so i hope PPK can answer the question ..

Yet what about solving it though ?
 .. if i am the only one experiencing this .. np
 i guess can solve my own problems (with a little help from my friends)..
but it seems like there will be more people getting or having this same problem sooner or later..

best regards,

p.s. the solution above does NOT fix the problem.. just makes it lighter ..  (a user that is counted for, and disconnects without  being noticed by the script still is couted for) as 1 .. but at least i wont wake up in the mornig again and see..
 38 users from poland and 28 from netherlands.. and to top it all off 56 from sweden in the top 10 list ..
 when there is only 43 users online..  ;0)
\NL   The knowledge and skills you have achieved are meant to be forgotten so you can float comfortably in emptiness, without obstruction.
" Holly loves me,...  . "      ;o)

& don't forget, the motto is :
  -- SUPPORT YOUR LOCAL DJ'S --

Zigurds

here is my fragment recension. Visible in but commands and right click menu


    User:SendData(" Hello "..User.sName.."  from "..C.." Welcome to "..frmHub:GetHubName()..
    ". \r\nOut of "..frmHub:GetUsersCount().." users in this hub,You have "..Countn.." compatriots in this hub.\r\n"..
    "Sending you this hubs normal user-command. Right-click on hub tab or userlist."..
    "$UserCommand 1 3|$UserCommand 1 1 Country\\Get Country Stats.$<%[mynick]> +TopCountry||"..
    "$UserCommand 0 2|$UserCommand 2 2 Country\\Get User's Country$<%[mynick]> +Country %[nick]||"..
    "$UserCommand 1 3 Country\\Country by IP$<%[mynick]> +Country %[line:IP?]||"..
    "$UserCommand 1 3 Country\\My IP$<%[mynick]> +myip||")
        if (curUser.iProfile == 0) then
    User:SendData("$UserCommand 1 3 Country\\Allow by Country Code$<%[mynick]> +Allow %[line:Country Code? or ALL?]||")
        end
end,

Zigurds

Sorry, my error

true --- if (User.iProfile == 0) then

PPK

QuoteOriginally posted by UwV
problem is with the  UserDisconnected function..
Bug found, bug fixed  :]
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

UwV

QuoteOriginally posted by PPK
QuoteOriginally posted by UwV
problem is with the  UserDisconnected function..
Bug found, bug fixed  :]

great :0)

didn't wanna post in bugs section untill i was absoluteley sure ..
 and i was only sure about it this morning
(after trying in solo and with a zzz. in the front of the filename and with a aaa. in front of the filename)

and it still gave me the same problems ..
aslong as i had PPK's "anti no-hash-client script" running..
users would get disconnected by it and not be noticed by geoip script...
 (even after commenting the  return 1 in PPK's and changing it from aaa.lua to zzz.lua rebooting etc. etc.) ..

so glad to hear this was not some ghosthunt  i was on ..
and even more happy to hear it is fixed already even :0)
\NL   The knowledge and skills you have achieved are meant to be forgotten so you can float comfortably in emptiness, without obstruction.
" Holly loves me,...  . "      ;o)

& don't forget, the motto is :
  -- SUPPORT YOUR LOCAL DJ'S --

PPK

QuoteOriginally posted by UwV
and it still gave me the same problems ..
aslong as i had PPK's "anti no-hash-client script" running..
users would get disconnected by it and not be noticed by geoip script...
 (even after commenting the  return 1 in PPK's and changing it from aaa.lua to zzz.lua rebooting etc. etc.) ..

so glad to hear this was not some ghosthunt  i was on ..
and even more happy to hear it is fixed already even :0)
My fix not help with problem if another script disconnect user in NewUserConnected :(
One way is to change manually script order, another way is add all scripts having NewUserConnected to one :rolleyes:
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

SMF spam blocked by CleanTalk