This is question is about whether this will hypothetically work for a project I'm working on:
Flash .swf plays in browser
User sends SMS text message to SMS Server.
SMS Server updates MySQL Database value.
Flash connects to MySQL database and checks value.
Technically right now, I know I have to do research, but the biggest thing is "Flash needs to do something once it hits X amount of SMS text messages". Anything that I can cut out of that process would be great, but I think that's the best way.
The SMS part is a mystery to me, but after looking at another post, it seems like with http://www.twilio.com/ or something similar I can have a MySQL database receive SMS data.
Getting Flash to connect to MySQL I've heard is possible, but that's not really the part I'm worried about.
Suggestions or tips?
Flash cannot connect to MySQL directly.
It can "ask" a server side programming language to though.
Basically you use HTTP or AMF remoting to connect to a PHP class or file which in turn interrogates the database.
Related
I am working on an app in visual c++ which requires data to be accessed from a database which can be edited so that every time there is a modification to the data I do not have to resend the app as it will automatically update, it is also required that this is a desktop app.
I am currently using MySql however for this to run constantly I will be needing a server which for a single simple app wont really be worth purchasing, so I started thinking of alternative methods and thought to myself there must be some method of reading directly from a website or online database, am I correct in thinking this? If so could someone please explain how I would achieve this?
Also, I have purchased phpmyadmin in the past so if there is any way I could connect my visual c++ app to a database from this then that would be great.
EDIT: Note, this app relies almost entirely on the database as it is just 3 combo box's and one text field all of that values for which come from the database.
The following response is assuming that by online you mean on the web.
You cannot exactly 'connect' to an online database with C++ (or anything outside of that server hosting the database).
What I would do is create some PHP API's that you can POST to with libcurl via C++. You can both send and receive data this way.
Here is what I'm doing. I will have an online game that is a real exe application that clients run. Clients connect to my game server. They will have stats, achievements, and be able to buy various things for which I will use PayPal IPN service.
When a player wants to log on, I must be able to retrieve their profile and information from somewhere. When a player wins a game, the game server must be able to add a point to their profile.
Users will need to be able to access their stats from the Web Site, or from the game itself.
Would it be a good idea to use the MySQL database that comes with the Web Site for everything. In that, the game server would get and set properties through php or something?
Otherwise what might be a better solution? Is there a way for my web site to use a database that is on the game server machine, if so would that be a good idea?
How is this sort of problem usually solved?
Thanks
Where you put the database doesn't really matter. If you already have one and it can handle the load, use it. But for security and general organization, you should create a separate database and user within MySQL for your game score information. The user should only be able to access the game data database. This way your other data in the data base is protected from your web interface to the game data in case of a PHP or SQL vulnerability.
MySQL is defineatly the way to go. I have a current setup in a folder outside of public html called users, when a user registers a subfolder inside users is created along with a mysql entry. I use MySQL for username/pass/DOB/etc. and the user's folder for storing pics, acheivements in XML, and comments.
As for the client, I'm sure you could initialize a invisible web browser to access the page, and then use simple coding to get data from the web browser.
MySQL is a popular choice for persistence. Load up the profile at login and cache the data on the client. Then write the updates back at the end of the session. This is one of the things MySQL/PHP was made for. It is cheap, easy and performs and scales well.
any ideas on what I need to create a touchscreen restaurant ordering system?
I've got the touch UI understood and implemented 100%.
What I can't figure out is how to implement the "Send order to
kitchen" and "Call waiter" functions.
Each table will have a "client" computer running an air app. Calling the "Send order to kitchen" and "Call waiter" functions from the "client" computer should make the "client" communicate with a different "kitchen" computer over wifi.
I'm sure this can be done, I just don't know what I need.
I've read about UDP but I'm not sure that's it.
Any ideas?
With real time data delivery, a streaming server is useful, like you mentioned. Adobe offers a free service for that:
http://labs.adobe.com/technologies/cirrus/
If you think dealing with that might be somewhat over your head, you can always use a standard, locally accessible web server like PHP/MySQL. It would even allow you to archive closed orders with say, an "order_status" database field in MySQL.
The host AIR application could periodically ping the server for "open" records and push an alert if it sees any new records. When an order goes out, you'd obviously send a separate request back to the web server to update a particular record as closed.
Additionally, clients would send their order requests to the web server for inserting new records into the database... with each new record receiving a unique id (primary key).
I personally would go for option 2 for the sake of a database implementation.
For an easy Windows PHP/MySQL installation: http://www.wampserver.com/
Don't over complicate it.
An AIR application can run a ServerSocket that other AIR apps can push and pull messages from. You only need to write and read Sockets.
We even have cross-platform implementations of this, where either server or client is a native Android or iPhone app.
It works well as long as you can read / write servers and you are on the same network.
Good luck!
Juan
C# 2008
I have developed an application that need to connect to a web server in order to work. If the web server goes offline. The the app will have to be notified so that the user using the app can know what happened.
This application will be downloaded from the internet from our clients web site. So hundreds or thousands of users could have it.
I was thinking about pinging the web server maybe every 5 seconds. However, with 100's or 1000's apps would overload the web server.
Someone has told me about ESB would be right for this problem. The way I am thinking to use this, and I am not totally sure. Is to have every app to subscribe to the ESB. If the web server goes offline it will send a message to all the apps.
However, I understand that ESB is very big and complex and maybe this is overkill for my problem.
Am I understanding correctly.
If ESB is not the correct choice is there another design pattern I could use?
Many thanks
It sounds inappropriately out of scope to spec an ESB for this simple purpose. Why not just have the client machines figure it out as they periodically need to access the website? Instead of pinging the web server over and over, in the course of their normal activities they will need to access the web server for any normal reason, if they get an error response they can branch down the "web server is down" code path.
An ESB sounds like the wrong solution.
Two possibilities come to mind:
(1) If the user doesn't need to know they're offline in real-time, defer detection to usual error handling when you try and access the server.
(2) If you must know real time, use a small proxy at each client site so that only the proxies need to ping your server, not every desktop.
I'm developing a game coded in Flash AS3 and need to read/write info to an SQL server.
Currently, for testing purposes, I use ASQL which is very simple and robust, but it needs a direct connection from the client machine to the SQL server (port 3306 open and allowing wildcard username to connect from anywhere using a password) and the worse, the .swf format itself is not encrypted and a all decompilers will let you extract AS3 code, which means a password stored in code.
I have rounded up a few options but they all lack security measures:
AS3 code sending a POST req to a PHP page which connects to the MySQL server
Use amfphp, but the AMF protocol is still sniff-able
Keep current method and force users to have outgoing port 3306 open, which may confuse costumers.
Help/tips/discussion would be highly appreciated.
You can use HTTP(S) with authentication with e.g. PHP. Don't make the script a wrapper to the SQL connection, as this'd ruin the point of the script (essencially); have custom commands as the protocol (e.g. add/update high scores).
Depending on the number of commands needed I think you should choose option 1 (with only one or a few commands) or option 2 (if you have some more and complex commands to send). Don't open your database to the public internet.
What is the problem you are trying to solve/secure? If all your application (game) logic is at the client you cannot prevent people from faking results. The client is never to be trusted and no securing of the line (https or any other encryption of the communication) will help that -- that will only keep other people from eavesdropping.
If you are trying to secure the posting of high scores or game state - to my knowledge you can make it hard to fake them but you cannot make it impossible unless you move at least some game logic to the server.