Jump to content

[REL] Socket Module & IRC Resource


Recommended Posts

Module:Sockets

I proudly present you ml_sockets a c++ extension for mta 1.0, it was made by Gamesnert, MCvarial & x86.

The module adds socket functions & events to mta, sockets are used for communication between computers.

See wikipedia for more info: http://en.wikipedia.org/wiki/Internet_socket

Installation:

- download ml_sockets (https://wiki.multitheftauto.com/wiki/Modules/Sockets)

- place ml_sockets in (..server\mods\deathmatch\modules)

- add the module to your mtaserver.conf ( or for linux)

- restart the server

Functions:

- socket sockOpen( string host, int port )

- bool sockWrite( socket theSocket, string data )

- bool sockClose( socket theSocket )

Events:

- onSockOpened source: N/A Args: socket theSocket

- onSockData source: N/A Args: socket theSocket, string data

- onSockClosed source: N/A Args: socket theSocket

Support for listening sockets will be added later.

More info: https://wiki.multitheftauto.com/wiki/Modules/Sockets

Download: http://code.google.com/p/multitheftauto-modules/downloads/list

Resource:irc

The first resource to make use of this module is called irc made by MCvarial.

Its a resource that creates a echobot on irc.

Installation:

- download the resource https://community.multitheftauto.com/index.php?p=resources&s=details&id=731

- download ml_sockets (https://wiki.multitheftauto.com/wiki/Modules/Sockets)

- place ml_sockets in (..server\mods\deathmatch\modules)

- add the module to your mtaserver.conf ( or for linux)

- change the settings (settings.xml in the resource)

- give the resource admin rights

- start the server

- start the resource

Commands:

!uptime level: 0

!say level: 0

!s level: 0

!players level: 0

!pm level: 0

!getip level: 2

!getserial level: 2

!mute level: 2

!unmute level: 2

!freeze level: 2

!unfreeze level: 2

!kill level: 2

!slap level: 2

!ban level: 3

!banip level: 3

!banserial level: 3

!banname level: 3

!unbanip level: 3

!unbanserial level: 3

!unban level: 3

!bans level: 3

!start level: 3

!restart level: 3

!stop level: 3

!commands level: 0

!cmds level: 0

!run level: 4

!crun level: 4

Levels

owner (~) 5

super admin (&) 4

admin (@) 3

halfop (%) 2

voice (+) 1

user () 0

The bot was tested on GTANet, FFSNetwork, Rizon & quakenet

The resource is still in beta stage, more functions & bugfixed will be added later.

Edited by Guest
  • Like 1
Link to comment

Hey

It's great to at last find something compatible with linux :D, Although there's 1 thing about the IRC resource that i am having trouble with when trying to connect, I get this:

[19:55:44] Starting irc
[19:55:44] irc started successfully
[19:55:44] IRC: resource 'irc' outdated, please update!
[19:55:46] IRC: connecting to (IP) on port 6667...
[19:55:46] (IP): connected as MTA!
[19:55:46] (IP): notice from (Server): *** Looking up your hostname...
[19:55:46] (IP): notice from (Server): *** Found your hostname
[19:55:46] (IP): PM from 642F3C7C: ^AVERSION^A
[19:56:25] (IP): disconnected! (closing link)
[19:56:25] WARNING: core.lua: Bad 'element' pointer @ 'triggerEvent'(2) - Line: 179

Where (IP) and (Server) was the server i was connecting to

Dunno if you already know of this, or any way around it lol

Any help appreciated

Huperman.

Link to comment

Thank you for reporting this.

This looks like the IRC owner has enabled anti-spoof, which needs to send first a ping back before logging in.

Should be checked by Gamesnert & MCVarial (just a little bit debugging).

Questions? contact me @ IRC (x86).

Link to comment
  • MTA Team

I could be wrong, but calling Lua from another thread is fraught with danger.

I humbly suggest you put the data for the onSock* events into a thread safe queue, and then from within 'MTAEXPORT bool DoPulse ( void )', process the queue and trigger the events.

Link to comment
  • 1 month later...
  • 3 months later...

I have a problem: (

Because if I join I can not approve, but when I restart the resource if I am gejoint

I can pass all commands? I really get nothing: (

I had already tried that when someone connects to the resource he automaticly

irc restart but that did not work: S

I hope someone can help.

Wouter

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...