Created the wmud_player_dup() function
This function duplicates a wmudPlayer struct. Signed-off-by: Gergely POLONKAI <polesz@w00d5t0ck.info>
This commit is contained in:
parent
b91ad8d87f
commit
4f601bb3dd
@ -59,6 +59,23 @@ wmud_player_exists(gchar *player_name)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wmudPlayer *
|
||||||
|
wmud_player_dup(wmudPlayer *player)
|
||||||
|
{
|
||||||
|
wmudPlayer *new_player;
|
||||||
|
|
||||||
|
if (!player)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
new_player = g_new0(wmudPlayer, 1);
|
||||||
|
new_player->id = player->id;
|
||||||
|
new_player->player_name = g_strdup(player->player_name);
|
||||||
|
new_player->cpassword = g_strdup(player->cpassword);
|
||||||
|
new_player->email = g_strdup(player->email);
|
||||||
|
|
||||||
|
return new_player;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
wmud_player_free(wmudPlayer **player)
|
wmud_player_free(wmudPlayer **player)
|
||||||
{
|
{
|
||||||
|
@ -28,5 +28,6 @@ extern GSList *players;
|
|||||||
gboolean wmud_player_auth(wmudClient *client);
|
gboolean wmud_player_auth(wmudClient *client);
|
||||||
wmudPlayer *wmud_player_exists(gchar *player_name);
|
wmudPlayer *wmud_player_exists(gchar *player_name);
|
||||||
void wmud_player_free(wmudPlayer **player);
|
void wmud_player_free(wmudPlayer **player);
|
||||||
|
wmudPlayer *wmud_player_dup(wmudPlayer *player);
|
||||||
|
|
||||||
#endif /* __WMUD_PLAYERS_H__ */
|
#endif /* __WMUD_PLAYERS_H__ */
|
||||||
|
Loading…
Reference in New Issue
Block a user