Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
hzqst committed Jul 21, 2024
1 parent d3a3c76 commit 7585a09
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion CGANode/info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -844,8 +844,15 @@ void GetCardsRecvMsg(const Nan::FunctionCallbackInfo<v8::Value>& info)
Local<Array> msgs = Array::New(isolate);
for (size_t j = 0; j < 10; ++j)
{
msgs->Set(context, j, Nan::New(myinfo.msgs[j]).ToLocalChecked());
Local<Object> payload = Object::New(isolate);

payload->Set(context, String::NewFromUtf8(isolate, "state").ToLocalChecked(), Integer::New(isolate, myinfo.msgs[j].state));
payload->Set(context, String::NewFromUtf8(isolate, "date").ToLocalChecked(), Nan::New(myinfo.msgs[j].date).ToLocalChecked());
payload->Set(context, String::NewFromUtf8(isolate, "msg").ToLocalChecked(), Nan::New(myinfo.msgs[j].msg).ToLocalChecked());

msgs->Set(context, j, payload);
}

obj->Set(context, String::NewFromUtf8(isolate, "msgs").ToLocalChecked(), msgs);

arr->Set(context, i, obj);
Expand Down

0 comments on commit 7585a09

Please sign in to comment.