void push_game_buffer(const FunctionCallbackInfo<Value>& args) { if (args.Length() != 1) { LOG_ERROR("push_game_buffer args error, length: %d\n", args.Length()); return; } Block_Buffer *buf= unwrap_buffer(args[0]->ToObject(args.GetIsolate()->GetCurrentContext()).ToLocalChecked()); if (buf) { GAME_MANAGER->push_block_buffer(buf); } }
void push_master_client_buffer(const FunctionCallbackInfo<Value>& args) { if (args.Length() != 2) { LOG_ERROR("push_master_client_buffer args error, length: %d\n", args.Length()); return; } int cid = args[0]->Int32Value(args.GetIsolate()->GetCurrentContext()).FromMaybe(0); Block_Buffer *buf= unwrap_buffer(args[1]->ToObject(args.GetIsolate()->GetCurrentContext()).ToLocalChecked()); if (buf) { MASTER_GATE_SERVER->push_block(cid, buf); } }
void send_master_buffer_to_db(const FunctionCallbackInfo<Value>& args) { if (args.Length() != 1) { LOG_ERROR("send_master_buffer_to_db args error, length: %d\n", args.Length()); return; } Block_Buffer *buf = unwrap_buffer(args[0]->ToObject(args.GetIsolate()->GetCurrentContext()).ToLocalChecked()); if (!buf) { return; } MASTER_MANAGER->send_to_db(*buf); }
void game_player_respond_success_result(const FunctionCallbackInfo<Value>& args) { if (args.Length() != 2) { LOG_ERROR("respond_success_result args error, length: %d\n", args.Length()); return; } Game_Player *player = unwrap_game_player(args.Holder()); if (!player) { return; } int msg_id = args[0]->Int32Value(args.GetIsolate()->GetCurrentContext()).FromMaybe(0); Block_Buffer *buf = unwrap_buffer(args[1]->ToObject(args.GetIsolate()->GetCurrentContext()).ToLocalChecked()); player->respond_success_result(msg_id, buf); }
void sync_data_to_game(const FunctionCallbackInfo<Value>& args) { if (args.Length() != 2) { LOG_ERROR("sync_data_to_game args error, length: %d\n", args.Length()); return; } Master_Player *player = unwrap_master_player(args.Holder()); if (!player) { return; } int msg_id = args[0]->Int32Value(args.GetIsolate()->GetCurrentContext()).FromMaybe(0); Block_Buffer *buf = unwrap_buffer(args[1]->ToObject(args.GetIsolate()->GetCurrentContext()).ToLocalChecked()); player->sync_data_to_game(msg_id, buf); }