forked from ddnet/ddnet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move
CHostLookup
to separate compilation unit
The host lookup job and the engine interface are independent so they are moved to separate files. The include of `engine.h` in `client.h` is therefore unnecessary and other includes also had to be adjusted because of this. The variable `m_VersionServeraddr` is unused and therefore removed. The host lookup job is currently not used on the client side.
- Loading branch information
Showing
8 changed files
with
51 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */ | ||
/* If you are missing that file, acquire a complete release at teeworlds.com. */ | ||
|
||
#include "host_lookup.h" | ||
|
||
#include <base/system.h> | ||
|
||
CHostLookup::CHostLookup() = default; | ||
|
||
CHostLookup::CHostLookup(const char *pHostname, int Nettype) | ||
{ | ||
str_copy(m_aHostname, pHostname); | ||
m_Nettype = Nettype; | ||
} | ||
|
||
void CHostLookup::Run() | ||
{ | ||
m_Result = net_host_lookup(m_aHostname, &m_Addr, m_Nettype); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */ | ||
/* If you are missing that file, acquire a complete release at teeworlds.com. */ | ||
#ifndef ENGINE_SHARED_HOST_LOOKUP_H | ||
#define ENGINE_SHARED_HOST_LOOKUP_H | ||
|
||
#include <base/system.h> | ||
|
||
#include <engine/shared/jobs.h> | ||
|
||
class CHostLookup : public IJob | ||
{ | ||
private: | ||
void Run() override; | ||
|
||
public: | ||
CHostLookup(); | ||
CHostLookup(const char *pHostname, int Nettype); | ||
|
||
int m_Result; | ||
char m_aHostname[128]; | ||
int m_Nettype; | ||
NETADDR m_Addr; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters