Exemplo n.º 1
0
    // Use this for initialization
    void Awake()
    {
        // We are a singleton
        if (Instance != null)
        {
            Destroy(gameObject);
            return;
        }
        else
        {
            Instance = this;
        }

        if (applicationId == -1)
        {
            applicationId = Network.Utils.GetIPBasedApplicationId();
        }

        Client            = new ClientNetworking(socketSettings, applicationId);
        Client.OnConnect += OnConnect;
        onPlayerFullPacketListenerHandle = Client.AddListener <PlayerFullPacket>(OnPlayerFullPacket);

        worldEntityManager = new WorldEntityManager(Client);
        npcManager         = new ClientNPCManager(Client, worldEntityManager);
        // don't set proxy manager up yet, as we want to wait for first player packet
        // as that is for *us* rather than proxy players

        Client.Connect();
    }
Exemplo n.º 2
0
 private void button1_Click(object sender, EventArgs e)
 {
     try {
         networkApi.Connect();
         label1.Text = "Connected...";
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Exemplo n.º 3
0
 private void Page_Loaded(object sender, RoutedEventArgs e)
 {
     LoginMenuPlayer(true, null);
     Task.Run(() => ClientNetworking.Connect());
     Task.Run(() => MainClientWorker.CheckSoundEffects());
 }