Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I am going to implement a "game lobby" for my game (which is a new topic for me). The game works the following way:
Users chooses "random game".
The device connects to a specific URL where I will implement some game logic (like name of players in the session, name of the game session itself and so on).
The URL returns values to the device so the game can load them and start.
My question is: What is "the best" way to do this? Should I have a database with different game sessions that contains all the information for each game session.
Or should I start a script on the server (one script equals on game session) for each game that starts that holds the information that is necessary?
I was on the thoughts to have this as a socket to socket game. But I think it will be easier with the client-server approach since the server then will take care of most of the logic and the devices only needs to concentrate on one single connection at a time.
Any help or advice is appreciated!
The cleanest approach for this would be a client server model as you guessed.
This simplifies client code a lot, as compared to database approach, but you need to setup and maintain a server.
You will anyways need a centralized entity (as a matchmaking service provider) if you want to let the user choose a random game. So I would suggest to go for setting up a server.
Following libraries might be helpful.
Netty (low level but versatile)
KryoNet (easy, high level features but limited (more than enough
for games))
jWebSockets (Very good real time performance with long lived TCP
connections)
Photon (Realtime, scalable, cloud, high performance but NOT
FREE)
There are many more... just search
Hope this helps.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I'm developing an android chat client, I decided to use XMPP and I started studying from the official XMPP RFC.
The 7th chapter is about Resource Binding.
Now, for me it's clear the way that Resource Binding is technically realized but I really can't understand for what it could be useful.
To be more clear and straightforward:
what usefulness can it have on the chat client?
why should a chat client use this feature?
what usefulness can it have on the chat server?
why should a chat server use this feature?
I read the guidelines of stackoverflow. I'm not asking for an opinion. I would like to have an explanation of how and why this feature could/should be implemented in an application.
Resources are used to distinguish different sessions of the same account, in particular on different devices. It would be very unhelpful if half of your file goes to a different device if that device signs on in the middle of a file transfer.
So to answer your questions:
So your client can distinguish between different sessions of the user's contacts and make sure the stanzas end up at the correct one.
Because servers (almost) always require it.
So the server can allow multiple sessions on the same account and can distinguish what session a stanza is for.
Because people want to be able to sign on to their account from multiple devices.
Any server will assign a random and unique resource for you if the client doesn't specify one. There isn't really a clear "best solution" here:
The resource may be a hint for your contacts about where or what that device is, such as "home", "office", "laptop", "phone".
However, specifying an easy to guess resource will make it possible for others to determine whether you are online or not (only the people you have allowed to do that should be able to determine that).
Two clients that are trying to use the same resource often lead to loops where they keep kicking the other off.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
i be wondering How to game calculate the time for completion of work?
e.x:clash of clans find something update are done.
i believe someone want say get the time by server.but even i be offline can receive notification which say done.even i do change clock of phone nothing change in game if i change time of phone.
The time that is used to determine the yield from objects existing in clash of clans is maintained from a centralized server.
If you wanted to build an app that would calculate the times required to do things in game I think the rout to go would be to
A) ask the developers for the code (unlikely to be fruitful)
B) reverse compile the code. (potentially illegal)
C) Hand document the times required for in game events to happen (game w/notes)
D) Do a literature review to find data on the game
From this Data you may be able to craft a sort of clash of clans advisory app, but I doubt it will be easy to dupe such a consistently maintained app with hacks as simple as changing you're clock.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I'm working on an ebook store application (my target users will be 10,000 users per months). It's very hard to make up my mind to select the backend between AWS and Parse.
Parse is very simple to use. It could save me one or two months development work. But I'm concerning about the number of requests per month. There are free 1,000,000 requests. But I don't know how they calculate the number of requests. I tested with the demo application. A simple run cost me 4 requests (there seems to be only one request in the code.). I totally have no clue 1,000,000 requests can server how many users.
AWS is free at the first year. It's more flexible. I can control almost everything. The problem is I have to do everything from scratch. Database, Web service, security, server management. Also it's very difficult to estimate the cost.
I'd like to hear your opinions about the cost, performance, scalability, security, etc. Thanks
Edit at 16th Nov. 2016:
Parse.com will terminate at 28th Jan. 2017. But it will provide a open source version. I personally think it's even better because I can host our own data at anywhere I like, for example, at AWS.
Regarding this very old QA...
Parse is now closed
back4app.com is the "new" Parse
AWS nowadays offers a full suite of such mobile services
generally, parse (now back4app.com) is much simpler, it is more of an all-in-one, "easy to use" BAAS. AWS is more industrial, expandable, a little harder to use and set up.
Parse have changed their price plan: you do not have monthly request limit, but burst limit. For free user it's now 30 req/s which is very fair.
For your question, yes, Parse will save you lots of time. I recommend starting with Parse for one reason: if they do not fit to you, you could switch after on AWS (or app engine with cloud endpoint).
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
So I am creating a project with a couple of buddies and I need to create an API. This is my first time creating a big project and creating my own API. I don't know where to start. The project that we're working on will have a website, an app for Android and IOS, and use PostgreSQL. We will be using Javascript and Node.js as well. If there are any tips about creating API's for Android, IOS, and Web please let me know.
I would strongly recommend you read "RESTful Web Services" by Richardson
The book gives a thorough grounding in the "why?" behind organizing resources restfully. Also provides a good outline of different RESTful authentication mechanisms and the pros and cons of each - vital for a mobile app talking to a web-based back-end.
Then, sit back and outline the resources that will be necessary to run your app and have at it!
First of all take paper and pen to start design the architecture and write down all use cases. Also define the way data will be access.
While creating an API for mobile apps we should keep some important things in mind. First what type of API it should be JSON based or XML. And I will prefer JSON for mobile app as its lightweight and will take less time to parse. Also it will be fast to transmit. While XML bit costly.
One of most important thing you should design the api as secure as it could be. Because sensitive information can be sniff by some one. better to use SSL hand shake to make it secure.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have made an Android card game where the user plays versus an AI. Now I want to make it online so a player could play versus another player. Is possible to host the game server (written in vb.net) in Windows Azure?
The server is using TCP connections and it will send a simple message to the client (e.g., "K Spades"), but I also want to have a DB with player names, scores, etc.
The game currently has ~20k players. What hardware/bandwidth will the servers need?
If is not possible to deploy the server on Azure, what should I use?
Short answer is "it depends". 20K players generating how much traffic? How much storage does it take now based on just 2 players playing 1 game? How much processing power does it take for a single game? (mutliply that with the potential number of players and games). Check out the pricing calculator.
Also, check out auto scaling where you resources will dynamically scale up and down depending on the traffic it gets at runtime (meaning you don't have to reserve instances ahead of time).
20k users should mean that you don't have more then ~ 2k users a day online.
Your game users should use far less traffic, then, for example, web site users.
For a web site, 2k users a day is a funny number, so I guess that you can run server even on your phone : )