#cloudcode binding issues

1 messages · Page 1 of 1 (latest)

snow forge
#

after serious consideration, i decided to move everything backend related to cloudcode , which i havent done before, because its more secured if player data processing is on cloudcode side right?
however, when im trying to regenerate bindings from CCMR, i encounter this error

#

this is one of the module thats successfully generated its binding , the whole project(module) only consists of one class

#

however this one cannot compile and generate bindings

#

so , i want to ask is there any requirements to generate bindings?

#

like is there only allow single class? or single cs files?

#

this is all of the function inside the module project

wooden berry
#

Your code is getting cut off in those screen shots. Seems like there is an object that it doesn't know how to bind

snow forge
#

this is all existing scripts inside my module project

#

the error said unprocessable schema exception , but what schema tho?

wooden berry
#

I would think that its from SaveGameData(). Try making it a Dictionary<string,object> or sending the object as a json string

snow forge
# wooden berry I would think that its from SaveGameData(). Try making it a Dictionary<string,ob...

in fact i just commented out the "savegamedata"

now the only exposed function in my project is

public async Task SavePlayerData(IExecutionContext context, IGameApiClient gameApiClient, DataAccessibility access, string key, object value)```

```cs
public async Task SaveSetPlayerData(IExecutionContext context, IGameApiClient gameApiClient, DataAccessibility access, Dictionary<string,object> data)```

```cs
public async Task SaveMultiPlayerData(IExecutionContext context, IGameApiClient gameApiClient, Dictionary<string, object> data)```
#

and after i commented them all out, it works

#

as there are no exposed function left

#

i doubt if using "object" type is not even acceptable at first place here....

#

yes, problem solved, cloud code does not accept object type as parameter

#

at least for its exposed functions

#

i changed object type to int type and it worked

#

lets hope it accept generic type <T>

wooden berry
#

I doubt generic types will work either. Its gotta know how to serialize it somehow

snow forge
#

so instead of object, string is the only option here i guess, as it can reach out to as many types as possible

#

just serialize stuff into json string first and call the binding function to save