November 01, 2024, 07:42:37 pm

Author Topic: Stock Market!  (Read 4712 times)

0 Members and 1 Guest are viewing this topic.

Chief149

  • Hero Member
  • **
  • Posts: 646
  • Oppan Gangnam Style
    • View Profile
Stock Market!
« on: October 22, 2012, 09:20:34 pm »
Goes like this:

There are two pieces. 1 is the in-game side, and the other is the side program.

One the game-side there are two commands:
1) /sm deposit
2) /sm withdraw

Then there is the second side of things: The app. The app I am talking about is actually a small program the user would have to download. The app would be connected to the MC server plugin, and it would be connected to it's own server app.

Plugin responsibility:
1) process commands. When a player does /sm deposit <amount> or /sm withdraw <amount> the plugin must tell the stock market server app the name of the player, and the amount given or taken, and that is it!
2) Handle error messages returned by the stock server. Basically if I had $10 in my stock account and tried doing /sm withdraw 100 then the stock server will send an error message saying there aren't enough funds which the plugin must relay to the player. Or maybe I never registered my username therefore it will give an invalid user error.

Trade server responsibility:
1) Accept deposits and withdraws, and keep track of user accounts.
2) Process trades, and check stock prices.
3) Process account creation


So to clear things up I will go through what happens for me to participate in this program. I am assuming this feature has been created, and fully implemented on the server.

First I will go and download the Exchange client app. This is required for me to trade in the market.

Then I open the exchange app. I then type in Chief149 as my username as it is the username I play with in the server (MUST BE YOUR IN-GAME USERNAME!!!). There are two buttons:  "Login" and "Register". I click register so my credentials are used to make a new account. View the spoiler for the back -end/technical stuff that goes on
(click to show/hide)



Now my account is made and the client is showing me the "Portfolio". This shows my account balance, and any investments in stock.

Now I need to add funds. I go into the opticraft server and do /sm deposit 100000 to send $100000 to my portfolio. View spoiler for technical stuff.
(click to show/hide)

Now I decide I want buy 100 shares of Amazon, so I go back to the exchange/trade client, and I look for the "Trade" button. I click it, and I fill out the form. I decide I want to buy 100 shares of Amazon, so in the ticker symbol input I type AMZN. I want to buy so I make sure the "buy" option is checked. Then I click trade.
(click to show/hide)

Now I can go to my portfolio in the trade client and view my trades. By clicking a trade the client asks the server what the current value of AMZN is, and gets it, does the calculations, and calculates the value of the stock based on price and shares owned.

One week later:


Amazon (AMZN) has gone up, but is starting to tinker down a bit. I go into the portfolio, click the AMZN trade. I enter in the number of shares I want to sell seeing as I have already made a profit, and click the "Sell" button.
(click to show/hide)

Now I want to put the profits to use in the Opticraft market to buy some coal. I go in-game and type /sm withdraw 10,000. Server verifies I have the account, and the money, and then subtracts that money from my stock exchange account and the plugin adds the money to my opticraft balance.



This is a huge idea, and a huge implementation, and perhaps a smaller version of this could be made, but this would add some realism to Opticraft being as the stock market would grab stock values from the real market.



Best griefer name ^



Spyow

  • Hero Member
  • **
  • Posts: 692
    • View Profile
    • Opticraft! :D
Re: Stock Market!
« Reply #1 on: October 22, 2012, 09:31:00 pm »
So, each and everyone of us has to install this app? :/

Morrison1996

  • I am the spawn of 2 worlds. I AM SlenderBrine.
  • Sr. Member
  • **
  • Posts: 335
  • Former moderator
    • View Profile
Re: Stock Market!
« Reply #2 on: October 22, 2012, 09:46:42 pm »
I haven't read the post but I'm just saying your timing is not very good for this kind of heavy plugin.
1. your suggesting it on the week of a big update
2. opti already has a large list of things to update/ make
3. the brief scanning that i did of this seems it would need a lot of code.
similar to the bank suggestion it would be cool at first but few people would have sustained interest in it.



JakeTheSnake888

  • Jr. Member
  • *
  • Posts: 52
  • SMP Trusted
    • View Profile
Re: Stock Market!
« Reply #3 on: October 22, 2012, 10:16:40 pm »
im just really confused on what he just said lol

NathanialJones

  • Full Member
  • *
  • Posts: 137
  • SMP Builder and cool guy extrodinare!
    • View Profile
Re: Stock Market!
« Reply #4 on: October 22, 2012, 10:18:50 pm »
Lots of words :o but seriously this could be done but it would take a lot of effort and time. I would cool to have a stock market though
About posts, how do you even post a post?



Chief149

  • Hero Member
  • **
  • Posts: 646
  • Oppan Gangnam Style
    • View Profile
Re: Stock Market!
« Reply #5 on: October 22, 2012, 11:24:36 pm »
So, each and everyone of us has to install this app? :/

Nope. Just a simple exe that you run. No installation, and only those who wanted to participate would have to download and run the app.

Also it probably wouldn't be too hard to code. Only thing is I know absolutely nothing about networking in Java. Hell, I barely know how to do networking sending/receiving in .NET or C++



Best griefer name ^



theacp127

  • Newbie
  • *
  • Posts: 47
  • I'm trusted. Trust me. Opticraft does.
    • View Profile
Re: Stock Market!
« Reply #6 on: October 22, 2012, 11:56:51 pm »
This is just too complicated for many of the players on Opticraft. You have to remember that about 80%+ are only about 11 or 12 years old. Many of them most likely don't even know what stocks are or how to trade them.

bigbeno37

  • Sr. Member
  • **
  • Posts: 318
  • We are all born with a purpose in life
    • View Profile
Re: Stock Market!
« Reply #7 on: October 23, 2012, 12:02:35 am »
Okay, so long as you are familar with technical stuff, this post should make sense. However, why must it be a client plugin? I  know that we could have the buttons and all, but couldn't we just have a command such as '/stock register' or '/stock login'? That way we wouldn't need to download that plugin and essentially EVERYONE gets access to it.

BTW, I looooove the idea, but god, that would take an immense amount of code, trust me. I have delved into Java before.


"We are all born on this planet with a purpose in life," This quote keeps me going during the day, always trying to find that answer.

Chief149

  • Hero Member
  • **
  • Posts: 646
  • Oppan Gangnam Style
    • View Profile
Re: Stock Market!
« Reply #8 on: October 23, 2012, 04:07:45 am »
It wouldn't be a client mod. It would be a small executable file. The reason for it is to keep the majority of processing away from the Minecraft Main thread and to keep things tidy. Plus it would be easier to incorporate a tutorial into its own application about trading.

Plus then the exchange server itself could be written in C++ or C# instead of shitty java which is a lot more inefficient. Although C# is also somewhat inefficient due to the fact that it and java are managed code, C++ would still work great as it is unmanaged and compiled into native binary making it faster and more efficient.
« Last Edit: October 23, 2012, 04:10:22 am by Chief149 »



Best griefer name ^



bigbeno37

  • Sr. Member
  • **
  • Posts: 318
  • We are all born with a purpose in life
    • View Profile
Re: Stock Market!
« Reply #9 on: October 23, 2012, 04:56:58 am »
Ah, okay. I see what you mean now. So, who would essentially 'control' the stock market? Optical? The Admins?


"We are all born on this planet with a purpose in life," This quote keeps me going during the day, always trying to find that answer.

☣2crzy4uall☣

  • Professional Redstoner
  • Champion Member
  • ***
  • Posts: 1434
    • View Profile
Re: Stock Market!
« Reply #10 on: October 23, 2012, 06:04:03 am »
Entertaining idea, but having an app on the user end wouldnt take any of the load off of the actual server, seeing as how the trade server has to be hosted by Optical anyway. Also you wouldnt want everyone calculating the stocks on their own end.... someone would screw with it for sure, anyhoo doesnt really seem like an Opticraft kinda thing, but interesting idea!


raul7legend

  • Israeli Operator
  • Champion Member
  • ***
  • Posts: 1977
    • View Profile
Re: Stock Market!
« Reply #11 on: October 23, 2012, 06:04:11 am »
It's a pretty good idea but the problem is that we aren't an economy sever and we don't intend to be, so I'm pretty sure optical won't bother implementing this.

Pugabyte

  • Sr. Member
  • **
  • Posts: 433
  • Haider
    • View Profile
Re: Stock Market!
« Reply #12 on: October 23, 2012, 08:01:58 pm »
No clue abboout just about everything said on here. lol. if my idea ofwhat u mean by stock market is correct, then it would be pretty cool on some servers, but i think it just dosnt fit the setting of this server.

NathanialJones

  • Full Member
  • *
  • Posts: 137
  • SMP Builder and cool guy extrodinare!
    • View Profile
Re: Stock Market!
« Reply #13 on: October 24, 2012, 12:28:54 am »
This is just too complicated for many of the players on Opticraft. You have to remember that about 80%+ are only about 11 or 12 years old. Many of them most likely don't even know what stocks are or how to trade them.
I am twelve and actually understood everything he said + know a nice big chunk about politics and the economy, then again I know the most about that in my school. Anyway epic idea, probealy won't be implemented, but if any coders/ moders read this it's a great plugin idea
About posts, how do you even post a post?



Chief149

  • Hero Member
  • **
  • Posts: 646
  • Oppan Gangnam Style
    • View Profile
Re: Stock Market!
« Reply #14 on: October 24, 2012, 12:44:12 am »
Entertaining idea, but having an app on the user end wouldnt take any of the load off of the actual server, seeing as how the trade server has to be hosted by Optical anyway. Also you wouldnt want everyone calculating the stocks on their own end.... someone would screw with it for sure, anyhoo doesnt really seem like an Opticraft kinda thing, but interesting idea!

stock calculation is server-sided. Having a separate server app means a separate thread, and possibly even a separate box meaning it then puts no load on the main java thread.



Best griefer name ^