Skip to content

Commit

Permalink
Merge branch 'UTF8ToString'
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrown-ultrabit committed Nov 22, 2024
2 parents e701e25 + ef2f382 commit 812a60a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions com.kongregate.kongregate-web/Runtime/KongregateWeb.jslib
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ var LibraryKongregate = {
},

$parseJSON: function (stringPointer) {
var stringValue = Pointer_stringify(stringPointer);
var stringValue = UTF8ToString(stringPointer);
if (stringValue.trim()) {
return JSON.parse(stringValue);
}
},

initKongregateAPI: function (gameObjectName) {
// Save the name of the Unity GameObject that we will send messages to.
instance.gameObjectName = Pointer_stringify(gameObjectName);
instance.gameObjectName = UTF8ToString(gameObjectName);

if (typeof kongregateAPI === 'undefined' || kongregateAPI === null) {
instance.sendMessage('OnInitFailed');
Expand Down Expand Up @@ -86,7 +86,7 @@ var LibraryKongregate = {
},

privateMessage: function (message) {
instance.kongregate.services.privateMessage(Pointer_stringify(message));
instance.kongregate.services.privateMessage(UTF8ToString(message));
},

resizeGame: function (width, height) {
Expand Down Expand Up @@ -121,7 +121,7 @@ var LibraryKongregate = {

requestUserItemList: function (username) {
// TODO: Do we need to explicitly handle if `username` is null?
username = Pointer_stringify(username);
username = UTF8ToString(username);
instance.kongregate.mtx.requestUserItemList(username, function (result) {
instance.sendMessage('OnUserItems', JSON.stringify(result));
});
Expand All @@ -136,7 +136,7 @@ var LibraryKongregate = {
},

submitStats: function (statistic_name, value) {
instance.kongregate.stats.submit(Pointer_stringify(statistic_name), value);
instance.kongregate.stats.submit(UTF8ToString(statistic_name), value);
},
};

Expand Down

0 comments on commit 812a60a

Please sign in to comment.