GithubHelp home page GithubHelp logo

danielga / gmod_luasocket Goto Github PK

View Code? Open in Web Editor NEW
27.0 4.0 3.0 71 KB

Modules for Garry's Mod that add bindings for OS sockets through luasocket.

Home Page: https://github.com/danielga/gmod_luasocket

License: Other

Lua 98.10% C++ 1.87% C 0.04%
garrysmod garrysmod-module gmod gmod-module garrys-mod

gmod_luasocket's People

Contributors

danielga avatar spiralp avatar yogpod avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

gmod_luasocket's Issues

require("socket") returns nil

Hey,
I am trying to use this library but cant get it running until the require statement.
I have moved all linux dlls into the lua/bin folder https://i.imgur.com/hCe2WQR.png and
when i use require("socket") the returned value is nil


if socket == nil then
	print("Why the fuck is the socket lib nil?!")
end```
the print message gets printed. But there are no errors in the console, that the module couldnt be loaded

Any example code?

Hi , I'm looking to implement sockets into my addon but as this is my first addon and sort of the first time I use lua I'd like to see some example code if that's available.

I am unable to get the library to work.

Hello, I am attempting to fix an old gamemode and it requires this library.

This is the error I am getting:

[ERROR] gamemodes/sslobby/gamemode/modules/sv_socket.lua:24: attempt to index global 'luasocket_stuff' (a nil value)
  1. unknown - gamemodes/sslobby/gamemode/modules/sv_socket.lua:24
   2. include - [C]:-1
    3. unknown - gamemodes/sslobby/gamemode/init.lua:25

and this is the code:

local luasocket = require(system.IsLinux() and "luasocket" or system.IsWindows() and "socket.core")

if(!luasocket) then
	luasocket = luasocket_stuff.luaopen_socket_core()
end

I have all the dll's in lua/bin and I have all the lua files in includes/modules. I don't know how to fix this, this is my first time using this library.

Undefined symbol: lua_getmetatable

I keep getting undefined symbol errors when requiring the modules. I've tried messing around with the makefiles generated with premake and linking with different settings but i'm not getting anywhere.

Heres the output of objdump -T gmsv_socket.core_linux.dll | grep meta if that's of any help
00000000 D UND 00000000 lua_getmetatable
00000000 D UND 00000000 lua_setmetatable
00000000 D UND 00000000 luaL_newmetatable

In fact, all but luaL_setfuncs and luaopen_socket_core show up as undefined when grepping for just lua instead of meta.

All the symbols seem to exist in lualib_shared.a so I don't think that's part of the issue but honestly I have no idea since I don't have much experience compiling lua modules.

Address/port whitelist for gm_socket

Using the module in clientside is pretty dangerous since it allows servers you connect to access to your entire network. A text file in lua/bin containing safe addresses and ports would be a good security improvement.

Use normal behavior if the whitelist file is absent.

Build not working

Hello,

So I am trying to build this for x86 and x86-64, I ran premake and Now I have the build files.

When I try to run make -f gmsv_socket.core.make it tells me that

garrysmod_common-master/projects/linux/gmake/x86/ReleaseWithSymbols/libhelpers.a

cannot be found and I'm unable to find that file anywhere online.
Could you help me out here?

Help with build

Hello, Danielga!

I'm not familiar with C++ and its build tools, so I need help. I downloaded premake and ran it:
premake gmake2 ./

I got new directory ./projects/linux/gmake2 with contents below:
image

Now i'm stuck of how to build libraries I need to put into lua/bin.

Do I need to run "make -f " for every file inside ./projects/linux/gmake2?

Thank you!

Won't require properly

lua/includes/modules/socket.lua:12: Couldn't load module library!

  1. require - [C]:-1
    1. unknown - lua/includes/modules/socket.lua:12

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.