Tuesday, December 17, 2024

Re: Confused about RPC setup

In my car racing game, I do the logic on both client and server.  The player does the car race all in the browser, and at the end of the race, their inputs are sent to the server via GWT RPC, that then also runs the race logic, to make sure they didn't cheat.

GWT is fantastic for this.  The same code runs in both the client and the server.  Although, I have to be careful not to use things like floats, as they are floats in Java, but when compiled to JavaScript, they become doubles.

It's https://drift.team/ if interested.

On Tuesday, 17 December 2024 at 1:26:23 am UTC+11 Tim Macpherson wrote:
Using a js library in gwt requires writing a
a native JsInterop class. In my apps that's very small as the detailed operations with the library are written in js 
On Mon, Dec 16, 2024 at 6:25 AM, Leon
No, that's not a reason why you should go UI only. But it is also not relevant on whether it is or not. 
It's your own project, you can do with it whatever you want.
The only thing holding you back is not the software architecture. 
In the GWT ui part, there is no more java code after the gwt compilation.
 
All java code gets compiled into javascript & html. If you want to add another java library to the ui code, all java used in that library (and all dependencies in there) will need to be in the supported emulation library. (https://www.gwtproject.org/doc/latest/RefJreEmulation.html#Package_java_io)
Once that library has extra dependencies like awt or log4j, you are just screaming for trouble.

When you open a GWT application, all you have is static html + javascript content. Just like an ordinary html page. There is no access to server log files, or any other server resources after that (apart from gwt rpc calls, or any javascript library). 
GWT is not an application server, your UI compiled GWT code lives in the browser. 

And in my opinion, if you really want to use other javascript libraries from within GWT, then it does not make sense to use GWT. 
That's like hiring a German consultant to go shopping for French cheese.

On Mon, Dec 16, 2024 at 5:42 AM Neil Aggarwal <ne...@propfinancing.com> wrote:

I just thought of another reason to do the logic on the client side:

I am using a CDN from Cloudflare to speed up the user experience.

I defeat its benefits if I put the logic on the server.

 

Thank you,

 Neil

 

--

Neil Aggarwal, (972) 834-1565, http://www.propfinancing.com

We offer 30 year loans on single family houses!

--
You received this message because you are subscribed to a topic in the Google Groups "GWT Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-web-toolkit/phc0Ajr7HFY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-web-tool...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-web-toolkit/e6f0787faa985852e8781b17e9dfd98f%40mail.gmail.com.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-tool...@googlegroups.com.

To view this discussion visit

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-web-toolkit/6ec05216-14e8-4b3a-9180-070dd9935fe3n%40googlegroups.com.

No comments:

Post a Comment