Example #1
0
        void Test_P2P()
        {
            SteamP2P.SetOnP2PSessionRequest(OnP2PSessionRequest);
            SteamP2P.SetOnP2PSessionConnectFail(OnP2PSessionConnectFail);

            while (true)
            {
                //Networking.SendString(new SteamPlayer(SteamCore.PlayerId()), "Hello");
                Networking.SendString(new SteamPlayer(76561198060676433), "Hello to 76561198060676433");
                Networking.SendString(new SteamPlayer(76561198201081585), "Hello to 76561198201081585");

                var bytes = File.ReadAllBytes("Content/Maps/Beset.m3n");
                var s     = new MessageGameState(0, bytes).MakeFullMessage().ToString();
                s = s.Substring(0, 100);
                Networking.SendString(new SteamPlayer(76561198060676433), s);

                while (SteamP2P.MessageAvailable())
                {
                    var msg = Networking.ReceiveString();
                    Console.WriteLine("got message! {0}", msg);
                }
            }
        }
Example #2
0
 public void AcceptSteamPlayer(SteamPlayer player)
 {
     Networking.SendString(player, "Implicit connection acceptance.");
 }
Example #3
0
 public SteamServerConnection() : base(new SteamPlayer(Program.SteamServer))
 {
     Networking.SendString(User, "Implicit connection acceptance.");
 }
Example #4
0
 public override void Send(string message)
 {
     Networking.SendString(User, message);
 }