Jump to content




[DISCONTINUED] [CC 1.481 | MC 1.4.7] Advanced Modems - 0.1


16 replies to this topic

#1 Tiin57

    Java Lunatic

  • Members
  • 1,412 posts
  • LocationIndiana, United States

Posted 27 December 2012 - 02:24 AM

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.

#2 Doyle3694

  • Members
  • 815 posts

Posted 27 December 2012 - 02:54 AM

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!

#3 Tiin57

    Java Lunatic

  • Members
  • 1,412 posts
  • LocationIndiana, United States

Posted 27 December 2012 - 03:19 AM

 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!

#4 Doyle3694

  • Members
  • 815 posts

Posted 27 December 2012 - 04:36 AM

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

#5 Tiin57

    Java Lunatic

  • Members
  • 1,412 posts
  • LocationIndiana, United States

Posted 27 December 2012 - 06:31 AM

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

#6 CoolisTheName007

  • Members
  • 304 posts

Posted 30 December 2012 - 05:30 AM

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.


#7 Cozzimoto

  • Members
  • 221 posts
  • LocationDallas, Tx

Posted 30 December 2012 - 06:13 AM

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

+ 10Posted Image

#8 Sebra

  • Members
  • 726 posts

Posted 30 December 2012 - 08:55 AM

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.

#9 Tiin57

    Java Lunatic

  • Members
  • 1,412 posts
  • LocationIndiana, United States

Posted 14 January 2013 - 09:25 AM

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

#10 zekesonxx

  • Signature Abuser
  • 263 posts
  • LocationWhere you aren't

Posted 14 January 2013 - 09:30 AM

 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.

#11 Tiin57

    Java Lunatic

  • Members
  • 1,412 posts
  • LocationIndiana, United States

Posted 16 January 2013 - 05:50 AM

Are there seriously no bugs?

#12 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 17 January 2013 - 10:51 PM

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?

#13 Tiin57

    Java Lunatic

  • Members
  • 1,412 posts
  • LocationIndiana, United States

Posted 20 January 2013 - 04:27 AM

 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.

#14 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 20 January 2013 - 04:33 AM

 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

#15 Doyle3694

  • Members
  • 815 posts

Posted 29 January 2013 - 12:51 PM

 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

#16 Dirkus7

  • Members
  • 148 posts
  • Locationthe Netherlands

Posted 08 February 2013 - 11:21 AM

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

#17 Tiin57

    Java Lunatic

  • Members
  • 1,412 posts
  • LocationIndiana, United States

Posted 08 February 2013 - 01:40 PM

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





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users