Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Programming and Scripting
Acess network or web server with Squirrel

nennad
Registered User
Quote
2010-12-12 10:26:28

Im looking for the way to write values from Copper Cube project to web server. For example, to store global high-scores of all players. When compiling as swf, it seems to me one way would be to pass a variable via JavaScript and then to PHP.
But what if i want standalone windows application which will need to communicate via Network with web server ? I could not find reference to that not here in Coppercube nor on Squirrel language web page!


niko
Moderator
Quote
2010-12-12 14:11:53

There is currently no documented API to do this, but I think I'm going to expose it, since it makes sense. But it is already existing and you can use this already anyway today:

There is a global variable named CL3D.CopperCubeVariables, holding all the variables. It is an array, containing only elements of type CL3D.FlaceVariable, representing each one variable. Each instance has the following methods:


getName()
setName(s)
getValueAsString()
getValueAsInt()
getValueAsFloat()
setValueAsString(s)
setValueAsInt(i)
setValueAsFloat(f)


I think with this, you should be able to access this. But this is only available in JavaScript, not in Squirrel, unfortunately.


nennad
Registered User
Quote
2010-12-12 15:19:04

Oops, Niko i think you have here a duplicate answer from other thread, regarding Javascript ? :)

Though it will be nice to have Squirrel functions from within Coppercube, to send few variables to the listening port on the server side, or to get variavbles from it (a global Highscore table, for example), (im thinking of win standalone)

Not to say in the future we could have multiplayer listener behaviour of some kind :) :)


gree
Registered User
Quote
2022-11-09 13:29:34

@niko
would you mind describing this a little bit.
how do I actual get all the global variables; just by typing the following in js? CL3D.CopperCubeVariables;

I'd really like to use this feature.
All other terms start with ccb.?

Thanks for helping out, again :)


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internation?l" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact