Team Spartan Cookies & Milk Forums
[Solved] Channels Bug - Printable Version

+- Team Spartan Cookies & Milk Forums (https://teamscm.co.uk)
+-- Forum: Garry's Mod (https://teamscm.co.uk/forum-4.html)
+--- Forum: Starfall (https://teamscm.co.uk/forum-7.html)
+--- Thread: [Solved] Channels Bug (/thread-1559.html)



[Solved] Channels Bug - esitee - 27-01-2016

So, it seems that 'channels.sendPrivate( Message )' is bugged. You can use it on the server environement, but not on the client.
Even though the documention says that it's useable on both.

Is that a starfall bug, or a failure in the documention?

For the code ( possibly that's wrong, but I don't think so ):

Serverside:

 
function sendPrivate( Message )
if Message ~= nil then
channels.sendPrivate( Message )
end
end

sendPrivate( "Hello World!" )

Clientside:


function sendPrivate( Message )
if Message ~= nil then
channels.sendPrivate( Message )
end
end

sendPrivate( "Hello World! From the Client!" )


The code used to get the Message on the other chip ( Serverside ):


function Incoming()
channels.listenPrivate( "Other", function( Chip, ... )
local Message = ...

Speak( Message, O )
end )
end

timer.create( "Incoming", 1, 0, Incoming )


I only got the message send serverside. I used chat.tell() so it's not because of some kind of spam protect. To be sure, I also run them seperately with 10 seconds between them. ( The Speak() function is basically just chat.tell() with some stuff added. ) The same happens, if I only use channels.sendPrivate() without a function.

Thanks, EisteeGolem.


RE: Channels Bug - SuperPlayer - 27-01-2016

That is not a bug as far a i know. Channels started in the server instance are ONLY availible to opperate on server. Same goes for clients. Do communicate between server and client you have to use net.


RE: Channels Bug - esitee - 28-01-2016

(27-01-2016, 08:45 PM)SuperPlayer Wrote: That is not a bug as far a i know. Channels started in the server instance are ONLY availible to opperate on server. Same goes for clients. Do communicate between server and client you have to use net.

Ah, didnt now that. Thanks!


RE: Channels Bug - Person8880 - 28-01-2016

Also to point out, this:

function Incoming()
channels.listenPrivate( "Other", function( Chip, ... )
local Message = ...

Speak( Message, O )
end )
end

timer.create( "Incoming", 1, 0, Incoming )

is a bad idea. You should only register a channel callback once. It's not going to be removed until you explicitly remove it, or the chip errors/is removed.


RE: Channels Bug - esitee - 29-01-2016

Ok, I'll pay attention on that in the future.

Thanks