// Token: 0x06001834 RID: 6196 RVA: 0x00088FEC File Offset: 0x000873EC
        public void open(uint ip, ushort port, ESecurityMode security)
        {
            if (this.isHosting)
            {
                return;
            }
            EServerMode eServerMode = EServerMode.eServerModeInvalid;

            if (security != ESecurityMode.LAN)
            {
                if (security != ESecurityMode.SECURE)
                {
                    if (security == ESecurityMode.INSECURE)
                    {
                        eServerMode = EServerMode.eServerModeAuthentication;
                    }
                }
                else
                {
                    eServerMode = EServerMode.eServerModeAuthenticationAndSecure;
                }
            }
            else
            {
                eServerMode = EServerMode.eServerModeNoAuthentication;
            }
            if (!GameServer.Init(ip, port + 2, port, port + 1, eServerMode, "1.0.0.0"))
            {
                throw new Exception("GameServer API initialization failed!");
            }
            SteamGameServer.SetDedicatedServer(this.appInfo.isDedicated);
            SteamGameServer.SetGameDescription(this.appInfo.name);
            SteamGameServer.SetProduct(this.appInfo.name);
            SteamGameServer.SetModDir(this.appInfo.name);
            SteamGameServer.LogOnAnonymous();
            SteamGameServer.EnableHeartbeats(true);
            this.isHosting = true;
        }
示例#2
0
 public static byte[] GetBytes(this ESecurityMode t)
 {
     return(BitConverter.GetBytes((ushort)t));
 }