Bạn đang xem: Rmi for android
Networking is a whole area of programming I have yet to lớn enter so I have sầu been finding it quite hard lớn decide how exactly to pull it off. In general, I felt that the correct way for it khổng lồ work would be to lớn have sầu a server phầm mềm with all the Monopoly game code và then phầm mềm client with just a GUI with remote method calls.
Is RMI going khổng lồ be too complex for this project or is it the best way to lớn proceed? Have sầu you any suggestions or tips for me?
Update: This game is going khổng lồ be 100% Java. So no worries about clients needing to lớn have sầu Java installed. Also, it would be great to lớn get some tips on using RXiaoMi MI.
java networking rngươi
edited Jun 19 "10 at 18:02
asked Jun 19 "10 at 16:25
3,99366 gold badges3131 silver badges4343 bronze badges
Add a comment |
2 Answers 2
Active Oldest Votes
RMI is not a complex thing, it"s the opposite.
Xem thêm: Tìm Hiểu Về Xe Cơ Giới Là Gì ? Xe Cơ Giới Là Gì
It allows you to develop your game protocol without caring about having Message objects going between VPS and clients with long if chains to lớn check which kind of message it is và vị whatever is required.
What you can actually vày with RXiaoMi MI is lớn have sầu a centralized object (on the server) on which you directly Gọi methods from clients like iWantToMoveThere(position) or iWantToBuyLand(where) and so on. This simplifies the protocol while putting some overhead that you would have sầu in any case since I discourage you from implementing a binary procotol. A XML or a serialized Java one would be a good compromise since you don"t really need realtime for a game lượt thích this one.
Xem thêm: cung hoàng đạo hnay
Another advantage of RXiaoMI is that you will easily manage a master server on which many game servers may attach khổng lồ give players the opportunity lớn play in them, & also many other little things lượt thích managing a separated lobby or so on.
Just as direct experience: I used RXiaoMI lớn manage a server that allowed developers khổng lồ publish their own game plugins allowing players lớn automatically connect khổng lồ the hệ thống và download the content to be able to lớn play. Everything was handled by RXiaoMI except for the fact that I needed a backward TCP.. connection to lớn be able khổng lồ handle asynchronous events whenever I needed. The whole source code was just ~1k lines in a bunch of 7-8 classes