void get_game_player_sync_buffer(const FunctionCallbackInfo<Value>& args){ Block_Buffer *buf = MASTER_MANAGER->pop_master_player_sync_data(); if (buf) { args.GetReturnValue().Set(wrap_buffer(args.GetIsolate(), buf)); } else { //设置对象为空 args.GetReturnValue().SetNull(); } }
void pop_sync_master_data_buffer(const FunctionCallbackInfo<Value>& args) { Block_Buffer *buf = GAME_MANAGER->pop_sync_master_data_buffer(); if (buf) { args.GetReturnValue().Set(wrap_buffer(args.GetIsolate(), buf)); } else { //设置对象为空 args.GetReturnValue().SetNull(); } }
void pop_game_buffer(const FunctionCallbackInfo<Value>& args) { Block_Buffer *buf = GAME_MANAGER->pop_block_buffer(); if (buf) { buf->reset(); args.GetReturnValue().Set(wrap_buffer(args.GetIsolate(), buf)); } else { //设置对象为空 args.GetReturnValue().SetNull(); } }
void get_game_player_save_data_buffer(const FunctionCallbackInfo<Value>& args) { Game_Player *player = unwrap_game_player(args.Holder()); if (!player) { args.GetReturnValue().SetNull(); return; } Block_Buffer *buf = player->save_player_data_buffer(); if (buf) { buf->reset(); args.GetReturnValue().Set(wrap_buffer(args.GetIsolate(), buf)); } else { //设置对象为空 args.GetReturnValue().SetNull(); } }
/* Add a (POS . LINE) pair to the ring, and rotate it. */ static void add_position_to_cache (struct buffer *b, Charbpos pos, EMACS_INT line) { Lisp_Object *ring = XVECTOR_DATA (LINE_NUMBER_RING (b)); int i = LINE_NUMBER_RING_SIZE - 1; /* Set the last marker in the ring to point nowhere. */ if (CONSP (ring[i])) Fset_marker (XCAR (ring[i]), Qnil, Qnil); /* Rotate the ring... */ for (; i > 0; i--) ring[i] = ring[i - 1]; /* ...and update it. */ ring[0] = Fcons (Fset_marker (Fmake_marker (), make_fixnum (pos), wrap_buffer (b)), make_fixnum (line)); }