←  Peripherals and Turtle Upgrades

ComputerCraft | Programmable Computers for Minecraft

»

[DISCONTINUED] [CC 1.481 | MC 1.4.7] Advan...

Tiin57's Photo Tiin57 27 Dec 2012

The advanced modem is basically a modem with some new features and a gold recipe.
First; craft it as you would a modem, but with gold, not stone.
Second; THEY CANNOT CONNECT TO THE REGULAR REDNET NETWORK. This is a feature I plan to add. No ETA requests; it'll be done when it's done.
Third; Channels. They're fun. Here's some methods for you to eat. Nomnomnom.
boolean = modem.open()
boolean = modem.close()
boolean = modem.send(id, msg)
boolean = modem.broadcast(msg)
boolean = modem.setChannel(channelID)
int = modem.getChannel()
Also, the message event for a modem is "advmodem_message".
Fourth; no textures yet. Or fancy rendering. Yes, I fail. Move on with life.
I think that's it.
Changelog & Downloads:
Spoiler
Do be warned that it is not functional as an advanced modem yet, and that it might be broken (haven't tested). I will be watching this thread for bug reports; tell me, so I can squish them with my Eclipse hammer.
Quote

Doyle3694's Photo Doyle3694 27 Dec 2012

no distance or sender id for modem.receive?
and I assume modem has to be wraped as a peripheral?

Otherwise, awesome. Will be added to my server once it gets recipies ;)

Though cloudy said it would be a planned feature as well, I really like this, have been waiting for it a long time.
+1!
Quote

Tiin57's Photo Tiin57 27 Dec 2012

 Doyle3694, on 27 December 2012 - 02:54 AM, said:

no distance or sender id for modem.receive?
Soon to be added.

 Doyle3694, on 27 December 2012 - 02:54 AM, said:

and I assume modem has to be wraped as a peripheral?
Yep.

 Doyle3694, on 27 December 2012 - 02:54 AM, said:

Otherwise, awesome. Will be added to my server once it gets recipies ;)
Though cloudy said it would be a planned feature as well, I really like this, have been waiting for it a long time.
+1!
Awesome, thanks!
Quote

Doyle3694's Photo Doyle3694 27 Dec 2012

Oh, and your links actually are ended with an .(dot)

So them no work, unless you manually copy into your URL bar and remove the dot
Quote

Tiin57's Photo Tiin57 27 Dec 2012

Derpyface, that has been fixed. Thanks.
Anyone having bugs?
Quote

CoolisTheName007's Photo CoolisTheName007 30 Dec 2012

If this can be used in turtles, what do you think about allowing the modem to listen to 2 frequencies? That way, turtles could connect two networks (each with a different frequency).
This makes more sense in the context of changing rednet to use frequencies (e.g. not send(id,msg) ). Since it's related, I post here what I think would be a complete solution for rednet frequencies (which is based of many ideas of the rednet frequencies suggestion thread):
setListenFreq(freq,n), where n is 1,2,3, or 4, and freq is something out of a very larger set of things, e.g. all Lua numbers, or strings of limited size.
Sets frequency slot n to freq.
Frequencies could initially be:
1st slot - the computer id;
2,3, and 4th slot: _default = a default frequency that wouldn't match any computer id;
All frequencies could also be a default value, in case there is the need to get rid of id's; which is an entirely diferent problem btw, how would people access their respective computer folders, ect. Plus, that wouldn't be backwards compatible.

send(freq,msg)
For all computers listening to the frequency freq, that are in rednet range, queues a rednet event ('rednet',freq,msg,distance,side) (side, why not? that way we can differentiate between modems). This is consequently backwards compatible with send(id,msg)

For backward compatibility, one can still implement broadcast(msg) as send(_default,msg). Backwards compatibility fails when people rely on send(_id,msg) only reaching the computer whose id is _id, because it would reach anyone listening to the frequency _id.

Why 4 frequencies to listen on? Because, in the context of a network, that is, a set of computers which wish to communicate efficiently among themselves, without interfering with others, and a turtle A of that network:
-1 frequency slot only, wouldn't allow listening to both the network's internal broadcasts and messages forwarded directly to A. The only solution would be filtering messages based on a target descriptor, e.g. send(net_freq,'target:A|msg'), but that would wake up every computer of the network in range of A, unnecessarily.
-2 frequency slots are better; but in networks there may be the need to have nodes linking 2 different networks, for instance the server network and a turtle fleet network, that one wants to keep with different frequencies, which are kept private and effectively serve as a secure channel (so that blacklisting a sub-network does not need to set a new frequency in the server network). Consequently, 4 channels are fine for this.

A computer can currently make this work with 4 advanced modems, but a turtle would need a modem with 4 channels. Personnaly, I would prefer a modem with 4 listening frequencies for all computers, because ease of use and turtle auto-servers and whatnot.

Btw, I now I've been talking a lot about networking, and I don't have anything completely ready yet, but I've already coded a routing protocol (github anyone interested, osi repository). I'm in the process of adpating cc-emu to simulate broken connections, and would like to use something like this to compare efficiency of normal broadcast with using channels. As it is now, it will work with the normal broadcast, but it would be more efficient either with the advanced modem as it is or the rednet frequencies described above.
Edited by CoolisTheName007, 30 December 2012 - 07:20 AM.
Quote

Cozzimoto's Photo Cozzimoto 30 Dec 2012

yes this is going to be awesome for added security and added ways to attempt to hack. lol =P

+ 10Posted Image
Quote

Sebra's Photo Sebra 30 Dec 2012

I like the way you done it.
Imho channel 0 should be connected to CC Modems. Not sure can you do it.
Rednet API should be able to use it. Not sure can you change it.
CCLan and Trans-World Modem can fit rednet very well too. I think rednet should be able to use many peripherals to communicate. At least which have all methods Modem have.
Quote

Tiin57's Photo Tiin57 14 Jan 2013

Ok, finally have proper networking, I hope.
Please BUGTEST.
Channel 0 will eventually connect to rednet.
Quote

zekesonxx's Photo zekesonxx 14 Jan 2013

 Doyle3694, on 27 December 2012 - 02:54 AM, said:

and I assume modem has to be wraped as a peripheral?

Edit rom/apis/rednet. The normal rednet modem is a peripheral as well.
Quote

Tiin57's Photo Tiin57 16 Jan 2013

Are there seriously no bugs?
Quote

theoriginalbit's Photo theoriginalbit 17 Jan 2013

Nice :) Was it you that made this as a suggestion at one point?

Also whats the channel range? And is there a way to get the channel its set to?
Quote

Tiin57's Photo Tiin57 20 Jan 2013

 TheOriginalBIT, on 17 January 2013 - 10:51 PM, said:

Nice :) Was it you that made this as a suggestion at one point?
Thanks!
And yes, this is in response to a suggestion.

 TheOriginalBIT, on 17 January 2013 - 10:51 PM, said:

Also whats the channel range? And is there a way to get the channel its set to?
modem.getChannel()
The range is up to 6 billion or something silly.
Quote

theoriginalbit's Photo theoriginalbit 20 Jan 2013

 tiin57, on 20 January 2013 - 04:27 AM, said:

 TheOriginalBIT, on 17 January 2013 - 10:51 PM, said:

Nice :) Was it you that made this as a suggestion at one point?
Thanks!
And yes, this is in response to a suggestion.

 TheOriginalBIT, on 17 January 2013 - 10:51 PM, said:

Also whats the channel range? And is there a way to get the channel its set to?
modem.getChannel()
The range is up to 6 billion or something silly.
Very nice! :D
Quote

Doyle3694's Photo Doyle3694 29 Jan 2013

 zekesonxx, on 14 January 2013 - 09:30 AM, said:

 Doyle3694, on 27 December 2012 - 02:54 AM, said:

and I assume modem has to be wraped as a peripheral?

Edit rom/apis/rednet. The normal rednet modem is a peripheral as well.

I know I'm abit late, but yes, I know it's a peripheral, I'm not retarded. My question was if I had to wrap it or if it was already wrapped with a built in program :P
Quote

Dirkus7's Photo Dirkus7 08 Feb 2013

This is now in the new ComputerCraft beta, the whole channel idea!
Quote

Tiin57's Photo Tiin57 08 Feb 2013

Yep. Due to CC's imminent inclusion of this idea in the core mod, I will not be developing this any further.
Quote