freeciv-web icon indicating copy to clipboard operation
freeciv-web copied to clipboard

CMA in Freeciv-web

Open andreasrosdal opened this issue 2 years ago • 8 comments

Implement CMA in Freeciv-web.

Screenshot_20220729-083958_Chrome

https://github.com/Lexxie9952/fcw.org-server/commit/caf342e5389cc4ef5663c684cac36c30bf25023a#diff-084184354ca98a010578f7d996d79bfbca0509e9a889e1e69535bc65e2bf1d79

https://github.com/Lexxie9952/fcw.org-server/blob/dev/freeciv-web/src/main/webapp/javascript/cma.js

https://github.com/Lexxie9952/fcw.org-server/blob/dev/freeciv/freeciv/common/networking/packets.def#L763

@cazfi Can you please help implement support for CMA for Freeciv-web in the Freeciv C server?

andreasrosdal avatar Jul 29 '22 06:07 andreasrosdal

What are you missing? I haven't tested server-side CMA much.

cazfi avatar Jul 29 '22 10:07 cazfi

The server side changes in this needs to be cleaned up and included in the Freeciv C server: https://github.com/Lexxie9952/fcw.org-server/commit/caf342e5389cc4ef5663c684cac36c30bf25023a#diff-084184354ca98a010578f7d996d79bfbca0509e9a889e1e69535bc65e2bf1d79

andreasrosdal avatar Jul 29 '22 14:07 andreasrosdal

That commit seems to be mostly about backporting server-side CMA + completely unrelated changes.

Some of those network protocol parts have been dropped from freeciv since, as nobody was using them. Maybe we need to put them back.

cazfi avatar Jul 29 '22 14:07 cazfi

First server side change -> https://osdn.net/projects/freeciv/ticket/45268

cazfi avatar Jul 29 '22 15:07 cazfi

Yes, Freeciv-web needs a server side CMA. It should be fast and have a very simple API in the normal network packets system. If you will please add server side CMA to the Freeciv C server, then I can implement in Freeciv-web.

andreasrosdal avatar Jul 30 '22 18:07 andreasrosdal

The latter part is coming in -> https://osdn.net/projects/freeciv/ticket/45485

Most probably I can implement it before the end of week.

cazfi avatar Aug 31 '22 00:08 cazfi

Very nice! Also: www.fciv.net has been updated to the same version as freeciv/freeciv-web - so these are both compatible and running the latest Freeciv C server.

andreasrosdal avatar Aug 31 '22 18:08 andreasrosdal

The latter part is coming in -> https://osdn.net/projects/freeciv/ticket/45485

The difference in the implementation there compared to one you linked is that I went for separate packets for setting cm parameter and clearing it, to avoid sending some dummy parameter data when one is about to remove the parameter.

cazfi avatar Sep 07 '22 15:09 cazfi

Do you have anything on the web-client side to share (make a PR about)?

cazfi avatar Oct 21 '22 16:10 cazfi

Here's a simple CMA for FCIV.NET https://github.com/fciv-net/fciv-net/commit/e2da9ce69b284e243f80be516cd63d07a6329f55

This could be modified to be usable in Freeciv-web.

andreasrosdal avatar Dec 04 '22 17:12 andreasrosdal

Thanks. Started working on a port.

cazfi avatar Dec 06 '22 08:12 cazfi