← Back to team overview

mugle-dev team mailing list archive

Re: GameEditBuilder

 

Somehow there are a lot of random things happening here and I am getting
really confused ;)
It will be difficult to explain these problems but let's give it a go.

I've tried to debug my code with Eclipse which after some initial struggle
worked fine. So I found that somehow in GameVersionServiceImpl.write() the
user I logged in with (matt@xxxxxxxxxxx) was always identified as a GUEST. I
figured that this was the reason I was never able to actually change any
objects on the server. So I tried to log in with other users and realised
that I was always logged in as a GUEST. This was the first thing that didn't
make sense. Remark: I was actually able to load the GameEdit form properly.

Then I added an anchor with a link to the GameEditBuilder for the test game
to different spots in the menu. Very strangely, these anchors didn't turn
up, even after a full clean of the project in Eclipse. I also realised
during debugging that somehow a reload of the page would not go through
MugleUiBuilder.buildToolsPanel(). This was the second thing that didn't make
sense.

I left Eclipse and went back to building the project with ant from the
command line which is probably the way to go. Now I do get to see these
anchors I have created. But when I open
http://127.0.0.1:8080/#!/test/test/+edit I get this message: The response
could not be deserialized

The code for loading the achievements is the following one:
        game.getAchievements(
                new AsyncCallback<Set<Achievement>> () {

            public void onFailure(Throwable error) {
                containerPanel.add(new Label(error.getMessage()));
            }

            public void onSuccess(Set<Achievement> result) {
                achievements = new ArrayList<Achievement>();
                achievements.addAll(result);
            }
        });

I will try on and see what I can make of this but maybe you have an idea
where these problems might come from, as strange as they are.



On Wed, May 18, 2011 at 9:19 PM, Prageeth Silva <prageethsilva@xxxxxxxxx>wrote:

> How can I find out the maximum allowed length of game name and description,
>> for example? I would like to restrict the textbox input accordingly.
>>
>
> As far as I remember, we have allowed any length on the backend, it's
> simply a string that already doesn't exist.
>
> When modifying the name or description of a game, do I need to check that
>> the string is a valid one (e.g. not an empty string) or is that going to
>> happen in the backend?
>>
>
> As to editing names and descriptions. Developers are not allowed to change
> the "name" (referring to the unique URL name given for a game, user,
> devteam, etc).
> However, the users are allowed to change their Full Name, and similar rules
> apply for games and dev teams. This means, potentially the description can
> be empty as far as the
> backend if concerned. Come to think of it, I'm not quite sure if this is
> the best option, but for now, I think the checking for empty strings should
> be done on client no matter what.
>
>
>> When modifying fields of model objects, is the backend going to check
>> whether the current user actually has the right to do so?
>>
>
> Yes, we have checks on the backend that actually checks read/write access
> of the current user. This applies to each object as a whole and also fields
> as well.
> For exmaple, a GUEST user has permission to edit his User object, as he/she
> should be able to modify their Full Name. But when saving the object back in
> the database,
> we allow only the Full Name (and other certain fields) to be
> updated/modified. All this happens in the backend and also returns an
> updated copy of the same object.
> And if a modification was discarded due to lack of write permission, this
> can be checked on the returned object.
>
> How can I best check whether the current user is allowed to see the game
>> edit view for a particular game?
>>
>
> There's no particular service method for this yet, but I think this is
> something important for all editable objects.
> I shall get started on this soon.
>
> To change a field of a model class in the datastore, is it correct to do
>> something like this:
>> gameVersion.setFullName("bla");
>> gameVersion.write(new AsyncCallback<GameVersion>() {
>>       ...
>> });
>>
>
> This seems correct to me.
>
>
>> Somehow the onSuccess method of my callback object is called but the value
>> in the datastore isn't changed. I login with the user matt, who appears to
>> be linked to devteam test and game test, and call the following URL to
>> display the game edit view (which at this moment only consists of a text box
>> for the name of the game):
>> http://127.0.0.1:8080/#!/test/test/+edit<http://127.0.0.1:8080/#%21/test/test/+edit>
>
>
>   I'll check on this as well.
>
>
>> Everytime I load this URL for the first time or hit the browser refresh
>> button, I receive the following very weird exception:
>>
>> Fc is null stack: Ic("test")@
>>> http://127.0.0.1:8080/mugle/129D7154D4CA62DF77704779CB590D6C.cache.html:1347Id("!/test/test/+edit",[object Object],[object Object])@
>>> http://127.0.0.1:8080/mugle/129D7154D4CA62DF77704779CB590D6C.cache.html:1356Fd([object Object],[object Object])@
>>> http://127.0.0.1:8080/mugle/129D7154D4CA62DF77704779CB590D6C.cache.html:1367Yb([object Object])@
>>> http://127.0.0.1:8080/mugle/129D7154D4CA62DF77704779CB590D6C.cache.html:1376RE([object Object],[object Object])@
>>> http://127.0.0.1:8080/mugle/129D7154D4CA62DF77704779CB590D6C.cache.html:1362Uq([object Object],[object Object])@
>>> http://127.0.0.1:8080/mugle/129D7154D4CA62DF77704779CB590D6C.cache.html:1227Ar([object XMLHttpRequest])@
>>> http://127.0.0.1:8080/mugle/129D7154D4CA62DF77704779CB590D6C.cache.html:1379([object Event])@
>>> http://127.0.0.1:8080/mugle/129D7154D4CA62DF77704779CB590D6C.cache.html:998Fl((function () {b.W(c);}),[object XMLHttpRequest],[object Arguments])@
>>> http://127.0.0.1:8080/mugle/129D7154D4CA62DF77704779CB590D6C.cache.html:818Il((function () {b.W(c);}),[object XMLHttpRequest],[object Arguments])@
>>> http://127.0.0.1:8080/mugle/129D7154D4CA62DF77704779CB590D6C.cache.html:1054([object Event])@
>>> http://127.0.0.1:8080/mugle/129D7154D4CA62DF77704779CB590D6C.cache.html:1053fileName:
>>> http://127.0.0.1:8080/mugle/129D7154D4CA62DF77704779CB590D6C.cache.htmllineNumber: 1347
>>>
>>
>> Has anyone seen this somewhere already? This doesn't happen if I move to a
>> different page first and then type the URL to edit the game into the browser
>> address bar and hit enter.
>>
>>
> I haven't seen this though. I have a feeling it's to do with the history
> token, best is to check with Scott.
>
> --
> *Prageeth Silva*
>

Follow ups

References