File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Game Development and the fly likes HELP Need to convet code to be non static (I believe) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Game Development
Bookmark "HELP Need to convet code to be non static (I believe)" Watch "HELP Need to convet code to be non static (I believe)" New topic
Author

HELP Need to convet code to be non static (I believe)

Jon Janouch
Greenhorn

Joined: Oct 22, 2009
Posts: 3
Ok, I don't know if anyone can help me here, but I have been using these forums for help on my quest to create a private server of a game called runescape.
Ok basically I know what needs to be fixed but I do not know how to go about doing it. When 2 players access my shops at a different time the first person to open a shop ends up being switched into the one the second person opened up, now I believe this is do too the code is static for people using the openshop (I believe thats how i would say that), and it needs to be non static (I believe this is the problem). So if anyone could help that would be appreciated



Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 31062
    
232

Jon,
Welcome to JavaRanch! I added code tags to make the post easier to read.

I don't see any statics in your code. What are you trying to get rid of?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Jon Janouch
Greenhorn

Joined: Oct 22, 2009
Posts: 3
ok, we'll I was following a guide on how to add shops into my server and on there someone said that the reason when two ip access the shops on the server and it switches to show the same shop for the is because it is static, there is more coding involved I'll post it and see if maybe I just posted the wrong code, that was where I thought the problem was because it's the shop handler.














This is all the code involved in the shops
Here is the link of the guide I followed http://www.rune-server.org/showthread.php?t=184826&highlight=z508+shop
I didnt repost shop handler because I felt bad for posting all this code as it is

[Edit]Add line breaks because these long lines "fall off" the edge of my screen" CR[/edit]
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40052
    
  28
too difficult for "beginning". Moving to our games forum.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40052
    
  28
Not sure whether anybody here will be familiar with your problem, I am afraid.
Where did you get that code? The public access on those arrays looks very weird.
Jon Janouch
Greenhorn

Joined: Oct 22, 2009
Posts: 3
umm, what do you mean about look weird, They are not trying to access each other, they are calling a pawn other files within the game files, I don't know I'll try to explain the problem and maybe someone will understand, I have 5 shops shops on my server, and we'll say I got to open we'll call it the magic shop, I open it, and then you go and say open the archer shop, we'll I'm still viewing the magic shop once I go to buy an item it switches me to the range shop and buys the items that is within the archer shop. I guess this is the best I can explain it.
 
jQuery in Action, 2nd edition
 
subject: HELP Need to convet code to be non static (I believe)