示例#1
0
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);
	}
}
示例#2
0
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);
	}
}
示例#3
0
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);
}
示例#4
0
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);
}
示例#5
0
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);
}