ID:260744
 
Goal/Objective: To link worlds, and allow users from one world to communicate with another. This is different then it sounds, but all this is doing is allow messages to be sent across worlds via text or numeral or any other means.

Procs

world/proc/LinkTo(linkedaddress=null,linkpassword,linkhash)
/* Links the world to another world using the syntax:
IP/Port. Returns 1 if link is established, 0 if it has
failed, or if the world has already been linked.

In order to link worlds, you must know the other server's
hub password, and possibly some sort of secret hub hash
that only the host of the server knows. i.e */



world/proc/LinkEstablished(linkedaddress)
//Called when the world has been linked. Meant to be overwritten by the user for their purposes

world/proc/LinkSend(message)
//Sends a message to the linked world. Returns 1 if successful, 0 otherwise.

world/proc/LinkRecieve(message,sendingaddress)
//Called when the world recieves a message. Meant to be overwritten by the user for their purposes.


//EXAMPLE

mob/verb/LinkMyWorld()
if(world.LinkTo(192.33.33.1:3000,"password","#12399"))
world << "This world has been connected."
usr.verbs+=/mob/verb/CellphoneMessage
usr.verbs+=/mob/verb/SendMoney


mob/verb/CellphoneMessage(T as text)
world.LinkSend("[T.name] says [T]!")

mob/verb/SendMoney(N as num)
if(world.LinkSend("[T.name] says [T]!")==1)
world.money-=N
world << "[N] money sent to the other economy!"

world/proc/LinkRecieve(message,sendingaddress)
if(istype(message,text))
world << "We got a cellphone message from [sendingaddress]! It says [message]!"

else if(istype(message,num))
world << "[sendingaddress] just gave our economy [message] dollars!"
world.money+=message



There you go. There's my idea.
Mista-mage123 wrote:
Goal/Objective: To link worlds, and allow users from one world to communicate with another. This is different then it sounds, but all this is doing is allow messages to be sent across worlds via text or numeral or any other means.

Procs

world/proc/LinkTo(linkedaddress=null,linkpassword,linkhash)
>
> /* Links the world to another world using the syntax:
> IP/Port. Returns 1 if link is established, 0 if it has
> failed, or if the world has already been linked.
>
> In order to link worlds, you must know the other server's
> hub password, and possibly some sort of secret hub hash
> that only the host of the server knows. i.e */

>
> mob/verb/LinkMyWorld()
> world.LinkTo(192.33.33.1:3000,"password","#12399")
>
>
> world/proc/LinkEstablished(linkedaddress)
> //Called when the world has been linked. Meant to be overwritten by the user for their purposes
>
> world/proc/LinkSend(message)
> //Sends a message to the linked world. Returns 1 if successful, 0 otherwise. i.e;
>
> mob/verb/CellphoneMessage(T as text)
> world.LinkSend("[T.name] says [T]!")
>
> world/proc/LinkRecieve(message,sendingaddress)
> //Called when the world recieves a message. Meant to be overwritten by the user for their purposes. i.e.
>
> world/proc/LinkRecieve(message,sendingaddress)
> if(istype(message,text))
> world << "We got a cellphone message from [sendingaddress]! It says [message]!"
>
> else if(istype(message,num))
> world << "[sendingaddress] just gave our economy [message] dollars!"
> world.money+=message

There you go. There's my idea.





... This is basically world.Export() with different parameters... Or... Thats who I see it.
Using world.Export() and world.Topic() you could easily make all of those procs yourself. Though with the way you're suggesting it, you'd only be able to have a single world connect to another single world, doesn't seem very effective, especially if it were to be something implemented directly into BYOND.
Mista-mage123 wrote:
Goal/Objective: To link worlds, and allow users from one world to communicate with another. This is different then it sounds, but all this is doing is allow messages to be sent across worlds via text or numeral or any other means.

Uh... that's already been implemented for years. As people have said, look into world/Export(). And the more recent addition of persistent connections should make this essentially the same as what you want.