ID:1124313
 
(See the best response by Blastcore.)
Code:
        Communicate(procedure, msg, args)
{
world.Export("byond://[ip]:[port]?encryption:[encryption]&procedure:[procedure]&msg:[msg]&args:[args]")
}

OOC(msg, args)
{
Communicate("/world/proc/OOC", msg, args)
}

world
Topic(encryption, msg as text, args)
if(encryption != md5("xxx")) { return } else { call(world,text2path(msg))(args) }

proc
OOC(msg, args)
{
world << "[msg]:[args]"
}


Problem description:

Basically im trying to send messages from one server to the other and calling procedures...so far i can't really get it to work any help would be nice
encryption:[encryption]&procedure:[procedure]&msg:[msg]&args :[args]

The proper way to parse the values is to use = instead of : in a the GET procedure.

world.Export("byond://[ip]:[port]?encryption=[encryption]&procedure=[procedure]&msg=[msg]&args=[args]")
Okay so nvm im starting to understand this better lol.
So basically i need to know if anyone can help me with this last thing im trying to search of the start of &procedure= and then copy any text until the next &argument

        Communicate(procedure, argument)
{
world.Export("byond://[ip]:[port]?encryption=[encryption]&procedure=[procedure]&argument=[argument]")
}

OOC(msg)
{
Communicate("/world/proc/OOC", msg)
}

world
Topic(T)
if(!findtext(T,"encryption=97bd7746eb02a4c76a61c15e2b1fce01"))
{
return
}
else
{
call(text2path(procedure))(argument)
}
In response to Gokussj99
Best response
Gokussj99 wrote:
So basically i need to know if anyone can help me with this last thing im trying to search of the start of &procedure= and then copy any text until the next &argument

>       Communicate(procedure, argument)
> {
> world.Export("byond://[ip]:[port]?encryption=[encryption]&procedure=[procedure]&argument=[argument]")
> }
>
> OOC(msg)
> {
> Communicate("/world/proc/OOC", msg)
> }
>
> world
> Topic(T)
> if(!findtext(T,"encryption=97bd7746eb02a4c76a61c15e2b1fce01"))
> {
> return
> }
> else
> {
> call(text2path(procedure))(argument)
> }
>


You can just save that stuff in a list and then do world.Export("byond://[ip]:[port]?[list2params(MyList)]")

And on world/Topic(T) you would do params2list()

For example:

var/list/MyList = list("Test1" = "Hello!")
world.Export("127.0.0.1:1000?[list2params(MyList)]")

world/Topic(T)
var/list/MyList = params2list(T)
if(MyList["Test1"] == "Hello!")
return "Hello"
thanks i got it working :)

        Communicate(procedure, argument)
{
var/list/data = list()
data.Add(encryption)
data.Add(procedure)
data.Add(argument)
world.Export("byond://[ip]:[port]?[list2params(data)]")
}

OOC(msg)
{
Communicate("/world/proc/OOC", msg)
}

world
Topic(T)
var/list/data = params2list(T)
if(data[1] != encryption)
{
return
}
else
{
call(text2path(data[2]))(data[3])
}