(0e354918b) Fixed Unicode on the server list
This commit is contained in:
committed by
Joonas Rikkonen
parent
4a8609a3d2
commit
682b57a1c3
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace SteamNative
|
||||
{
|
||||
@@ -256,13 +257,21 @@ namespace SteamNative
|
||||
// void
|
||||
public void SetKeyValue( string pKey /*const char **/, string pValue /*const char **/ )
|
||||
{
|
||||
platform.ISteamGameServer_SetKeyValue( pKey, pValue );
|
||||
byte[] bytesKey = Encoding.UTF8.GetBytes(pKey);
|
||||
GCHandle handleKey = GCHandle.Alloc(bytesKey, GCHandleType.Pinned);
|
||||
byte[] bytesValue = Encoding.UTF8.GetBytes(pValue);
|
||||
GCHandle handleValue = GCHandle.Alloc(bytesKey, GCHandleType.Pinned);
|
||||
platform.ISteamGameServer_SetKeyValue( handleKey.AddrOfPinnedObject(), handleValue.AddrOfPinnedObject() );
|
||||
handleKey.Free(); handleValue.Free();
|
||||
}
|
||||
|
||||
// void
|
||||
public void SetMapName( string pszMapName /*const char **/ )
|
||||
{
|
||||
platform.ISteamGameServer_SetMapName( pszMapName );
|
||||
byte[] bytes = Encoding.UTF8.GetBytes(pszMapName);
|
||||
GCHandle handle = GCHandle.Alloc(bytes, GCHandleType.Pinned);
|
||||
platform.ISteamGameServer_SetMapName( handle.AddrOfPinnedObject() );
|
||||
handle.Free();
|
||||
}
|
||||
|
||||
// void
|
||||
@@ -298,7 +307,10 @@ namespace SteamNative
|
||||
// void
|
||||
public void SetServerName( string pszServerName /*const char **/ )
|
||||
{
|
||||
platform.ISteamGameServer_SetServerName( pszServerName );
|
||||
byte[] bytes = Encoding.UTF8.GetBytes(pszServerName);
|
||||
GCHandle handle = GCHandle.Alloc(bytes, GCHandleType.Pinned);
|
||||
platform.ISteamGameServer_SetServerName( handle.AddrOfPinnedObject() );
|
||||
handle.Free();
|
||||
}
|
||||
|
||||
// void
|
||||
|
||||
Reference in New Issue
Block a user