mirror of
https://github.com/FAUSheppy/skillbird-sourcemod
synced 2025-12-06 07:01:38 +01:00
correctly determine servername
This commit is contained in:
@@ -70,9 +70,12 @@ public APLRes:AskPluginLoad2(Handle:myself, bool:late, String:error[], err_max){
|
||||
|
||||
public OnPluginStart(){
|
||||
|
||||
/* get and verify server name for output file */
|
||||
char server[SNAME_LEN];
|
||||
ServerName(server, sizeof(server));
|
||||
logfile = OpenFile(server,"at",false,NULL_STRING);
|
||||
if strlen(server) < 1:
|
||||
return ThrowNativeError(SP_ERROR_NATIVE, "Computed Invalid Servername '%s'", server)
|
||||
|
||||
/* inial line */
|
||||
LogToOpenFile(logfile,"0x42,start");
|
||||
|
||||
@@ -16,7 +16,7 @@ public void MapName(char[] prefix, char[] buf, int buflen){
|
||||
public void ServerName(char[] buf,int buflen){
|
||||
new String:sname[SNAME_LEN];
|
||||
ConVar servername = FindConVar("hostname");
|
||||
servername.GetString("sname",SNAME_LEN);
|
||||
servername.GetString(sname,SNAME_LEN);
|
||||
ReplaceString(sname,SNAME_LEN," ","");
|
||||
ReplaceString(sname,SNAME_LEN,"[","");
|
||||
ReplaceString(sname,SNAME_LEN,"]","");
|
||||
|
||||
Reference in New Issue
Block a user