/* call-seq: * Player.new(player_id) -> Player object * * This method returns a player object from the given player id. */ static VALUE playerRecord_initialize(VALUE self, VALUE playerID) { VALUE obj; bz_PlayerRecord *curPlayerRecord = bz_getPlayerByIndex(FIX2INT(playerID)); bz_PlayerRecord *playerRecord; Data_Get_Struct(self, bz_PlayerRecord, playerRecord); playerRecord->playerID = curPlayerRecord->playerID; playerRecord->callsign = curPlayerRecord->callsign; playerRecord->email = curPlayerRecord->email; playerRecord->team = curPlayerRecord->team; memcpy(playerRecord->pos, curPlayerRecord->pos, sizeof(float) * 3); playerRecord->rot = curPlayerRecord->rot; playerRecord->ipAddress = curPlayerRecord->ipAddress; playerRecord->currentFlag = curPlayerRecord->currentFlag; playerRecord->flagHistory = curPlayerRecord->flagHistory; playerRecord->spawned = curPlayerRecord->spawned; playerRecord->verified = curPlayerRecord->verified; playerRecord->globalUser = curPlayerRecord->globalUser; playerRecord->admin = curPlayerRecord->admin; playerRecord->op = curPlayerRecord->op; playerRecord->groups = curPlayerRecord->groups; playerRecord->lag = curPlayerRecord->lag; playerRecord->wins = curPlayerRecord->wins; playerRecord->losses = curPlayerRecord->losses; playerRecord->teamKills = curPlayerRecord->teamKills; delete curPlayerRecord; return self; }